9 #include "RelationalAccess/ISession.h" 10 #include "RelationalAccess/ITransaction.h" 11 #include "RelationalAccess/ISchema.h" 12 #include "RelationalAccess/ITable.h" 13 #include "RelationalAccess/ITableDataEditor.h" 14 #include "RelationalAccess/TableDescription.h" 15 #include "RelationalAccess/IQuery.h" 16 #include "RelationalAccess/ICursor.h" 18 #include "CoralBase/AttributeList.h" 19 #include "CoralBase/Attribute.h" 20 #include "CoralBase/AttributeSpecification.h" 41 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
44 session->transaction().start(
true);
45 coral::ISchema& schema = session->nominalSchema();
46 coral::IQuery* queryI = schema.newQuery();
47 queryI->addToTableList(
"FWCAENCHANNEL");
48 queryI->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID");
49 queryI->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP");
50 queryI->addToOutputList(
"FWCAENCHANNEL.ACTUAL_IMON",
"IMON");
53 std::vector<RPCObImon::I_Item> imonarray;
54 coral::TimeStamp tlast =
tMIN;
58 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
59 std::cout <<
">> creating IMON object..." << std::endl;
60 coral::AttributeList conditionData;
61 conditionData.extend<coral::TimeStamp>(
"tmin");
62 conditionData.extend<coral::TimeStamp>(
"tmax");
63 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
64 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
65 std::string condition =
"FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
66 queryI->setCondition(condition, conditionData);
67 coral::ICursor& cursorI = queryI->execute();
68 while (cursorI.next()) {
69 const coral::AttributeList& row = cursorI.currentRow();
70 float idoub = row[
"DPID"].data<
float>();
71 int id =
static_cast<int>(idoub);
72 float val = row[
"IMON"].data<
float>();
73 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
74 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
75 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
80 imonarray.push_back(Itemp);
83 std::cout <<
">> creating IMON object..." << std::endl;
84 coral::AttributeList conditionData;
85 conditionData.extend<coral::TimeStamp>(
"tmin");
86 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
87 std::string condition =
"FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
88 queryI->setCondition(condition, conditionData);
89 coral::ICursor& cursorI = queryI->execute();
90 while (cursorI.next()) {
91 const coral::AttributeList& row = cursorI.currentRow();
92 float idoub = row[
"DPID"].data<
float>();
93 int id =
static_cast<int>(idoub);
94 float val = row[
"IMON"].data<
float>();
95 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
98 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
99 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
104 imonarray.push_back(Itemp);
110 std::cout <<
">> Imon array --> size: " << imonarray.size() <<
" >> done." << std::endl;
112 session->transaction().commit();
121 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
124 session->transaction().start(
true);
125 coral::ISchema& schema = session->nominalSchema();
126 coral::IQuery* queryV = schema.newQuery();
127 queryV->addToTableList(
"FWCAENCHANNEL");
128 queryV->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID");
129 queryV->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP");
130 queryV->addToOutputList(
"FWCAENCHANNEL.ACTUAL_VMON",
"VMON");
132 std::vector<RPCObVmon::V_Item> vmonarray;
133 coral::TimeStamp tlast =
tMIN;
137 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
138 std::cout <<
">> creating VMON object..." << std::endl;
139 coral::AttributeList conditionData;
140 conditionData.extend<coral::TimeStamp>(
"tmin");
141 conditionData.extend<coral::TimeStamp>(
"tmax");
142 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
143 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
145 " NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE " 147 queryV->setCondition(condition, conditionData);
148 coral::ICursor& cursorV = queryV->execute();
149 while (cursorV.next()) {
150 const coral::AttributeList& row = cursorV.currentRow();
151 float idoub = row[
"DPID"].data<
float>();
152 int id =
static_cast<int>(idoub);
153 float val = row[
"VMON"].data<
float>();
154 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
157 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
158 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
163 vmonarray.push_back(Vtemp);
166 std::cout <<
">> creating VMON object..." << std::endl;
167 coral::AttributeList conditionData;
168 conditionData.extend<coral::TimeStamp>(
"tmin");
169 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
170 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
171 queryV->setCondition(condition, conditionData);
172 coral::ICursor& cursorV = queryV->execute();
173 while (cursorV.next()) {
174 const coral::AttributeList& row = cursorV.currentRow();
175 float idoub = row[
"DPID"].data<
float>();
176 int id =
static_cast<int>(idoub);
177 float val = row[
"VMON"].data<
float>();
178 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
181 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
182 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
187 vmonarray.push_back(Vtemp);
191 std::cout <<
">> Vmon array --> size: " << vmonarray.size() <<
" >> done." << std::endl;
193 session->transaction().commit();
202 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
205 session->transaction().start(
true);
206 coral::ISchema& schema = session->nominalSchema();
207 std::cout <<
">> creating STATUS object..." << std::endl;
208 coral::IQuery* queryS = schema.newQuery();
209 queryS->addToTableList(
"FWCAENCHANNEL");
210 queryS->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID");
211 queryS->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP");
212 queryS->addToOutputList(
"FWCAENCHANNEL.ACTUAL_STATUS",
"STATUS");
214 std::vector<RPCObStatus::S_Item> statusarray;
215 coral::TimeStamp tlast =
tMIN;
219 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
220 std::cout <<
">> creating STATUS object..." << std::endl;
221 coral::AttributeList conditionData;
222 conditionData.extend<coral::TimeStamp>(
"tmin");
223 conditionData.extend<coral::TimeStamp>(
"tmax");
224 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
225 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
227 " NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE " 229 queryS->setCondition(condition, conditionData);
230 coral::ICursor& cursorS = queryS->execute();
231 while (cursorS.next()) {
232 const coral::AttributeList& row = cursorS.currentRow();
233 float idoub = row[
"DPID"].data<
float>();
234 int id =
static_cast<int>(idoub);
235 float val = row[
"STATUS"].data<
float>();
236 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
237 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
238 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
243 statusarray.push_back(Stemp);
246 std::cout <<
">> creating STATUS object..." << std::endl;
247 coral::AttributeList conditionData;
248 conditionData.extend<coral::TimeStamp>(
"tmin");
249 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
250 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
251 queryS->setCondition(condition, conditionData);
252 coral::ICursor& cursorS = queryS->execute();
253 while (cursorS.next()) {
254 const coral::AttributeList& row = cursorS.currentRow();
255 float idoub = row[
"DPID"].data<
float>();
256 int id =
static_cast<int>(idoub);
257 float val = row[
"STATUS"].data<
float>();
258 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
259 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
260 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
265 statusarray.push_back(Stemp);
268 std::cout <<
">> Staus array --> size: " << statusarray.size() <<
" >> done." << std::endl << std::endl << std::endl;
271 session->transaction().commit();
281 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
284 session->transaction().start(
true);
285 coral::ISchema& schema = session->nominalSchema();
287 coral::TimeStamp tlast =
tMIN;
290 coral::IQuery* querySIN = schema.newQuery();
291 querySIN->addToTableList(
"RPCGASCHANNEL");
292 querySIN->addToOutputList(
"RPCGASCHANNEL.DPID",
"DPID");
293 querySIN->addToOutputList(
"RPCGASCHANNEL.CHANGE_DATE",
"TSTAMP");
294 querySIN->addToOutputList(
"RPCGASCHANNEL.FLOWIN",
"FLOWIN");
297 coral::IQuery* querySOUT = schema.newQuery();
298 querySOUT->addToTableList(
"RPCGASCHANNEL");
299 querySOUT->addToOutputList(
"RPCGASCHANNEL.DPID",
"DPID");
300 querySOUT->addToOutputList(
"RPCGASCHANNEL.CHANGE_DATE",
"TSTAMP");
301 querySOUT->addToOutputList(
"RPCGASCHANNEL.FLOWOUT",
"FLOWOUT");
304 std::vector<RPCObGas::Item> gasarray;
309 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
310 std::cout <<
">> creating GAS object..." << std::endl;
311 std::cout <<
">> processing FLOWIN..." << std::endl;
312 coral::AttributeList conditionData;
313 conditionData.extend<coral::TimeStamp>(
"tmin");
314 conditionData.extend<coral::TimeStamp>(
"tmax");
315 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
316 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
317 std::string conditionIN =
"RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
319 querySIN->setCondition(conditionIN, conditionData);
320 coral::ICursor& cursorSIN = querySIN->execute();
321 while (cursorSIN.next()) {
327 const coral::AttributeList& row = cursorSIN.currentRow();
328 float idoub = row[
"DPID"].data<
float>();
329 int id =
static_cast<int>(idoub);
330 float val = row[
"FLOWIN"].data<
float>();
331 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
332 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
333 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
337 gastemp.
time = ntime;
338 gasarray.push_back(gastemp);
341 std::cout <<
">> creating GAS object..." << std::endl;
342 std::cout <<
">> processing FLOWIN..." << std::endl;
343 coral::AttributeList conditionData;
344 conditionData.extend<coral::TimeStamp>(
"tmin");
345 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
346 std::string conditionIN =
"RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin";
347 std::cout <<
"processing FLOWIN..." << std::endl;
348 querySIN->setCondition(conditionIN, conditionData);
349 coral::ICursor& cursorSIN = querySIN->execute();
350 while (cursorSIN.next()) {
356 const coral::AttributeList& row = cursorSIN.currentRow();
357 float idoub = row[
"DPID"].data<
float>();
358 int id =
static_cast<int>(idoub);
359 float val = row[
"FLOWIN"].data<
float>();
360 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
361 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
362 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
366 gastemp.
time = ntime;
367 gasarray.push_back(gastemp);
374 std::cout <<
">> processing FLOWOUT..." << std::endl;
375 coral::AttributeList conditionData;
376 conditionData.extend<coral::TimeStamp>(
"tmin");
377 conditionData.extend<coral::TimeStamp>(
"tmax");
378 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
379 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
380 std::string conditionOUT =
"RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
382 querySOUT->setCondition(conditionOUT, conditionData);
383 coral::ICursor& cursorSOUT = querySOUT->execute();
384 while (cursorSOUT.next()) {
390 const coral::AttributeList& row = cursorSOUT.currentRow();
391 float idoub = row[
"DPID"].data<
float>();
392 int id =
static_cast<int>(idoub);
393 float val = row[
"FLOWOUT"].data<
float>();
394 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
395 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
396 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
400 gastemp.
time = ntime;
401 gasarray.push_back(gastemp);
404 std::cout <<
">> processing FLOWOUT..." << std::endl;
405 coral::AttributeList conditionData;
406 conditionData.extend<coral::TimeStamp>(
"tmin");
407 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
408 std::string conditionOUT =
"RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin";
409 querySOUT->setCondition(conditionOUT, conditionData);
410 coral::ICursor& cursorSOUT = querySOUT->execute();
411 while (cursorSOUT.next()) {
417 const coral::AttributeList& row = cursorSOUT.currentRow();
418 float idoub = row[
"DPID"].data<
float>();
419 int id =
static_cast<int>(idoub);
420 float val = row[
"FLOWOUT"].data<
float>();
421 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
422 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
423 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
427 gastemp.
time = ntime;
428 gasarray.push_back(gastemp);
435 std::cout <<
">> Gas array --> size: " << gasarray.size() <<
" >> done." << std::endl << std::endl << std::endl;
439 session->transaction().commit();
449 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
452 session->transaction().start(
true);
453 coral::ISchema& schema = session->nominalSchema();
454 coral::IQuery* queryS = schema.newQuery();
455 queryS->addToTableList(
"FWCAENCHANNELADC");
456 queryS->addToOutputList(
"FWCAENCHANNELADC.DPID",
"DPID");
457 queryS->addToOutputList(
"FWCAENCHANNELADC.CHANGE_DATE",
"TSTAMP");
458 queryS->addToOutputList(
"FWCAENCHANNELADC.ACTUAL_TEMPERATURE",
"TEMPERATURE");
460 std::vector<RPCObTemp::T_Item> temparray;
461 coral::TimeStamp tlast =
tMIN;
465 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
466 std::cout <<
">> creating TEMPERATURE object..." << std::endl;
467 coral::AttributeList conditionData;
468 conditionData.extend<coral::TimeStamp>(
"tmin");
469 conditionData.extend<coral::TimeStamp>(
"tmax");
470 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
471 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
473 "FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
474 queryS->setCondition(condition, conditionData);
475 coral::ICursor& cursorS = queryS->execute();
476 while (cursorS.next()) {
477 const coral::AttributeList& row = cursorS.currentRow();
478 float idoub = row[
"DPID"].data<
float>();
479 int id =
static_cast<int>(idoub);
480 float val = row[
"TEMPERATURE"].data<
float>();
481 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
482 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
483 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
489 temparray.push_back(Ttemp);
492 std::cout <<
">> creating TEMPERATURE object..." << std::endl;
493 coral::AttributeList conditionData;
494 conditionData.extend<coral::TimeStamp>(
"tmin");
495 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
496 std::string condition =
"FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin";
497 queryS->setCondition(condition, conditionData);
498 coral::ICursor& cursorS = queryS->execute();
499 while (cursorS.next()) {
500 const coral::AttributeList& row = cursorS.currentRow();
501 float idoub = row[
"DPID"].data<
float>();
502 int id =
static_cast<int>(idoub);
503 float val = row[
"TEMPERATURE"].data<
float>();
504 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
505 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
506 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
512 temparray.push_back(Ttemp);
518 std::cout <<
">> Temperature array --> size: " << temparray.size() <<
" >> done." << std::endl
523 session->transaction().commit();
532 std::cout <<
">> Processing data..." << std::endl;
535 session->transaction().start(
true);
536 coral::ISchema& schema = session->nominalSchema();
537 std::cout <<
">> creating IDMAP object..." << std::endl;
538 coral::IQuery* queryM = schema.newQuery();
539 queryM->addToTableList(
"RPCPVSSDETID");
540 queryM->addToOutputList(
"RPCPVSSDETID.SINCE",
"SINCE");
541 queryM->addToOutputList(
"RPCPVSSDETID.PVSS_ID",
"PVSS_ID");
542 queryM->addToOutputList(
"RPCPVSSDETID.REGION",
"REGION");
543 queryM->addToOutputList(
"RPCPVSSDETID.RING",
"RING");
544 queryM->addToOutputList(
"RPCPVSSDETID.STATION",
"STATION");
545 queryM->addToOutputList(
"RPCPVSSDETID.SECTOR",
"SECTOR");
546 queryM->addToOutputList(
"RPCPVSSDETID.LAYER",
"LAYER");
547 queryM->addToOutputList(
"RPCPVSSDETID.SUBSECTOR",
"SUBSECTOR");
548 queryM->addToOutputList(
"RPCPVSSDETID.SUPPLYTYPE",
"SUPPLYTYPE");
550 std::string condM =
"RPCPVSSDETID.PVSS_ID is not NULL";
553 coral::ICursor& cursorM = queryM->execute();
556 std::vector<RPCObPVSSmap::Item> idmaparray;
557 while (cursorM.next()) {
558 const coral::AttributeList& row = cursorM.currentRow();
559 int id = row[
"PVSS_ID"].data<
int>();
568 int reg = atoi(reg_s.c_str());
569 int rin = atoi(rin_s.c_str());
570 int sta = atoi(sta_s.c_str());
571 int sec = atoi(sec_s.c_str());
572 int lay = atoi(lay_s.c_str());
573 int sub = atoi(sub_s.c_str());
587 coral::TimeStamp ts = row[
"SINCE"].data<coral::TimeStamp>();
589 std::ostringstream dday;
590 std::ostringstream dmon;
591 std::ostringstream dyea;
595 std::string date = dday.str() +
"-" + dmon.str() +
"-" + dyea.str();
597 Itemp.
since = atoi(date.c_str());
607 idmaparray.push_back(Itemp);
610 std::cout <<
">> IDMAP array --> size: " << idmaparray.size() <<
" >> done." << std::endl;
612 session->transaction().commit();
621 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
624 session->transaction().start(
true);
625 coral::ISchema& schema = session->nominalSchema();
626 std::cout <<
">> creating FEB object..." << std::endl;
629 coral::IQuery* queryFVTH1 = schema.newQuery();
630 queryFVTH1->addToTableList(
"RPCFEB");
631 queryFVTH1->addToOutputList(
"RPCFEB.DPID",
"DPID");
632 queryFVTH1->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
633 queryFVTH1->addToOutputList(
"RPCFEB.VTH1",
"VTH1");
636 coral::IQuery* queryFVTH2 = schema.newQuery();
637 queryFVTH2->addToTableList(
"RPCFEB");
638 queryFVTH2->addToOutputList(
"RPCFEB.DPID",
"DPID");
639 queryFVTH2->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
640 queryFVTH2->addToOutputList(
"RPCFEB.VTH2",
"VTH2");
643 coral::IQuery* queryFVTH3 = schema.newQuery();
644 queryFVTH3->addToTableList(
"RPCFEB");
645 queryFVTH3->addToOutputList(
"RPCFEB.DPID",
"DPID");
646 queryFVTH3->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
647 queryFVTH3->addToOutputList(
"RPCFEB.VTH3",
"VTH3");
650 coral::IQuery* queryFVTH4 = schema.newQuery();
651 queryFVTH4->addToTableList(
"RPCFEB");
652 queryFVTH4->addToOutputList(
"RPCFEB.DPID",
"DPID");
653 queryFVTH4->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
654 queryFVTH4->addToOutputList(
"RPCFEB.VTH4",
"VTH4");
657 coral::IQuery* queryFVMON1 = schema.newQuery();
658 queryFVMON1->addToTableList(
"RPCFEB");
659 queryFVMON1->addToOutputList(
"RPCFEB.DPID",
"DPID");
660 queryFVMON1->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
661 queryFVMON1->addToOutputList(
"RPCFEB.VMON1",
"VMON1");
664 coral::IQuery* queryFVMON2 = schema.newQuery();
665 queryFVMON2->addToTableList(
"RPCFEB");
666 queryFVMON2->addToOutputList(
"RPCFEB.DPID",
"DPID");
667 queryFVMON2->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
668 queryFVMON2->addToOutputList(
"RPCFEB.VMON2",
"VMON2");
671 coral::IQuery* queryFVMON3 = schema.newQuery();
672 queryFVMON3->addToTableList(
"RPCFEB");
673 queryFVMON3->addToOutputList(
"RPCFEB.DPID",
"DPID");
674 queryFVMON3->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
675 queryFVMON3->addToOutputList(
"RPCFEB.VMON3",
"VMON3");
678 coral::IQuery* queryFVMON4 = schema.newQuery();
679 queryFVMON4->addToTableList(
"RPCFEB");
680 queryFVMON4->addToOutputList(
"RPCFEB.DPID",
"DPID");
681 queryFVMON4->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
682 queryFVMON4->addToOutputList(
"RPCFEB.VMON4",
"VMON4");
685 coral::IQuery* queryFTEMP1 = schema.newQuery();
686 queryFTEMP1->addToTableList(
"RPCFEB");
687 queryFTEMP1->addToOutputList(
"RPCFEB.DPID",
"DPID");
688 queryFTEMP1->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
689 queryFTEMP1->addToOutputList(
"RPCFEB.TEMPERATURE1",
"TEMP1");
692 coral::IQuery* queryFTEMP2 = schema.newQuery();
693 queryFTEMP2->addToTableList(
"RPCFEB");
694 queryFTEMP2->addToOutputList(
"RPCFEB.DPID",
"DPID");
695 queryFTEMP2->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
696 queryFTEMP2->addToOutputList(
"RPCFEB.TEMPERATURE2",
"TEMP2");
699 std::vector<RPCObFebmap::Feb_Item> febarray;
700 coral::TimeStamp tlast =
tMIN;
704 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
705 std::cout <<
"Processing VTH1..." << std::endl;
706 coral::AttributeList conditionData;
707 conditionData.extend<coral::TimeStamp>(
"tmin");
708 conditionData.extend<coral::TimeStamp>(
"tmax");
709 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
710 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
711 std::string conditionVTH1 =
"RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
712 queryFVTH1->setCondition(conditionVTH1, conditionData);
713 coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
714 while (cursorFVTH1.next()) {
729 const coral::AttributeList& row = cursorFVTH1.currentRow();
730 float idoub = row[
"DPID"].data<
float>();
731 int id =
static_cast<int>(idoub);
732 float vth1 = row[
"VTH1"].data<
float>();
733 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
734 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
735 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
740 febarray.push_back(Itemp);
743 std::cout <<
">> Processing VTH1..." << std::endl;
744 coral::AttributeList conditionData;
745 conditionData.extend<coral::TimeStamp>(
"tmin");
746 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
747 std::string conditionVTH1 =
"RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
748 queryFVTH1->setCondition(conditionVTH1, conditionData);
749 coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
750 while (cursorFVTH1.next()) {
765 const coral::AttributeList& row = cursorFVTH1.currentRow();
766 float idoub = row[
"DPID"].data<
float>();
767 int id =
static_cast<int>(idoub);
768 float vth1 = row[
"VTH1"].data<
float>();
769 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
770 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
771 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
776 febarray.push_back(Itemp);
782 std::cout <<
"Processing VTH2..." << std::endl;
783 coral::AttributeList conditionData;
784 conditionData.extend<coral::TimeStamp>(
"tmin");
785 conditionData.extend<coral::TimeStamp>(
"tmax");
786 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
787 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
788 std::string conditionVTH2 =
"RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
789 queryFVTH2->setCondition(conditionVTH2, conditionData);
790 coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
791 while (cursorFVTH2.next()) {
806 const coral::AttributeList& row = cursorFVTH2.currentRow();
807 float idoub = row[
"DPID"].data<
float>();
808 int id =
static_cast<int>(idoub);
809 float vth2 = row[
"VTH2"].data<
float>();
810 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
811 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
812 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
817 febarray.push_back(Itemp);
820 std::cout <<
">> Processing VTH2..." << std::endl;
821 coral::AttributeList conditionData;
822 conditionData.extend<coral::TimeStamp>(
"tmin");
823 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
824 std::string conditionVTH2 =
"RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
825 queryFVTH2->setCondition(conditionVTH2, conditionData);
826 coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
827 while (cursorFVTH2.next()) {
842 const coral::AttributeList& row = cursorFVTH2.currentRow();
843 float idoub = row[
"DPID"].data<
float>();
844 int id =
static_cast<int>(idoub);
845 float vth2 = row[
"VTH2"].data<
float>();
846 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
847 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
848 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
853 febarray.push_back(Itemp);
859 std::cout <<
"Processing VTH3..." << std::endl;
860 coral::AttributeList conditionData;
861 conditionData.extend<coral::TimeStamp>(
"tmin");
862 conditionData.extend<coral::TimeStamp>(
"tmax");
863 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
864 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
865 std::string conditionVTH3 =
"RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
866 queryFVTH3->setCondition(conditionVTH3, conditionData);
867 coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
868 while (cursorFVTH3.next()) {
883 const coral::AttributeList& row = cursorFVTH3.currentRow();
884 float idoub = row[
"DPID"].data<
float>();
885 int id =
static_cast<int>(idoub);
886 float vth3 = row[
"VTH3"].data<
float>();
887 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
888 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
889 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
894 febarray.push_back(Itemp);
897 std::cout <<
">> Processing VTH3..." << std::endl;
898 coral::AttributeList conditionData;
899 conditionData.extend<coral::TimeStamp>(
"tmin");
900 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
901 std::string conditionVTH3 =
"RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
902 queryFVTH3->setCondition(conditionVTH3, conditionData);
903 coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
904 while (cursorFVTH3.next()) {
919 const coral::AttributeList& row = cursorFVTH3.currentRow();
920 float idoub = row[
"DPID"].data<
float>();
921 int id =
static_cast<int>(idoub);
922 float vth3 = row[
"VTH3"].data<
float>();
923 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
924 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
925 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
930 febarray.push_back(Itemp);
936 std::cout <<
"Processing VTH4..." << std::endl;
937 coral::AttributeList conditionData;
938 conditionData.extend<coral::TimeStamp>(
"tmin");
939 conditionData.extend<coral::TimeStamp>(
"tmax");
940 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
941 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
942 std::string conditionVTH4 =
"RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
943 queryFVTH4->setCondition(conditionVTH4, conditionData);
944 coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
945 while (cursorFVTH4.next()) {
960 const coral::AttributeList& row = cursorFVTH4.currentRow();
961 float idoub = row[
"DPID"].data<
float>();
962 int id =
static_cast<int>(idoub);
963 float vth4 = row[
"VTH4"].data<
float>();
964 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
965 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
966 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
971 febarray.push_back(Itemp);
974 std::cout <<
">> Processing VTH4..." << std::endl;
975 coral::AttributeList conditionData;
976 conditionData.extend<coral::TimeStamp>(
"tmin");
977 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
978 std::string conditionVTH4 =
"RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
979 queryFVTH4->setCondition(conditionVTH4, conditionData);
980 coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
981 while (cursorFVTH4.next()) {
996 const coral::AttributeList& row = cursorFVTH4.currentRow();
997 float idoub = row[
"DPID"].data<
float>();
998 int id =
static_cast<int>(idoub);
999 float vth4 = row[
"VTH4"].data<
float>();
1000 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1001 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1002 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1007 febarray.push_back(Itemp);
1013 std::cout <<
"Processing VMON1..." << std::endl;
1014 coral::AttributeList conditionData;
1015 conditionData.extend<coral::TimeStamp>(
"tmin");
1016 conditionData.extend<coral::TimeStamp>(
"tmax");
1017 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1018 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1019 std::string conditionVMON1 =
"RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1020 queryFVMON1->setCondition(conditionVMON1, conditionData);
1021 coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1022 while (cursorFVMON1.next()) {
1037 const coral::AttributeList& row = cursorFVMON1.currentRow();
1038 float idoub = row[
"DPID"].data<
float>();
1039 int id =
static_cast<int>(idoub);
1040 float vmon1 = row[
"VMON1"].data<
float>();
1041 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1042 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1043 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1045 Itemp.
vmon1 = vmon1;
1048 febarray.push_back(Itemp);
1051 std::cout <<
">> Processing VMON1..." << std::endl;
1052 coral::AttributeList conditionData;
1053 conditionData.extend<coral::TimeStamp>(
"tmin");
1054 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1055 std::string conditionVMON1 =
"RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1056 queryFVMON1->setCondition(conditionVMON1, conditionData);
1057 coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1058 while (cursorFVMON1.next()) {
1073 const coral::AttributeList& row = cursorFVMON1.currentRow();
1074 float idoub = row[
"DPID"].data<
float>();
1075 int id =
static_cast<int>(idoub);
1076 float vmon1 = row[
"VMON1"].data<
float>();
1077 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1078 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1079 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1081 Itemp.
vmon1 = vmon1;
1084 febarray.push_back(Itemp);
1090 std::cout <<
"Processing VMON2..." << std::endl;
1091 coral::AttributeList conditionData;
1092 conditionData.extend<coral::TimeStamp>(
"tmin");
1093 conditionData.extend<coral::TimeStamp>(
"tmax");
1094 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1095 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1096 std::string conditionVMON2 =
"RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1097 queryFVMON2->setCondition(conditionVMON2, conditionData);
1098 coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1099 while (cursorFVMON2.next()) {
1114 const coral::AttributeList& row = cursorFVMON2.currentRow();
1115 float idoub = row[
"DPID"].data<
float>();
1116 int id =
static_cast<int>(idoub);
1117 float vmon2 = row[
"VMON2"].data<
float>();
1118 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1119 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1120 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1122 Itemp.
vmon2 = vmon2;
1125 febarray.push_back(Itemp);
1128 std::cout <<
">> Processing VMON2..." << std::endl;
1129 coral::AttributeList conditionData;
1130 conditionData.extend<coral::TimeStamp>(
"tmin");
1131 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1132 std::string conditionVMON2 =
"RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1133 queryFVMON2->setCondition(conditionVMON2, conditionData);
1134 coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1135 while (cursorFVMON2.next()) {
1150 const coral::AttributeList& row = cursorFVMON2.currentRow();
1151 float idoub = row[
"DPID"].data<
float>();
1152 int id =
static_cast<int>(idoub);
1153 float vmon2 = row[
"VMON2"].data<
float>();
1154 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1155 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1156 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1158 Itemp.
vmon2 = vmon2;
1161 febarray.push_back(Itemp);
1167 std::cout <<
"Processing VMON3..." << std::endl;
1168 coral::AttributeList conditionData;
1169 conditionData.extend<coral::TimeStamp>(
"tmin");
1170 conditionData.extend<coral::TimeStamp>(
"tmax");
1171 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1172 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1173 std::string conditionVMON3 =
"RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1174 queryFVMON3->setCondition(conditionVMON3, conditionData);
1175 coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1176 while (cursorFVMON3.next()) {
1191 const coral::AttributeList& row = cursorFVMON3.currentRow();
1192 float idoub = row[
"DPID"].data<
float>();
1193 int id =
static_cast<int>(idoub);
1194 float vmon3 = row[
"VMON3"].data<
float>();
1195 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1196 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1197 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1199 Itemp.
vmon3 = vmon3;
1202 febarray.push_back(Itemp);
1205 std::cout <<
">> Processing VMON3..." << std::endl;
1206 coral::AttributeList conditionData;
1207 conditionData.extend<coral::TimeStamp>(
"tmin");
1208 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1209 std::string conditionVMON3 =
"RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1210 queryFVMON3->setCondition(conditionVMON3, conditionData);
1211 coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1212 while (cursorFVMON3.next()) {
1227 const coral::AttributeList& row = cursorFVMON3.currentRow();
1228 float idoub = row[
"DPID"].data<
float>();
1229 int id =
static_cast<int>(idoub);
1230 float vmon3 = row[
"VMON3"].data<
float>();
1231 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1232 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1233 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1235 Itemp.
vmon3 = vmon3;
1238 febarray.push_back(Itemp);
1244 std::cout <<
"Processing VMON4..." << std::endl;
1245 coral::AttributeList conditionData;
1246 conditionData.extend<coral::TimeStamp>(
"tmin");
1247 conditionData.extend<coral::TimeStamp>(
"tmax");
1248 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1249 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1250 std::string conditionVMON4 =
"RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1251 queryFVMON4->setCondition(conditionVMON4, conditionData);
1252 coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1253 while (cursorFVMON4.next()) {
1268 const coral::AttributeList& row = cursorFVMON4.currentRow();
1269 float idoub = row[
"DPID"].data<
float>();
1270 int id =
static_cast<int>(idoub);
1271 float vmon4 = row[
"VMON4"].data<
float>();
1272 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1273 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1274 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1276 Itemp.
vmon4 = vmon4;
1279 febarray.push_back(Itemp);
1282 std::cout <<
">> Processing VMON4..." << std::endl;
1283 coral::AttributeList conditionData;
1284 conditionData.extend<coral::TimeStamp>(
"tmin");
1285 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1286 std::string conditionVMON4 =
"RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1287 queryFVMON4->setCondition(conditionVMON4, conditionData);
1288 coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1289 while (cursorFVMON4.next()) {
1304 const coral::AttributeList& row = cursorFVMON4.currentRow();
1305 float idoub = row[
"DPID"].data<
float>();
1306 int id =
static_cast<int>(idoub);
1307 float vmon4 = row[
"VMON4"].data<
float>();
1308 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1309 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1310 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1312 Itemp.
vmon4 = vmon4;
1315 febarray.push_back(Itemp);
1321 std::cout <<
"Processing TEMP1..." << std::endl;
1322 coral::AttributeList conditionData;
1323 conditionData.extend<coral::TimeStamp>(
"tmin");
1324 conditionData.extend<coral::TimeStamp>(
"tmax");
1325 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1326 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1328 "RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1329 queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1330 coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1331 while (cursorFTEMP1.next()) {
1346 const coral::AttributeList& row = cursorFTEMP1.currentRow();
1347 float idoub = row[
"DPID"].data<
float>();
1348 int id =
static_cast<int>(idoub);
1349 float temp1 = row[
"TEMP1"].data<
float>();
1350 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1351 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1352 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1354 Itemp.
temp1 = temp1;
1357 febarray.push_back(Itemp);
1360 std::cout <<
">> Processing TEMP1..." << std::endl;
1361 coral::AttributeList conditionData;
1362 conditionData.extend<coral::TimeStamp>(
"tmin");
1363 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1364 std::string conditionTEMP1 =
"RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1365 queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1366 coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1367 while (cursorFTEMP1.next()) {
1382 const coral::AttributeList& row = cursorFTEMP1.currentRow();
1383 float idoub = row[
"DPID"].data<
float>();
1384 int id =
static_cast<int>(idoub);
1385 float temp1 = row[
"TEMP1"].data<
float>();
1386 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1387 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1388 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1390 Itemp.
temp1 = temp1;
1393 febarray.push_back(Itemp);
1399 std::cout <<
"Processing TEMP2..." << std::endl;
1400 coral::AttributeList conditionData;
1401 conditionData.extend<coral::TimeStamp>(
"tmin");
1402 conditionData.extend<coral::TimeStamp>(
"tmax");
1403 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1404 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1406 "RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1407 queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1408 coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1409 while (cursorFTEMP2.next()) {
1424 const coral::AttributeList& row = cursorFTEMP2.currentRow();
1425 float idoub = row[
"DPID"].data<
float>();
1426 int id =
static_cast<int>(idoub);
1427 float temp2 = row[
"TEMP2"].data<
float>();
1428 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1429 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1430 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1432 Itemp.
temp2 = temp2;
1435 febarray.push_back(Itemp);
1438 std::cout <<
">> Processing TEMP2..." << std::endl;
1439 coral::AttributeList conditionData;
1440 conditionData.extend<coral::TimeStamp>(
"tmin");
1441 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1442 std::string conditionTEMP2 =
"RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1443 queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1444 coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1445 while (cursorFTEMP2.next()) {
1460 const coral::AttributeList& row = cursorFTEMP2.currentRow();
1461 float idoub = row[
"DPID"].data<
float>();
1462 int id =
static_cast<int>(idoub);
1463 float temp2 = row[
"TEMP2"].data<
float>();
1464 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1465 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1466 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1468 Itemp.
temp2 = temp2;
1471 febarray.push_back(Itemp);
1475 std::cout <<
">> FEB array --> size: " << febarray.size() <<
" >> done." << std::endl;
1481 session->transaction().commit();
1490 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
1493 session->transaction().start(
true);
1494 coral::ISchema& schema = session->nominalSchema();
1495 std::cout <<
">> creating UXC object..." << std::endl;
1498 coral::IQuery* queryUXCP = schema.newQuery();
1499 queryUXCP->addToTableList(
"RPCGASPARAMETERS");
1500 queryUXCP->addToTableList(
"DP_NAME2ID");
1501 queryUXCP->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1502 queryUXCP->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1503 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1504 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1505 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1506 coral::IQuery* queryUXCT = schema.newQuery();
1507 queryUXCT->addToTableList(
"RPCCOOLING");
1508 queryUXCT->addToTableList(
"DP_NAME2ID");
1509 queryUXCT->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1510 queryUXCT->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1511 queryUXCT->addToOutputList(
"RPCCOOLING.DPID",
"DPID");
1512 queryUXCT->addToOutputList(
"RPCCOOLING.CHANGE_DATE",
"TSTAMP");
1513 queryUXCT->addToOutputList(
"RPCCOOLING.VALUE",
"VALUE");
1514 coral::IQuery* queryUXCH = schema.newQuery();
1515 queryUXCH->addToTableList(
"RPCCOOLING");
1516 queryUXCH->addToTableList(
"DP_NAME2ID");
1517 queryUXCH->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1518 queryUXCH->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1519 queryUXCH->addToOutputList(
"RPCCOOLING.DPID",
"DPID");
1520 queryUXCH->addToOutputList(
"RPCCOOLING.CHANGE_DATE",
"TSTAMP");
1521 queryUXCH->addToOutputList(
"RPCCOOLING.VALUE",
"VALUE");
1524 std::vector<RPCObUXC::Item> uxcarray;
1525 coral::TimeStamp tlast =
tMIN;
1529 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
1530 std::cout <<
"Processing UXC..." << std::endl;
1531 coral::AttributeList conditionData;
1532 conditionData.extend<coral::TimeStamp>(
"tmin");
1533 conditionData.extend<coral::TimeStamp>(
"tmax");
1534 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1535 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1537 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1538 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%UXCPressure%')";
1539 queryUXCP->setCondition(conditionUXCP, conditionData);
1540 coral::ICursor& cursorUXCP = queryUXCP->execute();
1541 while (cursorUXCP.next()) {
1545 const coral::AttributeList& row = cursorUXCP.currentRow();
1546 float value = row[
"VALUE"].data<
float>();
1547 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1548 unsigned long long ut_time =
TtoUT(ts);
1551 uxcarray.push_back(Itemp);
1554 "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND " 1555 "(DP_NAME2ID.DPNAME like '%TempUXC%')";
1556 queryUXCT->setCondition(conditionUXCT, conditionData);
1557 coral::ICursor& cursorUXCT = queryUXCT->execute();
1558 while (cursorUXCT.next()) {
1562 const coral::AttributeList& row = cursorUXCT.currentRow();
1563 float value = row[
"VALUE"].data<
float>();
1564 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1565 unsigned long long ut_time =
TtoUT(ts);
1568 uxcarray.push_back(Itemp);
1571 "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND " 1572 "(DP_NAME2ID.DPNAME like '%DewpointUXC%')";
1573 queryUXCH->setCondition(conditionUXCH, conditionData);
1574 coral::ICursor& cursorUXCH = queryUXCH->execute();
1575 while (cursorUXCH.next()) {
1579 const coral::AttributeList& row = cursorUXCH.currentRow();
1580 float value = row[
"VALUE"].data<
float>();
1581 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1582 unsigned long long ut_time =
TtoUT(ts);
1585 uxcarray.push_back(Itemp);
1588 std::cout <<
"This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1591 std::cout <<
">> UXC array --> size: " << uxcarray.size() <<
" >> done." << std::endl;
1595 session->transaction().commit();
1604 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
1607 session->transaction().start(
true);
1608 coral::ISchema& schema = session->nominalSchema();
1609 std::cout <<
">> creating UXC object..." << std::endl;
1611 coral::IQuery* queryMix = schema.newQuery();
1612 queryMix->addToTableList(
"RPCGASPARAMETERS");
1613 queryMix->addToTableList(
"DP_NAME2ID");
1614 queryMix->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1615 queryMix->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1616 queryMix->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1617 queryMix->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1618 queryMix->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1620 coral::IQuery* queryMix2 = schema.newQuery();
1621 queryMix2->addToTableList(
"RPCGASPARAMETERS");
1622 queryMix2->addToTableList(
"DP_NAME2ID");
1623 queryMix2->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1624 queryMix2->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1625 queryMix2->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1626 queryMix2->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1627 queryMix2->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1629 coral::IQuery* queryMix3 = schema.newQuery();
1630 queryMix3->addToTableList(
"RPCGASPARAMETERS");
1631 queryMix3->addToTableList(
"DP_NAME2ID");
1632 queryMix3->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1633 queryMix3->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1634 queryMix3->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1635 queryMix3->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1636 queryMix3->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1639 std::vector<RPCObGasMix::Item> marray;
1640 coral::TimeStamp tlast =
tMIN;
1644 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
1645 std::cout <<
"Processing UXC..." << std::endl;
1646 coral::AttributeList conditionData;
1647 conditionData.extend<coral::TimeStamp>(
"tmin");
1648 conditionData.extend<coral::TimeStamp>(
"tmax");
1649 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1650 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1652 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1653 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%IC4H10Ratio%')";
1654 queryMix->setCondition(conditionM1, conditionData);
1655 coral::ICursor& cursorMix = queryMix->execute();
1656 while (cursorMix.next()) {
1660 const coral::AttributeList& row = cursorMix.currentRow();
1661 float value = row[
"VALUE"].data<
float>();
1662 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1663 unsigned long long ut_time =
TtoUT(ts);
1666 marray.push_back(Mtemp);
1669 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1670 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%C2H2F4Ratio%')";
1671 queryMix2->setCondition(conditionM2, conditionData);
1672 coral::ICursor& cursorMix2 = queryMix2->execute();
1673 while (cursorMix2.next()) {
1677 const coral::AttributeList& row = cursorMix2.currentRow();
1678 float value = row[
"VALUE"].data<
float>();
1679 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1680 unsigned long long ut_time =
TtoUT(ts);
1683 marray.push_back(Mtemp);
1686 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1687 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%SF6Ratio%')";
1688 queryMix3->setCondition(conditionM3, conditionData);
1689 coral::ICursor& cursorMix3 = queryMix3->execute();
1690 while (cursorMix3.next()) {
1694 const coral::AttributeList& row = cursorMix3.currentRow();
1695 float value = row[
"VALUE"].data<
float>();
1696 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1697 unsigned long long ut_time =
TtoUT(ts);
1700 marray.push_back(Mtemp);
1703 std::cout <<
"This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1706 std::cout <<
">> GasMix array --> size: " << marray.size() <<
" >> done." << std::endl;
1708 session->transaction().commit();
1715 int yea =
static_cast<int>(
trunc(utime / 31536000) + 1970);
1716 int yes = (yea - 1970) * 31536000;
1717 int cony = ((yea - 1972) % 4) + 1;
1719 yes = yes + (yea - 1972) / 4 * 86400;
1721 yes = yes +
static_cast<int>(
trunc((yea - 1972) / 4)) * 86400;
1722 int day =
static_cast<int>(
trunc((utime - yes) / 86400));
1723 int rest =
static_cast<int>(utime - yes -
day * 86400);
1732 if (
day >= 32 &&
day < 61) {
1736 if (
day >= 61 &&
day < 92) {
1740 if (
day >= 92 &&
day < 122) {
1744 if (
day >= 122 &&
day < 153) {
1748 if (
day >= 153 &&
day < 183) {
1752 if (
day >= 183 &&
day < 214) {
1756 if (
day >= 214 &&
day < 245) {
1760 if (
day >= 245 &&
day < 275) {
1764 if (
day >= 275 &&
day < 306) {
1768 if (
day >= 306 &&
day < 336) {
1783 if (
day >= 32 &&
day < 60) {
1787 if (
day >= 60 &&
day < 91) {
1791 if (
day >= 91 &&
day < 121) {
1795 if (
day >= 121 &&
day < 152) {
1799 if (
day >= 152 &&
day < 182) {
1803 if (
day >= 182 &&
day < 213) {
1807 if (
day >= 213 &&
day < 244) {
1811 if (
day >= 244 &&
day < 274) {
1815 if (
day >= 274 &&
day < 305) {
1819 if (
day >= 305 &&
day < 335) {
1829 int hou =
static_cast<int>(
trunc(
rest / 3600));
1838 coral::TimeStamp Tthr;
1846 long long utime = (
time.year() - 1970) * 31536000 + static_cast<int>(
trunc((
time.year() - 1972) / 4)) * 86400 +
1847 (((
time.month() - 1) * 31) * 86400) + ((
time.day() - 1) * 86400) +
time.hour() * 3600 +
1848 time.minute() * 60 +
time.second();
1850 if (
time.month() == 3)
1851 utime = utime - 3 * 86400;
1852 if (
time.month() == 4)
1853 utime = utime - 3 * 86400;
1854 if (
time.month() == 5)
1855 utime = utime - 4 * 86400;
1856 if (
time.month() == 6)
1857 utime = utime - 4 * 86400;
1858 if (
time.month() == 7)
1859 utime = utime - 5 * 86400;
1860 if (
time.month() == 8)
1861 utime = utime - 5 * 86400;
1862 if (
time.month() == 9)
1863 utime = utime - 5 * 86400;
1864 if (
time.month() == 10)
1865 utime = utime - 6 * 86400;
1866 if (
time.month() == 11)
1867 utime = utime - 6 * 86400;
1868 if (
time.month() == 12)
1869 utime = utime - 7 * 86400;
1876 fir.year() * 1e10 + fir.month() + 1e8 + fir.day() * 1e6 + fir.hour() * 1
e4 + fir.minute() * 1e2 + fir.second();
1878 sec.year() * 1e10 +
sec.month() + 1e8 +
sec.day() * 1e6 +
sec.hour() * 1
e4 +
sec.minute() * 1e2 +
sec.second();
unsigned long long TtoUT(const coral::TimeStamp &time)
std::vector< RPCObGasMix::Item > createMix(long long since, long long till)
bool isMajor(const coral::TimeStamp &fir, const coral::TimeStamp &sec)
std::vector< RPCObFebmap::Feb_Item > createFEB(long long since, long long till)
RPCFw(const std::string &connectionString, const std::string &userName, const std::string &password)
std::vector< RPCObUXC::Item > createUXC(long long since, long long till)
U second(std::pair< T, U > const &p)
std::vector< RPCObPVSSmap::Item > createIDMAP()
std::vector< RPCObGas::Item > createGAS(long long since, long long till)
coral::TimeStamp UTtoT(long long utime)
std::vector< RPCObVmon::V_Item > createVMON(long long from, long long till)
std::vector< RPCObStatus::S_Item > createSTATUS(long long since, long long till)
std::vector< RPCObTemp::T_Item > createT(long long since, long long till)
coral::ISession * connect(const std::string &connectionString, const std::string &userName, const std::string &password)
std::vector< RPCObImon::I_Item > createIMON(long long since, long long till)
std::string m_connectionString