Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-02 08:21:01

0001  
0002 
0003 #include <iostream>
0004 
0005 #include <daq_device_command.h>
0006 
0007 #include <unistd.h>
0008 #include <stdlib.h>
0009 
0010 using namespace std;
0011 
0012 daq_device_command::daq_device_command(const int eventtype
0013                        , const int subeventid 
0014                        , const char *command
0015                        , const int verbose)
0016 
0017 {
0018 
0019   m_eventType  = eventtype;
0020   m_subeventid = subeventid;
0021   _command = command;
0022   _verbose = verbose;
0023 
0024 
0025 }
0026 
0027 daq_device_command::~daq_device_command()
0028 {
0029 }
0030 
0031 
0032 
0033 // the put_data function
0034 
0035 int daq_device_command::put_data(const int etype, int * adr, const int length )
0036 {
0037   
0038 
0039   if (etype != m_eventType )  // not our id
0040     {
0041       return 0;
0042     }
0043 
0044   system ( _command.c_str() );
0045 
0046   return 0;
0047 
0048 }
0049 
0050 
0051 void daq_device_command::identify(std::ostream& os) const
0052 {
0053   
0054   os  << "Command Device  Event Type: " << m_eventType 
0055       << " executing " << _command << endl;
0056 
0057 }
0058 
0059