--- chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2010/02/12 12:45:49 1.13 +++ chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2010/02/16 13:38:13 1.14 @@ -1,5 +1,5 @@ //============================================================================ -// $Id: PamOffLineSW_Main.cpp,v 1.12 2010/02/12 05:22:04 mocchiut Exp $ +// $Id: PamOffLineSW_Main.cpp,v 1.13 2010/02/12 12:45:49 mocchiut Exp $ // Description : Pamela Off-Line Software //============================================================================ @@ -45,7 +45,9 @@ bool simulated_data = false; //bool do_vrl_check = false; //EMI bool do_vrl_check = true; //EMI - +int cclung = 0; + Bool_t headok = true; + Bool_t crcok = true; const char* db_host = ""; int db_port = 0; @@ -922,6 +924,8 @@ string sms = ss.str(); // mainLogUtil->logError(sms); // + headok = true; + crcok = true; if (!fin.good()) { //TODO: check here @@ -996,6 +1000,7 @@ //reading data in the cadre fin.read(ccData,LENGTH_DATA_CADRE); + cclung=fin.gcount(); if (!fin.good()) { stringstream oss; @@ -1038,7 +1043,7 @@ { isCadreGood=false; } - + crcok = false; //don't exit now, we need to keep it alive to process data //we will exit the main reading cicle after, } @@ -1063,11 +1068,15 @@ oss1<<"Route number unused = "<logAll(msg); + crcok = false; route=old_route; } } + + // if ( !crcok && !headok ) skip_cadre = true; // useless + // if ( cclung != LENGTH_DATA_CADRE ) skip_cadre = true; // useless if(!skip_cadre) { @@ -1085,6 +1094,7 @@ //main processing of the data, searching for Pamela Packets +// printf(" cc lung %i lung def %i \n",cclung,LENGTH_DATA_CADRE); for(int i=0; ireadInput(ccData[i]); @@ -1172,6 +1182,7 @@ if ( !hc && !horrorcount ) streamposiorig = streamposi; horrorcount++; }; + headok = false; return false; }