AlcapDAQ
1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
crate9
dummy_master.cpp
Go to the documentation of this file.
1
#include <time.h>
2
#include <sys/time.h>
3
4
#include <stdio.h>
5
#include <stdlib.h>
6
7
#include "midas.h"
8
#include "
crate.h
"
9
10
INT
dummy_master_poll_live
();
11
INT
dummy_master_poll_dead
();
12
INT
dummy_master_start_block
();
13
14
struct
readout_module
dummy_master_module
= {
15
NULL,
// init
16
NULL,
// exit
17
NULL,
// pre_bor
18
NULL,
// bor
19
NULL,
// eor
20
dummy_master_poll_live
,
// poll_live
21
dummy_master_poll_dead
,
// poll_dead
22
dummy_master_start_block
,
// start_block
23
NULL,
// stop_block
24
NULL,
// read
25
};
26
27
struct
timeval
block_start_time
;
28
29
INT
dummy_master_start_block
()
30
{
31
gettimeofday(&
block_start_time
, 0);
32
}
33
34
INT
dummy_master_poll_live
()
35
{
36
struct
timeval now;
37
gettimeofday(&now, 0);
38
double
increment = (now.tv_sec -
block_start_time
.tv_sec)*1e6 +
39
(now.tv_usec -
block_start_time
.tv_usec);
40
41
if
(increment > 0.1e6) {
42
return
FE_END_BLOCK
;
43
}
else
{
44
return
SUCCESS
;
45
}
46
}
47
48
INT
dummy_master_poll_dead
()
49
{
50
return
FE_NEED_START
;
51
}
52
Generated by
1.8.4