Changeset 10570


Ignore:
Timestamp:
May 4, 2011, 3:17:47 PM (8 years ago)
Author:
tbretz
Message:
Improved/fixed the retrieval of times from Dim once again.
Location:
trunk/FACT++/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DimDescriptionService.h

    r10452 r10570  
    4242};
    4343
    44 
    4544#endif
  • trunk/FACT++/src/DimNetwork.cc

    r10509 r10570  
    1414void StateClient::infoHandler()
    1515{
    16     // Make sure getTimestamp is called _before_ getTimestampMillisecs
    17     getInfo()->getTimestamp();
    18 
    1916    DimInfo *curr = getInfo(); // get current DimInfo address
    2017    if (!curr)
     
    2522        const bool disconnected = fInfoState.getSize()==0;
    2623
     24        // Make sure getTimestamp is called _before_ getTimestampMillisecs
     25        const int tsec = fInfoState.getTimestamp();
     26        const int tms  = fInfoState.getTimestampMillisecs();
     27
    2728        fState     = disconnected ? -2 : fInfoState.getQuality();
    28         fStateTime = Time(fInfoState.getTimestamp(),
    29                           fInfoState.getTimestampMillisecs()*1000);
     29        fStateTime = Time(tsec, tms*1000);
    3030
    3131        const string name = fInfoState.getName();
  • trunk/FACT++/src/DimServerList.cc

    r10513 r10570  
    4747void DimServerList::infoHandler()
    4848{
    49     // Make sure getTimestamp is called _before_ getTimestampMillisecs
    50     getInfo()->getTimestamp();
    51 
    5249    if (getInfo()!=&fDimServers)
    5350        return;
  • trunk/FACT++/src/DimServiceInfoList.cc

    r10514 r10570  
    120120void DimServiceInfoList::RemoveServer(const string &s)
    121121{
     122    cout << "Check for: " << s << endl;
     123
    122124    const ServiceInfoList::iterator v = fServiceInfoList.find(s);
    123125    if (v==fServiceInfoList.end())
     
    173175void DimServiceInfoList::infoHandler()
    174176{
    175     // Make sure getTimestamp is called _before_ getTimestampMillisecs
    176     getInfo()->getTimestamp();
    177 
    178177    // Get the name of the service
    179178    const string svc = getInfo()->getName();
  • trunk/FACT++/src/EventDim.h

    r10299 r10570  
    5858    Time GetTime() const
    5959    {
    60         return Time(const_cast<EventDim*>(this)->getTimestamp(),
    61                     const_cast<EventDim*>(this)->getTimestampMillisecs());
     60        // Must be in exactly this order!
     61        const int tsec = const_cast<EventDim*>(this)->getTimestamp();
     62        const int tms  = const_cast<EventDim*>(this)->getTimestampMillisecs();
     63
     64        return Time(tsec, tms*1000);
    6265    }
    6366};
  • trunk/FACT++/src/MessageDim.cc

    r10519 r10570  
    126126void MessageDimRX::infoHandler()
    127127{
    128     // Make sure getTimestamp is called _before_ getTimestampMillisecs
    129     getInfo()->getTimestamp();
    130 
    131128    if (getInfo()!=&fDimMessage)
    132129        return;
    133130
    134     const string name   = getInfo()->getName();
     131    const string name   = fDimMessage.getName();
    135132    const string server = name.substr(0, name.find_first_of('/'));
    136133
    137     fConnected = getInfo()->getSize()!=0;
     134    fConnected = fDimMessage.getSize()!=0;
    138135
    139136    // The server is diconnected. Do nothing
     
    147144
    148145    // skip all messages with a severity smaller than the minimum log level
    149     if (getInfo()->getQuality()<fMinLogLevel)
     146    if (fDimMessage.getQuality()<fMinLogLevel)
    150147        return;
    151148
    152149    stringstream msg;
    153     msg << server << ": " << getInfo()->getString();
     150    msg << server << ": " << fDimMessage.getString();
     151
     152    // Make sure getTimestamp is called _before_ getTimestampMillisecs
     153    // Must be in exactly this order!
     154    const int tsec = fDimMessage.getTimestamp();
     155    const int tms  = fDimMessage.getTimestampMillisecs();
    154156
    155157    // Write the received message to the output
    156     fMsg.Write(Time(getInfo()->getTimestamp(), getInfo()->getTimestampMillisecs()*1000),
    157                msg.str().c_str(), getInfo()->getQuality());
     158    fMsg.Write(Time(tsec, tms*1000), msg.str().c_str(), fDimMessage.getQuality());
    158159}
  • trunk/FACT++/src/dataLogger.cc

    r10549 r10570  
    755755                return;
    756756
    757         getInfo()->getTimestamp();
    758 
    759757        DimInfo* I = getInfo();
    760758        SubscriptionsListType::iterator x;
     
    799797        if (I->getSize() <= 0)
    800798                return;
    801         //check that the message has been updated by something, i.e. must be different from its initial value
     799
     800        // Make sure that getTimestampMillisecs is NEVER called before
     801        // getTimestamp is properly called
     802        // check that the message has been updated by something, i.e. must be different from its initial value
    802803        if (I->getTimestamp() == 0)
    803804                return;
Note: See TracChangeset for help on using the changeset viewer.