--- chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2008/11/04 09:44:33 1.2 +++ chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2008/12/18 12:58:37 1.4 @@ -77,7 +77,7 @@ char *outDir = ""; char * nome_output="chewbacca"; - bool multiFile = 0; + bool multiFile = 0; unsigned long int step_pkt_number=0; unsigned long int step_pkt_obt=0; LogUtil* mainLogUtil = NULL; @@ -96,6 +96,8 @@ //TODO: now it is unused unsigned long int delta_Time=0;//in seconds +#define TAGVALUELEN 4 + char tag_value[TAGVALUELEN]; } // main: @@ -176,10 +178,10 @@ 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 + //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); } @@ -488,7 +490,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= "<logAll(msg); } // is_new_route will be reset to false in PacketUser after the packet is used and stored - + + //main processing of the data, searching for Pamela Packets for(int i=0; ireadInput(ccData[i]); - iByte_tot++; - if(exitdbg==true){cout<<"**** DBG EXIT FOR****"<readInput(ccData[i]); + iByte_tot++; + if(exitdbg==true){cout<<"**** DBG EXIT FOR****"<