5 #include <rtsSystems.h>
7 #include <SFS/sfs_index.h>
8 #include <DAQ_READER/daqReader.h>
9 #include <DAQ_READER/daq_dta.h>
13 extern int l3_reader(
char *m,
struct l3_t *l3, u_int driver) ;
15 const char *daq_l3::help_string =
"L3 tst\n" ;
21 daq_det_factory::det_factories[L3_ID] = this ;
35 LOG(DBG,
"L3: rts_id %d, name %s",rts_id,name) ;
39 name = rts2name(rts_id) ;
42 if(caller) caller->insert(
this, rts_id) ;
46 LOG(DBG,
"%s: constructor: caller %p",name,caller) ;
51 LOG(DBG,
"%s: destructor",name) ;
52 if(caller) caller->de_insert(rts_id) ;
60 daq_dta *daq_l3::get(
const char *bank,
int c1,
int c2,
int c3,
void *p1,
void *p2)
63 if(!present)
return 0 ;
65 if(strcmp(bank,
"*")==0) bank =
"legacy" ;
67 if(strcasecmp(bank,
"legacy") != 0) {
68 LOG(ERR,
"%s: unknown bank %s",name,bank) ;
72 return handle_legacy() ;
77 daq_dta *daq_l3::handle_legacy()
81 legacy->create(1,
"l3_t",rts_id,DAQ_DTA_STRUCT(
l3_t)) ;
84 l3_t *l3_p = (
l3_t *) legacy->request(1) ;
86 if(present & DET_PRESENT_DATAP) {
87 l3_reader(caller->mem, l3_p, 0) ;
93 sprintf(str,
"gl3/l3_gtd") ;
94 full_name = caller->get_sfs_name(str) ;
96 LOG(DBG,
"full_name %s",full_name) ;
99 sprintf(str,
"l3/l3_gtd") ;
100 full_name = caller->get_sfs_name(str) ;
102 LOG(DBG,
"full_name %s",full_name) ;
105 if(!full_name)
return 0 ;
108 int bytes = caller->sfs->fileSize(full_name) ;
110 LOG(DBG,
"bytes %d",bytes) ;
112 char *mem = (
char *)valloc(bytes) ;
115 int ret = caller->sfs->read(str, mem, bytes) ;
117 LOG(DBG,
"ret %d",ret) ;
119 l3_reader(mem, l3_p, 1) ;
124 legacy->finalize(1,0,0,0) ;