102#include <sys/resource.h>
111#include "ov1720drv.h"
122#define NBLINKSPERA3818 1
123#define NBLINKSPERFE 1
124#define NB1720PERLINK 2
125#define NBV1720TOTAL 2
131#define FE_NAME "feov1720_SIM"
133#define FE_NAME "feov1720"
136#define UNUSED(x) ((void)(x))
264 itv1720->SetSettingsTouched(
true);
265 printf(
"Settings %s touched. Changes will take effect at start of next run.\n",
key.
name);
316 printf(
"ERROR: affinity not set\n");
318 printf(
">>> End of Init.\n\n");
329 printf(
"<<< No index supplied! Assuming only 1 frontend only and starting all boards on all links\n");
341 ov1720.back().verbose = 1;
355 printf(
"Link#:%d Board#:%d Module_Handle[%d]:%d (active:%d)\n",
358 ov1720.back().InitializeForAcq();
367 printf(
"Incorrect setup: the number of boards controlled by each frontend"
368 " is not a fraction of the total number of boards.");
384 printf(
"<<< Begin of Init \n feIndex:%i, link:%i, board:%i\n",
392 ov1720.back().verbose = 1;
406 printf(
"Link#:%d Board#:%d Module_Handle[%d]:%d (active:%d)\n",
409 ov1720.back().InitializeForAcq();
420 printf(
"ERROR: affinity not set\n");
424 printf(
">>> End of Init. %d active v1720. Expected %d\n\n",
427 printf(
">>> End of Init. %d active v1720. Expected %d\n\n",
435 printf(
"*** RUNNING SIMULATION ***\n");
475 printf(
"<<< Begin of begin_of_run\n");
483 if (!
itv1720->IsConnected())
continue;
484 printf(
"Starting module iBoard %d\n",
itv1720->GetModuleID());
494 printf(
">>> End of begin_of_run\n\n");
515 printf(
"<<< Beging of end_of_run \n");
538 printf(
">>> End Of end_of_run\n\n");
706 if (!
itv1720->IsConnected())
continue;
723 printf(
"Module:%02d Hndle:%d S/N:%8.8d Nloop:%d/%d (%5.2f) sCAEN:%d Event Stored:0x%x Event Size:0x%x\n"
728 int module = itv1720->GetModuleID();
BOOL frontend_call_loop
frontend_loop is called periodically if this variable is TRUE
int Nloop
Number of loops executed in event polling.
void seq_callback(INT hDB, INT hseq, void *info)
Sequencer callback info.
INT max_event_size
maximum event size produced by this frontend
INT frontend_exit()
Frontend exit.
BOOL debugpolling
debug msgs polling loop
bool runStopRequested
stop run requested
INT frontend_init()
Frontend initialization.
BOOL debugtrigger
debug msgs read trigger event
INT event_buffer_size
buffer size to hold events
bool runInProgress
run is in progress
#define EQ_TRGMSK
Trigger mask.
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
#define NBV1720TOTAL
Number of v1720 boards in total.
INT interrupt_configure(INT cmd, INT source, POINTER_T adr)
Interrupt configuration (not implemented)
int Ncount
Loop count for event polling timeout.
BOOL debug
debug printouts
#define NB1720PERLINK
Number of daisy-chained v1720s per optical link.
void interrupt_routine(void)
Interrupt Service Routine.
#define NBLINKSPERFE
Number of optical links controlled by each frontend.
INT poll_event(INT source, INT count, BOOL test)
Polling routine for events.
#define FE_NAME
Frontend name.
INT read_trigger_event(char *pevent, INT off)
Event readout.
vector< v1720CONET2 > ov1720
objects for the v1720 modules controlled by this frontend
EQUIPMENT equipment[]
Main structure for midas equipment.
INT display_period
a frontend status page is displayed with this frequency in ms
char * frontend_name
The frontend name (client name) as seen by other MIDAS clients.
char * frontend_file_name
The frontend file name, don't change it.
INT begin_of_run(INT run_number, char *error)
Begin of Run.
INT frontend_loop()
Frontend loop.
#define NBLINKSPERA3818
Number of optical links used per A3818.
INT end_of_run(INT run_number, char *error)
End of Run.
INT read_scaler_event(char *pevent, INT off)
Placeholder.
vector< v1720CONET2 >::iterator itv1720
iterator
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 cm_transition(INT transition, INT run_number, char *errstr, INT errstr_size, INT async_flag, INT debug_flag)
INT cm_set_watchdog_params(BOOL call_watchdog, DWORD timeout)
#define CMD_INTERRUPT_ATTACH
#define CMD_INTERRUPT_DISABLE
#define CMD_INTERRUPT_ENABLE
#define CMD_INTERRUPT_DETACH
INT ss_sleep(INT millisec)
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
INT db_get_key(HNDLE hDB, HNDLE hKey, KEY *key)
INT db_set_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, const void *data, INT data_size, INT num_values, DWORD type)
int set_equipment_status(const char *name, const char *equipment_status, const char *status_class)
int gettimeofday(struct timeval *tp, void *tzp)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)