This commit is contained in:
2025-09-17 18:21:32 +03:00
parent 281ceacf89
commit 1087e043a8
9 changed files with 86 additions and 27 deletions

View File

@@ -122,7 +122,7 @@ public:
{
*_stopSlewing = true;
_slewingFunc = [controls, this]() -> error_t {
_slewingFunc = [controls, this](bool slew_and_stop) -> error_t {
// first, check target coordinates
typename CONTROLS_T::error_t t_err;
MccTelemetryData tdata;
@@ -278,7 +278,8 @@ public:
{
std::lock_guard lock{*_currentParamsMutex};
if (adjust_mode && !_currentParams.slewAndStop) {
// if (adjust_mode && !_currentParams.slewAndStop) {
if (adjust_mode && !slew_and_stop) {
// do not allow mount speed fall below sideral
if constexpr (mccIsEquatorialMount(CONTROLS_T::mountType)) {
// turn on sideral rate only if the current position point catches up with the target
@@ -359,7 +360,7 @@ public:
virtual ~MccSimpleSlewingModel() = default;
error_t slewToTarget()
error_t slewToTarget(bool slew_and_stop = false)
{
if (!(*_stopSlewing)) {
return MccSimpleSlewingModelErrorCode::ERROR_ALREADY_SLEW;
@@ -367,7 +368,7 @@ public:
*_stopSlewing = false;
return _slewingFunc();
return _slewingFunc(slew_and_stop);
}
@@ -401,7 +402,7 @@ public:
}
protected:
std::function<error_t()> _slewingFunc{};
std::function<error_t(bool)> _slewingFunc{};
std::unique_ptr<std::atomic_bool> _stopSlewing;
slewing_params_t _currentParams{};