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"
34 m_connectionString( connectionString ),
35 m_userName( userName ),
36 m_password( password )
57 session->transaction().start(
true );
58 coral::ISchema&
schema = session->nominalSchema();
60 coral::IQuery* queryI = schema.newQuery();
61 queryI->addToTableList(
"FWCAENCHANNEL" );
62 queryI->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID" );
63 queryI->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP" );
64 queryI->addToOutputList(
"FWCAENCHANNEL.ACTUAL_IMON",
"IMON" );
67 std::vector<RPCObImon::I_Item> imonarray;
68 coral::TimeStamp tlast =
tMIN;
72 std::cout <<
">> creating IMON object..." << std::endl;
73 coral::AttributeList conditionData;
74 conditionData.extend<coral::TimeStamp>(
"tmin" );
75 conditionData.extend<coral::TimeStamp>(
"tmax" );
76 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
77 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
78 std::string condition =
"FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
79 queryI->setCondition( condition , conditionData );
80 coral::ICursor& cursorI = queryI->execute();
81 while ( cursorI.next() ) {
82 const coral::AttributeList& row = cursorI.currentRow();
83 float idoub = row[
"DPID"].data<
float>();
84 int id =
static_cast<int>(idoub);
85 float val = row[
"IMON"].data<
float>();
86 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
87 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
88 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
93 imonarray.push_back(Itemp);
97 std::cout <<
">> creating IMON object..." << std::endl;
98 coral::AttributeList conditionData;
99 conditionData.extend<coral::TimeStamp>(
"tmin" );
100 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
101 std::string condition =
"FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
102 queryI->setCondition( condition , conditionData );
103 coral::ICursor& cursorI = queryI->execute();
104 while ( cursorI.next() ) {
105 const coral::AttributeList& row = cursorI.currentRow();
106 float idoub = row[
"DPID"].data<
float>();
107 int id =
static_cast<int>(idoub);
108 float val = row[
"IMON"].data<
float>();
109 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
110 if (
isMajor(ts, tlast)) tlast = ts;
111 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
112 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
117 imonarray.push_back(Itemp);
122 if (till > since)
N_IOV = till;
123 std::cout <<
">> Imon array --> size: " << imonarray.size() <<
" >> done." << std::endl;
125 session->transaction().commit();
140 session->transaction().start(
true );
141 coral::ISchema&
schema = session->nominalSchema();
143 coral::IQuery* queryV = schema.newQuery();
144 queryV->addToTableList(
"FWCAENCHANNEL" );
145 queryV->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID" );
146 queryV->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP" );
147 queryV->addToOutputList(
"FWCAENCHANNEL.ACTUAL_VMON",
"VMON" );
149 std::vector<RPCObVmon::V_Item> vmonarray;
150 coral::TimeStamp tlast =
tMIN;
154 std::cout <<
">> creating VMON object..." << std::endl;
155 coral::AttributeList conditionData;
156 conditionData.extend<coral::TimeStamp>(
"tmin" );
157 conditionData.extend<coral::TimeStamp>(
"tmax" );
158 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
159 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
160 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE <:tmax";
161 queryV->setCondition( condition , conditionData );
162 coral::ICursor& cursorV = queryV->execute();
163 while ( cursorV.next() ) {
164 const coral::AttributeList& row = cursorV.currentRow();
165 float idoub = row[
"DPID"].data<
float>();
166 int id =
static_cast<int>(idoub);
167 float val = row[
"VMON"].data<
float>();
168 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
169 if (
isMajor(ts, tlast)) tlast = ts;
170 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
171 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
176 vmonarray.push_back(Vtemp);
180 std::cout <<
">> creating VMON object..." << std::endl;
181 coral::AttributeList conditionData;
182 conditionData.extend<coral::TimeStamp>(
"tmin" );
183 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
184 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
185 queryV->setCondition( condition , conditionData );
186 coral::ICursor& cursorV = queryV->execute();
187 while ( cursorV.next() ) {
188 const coral::AttributeList& row = cursorV.currentRow();
189 float idoub = row[
"DPID"].data<
float>();
190 int id =
static_cast<int>(idoub);
191 float val = row[
"VMON"].data<
float>();
192 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
193 if (
isMajor(ts, tlast)) tlast = ts;
194 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
195 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
200 vmonarray.push_back(Vtemp);
205 std::cout <<
">> Vmon array --> size: " << vmonarray.size() <<
" >> done." << std::endl;
207 session->transaction().commit();
221 session->transaction().start(
true );
222 coral::ISchema&
schema = session->nominalSchema();
224 std::cout <<
">> creating STATUS object..." << std::endl;
225 coral::IQuery* queryS = schema.newQuery();
226 queryS->addToTableList(
"FWCAENCHANNEL" );
227 queryS->addToOutputList(
"FWCAENCHANNEL.DPID",
"DPID" );
228 queryS->addToOutputList(
"FWCAENCHANNEL.CHANGE_DATE",
"TSTAMP" );
229 queryS->addToOutputList(
"FWCAENCHANNEL.ACTUAL_STATUS",
"STATUS" );
231 std::vector<RPCObStatus::S_Item> statusarray;
232 coral::TimeStamp tlast =
tMIN;
236 std::cout <<
">> creating STATUS object..." << std::endl;
237 coral::AttributeList conditionData;
238 conditionData.extend<coral::TimeStamp>(
"tmin" );
239 conditionData.extend<coral::TimeStamp>(
"tmax" );
240 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
241 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
242 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE <:tmax";
243 queryS->setCondition( condition , conditionData );
244 coral::ICursor& cursorS = queryS->execute();
245 while ( cursorS.next() ) {
246 const coral::AttributeList& row = cursorS.currentRow();
247 float idoub = row[
"DPID"].data<
float>();
248 int id =
static_cast<int>(idoub);
249 float val = row[
"STATUS"].data<
float>();
250 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
251 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
252 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
257 statusarray.push_back(Stemp);
261 std::cout <<
">> creating STATUS object..." << std::endl;
262 coral::AttributeList conditionData;
263 conditionData.extend<coral::TimeStamp>(
"tmin" );
264 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
265 std::string condition =
" NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
266 queryS->setCondition( condition , conditionData );
267 coral::ICursor& cursorS = queryS->execute();
268 while ( cursorS.next() ) {
269 const coral::AttributeList& row = cursorS.currentRow();
270 float idoub = row[
"DPID"].data<
float>();
271 int id =
static_cast<int>(idoub);
272 float val = row[
"STATUS"].data<
float>();
273 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
274 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
275 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
280 statusarray.push_back(Stemp);
284 std::cout <<
">> Staus array --> size: " << statusarray.size() <<
" >> done." << std::endl << std::endl << std::endl;
287 session->transaction().commit();
304 session->transaction().start(
true );
305 coral::ISchema&
schema = session->nominalSchema();
307 coral::TimeStamp tlast =
tMIN;
310 coral::IQuery* querySIN = schema.newQuery();
311 querySIN->addToTableList(
"RPCGASCHANNEL" );
312 querySIN->addToOutputList(
"RPCGASCHANNEL.DPID",
"DPID" );
313 querySIN->addToOutputList(
"RPCGASCHANNEL.CHANGE_DATE",
"TSTAMP" );
314 querySIN->addToOutputList(
"RPCGASCHANNEL.FLOWIN",
"FLOWIN" );
317 coral::IQuery* querySOUT = schema.newQuery();
318 querySOUT->addToTableList(
"RPCGASCHANNEL" );
319 querySOUT->addToOutputList(
"RPCGASCHANNEL.DPID",
"DPID" );
320 querySOUT->addToOutputList(
"RPCGASCHANNEL.CHANGE_DATE",
"TSTAMP" );
321 querySOUT->addToOutputList(
"RPCGASCHANNEL.FLOWOUT",
"FLOWOUT" );
325 std::vector<RPCObGas::Item> gasarray;
330 std::cout <<
">> creating GAS object..." << std::endl;
331 std::cout <<
">> processing FLOWIN..." << std::endl;
332 coral::AttributeList conditionData;
333 conditionData.extend<coral::TimeStamp>(
"tmin" );
334 conditionData.extend<coral::TimeStamp>(
"tmax" );
335 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
336 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
337 std::string conditionIN =
"RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
339 querySIN->setCondition( conditionIN, conditionData );
340 coral::ICursor& cursorSIN = querySIN->execute();
341 while ( cursorSIN.next() ) {
343 const coral::AttributeList& row = cursorSIN.currentRow();
344 float idoub = row[
"DPID"].data<
float>();
345 int id =
static_cast<int>(idoub);
346 float val = row[
"FLOWIN"].data<
float>();
347 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
348 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
349 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
353 gastemp.
time = ntime;
354 gasarray.push_back(gastemp);
357 std::cout <<
">> creating GAS object..." << std::endl;
358 std::cout <<
">> processing FLOWIN..." << std::endl;
359 coral::AttributeList conditionData;
360 conditionData.extend<coral::TimeStamp>(
"tmin" );
361 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
362 std::string conditionIN =
"RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin";
363 std::cout <<
"processing FLOWIN..." << std::endl;
364 querySIN->setCondition( conditionIN, conditionData );
365 coral::ICursor& cursorSIN = querySIN->execute();
366 while ( cursorSIN.next() ) {
368 const coral::AttributeList& row = cursorSIN.currentRow();
369 float idoub = row[
"DPID"].data<
float>();
370 int id =
static_cast<int>(idoub);
371 float val = row[
"FLOWIN"].data<
float>();
372 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
373 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
374 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
378 gastemp.
time = ntime;
379 gasarray.push_back(gastemp);
387 std::cout <<
">> processing FLOWOUT..." << std::endl;
388 coral::AttributeList conditionData;
389 conditionData.extend<coral::TimeStamp>(
"tmin" );
390 conditionData.extend<coral::TimeStamp>(
"tmax" );
391 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
392 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
393 std::string conditionOUT =
"RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
395 querySOUT->setCondition( conditionOUT, conditionData );
396 coral::ICursor& cursorSOUT = querySOUT->execute();
397 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() ) {
422 const coral::AttributeList& row = cursorSOUT.currentRow();
423 float idoub = row[
"DPID"].data<
float>();
424 int id =
static_cast<int>(idoub);
425 float val = row[
"FLOWOUT"].data<
float>();
426 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
427 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
428 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
432 gastemp.
time = ntime;
433 gasarray.push_back(gastemp);
439 if (till > since)
N_IOV = till;
440 std::cout <<
">> Gas array --> size: " << gasarray.size() <<
" >> done." << std::endl << std::endl << std::endl;
444 session->transaction().commit();
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 std::cout <<
">> creating TEMPERATURE object..." << std::endl;
476 coral::AttributeList conditionData;
477 conditionData.extend<coral::TimeStamp>(
"tmin" );
478 conditionData.extend<coral::TimeStamp>(
"tmax" );
479 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
480 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
481 std::string condition =
"FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
482 queryS->setCondition( condition , conditionData );
483 coral::ICursor& cursorS = queryS->execute();
484 while ( cursorS.next() ) {
485 const coral::AttributeList& row = cursorS.currentRow();
486 float idoub = row[
"DPID"].data<
float>();
487 int id =
static_cast<int>(idoub);
488 float val = row[
"TEMPERATURE"].data<
float>();
489 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
490 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
491 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
497 temparray.push_back(Ttemp);
502 std::cout <<
">> creating TEMPERATURE object..." << std::endl;
503 coral::AttributeList conditionData;
504 conditionData.extend<coral::TimeStamp>(
"tmin" );
505 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
506 std::string condition =
"FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin";
507 queryS->setCondition( condition , conditionData );
508 coral::ICursor& cursorS = queryS->execute();
509 while ( cursorS.next() ) {
510 const coral::AttributeList& row = cursorS.currentRow();
511 float idoub = row[
"DPID"].data<
float>();
512 int id =
static_cast<int>(idoub);
513 float val = row[
"TEMPERATURE"].data<
float>();
514 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
515 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
516 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
522 temparray.push_back(Ttemp);
528 if (till > since)
N_IOV = till;
529 std::cout <<
">> Temperature array --> size: " << temparray.size() <<
" >> done." << std::endl << std::endl << std::endl;
532 session->transaction().commit();
544 std::cout <<
">> Processing data..." << std::endl;
548 session->transaction().start(
true );
549 coral::ISchema&
schema = session->nominalSchema();
551 std::cout <<
">> creating IDMAP object..." << std::endl;
552 coral::IQuery* queryM = schema.newQuery();
553 queryM->addToTableList(
"RPCPVSSDETID");
554 queryM->addToOutputList(
"RPCPVSSDETID.SINCE",
"SINCE" );
555 queryM->addToOutputList(
"RPCPVSSDETID.PVSS_ID",
"PVSS_ID" );
556 queryM->addToOutputList(
"RPCPVSSDETID.REGION",
"REGION" );
557 queryM->addToOutputList(
"RPCPVSSDETID.RING",
"RING" );
558 queryM->addToOutputList(
"RPCPVSSDETID.STATION",
"STATION" );
559 queryM->addToOutputList(
"RPCPVSSDETID.SECTOR",
"SECTOR" );
560 queryM->addToOutputList(
"RPCPVSSDETID.LAYER",
"LAYER" );
561 queryM->addToOutputList(
"RPCPVSSDETID.SUBSECTOR",
"SUBSECTOR" );
562 queryM->addToOutputList(
"RPCPVSSDETID.SUPPLYTYPE",
"SUPPLYTYPE" );
564 std::string condM =
"RPCPVSSDETID.PVSS_ID is not NULL";
567 coral::ICursor& cursorM = queryM->execute();
570 std::vector<RPCObPVSSmap::Item> idmaparray;
571 while ( cursorM.next() ) {
572 const coral::AttributeList& row = cursorM.currentRow();
573 int id = row[
"PVSS_ID"].data<
int>();
582 int reg = atoi(reg_s.c_str());
583 int rin = atoi(rin_s.c_str());
584 int sta = atoi(sta_s.c_str());
585 int sec = atoi(sec_s.c_str());
586 int lay = atoi(lay_s.c_str());
587 int sub = atoi(sub_s.c_str());
590 if (sup_s ==
"HV") sup = 0;
591 if (sup_s ==
"LVA") sup = 1;
592 if (sup_s ==
"LVD") sup = 2;
593 if (sup_s ==
"LB") sup = 3;
594 if (sup_s ==
"T") sup = 4;
597 coral::TimeStamp ts = row[
"SINCE"].data<coral::TimeStamp>();
599 std::ostringstream dday;
600 std::ostringstream dmon;
601 std::ostringstream dyea;
605 std::string date = dday.str() +
"-" + dmon.str() +
"-" + dyea.str();
607 Itemp.
since = atoi(date.c_str());
617 idmaparray.push_back(Itemp);
623 std::cout <<
">> IDMAP array --> size: " << idmaparray.size() <<
" >> done." << std::endl;
625 session->transaction().commit();
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 std::cout <<
"Processing VTH1..." << std::endl;
722 coral::AttributeList conditionData;
723 conditionData.extend<coral::TimeStamp>(
"tmin" );
724 conditionData.extend<coral::TimeStamp>(
"tmax" );
725 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
726 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
727 std::string conditionVTH1 =
"RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
728 queryFVTH1->setCondition( conditionVTH1, conditionData );
729 coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
730 while ( cursorFVTH1.next() ) {
733 const coral::AttributeList& row = cursorFVTH1.currentRow();
734 float idoub = row[
"DPID"].data<
float>();
735 int id =
static_cast<int>(idoub);
736 float vth1 = row[
"VTH1"].data<
float>();
737 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
738 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
739 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
744 febarray.push_back(Itemp);
747 std::cout <<
">> Processing VTH1..." << std::endl;
748 coral::AttributeList conditionData;
749 conditionData.extend<coral::TimeStamp>(
"tmin" );
750 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
751 std::string conditionVTH1 =
"RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
752 queryFVTH1->setCondition( conditionVTH1, conditionData );
753 coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
754 while ( cursorFVTH1.next() ) {
757 const coral::AttributeList& row = cursorFVTH1.currentRow();
758 float idoub = row[
"DPID"].data<
float>();
759 int id =
static_cast<int>(idoub);
760 float vth1 = row[
"VTH1"].data<
float>();
761 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
762 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
763 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
768 febarray.push_back(Itemp);
774 std::cout <<
"Processing VTH2..." << std::endl;
775 coral::AttributeList conditionData;
776 conditionData.extend<coral::TimeStamp>(
"tmin" );
777 conditionData.extend<coral::TimeStamp>(
"tmax" );
778 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
779 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
780 std::string conditionVTH2 =
"RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
781 queryFVTH2->setCondition( conditionVTH2, conditionData );
782 coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
783 while ( cursorFVTH2.next() ) {
786 const coral::AttributeList& row = cursorFVTH2.currentRow();
787 float idoub = row[
"DPID"].data<
float>();
788 int id =
static_cast<int>(idoub);
789 float vth2 = row[
"VTH2"].data<
float>();
790 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
791 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
792 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
797 febarray.push_back(Itemp);
800 std::cout <<
">> Processing VTH2..." << std::endl;
801 coral::AttributeList conditionData;
802 conditionData.extend<coral::TimeStamp>(
"tmin" );
803 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
804 std::string conditionVTH2 =
"RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
805 queryFVTH2->setCondition( conditionVTH2, conditionData );
806 coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
807 while ( cursorFVTH2.next() ) {
810 const coral::AttributeList& row = cursorFVTH2.currentRow();
811 float idoub = row[
"DPID"].data<
float>();
812 int id =
static_cast<int>(idoub);
813 float vth2 = row[
"VTH2"].data<
float>();
814 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
815 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
816 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
821 febarray.push_back(Itemp);
828 std::cout <<
"Processing VTH3..." << std::endl;
829 coral::AttributeList conditionData;
830 conditionData.extend<coral::TimeStamp>(
"tmin" );
831 conditionData.extend<coral::TimeStamp>(
"tmax" );
832 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
833 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
834 std::string conditionVTH3 =
"RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
835 queryFVTH3->setCondition( conditionVTH3, conditionData );
836 coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
837 while ( cursorFVTH3.next() ) {
840 const coral::AttributeList& row = cursorFVTH3.currentRow();
841 float idoub = row[
"DPID"].data<
float>();
842 int id =
static_cast<int>(idoub);
843 float vth3 = row[
"VTH3"].data<
float>();
844 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
845 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
846 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
851 febarray.push_back(Itemp);
854 std::cout <<
">> Processing VTH3..." << std::endl;
855 coral::AttributeList conditionData;
856 conditionData.extend<coral::TimeStamp>(
"tmin" );
857 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
858 std::string conditionVTH3 =
"RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
859 queryFVTH3->setCondition( conditionVTH3, conditionData );
860 coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
861 while ( cursorFVTH3.next() ) {
864 const coral::AttributeList& row = cursorFVTH3.currentRow();
865 float idoub = row[
"DPID"].data<
float>();
866 int id =
static_cast<int>(idoub);
867 float vth3 = row[
"VTH3"].data<
float>();
868 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
869 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
870 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
875 febarray.push_back(Itemp);
882 std::cout <<
"Processing VTH4..." << std::endl;
883 coral::AttributeList conditionData;
884 conditionData.extend<coral::TimeStamp>(
"tmin" );
885 conditionData.extend<coral::TimeStamp>(
"tmax" );
886 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
887 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
888 std::string conditionVTH4 =
"RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
889 queryFVTH4->setCondition( conditionVTH4, conditionData );
890 coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
891 while ( cursorFVTH4.next() ) {
894 const coral::AttributeList& row = cursorFVTH4.currentRow();
895 float idoub = row[
"DPID"].data<
float>();
896 int id =
static_cast<int>(idoub);
897 float vth4 = row[
"VTH4"].data<
float>();
898 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
899 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
900 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
905 febarray.push_back(Itemp);
908 std::cout <<
">> Processing VTH4..." << std::endl;
909 coral::AttributeList conditionData;
910 conditionData.extend<coral::TimeStamp>(
"tmin" );
911 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
912 std::string conditionVTH4 =
"RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
913 queryFVTH4->setCondition( conditionVTH4, conditionData );
914 coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
915 while ( cursorFVTH4.next() ) {
918 const coral::AttributeList& row = cursorFVTH4.currentRow();
919 float idoub = row[
"DPID"].data<
float>();
920 int id =
static_cast<int>(idoub);
921 float vth4 = row[
"VTH4"].data<
float>();
922 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
923 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
924 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
929 febarray.push_back(Itemp);
935 std::cout <<
"Processing VMON1..." << std::endl;
936 coral::AttributeList conditionData;
937 conditionData.extend<coral::TimeStamp>(
"tmin" );
938 conditionData.extend<coral::TimeStamp>(
"tmax" );
939 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
940 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
941 std::string conditionVMON1 =
"RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
942 queryFVMON1->setCondition( conditionVMON1, conditionData );
943 coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
944 while ( cursorFVMON1.next() ) {
947 const coral::AttributeList& row = cursorFVMON1.currentRow();
948 float idoub = row[
"DPID"].data<
float>();
949 int id =
static_cast<int>(idoub);
950 float vmon1 = row[
"VMON1"].data<
float>();
951 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
952 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
953 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
958 febarray.push_back(Itemp);
961 std::cout <<
">> Processing VMON1..." << std::endl;
962 coral::AttributeList conditionData;
963 conditionData.extend<coral::TimeStamp>(
"tmin" );
964 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
965 std::string conditionVMON1 =
"RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
966 queryFVMON1->setCondition( conditionVMON1, conditionData );
967 coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
968 while ( cursorFVMON1.next() ) {
971 const coral::AttributeList& row = cursorFVMON1.currentRow();
972 float idoub = row[
"DPID"].data<
float>();
973 int id =
static_cast<int>(idoub);
974 float vmon1 = row[
"VMON1"].data<
float>();
975 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
976 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
977 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
982 febarray.push_back(Itemp);
990 std::cout <<
"Processing VMON2..." << std::endl;
991 coral::AttributeList conditionData;
992 conditionData.extend<coral::TimeStamp>(
"tmin" );
993 conditionData.extend<coral::TimeStamp>(
"tmax" );
994 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
995 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
996 std::string conditionVMON2 =
"RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
997 queryFVMON2->setCondition( conditionVMON2, conditionData );
998 coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
999 while ( cursorFVMON2.next() ) {
1002 const coral::AttributeList& row = cursorFVMON2.currentRow();
1003 float idoub = row[
"DPID"].data<
float>();
1004 int id =
static_cast<int>(idoub);
1005 float vmon2 = row[
"VMON2"].data<
float>();
1006 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1007 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1008 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1010 Itemp.
vmon2 = vmon2;
1013 febarray.push_back(Itemp);
1016 std::cout <<
">> Processing VMON2..." << std::endl;
1017 coral::AttributeList conditionData;
1018 conditionData.extend<coral::TimeStamp>(
"tmin" );
1019 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1020 std::string conditionVMON2 =
"RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1021 queryFVMON2->setCondition( conditionVMON2, conditionData );
1022 coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1023 while ( cursorFVMON2.next() ) {
1026 const coral::AttributeList& row = cursorFVMON2.currentRow();
1027 float idoub = row[
"DPID"].data<
float>();
1028 int id =
static_cast<int>(idoub);
1029 float vmon2 = row[
"VMON2"].data<
float>();
1030 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1031 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1032 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1034 Itemp.
vmon2 = vmon2;
1037 febarray.push_back(Itemp);
1044 std::cout <<
"Processing VMON3..." << std::endl;
1045 coral::AttributeList conditionData;
1046 conditionData.extend<coral::TimeStamp>(
"tmin" );
1047 conditionData.extend<coral::TimeStamp>(
"tmax" );
1048 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1049 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1050 std::string conditionVMON3 =
"RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1051 queryFVMON3->setCondition( conditionVMON3, conditionData );
1052 coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1053 while ( cursorFVMON3.next() ) {
1056 const coral::AttributeList& row = cursorFVMON3.currentRow();
1057 float idoub = row[
"DPID"].data<
float>();
1058 int id =
static_cast<int>(idoub);
1059 float vmon3 = row[
"VMON3"].data<
float>();
1060 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1061 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1062 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1064 Itemp.
vmon3 = vmon3;
1067 febarray.push_back(Itemp);
1070 std::cout <<
">> Processing VMON3..." << std::endl;
1071 coral::AttributeList conditionData;
1072 conditionData.extend<coral::TimeStamp>(
"tmin" );
1073 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1074 std::string conditionVMON3 =
"RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1075 queryFVMON3->setCondition( conditionVMON3, conditionData );
1076 coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1077 while ( cursorFVMON3.next() ) {
1080 const coral::AttributeList& row = cursorFVMON3.currentRow();
1081 float idoub = row[
"DPID"].data<
float>();
1082 int id =
static_cast<int>(idoub);
1083 float vmon3 = row[
"VMON3"].data<
float>();
1084 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1085 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1086 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1088 Itemp.
vmon3 = vmon3;
1091 febarray.push_back(Itemp);
1098 std::cout <<
"Processing VMON4..." << std::endl;
1099 coral::AttributeList conditionData;
1100 conditionData.extend<coral::TimeStamp>(
"tmin" );
1101 conditionData.extend<coral::TimeStamp>(
"tmax" );
1102 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1103 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1104 std::string conditionVMON4 =
"RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1105 queryFVMON4->setCondition( conditionVMON4, conditionData );
1106 coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1107 while ( cursorFVMON4.next() ) {
1110 const coral::AttributeList& row = cursorFVMON4.currentRow();
1111 float idoub = row[
"DPID"].data<
float>();
1112 int id =
static_cast<int>(idoub);
1113 float vmon4 = row[
"VMON4"].data<
float>();
1114 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1115 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1116 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1118 Itemp.
vmon4 = vmon4;
1121 febarray.push_back(Itemp);
1124 std::cout <<
">> Processing VMON4..." << std::endl;
1125 coral::AttributeList conditionData;
1126 conditionData.extend<coral::TimeStamp>(
"tmin" );
1127 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1128 std::string conditionVMON4 =
"RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1129 queryFVMON4->setCondition( conditionVMON4, conditionData );
1130 coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1131 while ( cursorFVMON4.next() ) {
1134 const coral::AttributeList& row = cursorFVMON4.currentRow();
1135 float idoub = row[
"DPID"].data<
float>();
1136 int id =
static_cast<int>(idoub);
1137 float vmon4 = row[
"VMON4"].data<
float>();
1138 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1139 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1140 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1142 Itemp.
vmon4 = vmon4;
1145 febarray.push_back(Itemp);
1152 std::cout <<
"Processing TEMP1..." << std::endl;
1153 coral::AttributeList conditionData;
1154 conditionData.extend<coral::TimeStamp>(
"tmin" );
1155 conditionData.extend<coral::TimeStamp>(
"tmax" );
1156 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1157 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1158 std::string conditionTEMP1 =
"RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1159 queryFTEMP1->setCondition( conditionTEMP1, conditionData );
1160 coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1161 while ( cursorFTEMP1.next() ) {
1164 const coral::AttributeList& row = cursorFTEMP1.currentRow();
1165 float idoub = row[
"DPID"].data<
float>();
1166 int id =
static_cast<int>(idoub);
1167 float temp1 = row[
"TEMP1"].data<
float>();
1168 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1169 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1170 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1172 Itemp.
temp1 = temp1;
1175 febarray.push_back(Itemp);
1178 std::cout <<
">> Processing TEMP1..." << std::endl;
1179 coral::AttributeList conditionData;
1180 conditionData.extend<coral::TimeStamp>(
"tmin" );
1181 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1182 std::string conditionTEMP1 =
"RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1183 queryFTEMP1->setCondition( conditionTEMP1, conditionData );
1184 coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1185 while ( cursorFTEMP1.next() ) {
1188 const coral::AttributeList& row = cursorFTEMP1.currentRow();
1189 float idoub = row[
"DPID"].data<
float>();
1190 int id =
static_cast<int>(idoub);
1191 float temp1 = row[
"TEMP1"].data<
float>();
1192 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1193 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1194 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1196 Itemp.
temp1 = temp1;
1199 febarray.push_back(Itemp);
1206 std::cout <<
"Processing TEMP2..." << std::endl;
1207 coral::AttributeList conditionData;
1208 conditionData.extend<coral::TimeStamp>(
"tmin" );
1209 conditionData.extend<coral::TimeStamp>(
"tmax" );
1210 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1211 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1212 std::string conditionTEMP2 =
"RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1213 queryFTEMP2->setCondition( conditionTEMP2, conditionData );
1214 coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1215 while ( cursorFTEMP2.next() ) {
1218 const coral::AttributeList& row = cursorFTEMP2.currentRow();
1219 float idoub = row[
"DPID"].data<
float>();
1220 int id =
static_cast<int>(idoub);
1221 float temp2 = row[
"TEMP2"].data<
float>();
1222 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1223 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1224 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1226 Itemp.
temp2 = temp2;
1229 febarray.push_back(Itemp);
1232 std::cout <<
">> Processing TEMP2..." << std::endl;
1233 coral::AttributeList conditionData;
1234 conditionData.extend<coral::TimeStamp>(
"tmin" );
1235 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1236 std::string conditionTEMP2 =
"RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1237 queryFTEMP2->setCondition( conditionTEMP2, conditionData );
1238 coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1239 while ( cursorFTEMP2.next() ) {
1242 const coral::AttributeList& row = cursorFTEMP2.currentRow();
1243 float idoub = row[
"DPID"].data<
float>();
1244 int id =
static_cast<int>(idoub);
1245 float temp2 = row[
"TEMP2"].data<
float>();
1246 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1247 int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year()-2000);
1248 int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1250 Itemp.
temp2 = temp2;
1253 febarray.push_back(Itemp);
1257 std::cout <<
">> FEB array --> size: " << febarray.size() <<
" >> done." << std::endl;
1263 session->transaction().commit();
1278 session->transaction().start(
true );
1279 coral::ISchema&
schema = session->nominalSchema();
1280 std::cout <<
">> creating UXC object..." << std::endl;
1283 coral::IQuery* queryUXCP = schema.newQuery();
1284 queryUXCP->addToTableList(
"RPCGASPARAMETERS");
1285 queryUXCP->addToTableList(
"DP_NAME2ID" );
1286 queryUXCP->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME" );
1287 queryUXCP->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1288 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID" );
1289 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP" );
1290 queryUXCP->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE" );
1291 coral::IQuery* queryUXCT = schema.newQuery();
1292 queryUXCT->addToTableList(
"RPCCOOLING");
1293 queryUXCT->addToTableList(
"DP_NAME2ID" );
1294 queryUXCT->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME" );
1295 queryUXCT->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1296 queryUXCT->addToOutputList(
"RPCCOOLING.DPID",
"DPID" );
1297 queryUXCT->addToOutputList(
"RPCCOOLING.CHANGE_DATE",
"TSTAMP" );
1298 queryUXCT->addToOutputList(
"RPCCOOLING.VALUE",
"VALUE" );
1299 coral::IQuery* queryUXCH = schema.newQuery();
1300 queryUXCH->addToTableList(
"RPCCOOLING");
1301 queryUXCH->addToTableList(
"DP_NAME2ID" );
1302 queryUXCH->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME" );
1303 queryUXCH->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1304 queryUXCH->addToOutputList(
"RPCCOOLING.DPID",
"DPID" );
1305 queryUXCH->addToOutputList(
"RPCCOOLING.CHANGE_DATE",
"TSTAMP" );
1306 queryUXCH->addToOutputList(
"RPCCOOLING.VALUE",
"VALUE" );
1310 std::vector<RPCObUXC::Item> uxcarray;
1311 coral::TimeStamp tlast =
tMIN;
1315 std::cout <<
"Processing UXC..." << std::endl;
1316 coral::AttributeList conditionData;
1317 conditionData.extend<coral::TimeStamp>(
"tmin" );
1318 conditionData.extend<coral::TimeStamp>(
"tmax" );
1319 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1320 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1321 std::string conditionUXCP =
"RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%UXCPressure%')";
1322 queryUXCP->setCondition( conditionUXCP, conditionData );
1323 coral::ICursor& cursorUXCP = queryUXCP->execute();
1324 while ( cursorUXCP.next() ) {
1326 const coral::AttributeList& row = cursorUXCP.currentRow();
1327 float value = row[
"VALUE"].data<
float>();
1328 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1329 unsigned long long ut_time =
TtoUT(ts);
1332 uxcarray.push_back(Itemp);
1334 std::string conditionUXCT =
"RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%TempUXC%')";
1335 queryUXCT->setCondition( conditionUXCT, conditionData );
1336 coral::ICursor& cursorUXCT = queryUXCT->execute();
1337 while ( cursorUXCT.next() ) {
1339 const coral::AttributeList& row = cursorUXCT.currentRow();
1340 float value = row[
"VALUE"].data<
float>();
1341 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1342 unsigned long long ut_time =
TtoUT(ts);
1345 uxcarray.push_back(Itemp);
1347 std::string conditionUXCH =
"RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%DewpointUXC%')";
1348 queryUXCH->setCondition( conditionUXCH, conditionData );
1349 coral::ICursor& cursorUXCH = queryUXCH->execute();
1350 while ( cursorUXCH.next() ) {
1352 const coral::AttributeList& row = cursorUXCH.currentRow();
1353 float value = row[
"VALUE"].data<
float>();
1354 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1355 unsigned long long ut_time =
TtoUT(ts);
1358 uxcarray.push_back(Itemp);
1362 std::cout <<
"This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1367 std::cout <<
">> UXC array --> size: " << uxcarray.size() <<
" >> done." << std::endl;
1371 session->transaction().commit();
1387 session->transaction().start(
true );
1388 coral::ISchema&
schema = session->nominalSchema();
1389 std::cout <<
">> creating UXC object..." << std::endl;
1391 coral::IQuery* queryMix = schema.newQuery();
1392 queryMix->addToTableList(
"RPCGASPARAMETERS");
1393 queryMix->addToTableList(
"DP_NAME2ID" );
1394 queryMix->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME" );
1395 queryMix->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1396 queryMix->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID" );
1397 queryMix->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP" );
1398 queryMix->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE" );
1400 coral::IQuery* queryMix2 = schema.newQuery();
1401 queryMix2->addToTableList(
"RPCGASPARAMETERS");
1402 queryMix2->addToTableList(
"DP_NAME2ID" );
1403 queryMix2->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME" );
1404 queryMix2->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1405 queryMix2->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID" );
1406 queryMix2->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP" );
1407 queryMix2->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE" );
1409 coral::IQuery* queryMix3 = schema.newQuery();
1410 queryMix3->addToTableList(
"RPCGASPARAMETERS");
1411 queryMix3->addToTableList(
"DP_NAME2ID" );
1412 queryMix3->addToOutputList(
"DP_NAME2ID.DPNAME",
"DPNAME" );
1413 queryMix3->addToOutputList(
"DP_NAME2ID.ID",
"ID");
1414 queryMix3->addToOutputList(
"RPCGASPARAMETERS.DPID",
"DPID" );
1415 queryMix3->addToOutputList(
"RPCGASPARAMETERS.CHANGE_DATE",
"TSTAMP" );
1416 queryMix3->addToOutputList(
"RPCGASPARAMETERS.VALUE",
"VALUE" );
1419 std::vector<RPCObGasMix::Item> marray;
1420 coral::TimeStamp tlast =
tMIN;
1424 std::cout <<
"Processing UXC..." << std::endl;
1425 coral::AttributeList conditionData;
1426 conditionData.extend<coral::TimeStamp>(
"tmin" );
1427 conditionData.extend<coral::TimeStamp>(
"tmax" );
1428 conditionData[
"tmin"].data<coral::TimeStamp>() =
tMIN;
1429 conditionData[
"tmax"].data<coral::TimeStamp>() =
tMAX;
1430 std::string conditionM1 =
"RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%IC4H10Ratio%')";
1431 queryMix->setCondition( conditionM1, conditionData );
1432 coral::ICursor& cursorMix = queryMix->execute();
1433 while ( cursorMix.next() ) {
1435 const coral::AttributeList& row = cursorMix.currentRow();
1436 float value = row[
"VALUE"].data<
float>();
1437 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1438 unsigned long long ut_time =
TtoUT(ts);
1441 marray.push_back(Mtemp);
1443 std::string conditionM2 =
"RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%C2H2F4Ratio%')";
1444 queryMix2->setCondition( conditionM2, conditionData );
1445 coral::ICursor& cursorMix2 = queryMix2->execute();
1446 while ( cursorMix2.next() ) {
1448 const coral::AttributeList& row = cursorMix2.currentRow();
1449 float value = row[
"VALUE"].data<
float>();
1450 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1451 unsigned long long ut_time =
TtoUT(ts);
1454 marray.push_back(Mtemp);
1456 std::string conditionM3 =
"RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%SF6Ratio%')";
1457 queryMix3->setCondition( conditionM3, conditionData );
1458 coral::ICursor& cursorMix3 = queryMix3->execute();
1459 while ( cursorMix3.next() ) {
1461 const coral::AttributeList& row = cursorMix3.currentRow();
1462 float value = row[
"VALUE"].data<
float>();
1463 coral::TimeStamp ts = row[
"TSTAMP"].data<coral::TimeStamp>();
1464 unsigned long long ut_time =
TtoUT(ts);
1467 marray.push_back(Mtemp);
1471 std::cout <<
"This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1476 std::cout <<
">> GasMix array --> size: " << marray.size() <<
" >> done." << std::endl;
1478 session->transaction().commit();
1491 int yea =
static_cast<int>(
trunc(utime/31536000) + 1970);
1492 int yes = (yea-1970)*31536000;
1493 int cony = ((yea-1972)%4)+1;
1494 if (cony == 0) yes = yes + (yea-1972)/4*86400;
1495 else yes = yes +
static_cast<int>(
trunc((yea-1972)/4))*86400;
1496 int day =
static_cast<int>(
trunc((utime - yes)/86400));
1497 int rest =
static_cast<int>(utime - yes - day*86400);
1506 if (day >= 32 && day < 61){
1510 if (day >= 61 && day < 92){
1514 if (day >= 92 && day < 122){
1518 if (day >= 122 && day < 153){
1522 if (day >= 153 && day < 183){
1526 if (day >= 183 && day < 214){
1530 if (day >= 214 && day < 245){
1534 if (day >= 245 && day < 275){
1538 if (day >= 275 && day < 306){
1542 if (day >= 306 && day < 336){
1557 if (day >= 32 && day < 60){
1561 if (day >= 60 && day < 91){
1565 if (day >= 91 && day < 121){
1569 if (day >= 121 && day < 152){
1573 if (day >= 152 && day < 182){
1577 if (day >= 182 && day < 213){
1581 if (day >= 213 && day < 244){
1585 if (day >= 244 && day < 274){
1589 if (day >= 274 && day < 305){
1593 if (day >= 305 && day < 335){
1603 int hou =
static_cast<int>(
trunc(rest/3600));
1604 rest = rest - hou*3600;
1605 int min =
static_cast<int>(
trunc(rest/60));
1606 rest = rest - min*60;
1612 coral::TimeStamp Tthr;
1614 Tthr = coral::TimeStamp(yea, mon, day, hou, min, sec, nan);
1624 long long utime = (time.year()-1970)*31536000+static_cast<int>(
trunc((time.year()-1972)/4))*86400+
1625 (((time.month()-1)*31)*86400)+((time.day()-1)*86400)+time.hour()*3600+time.minute()*60+time.second();
1627 if (time.month() == 3) utime = utime - 3*86400;
1628 if (time.month() == 4) utime = utime - 3*86400;
1629 if (time.month() == 5) utime = utime - 4*86400;
1630 if (time.month() == 6) utime = utime - 4*86400;
1631 if (time.month() == 7) utime = utime - 5*86400;
1632 if (time.month() == 8) utime = utime - 5*86400;
1633 if (time.month() == 9) utime = utime - 5*86400;
1634 if (time.month() == 10) utime = utime - 6*86400;
1635 if (time.month() == 11) utime = utime - 6*86400;
1636 if (time.month() == 12) utime = utime - 7*86400;
1646 double first = fir.year()*1e10+fir.month()+1e8+fir.day()*1e6+fir.hour()*1e4+fir.minute()*1e2+fir.second();
1647 double second = sec.year()*1e10+sec.month()+1e8+sec.day()*1e6+sec.hour()*1e4+sec.minute()*1e2+sec.second();
1649 if (first > second)
return true;
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