--- chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2008/12/12 15:58:48 1.3 +++ chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2008/12/18 14:47:02 1.5 @@ -1,5 +1,5 @@ //============================================================================ -// $Id: PamOffLineSW_Main.cpp,v 1.52 2008-09-12 14:03:55 messineo Exp $ +// $Id: PamOffLineSW_Main.cpp,v 1.4 2008/12/18 12:58:37 mocchiut Exp $ // Description : Pamela Off-Line Software //============================================================================ @@ -42,7 +42,8 @@ //global variables bool simulated_data = false; -bool do_vrl_check = false; +//bool do_vrl_check = false; //EMI +bool do_vrl_check = true; //EMI char* db_host = ""; int db_port = 0; @@ -76,26 +77,33 @@ // char *outDir = "."; char *outDir = ""; - char * nome_output="chewbacca"; - bool multiFile = 0; - unsigned long int step_pkt_number=0; - unsigned long int step_pkt_obt=0; + // char * nome_output="chewbacca"; //EMI + char * nome_output="L0PAM";//EMI + bool multiFile = 0; + // unsigned long int step_pkt_number=0; // EMI + unsigned long int step_pkt_number=3000; + // unsigned long int step_pkt_obt=0; // EMI + unsigned long int step_pkt_obt=7200000; // EMI LogUtil* mainLogUtil = NULL; TSQLServer* sqlServer = NULL; unsigned long int max_pkt_number = 16777215;//biggest value before reset unsigned long int max_pkt_obt = 4294967295u;//biggest value before reset - bool is_new_route = false; + // bool is_new_route = false; // EMI + bool is_new_route = true; // EMI ??????????? VA BENE? SECONDO ME SI` unsigned int download = 0; unsigned int orbit_number=0; unsigned int mmm_number = 0;//session_number unsigned long int time_Offset=0; - bool tryMerge = false; + // bool tryMerge = false; + bool tryMerge = true; bool do_cont_check=true;//if do_cont_check is false do not use a DB ... //TODO: now it is unused unsigned long int delta_Time=0;//in seconds +#define TAGVALUELEN 4 + char tag_value[TAGVALUELEN]; } // main: @@ -176,10 +184,11 @@ cout << "\t -session_number Value of the session number. If 0 this is retrieved from the input file name. [default = 0]\n"; cout << "\t -time_Offset Value of the timeOffset. If 0 this is retrieved using the orbital number. [default = 0]\n"; cout << "\t -tryMerge if you want to try to Merge ROOT files\n"; - //marco_new_01 + cout << "\t -dontMerge if you don not want to try to Merge ROOT files\n"; + //marco_new_01 cout << "\t -single_connection if you want to open only one connection to DB.\n"; - // cout << "\t -delta_Time set the allowed difference (seconds) in the Real Time between two root file. [default = 0]\n"; - + cout << "\t -tag if you want add the 'The owner of the file' - the tag lenght is 4 char\n"; + // cout << "\t -delta_Time set the allowed difference (seconds) in the Real Time between two root file. [default = 0]\n"; //cout << "\t -multi generate multiple root files \n"; exit(1); } @@ -213,6 +222,12 @@ tryMerge = true; continue; } + + if (!strcmp(argv[i], "-dontMerge")) // EMI + { + tryMerge = false; + continue; + } if (!strcmp(argv[i], "-time_Offset")){ if (++i >= argc){ @@ -301,6 +316,10 @@ continue; } + if (!strcmp(argv[i], "-no-vrl")) //EMI + { + do_vrl_check = false; + } if (!strcmp(argv[i], "-vrl")) { do_vrl_check = true; @@ -364,7 +383,7 @@ exit(1); } DIR* tempdir; - if ((tempdir = opendir(argv[i])) != 0) { + if ((tempdir = opendir(gSystem->ExpandPathName(argv[i]))) != 0) { // EMI outDir = argv[i]; closedir(tempdir); } else { @@ -488,7 +507,18 @@ db_pwd = argv[i]; continue; } - + if (!strcmp(argv[i], "-tag")){ + if (++i >= argc){ + cerr << "-tag needs arguments. \n"; + cout << "Try '-help' for more information. \n"; + exit(1); + } + int len=strlen(argv[i])>TAGVALUELEN?TAGVALUELEN:strlen(argv[i]); + strncpy(tag_value,argv[i],len); + tag_value[len]=0; + continue; + } + //TODO: check that multiFile is always 0 // if (!strcmp(argv[i], "-multi")){multiFile = 1; cout<<"debug: multi= "<logAlways(msg); - msg = "Output directory for the generated root file(s): " + (string)outDir; + msg = "Output directory for the generated root file(s): " + (string)outDir; mainLogUtil->logAlways(msg); + msg = "Output directory for the generated root file(s) expanded: " + (string)gSystem->ExpandPathName(outDir); // EMI + mainLogUtil->logAlways(msg); //EMI msg = "Output root name for the generated root file(s): " + (string)nome_output; mainLogUtil->logAlways(msg);