DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
dueca::hdf5log::HDF5Replayer Class Reference

Generic HDF5 replaying. More...

#include <HDF5Replayer.hxx>

Inheritance diagram for dueca::hdf5log::HDF5Replayer:
Inheritance graph
[legend]
Collaboration diagram for dueca::hdf5log::HDF5Replayer:
Collaboration graph
[legend]

Public Member Functions

 HDF5Replayer (Entity *e, const char *part, const PrioritySpec &ts)
 Constructor.
 
bool complete ()
 Continued construction.
 
 ~HDF5Replayer ()
 Destructor.
 
bool setTimeSpec (const TimeSpec &ts)
 Specify a time specification for the simulation activity.
 
bool checkTiming (const vector< int > &i)
 Request check on the timing.
 
bool setConfigChannel (const std::string &cname)
 Specify a channel for receiving configuration/reprogram events.
 
bool isPrepared ()
 indicate that everything is ready.
 
void startModule (const TimeSpec &time)
 start responsiveness to input data.
 
void stopModule (const TimeSpec &time)
 stop responsiveness to input data.
 
void doCalculation (const TimeSpec &ts)
 the method that implements the main calculation.
 
- Public Member Functions inherited from dueca::Module
virtual ~Module ()
 Destructor.
 
virtual bool isInitialPrepared ()
 To check whether the module is prepared to be prepared.
 
ObjectType getObjectType () const
 The object type within DUECA.
 
virtual void initialStartModule (const TimeSpec &time)
 Initial start opportunity.
 
virtual void finalStopModule (const TimeSpec &time)
 Final stop command.
 
const Entity * getMyEntity ()
 Return a pointer to the entity to which this module belongs.
 
const ModuleStategetState ()
 Return the module state.
 
- Public Member Functions inherited from dueca::NamedObject
const std::string getEntity () const
 Returns the "entity" part of the name.
 
const std::string getClass () const
 Returns the "class" part of the name.
 
const std::string getPart () const
 Returns the sub-entity or "part" part of the name.
 
const NameSetgetNameSet () const
 This returns the complete name set.
 
const GlobalIdgetId () const
 This returns the id.
 

Static Public Member Functions

static const IncoTablegetMyIncoTable ()
 Return the initial condition table.
 
static const ParameterTablegetMyParameterTable ()
 Return the parameter table.
 

Static Public Attributes

static const char *const classname
 Name of the module.
 

Additional Inherited Members

- Protected Member Functions inherited from dueca::SimulationModule
 SimulationModule (Entity *e, const char *m_class, const char *part, const IncoTable *table=NULL, int state_size=0)
 Constructor.
 
virtual ~SimulationModule ()
 Destructor.
 
SimulationState::Type getAndCheckState (const TimeSpec &ts, bool confirm_transition=true)
 Returns the state of the simulation at this time.
 
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.
 
SimulationState::Type getCurrentState ()
 If you "forgot" what the state from a previous getAndCheckState() call was, you can remember it here.
 
- Protected Member Functions inherited from dueca::DusimeModule
 DusimeModule (Entity *e, const char *m_class, const char *part, const IncoTable *inco_table, int state_size)
 Constructor.
 
virtual ~DusimeModule ()
 Destructor.
 
bool snapshotNow ()
 Returns true if a snapshot has to be taken in this cycle.
 
virtual void fillSnapshot (const TimeSpec &ts, Snapshot &snap, bool from_trim)
 If snapshots are generated, this has to be implemented by a descendant.
 
virtual void loadSnapshot (const TimeSpec &ts, const Snapshot &snap)
 For restoring the state from an old snapshot.
 
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.
 
virtual void trimCalculation (const TimeSpec &ts, const TrimMode &mode)
 This must be overridden if the module takes part in trim condition calculations.
 
- Protected Member Functions inherited from dueca::Module
 Module (const Entity *e, const char *m_class, const char *part)
 Constructor.
 
virtual void setSafetyStop ()
 Put a brake on this module's activities.
 
- Protected Member Functions inherited from dueca::NamedObject
 NamedObject (const GlobalId &id)
 Reserve for AssociateObject.
 
 NamedObject (const NameSet &ns)
 Normal constructor, protected, because it has no use to create a NamedObject by itself.
 
virtual ~NamedObject ()
 Destructor.
 
- Protected Attributes inherited from dueca::DusimeModule
SnapshotState snap_state
 State of the snapshot taking.
 
- Protected Attributes inherited from dueca::Module
ModuleState state
 Flag to remember whether we are stopped due to some error with hardware device manipulation.
 

Detailed Description

Generic HDF5 replaying.

This module can be used to replay the data in an HDF5 file. Either replaying runs continuously (also in HoldCurrent mode), or only in Advance mode. Note that entry creation & deletion is not provided; entries are created at the start of the simulation, and replay ends when the file is exhausted.

The replay attempts to "translate" the ticks in the datafile to the timing in the replay. For event type data, it is needed to have an event with the start of the recording.

The instructions to create a module of this class from the Scheme script are:

dueca.Module('hdf5-replayer', <part name; string>, <PrioritySpec>).param(
    set_timing = <TimeSpec>,
    # Supply a time specification to define the update rate of the main activity
    check_timing = <array of integers>,
    # Supply three integer parameters to specify a check on the timing of
    # the main activity: warning limit (in us), critical limit (in us), and
    # the number of loops to test before sending a report (optional, dflt=2000)
    filename = <string>,
    # existing hdf5 file name; open the file before specifying replay
    replay_start = <uint32_t>,
    # start point of the replay in the file, defined in DUECA time
    # granules. A value of 0 indicates earliest start possible.
    rcontinuous = <boolean>,
    # if true, continuous replay, otherwise new data only in advance
    add_replay = <array of strings>,
    # add a replay of an HDF5 file entry. Arguments (all strings):
    # - channel name (MyData://module/part/subpart)
    # - data class
    # - file path
    # - optional: event or stream type; "event" or *"stream"
    # - optional: packing mode; "mixed" or *"full"
    # - optional: transport class; "bulk", *"regular" or "high"
    # 
    config_channel = <string>,
    # Specify a channel with configuration events, to control logging
    # check HDFReplayConfig doc for options
    )
'''Description:
read out and replay data from an hdf5 file'''

Constructor & Destructor Documentation

◆ HDF5Replayer()

dueca::hdf5log::HDF5Replayer::HDF5Replayer ( Entity * e,
const char * part,
const PrioritySpec & ts )

Constructor.

Is normally called from scheme/the creation script.

Member Function Documentation

◆ complete()

bool dueca::hdf5log::HDF5Replayer::complete ( )
virtual

Continued construction.

This is called after all script parameters have been read and filled in, according to the parameter table. Your running environment, e.g. for OpenGL drawing, is also prepared. Any lengty initialisations (like reading the 4 GB of wind tables) should be done here. Return false if something in the parameters is wrong (by the way, it would help if you printed what!) May be deleted.

Reimplemented from dueca::Module.

◆ isPrepared()

bool dueca::hdf5log::HDF5Replayer::isPrepared ( )
virtual

indicate that everything is ready.

Implements dueca::Module.

◆ startModule()

void dueca::hdf5log::HDF5Replayer::startModule ( const TimeSpec & time)
virtual

start responsiveness to input data.

Implements dueca::Module.

◆ stopModule()

void dueca::hdf5log::HDF5Replayer::stopModule ( const TimeSpec & time)
virtual

stop responsiveness to input data.

Implements dueca::Module.


The documentation for this class was generated from the following file: