diff --git a/asibfm700/asibfm700_configfile.h b/asibfm700/asibfm700_configfile.h index e232578..d112041 100644 --- a/asibfm700/asibfm700_configfile.h +++ b/asibfm700/asibfm700_configfile.h @@ -394,6 +394,10 @@ static auto Asibfm700MountConfigDefaults = std::make_tuple( // minimum time in millisecs between two successive tracking corrections simple_config_record_t{"trackingCycleInterval", std::chrono::milliseconds(300)}, + // maximal valid target-to-mount distance for tracking process (arcsecs) + // if current distance is greater than assume current mount coordinate as target point + simple_config_record_t{"trackingMaxCoordDiff", 20.0}, + /* prohibited zones */ @@ -596,6 +600,8 @@ protected: // slew and track parameters + static constexpr double arcsecs2rad = std::numbers::pi / 180.0 / 3600.0; // arcseconds to radians + movingModelParams.telemetryTimeout = getValue("telemetryTimeout").value_or({}); @@ -606,10 +612,10 @@ protected: getValue("updatingPZoneInterval").value_or({}); movingModelParams.slewToleranceRadius = - getValue("slewToleranceRadius").value_or({}); + getValue("slewToleranceRadius").value_or({}) * arcsecs2rad; movingModelParams.adjustCoordDiff = - getValue("adjustCoordDiff").value_or({}); + getValue("adjustCoordDiff").value_or({}) * arcsecs2rad; movingModelParams.adjustCycleInterval = getValue("adjustCycleInterval").value_or({}); @@ -622,6 +628,9 @@ protected: movingModelParams.trackingCycleInterval = getValue("trackingCycleInterval").value_or({}); + movingModelParams.trackingMaxCoordDiff = + getValue("trackingMaxCoordDiff").value_or({}) * + arcsecs2rad; // PCM data diff --git a/mcc/mcc_generic_mount.h b/mcc/mcc_generic_mount.h index 4f1b897..76efa62 100644 --- a/mcc/mcc_generic_mount.h +++ b/mcc/mcc_generic_mount.h @@ -210,20 +210,20 @@ public: // in some intermediate buffer error_t setPointingTarget(mcc_celestial_point_c auto pt) { - mcc_copy_celestial_point(std::move(pt), &_inputTargetCoordiniates); + mcc_copy_celestial_point(std::move(pt), &_enteredTargetCoordiniates); std::string xstr; - if (_inputTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS || - _inputTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_APP || - _inputTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_HADEC_APP) { - xstr = MccAngle(_inputTargetCoordiniates.X).sexagesimal(true); + if (_enteredTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS || + _enteredTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_APP || + _enteredTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_HADEC_APP) { + xstr = MccAngle(_enteredTargetCoordiniates.X).sexagesimal(true); } else { - MccAngle(_inputTargetCoordiniates.X).sexagesimal(); + MccAngle(_enteredTargetCoordiniates.X).sexagesimal(); } - logInfo(std::format("Set input target coordinates to: {} {} {}", xstr, - MccAngle(_inputTargetCoordiniates.Y).sexagesimal(), - MccCoordPairKindStr<_inputTargetCoordiniates.pair_kind>)); + logInfo(std::format("Set entered target coordinates to: {} {} {}", xstr, + MccAngle(_enteredTargetCoordiniates.Y).sexagesimal(), + MccCoordPairKindStr<_enteredTargetCoordiniates.pair_kind>)); return MccGenericMountErrorCode::ERROR_OK; } @@ -231,7 +231,7 @@ public: // re-implements SlewModelT::slewToTarget to fetch input target coordinates from intermediate buffer error_t slewToTarget(bool slew_and_stop = false) { - auto err = TelemetryT::setPointingTarget(_inputTargetCoordiniates); + auto err = TelemetryT::setPointingTarget(_enteredTargetCoordiniates); if (err) { return mcc_deduce_error_code(err, MccGenericMountErrorCode::ERROR_SET_TARGET); } @@ -241,7 +241,7 @@ public: } protected: - MccCelestialPoint _inputTargetCoordiniates; + MccCelestialPoint _enteredTargetCoordiniates; }; diff --git a/mcc/mcc_moving_model_common.h b/mcc/mcc_moving_model_common.h index fa7b7c5..3b0e423 100644 --- a/mcc/mcc_moving_model_common.h +++ b/mcc/mcc_moving_model_common.h @@ -61,6 +61,9 @@ struct MccSimpleMovingModelParams { // time shift into future to compute target position in future (UT1-scale time duration) std::chrono::milliseconds timeShiftToTargetPoint{10000}; + // maximal target-to-mount difference for tracking process (in arcsecs) + // it it is greater then the current mount coordinates are used as target one + double trackingMaxCoordDiff{20.0}; // ******* guiding mode *******