forked from sPHENIX-Collaboration/rcdaq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rcdaq.h
112 lines (73 loc) · 2.87 KB
/
rcdaq.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef __RCDAQ_H__
#define __RCDAQ_H__
#include <iostream>
#include <pthread.h>
class daq_device;
void sig_handler(int i);
void set_eventsizes();
void *writebuffers ( void * arg);
void *EventLoop( void *arg);
//int daq_end();
int Command( const int command);
int switch_buffer();
int device_init();
int device_endrun();
int readout(const int etype);
int rearm(const int etype);
int rcdaq_init(pthread_mutex_t &M );
int add_readoutdevice( daq_device *d);
int daq_begin(const int irun,std::ostream& os = std::cout );
int daq_end_immediate(std::ostream& os = std::cout);
int daq_end_interactive(std::ostream& os);
int daq_end(std::ostream& os = std::cout);
int daq_fake_trigger (const int n, const int waitinterval);
int daq_write_runnumberfile(const int run);
int daq_set_runnumberfile(const char *file);
int daq_set_filerule(const char *rule);
int daq_setruntype(const char *type, std::ostream& os = std::cout);
int daq_getruntype(const int flag, std::ostream& os = std::cout);
int daq_define_runtype(const char *type, const char * rule);
int daq_list_runtypes(const int flag, std::ostream& os = std::cout );
std::string& daq_get_filerule();
int daq_open(std::ostream& os = std::cout);
int daq_shutdown(const unsigned long servernumber, const unsigned long versionnumber,
std::ostream& os = std::cout);
std::string& get_current_filename();
int daq_close (std::ostream& os = std::cout);
int is_open();
int daq_set_server (const char *hostname, const int port, std::ostream& os = std::cout);
int is_server_open();
int daq_server_close (std::ostream& os = std::cout);
int get_serverflag();
int daq_set_name(const char *name);
int daq_get_name(std::ostream& os = std::cout);
std::string daq_get_myname();
double daq_get_mb_per_second();
double daq_get_events_per_second();
int daq_list_readlist(std::ostream& os = std::cout );
int daq_clear_readlist(std::ostream& os = std::cout);
std::string& get_current_filename();
std::string& daq_get_filerule();
int daq_status(const int flag, std::ostream& os = std::cout );
int daq_running();
int daq_status_plugin(const int flag =0, std::ostream& os = std::cout );
int daq_setmaxevents (const int n, std::ostream& os);
int daq_setmaxvolume (const int n_mb, std::ostream& os);
int daq_setmaxbuffersize (const int n_mb, std::ostream& os);
int daq_setadaptivebuffering (const int usecs, std::ostream& os);
int daq_set_eloghandler( const char *host, const int port, const char *logname);
int daq_load_plugin( const char *sharedlib, std::ostream& os);
int daq_wait_for_actual_end();
// functions for the webserver
int daq_webcontrol(const int port,std::ostream& os = std::cout );
int daq_getlastfilename(std::ostream& os = std::cout );
int get_runnumber();
int get_oldrunnumber();
int get_eventnumber();
double get_runvolume();
int get_runduration();
int get_openflag();
#define MG_REQUEST_NAME 1
#define MG_REQUEST_SPEED 2
// more defs to come in the future
#endif