Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Attributes | Private Member Functions | Private Attributes | List of all members
AcousticDataFilter Class Reference

#include <AcousticDataFilter.h>

Inheritance diagram for AcousticDataFilter:
KM3NETDAQ::JDAQClient JDAQStateMachine KM3NETDAQ::JDAQClient_t JDAQCHSM

Public Member Functions

 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 &parameter)
 Add parameter to parser used in method enter(). More...
 
template<class T >
void addParameter (const char option, T &parameter, 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...
 
const std::string & getName () const
 Get name of state machine. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getRunNumber () const
 Get run number. More...
 
int getRunNumber () const
 Get run number. More...
 
virtual void actionError ()
 
virtual void actionError ()
 
virtual void actionRecover (int, const char *)
 
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...
 

Public Attributes

JDAQStateMachine::state_root root
 
JDAQStateMachine::state_Main Main
 
JDAQStateMachine::ev_daq_event ev_daq
 
char ev_daq_param_block [sizeof(ev_daq_event::param_block)]
 
JDAQStateMachine::ev_init_event ev_init
 
char ev_init_param_block [sizeof(ev_init_event::param_block)]
 
JDAQStateMachine::ev_configure_event ev_configure
 
char ev_configure_param_block [sizeof(ev_configure_event::param_block)]
 
JDAQStateMachine::ev_start_event ev_start
 
char ev_start_param_block [sizeof(ev_start_event::param_block)]
 
JDAQStateMachine::ev_pause_event ev_pause
 
char ev_pause_param_block [sizeof(ev_pause_event::param_block)]
 
JDAQStateMachine::ev_continue_event ev_continue
 
char ev_continue_param_block [sizeof(ev_continue_event::param_block)]
 
JDAQStateMachine::ev_stop_event ev_stop
 
char ev_stop_param_block [sizeof(ev_stop_event::param_block)]
 
JDAQStateMachine::ev_reset_event ev_reset
 
char ev_reset_param_block [sizeof(ev_reset_event::param_block)]
 
JDAQStateMachine::ev_quit_event ev_quit
 
char ev_quit_param_block [sizeof(ev_quit_event::param_block)]
 
JDAQStateMachine::ev_off_event ev_off
 
char ev_off_param_block [sizeof(ev_off_event::param_block)]
 
JDAQStateMachine::ev_check_event ev_check
 
char ev_check_param_block [sizeof(ev_check_event::param_block)]
 
JDAQStateMachine::ev_input_event ev_input
 
char ev_input_param_block [sizeof(ev_input_event::param_block)]
 
JDAQStateMachine::ev_recover_event ev_recover
 
char ev_recover_param_block [sizeof(ev_recover_event::param_block)]
 
JDAQStateMachine::ev_error_event ev_error
 
char ev_error_param_block [sizeof(ev_error_event::param_block)]
 

Static Public Attributes

static const int DEBUG_LEVEL =1
 
static const int TIMEOUT_S = 1
 time out of update [s] More...
 

Protected Types

typedef void(JDAQCHSM::* action )(int, const char *)
 Type definition of action method. More...
 
typedef void(JDAQCHSM::* action )(int, const char *)
 Type definition of action method. More...
 

Protected Attributes

JSharedPointer< JControlHost > server
 message server More...
 
JMessageLogger logger
 message logger More...
 
std::string name
 
int detector_id
 
int run_number
 
JEventTable eventTable
 event table More...
 
std::string hostname
 
std::string fullname
 
JTag unique_tag
 
JTimekeeper clock
 central clock More...
 
int event_number
 number of last event More...
 

Private Member Functions

const JNET::JTagclientTag () 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)
 

Private Attributes

boost::atomic< bool > exit_
 
boost::atomic< bool > running_
 
std::string address_
 
std::string port_
 
std::map< std::size_t, pProbeprobes_
 
std::map< std::size_t, pDOMdoms_
 
std::vector< pLinklinks_
 
boost::thread_group server_threads_
 
boost::asio::io_service server_io_service_
 
boost::asio::io_service::work * server_work_
 
boost::asio::ip::tcp::acceptor server_acceptor_
 
boost::thread_group trigger_threads_
 
boost::asio::io_service trigger_io_service_
 
boost::asio::io_service::work * trigger_work_
 
boost::asio::io_service::strand strand_
 
std::string debug_file_path_
 
std::string toa_file_path_
 
std::ofstream toa_file_
 
std::string wisdom_file_
 

Detailed Description

Definition at line 46 of file AcousticDataFilter.h.

Member Typedef Documentation

typedef void(JDAQCHSM::* JDAQCHSM::action)(int, const char *)
protectedinherited

Type definition of action method.

Definition at line 141 of file JDAQCHSM.chsm.

typedef void(JDAQCHSM::* JDAQCHSM::action)(int, const char *)
protectedinherited

Type definition of action method.

Definition at line 152 of file JDAQCHSM.hh.

Constructor & Destructor Documentation

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 
)

Definition at line 63 of file AcousticDataFilter.cpp.

71  : KM3NETDAQ::JDAQClient(name,server,logger,level),\
74 {
75  DEBUG_MSG("Constructor",0);
76 
78 
79  address_=address;
80  port_=port;
81  exit_=false;
82  running_=false;
83  wisdom_file_=wisdom;
84  toa_file_path_=output;
85  debug_file_path_=raw;
86 
87 }
boost::atomic< bool > exit_
JDAQStateMachine::ev_configure_event ev_configure
boost::asio::io_service trigger_io_service_
boost::asio::io_service::strand strand_
std::string name
Definition: JDAQCHSM.chsm:154
void replaceEvent(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace tag of given event in event table.
Definition: JDAQClient.hh:492
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:800
const JNET::JTag & clientTag() const
boost::atomic< bool > running_
Control unit client base class.
Definition: JDAQClient.hh:272
boost::asio::ip::tcp::acceptor server_acceptor_
boost::asio::io_service server_io_service_
std::string debug_file_path_
static const JNET::JTag RC_CMD
Definition: JDAQTags.hh:44
#define DEBUG_MSG(str, lev)
AcousticDataFilter::~AcousticDataFilter ( )
virtual

Definition at line 89 of file AcousticDataFilter.cpp.

90 {
91  DEBUG_MSG("Destructor",0);
92  Stop();
93 }
#define DEBUG_MSG(str, lev)

Member Function Documentation

void AcousticDataFilter::Send_toa_async ( ToA_Packet  packet)
inline

Definition at line 62 of file AcousticDataFilter.h.

62 {strand_.post(boost::bind(&AcousticDataFilter::Send_toa,this,packet));};
boost::asio::io_service::strand strand_
void Send_toa(ToA_Packet packet)
virtual void AcousticDataFilter::actionEnter ( )
inlinevirtual

Interface methods for actions corresponding to state transitions.

Reimplemented from JDAQCHSM.

Definition at line 64 of file AcousticDataFilter.h.

64 {};
virtual void AcousticDataFilter::actionExit ( )
inlinevirtual

Reimplemented from JDAQCHSM.

Definition at line 65 of file AcousticDataFilter.h.

65 {exit_=true;};
boost::atomic< bool > exit_
void AcousticDataFilter::actionInit ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 157 of file AcousticDataFilter.cpp.

158 {
159  DEBUG_MSG("SM:Init",2);
160  FILE* pfile;
161  pfile=fopen(wisdom_file_.c_str(),"r");
162  if (pfile!=NULL)
163  {
164  if (fftwf_import_wisdom_from_file(pfile)==1)
165  {
166  DEBUG_MSG("SM:Init wisdom imported",2);
167  }
168  fclose(pfile);
169  }
170 }
do FILE
Definition: JFilter.sh:49
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionConfigure ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 185 of file AcousticDataFilter.cpp.

186 {
187  DEBUG_MSG("SM:Configure",2);
188  Parser dummy(std::string(buffer, length),';');
189  DEBUG_MSG("SM:Cerco",2);
190 
191  std::string l_debug_file_path;
192  std::string l_window;
193  std::string l_overlap;
194  std::vector<std::string> l_toa_path;
195  std::vector<std::string> l_dbg_path;
196  std::vector<std::string> l_probes;
197  std::vector<std::string> l_dom_configuration;
198 
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");
203 
204  l_toa_path=dummy.Find("ADF_TOA_path");
205  if (l_toa_path.size()!=0) toa_file_path_=l_toa_path[0];
206  l_dbg_path=dummy.Find("ADF_DBG_path");
207  if (l_dbg_path.size()!=0) debug_file_path_=l_dbg_path[0];
208 
209  DEBUG_MSG("SM:Configure. win="<<l_window,2);
210  DEBUG_MSG("SM:Configure. ovr="<<l_overlap,2);
211  DEBUG_MSG("SM:Configure. TOA_path="<<toa_file_path_,2);
212  DEBUG_MSG("SM:Configure. DBG_path="<<debug_file_path_,2);
213 
214  DEBUG_MSG("SM:Configure. n dom="<<l_dom_configuration.size(),2);
215  DEBUG_MSG("SM:Configure. n pro="<<l_probes.size(),2);
216 
217  Create_probes(l_probes,atoi(l_window.c_str()));
218  Create_DOMs(l_dom_configuration,debug_file_path_,atoi(l_window.c_str()),atoi(l_overlap.c_str()));
219 
220  Start();
221 
222 }
void Create_probes(std::vector< std::string > probes, std::size_t window)
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)
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionStart ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 224 of file AcousticDataFilter.cpp.

225 {
226  DEBUG_MSG("SM start",2);
227  running_=true;
228  strand_.post(boost::bind(&AcousticDataFilter::Start_accept,this));
229 }
boost::asio::io_service::strand strand_
boost::atomic< bool > running_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionPause ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 338 of file AcousticDataFilter.cpp.

339 {
340  DEBUG_MSG("SM: pause",2);
341  running_=false;
342 }
boost::atomic< bool > running_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionContinue ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 344 of file AcousticDataFilter.cpp.

345 {
346  DEBUG_MSG("SM: continue",2);
347  running_=true;
348 }
boost::atomic< bool > running_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionStop ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 350 of file AcousticDataFilter.cpp.

351 {
352  DEBUG_MSG("SM:Stop",2);
353  Stop();
354 }
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionReset ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 172 of file AcousticDataFilter.cpp.

173 {
174  DEBUG_MSG("SM:Reset",2);
175  FILE* pfile;
176  pfile=fopen(wisdom_file_.c_str(),"w");
177  if (pfile!=NULL)
178  {
179 DEBUG_MSG("SM:Reset wisdom saved",2);
180  fftwf_export_wisdom_to_file(pfile);
181  fclose(pfile);
182  }
183 }
do FILE
Definition: JFilter.sh:49
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::actionQuit ( int  length,
const char *  buffer 
)
virtual

Reimplemented from JDAQCHSM.

Definition at line 356 of file AcousticDataFilter.cpp.

357 {
358  DEBUG_MSG("SM:Quit",2);
359  Stop();
360 }
#define DEBUG_MSG(str, lev)
virtual void AcousticDataFilter::actionInput ( int  length,
const char *  buffer 
)
inlinevirtual

This method is called at ev_input.

Parameters
lengthlength of data
bufferpointer to data

Reimplemented from KM3NETDAQ::JDAQClient.

Definition at line 74 of file AcousticDataFilter.h.

74 {};
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.

75 {};
const JNET::JTag& AcousticDataFilter::clientTag ( ) const
inlineprivate

Definition at line 79 of file AcousticDataFilter.h.

79 { return KM3NETDAQ::RC_AFILTER; };
static const JNET::JTag RC_AFILTER
Definition: JDAQTags.hh:56
void AcousticDataFilter::Create_probes ( std::vector< std::string >  probes,
std::size_t  window 
)
private

Definition at line 231 of file AcousticDataFilter.cpp.

232 {
233  DEBUG_MSG("Create probes",1);
234 
235  for(int t=0;t<probes.size();++t)
236  {
237  std::istringstream l_iss(probes.at(t));
238  std::string l_line;
239  uint32_t l_id;
240  uint32_t l_samples;
241  real_type* l_buffer;
242 
243  std::getline(l_iss, l_line,' ');
244  l_id=atoi(l_line.c_str());
245  DEBUG_MSG("id probe="<<l_id,1);
246  std::getline(l_iss, l_line,' ');
247  l_samples=atoi(l_line.c_str());
248  DEBUG_MSG("n samples="<<l_samples,1);
249  l_buffer=(real_type*)malloc(l_samples*sizeof(real_type));
250  for (uint32_t i=0; i<l_samples; ++i)
251  {
252  std::getline(l_iss, l_line,' ');
253  real_type l_dummy=atof(l_line.c_str());
254  DEBUG_MSG("sample="<<l_dummy,0);
255  l_buffer[i]=l_dummy;
256  }
257  DEBUG_MSG("creating probes",1);
258  pProbe l_probe = boost::make_shared<KM3::TOALIB::CTOAFinder::probeSignalT>(*(new KM3::TOALIB::CTOAFinder::probeSignalT(window)));
259  DEBUG_MSG("copying data",1);
260  l_probe->copyFromBuffer(l_buffer,l_samples);
261  DEBUG_MSG("insert probe",1);
262  probes_.insert(probe_entry(l_id,l_probe));
263  }
264  DEBUG_MSG("Probes creation finished",1);
265 }
std::map< std::size_t, pProbe > probes_
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
boost::shared_ptr< KM3::TOALIB::CTOAFinder::probeSignalT > pProbe
std::pair< std::size_t, pProbe > probe_entry
#define DEBUG_MSG(str, lev)
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.

268 {
269  DEBUG_MSG("Create DOM",1);
270 
271  for(int t=0;t<dom_configuration.size();++t)
272  {
273  std::istringstream l_iss(dom_configuration.at(t));
274  std::string l_line;
275  uint32_t l_dom_id;
276  uint32_t l_probe_id;
277  uint32_t l_threshold;
278  uint32_t l_waveforms;
279  uint32_t l_test;
280 
281  std::getline(l_iss, l_line,' ');
282  l_dom_id=atoi(l_line.c_str());
283  DEBUG_MSG("DOM id="<<l_dom_id,1);
284  pDOM l_dom = boost::make_shared<KM3NeT_DOM>(*(new KM3NeT_DOM( trigger_io_service_,\
285  boost::bind(&AcousticDataFilter::Send_toa_async, this, _1),\
286  debug_file_path,\
287  window,\
288  overlap)));
289  doms_.insert(dom_entry(l_dom_id,l_dom));
290  std::getline(l_iss, l_line,' ');
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)
294  {
295  std::getline(l_iss, l_line,' ');
296  l_probe_id=atoi(l_line.c_str());
297  std::getline(l_iss, l_line,' ');
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);
301  }
302  std::getline(l_iss, l_line,' ');
303  l_test=atoi(l_line.c_str());
304  DEBUG_MSG("setting test id="<<l_test,1);
305  l_dom->Set_test(l_test);
306  }
307  DEBUG_MSG("DOMs creation finished",1);
308 }
void Send_toa_async(ToA_Packet packet)
boost::asio::io_service trigger_io_service_
std::map< std::size_t, pProbe > probes_
boost::shared_ptr< KM3NeT_DOM > pDOM
Definition: KM3NeT_DOM.h:65
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
std::map< std::size_t, pDOM > doms_
bool overlap(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Test overlap between ranges.
Definition: JRange.hh:664
#define DEBUG_MSG(str, lev)
std::pair< std::size_t, pDOM > dom_entry
void AcousticDataFilter::Start_accept ( )
private

Definition at line 138 of file AcousticDataFilter.cpp.

139 {
140  DEBUG_MSG("Start accept",2);
142  links_.push_back(l_link);
143  server_acceptor_.async_accept(l_link->Socket(), boost::bind(&AcousticDataFilter::Accept_completed, this, l_link, boost::asio::placeholders::error));
144 }
std::vector< pLink > links_
std::map< std::size_t, pDOM > doms_
void Accept_completed(pLink link, const boost::system::error_code &error)
boost::asio::ip::tcp::acceptor server_acceptor_
boost::asio::io_service server_io_service_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::Accept_completed ( pLink  link,
const boost::system::error_code &  error 
)
private

Definition at line 146 of file AcousticDataFilter.cpp.

147 {
148  DEBUG_MSG("Accept completed",2);
149 
150  if (!error)
151  {
152  link->Start_reading();
153  strand_.post(boost::bind(&AcousticDataFilter::Start_accept,this));
154  }
155 }
boost::asio::io_service::strand strand_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::Start ( )
private

Definition at line 95 of file AcousticDataFilter.cpp.

96 {
97  DEBUG_MSG("Start",2);
98  server_work_ = new boost::asio::io_service::work(server_io_service_);
99  trigger_work_ = new boost::asio::io_service::work(trigger_io_service_);
100 
101  boost::asio::ip::tcp::resolver l_resolver(server_io_service_);
102  boost::asio::ip::tcp::resolver::query l_query(address_,port_);
103  boost::asio::ip::tcp::endpoint l_endpoint = *l_resolver.resolve(l_query);
104  server_acceptor_.open(l_endpoint.protocol());
105  server_acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
106  server_acceptor_.bind(l_endpoint);
107  server_acceptor_.listen();
108 
109  for (std::size_t i=0; i<SERVER_THREAD_POOL; ++i) { server_threads_.create_thread(boost::bind(&boost::asio::io_service::run,&server_io_service_)); }
110  for (std::size_t i=0; i<TRIGGER_THREAD_POOL; ++i) { trigger_threads_.create_thread(boost::bind(&boost::asio::io_service::run,&trigger_io_service_)); }
111 }
boost::asio::io_service trigger_io_service_
boost::asio::io_service::work * server_work_
boost::thread_group trigger_threads_
#define TRIGGER_THREAD_POOL
boost::thread_group server_threads_
boost::asio::ip::tcp::acceptor server_acceptor_
boost::asio::io_service server_io_service_
#define SERVER_THREAD_POOL
boost::asio::io_service::work * trigger_work_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::Stop ( )
private

Definition at line 113 of file AcousticDataFilter.cpp.

114 {
115  DEBUG_MSG("Stop",2);
116 
117  server_acceptor_.close();
118  delete server_work_;
119 
121  for (i=links_.begin(); i!=links_.end(); ++i){ (*i)->Disconnect(); }
122  server_io_service_.stop();
123  server_threads_.join_all();
124  server_io_service_.reset();
125 
126  delete trigger_work_;
127  trigger_io_service_.stop();
128  trigger_threads_.join_all();
129  trigger_io_service_.reset();
130 
131  links_.clear();
132  doms_.clear();
133  probes_.clear();
134 
135  if (toa_file_.is_open()) toa_file_.close();
136 }
boost::asio::io_service trigger_io_service_
std::map< std::size_t, pProbe > probes_
boost::asio::io_service::work * server_work_
boost::thread_group trigger_threads_
std::vector< pLink > links_
std::map< std::size_t, pDOM > doms_
boost::thread_group server_threads_
boost::asio::ip::tcp::acceptor server_acceptor_
boost::asio::io_service server_io_service_
boost::asio::io_service::work * trigger_work_
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::Open_toa_file ( )
private

Definition at line 329 of file AcousticDataFilter.cpp.

330 {
331  std::string l_file=toa_file_path_;
332  std::time_t seconds = std::time(0);
333  l_file+="TOA_"+std::to_string((long long unsigned int)seconds)+".bin";
334  toa_file_.open(l_file.c_str(),std::ofstream::binary);
335  DEBUG_MSG("Toa file opened at "<<seconds,1);
336 }
std::string to_string(const T &value)
Convert value to string.
#define DEBUG_MSG(str, lev)
void AcousticDataFilter::Send_toa ( ToA_Packet  packet)
private

Definition at line 310 of file AcousticDataFilter.cpp.

311 {
312  if (!running_) return;
313 
314  DEBUG_MSG("Sent toa from ID="<<packet.Header.DOM_Identifier,3);
315 
316  if (!toa_file_.is_open()) Open_toa_file();
317 
318  if (toa_file_.tellp()>MAX_TOA_SIZE)
319  {
320  DEBUG_MSG("Toa file closed",1);
321  toa_file_.close();
322  Open_toa_file();
323  }
324 
325  if (toa_file_.is_open()) toa_file_.write((char*)&packet,sizeof(ToA_Packet));
326 
327 }
boost::atomic< bool > running_
#define MAX_TOA_SIZE
DAQ_Common_Header Header
#define DEBUG_MSG(str, lev)
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
argsarray of command line arguments
Returns
true if okay; else false

Definition at line 363 of file JDAQClient.hh.

364  {
365  using namespace std;
366 
367  string server;
368  string logger;
369  int level;
370  bool use_cout;
371 
372  try {
373 
374  parser['H'] = make_field(server) = "localhost";
375  parser['M'] = make_field(logger) = "localhost";
376  parser['d'] = make_field(level) = 0;
377  parser['c'] = make_field(use_cout);
378 
379  if (parser.read(args) != 0) {
380  return false;
381  }
382  }
383  catch(const exception &error) {
384  cerr << error.what() << endl;
385  return false;
386  }
387 
388  try {
389 
390  JLogger* out = NULL;
391 
392  if (use_cout)
393  out = new JStreamLogger(cout);
394  else
395  out = new JControlHostLogger(logger);
396 
397  this->logger = JMessageLogger(out, getName(), level);
398 
399  this->server.reset(new JControlHost(server));
400 
401  return enter();
402  }
403  catch(const JControlHostException& error) {
404  cerr << error << endl;
405  return false;
406  }
407  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1027
Message logging based on std::ostream.
Interface for logging messages.
Definition: JLogger.hh:22
Message logging based on ControlHost.
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:800
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
virtual bool enter()
Enter the state machine.
Definition: JDAQClient.hh:418
int read(const int argc, const char *const argv[])
Parse the program&#39;s command line options.
Definition: JParser.hh:1791
JMessageLogger logger
message logger
Definition: JDAQClient.hh:801
const std::string & getName() const
Get name of state machine.
Definition: JDAQCHSM.chsm:78
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.

419  {
420  using namespace std;
421  using namespace JPP;
422 
423  if (server.is_valid() && logger.is_valid()) {
424 
425  const JSubscriptionList buffer = getSubscription(eventTable) + subscription;
426 
427  try {
428 
429  server->Subscribe(buffer);
430  server->SendMeAlways();
431  server->MyId(getFullName());
432 
433  JNoticeStream(logger) << "Nick name \"" << getFullName() << "\" subscription: " << buffer.toString();
434 
435  return CHSM::machine::enter();
436  }
437  catch(const JControlHostException& error) {
438  JErrorStream(logger) << error;
439  }
440 
441  } else {
442  cerr << "Message server or logger not properly initialised." << endl;
443  }
444 
445  return false;
446  }
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:800
JSubscriptionList subscription
custom subscription
Definition: JDAQClient.hh:1028
JEventTable eventTable
event table
Definition: JDAQClient.hh:202
bool is_valid() const
Check validity of logger object.
const std::string & getFullName() const
Get full name of this run control client.
Definition: JDAQClient.hh:119
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription.
Definition: JEventTable.hh:129
JMessageLogger logger
message logger
Definition: JDAQClient.hh:801
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.

457  {
458  try {
459  if (server.is_valid()) { server.reset(NULL); }
460  }
461  catch(const JControlHostException& error) {
462  }
463 
464  try {
465  if (logger.is_valid()) { logger.reset(NULL); }
466  }
467  catch(const JControlHostException& error) {
468  }
469 
470  return CHSM::machine::exit();
471  }
void reset(JLogger *__logger=NULL)
Reset logger.
exit
Definition: JPizza.sh:36
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:800
bool is_valid() const
Check validity of logger object.
JMessageLogger logger
message logger
Definition: JDAQClient.hh:801
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.

480  {
481  return Main.RunControl.Operational.Running.active();
482  }
JDAQStateMachine::state_Main Main
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
JDAQStateMachine::state_Main::state_RunControl RunControl
void KM3NETDAQ::JDAQClient::replaceEvent ( const JTag oldTag,
const JTag newTag,
JDAQEvent_t event 
)
inlineinherited

Replace tag of given event in event table.

Parameters
oldTagold tag
newTagnew tag
eventevent

Definition at line 492 of file JDAQClient.hh.

495  {
496  eventTable.replace(oldTag, newTag, event);
497  }
void replace(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace entry in table.
Definition: JEventTable.hh:96
JEventTable eventTable
event table
Definition: JDAQClient.hh:202
JDAQEvent_t* KM3NETDAQ::JDAQClient::findEvent ( const JTag tag,
const std::string &  event_name 
)
inlineinherited

Find event in event table.

Parameters
tagtag
event_nameevent name
Returns
pointer to event or NULL

Definition at line 507 of file JDAQClient.hh.

508  {
509  JEventTable::const_iterator i = eventTable.find(tag, event_name);
510 
511  if (i != eventTable.end())
512  return i->second;
513  else
514  return NULL;
515  }
JEventTable eventTable
event table
Definition: JDAQClient.hh:202
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
Definition: JEventTable.hh:116
void KM3NETDAQ::JDAQClient::addSubscription ( const JSubscription subscription)
inlineinherited

Add custom subscription.

Parameters
subscriptionsubscription

Definition at line 523 of file JDAQClient.hh.

524  {
526  }
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
JSubscriptionList subscription
custom subscription
Definition: JDAQClient.hh:1028
template<class T >
void KM3NETDAQ::JDAQClient::addParameter ( const char  option,
T parameter 
)
inlineinherited

Add parameter to parser used in method enter().

Parameters
optionoption
parameterparameter

Definition at line 536 of file JDAQClient.hh.

537  {
538  parser[option] = make_field(parameter);
539  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1027
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
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
optionoption
parameterparameter
valuedefault value

Definition at line 550 of file JDAQClient.hh.

551  {
552  parser[option] = make_field(parameter) = value;
553  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1027
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
void KM3NETDAQ::JDAQClient::setSelect ( )
inlineinherited

Set the file descriptor mask for the select call.

Definition at line 559 of file JDAQClient.hh.

560  {
561  select.reset();
562 
564 
566  }
JSelectReader select
select call
Definition: JDAQClient.hh:1026
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:800
JFileDescriptorMask & getReaderMask()
Get reader mask.
void setReaderMask(const JAbstractFile &file)
Set reader mask.
void reset()
Reset.
void setSelect()
Set the file descriptor mask for the select call.
Definition: JDAQClient.hh:559
virtual void KM3NETDAQ::JDAQClient::setSelect ( JFileDescriptorMask mask) const
inlinevirtualinherited

Set the file descriptor mask for the select call.

This implementation does nothing but may be redefined by the derived class.

Parameters
maskfile descriptor mask

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::JDataWriter, and KM3NETDAQ::MonitorRouter.

Definition at line 575 of file JDAQClient.hh.

576  {}
virtual void KM3NETDAQ::JDAQClient::actionSelect ( const JFileDescriptorMask mask)
inlinevirtualinherited

Action method following last select call.

This implementation does nothing but may be redefined by the derived class.

Parameters
maskfile descriptor mask

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::DataQueue, KM3NETDAQ::JDataWriter, and KM3NETDAQ::MonitorRouter.

Definition at line 585 of file JDAQClient.hh.

586  {}
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
tagtag
lengthnumber of characters
buffermessage
Returns
skip message or not

Definition at line 633 of file JDAQClient.hh.

634  {
635  return false;
636  }
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
tagtag
lengthlength of data
bufferpointer to data

Reimplemented in KM3NETDAQ::JDataFilter.

Definition at line 646 of file JDAQClient.hh.

647  {
648  }
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.

662  {
663  using namespace std;
664 
665  while (active()) {
666 
667  try {
668 
669  setSelect();
670 
671  if (select(JTimeval(TIMEOUT_S,0)) > 0) {
672 
673  if (select.hasReaderMask(*server)) {
674  update();
675  }
676 
678 
679  } else {
680 
681  continue;
682  }
683 
684 
685  if (isRunning() && clock.getInterval() != 0LL) {
686 
687  long long int numberOfCalls = 0;
688 
689  clock.reset();
690 
691  do {
692 
693  ++numberOfCalls;
694 
695  setSelect();
696 
697  if (clock.wait(select.getReaderMask())) {
698 
699  if (select.hasReaderMask(*server)) {
700  update();
701  }
702 
704 
705  } else {
706 
707  try {
708  actionRunning();
709  }
710  catch(const exception& error) {
711  logger.error(error.what());
712  }
713  }
714 
715  } while (isRunning());
716 
717  if (numberOfCalls != 0) {
718  JNoticeStream(logger) << "Delay per call " << clock.getDelay() / numberOfCalls / 1000 << " ms";
719  }
720  }
721  }
722  catch(const exception& error) {
723  JErrorStream(logger) << "method run(): " << error.what();
724  }
725  }
726  }
long long int getDelay() const
Get total delay time.
Definition: JTimekeeper.hh:78
JTimekeeper clock
central clock
Definition: JDAQClient.hh:206
static const int TIMEOUT_S
time out of update [s]
Definition: JDAQClient.hh:61
JSelectReader select
select call
Definition: JDAQClient.hh:1026
void reset(const long long int t0)
Reset time.
Definition: JTimekeeper.hh:100
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:800
JFileDescriptorMask & getReaderMask()
Get reader mask.
void wait() const
Wait until the number of time intervals has elapsed since the last call to the reset method...
Definition: JTimekeeper.hh:145
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
Definition: JDAQClient.hh:596
bool isRunning() const
Check if this client is in runnig state.
Definition: JDAQClient.hh:479
void update()
Update state machine.
Definition: JDAQClient.hh:808
long long int getInterval() const
Get interval time.
Definition: JTimekeeper.hh:67
JMessageLogger logger
message logger
Definition: JDAQClient.hh:801
void error(const JMessage_t &message)
void setSelect()
Set the file descriptor mask for the select call.
Definition: JDAQClient.hh:559
virtual void actionSelect(const JFileDescriptorMask &mask)
Action method following last select call.
Definition: JDAQClient.hh:585
bool hasReaderMask(const JAbstractFile &file) const
Has reader file.
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
portport number

Definition at line 741 of file JDAQClient.hh.

742  {
743  JControlHostServer local_server(port);
744 
745  for ( ; ; ) {
746 
747  JControlHost* ps = local_server.AcceptClient();
748 
749  ps->Connected();
750 
751  JNET::JPrefix prefix;
752 
753  ps->WaitHead(prefix);
754 
755  const int length = prefix.getSize();
756 
757  char* buffer = new char[length];
758 
759  ps->GetFullData(buffer, length);
760  ps->PutFullData(prefix.toString(), buffer, length);
761 
762  delete ps;
763 
764  enter(JArgs(std::string(buffer, length)));
765 
766  delete [] buffer;
767 
768  run();
769 
770  exit();
771  }
772  }
ControlHost prefix.
Definition: JPrefix.hh:31
void run()
Run as run control client following command messages via JNET::JControlHost.
Definition: JDAQClient.hh:661
int getSize() const
Get size.
Definition: JPrefix.hh:62
virtual bool enter()
Enter the state machine.
Definition: JDAQClient.hh:418
virtual bool exit()
Exit the state machine.
Definition: JDAQClient.hh:456
std::string toString() const
Convert tag to string.
Definition: JTag.hh:167
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
ininput stream

Definition at line 786 of file JDAQClient.hh.

787  {
788  using namespace std;
789 
790  string tag;
791  string buffer;
792 
793  while (in >> tag && in >> skipws && getline(in, buffer, ';')) {
794  update(tag, buffer.length(), buffer.data());
795  }
796  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
void update()
Update state machine.
Definition: JDAQClient.hh:808
void JDAQStateMachine::A1 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 344 of file JDAQCHSM.cc.

344 { actionError(); }
virtual void actionError()
Definition: JDAQCHSM.chsm:124
void JDAQStateMachine::A2 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 346 of file JDAQCHSM.cc.

346 { execute(&JDAQCHSM::actionInit, event); }
virtual void actionInit(int, const char *)
Definition: JDAQCHSM.chsm:112
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A3 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 348 of file JDAQCHSM.cc.

348 { JDAQCHSM::exit(); }
exit
Definition: JPizza.sh:36
void JDAQStateMachine::A4 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 350 of file JDAQCHSM.cc.

virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionConfigure(int, const char *)
Definition: JDAQCHSM.chsm:113
void JDAQStateMachine::A5 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 352 of file JDAQCHSM.cc.

352 { execute(&JDAQCHSM::actionReset, event); }
virtual void actionReset(int, const char *)
Definition: JDAQCHSM.chsm:118
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A6 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 354 of file JDAQCHSM.cc.

354  {
355 
356  std::istringstream is(std::string(ev_start->buffer, ev_start->length));
357 
358  is >> run_number >> detector_id;
359 
361 
362  }
JDAQStateMachine::ev_start_event ev_start
int run_number
Definition: JDAQCHSM.chsm:156
is
Definition: JDAQCHSM.chsm:167
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionStart(int, const char *)
Definition: JDAQCHSM.chsm:114
int detector_id
Definition: JDAQCHSM.chsm:155
void JDAQStateMachine::A7 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 364 of file JDAQCHSM.cc.

364 { execute(&JDAQCHSM::actionQuit, event); }
virtual void actionQuit(int, const char *)
Definition: JDAQCHSM.chsm:119
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A8 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 366 of file JDAQCHSM.cc.

366 { execute(&JDAQCHSM::actionContinue, event); }
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionContinue(int, const char *)
Definition: JDAQCHSM.chsm:116
void JDAQStateMachine::A9 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 368 of file JDAQCHSM.cc.

368 { execute(&JDAQCHSM::actionStop, event); }
virtual void actionStop(int, const char *)
Definition: JDAQCHSM.chsm:117
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A10 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 370 of file JDAQCHSM.cc.

370 { execute(&JDAQCHSM::actionPause, event); }
virtual void actionPause(int, const char *)
Definition: JDAQCHSM.chsm:115
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A11 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 372 of file JDAQCHSM.cc.

372 { execute(&JDAQCHSM::actionRecover, event); }
virtual void actionRecover(int, const char *)
Definition: JDAQCHSM.chsm:125
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A12 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 374 of file JDAQCHSM.cc.

374 { JDAQCHSM::exit(); }
exit
Definition: JPizza.sh:36
void JDAQStateMachine::A13 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 376 of file JDAQCHSM.cc.

376 { execute(&JDAQCHSM::actionCheck, event); }
virtual void actionCheck(int, const char *)
Definition: JDAQCHSM.chsm:121
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A14 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 378 of file JDAQCHSM.cc.

378 { execute(&JDAQCHSM::actionInput, event); }
virtual void actionInput(int, const char *)
Definition: JDAQCHSM.chsm:122
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
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.

337  {
338 #line 164 "JDAQCHSM.chsm"
339  CHSM_ns_alias::cluster const &state = (CHSM_ns_alias::cluster const&)chsm_state_; actionEnter(); }
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
Definition: JDAQCHSM.chsm:109
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.

340  {
341 #line 165 "JDAQCHSM.chsm"
342  CHSM_ns_alias::cluster const &state = (CHSM_ns_alias::cluster const&)chsm_state_; actionExit(); }
virtual void actionExit()
Definition: JDAQCHSM.chsm:110
const std::string& JDAQCHSM::getName ( ) const
inlineinherited

Get name of state machine.

Returns
name

Definition at line 78 of file JDAQCHSM.chsm.

79  {
80  return name;
81  }
std::string name
Definition: JDAQCHSM.chsm:154
const std::string& JDAQCHSM::getName ( ) const
inlineinherited

Get name of state machine.

Returns
name

Definition at line 89 of file JDAQCHSM.hh.

90  {
91  return name;
92  }
std::string name
Definition: JDAQCHSM.chsm:154
int JDAQCHSM::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 89 of file JDAQCHSM.chsm.

90  {
91  return detector_id;
92  }
int detector_id
Definition: JDAQCHSM.chsm:155
int JDAQCHSM::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 100 of file JDAQCHSM.hh.

101  {
102  return detector_id;
103  }
int detector_id
Definition: JDAQCHSM.chsm:155
int JDAQCHSM::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 100 of file JDAQCHSM.chsm.

101  {
102  return run_number;
103  }
int run_number
Definition: JDAQCHSM.chsm:156
int JDAQCHSM::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 111 of file JDAQCHSM.hh.

112  {
113  return run_number;
114  }
int run_number
Definition: JDAQCHSM.chsm:156
virtual void JDAQCHSM::actionError ( )
inlinevirtualinherited

Definition at line 124 of file JDAQCHSM.chsm.

124 {}
virtual void JDAQCHSM::actionError ( )
inlinevirtualinherited

Definition at line 135 of file JDAQCHSM.hh.

135 {}
virtual void JDAQCHSM::actionRecover ( int  ,
const char *   
)
inlinevirtualinherited

Definition at line 125 of file JDAQCHSM.chsm.

125 {}
virtual void JDAQCHSM::actionRecover ( int  ,
const char *   
)
inlinevirtualinherited

Definition at line 136 of file JDAQCHSM.hh.

136 {}
const std::string& KM3NETDAQ::JDAQClient_t::getHostname ( ) const
inlineinherited

Get hostname.

Returns
host name

Definition at line 108 of file JDAQClient.hh.

109  {
110  return hostname;
111  }
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.

120  {
121  return fullname;
122  }
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.

131  {
132  return unique_tag;
133  }
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.

142  {
143  return clock.getDelay();
144  }
long long int getDelay() const
Get total delay time.
Definition: JTimekeeper.hh:78
JTimekeeper clock
central clock
Definition: JDAQClient.hh:206
long long int KM3NETDAQ::JDAQClient_t::getClockInterval ( ) const
inlineinherited

Get interval time.

Returns
interval time [us]

Definition at line 153 of file JDAQClient.hh.

154  {
155  return clock.getInterval();
156  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:206
long long int getInterval() const
Get interval time.
Definition: JTimekeeper.hh:67
void KM3NETDAQ::JDAQClient_t::setClockInterval ( const long long int  interval_us)
inlineinherited

Set interval time.

Parameters
interval_usinterval time [us]

Definition at line 164 of file JDAQClient.hh.

165  {
166  clock.setInterval(interval_us);
167  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:206
void setInterval(const long long int interval_us)
Set interval time.
Definition: JTimekeeper.hh:89
void KM3NETDAQ::JDAQClient_t::resetClock ( )
inlineinherited

Reset clock.

Definition at line 173 of file JDAQClient.hh.

174  {
175  clock.reset();
176  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:206
void reset(const long long int t0)
Reset time.
Definition: JTimekeeper.hh:100
int KM3NETDAQ::JDAQClient_t::getEventNumber ( ) const
inlineinherited

Get last event number.

Returns
event number

Definition at line 184 of file JDAQClient.hh.

185  {
186  return event_number;
187  }
int event_number
number of last event
Definition: JDAQClient.hh:207
void KM3NETDAQ::JDAQClient_t::setEventNumber ( const int  event_number)
inlineinherited

Set last event number.

Parameters
event_numberevent number

Definition at line 195 of file JDAQClient.hh.

196  {
197  this->event_number = event_number;
198  }
int event_number
number of last event
Definition: JDAQClient.hh:207

Member Data Documentation

const int AcousticDataFilter::DEBUG_LEVEL =1
static

Definition at line 49 of file AcousticDataFilter.h.

boost::atomic<bool> AcousticDataFilter::exit_
private

Definition at line 90 of file AcousticDataFilter.h.

boost::atomic<bool> AcousticDataFilter::running_
private

Definition at line 91 of file AcousticDataFilter.h.

std::string AcousticDataFilter::address_
private

Definition at line 92 of file AcousticDataFilter.h.

std::string AcousticDataFilter::port_
private

Definition at line 93 of file AcousticDataFilter.h.

std::map<std::size_t,pProbe> AcousticDataFilter::probes_
private

Definition at line 95 of file AcousticDataFilter.h.

std::map<std::size_t,pDOM> AcousticDataFilter::doms_
private

Definition at line 96 of file AcousticDataFilter.h.

std::vector<pLink> AcousticDataFilter::links_
private

Definition at line 97 of file AcousticDataFilter.h.

boost::thread_group AcousticDataFilter::server_threads_
private

Definition at line 99 of file AcousticDataFilter.h.

boost::asio::io_service AcousticDataFilter::server_io_service_
private

Definition at line 100 of file AcousticDataFilter.h.

boost::asio::io_service::work* AcousticDataFilter::server_work_
private

Definition at line 101 of file AcousticDataFilter.h.

boost::asio::ip::tcp::acceptor AcousticDataFilter::server_acceptor_
private

Definition at line 102 of file AcousticDataFilter.h.

boost::thread_group AcousticDataFilter::trigger_threads_
private

Definition at line 103 of file AcousticDataFilter.h.

boost::asio::io_service AcousticDataFilter::trigger_io_service_
private

Definition at line 104 of file AcousticDataFilter.h.

boost::asio::io_service::work* AcousticDataFilter::trigger_work_
private

Definition at line 105 of file AcousticDataFilter.h.

boost::asio::io_service::strand AcousticDataFilter::strand_
private

Definition at line 106 of file AcousticDataFilter.h.

std::string AcousticDataFilter::debug_file_path_
private

Definition at line 108 of file AcousticDataFilter.h.

std::string AcousticDataFilter::toa_file_path_
private

Definition at line 109 of file AcousticDataFilter.h.

std::ofstream AcousticDataFilter::toa_file_
private

Definition at line 110 of file AcousticDataFilter.h.

std::string AcousticDataFilter::wisdom_file_
private

Definition at line 111 of file AcousticDataFilter.h.

JSharedPointer<JControlHost> KM3NETDAQ::JDAQClient::server
protectedinherited

message server

Definition at line 800 of file JDAQClient.hh.

JMessageLogger KM3NETDAQ::JDAQClient::logger
protectedinherited

message logger

Definition at line 801 of file JDAQClient.hh.

JDAQStateMachine::state_root JDAQStateMachine::root
inherited
JDAQStateMachine::state_Main JDAQStateMachine::Main
inherited
JDAQStateMachine::ev_daq_event JDAQStateMachine::ev_daq
inherited
char JDAQStateMachine::ev_daq_param_block[sizeof(ev_daq_event::param_block)]
inherited

Definition at line 238 of file JDAQCHSM.hh.

JDAQStateMachine::ev_init_event JDAQStateMachine::ev_init
inherited
char JDAQStateMachine::ev_init_param_block[sizeof(ev_init_event::param_block)]
inherited

Definition at line 258 of file JDAQCHSM.hh.

JDAQStateMachine::ev_configure_event JDAQStateMachine::ev_configure
inherited
char JDAQStateMachine::ev_configure_param_block[sizeof(ev_configure_event::param_block)]
inherited

Definition at line 278 of file JDAQCHSM.hh.

JDAQStateMachine::ev_start_event JDAQStateMachine::ev_start
inherited
char JDAQStateMachine::ev_start_param_block[sizeof(ev_start_event::param_block)]
inherited

Definition at line 298 of file JDAQCHSM.hh.

JDAQStateMachine::ev_pause_event JDAQStateMachine::ev_pause
inherited
char JDAQStateMachine::ev_pause_param_block[sizeof(ev_pause_event::param_block)]
inherited

Definition at line 318 of file JDAQCHSM.hh.

JDAQStateMachine::ev_continue_event JDAQStateMachine::ev_continue
inherited
char JDAQStateMachine::ev_continue_param_block[sizeof(ev_continue_event::param_block)]
inherited

Definition at line 338 of file JDAQCHSM.hh.

JDAQStateMachine::ev_stop_event JDAQStateMachine::ev_stop
inherited
char JDAQStateMachine::ev_stop_param_block[sizeof(ev_stop_event::param_block)]
inherited

Definition at line 358 of file JDAQCHSM.hh.

JDAQStateMachine::ev_reset_event JDAQStateMachine::ev_reset
inherited
char JDAQStateMachine::ev_reset_param_block[sizeof(ev_reset_event::param_block)]
inherited

Definition at line 378 of file JDAQCHSM.hh.

JDAQStateMachine::ev_quit_event JDAQStateMachine::ev_quit
inherited
char JDAQStateMachine::ev_quit_param_block[sizeof(ev_quit_event::param_block)]
inherited

Definition at line 398 of file JDAQCHSM.hh.

JDAQStateMachine::ev_off_event JDAQStateMachine::ev_off
inherited
char JDAQStateMachine::ev_off_param_block[sizeof(ev_off_event::param_block)]
inherited

Definition at line 418 of file JDAQCHSM.hh.

JDAQStateMachine::ev_check_event JDAQStateMachine::ev_check
inherited
char JDAQStateMachine::ev_check_param_block[sizeof(ev_check_event::param_block)]
inherited

Definition at line 438 of file JDAQCHSM.hh.

JDAQStateMachine::ev_input_event JDAQStateMachine::ev_input
inherited
char JDAQStateMachine::ev_input_param_block[sizeof(ev_input_event::param_block)]
inherited

Definition at line 458 of file JDAQCHSM.hh.

JDAQStateMachine::ev_recover_event JDAQStateMachine::ev_recover
inherited
char JDAQStateMachine::ev_recover_param_block[sizeof(ev_recover_event::param_block)]
inherited

Definition at line 478 of file JDAQCHSM.hh.

JDAQStateMachine::ev_error_event JDAQStateMachine::ev_error
inherited
char JDAQStateMachine::ev_error_param_block[sizeof(ev_error_event::param_block)]
inherited

Definition at line 495 of file JDAQCHSM.hh.

std::string JDAQCHSM::name
protectedinherited

Definition at line 154 of file JDAQCHSM.chsm.

int JDAQCHSM::detector_id
protectedinherited

Definition at line 155 of file JDAQCHSM.chsm.

int JDAQCHSM::run_number
protectedinherited

Definition at line 156 of file JDAQCHSM.chsm.

const int KM3NETDAQ::JDAQClient_t::TIMEOUT_S = 1
staticinherited

time out of update [s]

Definition at line 61 of file JDAQClient.hh.

JEventTable KM3NETDAQ::JDAQClient_t::eventTable
protectedinherited

event table

Definition at line 202 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::hostname
protectedinherited

Definition at line 203 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::fullname
protectedinherited

Definition at line 204 of file JDAQClient.hh.

JTag KM3NETDAQ::JDAQClient_t::unique_tag
protectedinherited

Definition at line 205 of file JDAQClient.hh.

JTimekeeper KM3NETDAQ::JDAQClient_t::clock
protectedinherited

central clock

Definition at line 206 of file JDAQClient.hh.

int KM3NETDAQ::JDAQClient_t::event_number
protectedinherited

number of last event

Definition at line 207 of file JDAQClient.hh.


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