1 |
/** @file |
/** @file |
2 |
* $Source: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/techmodel/McmdReader.cpp,v $ |
* $Source: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/techmodel/McmdReader.cpp,v $ |
3 |
* $Id: McmdReader.cpp,v 1.2 2008-10-01 09:53:42 mocchiut Exp $ |
* $Id: McmdReader.cpp,v 1.3 2009/04/15 08:40:06 pam-fi Exp $ |
4 |
* $Author: mocchiut $ |
* $Author: pam-fi $ |
5 |
* |
* |
6 |
* Implementation of the McmdReader class. |
* Implementation of the McmdReader class. |
7 |
*/ |
*/ |
24 |
* Get a string with the version info of the algorithm. |
* Get a string with the version info of the algorithm. |
25 |
*/ |
*/ |
26 |
std::string McmdReader::GetVersionInfo(void) const { |
std::string McmdReader::GetVersionInfo(void) const { |
27 |
return "$Header: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/techmodel/McmdReader.cpp,v 1.2 2008-10-01 09:53:42 mocchiut Exp $\n"; |
return "$Header: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/techmodel/McmdReader.cpp,v 1.3 2009/04/15 08:40:06 pam-fi Exp $\n"; |
28 |
} |
} |
29 |
|
|
30 |
/** |
/** |
173 |
//and finally update the partialCRC |
//and finally update the partialCRC |
174 |
//TO DO - if one CRC is wrong also the total one will be corrupted |
//TO DO - if one CRC is wrong also the total one will be corrupted |
175 |
// printf(" subCRC %X readCRC %X \n",subCRC,readCRC); |
// printf(" subCRC %X readCRC %X \n",subCRC,readCRC); |
176 |
if (subCRC == readCRC) { |
// if (subCRC == readCRC) { // BUG?! Emiliano 2009 10 01 |
177 |
rec = new (recs[i++]) McmdRecord(); //aggiungo un nuovo McmdRecord all'evento |
rec = new (recs[i++]) McmdRecord(); //aggiungo un nuovo McmdRecord all'evento |
178 |
rec->MCMD_RECORD_OBT = (((UINT32)OBT[0] << 24) & 0xFF000000) + (((UINT32)OBT[1] << 16) & 0x00FF0000) |
rec->MCMD_RECORD_OBT = (((UINT32)OBT[0] << 24) & 0xFF000000) + (((UINT32)OBT[1] << 16) & 0x00FF0000) |
179 |
+ (((UINT32)OBT[2] << 8) & 0x0000FF00) + (((UINT32)OBT[3]) & 0x000000FF); |
+ (((UINT32)OBT[2] << 8) & 0x0000FF00) + (((UINT32)OBT[3]) & 0x000000FF); |
187 |
|
|
188 |
rec->McmdData = new TArrayC(dataLength, subData); |
rec->McmdData = new TArrayC(dataLength, subData); |
189 |
// delete [] subData; |
// delete [] subData; |
190 |
|
if (subCRC == readCRC) { |
191 |
|
rec->Mcmd_Block_crc_ok = 1; |
192 |
} |
} |
193 |
else { |
else { |
194 |
|
rec->Mcmd_Block_crc_ok = 0; |
195 |
oss.str(""); |
oss.str(""); |
196 |
oss << "Wrong CRC on Subpacket internal to MCMD Packet "; |
oss << "Wrong CRC on Subpacket internal to MCMD Packet "; |
197 |
msg = oss.str(); |
msg = oss.str(); |
215 |
// printf(" CICCIOEND readCRC %X partialCRC %X \n",(UINT16)readCRC,(UINT16)partialCRC); |
// printf(" CICCIOEND readCRC %X partialCRC %X \n",(UINT16)readCRC,(UINT16)partialCRC); |
216 |
// if(partialCRC != readCRC) throw WrongCRCException(" Wrong Global CRC for MCMD Packet "); |
// if(partialCRC != readCRC) throw WrongCRCException(" Wrong Global CRC for MCMD Packet "); |
217 |
if (partialCRC != readCRC) { |
if (partialCRC != readCRC) { |
218 |
|
Mcmd->Mcmd_crc_ok = 0; |
219 |
oss.str(""); |
oss.str(""); |
220 |
oss << "Wrong CRC for MCMD Packet: " << " CRC COMPUTED= " << partialCRC << " CRC READ= " << readCRC; |
oss << "Wrong CRC for MCMD Packet: " << " CRC COMPUTED= " << partialCRC << " CRC READ= " << readCRC; |
221 |
msg = oss.str(); |
msg = oss.str(); |
222 |
PamOffLineSW::mainLogUtil->logWarning(msg); |
PamOffLineSW::mainLogUtil->logWarning(msg); |
223 |
throw WrongCRCException_PKTUsed(" Wrong CRC for MCMD Packet. "); |
throw WrongCRCException_PKTUsed(" Wrong CRC for MCMD Packet. "); |
224 |
}; |
} else { |
225 |
|
Mcmd->Mcmd_crc_ok = 1; |
226 |
|
} |
227 |
} |
} |
228 |
|
|