diff --git a/algos/template/algo_template_create_tcl.m b/algos/template/algo_template_create_tcl.m new file mode 100644 index 0000000000000000000000000000000000000000..debfaa5f0a7bde553383549db13fb9bb8c34ff00 --- /dev/null +++ b/algos/template/algo_template_create_tcl.m @@ -0,0 +1,41 @@ +% This script will crate automatically +% the TCL files for building +% parameters, inputs and outputs trees, using SPC mds-matlab-structs +% functions (liked in a git submodule) +% +% it is assumed that the main algo_template_tp +% structure is already present in the base workspace +% +% if successfully executed the three generated TCL scripts: +% /tmp/<username>/template_tp.tcl +% /tmp/<username>/template_inbus.tcl +% /tmp/<username>/template_outbus.tcl +% can be executed by a MDSplus tree edit enabled user via: +% cat /tmp/<username>/template_tp.tcl | mdstcl +% and so on + +addpath ../../mds/mds-matlab-structs + +%% tunable parameters +tpsrc=Simulink.data.evalinGlobal('algo_template','algo_template_tp_tmpl').Value; +tpsrcpad=struct(); +tpsrcpad.template.params=tpsrc; +[status_out,struct_out_ala_mds,fname_out]=... + mds_create_nodes(tpsrcpad,'template_tp.tcl','scdds','value') +clear tpsrc tpsrcpad + +%% input bus +inbus=Simulink.data.evalinGlobal('algo_template','algo_template_inBus'); +inbussrc=Simulink.Bus.createMATLABStruct('inbus'); +inbussrcpad.template.inputs=inbussrc; +[status_out,struct_out_ala_mds,fname_out]=... + mds_create_nodes(inbussrcpad,'template_inbus.tcl','scdds','data','full_name','dim') +clear inbus inbussrc inbussrcpad + +%% output bus +outbus=Simulink.data.evalinGlobal('algo_template','algo_template_outBus'); +outbussrc=Simulink.Bus.createMATLABStruct('outbus'); +outbussrcpad.template.outputs=outbussrc; +[status_out,struct_out_ala_mds,fname_out]=... + mds_create_nodes(outbussrcpad,'template_outbus.tcl','scdds','data','full_name','dim') +clear outbus outbussrc outbussrcpad