1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvsmanager/yoda/techmodel/physics/S4Reader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/physics/S4Reader.cpp,v $ |
3 |
* $Id: S4Reader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $ |
* $Id: S4Reader.cpp,v 2.1 2004/10/17 12:28:46 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the S4Reader class. |
* Implementation of the S4Reader class. |
29 |
*/ |
*/ |
30 |
std::string S4Reader::GetVersionInfo(void) const { |
std::string S4Reader::GetVersionInfo(void) const { |
31 |
return |
return |
32 |
"$Header: /home/cvsmanager/yoda/techmodel/physics/S4Reader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $"; |
"$Header: /home/cvsmanager/yoda/techmodel/physics/S4Reader.cpp,v 2.1 2004/10/17 12:28:46 kusanagi Exp $"; |
33 |
} |
} |
34 |
|
|
35 |
/** |
/** |
51 |
|
|
52 |
/** |
/** |
53 |
* Unpack the S4 data event from the physical packet. |
* Unpack the S4 data event from the physical packet. |
54 |
|
* Unfortunately the only definition available for S4 is "Rigth before the Neutron detector data" |
55 |
|
* consequently supposing the Neutron data (12 Bytes) always present S4 start 18 Bytes before the end of the packet |
56 |
*/ |
*/ |
57 |
void S4Reader::RunEvent(int EventNumber, const char subData[], long int length) { |
void S4Reader::RunEvent(int EventNumber, const char subData[], long int length) { |
58 |
/* char *data = new char[length]; |
//char *data = new char[lenght]; |
59 |
memcpy(data, subData, length); |
//memcpy(data, subData, lenght); |
60 |
int ERROR; |
int offset = length - 18; |
61 |
|
s4->S4_REG_STATUS = (((UINT8)subData[offset])&0xF0); |
62 |
|
s4->S4_DATA = ((((UINT16)subData[offset]<<8)&0x0FFF) + (((UINT16)subData[offset+1])&0x00FF)); |
63 |
delete[] data; */ |
s4->S4_CMD_NUM = (((UINT8)subData[offset+2])&0xFF);; |
64 |
|
s4->S4_RESP_LENGHT = ((((UINT16)subData[offset+3]<<8)&0xFF00) + (((UINT16)subData[offset+4])&0x00FF));; |
65 |
|
s4->S4_OVERALL_CHKCODE = (((UINT8)subData[offset+5])&0xFF);; |
66 |
} |
} |
67 |
|
|