Changeset 16054


Ignore:
Timestamp:
05/22/13 22:39:04 (12 years ago)
Author:
tbretz
Message:
Print a red warning in case of Cooling failure.
File:
1 edited

Legend:

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

    r15633 r16054  
    263263    int GetState() const
    264264    {
    265         using namespace Power::State;
    266 
    267265        // Timeout
    268266        if (!fLastReport.IsValid() || Time()>fLastReport+boost::posix_time::seconds(fInterval*3))
    269             return kDisconnected;
     267            return Power::State::kDisconnected;
    270268
    271269        // No data received yet
    272270        if (!fIsValid)
    273             return kConnected;
     271            return Power::State::kConnected;
    274272
    275273        /*
     
    285283
    286284        if (!fStatus.fWaterLevelOk || (fStatus.fPwrPumpOn && !fStatus.fWaterFlowOk))
    287             return kCoolingFailure;
     285            return Power::State::kCoolingFailure;
    288286
    289287        const int rc =
    290             (fStatus.fPwrBiasOn       ? kBiasOn   : 0) |
    291             (fStatus.fPwrPumpOn       ? kCameraOn : 0) |
    292             (fStatus.fDriveFeedbackOn ? kDriveOn  : 0);
    293 
    294         return rc==0 ? kSystemOff : rc;
     288            (fStatus.fPwrBiasOn       ? Power::State::kBiasOn   : 0) |
     289            (fStatus.fPwrPumpOn       ? Power::State::kCameraOn : 0) |
     290            (fStatus.fDriveFeedbackOn ? Power::State::kDriveOn  : 0);
     291
     292        return rc==0 ? Power::State::kSystemOff : rc;
    295293    }
    296294};
     
    404402        const int rc = fPower.GetState();
    405403
    406         if (rc==Power::State::kCoolingFailure && GetCurrentState()!=Power::State::kCoolingFailure)
    407             Error("Power control unit reported cooling failure.");
     404        if (rc==Power::State::kCoolingFailure && T::GetCurrentState()!=Power::State::kCoolingFailure)
     405            T::Error("Power control unit reported cooling failure.");
    408406
    409407        return fPower.GetState();
Note: See TracChangeset for help on using the changeset viewer.