#include <AcousticDataFilter.h>
|
| AcousticDataFilter (const std::string &address, const std::string &port, const std::string &name, const std::string &server, const std::string &wisdom, const std::string &output, const std::string &raw, JLOGGER::JLogger *logger, const int level) |
|
virtual | ~AcousticDataFilter () |
|
void | Send_toa_async (ToA_Packet packet) |
|
virtual void | actionEnter () |
| Interface methods for actions corresponding to state transitions. More...
|
|
virtual void | actionExit () |
|
virtual void | actionInit (int length, const char *buffer) |
|
virtual void | actionConfigure (int length, const char *buffer) |
|
virtual void | actionStart (int length, const char *buffer) |
|
virtual void | actionPause (int length, const char *buffer) |
|
virtual void | actionContinue (int length, const char *buffer) |
|
virtual void | actionStop (int length, const char *buffer) |
|
virtual void | actionReset (int length, const char *buffer) |
|
virtual void | actionQuit (int length, const char *buffer) |
|
virtual void | actionInput (int length, const char *buffer) |
| This method is called at ev_input . More...
|
|
virtual void | actionRunning () |
| This method is repeatedly called when this client machine is in state Running and the clock interval time is non-zero. More...
|
|
virtual bool | enter (const JArgs &args) |
| Enter the state machine. More...
|
|
virtual bool | enter () |
| Enter the state machine. More...
|
|
virtual bool | exit () |
| Exit the state machine. More...
|
|
bool | isRunning () const |
| Check if this client is in runnig state. More...
|
|
void | replaceEvent (const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event) |
| Replace tag of given event in event table. More...
|
|
JDAQEvent_t * | findEvent (const JTag &tag, const std::string &event_name) |
| Find event in event table. More...
|
|
void | addSubscription (const JSubscription &subscription) |
| Add custom subscription. More...
|
|
template<class T > |
void | addParameter (const char option, T ¶meter) |
| Add parameter to parser used in method enter(). More...
|
|
template<class T > |
void | addParameter (const char option, T ¶meter, const T &value) |
| Add parameter to parser used in method enter(). More...
|
|
void | setSelect () |
| Set the file descriptor mask for the select call. More...
|
|
virtual void | setSelect (JFileDescriptorMask &mask) const |
| Set the file descriptor mask for the select call. More...
|
|
virtual void | actionSelect (const JFileDescriptorMask &mask) |
| Action method following last select call. More...
|
|
virtual bool | filter (const JTag &tag, int length, const char *buffer) |
| Filter message. More...
|
|
virtual void | actionTagged (const JTag &tag, int length, const char *buffer) |
| This method is called when a custom tag is encountered. More...
|
|
void | run () |
| Run as run control client following command messages via JNET::JControlHost. More...
|
|
void | run (const int port) |
| Run for ever. More...
|
|
void | run (std::istream &in) |
| Run client with commands from input stream (e.g. More...
|
|
void | A1 (CHSM_ns_alias::event const &) |
|
void | A2 (CHSM_ns_alias::event const &) |
|
void | A3 (CHSM_ns_alias::event const &) |
|
void | A4 (CHSM_ns_alias::event const &) |
|
void | A5 (CHSM_ns_alias::event const &) |
|
void | A6 (CHSM_ns_alias::event const &) |
|
void | A7 (CHSM_ns_alias::event const &) |
|
void | A8 (CHSM_ns_alias::event const &) |
|
void | A9 (CHSM_ns_alias::event const &) |
|
void | A10 (CHSM_ns_alias::event const &) |
|
void | A11 (CHSM_ns_alias::event const &) |
|
void | A12 (CHSM_ns_alias::event const &) |
|
void | A13 (CHSM_ns_alias::event const &) |
|
void | A14 (CHSM_ns_alias::event const &) |
|
void | EAM4root (CHSM_ns_alias::state const &, CHSM_ns_alias::event const &) |
|
void | XAM4root (CHSM_ns_alias::state const &, CHSM_ns_alias::event const &) |
|
const std::string & | getName () const |
| Get name of state machine. More...
|
|
int | getDetectorID () const |
| Get detector identifier. More...
|
|
int | getRunNumber () const |
| Get run number. More...
|
|
virtual void | actionError () |
|
virtual void | actionRecover (int, const char *) |
|
const std::string & | getHostname () const |
| Get hostname. More...
|
|
const std::string & | getFullName () const |
| Get full name of this run control client. More...
|
|
const JTag & | getUniqueTag () const |
| Get unique tag of this run control client. More...
|
|
long long int | getClockDelay () const |
| Get total delay time. More...
|
|
long long int | getClockInterval () const |
| Get interval time. More...
|
|
void | setClockInterval (const long long int interval_us) |
| Set interval time. More...
|
|
void | resetClock () |
| Reset clock. More...
|
|
int | getEventNumber () const |
| Get last event number. More...
|
|
void | setEventNumber (const int event_number) |
| Set last event number. More...
|
|
|
typedef void(JDAQCHSM::* | action) (int, const char *) |
| Type definition of action method. More...
|
|
|
const JNET::JTag & | clientTag () const |
|
void | Create_probes (std::vector< std::string > probes, std::size_t window) |
|
void | Create_DOMs (std::vector< std::string > doms, std::string &debug_file_path, std::size_t window, std::size_t overlap) |
|
void | Start_accept () |
|
void | Accept_completed (pLink link, const boost::system::error_code &error) |
|
void | Start () |
|
void | Stop () |
|
void | Open_toa_file () |
|
void | Send_toa (ToA_Packet packet) |
|
void | update () |
| Update state machine. More...
|
|
void | update (const JTag &tag, int length, const char *buffer) |
| Update state machine. More...
|
|
void | configure () |
| Configure client. More...
|
|
std::string | getMessage (const CHSM::state &state, const CHSM::event &event) const |
| Get event message. More...
|
|
virtual void | enterState (const CHSM::state &state, const CHSM::event &event) |
| Action when entering state. More...
|
|
virtual void | actionCheck (int length, const char *buffer) |
| This method is called at ev_check and reports a system check by mimicing an enter state action. More...
|
|
void | execute (action __action, const CHSM::event &__event) |
| The method to execute the action. More...
|
|
const CHSM::state * | getState () const |
| Get current state. More...
|
|
Definition at line 46 of file AcousticDataFilter.h.
◆ action
typedef void(JDAQCHSM::* JDAQCHSM::action) (int, const char *) |
|
protectedinherited |
Type definition of action method.
Definition at line 152 of file JDAQCHSM.hh.
◆ AcousticDataFilter()
AcousticDataFilter::AcousticDataFilter |
( |
const std::string & |
address, |
|
|
const std::string & |
port, |
|
|
const std::string & |
name, |
|
|
const std::string & |
server, |
|
|
const std::string & |
wisdom, |
|
|
const std::string & |
output, |
|
|
const std::string & |
raw, |
|
|
JLOGGER::JLogger * |
logger, |
|
|
const int |
level |
|
) |
| |
◆ ~AcousticDataFilter()
AcousticDataFilter::~AcousticDataFilter |
( |
| ) |
|
|
virtual |
◆ Send_toa_async()
void AcousticDataFilter::Send_toa_async |
( |
ToA_Packet |
packet | ) |
|
|
inline |
◆ actionEnter()
virtual void AcousticDataFilter::actionEnter |
( |
| ) |
|
|
inlinevirtual |
◆ actionExit()
virtual void AcousticDataFilter::actionExit |
( |
| ) |
|
|
inlinevirtual |
◆ actionInit()
void AcousticDataFilter::actionInit |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionConfigure()
void AcousticDataFilter::actionConfigure |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
Reimplemented from JDAQCHSM.
Definition at line 185 of file AcousticDataFilter.cpp.
188 Parser dummy(std::string(buffer, length),
';');
191 std::string l_debug_file_path;
192 std::string l_window;
193 std::string l_overlap;
199 l_window = dummy.Find(
"ADF_analysis_window_size", 0);
200 l_overlap = dummy.Find(
"ADF_analysis_window_overlap", 0);
201 l_probes = dummy.Find(
"ADF_waveform");
202 l_dom_configuration = dummy.Find(
"ADF_DOM_configuration");
204 l_toa_path=dummy.Find(
"ADF_TOA_path");
206 l_dbg_path=dummy.Find(
"ADF_DBG_path");
209 DEBUG_MSG(
"SM:Configure. win="<<l_window,2);
210 DEBUG_MSG(
"SM:Configure. ovr="<<l_overlap,2);
214 DEBUG_MSG(
"SM:Configure. n dom="<<l_dom_configuration.size(),2);
215 DEBUG_MSG(
"SM:Configure. n pro="<<l_probes.size(),2);
◆ actionStart()
void AcousticDataFilter::actionStart |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionPause()
void AcousticDataFilter::actionPause |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionContinue()
void AcousticDataFilter::actionContinue |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionStop()
void AcousticDataFilter::actionStop |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionReset()
void AcousticDataFilter::actionReset |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionQuit()
void AcousticDataFilter::actionQuit |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
virtual |
◆ actionInput()
virtual void AcousticDataFilter::actionInput |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ actionRunning()
virtual void AcousticDataFilter::actionRunning |
( |
| ) |
|
|
inlinevirtual |
This method is repeatedly called when this client machine is in state Running and the clock interval time is non-zero.
This implementation does nothing but may be redefined by the derived class. Care has to be taken so that the time needed to execute this method should be less than the specified clock interval time (see method setClockInterval()).
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 75 of file AcousticDataFilter.h.
◆ clientTag()
const JNET::JTag& AcousticDataFilter::clientTag |
( |
| ) |
const |
|
inlineprivate |
◆ Create_probes()
void AcousticDataFilter::Create_probes |
( |
std::vector< std::string > |
probes, |
|
|
std::size_t |
window |
|
) |
| |
|
private |
Definition at line 231 of file AcousticDataFilter.cpp.
235 for(
int t=0;t<probes.size();++t)
237 std::istringstream l_iss(probes.at(t));
244 l_id=atoi(l_line.c_str());
247 l_samples=atoi(l_line.c_str());
249 l_buffer=(real_type*)malloc(l_samples*
sizeof(real_type));
250 for (uint32_t i=0; i<l_samples; ++i)
253 real_type l_dummy=atof(l_line.c_str());
258 pProbe l_probe = boost::make_shared<KM3::TOALIB::CTOAFinder::probeSignalT>(*(
new KM3::TOALIB::CTOAFinder::probeSignalT(window)));
260 l_probe->copyFromBuffer(l_buffer,l_samples);
◆ Create_DOMs()
void AcousticDataFilter::Create_DOMs |
( |
std::vector< std::string > |
doms, |
|
|
std::string & |
debug_file_path, |
|
|
std::size_t |
window, |
|
|
std::size_t |
overlap |
|
) |
| |
|
private |
Definition at line 267 of file AcousticDataFilter.cpp.
271 for(
int t=0;t<dom_configuration.size();++t)
273 std::istringstream l_iss(dom_configuration.at(t));
277 uint32_t l_threshold;
278 uint32_t l_waveforms;
282 l_dom_id=atoi(l_line.c_str());
291 l_waveforms=atoi(l_line.c_str());
292 DEBUG_MSG(
"n waveforms="<<l_waveforms,1);
293 for (uint32_t i=0; i<l_waveforms; ++i)
296 l_probe_id=atoi(l_line.c_str());
298 l_threshold=atoi(l_line.c_str());
299 DEBUG_MSG(
"adding probe "<<l_probe_id<<
" with threshold "<<l_threshold<<
" to DOM "<<l_dom_id,1);
300 l_dom->Add_probe(
probes_.find(l_probe_id)->second,l_probe_id,l_threshold);
303 l_test=atoi(l_line.c_str());
305 l_dom->Set_test(l_test);
◆ Start_accept()
void AcousticDataFilter::Start_accept |
( |
| ) |
|
|
private |
◆ Accept_completed()
void AcousticDataFilter::Accept_completed |
( |
pLink |
link, |
|
|
const boost::system::error_code & |
error |
|
) |
| |
|
private |
◆ Start()
void AcousticDataFilter::Start |
( |
| ) |
|
|
private |
Definition at line 95 of file AcousticDataFilter.cpp.
102 boost::asio::ip::tcp::resolver::query l_query(
address_,
port_);
103 boost::asio::ip::tcp::endpoint l_endpoint = *l_resolver.resolve(l_query);
105 server_acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(
true));
◆ Stop()
void AcousticDataFilter::Stop |
( |
| ) |
|
|
private |
◆ Open_toa_file()
void AcousticDataFilter::Open_toa_file |
( |
| ) |
|
|
private |
◆ Send_toa()
void AcousticDataFilter::Send_toa |
( |
ToA_Packet |
packet | ) |
|
|
private |
◆ enter() [1/2]
virtual bool KM3NETDAQ::JDAQClient::enter |
( |
const JArgs & |
args | ) |
|
|
inlinevirtualinherited |
Enter the state machine.
This overloaded method enter reproduces the constructor. All necessary input is parsed from the list of arguments. In case of an error, the state machine is not entered.
- Parameters
-
args | array of command line arguments |
- Returns
- true if okay; else false
Definition at line 363 of file JDAQClient.hh.
383 catch(
const exception &error) {
384 cerr << error.what() << endl;
399 this->server.reset(
new JControlHost(
server));
403 catch(
const JControlHostException& error) {
404 cerr << error << endl;
◆ enter() [2/2]
virtual bool KM3NETDAQ::JDAQClient::enter |
( |
| ) |
|
|
inlinevirtualinherited |
Enter the state machine.
This method activates the subscription to JNET::JControlHost messages. In case of an error, the state machine is not entered.
- Returns
- true if okay; else false
Reimplemented in KM3NETDAQ::JDAQDriver.
Definition at line 418 of file JDAQClient.hh.
429 server->Subscribe(buffer);
435 return CHSM::machine::enter();
437 catch(
const JControlHostException& error) {
442 cerr <<
"Message server or logger not properly initialised." << endl;
◆ exit()
virtual bool KM3NETDAQ::JDAQClient::exit |
( |
| ) |
|
|
inlinevirtualinherited |
Exit the state machine.
This method releases the various resources.
- Returns
- true if okay; else false
Definition at line 456 of file JDAQClient.hh.
461 catch(
const JControlHostException& error) {
467 catch(
const JControlHostException& error) {
470 return CHSM::machine::exit();
◆ isRunning()
bool KM3NETDAQ::JDAQClient::isRunning |
( |
| ) |
const |
|
inlineinherited |
Check if this client is in runnig state.
- Returns
- true if running; else false
Definition at line 479 of file JDAQClient.hh.
◆ replaceEvent()
void KM3NETDAQ::JDAQClient::replaceEvent |
( |
const JTag & |
oldTag, |
|
|
const JTag & |
newTag, |
|
|
JDAQEvent_t & |
event |
|
) |
| |
|
inlineinherited |
Replace tag of given event in event table.
- Parameters
-
oldTag | old tag |
newTag | new tag |
event | event |
Definition at line 492 of file JDAQClient.hh.
◆ findEvent()
JDAQEvent_t* KM3NETDAQ::JDAQClient::findEvent |
( |
const JTag & |
tag, |
|
|
const std::string & |
event_name |
|
) |
| |
|
inlineinherited |
Find event in event table.
- Parameters
-
tag | tag |
event_name | event name |
- Returns
- pointer to event or NULL
Definition at line 507 of file JDAQClient.hh.
◆ addSubscription()
void KM3NETDAQ::JDAQClient::addSubscription |
( |
const JSubscription & |
subscription | ) |
|
|
inlineinherited |
Add custom subscription.
- Parameters
-
Definition at line 523 of file JDAQClient.hh.
◆ addParameter() [1/2]
template<class T >
void KM3NETDAQ::JDAQClient::addParameter |
( |
const char |
option, |
|
|
T & |
parameter |
|
) |
| |
|
inlineinherited |
Add parameter to parser used in method enter().
- Parameters
-
option | option |
parameter | parameter |
Definition at line 536 of file JDAQClient.hh.
◆ addParameter() [2/2]
template<class T >
void KM3NETDAQ::JDAQClient::addParameter |
( |
const char |
option, |
|
|
T & |
parameter, |
|
|
const T & |
value |
|
) |
| |
|
inlineinherited |
Add parameter to parser used in method enter().
- Parameters
-
option | option |
parameter | parameter |
value | default value |
Definition at line 550 of file JDAQClient.hh.
◆ setSelect() [1/2]
void KM3NETDAQ::JDAQClient::setSelect |
( |
| ) |
|
|
inlineinherited |
Set the file descriptor mask for the select call.
Definition at line 559 of file JDAQClient.hh.
◆ setSelect() [2/2]
◆ actionSelect()
◆ filter()
virtual bool KM3NETDAQ::JDAQClient::filter |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
Filter message.
The filter method can be overwritten so that a specific action is made before the corresponding message is processed by the state machine. The message is ignored if true is returned, else it is normally processed.
- Parameters
-
tag | tag |
length | number of characters |
buffer | message |
- Returns
- skip message or not
Definition at line 633 of file JDAQClient.hh.
◆ actionTagged()
virtual void KM3NETDAQ::JDAQClient::actionTagged |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
This method is called when a custom tag is encountered.
- Parameters
-
tag | tag |
length | length of data |
buffer | pointer to data |
Reimplemented in KM3NETDAQ::JDataFilter.
Definition at line 646 of file JDAQClient.hh.
◆ run() [1/3]
void KM3NETDAQ::JDAQClient::run |
( |
| ) |
|
|
inlineinherited |
Run as run control client following command messages via JNET::JControlHost.
This method can be called once the state machine is entered. It returns when the state machine is exited. If the clock interval is non-zero, the method actionRunning() is repeatedly called when this client machine is in state Running. The file descriptor mask can be set to interrupt the timeout of the select call and clock method wait() in this calling sequence (see methods setSelect() and actionSelect()).
Definition at line 661 of file JDAQClient.hh.
687 long long int numberOfCalls = 0;
710 catch(
const exception& error) {
717 if (numberOfCalls != 0) {
722 catch(
const exception& error) {
◆ run() [2/3]
void KM3NETDAQ::JDAQClient::run |
( |
const int |
port | ) |
|
|
inlineinherited |
Run for ever.
This method can be used when the run control client is started before the run control (e.g. at boot time of the host processor). This method should be called before the state machine is entered. It launches a server which accepts a JNET::JControlHost connection from a designated application e.g. the JDAQClientStarter.cc program. The state machine is entered using the available data in the JNET::JControlHost message. After the state machine is exited, it accepts a new a JNET::JControlHost connection.
- Parameters
-
Definition at line 741 of file JDAQClient.hh.
743 JControlHostServer local_server(port);
747 JControlHost* ps = local_server.AcceptClient();
753 ps->WaitHead(prefix);
755 const int length = prefix.
getSize();
757 char* buffer =
new char[length];
759 ps->GetFullData(buffer, length);
760 ps->PutFullData(prefix.
toString(), buffer, length);
◆ run() [3/3]
void KM3NETDAQ::JDAQClient::run |
( |
std::istream & |
in | ) |
|
|
inlineinherited |
Run client with commands from input stream (e.g.
for debugging).
Example input format:
<tag> <event name>[#data];
<tag> <event name>[#data];
- Parameters
-
Definition at line 786 of file JDAQClient.hh.
793 while (in >> tag && in >> skipws &&
getline(in, buffer,
';')) {
794 update(tag, buffer.length(), buffer.data());
◆ update() [1/2]
void KM3NETDAQ::JDAQClient::update |
( |
| ) |
|
|
inlineprivateinherited |
Update state machine.
This method waits for a message from JNET::JControlHost server.
Definition at line 808 of file JDAQClient.hh.
814 const int length = prefix.
getSize();
816 char* buffer =
new char[length];
818 server->GetFullData(buffer, length);
◆ update() [2/2]
void KM3NETDAQ::JDAQClient::update |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlineprivateinherited |
Update state machine.
- Parameters
-
tag | tag |
length | number of characters |
buffer | message |
Definition at line 833 of file JDAQClient.hh.
838 if (
filter(tag, length, buffer)) {
851 string::size_type pos = 0;
853 while (pos != (string::size_type) length &&
TOKEN_DELIMETER.find(*(buffer + pos)) == string::npos) {
861 while (pos != (string::size_type) length &&
TOKEN_DELIMETER.find(*(buffer + pos)) != string::npos) {
866 JEventTable::const_iterator i =
eventTable.
find(tag, event.getName());
870 const CHSM::state*
const s0 =
getState();
872 if (!i->second->active()) {
874 JWarningStream(
logger) <<
"Event " << i->second->name() <<
" not active (" << (s0 != NULL ? s0->name() :
"") <<
")";
876 if (
server.is_valid() && s0 != NULL) {
887 JRedirectStream redirect[] = { JRedirectStream(cin,
JLANG::null),
888 JRedirectStream(cout,
debug),
889 JRedirectStream(cerr, error) };
895 (*(i->second))(length - pos, buffer + pos);
899 const CHSM::state*
const s1 =
getState();
902 << (s0 != NULL ? s0->name() :
"")
903 <<
"->(" << i->second->name() <<
")->"
904 << (s1 != NULL ? s1->name() :
"");
◆ configure()
void KM3NETDAQ::JDAQClient::configure |
( |
| ) |
|
|
inlineprivateinherited |
Configure client.
This method is used to setup the event table.
Definition at line 916 of file JDAQClient.hh.
◆ getMessage()
std::string KM3NETDAQ::JDAQClient::getMessage |
( |
const CHSM::state & |
state, |
|
|
const CHSM::event & |
event |
|
) |
| const |
|
inlineprivateinherited |
Get event message.
- Parameters
-
- Returns
- message
Definition at line 928 of file JDAQClient.hh.
930 std::ostringstream os;
◆ enterState()
virtual void KM3NETDAQ::JDAQClient::enterState |
( |
const CHSM::state & |
state, |
|
|
const CHSM::event & |
event |
|
) |
| |
|
inlineprivatevirtualinherited |
Action when entering state.
This method provides for the hand shaking with the run control program.
- Parameters
-
state | entered state |
event | event that triggered transition |
Implements JDAQCHSM.
Reimplemented in KM3NETDAQ::JDAQDriver.
Definition at line 949 of file JDAQClient.hh.
◆ actionCheck()
virtual void KM3NETDAQ::JDAQClient::actionCheck |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlineprivatevirtualinherited |
This method is called at ev_check
and reports a system check by mimicing an enter state action.
- Parameters
-
length | number of characters |
buffer | message |
Reimplemented from JDAQCHSM.
Definition at line 963 of file JDAQClient.hh.
973 if (state->active()) {
◆ execute()
void KM3NETDAQ::JDAQClient::execute |
( |
action |
__action, |
|
|
const CHSM::event & |
__event |
|
) |
| |
|
inlineprivatevirtualinherited |
The method to execute the action.
- Parameters
-
__action | pointer to action method |
__event | event that triggered the action |
Implements JDAQCHSM.
Definition at line 990 of file JDAQClient.hh.
996 (this->*__action)(event->length, event->buffer);
998 catch(
const std::exception& error) {
999 JErrorStream(
logger) <<
"Error at event " << __event.name() <<
" \"" << error.what() <<
"\"; trigger ev_error.";
◆ getState()
const CHSM::state* KM3NETDAQ::JDAQClient::getState |
( |
| ) |
const |
|
inlineprivateinherited |
Get current state.
- Returns
- state
Definition at line 1010 of file JDAQClient.hh.
1013 if (state->active()) {
◆ A1()
void JDAQStateMachine::A1 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A2()
void JDAQStateMachine::A2 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A3()
void JDAQStateMachine::A3 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A4()
void JDAQStateMachine::A4 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A5()
void JDAQStateMachine::A5 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A6()
void JDAQStateMachine::A6 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A7()
void JDAQStateMachine::A7 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A8()
void JDAQStateMachine::A8 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A9()
void JDAQStateMachine::A9 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A10()
void JDAQStateMachine::A10 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A11()
void JDAQStateMachine::A11 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A12()
void JDAQStateMachine::A12 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A13()
void JDAQStateMachine::A13 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A14()
void JDAQStateMachine::A14 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ EAM4root()
void JDAQStateMachine::EAM4root |
( |
CHSM_ns_alias::state const & |
chsm_state_, |
|
|
CHSM_ns_alias::event const & |
event |
|
) |
| |
|
inherited |
Definition at line 337 of file JDAQCHSM.cc.
338 #line 164 "JDAQCHSM.chsm"
339 CHSM_ns_alias::cluster
const &state = (CHSM_ns_alias::cluster
const&)chsm_state_;
actionEnter(); }
◆ XAM4root()
void JDAQStateMachine::XAM4root |
( |
CHSM_ns_alias::state const & |
chsm_state_, |
|
|
CHSM_ns_alias::event const & |
event |
|
) |
| |
|
inherited |
Definition at line 340 of file JDAQCHSM.cc.
341 #line 165 "JDAQCHSM.chsm"
342 CHSM_ns_alias::cluster
const &state = (CHSM_ns_alias::cluster
const&)chsm_state_;
actionExit(); }
◆ getName()
const std::string& JDAQCHSM::getName |
( |
| ) |
const |
|
inlineinherited |
Get name of state machine.
- Returns
- name
Definition at line 89 of file JDAQCHSM.hh.
◆ getDetectorID()
int JDAQCHSM::getDetectorID |
( |
| ) |
const |
|
inlineinherited |
Get detector identifier.
- Returns
- detector identifier.
Definition at line 100 of file JDAQCHSM.hh.
◆ getRunNumber()
int JDAQCHSM::getRunNumber |
( |
| ) |
const |
|
inlineinherited |
Get run number.
- Returns
- run number
Definition at line 111 of file JDAQCHSM.hh.
◆ actionError()
virtual void JDAQCHSM::actionError |
( |
| ) |
|
|
inlinevirtualinherited |
◆ actionRecover()
virtual void JDAQCHSM::actionRecover |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ getHostname()
const std::string& KM3NETDAQ::JDAQClient_t::getHostname |
( |
| ) |
const |
|
inlineinherited |
◆ getFullName()
const std::string& KM3NETDAQ::JDAQClient_t::getFullName |
( |
| ) |
const |
|
inlineinherited |
Get full name of this run control client.
- Returns
- full name
Definition at line 119 of file JDAQClient.hh.
◆ getUniqueTag()
const JTag& KM3NETDAQ::JDAQClient_t::getUniqueTag |
( |
| ) |
const |
|
inlineinherited |
Get unique tag of this run control client.
- Returns
- unique tag
Definition at line 130 of file JDAQClient.hh.
◆ getClockDelay()
long long int KM3NETDAQ::JDAQClient_t::getClockDelay |
( |
| ) |
const |
|
inlineinherited |
Get total delay time.
- Returns
- delay time [us]
Definition at line 141 of file JDAQClient.hh.
◆ getClockInterval()
long long int KM3NETDAQ::JDAQClient_t::getClockInterval |
( |
| ) |
const |
|
inlineinherited |
Get interval time.
- Returns
- interval time [us]
Definition at line 153 of file JDAQClient.hh.
◆ setClockInterval()
void KM3NETDAQ::JDAQClient_t::setClockInterval |
( |
const long long int |
interval_us | ) |
|
|
inlineinherited |
Set interval time.
- Parameters
-
interval_us | interval time [us] |
Definition at line 164 of file JDAQClient.hh.
◆ resetClock()
void KM3NETDAQ::JDAQClient_t::resetClock |
( |
| ) |
|
|
inlineinherited |
◆ getEventNumber()
int KM3NETDAQ::JDAQClient_t::getEventNumber |
( |
| ) |
const |
|
inlineinherited |
Get last event number.
- Returns
- event number
Definition at line 184 of file JDAQClient.hh.
◆ setEventNumber()
void KM3NETDAQ::JDAQClient_t::setEventNumber |
( |
const int |
event_number | ) |
|
|
inlineinherited |
◆ DEBUG_LEVEL
const int AcousticDataFilter::DEBUG_LEVEL =1 |
|
static |
◆ exit_
boost::atomic<bool> AcousticDataFilter::exit_ |
|
private |
◆ running_
boost::atomic<bool> AcousticDataFilter::running_ |
|
private |
◆ address_
std::string AcousticDataFilter::address_ |
|
private |
◆ port_
std::string AcousticDataFilter::port_ |
|
private |
◆ probes_
◆ doms_
◆ links_
◆ server_threads_
boost::thread_group AcousticDataFilter::server_threads_ |
|
private |
◆ server_io_service_
boost::asio::io_service AcousticDataFilter::server_io_service_ |
|
private |
◆ server_work_
boost::asio::io_service::work* AcousticDataFilter::server_work_ |
|
private |
◆ server_acceptor_
boost::asio::ip::tcp::acceptor AcousticDataFilter::server_acceptor_ |
|
private |
◆ trigger_threads_
boost::thread_group AcousticDataFilter::trigger_threads_ |
|
private |
◆ trigger_io_service_
boost::asio::io_service AcousticDataFilter::trigger_io_service_ |
|
private |
◆ trigger_work_
boost::asio::io_service::work* AcousticDataFilter::trigger_work_ |
|
private |
◆ strand_
boost::asio::io_service::strand AcousticDataFilter::strand_ |
|
private |
◆ debug_file_path_
std::string AcousticDataFilter::debug_file_path_ |
|
private |
◆ toa_file_path_
std::string AcousticDataFilter::toa_file_path_ |
|
private |
◆ toa_file_
std::ofstream AcousticDataFilter::toa_file_ |
|
private |
◆ wisdom_file_
std::string AcousticDataFilter::wisdom_file_ |
|
private |
◆ server
JSharedPointer<JControlHost> KM3NETDAQ::JDAQClient::server |
|
protectedinherited |
◆ logger
◆ select
JSelectReader KM3NETDAQ::JDAQClient::select |
|
privateinherited |
◆ parser
JParser KM3NETDAQ::JDAQClient::parser |
|
privateinherited |
◆ subscription
JSubscriptionList KM3NETDAQ::JDAQClient::subscription |
|
privateinherited |
◆ root
◆ Main
◆ ev_daq_transitions
const int JDAQStateMachine::ev_daq_transitions |
|
staticprivateinherited |
◆ ev_daq
◆ ev_daq_param_block
char JDAQStateMachine::ev_daq_param_block[sizeof(ev_daq_event::param_block)] |
|
inherited |
◆ ev_init_transitions
const int JDAQStateMachine::ev_init_transitions |
|
staticprivateinherited |
◆ ev_init
◆ ev_init_param_block
char JDAQStateMachine::ev_init_param_block[sizeof(ev_init_event::param_block)] |
|
inherited |
◆ ev_configure_transitions
const int JDAQStateMachine::ev_configure_transitions |
|
staticprivateinherited |
◆ ev_configure
◆ ev_configure_param_block
char JDAQStateMachine::ev_configure_param_block[sizeof(ev_configure_event::param_block)] |
|
inherited |
◆ ev_start_transitions
const int JDAQStateMachine::ev_start_transitions |
|
staticprivateinherited |
◆ ev_start
◆ ev_start_param_block
char JDAQStateMachine::ev_start_param_block[sizeof(ev_start_event::param_block)] |
|
inherited |
◆ ev_pause_transitions
const int JDAQStateMachine::ev_pause_transitions |
|
staticprivateinherited |
◆ ev_pause
◆ ev_pause_param_block
char JDAQStateMachine::ev_pause_param_block[sizeof(ev_pause_event::param_block)] |
|
inherited |
◆ ev_continue_transitions
const int JDAQStateMachine::ev_continue_transitions |
|
staticprivateinherited |
◆ ev_continue
◆ ev_continue_param_block
char JDAQStateMachine::ev_continue_param_block[sizeof(ev_continue_event::param_block)] |
|
inherited |
◆ ev_stop_transitions
const int JDAQStateMachine::ev_stop_transitions |
|
staticprivateinherited |
◆ ev_stop
◆ ev_stop_param_block
char JDAQStateMachine::ev_stop_param_block[sizeof(ev_stop_event::param_block)] |
|
inherited |
◆ ev_reset_transitions
const int JDAQStateMachine::ev_reset_transitions |
|
staticprivateinherited |
◆ ev_reset
◆ ev_reset_param_block
char JDAQStateMachine::ev_reset_param_block[sizeof(ev_reset_event::param_block)] |
|
inherited |
◆ ev_quit_transitions
const int JDAQStateMachine::ev_quit_transitions |
|
staticprivateinherited |
◆ ev_quit
◆ ev_quit_param_block
char JDAQStateMachine::ev_quit_param_block[sizeof(ev_quit_event::param_block)] |
|
inherited |
◆ ev_off_transitions
const int JDAQStateMachine::ev_off_transitions |
|
staticprivateinherited |
◆ ev_off
◆ ev_off_param_block
char JDAQStateMachine::ev_off_param_block[sizeof(ev_off_event::param_block)] |
|
inherited |
◆ ev_check_transitions
const int JDAQStateMachine::ev_check_transitions |
|
staticprivateinherited |
◆ ev_check
◆ ev_check_param_block
char JDAQStateMachine::ev_check_param_block[sizeof(ev_check_event::param_block)] |
|
inherited |
◆ ev_input_transitions
const int JDAQStateMachine::ev_input_transitions |
|
staticprivateinherited |
◆ ev_input
◆ ev_input_param_block
char JDAQStateMachine::ev_input_param_block[sizeof(ev_input_event::param_block)] |
|
inherited |
◆ ev_recover_transitions
const int JDAQStateMachine::ev_recover_transitions |
|
staticprivateinherited |
◆ ev_recover
◆ ev_recover_param_block
char JDAQStateMachine::ev_recover_param_block[sizeof(ev_recover_event::param_block)] |
|
inherited |
◆ ev_error_transitions
const int JDAQStateMachine::ev_error_transitions |
|
staticprivateinherited |
◆ ev_error
◆ ev_error_param_block
char JDAQStateMachine::ev_error_param_block[sizeof(ev_error_event::param_block)] |
|
inherited |
◆ state_
CHSM_ns_alias::state* JDAQStateMachine::state_[11] |
|
privateinherited |
◆ transition_
const CHSM_ns_alias::transition JDAQStateMachine::transition_ |
|
staticprivateinherited |
◆ taken_
const CHSM_ns_alias::event* JDAQStateMachine::taken_[14] |
|
privateinherited |
◆ target_
CHSM_ns_alias::state* JDAQStateMachine::target_[14] |
|
privateinherited |
◆ name
std::string JDAQCHSM::name |
|
protectedinherited |
◆ detector_id
int JDAQCHSM::detector_id |
|
protectedinherited |
◆ run_number
◆ TIMEOUT_S
const int KM3NETDAQ::JDAQClient_t::TIMEOUT_S = 1 |
|
staticinherited |
◆ eventTable
JEventTable KM3NETDAQ::JDAQClient_t::eventTable |
|
protectedinherited |
◆ hostname
std::string KM3NETDAQ::JDAQClient_t::hostname |
|
protectedinherited |
◆ fullname
std::string KM3NETDAQ::JDAQClient_t::fullname |
|
protectedinherited |
◆ unique_tag
JTag KM3NETDAQ::JDAQClient_t::unique_tag |
|
protectedinherited |
◆ clock
JTimekeeper KM3NETDAQ::JDAQClient_t::clock |
|
protectedinherited |
◆ event_number
int KM3NETDAQ::JDAQClient_t::event_number |
|
protectedinherited |
The documentation for this class was generated from the following files:
virtual void actionStart(int, const char *)
Level specific message streamers.
Interface for logging messages.
const JNET::JTag & clientTag() const
static const JNET::JTag RC_FAIL
std::pair< std::size_t, pProbe > probe_entry
std::string toa_file_path_
void Create_probes(std::vector< std::string > probes, std::size_t window)
static const std::string TOKEN_DELIMETER
void setSelect()
Set the file descriptor mask for the select call.
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
boost::asio::io_service trigger_io_service_
const CHSM::state * getState() const
Get current state.
static const JNET::JTag RC_AFILTER
virtual void actionContinue(int, const char *)
Data structure to store command line arguments.
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void A5(CHSM_ns_alias::event const &)
virtual void enterState(const CHSM::state &state, const CHSM::event &event)
Action when entering state.
virtual void actionRecover(int, const char *)
virtual void actionReset(int, const char *)
boost::shared_ptr< KM3NeT_Acoustic_Link > pLink
boost::atomic< bool > exit_
JParser parser
parser method enter()
void wait() const
Wait until the number of time intervals has elapsed since the last call to the reset method.
static const int TIMEOUT_S
time out of update [s]
void A3(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_check_event ev_check
JFileDescriptorMask & getReaderMask()
Get reader mask.
std::vector< pLink > links_
boost::asio::io_service::work * server_work_
void run()
Run as run control client following command messages via JNET::JControlHost.
static const JNET::JTag RC_REPLY
const JTag & getTag() const
Get tag.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
const std::string & getName() const
Get name of state machine.
static JNullStream null
Null I/O stream.
boost::thread_group server_threads_
void A6(CHSM_ns_alias::event const &)
JEventTable eventTable
event table
void Send_toa(ToA_Packet packet)
JSharedPointer< JControlHost > server
message server
boost::shared_ptr< KM3NeT_DOM > pDOM
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
virtual bool filter(const JTag &tag, int length, const char *buffer)
Filter message.
JSelectReader select
select call
void Accept_completed(pLink link, const boost::system::error_code &error)
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
void error(const JMessage_t &message)
void reset(const long long int t0)
Reset time.
std::map< std::size_t, pDOM > doms_
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
boost::thread_group trigger_threads_
static JEvent_t toValue(const std::string &buffer)
Convert string to event.
void replaceEvent(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace tag of given event in event table.
boost::asio::io_service server_io_service_
void A8(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_start_event ev_start
boost::asio::io_service::strand strand_
virtual void actionPause(int, const char *)
void A2(CHSM_ns_alias::event const &)
virtual void actionTagged(const JTag &tag, int length, const char *buffer)
This method is called when a custom tag is encountered.
bool hasReaderMask(const JAbstractFile &file) const
Has reader file.
boost::shared_ptr< KM3::TOALIB::CTOAFinder::probeSignalT > pProbe
Message logging based on std::ostream.
virtual bool exit()
Exit the state machine.
#define SERVER_THREAD_POOL
void A12(CHSM_ns_alias::event const &)
void setInterval(const long long int interval_us)
Set interval time.
virtual bool enter()
Enter the state machine.
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
virtual void actionConfigure(int, const char *)
bool isRunning() const
Check if this client is in runnig state.
void Send_toa_async(ToA_Packet packet)
void update()
Update state machine.
bool is_valid() const
Check validity of logger object.
virtual void actionQuit(int, const char *)
void A14(CHSM_ns_alias::event const &)
Control unit client base class.
Message logging based on ControlHost.
std::string to_string(const T &value)
Convert value to string.
void replace(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace entry in table.
void reset(JLogger *__logger=NULL)
Reset logger.
JDAQStateMachine::state_Main::state_RunControl RunControl
void A4(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_error_event ev_error
boost::asio::io_service::work * trigger_work_
JSubscriptionList subscription
custom subscription
JMessageLogger logger
message logger
std::string debug_file_path_
void Create_DOMs(std::vector< std::string > doms, std::string &debug_file_path, std::size_t window, std::size_t overlap)
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
virtual void actionCheck(int, const char *)
void A1(CHSM_ns_alias::event const &)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
long long int getInterval() const
Get interval time.
boost::atomic< bool > running_
const std::string & getFullName() const
Get full name of this run control client.
virtual void actionError()
void setReaderMask(const JAbstractFile &file)
Set reader mask.
JDAQStateMachine::ev_configure_event ev_configure
std::string getStateName(const std::string &name)
Get name of state.
#define DEBUG_MSG(str, lev)
boost::asio::ip::tcp::acceptor server_acceptor_
#define TRIGGER_THREAD_POOL
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription.
void A13(CHSM_ns_alias::event const &)
void A7(CHSM_ns_alias::event const &)
std::string getMessage(const CHSM::state &state, const CHSM::event &event) const
Get event message.
std::map< std::size_t, pProbe > probes_
static const JNET::JTag RC_CMD
virtual void actionStop(int, const char *)
virtual void actionExit()
std::pair< std::size_t, pDOM > dom_entry
int event_number
number of last event
JDAQStateMachine::state_Main Main
char getTokenDelimeter()
Get the token delimeter for command messages.
std::string toString() const
Convert tag to string.
virtual void actionInit(int, const char *)
int getSize() const
Get size.
virtual void actionInput(int, const char *)
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
void A11(CHSM_ns_alias::event const &)
long long int getDelay() const
Get total delay time.
void A10(CHSM_ns_alias::event const &)
JTimekeeper clock
central clock
virtual void actionSelect(const JFileDescriptorMask &mask)
Action method following last select call.
int read(const int argc, const char *const argv[])
Parse the program's command line options.
void setEventNumber(const int event_number)
Set last event number.
void A9(CHSM_ns_alias::event const &)