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

Diff of /chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp

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

revision 1.1 by mocchiut, Tue Sep 23 07:20:14 2008 UTC revision 1.2 by mocchiut, Tue Nov 4 09:44:33 2008 UTC
# Line 1  Line 1 
1  //============================================================================  //============================================================================
2  // $Id: PamOffLineSW_Main.cpp,v 1.51 2008-09-05 14:33:48 messineo Exp $  // $Id: PamOffLineSW_Main.cpp,v 1.52 2008-09-12 14:03:55 messineo Exp $
3  // Description : Pamela Off-Line Software  // Description : Pamela Off-Line Software
4  //============================================================================  //============================================================================
5    
# Line 48  char*  db_host = ""; Line 48  char*  db_host = "";
48  int        db_port = 0;  int        db_port = 0;
49  char*  db_name = "";  char*  db_name = "";
50  char conn[100]="";  char conn[100]="";
 //char* connection = NULL;        
 //char*  db_user = "yoda_user";  
 //char*  db_pwd  = "yoda_pwd";  
51    
52  LogUtil::logLevel loglevel=LogUtil::LOGERROR;  LogUtil::logLevel loglevel=LogUtil::LOGERROR;
53  char* logfilename = "pamofflinesw.log";  char* logfilename = "chewbacca.log";
54  //current route  //current route
55  int route = 999;  int route = 999;
56  //previous route  //previous route
# Line 79  namespace PamOffLineSW Line 76  namespace PamOffLineSW
76  //      char *outDir = ".";  //      char *outDir = ".";
77          char *outDir = "";          char *outDir = "";
78    
79          char * nome_output="yoda";          char * nome_output="chewbacca";
80      bool multiFile = 0;      bool multiFile = 0;
81          unsigned long int step_pkt_number=0;          unsigned long int step_pkt_number=0;
82          unsigned long int step_pkt_obt=0;          unsigned long int step_pkt_obt=0;
# Line 161  void readOptions(int argc, char *argv[]) Line 158  void readOptions(int argc, char *argv[])
158          cout << "\t  (-help | --help | -h) print this help and exit \n";          cout << "\t  (-help | --help | -h) print this help and exit \n";
159          cout << "\t -simu       if the input file contains simulated data instead of real data\n";          cout << "\t -simu       if the input file contains simulated data instead of real data\n";
160          cout << "\t -vrl    if you want to perform the vrl check\n";          cout << "\t -vrl    if you want to perform the vrl check\n";
161          cout << "\t -filelog     set the log filename. [default: pamofflinesw.log]\n";          cout << "\t -filelog     set the log filename. [default: chewbacca.log]\n";
162          cout << "\t -loglevel     set the log level. Values: [0,3] (error,warning,info,all) [default:0]\n";          cout << "\t -loglevel     set the log level. Values: [0,3] (error,warning,info,all) [default:0]\n";
163          cout << "\t -c      set the compression level for the generated ROOT file(s). Values: [0,9] [default = 3]\n";          cout << "\t -c      set the compression level for the generated ROOT file(s). Values: [0,9] [default = 3]\n";
164          cout << "\t -root_name      set the root-name for the generated ROOT file(s). [default = yoda]\n";          cout << "\t -root_name      set the root-name for the generated ROOT file(s). [default = chewbacca]\n";
165          cout << "\t -outDir      set the output directory for the generated root file(s). [default = .]\n";          cout << "\t -outDir      set the output directory for the generated root file(s). [default = .]\n";
166          cout << "\t -delta_counter     set the allowed difference in the Packet Counter between two continuos packets. If 0 all packets are considered continuos.  [default = 0]\n";          cout << "\t -delta_counter     set the allowed difference in the Packet Counter between two continuos packets. If 0 all packets are considered continuos.  [default = 0]\n";
167          cout << "\t -delta_obt     set the allowed difference (ms) in the Packet Orbital Time between two continuos packets. If 0 all packets are considered continuos.  [default = 0]\n";          cout << "\t -delta_obt     set the allowed difference (ms) in the Packet Orbital Time between two continuos packets. If 0 all packets are considered continuos.  [default = 0]\n";
168          cout << "\t -db_host   set the host-name of the DataBase.  [default = localhost]\n";          cout << "\t -db_host   set the host-name of the DataBase.  [default = localhost]\n";
169          cout << "\t -db_port  set the port of the DataBase.  [default = 3306]\n";          cout << "\t -db_port  set the port of the DataBase.  [default = 3306]\n";
170          cout << "\t -db_name  set the name of the DataBase.  [default = yoda_db]\n";          cout << "\t -db_name  set the name of the DataBase.  [default = chewbacca_db]\n";
171          cout << "\t -db_user  set the user of the DataBase.  [default = yoda_user]\n";          cout << "\t -db_user  set the user of the DataBase.  [default = chewbacca_user]\n";
172          cout << "\t -db_pwd  set the user of the DataBase.  [default = yoda_pwd]\n";          cout << "\t -db_pwd  set the user of the DataBase.  [default = chewbacca_pwd]\n";
173          cout << "\t -max_pkt_number  Maximum value for  Packet Counter, after this value it is resetted.  [default = 2^24 - 1]\n";          cout << "\t -max_pkt_number  Maximum value for  Packet Counter, after this value it is resetted.  [default = 2^24 - 1]\n";
174          cout << "\t -max_pkt_obt  Maximum value for  Packet OBT, after this value it is resetted.  [default = 2^32 - 1]\n";                cout << "\t -max_pkt_obt  Maximum value for  Packet OBT, after this value it is resetted.  [default = 2^32 - 1]\n";      
175          cout << "\t -orbit_number  Value of the orbital number. If 0 this is retrieved from the input file name.  [default = 0]\n";                  cout << "\t -orbit_number  Value of the orbital number. If 0 this is retrieved from the input file name.  [default = 0]\n";        
# Line 590  void DB_config() Line 587  void DB_config()
587                                                    
588                          if (!strcmp(db_name,""))                          if (!strcmp(db_name,""))
589                          {                          {
590                                  db_name="yoda_db";                                                db_name="chewbacca_db";        
591                          }                                                                                        }                                                              
592                          sprintf(conn,"mysql://%s:%d/%s",db_host,db_port,db_name);                                sprintf(conn,"mysql://%s:%d/%s",db_host,db_port,db_name);      
593                          connection=conn;                                                  connection=conn;                        
# Line 610  void DB_config() Line 607  void DB_config()
607                  }                  }
608                  else                  else
609                  {                  {
610                          db_user="yoda_user";                          db_user="chewbacca_user";
611                  }                  }
612                    
613          }          }
# Line 624  void DB_config() Line 621  void DB_config()
621                  }                  }
622                  else                  else
623                  {                  {
624                          db_pwd="yoda_pwd";                          db_pwd="chewbacca_pwd";
625                  }                        }      
626          }          }
627                    
# Line 897  void mainRead_RealData(char fni[]) Line 894  void mainRead_RealData(char fni[])
894                                  string msg = oss.str();                                  string msg = oss.str();
895                                  mainLogUtil->logError(msg);                                  mainLogUtil->logError(msg);
896                                                                    
897                                  //non mi fido del contatore del route                                  //non mi fido del contatore del route                                  
                                           
898                                  stringstream oss1;                                  stringstream oss1;
899                                  oss1<<"Route number unused = "<<route<<" Resetting ROUTE to old value = "<<old_route<<" (download="<<download<<")";                                  oss1<<"Route number unused = "<<route<<" Resetting ROUTE to old value = "<<old_route<<" (download="<<download<<")";
900                                  msg = oss1.str();                                  msg = oss1.str();
# Line 967  void mainRead_RealData(char fni[]) Line 963  void mainRead_RealData(char fni[])
963  //function that check the header VRL  //function that check the header VRL
964  bool VRL_Header_Check(char* headVRL, int length)  bool VRL_Header_Check(char* headVRL, int length)
965  {        {      
966                            
           
967  /*      stringstream oss;                                                /*      stringstream oss;                                              
968          oss<<"Pippooooooo: at byte+ "<<iByte_tot<<" cadre ... route number = "<<(int)headVRL[3];          oss<<"Pippooooooo: at byte+ "<<iByte_tot<<" cadre ... route number = "<<(int)headVRL[3];
969          string msg = oss.str();          string msg = oss.str();

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23