1 |
//============================================================================ |
//============================================================================ |
2 |
// $Id: PacketUser.h,v 1.38 2008-06-10 08:49:18 messineo Exp $ |
// $Id: PacketUser.h,v 1.39 2008-09-05 14:33:48 messineo Exp $ |
3 |
// Description : |
// Description : |
4 |
//============================================================================ |
//============================================================================ |
5 |
#ifndef PACKETUSER_H_ |
#ifndef PACKETUSER_H_ |
64 |
//tymesync and OBT informations |
//tymesync and OBT informations |
65 |
unsigned long int obt_time_sync; |
unsigned long int obt_time_sync; |
66 |
unsigned long int last_time_sync_info; |
unsigned long int last_time_sync_info; |
67 |
|
// (tassa) keep previous value of time_sync |
68 |
|
unsigned long int obt_time_sync_prevvalue; |
69 |
|
unsigned long int last_time_sync_info_prevvalue; |
70 |
|
bool time_is_estimated; |
71 |
//TimeOffset used to obtain absolute time |
//TimeOffset used to obtain absolute time |
72 |
unsigned long int timeOffset; |
unsigned long int timeOffset; |
73 |
//part of the ROOT filename used to retrieve timeOffset for special files |
//part of the ROOT filename used to retrieve timeOffset for special files |
74 |
char nnnn_mmm_ppp[80]; |
char nnnn_mmm_ppp[80]; |
75 |
//BOOT Number |
//boot number |
76 |
unsigned long int boot_number; |
unsigned long int boot_number; |
77 |
|
unsigned long int boot_number_prevvalue; |
78 |
|
//(tassa) |
79 |
|
unsigned int id_to_recover[1000]; |
80 |
|
int id_to_recover_index; |
81 |
//number of packets with problems( in general CRC problems) detected in EventReader: |
//number of packets with problems( in general CRC problems) detected in EventReader: |
82 |
int bad_pkt_EventReader; |
int bad_pkt_EventReader; |
83 |
//num ber of Calibration packets with problems( in general CRC problems) detected in EventReader: |
//num ber of Calibration packets with problems( in general CRC problems) detected in EventReader: |
89 |
//the ID of the current ROOT file in table Table_ROOT_Good |
//the ID of the current ROOT file in table Table_ROOT_Good |
90 |
unsigned int my_id; |
unsigned int my_id; |
91 |
|
|
92 |
//number of good Calibration packets in the ROOT files |
//number of good Calibration packets in the ROOT files |
93 |
// int good_pkt_Calib;//maybe I will remove this in future |
// int good_pkt_Calib;//maybe I will use this in future |
94 |
|
|
95 |
//the table name in our DB for the ROOT files |
//the table name in our DB for the ROOT files |
96 |
char* Table_ROOT_Good; |
char* Table_ROOT_Good; |
115 |
void setBootNumber(char* packet, long int pktLenght, const PacketType* type); |
void setBootNumber(char* packet, long int pktLenght, const PacketType* type); |
116 |
//set real_time_init and real_time_last |
//set real_time_init and real_time_last |
117 |
void setReal_Time(); |
void setReal_Time(); |
118 |
|
// |
119 |
|
void recover_boot_number(); |
120 |
|
|
121 |
//retrieve the timeOffset from table=Table_GL_RESURS_OFFSET |
//retrieve the timeOffset from table=Table_GL_RESURS_OFFSET |
122 |
unsigned long int retrieveTimeOffset(char * table); |
unsigned long int retrieveTimeOffset(char * table); |
123 |
|
|
132 |
unsigned long int mboot_num, |
unsigned long int mboot_num, |
133 |
unsigned long int time_offset, |
unsigned long int time_offset, |
134 |
int bad_pkt, int bad_pkt_read, int bad_pkt_CalRead, int num_PKT_Saved, |
int bad_pkt, int bad_pkt_read, int bad_pkt_CalRead, int num_PKT_Saved, |
135 |
char* nome_input); |
char* nome_input,bool _time_is_estimated); |
136 |
|
|
137 |
///new part merging |
///new part merging |
138 |
|
|
139 |
//tipi di relazioni che il ROOT file puo' avere con un ROOT gia salvatto in DB |
//tipi di relazioni che il ROOT file puo' avere con un ROOT gia salvatto in DB |
140 |
|
//0 =AFTER se c'e' una sovrapposizione temporale parziale, inizia dopo l'inizio di quello associato e finisce dopo la sua fine |
141 |
|
//1 =BEFORE se c'e' una sovrapposizione temporale parziale, ossia finisce prima della fine di quello associato ma inizia prima |
142 |
|
//2 =SMALLER se c'e' una sovrapposizione temporale parziale: e' contenuto nel ROOT file associato |
143 |
|
//3 =BIGGER se c'e' una sovrapposizione temporale parziale: contiene il ROOT file associato |
144 |
enum type_Rel_ROOT{ |
enum type_Rel_ROOT{ |
145 |
AFTER, //se inizia dentro e finisce fuori |
AFTER, //se inizia dentro e finisce fuori |
146 |
BEFORE, //inizia prima ma finisce dentro |
BEFORE, //inizia prima ma finisce dentro |
148 |
BIGGER //se inizia prima e finisce dopo |
BIGGER //se inizia prima e finisce dopo |
149 |
}; |
}; |
150 |
|
|
151 |
/* |
|
|
0 =AFTER se c'e' una sovrapposizione temporale parziale, inizia dopo l'inizio di quello associato e finisce dopo la sua fine |
|
|
1 =BEFORE se c'e' una sovrapposizione temporale parziale, ossia finisce prima della fine di quello associato ma inizia prima |
|
|
2 =SMALLER se c'e' una sovrapposizione temporale parziale: e' contenuto nel ROOT file associato |
|
|
3 =BIGGER se c'e' una sovrapposizione temporale parziale: contiene il ROOT file associato |
|
|
*/ |
|
152 |
|
|
153 |
|
|
154 |
bool merge_ROOTfiles(); |
bool merge_ROOTfiles(); |
172 |
double bad_perc, |
double bad_perc, |
173 |
unsigned int ID_record, type_Rel_ROOT type_rel); |
unsigned int ID_record, type_Rel_ROOT type_rel); |
174 |
|
|
175 |
//unsigned int Return_IDN_merging(char* table_name, unsigned long int mtime_init, unsigned long int mtime_last, type_Rel_ROOT type_rel); |
//search in DB if there are ROOT files in the temporal range of interest and with the given relation |
176 |
TSQLResult* Select_merging(char* table_name, unsigned long int mtime_init, unsigned long int mtime_last, type_Rel_ROOT type_rel); |
TSQLResult* Select_merging(char* table_name, unsigned long int mtime_init, unsigned long int mtime_last, type_Rel_ROOT type_rel); |
177 |
|
|
178 |
//Lock the tableTobeLocked table or all the tables I know if par=NULL |
//Lock the tableTobeLocked table or all the tables I know if par=NULL |
179 |
int LockTables(char* tableTobeLocked); |
int LockTables(char* tableTobeLocked); |