artdaq
v3_09_01
|
CommandableFragmentGenerator derived class for testing. More...
Public Member Functions | |
CommandableFragmentGeneratorTest (const fhicl::ParameterSet &ps) | |
CommandableFragmentGeneratorTest Constructor. | |
void | setFireCount (size_t count) |
Have getNext_ generate count fragments. More... | |
void | setHwFail () |
Set the hwFail flag. | |
void | setEnabledIds (uint64_t bitmask) |
Set the enabled IDs mask for the Fragment Generator. More... | |
void | setTimestamp (artdaq::Fragment::timestamp_t ts) |
Set the timestamp to be used for the next Fragment. More... | |
artdaq::Fragment::timestamp_t | getTimestamp () |
Get the timestamp that will be used for the next Fragment. More... | |
![]() | |
CommandableFragmentGenerator (const fhicl::ParameterSet &ps) | |
CommandableFragmentGenerator Constructor. More... | |
virtual | ~CommandableFragmentGenerator () |
CommandableFragmentGenerator Destructor. More... | |
void | joinThreads () |
Join any data-taking threads. Should be called when destructing CommandableFragmentGenerator. More... | |
bool | getNext (FragmentPtrs &output) overridefinal |
getNext calls either applyRequests or getNext_ to get any data that is ready to be sent to the EventBuilders More... | |
void | startMonitoringThread () |
Function that launches the monitoring thread (getMonitoringDataLoop()) | |
void | getMonitoringDataLoop () |
This function regularly calls checkHWStatus_(), and sets the isHardwareOK flag accordingly. | |
std::vector < Fragment::fragment_id_t > | fragmentIDs () override |
Get the list of Fragment IDs handled by this CommandableFragmentGenerator. More... | |
size_t | ev_counter () const |
Get the current value of the event counter. More... | |
void | StartCmd (int run, uint64_t timeout, uint64_t timestamp) |
Start the CommandableFragmentGenerator. More... | |
void | StopCmd (uint64_t timeout, uint64_t timestamp) |
Stop the CommandableFragmentGenerator. More... | |
void | PauseCmd (uint64_t timeout, uint64_t timestamp) |
Pause the CommandableFragmentGenerator. More... | |
void | ResumeCmd (uint64_t timeout, uint64_t timestamp) |
Resume the CommandableFragmentGenerator. More... | |
std::string | ReportCmd (std::string const &which="") |
Get a report about a user-specified run-time quantity. More... | |
virtual std::string | metricsReportingInstanceName () const |
Get the name used when reporting metrics. More... | |
bool | exception () const |
Get the current value of the exception flag. More... | |
virtual bool | metaCommand (std::string const &command, std::string const &arg) |
The meta-command is used for implementing user-specific commands in a CommandableFragmentGenerator. More... | |
void | SetRequestBuffer (std::shared_ptr< RequestBuffer > buffer) |
Protected Member Functions | |
bool | getNext_ (artdaq::FragmentPtrs &frags) override |
Generate data and return it to CommandableFragmentGenerator. More... | |
bool | checkHWStatus_ () override |
Returns whether the hwFail flag has not been set. More... | |
void | start () override |
Perform start actions. No-Op. | |
void | stopNoMutex () override |
Perform immediate stop actions. No-Op. | |
void | stop () override |
Perform stop actions. No-Op. | |
void | pause () override |
Perform pause actions. No-Op. | |
void | resume () override |
Perform resume actions. No-Op. | |
![]() | |
int | run_number () const |
Get the current Run number. More... | |
int | subrun_number () const |
Get the current Subrun number. More... | |
uint64_t | timeout () const |
Timeout of last command. More... | |
uint64_t | timestamp () const |
Timestamp of last command. More... | |
artdaq::Fragment::fragment_id_t | fragment_id () const |
Get the Fragment ID of this Fragment generator. More... | |
bool | should_stop () const |
Get the current value of the should_stop flag. More... | |
bool | check_stop () |
Routine used by applyRequests to make sure that all outstanding requests have been fulfilled before returning. More... | |
int | board_id () const |
Gets the current board_id. More... | |
size_t | ev_counter_inc (size_t step=1) |
Increment the event counter. More... | |
void | set_exception (bool exception) |
Control the exception flag. More... | |
void | metricsReportingInstanceName (std::string const &name) |
Sets the name for metrics reporting. More... | |
std::shared_ptr< RequestBuffer > | GetRequestBuffer () |
virtual bool | getNext_ (FragmentPtrs &output)=0 |
Obtain the next group of Fragments, if any are available. Return false if readout cannot continue, if we are 'stopped', or if we are not running in state-machine mode. Note that getNext_() must return n of each fragmentID declared by fragmentIDs_(). More... | |
virtual void | pauseNoMutex () |
On call to PauseCmd, pauseNoMutex() is called prior to PauseCmd acquiring the mutex More... | |
virtual std::string | report () |
Let's say that the contract with the report() functions is that they return a non-empty string if they have something useful to report, but if they don't know how to handle a given request, they simply return an empty string and the ReportCmd() takes care of saying "the xyz command is not currently supported". For backward compatibility, we keep the report function that takes no arguments and add one that takes a "which" argument. In the ReportCmd function, we'll call the more specific one first. More... | |
virtual std::string | reportSpecific (std::string const &what) |
Report the status of a specific quantity More... | |
Additional Inherited Members | |
![]() | |
using | Parameters = fhicl::WrappedTable< Config > |
Used for ParameterSet validation (if desired) | |
![]() | |
std::mutex | mutex_ |
Mutex used to ensure that multiple transition commands do not run at the same time. | |
CommandableFragmentGenerator derived class for testing.
Definition at line 46 of file CommandableFragmentGenerator_t.cc.
|
inlineoverrideprotectedvirtual |
Returns whether the hwFail flag has not been set.
Reimplemented from artdaq::CommandableFragmentGenerator.
Definition at line 76 of file CommandableFragmentGenerator_t.cc.
|
overrideprotected |
Generate data and return it to CommandableFragmentGenerator.
frags | FragmentPtrs list that new Fragments should be added to |
CommandableFragmentGeneratorTest merely default-constructs Fragments, emplacing them on the frags list.
Definition at line 157 of file CommandableFragmentGenerator_t.cc.
|
inline |
Get the timestamp that will be used for the next Fragment.
Definition at line 134 of file CommandableFragmentGenerator_t.cc.
|
inline |
Set the enabled IDs mask for the Fragment Generator.
bitmask | Bitmask of enabled IDs for the Fragment Generator |
For testing, this bitmask allows a configured Fragment ID to not be generated by a given call to setFireCount. This is used to create asymmetric response from the Fragment generator in the _MultipleIDs test cases
Definition at line 122 of file CommandableFragmentGenerator_t.cc.
|
inline |
Have getNext_ generate count fragments.
count | Number of fragments to generate |
Definition at line 108 of file CommandableFragmentGenerator_t.cc.
|
inline |
Set the timestamp to be used for the next Fragment.
ts | Timestamp to be used for the next Fragment |
Definition at line 128 of file CommandableFragmentGenerator_t.cc.