|
| DDFFDataRecorder () |
| Constructor.
|
|
bool | complete (const std::string &entity, const ChannelWriteToken &w_token, const std::string &key=std::string("")) |
| Complete; i.e., connect to the file storage.
|
|
bool | complete (const std::string &entity, const std::string &key, const std::string &data_class=std::string("")) |
| Complete; i.e., connect to the file storage.
|
|
template<typename DCO > |
bool | replay (const DataTimeSpec &ts, DCO &object, DataTimeSpec &object_ts) |
| Replay "stream" data into a DCO object.
|
|
template<typename DCO > |
bool | replay (const DataTimeSpec &ts, DCO &object) |
| Replay "stream" data into a DCO object.
|
|
template<typename DCO > |
void | record (const DataTimeSpec &ts, const DCO &object) |
| Record data from a DCO object.
|
|
void | channelRecord (const DataTimeSpec &ts, CommObjectWriter &writer) |
| Record data from a generic data writer.
|
|
unsigned | channelReplay (const DataTimeSpec &ts, ChannelWriteToken &w_token) |
| Replay previously recorded data into a write channel.
|
|
void | markRecord (const DataTimeSpec &ts) |
| Mark until where data recording is complete.
|
|
| ~DDFFDataRecorder () |
| Destructor.
|
|
bool | isValid () |
| Is connected, valid, etc.
|
|
void | startStretch (TimeTickType tick) |
| Starting a new stretch; will mark the first data written in this stretch (if any) for callback with the offset of that data.
|
|
unsigned | getStreamId () const |
| Get the associated stream id.
|
|
void | startReplay (TimeTickType tick) |
| Starting a new replay; provide offset for the replayed data.
|
|
void | spoolReplay (ddff::FileHandler::pos_type offset, ddff::FileHandler::pos_type end_offset) |
| Control spooling replay position.
|
|
bool | checkWriteTick (TimeTickType tick) |
| Check write status, before forcing a flush of the file.
|
|
void | syncRecorder () |
| Initiate syncing of the data to disk.
|
|
bool | checkAndMakeClean () |
| Check and possibly reset the dirty flag.
|
|
Recording/replay facility for storing data in simulation replay.
To enable recording and replay, all DUECA modules that "generate" fresh data, e.g., a control loading module, or a module reading stick/ buttons/screens in a simulator etc., need to record the data generated and sent in a session, and be able to retrieve and replay that data in replay mode. Often it is enough to record the data sent over channels, but it may also be necessary, e.g., to have control loading devices mimic the previously generated motion, to record additional data. Decide what you need for full replay, and create one or more DDFFDataRecorder objects in your module to record the data and access the replay.
Recording/replay facility for storing data in simulation replay.
Definition DDFFDataRecorder.hxx:113
If your recorder directly records the data sent over a channel, the recorder needs to be "completed" in the isPrepared call for your module, after the channel has become valid, an example:
bool MyModule::isPrepared()
{
bool res = true;
CHECK_TOKEN(w_mytoken);
if (res) {
my_recorder.
complete(getEntity(), w_mytoken);
}
CHECK_RECORDER(my_recorder);
return res;
}
bool complete(const std::string &entity, const ChannelWriteToken &w_token, const std::string &key=std::string(""))
Complete; i.e., connect to the file storage.
If you need to record additional data, not sent over a channel, create a recorder directly for a DCO datatype, in that case, the complete call changes a little, and is not dependent on a channel state:
my_other_recorder.complete(getEntity(),
"some unique key for the recorder",
"SomeDCODataClass");
CHECK_RECORDER(my_other_recorder);
In the "Advance" mode of the simulation, use the record call to record the data of the DCO object you are about to write:
my_recorder.
record(ts, dco_object);
void record(const DataTimeSpec &ts, const DCO &object)
Record data from a DCO object.
Definition DDFFDataRecorder.hxx:323
or directly when writing (note, do not record in HoldCurrent:
DataWriter<MyObject> dw(w_mytoken, ts);
if (getCurrentState() == SimulationState::Advance) {
my_recorder.
record(dw.data(), ts);
}
When in the "Replay" mode, the recorder's "replay" method can be used to retrieve the previously stored data.