|
| RTWModule (Entity *e, const char *m_class, const char *part, const IncoTable *table=NULL, int state_size=0) |
| Constructor. More...
|
|
virtual | ~RTWModule () |
| Destructor. More...
|
|
| SimulationModule (Entity *e, const char *m_class, const char *part, const IncoTable *table=NULL, int state_size=0) |
| Constructor. More...
|
|
virtual | ~SimulationModule () |
| Destructor. More...
|
|
SimulationState::Type | getAndCheckState (const TimeSpec &ts, bool confirm_transition=true) |
| Returns the state of the simulation at this time. More...
|
|
void | transitionComplete () |
| If a transition was not (implicitly) confirmed in the getAndCheckState call (second argument false), confirm with this call that it is now complete. More...
|
|
SimulationState::Type | getCurrentState () |
| If you "forgot" what the state from a previous getAndCheckState() call was, you can remember it here. More...
|
|
| DusimeModule (Entity *e, const char *m_class, const char *part, const IncoTable *inco_table, int state_size) |
| Constructor. More...
|
|
virtual | ~DusimeModule () |
| Destructor. More...
|
|
bool | snapshotNow () |
| Returns true if a snapshot has to be taken in this cycle. More...
|
|
virtual void | fillSnapshot (const TimeSpec &ts, Snapshot &snap, bool from_trim) |
| If snapshots are generated, this has to be implemented by a descendant. More...
|
|
virtual void | loadSnapshot (const TimeSpec &ts, const Snapshot &snap) |
| For restoring the state from an old snapshot. More...
|
|
void | trimCalculationCondition (TriggerPuller &cond) |
| This can be used to specify the condition under which the trim calculation may take place, for example, data has to be received on trim calculation input channels. More...
|
|
virtual void | trimCalculation (const TimeSpec &ts, const TrimMode &mode) |
| This must be overridden if the module takes part in trim condition calculations. More...
|
|
| Module (const Entity *e, const char *m_class, const char *part) |
| Constructor.
|
|
virtual void | setSafetyStop () |
| Put a brake on this module's activities.
|
|
| NamedObject (const GlobalId &id) |
| Reserve for AssociateObject. More...
|
|
| NamedObject (const NameSet &ns) |
| Normal constructor, protected, because it has no use to create a NamedObject by itself.
|
|
virtual | ~NamedObject () |
| Destructor.
|
|
A base class from which users can derive Real-Time Workshop modules.
The RTWModule base class implements the basic communication for a DUSIME module. By deriving from this class, using its methods to dermine the simulation state, and re-implementing applicable virtual methods, a fully DUSIME-aware class can be made, and objects of this class have coordinated start-stop abilities, the ability to calculate initial conditions and the ability for saving and restoring simulation state. A RTWModule can also store and restore RTW model state and parameters, from and to an xml description. This enables translation of states and parametersets between your DUECA simulation and the MATLAB workspace.
virtual void dueca::RTWModule::loadXmlSnapshot |
( |
const TimeSpec & |
ts, |
|
|
const XmlSnapshot & |
snap |
|
) |
| |
|
virtual |
For restoring state, model parameters, and initial inputs from a previously generated xml file.
This should take the snapshot data, unpack it (so keep aligned with the sendXmlSnapshot routine), and use this to replace the current state, parameters, and inputs. Note that the model will not be running at this time, so – if you don't touch your state in HoldCurrent, as you should not – this can run in parallel to the simulation without locking. Default implementation for this function is included in the rtw model template.