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" 31 :
RPCDBCom(), m_connectionString(connectionString), m_userName(userName), m_password(password) {}
41 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
44 session->transaction().start(
true);
45 coral::ISchema& schema = session->nominalSchema();
47 coral::IQuery* queryI = schema.newQuery();
48 queryI->addToTableList(
"FWCAENCHANNEL");
49 queryI->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID");
50 queryI->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP");
51 queryI->addToOutputList(
"FWCAENCHANNEL.ACTUAL_IMON",
"IMON");
54 std::vector<RPCObImon::I_Item> imonarray;
55 coral::TimeStamp tlast =
tMIN;
59 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
60 std::cout <<
">> creating IMON object..." << std::endl;
61 coral::AttributeList conditionData;
62 conditionData.extend<coral::TimeStamp>(
"tmin");
63 conditionData.extend<coral::TimeStamp>(
"tmax");
64 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
65 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
66 std::string condition =
"FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
67 queryI->setCondition(condition, conditionData);
68 coral::ICursor& cursorI = queryI->execute();
69 while (cursorI.next()) {
70 const coral::AttributeList& row = cursorI.currentRow();
71 float idoub = row[
"DPID"].data<
float>();
72 int id =
static_cast<int>(idoub);
73 float val = row[
"IMON"].data<
float>();
74 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
75 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
76 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
81 imonarray.push_back(Itemp);
85 std::cout <<
">> creating IMON object..." << std::endl;
86 coral::AttributeList conditionData;
87 conditionData.extend<coral::TimeStamp>(
"tmin");
88 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
89 std::string condition =
"FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
90 queryI->setCondition(condition, conditionData);
91 coral::ICursor& cursorI = queryI->execute();
92 while (cursorI.next()) {
93 const coral::AttributeList& row = cursorI.currentRow();
94 float idoub = row[
"DPID"].data<
float>();
95 int id =
static_cast<int>(idoub);
96 float val = row[
"IMON"].data<
float>();
97 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
100 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
101 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
106 imonarray.push_back(Itemp);
113 std::cout <<
">> Imon array --> size: " << imonarray.size() <<
" >> done." << std::endl;
115 session->transaction().commit();
124 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
127 session->transaction().start(
true);
128 coral::ISchema& schema = session->nominalSchema();
130 coral::IQuery* queryV = schema.newQuery();
131 queryV->addToTableList(
"FWCAENCHANNEL");
132 queryV->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID");
133 queryV->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP");
134 queryV->addToOutputList(
"FWCAENCHANNEL.ACTUAL_VMON",
"VMON");
136 std::vector<RPCObVmon::V_Item> vmonarray;
137 coral::TimeStamp tlast =
tMIN;
141 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
142 std::cout <<
">> creating VMON object..." << std::endl;
143 coral::AttributeList conditionData;
144 conditionData.extend<coral::TimeStamp>(
"tmin");
145 conditionData.extend<coral::TimeStamp>(
"tmax");
146 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
147 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
149 " NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE " 151 queryV->setCondition(condition, conditionData);
152 coral::ICursor& cursorV = queryV->execute();
153 while (cursorV.next()) {
154 const coral::AttributeList& row = cursorV.currentRow();
155 float idoub = row[
"DPID"].data<
float>();
156 int id =
static_cast<int>(idoub);
157 float val = row[
"VMON"].data<
float>();
158 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
161 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
162 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
167 vmonarray.push_back(Vtemp);
171 std::cout <<
">> creating VMON object..." << std::endl;
172 coral::AttributeList conditionData;
173 conditionData.extend<coral::TimeStamp>(
"tmin");
174 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
175 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
176 queryV->setCondition(condition, conditionData);
177 coral::ICursor& cursorV = queryV->execute();
178 while (cursorV.next()) {
179 const coral::AttributeList& row = cursorV.currentRow();
180 float idoub = row[
"DPID"].data<
float>();
181 int id =
static_cast<int>(idoub);
182 float val = row[
"VMON"].data<
float>();
183 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
186 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
187 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
192 vmonarray.push_back(Vtemp);
197 std::cout <<
">> Vmon array --> size: " << vmonarray.size() <<
" >> done." << std::endl;
199 session->transaction().commit();
208 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
211 session->transaction().start(
true);
212 coral::ISchema& schema = session->nominalSchema();
214 std::cout <<
">> creating STATUS object..." << std::endl;
215 coral::IQuery* queryS = schema.newQuery();
216 queryS->addToTableList(
"FWCAENCHANNEL");
217 queryS->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID");
218 queryS->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP");
219 queryS->addToOutputList(
"FWCAENCHANNEL.ACTUAL_STATUS",
"STATUS");
221 std::vector<RPCObStatus::S_Item> statusarray;
222 coral::TimeStamp tlast =
tMIN;
226 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
227 std::cout <<
">> creating STATUS object..." << std::endl;
228 coral::AttributeList conditionData;
229 conditionData.extend<coral::TimeStamp>(
"tmin");
230 conditionData.extend<coral::TimeStamp>(
"tmax");
231 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
232 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
234 " NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE " 236 queryS->setCondition(condition, conditionData);
237 coral::ICursor& cursorS = queryS->execute();
238 while (cursorS.next()) {
239 const coral::AttributeList& row = cursorS.currentRow();
240 float idoub = row[
"DPID"].data<
float>();
241 int id =
static_cast<int>(idoub);
242 float val = row[
"STATUS"].data<
float>();
243 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
244 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
245 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
250 statusarray.push_back(Stemp);
254 std::cout <<
">> creating STATUS object..." << std::endl;
255 coral::AttributeList conditionData;
256 conditionData.extend<coral::TimeStamp>(
"tmin");
257 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
258 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
259 queryS->setCondition(condition, conditionData);
260 coral::ICursor& cursorS = queryS->execute();
261 while (cursorS.next()) {
262 const coral::AttributeList& row = cursorS.currentRow();
263 float idoub = row[
"DPID"].data<
float>();
264 int id =
static_cast<int>(idoub);
265 float val = row[
"STATUS"].data<
float>();
266 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
267 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
268 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
273 statusarray.push_back(Stemp);
277 std::cout <<
">> Staus array --> size: " << statusarray.size() <<
" >> done." << std::endl << std::endl << std::endl;
280 session->transaction().commit();
290 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
293 session->transaction().start(
true);
294 coral::ISchema& schema = session->nominalSchema();
296 coral::TimeStamp tlast =
tMIN;
299 coral::IQuery* querySIN = schema.newQuery();
300 querySIN->addToTableList(
"RPCGASCHANNEL");
301 querySIN->addToOutputList(
"RPCGASCHANNEL.DPID",
"DPID");
302 querySIN->addToOutputList(
"RPCGASCHANNEL.CHANGE_DATE",
"TSTAMP");
303 querySIN->addToOutputList(
"RPCGASCHANNEL.FLOWIN",
"FLOWIN");
306 coral::IQuery* querySOUT = schema.newQuery();
307 querySOUT->addToTableList(
"RPCGASCHANNEL");
308 querySOUT->addToOutputList(
"RPCGASCHANNEL.DPID",
"DPID");
309 querySOUT->addToOutputList(
"RPCGASCHANNEL.CHANGE_DATE",
"TSTAMP");
310 querySOUT->addToOutputList(
"RPCGASCHANNEL.FLOWOUT",
"FLOWOUT");
313 std::vector<RPCObGas::Item> gasarray;
318 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
319 std::cout <<
">> creating GAS object..." << std::endl;
320 std::cout <<
">> processing FLOWIN..." << std::endl;
321 coral::AttributeList conditionData;
322 conditionData.extend<coral::TimeStamp>(
"tmin");
323 conditionData.extend<coral::TimeStamp>(
"tmax");
324 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
325 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
326 std::string conditionIN =
"RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
328 querySIN->setCondition(conditionIN, conditionData);
329 coral::ICursor& cursorSIN = querySIN->execute();
330 while (cursorSIN.next()) {
336 const coral::AttributeList& row = cursorSIN.currentRow();
337 float idoub = row[
"DPID"].data<
float>();
338 int id =
static_cast<int>(idoub);
339 float val = row[
"FLOWIN"].data<
float>();
340 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
341 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
342 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
346 gastemp.
time = ntime;
347 gasarray.push_back(gastemp);
350 std::cout <<
">> creating GAS object..." << std::endl;
351 std::cout <<
">> processing FLOWIN..." << std::endl;
352 coral::AttributeList conditionData;
353 conditionData.extend<coral::TimeStamp>(
"tmin");
354 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
355 std::string conditionIN =
"RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin";
356 std::cout <<
"processing FLOWIN..." << std::endl;
357 querySIN->setCondition(conditionIN, conditionData);
358 coral::ICursor& cursorSIN = querySIN->execute();
359 while (cursorSIN.next()) {
365 const coral::AttributeList& row = cursorSIN.currentRow();
366 float idoub = row[
"DPID"].data<
float>();
367 int id =
static_cast<int>(idoub);
368 float val = row[
"FLOWIN"].data<
float>();
369 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
370 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
371 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
375 gastemp.
time = ntime;
376 gasarray.push_back(gastemp);
383 std::cout <<
">> processing FLOWOUT..." << std::endl;
384 coral::AttributeList conditionData;
385 conditionData.extend<coral::TimeStamp>(
"tmin");
386 conditionData.extend<coral::TimeStamp>(
"tmax");
387 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
388 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
389 std::string conditionOUT =
"RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
391 querySOUT->setCondition(conditionOUT, conditionData);
392 coral::ICursor& cursorSOUT = querySOUT->execute();
393 while (cursorSOUT.next()) {
399 const coral::AttributeList& row = cursorSOUT.currentRow();
400 float idoub = row[
"DPID"].data<
float>();
401 int id =
static_cast<int>(idoub);
402 float val = row[
"FLOWOUT"].data<
float>();
403 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
404 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
405 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
409 gastemp.
time = ntime;
410 gasarray.push_back(gastemp);
413 std::cout <<
">> processing FLOWOUT..." << std::endl;
414 coral::AttributeList conditionData;
415 conditionData.extend<coral::TimeStamp>(
"tmin");
416 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
417 std::string conditionOUT =
"RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin";
418 querySOUT->setCondition(conditionOUT, conditionData);
419 coral::ICursor& cursorSOUT = querySOUT->execute();
420 while (cursorSOUT.next()) {
426 const coral::AttributeList& row = cursorSOUT.currentRow();
427 float idoub = row[
"DPID"].data<
float>();
428 int id =
static_cast<int>(idoub);
429 float val = row[
"FLOWOUT"].data<
float>();
430 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
431 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
432 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
436 gastemp.
time = ntime;
437 gasarray.push_back(gastemp);
444 std::cout <<
">> Gas array --> size: " << gasarray.size() <<
" >> done." << std::endl << std::endl << std::endl;
448 session->transaction().commit();
458 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
461 session->transaction().start(
true);
462 coral::ISchema& schema = session->nominalSchema();
464 coral::IQuery* queryS = schema.newQuery();
465 queryS->addToTableList(
"FWCAENCHANNELADC");
466 queryS->addToOutputList(
"FWCAENCHANNELADC.DPID",
"DPID");
467 queryS->addToOutputList(
"FWCAENCHANNELADC.CHANGE_DATE",
"TSTAMP");
468 queryS->addToOutputList(
"FWCAENCHANNELADC.ACTUAL_TEMPERATURE",
"TEMPERATURE");
470 std::vector<RPCObTemp::T_Item> temparray;
471 coral::TimeStamp tlast =
tMIN;
475 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
476 std::cout <<
">> creating TEMPERATURE object..." << std::endl;
477 coral::AttributeList conditionData;
478 conditionData.extend<coral::TimeStamp>(
"tmin");
479 conditionData.extend<coral::TimeStamp>(
"tmax");
480 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
481 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
483 "FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
484 queryS->setCondition(condition, conditionData);
485 coral::ICursor& cursorS = queryS->execute();
486 while (cursorS.next()) {
487 const coral::AttributeList& row = cursorS.currentRow();
488 float idoub = row[
"DPID"].data<
float>();
489 int id =
static_cast<int>(idoub);
490 float val = row[
"TEMPERATURE"].data<
float>();
491 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
492 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
493 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
499 temparray.push_back(Ttemp);
504 std::cout <<
">> creating TEMPERATURE object..." << std::endl;
505 coral::AttributeList conditionData;
506 conditionData.extend<coral::TimeStamp>(
"tmin");
507 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
508 std::string condition =
"FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin";
509 queryS->setCondition(condition, conditionData);
510 coral::ICursor& cursorS = queryS->execute();
511 while (cursorS.next()) {
512 const coral::AttributeList& row = cursorS.currentRow();
513 float idoub = row[
"DPID"].data<
float>();
514 int id =
static_cast<int>(idoub);
515 float val = row[
"TEMPERATURE"].data<
float>();
516 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
517 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
518 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
524 temparray.push_back(Ttemp);
532 std::cout <<
">> Temperature array --> size: " << temparray.size() <<
" >> done." << std::endl
537 session->transaction().commit();
546 std::cout <<
">> Processing data..." << std::endl;
549 session->transaction().start(
true);
550 coral::ISchema& schema = session->nominalSchema();
552 std::cout <<
">> creating IDMAP object..." << std::endl;
553 coral::IQuery* queryM = schema.newQuery();
554 queryM->addToTableList(
"RPCPVSSDETID");
555 queryM->addToOutputList(
"RPCPVSSDETID.SINCE",
"SINCE");
556 queryM->addToOutputList(
"RPCPVSSDETID.PVSS_ID",
"PVSS_ID");
557 queryM->addToOutputList(
"RPCPVSSDETID.REGION",
"REGION");
558 queryM->addToOutputList(
"RPCPVSSDETID.RING",
"RING");
559 queryM->addToOutputList(
"RPCPVSSDETID.STATION",
"STATION");
560 queryM->addToOutputList(
"RPCPVSSDETID.SECTOR",
"SECTOR");
561 queryM->addToOutputList(
"RPCPVSSDETID.LAYER",
"LAYER");
562 queryM->addToOutputList(
"RPCPVSSDETID.SUBSECTOR",
"SUBSECTOR");
563 queryM->addToOutputList(
"RPCPVSSDETID.SUPPLYTYPE",
"SUPPLYTYPE");
565 std::string condM =
"RPCPVSSDETID.PVSS_ID is not NULL";
568 coral::ICursor& cursorM = queryM->execute();
571 std::vector<RPCObPVSSmap::Item> idmaparray;
572 while (cursorM.next()) {
573 const coral::AttributeList& row = cursorM.currentRow();
574 int id = row[
"PVSS_ID"].data<
int>();
583 int reg = atoi(reg_s.c_str());
584 int rin = atoi(rin_s.c_str());
585 int sta = atoi(sta_s.c_str());
586 int sec = atoi(sec_s.c_str());
587 int lay = atoi(lay_s.c_str());
588 int sub = atoi(sub_s.c_str());
602 coral::TimeStamp ts = row[
"SINCE"].data<coral::TimeStamp>();
604 std::ostringstream dday;
605 std::ostringstream dmon;
606 std::ostringstream dyea;
612 Itemp.
since = atoi(date.c_str());
622 idmaparray.push_back(Itemp);
627 std::cout <<
">> IDMAP array --> size: " << idmaparray.size() <<
" >> done." << std::endl;
629 session->transaction().commit();
638 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
641 session->transaction().start(
true);
642 coral::ISchema& schema = session->nominalSchema();
643 std::cout <<
">> creating FEB object..." << std::endl;
646 coral::IQuery* queryFVTH1 = schema.newQuery();
647 queryFVTH1->addToTableList(
"RPCFEB");
648 queryFVTH1->addToOutputList(
"RPCFEB.DPID",
"DPID");
649 queryFVTH1->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
650 queryFVTH1->addToOutputList(
"RPCFEB.VTH1",
"VTH1");
653 coral::IQuery* queryFVTH2 = schema.newQuery();
654 queryFVTH2->addToTableList(
"RPCFEB");
655 queryFVTH2->addToOutputList(
"RPCFEB.DPID",
"DPID");
656 queryFVTH2->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
657 queryFVTH2->addToOutputList(
"RPCFEB.VTH2",
"VTH2");
660 coral::IQuery* queryFVTH3 = schema.newQuery();
661 queryFVTH3->addToTableList(
"RPCFEB");
662 queryFVTH3->addToOutputList(
"RPCFEB.DPID",
"DPID");
663 queryFVTH3->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
664 queryFVTH3->addToOutputList(
"RPCFEB.VTH3",
"VTH3");
667 coral::IQuery* queryFVTH4 = schema.newQuery();
668 queryFVTH4->addToTableList(
"RPCFEB");
669 queryFVTH4->addToOutputList(
"RPCFEB.DPID",
"DPID");
670 queryFVTH4->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
671 queryFVTH4->addToOutputList(
"RPCFEB.VTH4",
"VTH4");
674 coral::IQuery* queryFVMON1 = schema.newQuery();
675 queryFVMON1->addToTableList(
"RPCFEB");
676 queryFVMON1->addToOutputList(
"RPCFEB.DPID",
"DPID");
677 queryFVMON1->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
678 queryFVMON1->addToOutputList(
"RPCFEB.VMON1",
"VMON1");
681 coral::IQuery* queryFVMON2 = schema.newQuery();
682 queryFVMON2->addToTableList(
"RPCFEB");
683 queryFVMON2->addToOutputList(
"RPCFEB.DPID",
"DPID");
684 queryFVMON2->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
685 queryFVMON2->addToOutputList(
"RPCFEB.VMON2",
"VMON2");
688 coral::IQuery* queryFVMON3 = schema.newQuery();
689 queryFVMON3->addToTableList(
"RPCFEB");
690 queryFVMON3->addToOutputList(
"RPCFEB.DPID",
"DPID");
691 queryFVMON3->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
692 queryFVMON3->addToOutputList(
"RPCFEB.VMON3",
"VMON3");
695 coral::IQuery* queryFVMON4 = schema.newQuery();
696 queryFVMON4->addToTableList(
"RPCFEB");
697 queryFVMON4->addToOutputList(
"RPCFEB.DPID",
"DPID");
698 queryFVMON4->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
699 queryFVMON4->addToOutputList(
"RPCFEB.VMON4",
"VMON4");
702 coral::IQuery* queryFTEMP1 = schema.newQuery();
703 queryFTEMP1->addToTableList(
"RPCFEB");
704 queryFTEMP1->addToOutputList(
"RPCFEB.DPID",
"DPID");
705 queryFTEMP1->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
706 queryFTEMP1->addToOutputList(
"RPCFEB.TEMPERATURE1",
"TEMP1");
709 coral::IQuery* queryFTEMP2 = schema.newQuery();
710 queryFTEMP2->addToTableList(
"RPCFEB");
711 queryFTEMP2->addToOutputList(
"RPCFEB.DPID",
"DPID");
712 queryFTEMP2->addToOutputList(
"RPCFEB.CHANGE_DATE",
"TSTAMP");
713 queryFTEMP2->addToOutputList(
"RPCFEB.TEMPERATURE2",
"TEMP2");
716 std::vector<RPCObFebmap::Feb_Item> febarray;
717 coral::TimeStamp tlast =
tMIN;
721 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
722 std::cout <<
"Processing VTH1..." << std::endl;
723 coral::AttributeList conditionData;
724 conditionData.extend<coral::TimeStamp>(
"tmin");
725 conditionData.extend<coral::TimeStamp>(
"tmax");
726 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
727 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
728 std::string conditionVTH1 =
"RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
729 queryFVTH1->setCondition(conditionVTH1, conditionData);
730 coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
731 while (cursorFVTH1.next()) {
746 const coral::AttributeList& row = cursorFVTH1.currentRow();
747 float idoub = row[
"DPID"].data<
float>();
748 int id =
static_cast<int>(idoub);
749 float vth1 = row[
"VTH1"].data<
float>();
750 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
751 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
752 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
757 febarray.push_back(Itemp);
760 std::cout <<
">> Processing VTH1..." << std::endl;
761 coral::AttributeList conditionData;
762 conditionData.extend<coral::TimeStamp>(
"tmin");
763 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
764 std::string conditionVTH1 =
"RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
765 queryFVTH1->setCondition(conditionVTH1, conditionData);
766 coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
767 while (cursorFVTH1.next()) {
782 const coral::AttributeList& row = cursorFVTH1.currentRow();
783 float idoub = row[
"DPID"].data<
float>();
784 int id =
static_cast<int>(idoub);
785 float vth1 = row[
"VTH1"].data<
float>();
786 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
787 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
788 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
793 febarray.push_back(Itemp);
799 std::cout <<
"Processing VTH2..." << std::endl;
800 coral::AttributeList conditionData;
801 conditionData.extend<coral::TimeStamp>(
"tmin");
802 conditionData.extend<coral::TimeStamp>(
"tmax");
803 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
804 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
805 std::string conditionVTH2 =
"RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
806 queryFVTH2->setCondition(conditionVTH2, conditionData);
807 coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
808 while (cursorFVTH2.next()) {
823 const coral::AttributeList& row = cursorFVTH2.currentRow();
824 float idoub = row[
"DPID"].data<
float>();
825 int id =
static_cast<int>(idoub);
826 float vth2 = row[
"VTH2"].data<
float>();
827 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
828 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
829 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
834 febarray.push_back(Itemp);
837 std::cout <<
">> Processing VTH2..." << std::endl;
838 coral::AttributeList conditionData;
839 conditionData.extend<coral::TimeStamp>(
"tmin");
840 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
841 std::string conditionVTH2 =
"RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
842 queryFVTH2->setCondition(conditionVTH2, conditionData);
843 coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
844 while (cursorFVTH2.next()) {
859 const coral::AttributeList& row = cursorFVTH2.currentRow();
860 float idoub = row[
"DPID"].data<
float>();
861 int id =
static_cast<int>(idoub);
862 float vth2 = row[
"VTH2"].data<
float>();
863 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
864 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
865 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
870 febarray.push_back(Itemp);
876 std::cout <<
"Processing VTH3..." << std::endl;
877 coral::AttributeList conditionData;
878 conditionData.extend<coral::TimeStamp>(
"tmin");
879 conditionData.extend<coral::TimeStamp>(
"tmax");
880 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
881 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
882 std::string conditionVTH3 =
"RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
883 queryFVTH3->setCondition(conditionVTH3, conditionData);
884 coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
885 while (cursorFVTH3.next()) {
900 const coral::AttributeList& row = cursorFVTH3.currentRow();
901 float idoub = row[
"DPID"].data<
float>();
902 int id =
static_cast<int>(idoub);
903 float vth3 = row[
"VTH3"].data<
float>();
904 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
905 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
906 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
911 febarray.push_back(Itemp);
914 std::cout <<
">> Processing VTH3..." << std::endl;
915 coral::AttributeList conditionData;
916 conditionData.extend<coral::TimeStamp>(
"tmin");
917 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
918 std::string conditionVTH3 =
"RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
919 queryFVTH3->setCondition(conditionVTH3, conditionData);
920 coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
921 while (cursorFVTH3.next()) {
936 const coral::AttributeList& row = cursorFVTH3.currentRow();
937 float idoub = row[
"DPID"].data<
float>();
938 int id =
static_cast<int>(idoub);
939 float vth3 = row[
"VTH3"].data<
float>();
940 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
941 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
942 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
947 febarray.push_back(Itemp);
953 std::cout <<
"Processing VTH4..." << std::endl;
954 coral::AttributeList conditionData;
955 conditionData.extend<coral::TimeStamp>(
"tmin");
956 conditionData.extend<coral::TimeStamp>(
"tmax");
957 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
958 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
959 std::string conditionVTH4 =
"RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
960 queryFVTH4->setCondition(conditionVTH4, conditionData);
961 coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
962 while (cursorFVTH4.next()) {
977 const coral::AttributeList& row = cursorFVTH4.currentRow();
978 float idoub = row[
"DPID"].data<
float>();
979 int id =
static_cast<int>(idoub);
980 float vth4 = row[
"VTH4"].data<
float>();
981 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
982 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
983 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
988 febarray.push_back(Itemp);
991 std::cout <<
">> Processing VTH4..." << std::endl;
992 coral::AttributeList conditionData;
993 conditionData.extend<coral::TimeStamp>(
"tmin");
994 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
995 std::string conditionVTH4 =
"RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
996 queryFVTH4->setCondition(conditionVTH4, conditionData);
997 coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
998 while (cursorFVTH4.next()) {
1013 const coral::AttributeList& row = cursorFVTH4.currentRow();
1014 float idoub = row[
"DPID"].data<
float>();
1015 int id =
static_cast<int>(idoub);
1016 float vth4 = row[
"VTH4"].data<
float>();
1017 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1018 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1019 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1024 febarray.push_back(Itemp);
1030 std::cout <<
"Processing VMON1..." << std::endl;
1031 coral::AttributeList conditionData;
1032 conditionData.extend<coral::TimeStamp>(
"tmin");
1033 conditionData.extend<coral::TimeStamp>(
"tmax");
1034 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1035 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1036 std::string conditionVMON1 =
"RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1037 queryFVMON1->setCondition(conditionVMON1, conditionData);
1038 coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1039 while (cursorFVMON1.next()) {
1054 const coral::AttributeList& row = cursorFVMON1.currentRow();
1055 float idoub = row[
"DPID"].data<
float>();
1056 int id =
static_cast<int>(idoub);
1057 float vmon1 = row[
"VMON1"].data<
float>();
1058 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1059 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1060 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1062 Itemp.
vmon1 = vmon1;
1065 febarray.push_back(Itemp);
1068 std::cout <<
">> Processing VMON1..." << std::endl;
1069 coral::AttributeList conditionData;
1070 conditionData.extend<coral::TimeStamp>(
"tmin");
1071 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1072 std::string conditionVMON1 =
"RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1073 queryFVMON1->setCondition(conditionVMON1, conditionData);
1074 coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1075 while (cursorFVMON1.next()) {
1090 const coral::AttributeList& row = cursorFVMON1.currentRow();
1091 float idoub = row[
"DPID"].data<
float>();
1092 int id =
static_cast<int>(idoub);
1093 float vmon1 = row[
"VMON1"].data<
float>();
1094 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1095 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1096 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1098 Itemp.
vmon1 = vmon1;
1101 febarray.push_back(Itemp);
1107 std::cout <<
"Processing VMON2..." << std::endl;
1108 coral::AttributeList conditionData;
1109 conditionData.extend<coral::TimeStamp>(
"tmin");
1110 conditionData.extend<coral::TimeStamp>(
"tmax");
1111 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1112 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1113 std::string conditionVMON2 =
"RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1114 queryFVMON2->setCondition(conditionVMON2, conditionData);
1115 coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1116 while (cursorFVMON2.next()) {
1131 const coral::AttributeList& row = cursorFVMON2.currentRow();
1132 float idoub = row[
"DPID"].data<
float>();
1133 int id =
static_cast<int>(idoub);
1134 float vmon2 = row[
"VMON2"].data<
float>();
1135 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1136 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1137 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1139 Itemp.
vmon2 = vmon2;
1142 febarray.push_back(Itemp);
1145 std::cout <<
">> Processing VMON2..." << std::endl;
1146 coral::AttributeList conditionData;
1147 conditionData.extend<coral::TimeStamp>(
"tmin");
1148 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1149 std::string conditionVMON2 =
"RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1150 queryFVMON2->setCondition(conditionVMON2, conditionData);
1151 coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1152 while (cursorFVMON2.next()) {
1167 const coral::AttributeList& row = cursorFVMON2.currentRow();
1168 float idoub = row[
"DPID"].data<
float>();
1169 int id =
static_cast<int>(idoub);
1170 float vmon2 = row[
"VMON2"].data<
float>();
1171 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1172 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1173 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1175 Itemp.
vmon2 = vmon2;
1178 febarray.push_back(Itemp);
1184 std::cout <<
"Processing VMON3..." << std::endl;
1185 coral::AttributeList conditionData;
1186 conditionData.extend<coral::TimeStamp>(
"tmin");
1187 conditionData.extend<coral::TimeStamp>(
"tmax");
1188 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1189 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1190 std::string conditionVMON3 =
"RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1191 queryFVMON3->setCondition(conditionVMON3, conditionData);
1192 coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1193 while (cursorFVMON3.next()) {
1208 const coral::AttributeList& row = cursorFVMON3.currentRow();
1209 float idoub = row[
"DPID"].data<
float>();
1210 int id =
static_cast<int>(idoub);
1211 float vmon3 = row[
"VMON3"].data<
float>();
1212 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1213 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1214 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1216 Itemp.
vmon3 = vmon3;
1219 febarray.push_back(Itemp);
1222 std::cout <<
">> Processing VMON3..." << std::endl;
1223 coral::AttributeList conditionData;
1224 conditionData.extend<coral::TimeStamp>(
"tmin");
1225 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1226 std::string conditionVMON3 =
"RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1227 queryFVMON3->setCondition(conditionVMON3, conditionData);
1228 coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1229 while (cursorFVMON3.next()) {
1244 const coral::AttributeList& row = cursorFVMON3.currentRow();
1245 float idoub = row[
"DPID"].data<
float>();
1246 int id =
static_cast<int>(idoub);
1247 float vmon3 = row[
"VMON3"].data<
float>();
1248 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1249 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1250 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1252 Itemp.
vmon3 = vmon3;
1255 febarray.push_back(Itemp);
1261 std::cout <<
"Processing VMON4..." << std::endl;
1262 coral::AttributeList conditionData;
1263 conditionData.extend<coral::TimeStamp>(
"tmin");
1264 conditionData.extend<coral::TimeStamp>(
"tmax");
1265 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1266 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1267 std::string conditionVMON4 =
"RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1268 queryFVMON4->setCondition(conditionVMON4, conditionData);
1269 coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1270 while (cursorFVMON4.next()) {
1285 const coral::AttributeList& row = cursorFVMON4.currentRow();
1286 float idoub = row[
"DPID"].data<
float>();
1287 int id =
static_cast<int>(idoub);
1288 float vmon4 = row[
"VMON4"].data<
float>();
1289 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1290 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1291 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1293 Itemp.
vmon4 = vmon4;
1296 febarray.push_back(Itemp);
1299 std::cout <<
">> Processing VMON4..." << std::endl;
1300 coral::AttributeList conditionData;
1301 conditionData.extend<coral::TimeStamp>(
"tmin");
1302 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1303 std::string conditionVMON4 =
"RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1304 queryFVMON4->setCondition(conditionVMON4, conditionData);
1305 coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1306 while (cursorFVMON4.next()) {
1321 const coral::AttributeList& row = cursorFVMON4.currentRow();
1322 float idoub = row[
"DPID"].data<
float>();
1323 int id =
static_cast<int>(idoub);
1324 float vmon4 = row[
"VMON4"].data<
float>();
1325 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1326 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1327 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1329 Itemp.
vmon4 = vmon4;
1332 febarray.push_back(Itemp);
1338 std::cout <<
"Processing TEMP1..." << std::endl;
1339 coral::AttributeList conditionData;
1340 conditionData.extend<coral::TimeStamp>(
"tmin");
1341 conditionData.extend<coral::TimeStamp>(
"tmax");
1342 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1343 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1345 "RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1346 queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1347 coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1348 while (cursorFTEMP1.next()) {
1363 const coral::AttributeList& row = cursorFTEMP1.currentRow();
1364 float idoub = row[
"DPID"].data<
float>();
1365 int id =
static_cast<int>(idoub);
1366 float temp1 = row[
"TEMP1"].data<
float>();
1367 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1368 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1369 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1371 Itemp.
temp1 = temp1;
1374 febarray.push_back(Itemp);
1377 std::cout <<
">> Processing TEMP1..." << std::endl;
1378 coral::AttributeList conditionData;
1379 conditionData.extend<coral::TimeStamp>(
"tmin");
1380 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1381 std::string conditionTEMP1 =
"RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1382 queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1383 coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1384 while (cursorFTEMP1.next()) {
1399 const coral::AttributeList& row = cursorFTEMP1.currentRow();
1400 float idoub = row[
"DPID"].data<
float>();
1401 int id =
static_cast<int>(idoub);
1402 float temp1 = row[
"TEMP1"].data<
float>();
1403 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1404 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1405 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1407 Itemp.
temp1 = temp1;
1410 febarray.push_back(Itemp);
1416 std::cout <<
"Processing TEMP2..." << std::endl;
1417 coral::AttributeList conditionData;
1418 conditionData.extend<coral::TimeStamp>(
"tmin");
1419 conditionData.extend<coral::TimeStamp>(
"tmax");
1420 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1421 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1423 "RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1424 queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1425 coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1426 while (cursorFTEMP2.next()) {
1441 const coral::AttributeList& row = cursorFTEMP2.currentRow();
1442 float idoub = row[
"DPID"].data<
float>();
1443 int id =
static_cast<int>(idoub);
1444 float temp2 = row[
"TEMP2"].data<
float>();
1445 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1446 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1447 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1449 Itemp.
temp2 = temp2;
1452 febarray.push_back(Itemp);
1455 std::cout <<
">> Processing TEMP2..." << std::endl;
1456 coral::AttributeList conditionData;
1457 conditionData.extend<coral::TimeStamp>(
"tmin");
1458 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1459 std::string conditionTEMP2 =
"RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1460 queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1461 coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1462 while (cursorFTEMP2.next()) {
1477 const coral::AttributeList& row = cursorFTEMP2.currentRow();
1478 float idoub = row[
"DPID"].data<
float>();
1479 int id =
static_cast<int>(idoub);
1480 float temp2 = row[
"TEMP2"].data<
float>();
1481 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1482 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1483 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1485 Itemp.
temp2 = temp2;
1488 febarray.push_back(Itemp);
1492 std::cout <<
">> FEB array --> size: " << febarray.size() <<
" >> done." << std::endl;
1498 session->transaction().commit();
1507 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
1510 session->transaction().start(
true);
1511 coral::ISchema& schema = session->nominalSchema();
1512 std::cout <<
">> creating UXC object..." << std::endl;
1515 coral::IQuery* queryUXCP = schema.newQuery();
1516 queryUXCP->addToTableList(
"RPCGASPARAMETERS");
1517 queryUXCP->addToTableList(
"DP_NAME2ID");
1518 queryUXCP->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1519 queryUXCP->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1520 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1521 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1522 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1523 coral::IQuery* queryUXCT = schema.newQuery();
1524 queryUXCT->addToTableList(
"RPCCOOLING");
1525 queryUXCT->addToTableList(
"DP_NAME2ID");
1526 queryUXCT->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1527 queryUXCT->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1528 queryUXCT->addToOutputList(
"RPCCOOLING.DPID",
"DPID");
1529 queryUXCT->addToOutputList(
"RPCCOOLING.CHANGE_DATE",
"TSTAMP");
1530 queryUXCT->addToOutputList(
"RPCCOOLING.VALUE",
"VALUE");
1531 coral::IQuery* queryUXCH = schema.newQuery();
1532 queryUXCH->addToTableList(
"RPCCOOLING");
1533 queryUXCH->addToTableList(
"DP_NAME2ID");
1534 queryUXCH->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1535 queryUXCH->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1536 queryUXCH->addToOutputList(
"RPCCOOLING.DPID",
"DPID");
1537 queryUXCH->addToOutputList(
"RPCCOOLING.CHANGE_DATE",
"TSTAMP");
1538 queryUXCH->addToOutputList(
"RPCCOOLING.VALUE",
"VALUE");
1541 std::vector<RPCObUXC::Item> uxcarray;
1542 coral::TimeStamp tlast =
tMIN;
1546 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
1547 std::cout <<
"Processing UXC..." << std::endl;
1548 coral::AttributeList conditionData;
1549 conditionData.extend<coral::TimeStamp>(
"tmin");
1550 conditionData.extend<coral::TimeStamp>(
"tmax");
1551 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1552 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1554 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1555 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%UXCPressure%')";
1556 queryUXCP->setCondition(conditionUXCP, conditionData);
1557 coral::ICursor& cursorUXCP = queryUXCP->execute();
1558 while (cursorUXCP.next()) {
1562 const coral::AttributeList& row = cursorUXCP.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 '%TempUXC%')";
1573 queryUXCT->setCondition(conditionUXCT, conditionData);
1574 coral::ICursor& cursorUXCT = queryUXCT->execute();
1575 while (cursorUXCT.next()) {
1579 const coral::AttributeList& row = cursorUXCT.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 "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND " 1589 "(DP_NAME2ID.DPNAME like '%DewpointUXC%')";
1590 queryUXCH->setCondition(conditionUXCH, conditionData);
1591 coral::ICursor& cursorUXCH = queryUXCH->execute();
1592 while (cursorUXCH.next()) {
1596 const coral::AttributeList& row = cursorUXCH.currentRow();
1597 float value = row[
"VALUE"].data<
float>();
1598 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1599 unsigned long long ut_time =
TtoUT(ts);
1602 uxcarray.push_back(Itemp);
1605 std::cout <<
"This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1608 std::cout <<
">> UXC array --> size: " << uxcarray.size() <<
" >> done." << std::endl;
1612 session->transaction().commit();
1621 <<
":" <<
tMIN.minute() <<
"." <<
tMIN.second() << std::endl;
1624 session->transaction().start(
true);
1625 coral::ISchema& schema = session->nominalSchema();
1626 std::cout <<
">> creating UXC object..." << std::endl;
1628 coral::IQuery* queryMix = schema.newQuery();
1629 queryMix->addToTableList(
"RPCGASPARAMETERS");
1630 queryMix->addToTableList(
"DP_NAME2ID");
1631 queryMix->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1632 queryMix->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1633 queryMix->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1634 queryMix->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1635 queryMix->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1637 coral::IQuery* queryMix2 = schema.newQuery();
1638 queryMix2->addToTableList(
"RPCGASPARAMETERS");
1639 queryMix2->addToTableList(
"DP_NAME2ID");
1640 queryMix2->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1641 queryMix2->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1642 queryMix2->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1643 queryMix2->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1644 queryMix2->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1646 coral::IQuery* queryMix3 = schema.newQuery();
1647 queryMix3->addToTableList(
"RPCGASPARAMETERS");
1648 queryMix3->addToTableList(
"DP_NAME2ID");
1649 queryMix3->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME");
1650 queryMix3->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1651 queryMix3->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID");
1652 queryMix3->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP");
1653 queryMix3->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE");
1656 std::vector<RPCObGasMix::Item> marray;
1657 coral::TimeStamp tlast =
tMIN;
1661 <<
":" <<
tMAX.minute() <<
"." <<
tMAX.second() << std::endl;
1662 std::cout <<
"Processing UXC..." << std::endl;
1663 coral::AttributeList conditionData;
1664 conditionData.extend<coral::TimeStamp>(
"tmin");
1665 conditionData.extend<coral::TimeStamp>(
"tmax");
1666 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1667 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1669 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1670 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%IC4H10Ratio%')";
1671 queryMix->setCondition(conditionM1, conditionData);
1672 coral::ICursor& cursorMix = queryMix->execute();
1673 while (cursorMix.next()) {
1677 const coral::AttributeList& row = cursorMix.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 '%C2H2F4Ratio%')";
1688 queryMix2->setCondition(conditionM2, conditionData);
1689 coral::ICursor& cursorMix2 = queryMix2->execute();
1690 while (cursorMix2.next()) {
1694 const coral::AttributeList& row = cursorMix2.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 "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND " 1704 "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%SF6Ratio%')";
1705 queryMix3->setCondition(conditionM3, conditionData);
1706 coral::ICursor& cursorMix3 = queryMix3->execute();
1707 while (cursorMix3.next()) {
1711 const coral::AttributeList& row = cursorMix3.currentRow();
1712 float value = row[
"VALUE"].data<
float>();
1713 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1714 unsigned long long ut_time =
TtoUT(ts);
1717 marray.push_back(Mtemp);
1720 std::cout <<
"This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1723 std::cout <<
">> GasMix array --> size: " << marray.size() <<
" >> done." << std::endl;
1725 session->transaction().commit();
1732 int yea =
static_cast<int>(
trunc(utime / 31536000) + 1970);
1733 int yes = (yea - 1970) * 31536000;
1734 int cony = ((yea - 1972) % 4) + 1;
1736 yes = yes + (yea - 1972) / 4 * 86400;
1738 yes = yes +
static_cast<int>(
trunc((yea - 1972) / 4)) * 86400;
1739 int day =
static_cast<int>(
trunc((utime - yes) / 86400));
1740 int rest =
static_cast<int>(utime - yes - day * 86400);
1749 if (day >= 32 && day < 61) {
1753 if (day >= 61 && day < 92) {
1757 if (day >= 92 && day < 122) {
1761 if (day >= 122 && day < 153) {
1765 if (day >= 153 && day < 183) {
1769 if (day >= 183 && day < 214) {
1773 if (day >= 214 && day < 245) {
1777 if (day >= 245 && day < 275) {
1781 if (day >= 275 && day < 306) {
1785 if (day >= 306 && day < 336) {
1800 if (day >= 32 && day < 60) {
1804 if (day >= 60 && day < 91) {
1808 if (day >= 91 && day < 121) {
1812 if (day >= 121 && day < 152) {
1816 if (day >= 152 && day < 182) {
1820 if (day >= 182 && day < 213) {
1824 if (day >= 213 && day < 244) {
1828 if (day >= 244 && day < 274) {
1832 if (day >= 274 && day < 305) {
1836 if (day >= 305 && day < 335) {
1846 int hou =
static_cast<int>(
trunc(rest / 3600));
1847 rest = rest - hou * 3600;
1848 int min =
static_cast<int>(
trunc(rest / 60));
1849 rest = rest - min * 60;
1855 coral::TimeStamp Tthr;
1857 Tthr = coral::TimeStamp(yea, mon, day, hou, min, sec, nan);
1863 long long utime = (time.year() - 1970) * 31536000 + static_cast<int>(
trunc((time.year() - 1972) / 4)) * 86400 +
1864 (((time.month() - 1) * 31) * 86400) + ((time.day() - 1) * 86400) + time.hour() * 3600 +
1865 time.minute() * 60 + time.second();
1867 if (time.month() == 3)
1868 utime = utime - 3 * 86400;
1869 if (time.month() == 4)
1870 utime = utime - 3 * 86400;
1871 if (time.month() == 5)
1872 utime = utime - 4 * 86400;
1873 if (time.month() == 6)
1874 utime = utime - 4 * 86400;
1875 if (time.month() == 7)
1876 utime = utime - 5 * 86400;
1877 if (time.month() == 8)
1878 utime = utime - 5 * 86400;
1879 if (time.month() == 9)
1880 utime = utime - 5 * 86400;
1881 if (time.month() == 10)
1882 utime = utime - 6 * 86400;
1883 if (time.month() == 11)
1884 utime = utime - 6 * 86400;
1885 if (time.month() == 12)
1886 utime = utime - 7 * 86400;
1893 fir.year() * 1e10 + fir.month() + 1e8 + fir.day() * 1e6 + fir.hour() * 1
e4 + fir.minute() * 1e2 + fir.second();
1895 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