A device event is a primary messaging structure, which is used to communicate between entities (primarily filters). The SDK defines the structure scgms::TDevice_Event
with the
following memory layout:
struct TDevice_Event {
NDevice_Event_Code event_code;
GUID device_id;
GUID signal_id;
double device_time;
int64_t logical_time;
uint64_t segment_id;
union {
double level = 0.0;
IModel_Parameter_Vector* parameters;
refcnt::wstr_container* info;
};
};
The meaning of all structure members are:
event_code
- the identifier of data contained within this device event, see below for possible valuesdevice_id
- GUID of device (filter, model) that produced this device eventsignal_id
- GUID of signal, that is carried by this device eventdevice_time
- rat time of this device event creation, see time and time segments pagelogical_time
- logical time of this device event; increasing sequence of numbers are assigned, preferably by a single global arbiter (the scgms
library achieves that by centralizing the device event creation)segment_id
- ID of time segment, see time and time segments pagelevel
- holds a signal level valueparameters
- holds a vector of parametersinfo
- holds a string
The event_code
field contains one of the values from scgms::NDevice_Event_Code
enumeration:
Nothing
- this value is considered invalid outside the entity context; this should only represent an internal device eventShut_Down
- shuts down the entity operation and releases it from memory, if possibleLevel
- holds signal valueMasked_Level
- holds masked signal value ("hidden" level, masked by a masking filter in order to create e.g.; testing dataset)Parameters
- holds the newest set of parameters of a modelParameters_Hint
- holds the hint for a model parameters (a set of previously identified parameters used e.g.; as an initial population member in solvers)Suspend_Parameter_Solving
- suspends parameter solving in filters, that solves parameters repeatedly during simulationResume_Parameter_Solving
- resumes parameter solving in filters, that solves parameters repeatedly during simulationSolve_Parameters
- explicitly requests the solver to be run on a given parameter-solving filterTime_Segment_Start
- marks the start of a time segment, see time and time segments page for more infoTime_Segment_Stop
- marks the end of a time segment, see time and time segments page for more infoWarm_Reset
- resets the entity to an initial state, but preserving any useful data (e.g.; solved parameters)Information
- holds the information stringWarning
- reports warning, holds the warning detail stringError
- reports a runtime error, holds the error detail string