#include <stdio.h>
#include <stdlib.h>
#include "midas.h"
#include "msystem.h"
#include "mfe.h"
Go to the source code of this file.
◆ frontend_init()
| INT frontend_init |
( |
void |
| ) |
|
Frontend initialization.
Runs once at application startup. We initialize the hardware and optical interfaces and set the equipment status in ODB. We also lock the frontend to once physical cpu core.
- Returns
- Midas status code
Definition at line 57 of file mtfe.cxx.
58{
59
60 for (
int i=0 ;
i<3 ;
i++) {
61
62
64
65
67 }
68
70}
midas_thread_t ss_thread_create(INT(*thread_func)(void *), void *param)
int create_event_rb(int i)
INT trigger_thread(void *param)
◆ trigger_thread()
| INT trigger_thread |
( |
void * |
param | ) |
|
Definition at line 74 of file mtfe.cxx.
75{
80
81
83
84
86
87
89
90
91 printf(
"Start readout thread %d\n",
index);
92
93
95
97
99
101 continue;
102 }
103
104
106
108
109
111 break;
112
113
114 do {
118
119
122 break;
123 }
124 }
126
127 if (exit)
128 break;
129
131 pdata = (
WORD *)(pevent + 1);
132
133
135
136
138
139
140 int len = 32 + rand() % 10000;
141 for (
i=0 ;
i<len;
i++)
142 *padc++ = len;
143
145
147
148
150 }
151 }
152
153
155
156 printf(
"Stop readout thread %d\n",
index);
157
158 return 0;
159}
INT bk_close(void *event, void *pdata)
void bk_init32(void *event)
void bk_create(void *event, const char *name, WORD type, void **pdata)
INT bk_size(const void *event)
INT bm_compose_event_threadsafe(EVENT_HEADER *event_header, short int event_id, short int trigger_mask, DWORD data_size, DWORD *serial)
INT EXPRT ss_thread_set_name(std::string name)
INT ss_sleep(INT millisec)
int rb_get_wp(int handle, void **p, int millisec)
int rb_increment_wp(int handle, int size)
static int rbh[MAX_N_THREADS]
void signal_readout_thread_active(int index, int flag)
bool readout_enabled(void)
bool is_readout_thread_enabled()
◆ equipment
Initial value:= {
{"Trigger",
{1, 0,
"SYSTEM",
0,
"MIDAS",
500,
0,
0,
0,
"", "", "",},
NULL,
},
{""}
}
Definition at line 34 of file mtfe.cxx.
34 {
35
36 {"Trigger",
37 {1, 0,
38 "SYSTEM",
40 0,
41 "MIDAS",
44 500,
45 0,
46 0,
47 0,
48 "", "", "",},
49 NULL,
50 },
51
52 {""}
53};
◆ equipment_common_overwrite
◆ frontend_file_name
| const char* frontend_file_name = __FILE__ |
◆ frontend_name
| const char* frontend_name = "Sample Frontend" |