AlcapDAQ
1
|
Go to the source code of this file.
Macros | |
#define | SERVER_CACHE_SIZE 100000 /* event cache before buffer */ |
#define | ODB_UPDATE_TIME 1000 /* 1 seconds for ODB update */ |
#define | DEFAULT_FE_TIMEOUT 60000 /* 60 seconds for watchdog timeout */ |
#define | EQUIPMENT_COMMON_STR "\Event ID = WORD : 0\n\Trigger mask = WORD : 0\n\Buffer = STRING : [32] SYSTEM\n\Type = INT : 0\n\Source = INT : 0\n\Format = STRING : [8] FIXED\n\Enabled = BOOL : 0\n\Read on = INT : 0\n\Period = INT : 0\n\Event limit = DOUBLE : 0\n\Num subevents = DWORD : 0\n\Log history = INT : 0\n\Frontend host = STRING : [32] \n\Frontend name = STRING : [32] \n\Frontend file name = STRING : [256] \n\" |
#define | EQUIPMENT_STATISTICS_STR "\Events sent = DOUBLE : 0\n\Events per sec. = DOUBLE : 0\n\kBytes per sec. = DOUBLE : 0\n\" |
Functions | |
INT | handFlush (void) |
INT | source_booking (void) |
INT | source_unbooking (void) |
INT | close_buffers (void) |
INT | source_scan (INT fmt, EQUIPMENT_INFO *eq_info) |
INT | eb_mfragment_add (char *pdest, char *psrce, INT *size) |
INT | eb_yfragment_add (char *pdest, char *psrce, INT *size) |
INT | eb_begin_of_run (INT, char *, char *) |
INT | eb_end_of_run (INT, char *) |
INT | eb_user (INT, BOOL mismatch, EBUILDER_CHANNEL *, EVENT_HEADER *, void *, INT *) |
INT | load_fragment (void) |
INT | scan_fragment (void) |
INT | ebuilder_init (void) |
INT | ebuilder_exit (void) |
INT | ebuilder_loop (void) |
INT | ybos_event_swap (DWORD *pevt) |
INT | register_equipment (void) |
INT | tr_start (INT rn, char *error) |
INT | tr_stop (INT rn, char *error) |
void | free_event_buffer (INT nfrag) |
int | main (unsigned int argc, char **argv) |
Variables | |
EBUILDER_SETTINGS | ebset |
EBUILDER_CHANNEL | ebch [MAX_CHANNELS] |
INT | run_state |
INT | run_number |
DWORD | last_time |
DWORD | actual_time |
DWORD | actual_millitime |
char | host_name [HOST_NAME_LENGTH] |
char | expt_name [NAME_LENGTH] |
char | full_frontend_name [256] |
char | buffer_name [NAME_LENGTH] |
INT | nfragment |
char * | dest_event |
HNDLE | hDB |
HNDLE | hKey |
HNDLE | hStatKey |
HNDLE | hSubkey |
HNDLE | hEqKey |
HNDLE | hESetKey |
BOOL | debug = FALSE |
BOOL | debug1 = FALSE |
BOOL | wheel = FALSE |
char | bars [] = "|\\-/" |
int | i_bar |
BOOL | abort_requested = FALSE |
BOOL | stop_requested = TRUE |
DWORD | stop_time = 0 |
DWORD | request_stop_time = 0 |
INT(* | meb_fragment_add )(char *, char *, INT *) |
char * | frontend_name |
char * | frontend_file_name |
BOOL | frontend_call_loop |
INT | max_event_size |
INT | max_event_size_frag |
INT | event_buffer_size |
INT | display_period |
EQUIPMENT | equipment [] |
Definition at line 78 of file new_mevb.cpp.
#define EQUIPMENT_COMMON_STR "\Event ID = WORD : 0\n\Trigger mask = WORD : 0\n\Buffer = STRING : [32] SYSTEM\n\Type = INT : 0\n\Source = INT : 0\n\Format = STRING : [8] FIXED\n\Enabled = BOOL : 0\n\Read on = INT : 0\n\Period = INT : 0\n\Event limit = DOUBLE : 0\n\Num subevents = DWORD : 0\n\Log history = INT : 0\n\Frontend host = STRING : [32] \n\Frontend name = STRING : [32] \n\Frontend file name = STRING : [256] \n\" |
Definition at line 135 of file new_mevb.cpp.
Referenced by register_equipment().
#define EQUIPMENT_STATISTICS_STR "\Events sent = DOUBLE : 0\n\Events per sec. = DOUBLE : 0\n\kBytes per sec. = DOUBLE : 0\n\" |
Definition at line 153 of file new_mevb.cpp.
Referenced by register_equipment().
#define ODB_UPDATE_TIME 1000 /* 1 seconds for ODB update */ |
Definition at line 76 of file new_mevb.cpp.
#define SERVER_CACHE_SIZE 100000 /* event cache before buffer */ |
INT close_buffers | ( | void | ) |
INT eb_begin_of_run | ( | INT | , |
char * | , | ||
char * | |||
) |
Hook to the event builder task at PreStart transition.
rn | run number |
UserField | argument from /Ebuilder/Settings |
error | error string to be passed back to the system. |
eb_begin_of_run()
Hook to the event builder task at PreStart transition. {verbatim} {verbatim}
rn | run number |
UserField | argument from /Ebuilder/Settings |
error | error string to be passed back to the system. |
eb_begin_of_run()
Hook to the event builder task at PreStart transition. {verbatim} {verbatim}
rn | run number |
UserField | argument from /Ebuilder/Settings |
error | error string to be passed back to the system. |
Definition at line 145 of file ebuser.cpp.
INT eb_end_of_run | ( | INT | , |
char * | |||
) |
Hook to the event builder task at completion of event collection after receiving the Stop transition.
rn | run number |
error | error string to be passed back to the system. |
eb_end_of_run()
Hook to the event builder task at completion of event collection after receiving the Stop transition. {verbatim} {verbatim}
rn | run number |
error | error string to be passed back to the system. |
eb_end_of_run()
Hook to the event builder task at completion of event collection after receiving the Stop transition. {verbatim} {verbatim}
rn | run number |
error | error string to be passed back to the system. |
Definition at line 193 of file ebuser.cpp.
INT eb_mfragment_add | ( | char * | pdest, |
char * | psrce, | ||
INT * | size | ||
) |
INT eb_user | ( | INT | nfrag, |
BOOL | mismatch, | ||
EBUILDER_CHANNEL * | ebch, | ||
EVENT_HEADER * | pheader, | ||
void * | pevent, | ||
INT * | dest_size | ||
) |
Hook to the event builder task after the reception of all fragments of the same serial number. The destination event has already the final EVENT_HEADER setup with the data size set to 0. It is than possible to add private data at this point using the proper bank calls.
The ebch[] array structure points to nfragment channel structure with the following content:
The correct code for including your own MIDAS bank is shown below where TID_xxx is one of the valid Bank type starting with TID_ for midas format or xxx_BKTYPE for Ybos data format. bank_name is a 4 character descriptor. pdata has to be declared accordingly with the bank type. Refers to the ebuser.c source code for further description.
It is not possible to mix within the same destination event different event format!
For YBOS format, use the following example.
nfrag | Number of fragment. |
mismatch | Midas Serial number mismatch flag. |
ebch | Structure to all the fragments. |
pheader | Destination pointer to the header. |
pevent | Destination pointer to the bank header. |
dest_size | Destination event size in bytes. |
Definition at line 259 of file ebuser.cpp.
References compress_event(), EB_SUCCESS, EB_USER_ERROR, i, EBUILDER_CHANNEL::pfragment, and printf().
Referenced by source_scan().
INT eb_yfragment_add | ( | char * | pdest, |
char * | psrce, | ||
INT * | size | ||
) |
INT ebuilder_exit | ( | void | ) |
INT ebuilder_init | ( | void | ) |
INT ebuilder_loop | ( | void | ) |
Definition at line 132 of file ebuser.cpp.
References EB_SUCCESS.
void free_event_buffer | ( | INT | nfrag) |
Definition at line 701 of file new_mevb.cpp.
References i, and EBUILDER_CHANNEL::pfragment.
INT handFlush | ( | void | ) |
INT load_fragment | ( | void | ) |
int main | ( | unsigned int | argc, |
char ** | argv | ||
) |
Definition at line 1067 of file new_mevb.cpp.
References buffer_name, cm_get_environment(), debug, EB_SUCCESS, ebuilder_exit(), ebuilder_init(), expt_name, FALSE, free_event_buffer(), frontend_name, full_frontend_name, hDB, hKey, host_name, i, load_fragment(), EBUILDER_SETTINGS::nfragment, printf(), register_equipment(), scan_fragment(), source_unbooking(), status, SUCCESS, tr_start(), tr_stop, TRUE, usage(), and wheel.
INT register_equipment | ( | void | ) |
Definition at line 160 of file new_mevb.cpp.
References EB_SUCCESS, equipment, EQUIPMENT_COMMON_STR, EQUIPMENT_STATISTICS_STR, frontend_file_name, full_frontend_name, hDB, hKey, printf(), run_number, run_state, SERVER_CACHE_SIZE, size, sprintf(), status, SUCCESS, and TRUE.
INT scan_fragment | ( | void | ) |
INT source_booking | ( | void | ) |
INT source_scan | ( | INT | fmt, |
EQUIPMENT_INFO * | eq_info | ||
) |
Scan all the fragment source once per call.
fmt | Fragment format type |
eq_info | Equipement pointer |
dest_hBuf | Destination buffer handle |
INT source_unbooking | ( | void | ) |
INT tr_start | ( | INT | rn, |
char * | error | ||
) |
Definition at line 588 of file new_mevb.cpp.
References abort_requested, eb_begin_of_run(), EB_SUCCESS, EBUILDER, equipment, FALSE, full_frontend_name, hDB, hKey, i, key, EBUILDER_SETTINGS::nfragment, nfragment, EBUILDER_SETTINGS::preqfrag, printf(), EBUILDER_SETTINGS::received, run_number, run_state, size, source_booking(), sprintf(), status, stop_requested, SUCCESS, TRUE, EBUILDER_SETTINGS::user_build, and EBUILDER_SETTINGS::user_field.
INT tr_stop | ( | INT | rn, |
char * | error | ||
) |
Definition at line 688 of file new_mevb.cpp.
References full_frontend_name, printf(), request_stop_time, stop_requested, and TRUE.
INT ybos_event_swap | ( | DWORD * | pevt) |
BOOL abort_requested = FALSE |
Definition at line 101 of file new_mevb.cpp.
DWORD actual_millitime |
Definition at line 87 of file new_mevb.cpp.
DWORD actual_time |
Definition at line 86 of file new_mevb.cpp.
char bars[] = "|\\-/" |
Definition at line 99 of file new_mevb.cpp.
char buffer_name[NAME_LENGTH] |
Definition at line 92 of file new_mevb.cpp.
BOOL debug = FALSE |
Definition at line 96 of file new_mevb.cpp.
BOOL debug1 = FALSE |
Definition at line 96 of file new_mevb.cpp.
char* dest_event |
Definition at line 94 of file new_mevb.cpp.
INT display_period |
Definition at line 43 of file crate.cpp.
Referenced by main(), manual_trigger(), register_equipment(), scheduler(), tr_pause(), tr_prepause(), tr_prestop(), tr_resume(), tr_start(), and tr_stop().
EBUILDER_CHANNEL ebch[MAX_CHANNELS] |
Definition at line 81 of file new_mevb.cpp.
EBUILDER_SETTINGS ebset |
Definition at line 80 of file new_mevb.cpp.
EQUIPMENT equipment[] |
Definition at line 72 of file crate.cpp.
Referenced by close_buffers(), display(), frontend_early_init(), load_fragment(), main(), manual_trigger(), register_equipment(), rpc_end_of_cycle(), scan_fragment(), scheduler(), send_all_periodic_events(), send_event(), source_scan(), tr_prestop(), tr_start(), and tr_stop().
char expt_name[NAME_LENGTH] |
Definition at line 90 of file new_mevb.cpp.
BOOL frontend_call_loop |
Definition at line 39 of file crate.cpp.
Referenced by scheduler().
char* frontend_file_name |
Definition at line 36 of file crate.cpp.
Referenced by register_equipment().
char* frontend_name |
Definition at line 33 of file crate.cpp.
Referenced by diag_print_impl(), display(), dl403_init(), frontend_early_init(), main(), read_separator_event(), and register_equipment().
char full_frontend_name[256] |
Definition at line 91 of file new_mevb.cpp.
HNDLE hDB |
Definition at line 95 of file new_mevb.cpp.
HNDLE hEqKey |
Definition at line 95 of file new_mevb.cpp.
HNDLE hESetKey |
Definition at line 95 of file new_mevb.cpp.
HNDLE hKey |
Definition at line 95 of file new_mevb.cpp.
char host_name[HOST_NAME_LENGTH] |
Definition at line 89 of file new_mevb.cpp.
HNDLE hStatKey |
Definition at line 95 of file new_mevb.cpp.
HNDLE hSubkey |
Definition at line 95 of file new_mevb.cpp.
int i_bar |
Definition at line 100 of file new_mevb.cpp.
DWORD last_time |
Definition at line 85 of file new_mevb.cpp.
INT max_event_size |
Definition at line 47 of file crate.cpp.
Referenced by handFlush(), load_fragment(), main(), scheduler(), send_event(), source_booking(), and source_scan().
INT max_event_size_frag |
Definition at line 50 of file crate.cpp.
Referenced by main(), and send_event().
INT(* meb_fragment_add)(char *, char *, INT *) |
Definition at line 104 of file new_mevb.cpp.
INT nfragment |
Definition at line 93 of file new_mevb.cpp.
DWORD request_stop_time = 0 |
Definition at line 102 of file new_mevb.cpp.
INT run_number |
Definition at line 84 of file new_mevb.cpp.
INT run_state |
PROGRAM: crate.cpp DESCRIPTION: Control and readout of CAEN V1724 digitizers. author: V.Tishchenko date: 12-Aug-2012
Modifications:
Definition at line 83 of file new_mevb.cpp.
BOOL stop_requested = TRUE |
Definition at line 101 of file new_mevb.cpp.
DWORD stop_time = 0 |
Definition at line 102 of file new_mevb.cpp.
BOOL wheel = FALSE |
Definition at line 98 of file new_mevb.cpp.