Changeset 10593 for trunk/FACT++/src


Ignore:
Timestamp:
05/05/11 21:37:48 (14 years ago)
Author:
tbretz
Message:
Fixed type of fClockConditioner; added proper byte swapping for fClockConditioner; some improvements to output; fixed printing of error message.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersFTM.cc

    r10572 r10593  
    1111void FTM::Header::print(std::ostream &out) const
    1212{
    13     out << "State=" << fState;
     13    out << "State=" << std::dec << fState;
    1414    out << "  Type=" << fType;
    1515    out << "  (len=" << fDataSize << ")";
     
    3030void FTM::FtuList::print(std::ostream &out) const
    3131{
    32     out << "Number of boards responded: " << fNumBoards << " (";
     32    out << "Number of boards responded: " << std::dec << fNumBoards << " (";
    3333    out << fNumBoardsCrate[0] << ", ";
    3434    out << fNumBoardsCrate[1] << ", ";
     
    6262void FTM::DynamicData::print(std::ostream &out) const
    6363{
    64     out << "OnTime=" << fOnTimeCounter << " ";
     64    out << "OnTime=" << std::dec << fOnTimeCounter << " ";
    6565    out << "Temp=(";
    6666    out << fTempSensor[0] << ",";
     
    112112    out << "Dead time:         " << fDeadTime*4+8 << "ns" << endl;
    113113    out << "Clock conditioner:";
    114     out << std::hex;
     114    out << std::hex << setfill('0');
    115115    for (int i=0; i<8; i++)
    116         out << " " << fClockConditioner[i];
     116        out << " " << setw(8) << fClockConditioner[i];
    117117    out << endl;
    118118    out << "Active FTUs:       ";
     
    137137    out << "       Delimiter   = " << (fDelimiter=='@'?"ok":"wrong") << endl;
    138138    out << "       Path        = ";
    139     out << (fSrcAddress &0x3) << ":" << (fSrcAddress >>2) << " --> ";
    140     out << (fDestAddress&0x3) << ":" << (fDestAddress>>2) << endl;
     139    if (fSrcAddress==0xc0)
     140        out << "FTM(192)";
     141    else
     142        out << "FTU(" << (fSrcAddress &0x3) << ":" << (fSrcAddress >>2) << ")";
     143    out << " --> ";
     144    if (fDestAddress==0xc0)
     145        out << "FTM(192)";
     146    else
     147        out << "FTU(" << (fDestAddress&0x3) << ":" << (fDestAddress>>2) << ")";
     148    out << endl;
    141149    out << "       FirmwareId  = " << hex << fFirmwareId << endl;
    142150    out << "       Command     = " << hex << fCommand << endl;
    143151    out << "       CRC counter = " << dec << fCrcErrorCounter << endl;
    144152    out << "       CRC         = " << hex << fCrcCheckSum << endl;
    145     out << "       Data: " << Converter::GetHex<unsigned int>(fData, 21, 0, false) << endl;
     153    out << "       Data: " << Converter::GetHex<unsigned short>(fData, 0, false) << endl;
    146154}
  • trunk/FACT++/src/HeadersFTM.h

    r10574 r10593  
    306306        uint16_t fDelayTimeMarker;
    307307        uint16_t fDeadTime;
    308         uint16_t fClockConditioner[8];  // R0, R1, R8, R9, R11, R13, R14, R15
     308        uint32_t fClockConditioner[8];  // R0, R1, R8, R9, R11, R13, R14, R15
    309309        uint16_t fWindowPhysics;
    310310        uint16_t fWindowCalib;
     
    319319        std::vector<uint16_t> HtoN() const
    320320        {
    321             return htoncpy(*this);
     321            StaticData d(*this);
     322            for (int i=0; i<8; i++)
     323                Reverse(d.fClockConditioner+i);
     324
     325            return htoncpy(d);
    322326        }
    323327
     
    325329        {
    326330            ntohcpy(vec, *this);
     331
     332            for (int i=0; i<8; i++)
     333                Reverse(fClockConditioner+i);
    327334        }
    328335
     
    398405                       (uint64_t(d.fActiveFTU[2])<<20) |
    399406                       (uint64_t(d.fActiveFTU[3])<<30)),
    400             fTriggerInterval(d.fTriggerInterval*4+8),
     407            fTriggerInterval(d.fTriggerInterval),
    401408            fTriggerSeqLPint((d.fTriggerSequence)&0x1f),
    402409            fTriggerSeqLPext((d.fTriggerSequence>>5)&0x1f),
Note: See TracChangeset for help on using the changeset viewer.