/[PAMELA software]/chewbacca/YodaProfiler/src/PamelaDBOperations.cpp
ViewVC logotype

Diff of /chewbacca/YodaProfiler/src/PamelaDBOperations.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by mocchiut, Fri Dec 12 20:08:13 2008 UTC revision 1.19 by mocchiut, Mon Dec 22 11:05:10 2008 UTC
# Line 135  void PamelaDBOperations::OpenL0File(TStr Line 135  void PamelaDBOperations::OpenL0File(TStr
135        stringstream qu;        stringstream qu;
136        TSQLResult *result = 0;        TSQLResult *result = 0;
137        TSQLResult *result2 = 0;        TSQLResult *result2 = 0;
138          TSQLResult *result3 = 0;
139        TSQLRow    *row    = 0;            TSQLRow    *row    = 0;    
140        TSQLRow    *row2    = 0;            TSQLRow    *row2    = 0;    
141          TSQLRow    *row3    = 0;    
142        TString chpath;        TString chpath;
143        TString chfile;        TString chfile;
144        UInt_t ridn = 0;        UInt_t ridn = 0;
# Line 161  void PamelaDBOperations::OpenL0File(TStr Line 163  void PamelaDBOperations::OpenL0File(TStr
163        };        };
164        delete result;        delete result;
165        qu.str("");        qu.str("");
166        qu << "SELECT FOLDER_NAME,FILE_NAME,OBT_TIME_SYNC,LAST_TIME_SYNC_INFO,TIME_OFFSET,BOOT_NUMBER,PKT_NUMBER_INIT,PKT_NUMBER_FINAL,PKT_OBT_INIT,PKT_OBT_FINAL from ROOT_TABLE where ID_N=" << ridn << ";";        qu << "SELECT FOLDER_NAME,FILE_NAME,OBT_TIME_SYNC,LAST_TIME_SYNC_INFO,TIME_OFFSET,BOOT_NUMBER,PKT_NUMBER_INIT,PKT_NUMBER_FINAL,PKT_OBT_INIT,PKT_OBT_FINAL,REAL_TIME_INIT from ROOT_TABLE where ID_N=" << ridn << ";";
167        if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());        if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());
168        result2 = conn->Query(qu.str().c_str());        result2 = conn->Query(qu.str().c_str());
169        if ( result2 ){        if ( result2 ){
# Line 178  void PamelaDBOperations::OpenL0File(TStr Line 180  void PamelaDBOperations::OpenL0File(TStr
180            chresursts = (UInt_t)atoll(row2->GetField(4));            chresursts = (UInt_t)atoll(row2->GetField(4));
181            chboot = (UInt_t)atoll(row2->GetField(5));            chboot = (UInt_t)atoll(row2->GetField(5));
182            //            //
183              if ( !chboot ){
184                qu.str("");
185                qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<10000 AND (REAL_TIME_INIT-"<< row2->GetField(10) <<")<7200 group by BOOT_NUMBER order by BOOT_NUMBER asc;";
186                if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());
187                result3 = conn->Query(qu.str().c_str());
188                if ( result3 ){
189                  row3 = result3->Next();
190                  if ( row3 && result3->GetRowCount() == 1 ){
191                    chboot = (UInt_t)atoll(row3->GetField(0));
192                    if ( debug ) printf(" Found boot_number = %u \n",chboot);
193                  } else {
194                    if ( debug ) printf(" AGH CANNOT DETERMINE THE BOOT NUMBER... \n");
195                    throw -29;
196                  };
197                };
198              };
199              //
200            chpktinit = (UInt_t)atoll(row2->GetField(6));            chpktinit = (UInt_t)atoll(row2->GetField(6));
201            chpktfinal = (UInt_t)atoll(row2->GetField(7));            chpktfinal = (UInt_t)atoll(row2->GetField(7));
202            chobtinit = (UInt_t)atoll(row2->GetField(8));            chobtinit = (UInt_t)atoll(row2->GetField(8));

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.23