MIDAS
|
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "midas.h"
#include "mvmestd.h"
#include "CAENComm.h"
#include "v1740CONET2.hxx"
Go to the source code of this file.
Macros | |
#define | Nv1740 1 |
Set the number of v1720 modules to be used. | |
#define | EQ_EVID 4 |
Event ID. | |
#define | EQ_TRGMSK 0 |
Trigger mask. | |
#define | FE_NAME "feoV1740" |
Frontend name. | |
#define | UNUSED(x) ((void)(x)) |
Suppress compiler warnings. | |
Functions | |
INT | frontend_init () |
Frontend initialization. | |
INT | frontend_exit () |
Frontend exit. | |
INT | begin_of_run (INT run_number, char *error) |
Begin of Run. | |
INT | end_of_run (INT run_number, char *error) |
End of Run. | |
INT | pause_run (INT run_number, char *error) |
Pause Run. | |
INT | resume_run (INT run_number, char *error) |
Resume Run. | |
INT | frontend_loop () |
Frontend loop. | |
void | interrupt_routine (void) |
Interrupt Service Routine. | |
INT | read_trigger_event (char *pevent, INT off) |
Trigger event readout. | |
INT | read_scaler_event (char *pevent, INT off) |
Scaler event readout. | |
void | seq_callback (INT hDB, INT hseq, void *info) |
Sequencer callback info. | |
INT | poll_event (INT source, INT count, BOOL test) |
Polling routine for events. | |
INT | interrupt_configure (INT cmd, INT source, POINTER_T adr) |
Interrupt configuration (not implemented) | |
Variables | |
HNDLE | hDB |
main ODB handle | |
BOOL | debug |
debug printouts | |
char * | frontend_name = (char*)FE_NAME |
The frontend name (client name) as seen by other MIDAS clients. | |
char * | frontend_file_name = (char*)__FILE__ |
The frontend file name, don't change it. | |
BOOL | frontend_call_loop = FALSE |
frontend_loop is called periodically if this variable is TRUE | |
INT | display_period = 000 |
a frontend status page is displayed with this frequency in ms | |
INT | max_event_size = 32 * 34000 |
maximum event size produced by this frontend | |
INT | max_event_size_frag = 5 * 1024 * 1024 |
maximum event size for fragmented events (EQ_FRAGMENTED) | |
INT | event_buffer_size = 200 * max_event_size |
buffer size to hold events | |
bool | runInProgress = false |
run is in progress | |
bool | runOver = false |
run is over | |
bool | runStopRequested = false |
stop run requested | |
EQUIPMENT | equipment [] |
Main structure for midas equipment. | |
vector< v1740CONET2 > | ov1740 |
objects for the v1740 modules controlled by this frontend | |
vector< v1740CONET2 >::iterator | itv1740 |
iterator | |
int | Nloop |
Number of loops executed in event polling. | |
int | Ncount |
Loop count for event polling timeout. | |
#define EQ_EVID 4 |
Event ID.
Definition at line 63 of file feoV1740.cxx.
#define EQ_TRGMSK 0 |
Trigger mask.
Definition at line 64 of file feoV1740.cxx.
#define FE_NAME "feoV1740" |
Frontend name.
Definition at line 69 of file feoV1740.cxx.
#define Nv1740 1 |
Set the number of v1720 modules to be used.
Definition at line 62 of file feoV1740.cxx.
Suppress compiler warnings.
Definition at line 72 of file feoV1740.cxx.
Begin of Run.
Called every run start transition. Set equipment status in ODB, start acquisition on the modules.
[in] | run_number | Number of the run being started |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 285 of file feoV1740.cxx.
End of Run.
Called every stop run transition. Set equipment status in ODB, stop acquisition on the modules.
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 323 of file feoV1740.cxx.
Frontend exit.
Runs at frontend shutdown. Disconnect hardware and set equipment status in ODB
Definition at line 259 of file feoV1740.cxx.
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.
Definition at line 198 of file feoV1740.cxx.
Frontend loop.
If frontend_call_loop is true, this routine gets called when the frontend is idle or once between every event.
Definition at line 398 of file feoV1740.cxx.
Interrupt configuration (not implemented)
Routine for interrupt configuration if equipment is set in EQ_INTERRUPT mode. Not implemented right now, returns SUCCESS.
[in] | cmd | Command for interrupt events (see midas.h) |
[in] | source | Equipment index number |
[in] | adr | Interrupt routine (see mfe.c) |
Definition at line 475 of file feoV1740.cxx.
Pause Run.
Called every pause run transition.
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 365 of file feoV1740.cxx.
Polling routine for events.
[in] | source | Event source (LAM/IRQ) |
[in] | count | Loop count for event polling timeout |
[in] | test | flag used to time the polling |
Definition at line 436 of file feoV1740.cxx.
Scaler event readout.
Placeholder.
Scaler event readout routine. Not used in this example.
[in] | pevent | Pointer to event buffer |
[in] | off | Caller info (unused here), see mfe.c |
Definition at line 554 of file feoV1740.cxx.
Trigger event readout.
Main trigger event readout routine. This is called by the polling or interrupt routines. (see mfe.c). For each module, read the event buffer into a midas data bank.
[in] | pevent | Pointer to event buffer |
[in] | off | Caller info (unused here), see mfe.c |
Definition at line 502 of file feoV1740.cxx.
Resume Run.
Called every resume run transition.
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 383 of file feoV1740.cxx.
Sequencer callback info.
Function which gets called when record is updated
[in] | hDB | main ODB handle |
[in] | hseq | Handle for key where search starts in ODB, zero for root. |
[in] | info | Record descriptor additional info |
Definition at line 176 of file feoV1740.cxx.
INT display_period = 000 |
a frontend status page is displayed with this frequency in ms
Definition at line 93 of file feoV1740.cxx.
EQUIPMENT equipment[] |
Main structure for midas equipment.
Definition at line 121 of file feoV1740.cxx.
INT event_buffer_size = 200 * max_event_size |
buffer size to hold events
Definition at line 99 of file feoV1740.cxx.
frontend_loop is called periodically if this variable is TRUE
Definition at line 91 of file feoV1740.cxx.
The frontend file name, don't change it.
Definition at line 89 of file feoV1740.cxx.
The frontend name (client name) as seen by other MIDAS clients.
Definition at line 87 of file feoV1740.cxx.
vector<v1740CONET2>::iterator itv1740 |
iterator
Definition at line 160 of file feoV1740.cxx.
INT max_event_size = 32 * 34000 |
maximum event size produced by this frontend
Definition at line 95 of file feoV1740.cxx.
INT max_event_size_frag = 5 * 1024 * 1024 |
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition at line 97 of file feoV1740.cxx.
int Ncount |
Loop count for event polling timeout.
Definition at line 423 of file feoV1740.cxx.
int Nloop |
Number of loops executed in event polling.
Definition at line 422 of file feoV1740.cxx.
vector<v1740CONET2> ov1740 |
objects for the v1740 modules controlled by this frontend
Definition at line 159 of file feoV1740.cxx.
run is in progress
Definition at line 101 of file feoV1740.cxx.
run is over
Definition at line 102 of file feoV1740.cxx.
stop run requested
Definition at line 103 of file feoV1740.cxx.