Changeset 18387 for trunk


Ignore:
Timestamp:
12/10/15 11:06:17 (9 years ago)
Author:
tbretz
Message:
Added a RESET command to allow to get out of the internal error states. Fixed a bug in the handling of automatic parking in the morning.
File:
1 edited

Legend:

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

    r18382 r18387  
    21712171    }
    21722172
     2173    int ResetError()
     2174    {
     2175        const int rc = CheckState();
     2176        return rc>0 ? rc : T::GetCurrentState();
     2177    }
     2178
    21732179    // --------------------- Others ---------------------
    21742180
     
    25082514    {
    25092515        const Time now;
    2510         if (now>fSunRise)
    2511         {
    2512             if (T::GetCurrentState()==State::kParking)
    2513                 return State::kParking;
    2514 
     2516        if (now>fSunRise && T::GetCurrentState()!=State::kParking)
     2517        {
    25152518            if (T::GetCurrentState()>State::kLocked && T::GetCurrentState()!=StateMachineImp::kError)
    25162519                return Park();
     
    27882791            ("Park the telescope");
    27892792
    2790         T::AddEvent("STOP")(State::kUnavailable)(State::kAvailable)(State::kArmed)(State::kInitialized)(State::kStopping)(State::kParking)(State::kMoving)(State::kTracking)(State::kOnTrack)(State::kPositioningFailed)(State::kAllowedRangeExceeded)
     2793        T::AddEvent("STOP")(State::kUnavailable)(State::kAvailable)(State::kArmed)(State::kInitialized)(State::kStopping)(State::kParking)(State::kMoving)(State::kTracking)(State::kOnTrack)
    27912794            (bind(&StateMachineDrive::StopMovement, this))
    27922795            ("Stop any kind of movement.");
     2796
     2797        T::AddEvent("RESET", State::kPositioningFailed, State::kAllowedRangeExceeded)
     2798            (bind(&StateMachineDrive::ResetError, this))
     2799            ("Acknoledge an internal error (PositioningFailed, AllowedRangeExceeded)");
    27932800
    27942801        T::AddEvent("TPOINT", State::kOnTrack)
Note: See TracChangeset for help on using the changeset viewer.