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

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

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

revision 1.1 by mocchiut, Tue Sep 23 07:20:33 2008 UTC revision 1.5 by mocchiut, Mon Dec 22 10:38:15 2008 UTC
# Line 24  void usage(){ Line 24  void usage(){
24    printf(" -v | --verbose  be verbose [default]\n");    printf(" -v | --verbose  be verbose [default]\n");
25    printf(" -s | --silent   print nothing on STDOUT\n");    printf(" -s | --silent   print nothing on STDOUT\n");
26    printf(" -g | --debug    be very verbose [default: no]\n");    printf(" -g | --debug    be very verbose [default: no]\n");
27    printf(" -p | --pedantic be strict in checks, exit with error if any problem is found [default: no]\n");    printf(" -p | --pedantic be strict in checks, exit with error if any problem is found [default: yes]\n");
28      printf(" -np | --no-pedantic do NOT be strict in checks, try to continue if any problem is found [default: no]\n");
29      printf(" -tag char       set the run tagging in _RUNID_GEN to \"char\" (four letters)[default = 'NONE']\n");
30    printf(" -boot number    CPU boot number [default = taken from VarDump]\n");    printf(" -boot number    CPU boot number [default = taken from VarDump]\n");
31    printf(" -autoboot       if no VarDump found try to determine the BOOT number\n");    printf(" -autoboot       if no VarDump found try to determine the BOOT number\n");
32    printf("                 looking at timesync [default]\n");    printf("                 looking at timesync [default]\n");
# Line 33  void usage(){ Line 35  void usage(){
35    printf(" -obt0 number    obt at timesync (ms) [default = taken from data]\n");    printf(" -obt0 number    obt at timesync (ms) [default = taken from data]\n");
36    printf(" -dworbit number number is the downlink orbit number (to be used with non-standard names)\n");    printf(" -dworbit number number is the downlink orbit number (to be used with non-standard names)\n");
37    printf(" -static         use static path inside the DB instead of symbolic names\n");    printf(" -static         use static path inside the DB instead of symbolic names\n");
38      //  printf(" -keepenv        use environmental variables in the filenames\n");
39      printf(" -k | --keepenv  use environmental variables in the filenames [default]\n");
40      printf(" -nk | --no-keepenv  use PAM_L0 or standard filenames\n");
41    //  printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -tsync 1 -no-autoboot -boot 1 -dworbit 1 -static\"\n");    //  printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -tsync 1 -no-autoboot -boot 1 -dworbit 1 -static\"\n");
42    printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -no-autoboot -dworbit 1 -static\"\n");    printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -no-autoboot -dworbit 1 -static\"\n");
43    printf(" -clean number   number in seconds after which the fragment table\n");    printf(" -clean number   number in seconds after which the fragment table\n");
# Line 81  int main(int numinp, char *inps[]){ Line 86  int main(int numinp, char *inps[]){
86    Bool_t runpieces = false;    Bool_t runpieces = false;
87    //    //
88    //    //
89      TString tag = "NONE";
90    TString filerawname  = "";    TString filerawname  = "";
91    TString filerootname = "";    TString filerootname = "";
92    //    //
# Line 103  int main(int numinp, char *inps[]){ Line 109  int main(int numinp, char *inps[]){
109    //        //    
110    Bool_t chewbacca = false;    Bool_t chewbacca = false;
111    Bool_t staticp = false;    Bool_t staticp = false;
112      Bool_t keepenv = true;
113    Bool_t beverbose = true;    Bool_t beverbose = true;
114    Bool_t debug = false;    Bool_t debug = false;
115    Bool_t autoboot = true;    Bool_t autoboot = true;
# Line 123  int main(int numinp, char *inps[]){ Line 130  int main(int numinp, char *inps[]){
130    //    //
131    Bool_t check = false;    Bool_t check = false;
132    //    //
133    Bool_t pedantic = false;    Bool_t pedantic = true;
134    //    //
135    Int_t i = 0;    Int_t i = 0;
136    //    //
# Line 145  int main(int numinp, char *inps[]){ Line 152  int main(int numinp, char *inps[]){
152          };          };
153          filerawname = (TString)inps[i+1];                        filerawname = (TString)inps[i+1];              
154        };        };
155        if ( !strcmp(inps[i],"-yodaFile") ) {        if ( !strcmp(inps[i],"-yodaFile") || !strcmp(inps[i],"-L0File") ) {
156          if ( numinp-1 < i+1 ){          if ( numinp-1 < i+1 ){
157            usage();            usage();
158            exit(1);            exit(1);
# Line 172  int main(int numinp, char *inps[]){ Line 179  int main(int numinp, char *inps[]){
179          fcleanfile = (TString)inps[i+1];                  fcleanfile = (TString)inps[i+1];        
180          forceclean = true;          forceclean = true;
181        };        };
182         if ( !strcmp(inps[i],"-tag") ) {
183            if ( numinp-1 < i+1 ){
184              usage();
185              exit(1);
186            };
187            tag = (TString)inps[i+1];      
188          };
189       if ( !strcmp(inps[i],"-validate") ) {       if ( !strcmp(inps[i],"-validate") ) {
190          if ( numinp-1 < i+1 ){          if ( numinp-1 < i+1 ){
191            usage();            usage();
# Line 189  int main(int numinp, char *inps[]){ Line 203  int main(int numinp, char *inps[]){
203        if ( !strcmp(inps[i],"-static") ) {        if ( !strcmp(inps[i],"-static") ) {
204          staticp = true;          staticp = true;
205        };        };
206          if ( !strcmp(inps[i],"-k") || !strcmp(inps[i],"--keepenv") ) {
207            keepenv = true;
208          };
209          if ( !strcmp(inps[i],"-nk") || !strcmp(inps[i],"--no-keepenv") ) {
210            keepenv = false;
211          };
212        if ( !strcmp(inps[i],"-autoboot") ) {        if ( !strcmp(inps[i],"-autoboot") ) {
213          autoboot = true;          autoboot = true;
214        };        };
# Line 285  int main(int numinp, char *inps[]){ Line 305  int main(int numinp, char *inps[]){
305        //        //
306        if ( !strcmp(inps[i],"-p") || !strcmp(inps[i],"--pedantic") ) pedantic = true;        if ( !strcmp(inps[i],"-p") || !strcmp(inps[i],"--pedantic") ) pedantic = true;
307        //        //
308          if ( !strcmp(inps[i],"-np") || !strcmp(inps[i],"--no-pedantic") ) pedantic = false;
309          //
310        if ( !strcmp(inps[i],"-nofrag") ) nofrag = true;        if ( !strcmp(inps[i],"-nofrag") ) nofrag = true;
311        //        //
312        if ( !strcmp(inps[i],"-check") ) check = true;        if ( !strcmp(inps[i],"-check") ) check = true;
# Line 387  int main(int numinp, char *inps[]){ Line 409  int main(int numinp, char *inps[]){
409      // Create pamDB object and open SQL connection      // Create pamDB object and open SQL connection
410      //-------------------------------------------------------------------------------------------      //-------------------------------------------------------------------------------------------
411      if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n");      if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n");
412      pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug,tlefilename,dwinput,staticp,gpamela);      pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug,tlefilename,dwinput,staticp,gpamela,keepenv);
413      pamDB->CheckConnection();      pamDB->CheckConnection();
414      pamDB->LockTables();      pamDB->LockTables();
415      pamDB->OpenL0File(filerootname);      pamDB->OpenL0File(filerootname);
416        pamDB->SetTag(tag);
417      //-------------------------------------------------------------------------------------------      //-------------------------------------------------------------------------------------------
418      //      //
419      //      //
# Line 599  int main(int numinp, char *inps[]){ Line 622  int main(int numinp, char *inps[]){
622      case -87: message += " PEDANTIC: THE RUN SHOULD HAVE ALREADY BEEN TREATED BY HANDLERUN()!"; break;      case -87: message += " PEDANTIC: THE RUN SHOULD HAVE ALREADY BEEN TREATED BY HANDLERUN()!"; break;
623      case -88: message += " PEDANTIC: INCONSISTENT PKT/OBT SEQUENCE"; break;      case -88: message += " PEDANTIC: INCONSISTENT PKT/OBT SEQUENCE"; break;
624      case -89: message += " PEDANTIC: CANNOT FIND PKT/OBT SEQUENCE IN THE POINTED FILE"; break;      case -89: message += " PEDANTIC: CANNOT FIND PKT/OBT SEQUENCE IN THE POINTED FILE"; break;
625        case -90: message += " No PhysEndRun tree in the file"; break;
626        case -91: message += " PEDANTIC: Repetition of PhysEndRun data"; break;
627        case -92: message += " CHEWBACCA: cannot find Resurs time zero used by chewbacca in the GL_RESURS_OFFSET table"; break;
628        case -100: message += " Cannot open calibration files to check repeated calibration"; break;
629      default: message += " Unidentified error"; break;      default: message += " Unidentified error"; break;
630      };      };
631      printf("\n");      printf("\n");

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

  ViewVC Help
Powered by ViewVC 1.1.23