Low-Energy Muon (LEM) Experiment  0.5.2
lemplug_scfe.cxx
Go to the documentation of this file.
1 /*******************************************************************\
2 
3  Name: lemplug_scfe.cxx
4  Created by: Andreas Suter
5 
6  Contents: Midas frontend for the ePowerSwitch M8
7 
8 \*******************************************************************/
9 
10 #include <cstdio>
11 
12 #include "midas.h"
13 #include "mfe.h"
14 #include "msystem.h"
15 #include "lem_generic.h"
16 #include "lemplug.h"
17 #include "bus/null.h"
18 
19 //-- Globals -------------------------------------------------------
20 
21 // The frontend name (client name) as seen by other MIDAS clients
22 const char *frontend_name = "lemPlug";
23 // The frontend file name, don't change it
24 const char *frontend_file_name = __FILE__;
25 
26 // frontend_loop is called periodically if this variable is TRUE
27 BOOL frontend_call_loop = FALSE;
28 
29 // a frontend status page is displayed with this frequency in ms
30 INT display_period = 1000;
31 
32 // maximum event size produced by this frontend
33 INT max_event_size = 10000;
34 
35 // maximum event size for fragmented events (EQ_FRAGMENTED)
36 INT max_event_size_frag = 5*1024*1024;
37 
38 // buffer size to hold events
39 INT event_buffer_size = 10*10000;
40 
41 //-- Equipment list ------------------------------------------------
42 
43 // device driver list
44 
45 DEVICE_DRIVER lemplug_driver[] = {
46  { "lemplug", lemplug, 8, null, DF_PRIO_DEVICE},
47  { "lemplug2", lemplug, 8, null, DF_PRIO_DEVICE},
48  { "" }
49 };
50 
60 
61 EQUIPMENT equipment[] = {
62 
63  { "lemplug", // equipment name
64  {61, 0, // event ID, trigger mask
65  "SYSTEM", // event buffer
66  EQ_SLOW, // equipment type
67  0, // event source
68  "FIXED", // format
69  TRUE, // enabled
70  RO_RUNNING |
71  RO_TRANSITIONS, // read when running and on transitions
72  5000, // read every 5 sec
73  0, // stop run after this event limit
74  0, // number of sub events
75  1, // log history every event
76  "", "", "",},
77  cd_gen_read, // readout routine
78  cd_gen, // class driver main routine
79  lemplug_driver, // device driver list
80  NULL, // init string
81  },
82 
83  { "" }
84 };
85 
86 //-- Dummy routines ------------------------------------------------
87 
88 INT poll_event(INT source, INT count, BOOL test) {return 1;};
89 INT interrupt_configure(INT cmd, INT source, POINTER_T adr) {return 1;};
90 
91 //-- Frontend Init -------------------------------------------------
92 
94 {
95  // de-register run-transition notifications
96  cm_deregister_transition(TR_START);
97  cm_deregister_transition(TR_STOP);
98  cm_deregister_transition(TR_PAUSE);
99  cm_deregister_transition(TR_RESUME);
100 
101  return CM_SUCCESS;
102 }
103 
104 //-- Frontend Exit -------------------------------------------------
105 
107 {
108  return CM_SUCCESS;
109 }
110 
111 //-- Frontend Loop -------------------------------------------------
112 
114 {
115  return CM_SUCCESS;
116 }
117 
118 //-- Begin of Run --------------------------------------------------
119 
120 INT begin_of_run(INT run_number, char *error)
121 {
122  return CM_SUCCESS;
123 }
124 
125 //-- End of Run ----------------------------------------------------
126 
127 INT end_of_run(INT run_number, char *error)
128 {
129  return CM_SUCCESS;
130 }
131 
132 //-- Pause Run -----------------------------------------------------
133 
134 INT pause_run(INT run_number, char *error)
135 {
136  return CM_SUCCESS;
137 }
138 
139 //-- Resuem Run ----------------------------------------------------
140 
141 INT resume_run(INT run_number, char *error)
142 {
143  return CM_SUCCESS;
144 }
145 
146 //------------------------------------------------------------------
const char * frontend_name
&lt; created by ODBedit, command &quot;make&quot;
Definition: vme_fe.cxx:167
INT max_event_size
maximum event size produced by this frontend
Definition: vme_fe.cxx:179
BOOL frontend_call_loop
frontend_loop is called periodically if this variable is TRUE
Definition: vme_fe.cxx:173
INT display_period
a frontend status page is displayed with this frequency in ms
Definition: vme_fe.cxx:176
DEVICE_DRIVER lemplug_driver[]
INT event_buffer_size
buffer size to hold events
Definition: vme_fe.cxx:185
INT frontend_exit()
Definition: vme_fe.cxx:565
EQUIPMENT equipment[]
Definition: vme_fe.cxx:343
INT begin_of_run(INT run_number, char *error)
Definition: vme_fe.cxx:597
INT interrupt_configure(INT cmd, INT source, PTYPE adr)
Definition: vme_fe.cxx:2105
INT frontend_loop()
Definition: vme_fe.cxx:957
INT resume_run(INT run_number, char *error)
Definition: vme_fe.cxx:900
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition: vme_fe.cxx:182
INT frontend_init()
Definition: vme_fe.cxx:429
BOOL equipment_common_overwrite
Definition: vme_fe.cxx:341
INT end_of_run(INT run_number, char *error)
Definition: vme_fe.cxx:865
INT poll_event(INT source, INT count, BOOL test)
Definition: vme_fe.cxx:2088
INT lemplug(INT cmd,...)
INT pause_run(INT run_number, char *error)
Definition: vme_fe.cxx:893
const char * frontend_file_name
The frontend file name, don&#39;t change it.
Definition: vme_fe.cxx:170