Changeset 13211


Ignore:
Timestamp:
03/23/12 22:17:03 (13 years ago)
Author:
tbretz
Message:
Improves state handling.
File:
1 edited

Legend:

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

    r13210 r13211  
    286286public:
    287287    ConnectionWeather(ba::io_service& ioservice, MessageImp &imp) : Connection(ioservice, imp()),
    288         fIsVerbose(true), fKeepAlive(ioservice)
     288        fIsVerbose(true), fLastReport(Time::none), fLastReception(Time::none), fKeepAlive(ioservice)
    289289    {
    290290        SetLogStream(&imp);
     
    309309    int GetState() const
    310310    {
    311         if (fLastReport+boost::posix_time::seconds(fInterval*2)>Time())
     311        if (fLastReport.IsValid() && fLastReport+boost::posix_time::seconds(fInterval*2)>Time())
    312312            return 3;
    313         if (fLastReception+boost::posix_time::seconds(fInterval*2)>Time())
     313
     314        if (fLastReception.IsValid() && fLastReception+boost::posix_time::seconds(fInterval*2)>Time())
    314315            return 2;
     316
    315317        return 1;
    316318
Note: See TracChangeset for help on using the changeset viewer.