Changeset 12495
- Timestamp:
- 11/11/11 03:21:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/HeadersFAD.h
r12477 r12495 213 213 ntohcpy(vec, *this); 214 214 215 Reverse(((uint16_t*)fEventCounter));216 Reverse(((uint16_t*)fEventCounter)+1);217 218 215 Reverse(&fEventCounter); 219 220 Reverse(((uint16_t*)fTriggerCounter));221 Reverse(((uint16_t*)fTriggerCounter)+1);222 223 216 Reverse(&fTriggerCounter); 224 225 Reverse(((uint16_t*)fFreqRefClock));226 Reverse(((uint16_t*)fFreqRefClock)+1);227 228 217 Reverse(&fFreqRefClock); 229 230 Reverse(((uint16_t*)&fTimeStamp));231 Reverse(((uint16_t*)&fTimeStamp)+1);232 233 218 Reverse(&fTimeStamp); 234 235 Reverse(((uint16_t*)&fRunNumber));236 Reverse(((uint16_t*)&fRunNumber)+1);237 238 219 Reverse(&fRunNumber); 239 Reverse(&fDNA); 240 241 /* 242 for (int i=0; i<kNumTemp; i++) 243 { 244 fTempDrs[i] = 245 (fTempDrs[i]&0x8000) ? 246 ((fTempDrs[i]&0x007fff)^0xffffffff) : 247 (fTempDrs[i]&0x007fff); 248 fTempDrs[i]>>=3; 249 }*/ 250 220 221 for (int i=0; i<8; i+=2) 222 std::swap(reinterpret_cast<uint8_t*>(&fDNA)[i], 223 reinterpret_cast<uint8_t*>(&fDNA)[i+1]); 251 224 } 252 225 … … 255 228 EventHeader h(*this); 256 229 257 Reverse(((uint16_t*)h.fEventCounter));258 Reverse(((uint16_t*)h.fEventCounter)+1);259 260 230 Reverse(&h.fEventCounter); 261 262 Reverse(((uint16_t*)h.fFreqRefClock));263 Reverse(((uint16_t*)h.fFreqRefClock)+1);264 265 231 Reverse(&h.fFreqRefClock); 266 267 Reverse(((uint16_t*)&h.fTimeStamp));268 Reverse(((uint16_t*)&h.fTimeStamp)+1);269 270 232 Reverse(&h.fTimeStamp); 271 272 Reverse(((uint16_t*)&h.fRunNumber));273 Reverse(((uint16_t*)&h.fRunNumber)+1);274 275 233 Reverse(&h.fRunNumber); 276 Reverse(&h.fDNA); 277 278 /* 279 for (int i=0; i<kNumTemp; i++) 280 { 281 h.fTempDrs[i] <<= 3; 282 h.fTempDrs[i] = ((h.fTempDrs[i]&0x800000) ? 283 (((h.fTempDrs[i]^0xffffffff)&0x007fff)|0x8000) : 284 (h.fTempDrs[i]&0x007fff)); 285 }*/ 234 235 for (int i=0; i<8; i+=2) 236 std::swap(reinterpret_cast<uint8_t*>(&h.fDNA)[i], 237 reinterpret_cast<uint8_t*>(&h.fDNA)[i+1]); 286 238 287 239 return htoncpy(h); … … 301 253 302 254 float GetTemp(int i) const { return fTempDrs[i]/16.; } 303 304 /*305 float GetTemp(int i) const306 {307 return (((fTempDrs[i]&0x8000) ?308 ((fTempDrs[i]&0x007fff)^0xffffffff)309 : (fTempDrs[i]&0x007fff))>>3)/16.; }*/310 255 311 256 uint8_t PLLLCK() const { return fStatus>>12; }
Note:
See TracChangeset
for help on using the changeset viewer.