Changeset 18803
- Timestamp:
- 04/05/17 15:26:16 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/drivectrl.cc
r18655 r18803 1308 1308 } 1309 1309 1310 bool Has Error() const1310 bool HasWarning() const 1311 1311 { 1312 1312 const uint8_t typ0 = fErrCode[0]>>16; 1313 1313 const uint8_t typ1 = fErrCode[1]>>16; 1314 return typ0==0xe || typ0==0xf || typ1==0xe || typ1==0xf; 1314 return typ0==0xe || typ1==0xe; 1315 } 1316 1317 bool HasError() const 1318 { 1319 const uint8_t typ0 = fErrCode[0]>>16; 1320 const uint8_t typ1 = fErrCode[1]>>16; 1321 return typ0==0xf || typ1==0xf; 1315 1322 } 1316 1323 … … 2511 2518 // FIXME: This can prevent parking in case e.g. 2512 2519 // of e8029 Position limit exceeded 2513 if (fDrive.Has Error())2520 if (fDrive.HasWarning() || fDrive.HasError()) 2514 2521 { 2515 2522 if (T::GetCurrentState()==State::kOnTrack || … … 2521 2528 if (T::GetCurrentState()==State::kStopping && fDrive.IsMoving()) 2522 2529 return State::kStopping; 2530 2531 if (fDrive.HasError()) 2532 return State::kHardwareError; 2533 2534 if (fDrive.HasWarning()) 2535 return State::kHardwareWarning; 2523 2536 2524 2537 return StateMachineImp::kSM_Error; … … 2728 2741 T::AddStateName(State::kInvalidCoordinates, "InvalidCoordinates", 2729 2742 "Tracking coordinates out of range"); 2743 2744 T::AddStateName(State::kHardwareWarning, "HwardwareWarning", 2745 "At least one IndraDrive in a warning condition... check carefully!"); 2746 T::AddStateName(State::kHardwareError, "HwardwareError", 2747 "At least one IndraDrive in an error condition... this is a serious incident!"); 2730 2748 2731 2749 … … 2817 2835 2818 2836 // FIXME: What to do in error state? 2819 T::AddEvent("PARK", State::kInitialized, State::kMoving, State::kTracking, State::kOnTrack )2837 T::AddEvent("PARK", State::kInitialized, State::kMoving, State::kTracking, State::kOnTrack, State::kHardwareWarning) 2820 2838 (bind(&StateMachineDrive::Park, this)) 2821 2839 ("Park the telescope"); … … 2825 2843 ("Stop any kind of movement."); 2826 2844 2827 T::AddEvent("RESET", State::kPositioningFailed, State::kAllowedRangeExceeded )2845 T::AddEvent("RESET", State::kPositioningFailed, State::kAllowedRangeExceeded, State::kInvalidCoordinates) 2828 2846 (bind(&StateMachineDrive::ResetError, this)) 2829 ("Ackno ledge an internal error (PositioningFailed, AllowedRangeExceeded)");2847 ("Acknowledge an internal drivectrl error (PositioningFailed, AllowedRangeExceeded, InvalidCoordinates)"); 2830 2848 2831 2849 T::AddEvent("TPOINT", State::kOnTrack)
Note:
See TracChangeset
for help on using the changeset viewer.