/[PAMELA software]/chewbacca/PamOffLineSW/PacketUser.cpp
ViewVC logotype

Diff of /chewbacca/PamOffLineSW/PacketUser.cpp

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

revision 1.4 by mocchiut, Thu Dec 18 14:46:56 2008 UTC revision 1.7 by mocchiut, Fri Jul 24 13:53:38 2009 UTC
# Line 1  Line 1 
1  //============================================================================  //============================================================================
2  // $Id: PacketUser.cpp,v 1.3 2008/12/18 12:58:37 mocchiut Exp $  // $Id: PacketUser.cpp,v 1.6 2008/12/23 20:43:08 mocchiut Exp $
3  // Description :  // Description :
4  //============================================================================  //============================================================================
5  #include "PacketUser.h"  #include "PacketUser.h"
# Line 87  PacketUser::PacketUser() Line 87  PacketUser::PacketUser()
87          boot_number_prevvalue=0;          boot_number_prevvalue=0;
88    
89          //(tassa)          //(tassa)
90          id_to_recover[1000];          //        id_to_recover[1000]; // Emiliano: che si vuole fare con questa riga? cosi` non fa nulla...
91          id_to_recover_index=0;            id_to_recover_index=0;  
92  }  }
93    
# Line 325  void PacketUser::setTimeSync(char* packe Line 325  void PacketUser::setTimeSync(char* packe
325    
326          stringstream oss;          stringstream oss;
327          oss.str()="";          oss.str()="";
328          oss<<"In download: "<<download<<" timeOffset: "<<timeOffset<<" obt_time_sync: "<<obt_time_sync<<" last_time_sync_info: "<<last_time_sync_info<<" using Packet Type: "<<type->GetName().c_str();          oss<<"In download: "<<download<<" timeOffset: "<<timeOffset<<" obt_time_sync: "<<obt_time_sync<<" last_time_sync_info: "<<last_time_sync_info<<" using Packet Type: "<<type->GetName();
329            //      oss<<"In download: "<<download<<" timeOffset: "<<timeOffset<<" obt_time_sync: "<<obt_time_sync<<" last_time_sync_info: "<<last_time_sync_info<<" using Packet Type: "<<type->GetName().c_str();
330          string msg = oss.str();          string msg = oss.str();
331          mainLogUtil->logAll(msg);          mainLogUtil->logAll(msg);
332  }  }
# Line 351  void PacketUser::setBootNumber(char* pac Line 352  void PacketUser::setBootNumber(char* pac
352  */                */              
353                  stringstream oss;                  stringstream oss;
354                  oss.str()="";                  oss.str()="";
355                  oss<<"In download: "<<download<<" boot_number: "<<boot_number<<" using Packet Type: "<<type->GetName().c_str();                  //              oss<<"In download: "<<download<<" boot_number: "<<boot_number<<" using Packet Type: "<<type->GetName().c_str();
356                    oss<<"In download: "<<download<<" boot_number: "<<boot_number<<" using Packet Type: "<<type->GetName();
357                  string msg = oss.str();                  string msg = oss.str();
358                  mainLogUtil->logAll(msg);                  mainLogUtil->logAll(msg);
359                  return;                  return;
# Line 429  unsigned long int PacketUser::retrieveTi Line 431  unsigned long int PacketUser::retrieveTi
431    
432          oss.str("");          oss.str("");
433          oss << "SELECT YEAR(OFFSET_DATE),MONTH(OFFSET_DATE),DAY(OFFSET_DATE),HOUR(OFFSET_DATE),MINUTE(OFFSET_DATE),SECOND(OFFSET_DATE),ID FROM "<<      table <<" WHERE FROM_ORBIT < "          oss << "SELECT YEAR(OFFSET_DATE),MONTH(OFFSET_DATE),DAY(OFFSET_DATE),HOUR(OFFSET_DATE),MINUTE(OFFSET_DATE),SECOND(OFFSET_DATE),ID FROM "<<      table <<" WHERE FROM_ORBIT < "
434          << orbit_number << " order by FROM_ORBIT desc limit 1;";          << orbit_number << " AND SPECIAL_FILE='' order by FROM_ORBIT desc limit 1;";
435                    
436                  string msg2 = oss.str();                  string msg2 = oss.str();
437                  mainLogUtil->logAll(msg2);                  mainLogUtil->logAll(msg2);
# Line 614  bool PacketUser::saveROOT_DB(char* table Line 616  bool PacketUser::saveROOT_DB(char* table
616      << bad_pkt <<"','" << bad_pkt_read <<"','"<< bad_pkt_CalRead <<"','"<< num_PKT_Saved<<"','"      << bad_pkt <<"','" << bad_pkt_read <<"','"<< bad_pkt_CalRead <<"','"<< num_PKT_Saved<<"','"
617      << nome_input <<"',"      << nome_input <<"',"
618      <<"NULL,"<<_time_is_estimated<<        <<"NULL,"<<_time_is_estimated<<  
619      ")";                  ");";          
620          string msg = oss.str();          string msg = oss.str();
621          mainLogUtil->logAll(msg);                mainLogUtil->logAll(msg);      
622                    
# Line 664  void PacketUser::recover_boot_number(){ Line 666  void PacketUser::recover_boot_number(){
666      return;      return;
667        
668    for (int i = 0; i<id_to_recover_index;i++){    for (int i = 0; i<id_to_recover_index;i++){
669      oss << "UPDATE "<<  Table_ROOT_Good << " SET BOOT_NUMBER=" << boot_number << " WHERE ID_N=" << id_to_recover[i];        oss.str("");
670        oss << "UPDATE "<<  Table_ROOT_Good << " SET BOOT_NUMBER=" << boot_number << " WHERE ID_N=" << id_to_recover[i] << ";";  
671     query = oss.str();     query = oss.str();
672     res= sqlServer->Query(query.c_str());     res= sqlServer->Query(query.c_str());
673     if(!res)     if(!res)
# Line 676  void PacketUser::recover_boot_number(){ Line 679  void PacketUser::recover_boot_number(){
679     }     }
680    }    }
681    
682  for (int i = 0; i<id_to_recover_index;i++){    for (int i = 0; i<id_to_recover_index;i++){
683    oss << "UPDATE " <<  Table_ROOT_Merging << " SET BOOT_NUMBER=" <<  boot_number << " WHERE ROOT_ID_N=" << id_to_recover[i];        oss.str("");
684    query=oss.str();      oss << "UPDATE " <<  Table_ROOT_Merging << " SET BOOT_NUMBER=" <<  boot_number << " WHERE ROOT_ID_N=" << id_to_recover[i] << ";";  
685     res= sqlServer->Query(query.c_str());      query=oss.str();
686     if(!res)      res= sqlServer->Query(query.c_str());
687     {          if(!res)
688          {
689             oss1<<"DBError UNABLE to: "<<query.c_str()<<endl;               oss1<<"DBError UNABLE to: "<<query.c_str()<<endl;  
690             msg1=oss1.str();             msg1=oss1.str();
691             mainLogUtil->logError(msg1);               mainLogUtil->logError(msg1);  

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.23