34 CHSM::state(CHSM_STATE_INIT)
45 bool enter(
const CHSM::event& event, CHSM::state* from)
51 return CHSM::state::enter(event, from);
53 catch(
const std::exception& error) {
65 JDAQCHSM(CHSM_MACHINE_ARGS,
const std::string& __name) :
66 CHSM::machine(CHSM_MACHINE_INIT),
135 virtual void enterState(
const CHSM::state& state,
const CHSM::event& event) = 0;
152 virtual void execute(
action __action,
const CHSM::event& __event) = 0;
164 upon enter %{ actionEnter(); %}
165 upon
exit %{ actionExit(); %}
172 event ev_daq(
int length,
const char* buffer);
193 cluster RunControl(Operational, Error) is {
195 cluster Operational(Idle, Standby, Ready, Paused, Running) {
197 ev_error->Error %{ actionError(); %};
201 state<JDAQState> Idle {
207 state<JDAQState> Standby {
213 state<JDAQState> Ready {
217 std::istringstream
is(std::string(ev_start->buffer, ev_start->length));
219 is >> run_number >> detector_id;
228 state<JDAQState> Paused {
234 state<JDAQState> Running {
241 state<JDAQState> Error {
set Main(RunControl, Responder) is
chsm< JDAQCHSM > JDAQStateMachine(const std::string __name)
virtual void actionError()
event< ev_daq > ev_continue
virtual void actionQuit(int, const char *)
event< ev_daq > ev_recover
void(JDAQCHSM::* action)(int, const char *)
Type definition of action method.
virtual void actionInit(int, const char *)
virtual void actionStop(int, const char *)
virtual void actionReset(int, const char *)
virtual void enterState(const CHSM::state &state, const CHSM::event &event)=0
Action when entering state.
virtual void actionPause(int, const char *)
JDAQState(CHSM_STATE_ARGS)
Default CHSM constructor.
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
virtual void actionRecover(int, const char *)
virtual void actionInput(int, const char *)
DAQ state machine interface.
then cat ev_configure txt<< EOFdatawriter=$DWRITER_HOST;inputFile=$INPUT_FILE;eventRate_Hz=100.0;EOFfiif[[!-f driver.txt]];thencat > driver txt<< EOFprocess JEventGenerator $HOST ssh\$HOST\$"$JPP_BIN/JEventGenerator -u \$NAME\$ -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG </dev/null >& dev null& process JDataWriter $HOST ssh $HOST $JPP_BIN JDataWriter u $NAME H $SERVER M $LOGGER d $DEBUG</dev/null >& dev null& enter event ev_init
int getDetectorID() const
Get detector identifier.
virtual void actionCheck(int, const char *)
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
event< ev_daq > ev_configure
virtual void actionStart(int, const char *)
virtual void actionContinue(int, const char *)
virtual void actionExit()
int getRunNumber() const
Get run number.
bool enter(const CHSM::event &event, CHSM::state *from)
Enter this state.
virtual void actionConfigure(int, const char *)
const std::string & getName() const
Get name of state machine.
JDAQCHSM(CHSM_MACHINE_ARGS, const std::string &__name)
Constructor.