...
This commit is contained in:
@@ -279,7 +279,18 @@ protected:
|
||||
struct MccGenericFsmMountSlewEvent : MccGenericFsmMountBaseEvent {
|
||||
static constexpr std::string_view ID{"GENERIC-MOUNT-SLEW-EVENT"};
|
||||
|
||||
MccGenericFsmMountSlewEvent(MccGenericFsmMount* mount) : MccGenericFsmMountBaseEvent(mount) {}
|
||||
MccGenericFsmMountSlewEvent(MccGenericFsmMount* mount, bool slew_and_stop)
|
||||
: MccGenericFsmMountBaseEvent(mount), _slewAndStop(slew_and_stop)
|
||||
{
|
||||
}
|
||||
|
||||
bool eventData() const noexcept
|
||||
{
|
||||
return _slewAndStop;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool _slewAndStop{};
|
||||
};
|
||||
|
||||
struct MccGenericFsmMountTrackEvent : MccGenericFsmMountBaseEvent {
|
||||
@@ -473,9 +484,8 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
MccGenericFsmMount::slewing_params_t params;
|
||||
mount_ptr->getSlewingParams(¶ms);
|
||||
if (params.slewAndStop) { // after slewing switch to IDLE state
|
||||
bool slew_and_stop = event.eventData();
|
||||
if (slew_and_stop) { // after slewing switch to IDLE state
|
||||
mount_ptr->dispatchEvent(MccGenericFsmMountIdleEvent{mount_ptr});
|
||||
} else { // after slewing switch to tracking state
|
||||
mount_ptr->dispatchEvent(MccGenericFsmMountTrackEvent{mount_ptr});
|
||||
@@ -674,10 +684,10 @@ public:
|
||||
return _lastError;
|
||||
}
|
||||
|
||||
auto slewToTarget()
|
||||
auto slewToTarget(bool slew_and_stop = false)
|
||||
{
|
||||
try {
|
||||
this->dispatchEvent(MccGenericFsmMountSlewEvent{this});
|
||||
this->dispatchEvent(MccGenericFsmMountSlewEvent{this, slew_and_stop});
|
||||
} catch (std::system_error const& exc) {
|
||||
if (exc.code().category() == fsm::MccFiniteStateMachineCategory::get()) {
|
||||
_lastError = MccGenericFsmMountErrorCode::ERROR_INVALID_OPERATION;
|
||||
|
||||
Reference in New Issue
Block a user