File indexing completed on 2025-08-02 08:21:07
0001
0002 #include <iostream>
0003 #include "rcdaq.h"
0004 #include <stdlib.h>
0005
0006 #include "daq_device.h"
0007 #include "daq_device_random.h"
0008
0009 using namespace std;
0010
0011
0012 void exitmsg()
0013 {
0014 cout << "Usage: rcdaq [options] filerule" << endl;
0015 cout << " rcdaq -h for help" << endl;
0016 exit(0);
0017 }
0018
0019 void exithelp()
0020 {
0021 cout << "** This is the DAQ engine. No gimmicks. Pure Power." << endl;
0022 cout << "** usage: rcdaq [options] filerule" << endl;
0023 cout << " -m <minutes> run for so many minutes" << endl;
0024 cout << " -b <number> read so many buffers" << endl;
0025 cout << " -r <number> run number" << endl;
0026 cout << " -p <id> packet id to use (def 1001)" << endl;
0027
0028 cout << " -s file size chunks in MB (def 2GB)" << endl;
0029 cout << " -v verbose" << endl;
0030 exit(0);
0031 }
0032
0033
0034
0035 int main( int argc, char* argv[])
0036 {
0037
0038 int status;
0039
0040
0041
0042 extern char *optarg;
0043 extern int optind;
0044
0045 int i;
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 rcdaq_init();
0095
0096
0097 add_readoutdevice ( new daq_device_random( 1,1001));
0098 daq_list_readlist();
0099
0100 add_readoutdevice ( new daq_device_random( 1,1010,32, 0, 1024));
0101 add_readoutdevice ( new daq_device_random( 1,1011,64, 0, 4096));
0102
0103 daq_list_readlist();
0104
0105 daq_clear_readlist();
0106 add_readoutdevice ( new daq_device_random( 1,2010,32, 0, 1024));
0107 add_readoutdevice ( new daq_device_random( 1,2011,64, 0, 4096));
0108
0109 daq_list_readlist();
0110
0111 daq_open_file("xx.evt");
0112 daq_begin(100);
0113 daq_fake_trigger (10);
0114
0115 daq_end();
0116
0117 sleep (10);
0118
0119 daq_close_file();
0120
0121
0122 return 0;
0123
0124 }