expcode¶
[SCDDS - Simulink Control Development & Deployment Suite] Copyright SPC-EPFL Lausanne 2022. Distributed under the terms of the GNU Lesser General Public License, LGPL-3.0-only.
Class hierarchy: expcode¶
- class SCDDSclass_expcode¶
Superclass for SCDDS expcode object
- Main methods:
- .open: Open baseline .slx model
open(N): Open node N open(N,M): Open thread M of node N
.compile, compile(N), compile(N,M): Compile Simulink model for node N, thread M) .close_all: Close all Simulink block diagrams .build, build(N), build(N,M): Generate C code for node N, thread M .clean: Clean configured build folder .deploy, deploy(N), deploy(N,M): deploy object code for node N, thread M
.printinfo: Print information about components of this expcode .printtasks: Print configured tasks .printwavegens: Print configured wavegen signals
- Constructor Summary
- SCDDSclass_expcode(name, code)¶
Constructor
- Property Summary
- SCDBusdd_path¶
data dictionary path for common SCDBus objects
- algoddlist¶
list of data dictionaries at algorithm level
- algonamelist¶
List of loaded algorithm names
- algonameprefix¶
algorithms name prefix
- algoobjlist¶
list of loaded algorithm objects with configured inits
- algos¶
list of algorithms objects
- ddname¶
can be changed by derived classes
- ddpath¶
main expcode data dictionary save path
- definednodes¶
List of defined nodes at top expcode level
- exportedtps¶
list of tunable parameters variable to be exported
- fpinits¶
list of standard inits scripts
- loadverbose¶
Verbosity level of the loading (currently 0 or 1)
- maincode¶
Expcode number set by expcode container
- mainname¶
to be implemented by derived classes
- mainslxname¶
Top-level SLX name
- mdscontainer¶
container class for MDS+ interface objects
- modeltoactualize¶
name of the algorithm to actualize (‘all’ means all coonfigured)
- name¶
can not be changed by derived classes
- nodes¶
array of node properties structs
- status¶
Main properties
- taskcontainer¶
container class for generic init and term task objects
- Method Summary
- actualize(shot, varargin)¶
if a model name is given, operations will be performed only on it, otherwise they will be performed on all configured models
- build(varargin)¶
this method builds expcode threads invoking rtwbuild command first optional parameter is an array of nodes and second is an array of threads if no additional parameters are given, all expcode configured nodes and threads are built
- clean()¶
- compile(varargin)¶
- createmaindd()¶
create main data dictionary from scratch to ensure it exists
- getexportedtps()¶
- getslxname(inode, icpu)¶
- static help()¶
- init()¶
close all data dictionaries
- open(varargin)¶
- printMARTe2parconfig(shot, varargin)¶
function printMARTe2parconfig(shot, varargin)
produces an automatically generated text output instanitating a MARTe2 MDSObjLoader component loading all configured tunable parameters.
shot is used to distinguish the loader classes loading source between model shot and standard shot, if configured
varargin has two optional parameters: if a ‘model’ name is given, operations will be performed only on it, otherwise they will be performed on all configured models an optional ‘fid’ parameter can contain an open file identifier, in this case the output will be redirected to thsi file, otherwise it will be on the screen
- printMARTe2taskconfig(shot, varargin)¶
- printMARTe2wgbusconfig(obj, shot, busname, frequency, fid, varargin)¶
prints cfg file for loading busname Simulink.Bus as a wavegen (or a set of them) in MARTe2 shot can be -1 or a fixed shot (usually -1), but currently the Shot= entry is populated by a fixed macro frequency is the frequency of signal generation in MARTe2 the optional parameter ‘ddname’ can be given to specify the data dictionary where the bus definition is, if omitted the default expcode level data dicationary is used
- printinfo(nodenr, cpunr)¶
- printinits()¶
TODO: uniform the approach between stdinits and fpinits but only if fpinits will stay …
- printparameters()¶
- printtasks()¶
- printwavegens()¶
- processalgorithm(algoObj, node, cpu)¶
Checking and importing algorithm name
- setbuildconf(~)¶
set build configuration
- setmainslxname(name)¶
- setnode(node, nodenr)¶
- setsimconf(~)¶
set simulation configuration
- setup()¶
This function sets up the SCD Simulink model to simulate this experimental code. NOTE THAT it doesn’t actualize tunable parameters and wavegens, call actualizedata for that
- setupmaindd()¶
prepare main top-level SLDD
- sim(varargin)¶
- sortalgoobjlist()¶
sort algoobj list such that no algoobj has dependency on other algoobj that are further down the list. So running algoobj inits in this order ensures that everything is initialized in the correct order.
- updatedefaulttp()¶
updates _tmpl tunparams structures for every defined updating function To define an update function see SCDclass_algo.addtunparamstruct
- updatemdsmodel(algo)¶