This commit is contained in:
2025-08-01 17:55:55 +03:00
parent 750d29ceb9
commit 9bfe1c3ad5
9 changed files with 125 additions and 265 deletions

View File

@@ -137,13 +137,7 @@ public:
typedef std::error_code error_t;
struct guiding_point_t : MccCelestialPoint {
coord_t corrThresh{(double)MccAngle("00:00:00.2"_dms)}; // correction threshold
coord_t correctionRange[2]{(double)MccAngle(0.5_arcsecs), (double)MccAngle(5.0_arcsecs)};
// timeout to wait telemetry update (in seconds, as floating-point)
std::chrono::duration<double> telemetryUpdateTimeout{1.0};
};
using guiding_point_t = MccSlewAndGuidingPoint;
template <traits::mcc_mount_controls_c MOUNT_CONTROLS_T, typename... LoggerCtorArgTs>
MccSimpleGuidingModel(MOUNT_CONTROLS_T& mount_controls, LoggerCtorArgTs&&... ctor_args)
@@ -248,18 +242,21 @@ protected:
while (true) {
if (_stopRequested) {
res_err = MccSimpleGuidingModelErrorCode::ERROR_GUIDING_STOPPED;
// return MccSimpleGuidingModelErrorCode::ERROR_GUIDING_STOPPED;
// interpetate stoping as 'no error' exit
return MccSimpleGuidingModelErrorCode::ERROR_OK;
}
// suspend the thread here until telemetry data is updated
t_err = telemetry.waitForUpdatedData(t_data, guiding_point.telemetryUpdateTimeout);
// check prohibited zones ...
if (mccCheckInZonePZTuple(t_data, p_mount_controls->prohibitedZones, in_zone_flag)) {
return MccSimpleGuidingModelErrorCode::ERROR_IN_PROHIBITED_ZONE;
};
// suspend the thread here until telemetry data is updated
t_err = telemetry.waitForUpdatedData(t_data, guiding_point.telemetryUpdateTimeout);
if (t_err) {
std::string err_str = "An error occured while waiting for updated telemetry";
if constexpr (std::same_as<decltype(t_err), error_t>) {
@@ -276,7 +273,8 @@ protected:
}
if (_stopRequested) {
res_err = MccSimpleGuidingModelErrorCode::ERROR_GUIDING_STOPPED;
// interpetate stoping as 'no error' exit
return MccSimpleGuidingModelErrorCode::ERROR_OK;
}
// compare t_data with computed coordinates ...