| 1 |
//============================================================================ |
//============================================================================ |
| 2 |
// $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 $ |
| 3 |
// Description : Pamela Off-Line Software |
// Description : Pamela Off-Line Software |
| 4 |
//============================================================================ |
//============================================================================ |
| 5 |
|
|
| 45 |
bool simulated_data = false; |
bool simulated_data = false; |
| 46 |
//bool do_vrl_check = false; //EMI |
//bool do_vrl_check = false; //EMI |
| 47 |
bool do_vrl_check = true; //EMI |
bool do_vrl_check = true; //EMI |
| 48 |
|
int cclung = 0; |
| 49 |
|
Bool_t headok = true; |
| 50 |
|
Bool_t crcok = true; |
| 51 |
|
|
| 52 |
const char* db_host = ""; |
const char* db_host = ""; |
| 53 |
int db_port = 0; |
int db_port = 0; |
| 924 |
string sms = ss.str(); |
string sms = ss.str(); |
| 925 |
// mainLogUtil->logError(sms); |
// mainLogUtil->logError(sms); |
| 926 |
// |
// |
| 927 |
|
headok = true; |
| 928 |
|
crcok = true; |
| 929 |
if (!fin.good()) |
if (!fin.good()) |
| 930 |
{ |
{ |
| 931 |
//TODO: check here |
//TODO: check here |
| 1000 |
|
|
| 1001 |
//reading data in the cadre |
//reading data in the cadre |
| 1002 |
fin.read(ccData,LENGTH_DATA_CADRE); |
fin.read(ccData,LENGTH_DATA_CADRE); |
| 1003 |
|
cclung=fin.gcount(); |
| 1004 |
if (!fin.good()) |
if (!fin.good()) |
| 1005 |
{ |
{ |
| 1006 |
stringstream oss; |
stringstream oss; |
| 1043 |
{ |
{ |
| 1044 |
isCadreGood=false; |
isCadreGood=false; |
| 1045 |
} |
} |
| 1046 |
|
crcok = false; |
| 1047 |
//don't exit now, we need to keep it alive to process data |
//don't exit now, we need to keep it alive to process data |
| 1048 |
//we will exit the main reading cicle after, |
//we will exit the main reading cicle after, |
| 1049 |
} |
} |
| 1068 |
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<<")"; |
| 1069 |
msg = oss1.str(); |
msg = oss1.str(); |
| 1070 |
mainLogUtil->logAll(msg); |
mainLogUtil->logAll(msg); |
| 1071 |
|
crcok = false; |
| 1072 |
|
|
| 1073 |
route=old_route; |
route=old_route; |
| 1074 |
|
|
| 1075 |
} |
} |
| 1076 |
} |
} |
| 1077 |
|
|
| 1078 |
|
// if ( !crcok && !headok ) skip_cadre = true; // useless |
| 1079 |
|
// if ( cclung != LENGTH_DATA_CADRE ) skip_cadre = true; // useless |
| 1080 |
|
|
| 1081 |
if(!skip_cadre) |
if(!skip_cadre) |
| 1082 |
{ |
{ |
| 1094 |
|
|
| 1095 |
|
|
| 1096 |
//main processing of the data, searching for Pamela Packets |
//main processing of the data, searching for Pamela Packets |
| 1097 |
|
// printf(" cc lung %i lung def %i \n",cclung,LENGTH_DATA_CADRE); |
| 1098 |
for(int i=0; i<LENGTH_DATA_CADRE; i++) |
for(int i=0; i<LENGTH_DATA_CADRE; i++) |
| 1099 |
{ |
{ |
| 1100 |
StateManager::getInstance().getCurrentState()->readInput(ccData[i]); |
StateManager::getInstance().getCurrentState()->readInput(ccData[i]); |
| 1182 |
if ( !hc && !horrorcount ) streamposiorig = streamposi; |
if ( !hc && !horrorcount ) streamposiorig = streamposi; |
| 1183 |
horrorcount++; |
horrorcount++; |
| 1184 |
}; |
}; |
| 1185 |
|
headok = false; |
| 1186 |
|
|
| 1187 |
return false; |
return false; |
| 1188 |
} |
} |