From 8aa58b727be7de0ab73f2f1eebcbf3d73bdf48ca Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Thu, 26 Feb 2026 12:13:39 +0300 Subject: [PATCH] ... --- include/mcc/mcc_generic_mount.h | 8 ++++---- include/mcc/mcc_generic_movecontrols.h | 28 ++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/include/mcc/mcc_generic_mount.h b/include/mcc/mcc_generic_mount.h index 6afe8b9..bf0c44b 100644 --- a/include/mcc/mcc_generic_mount.h +++ b/include/mcc/mcc_generic_mount.h @@ -147,9 +147,9 @@ public: std::tuple move_cntrl_ctor_ars, std::tuple logger_ctor_args) : TELEMETRY_T(std::make_from_tuple(std::move(telemetry_ctor_args))), - PZONE_CONT_T(std::make_from_tuple(pzone_cont_ctor_ars)), - MOVE_CNTRL_T(std::make_from_tuple(move_cntrl_ctor_ars)), - LOGGER_T(std::make_from_tuple(logger_ctor_args)) + PZONE_CONT_T(std::make_from_tuple(std::move(pzone_cont_ctor_ars))), + MOVE_CNTRL_T(std::make_from_tuple(std::move(move_cntrl_ctor_ars))), + LOGGER_T(std::make_from_tuple(std::move(logger_ctor_args))) { // logDebug(std::format("Create MccGenericMount class instance (thread: {})", std::this_thread::get_id())); logDebug("Create MccGenericMount class instance (thread: {})", std::this_thread::get_id()); @@ -194,7 +194,7 @@ public: error_t initMount() { - logInfo(std::format("Start MccGenericMount class initialization (thread: {}) ...", std::this_thread::get_id())); + logInfo("Start MccGenericMount class initialization (thread: {}) ...", std::this_thread::get_id()); *_mountStatus = mount_status_t::MOUNT_STATUS_IDLE; diff --git a/include/mcc/mcc_generic_movecontrols.h b/include/mcc/mcc_generic_movecontrols.h index cae0b01..f055e7c 100644 --- a/include/mcc/mcc_generic_movecontrols.h +++ b/include/mcc/mcc_generic_movecontrols.h @@ -21,10 +21,15 @@ namespace mcc::impl { + +// mount movement-related generic errors enum class MccGenericMovementControlsErrorCode : int { ERROR_OK, ERROR_IN_PZONE, - ERRROR_NEAR_PZONE, + ERROR_NEAR_PZONE, + ERROR_SLEW_TIMEOUT, + ERROR_STOP_TIMEOUT, + ERROR_HARDWARE, ERROR_TELEMETRY_TIMEOUT }; } // namespace mcc::impl @@ -56,8 +61,14 @@ struct MccGenericMovementControlsErrorCategory : std::error_category { return "OK"; case MccGenericMovementControlsErrorCode::ERROR_IN_PZONE: return "target is in zone"; - case MccGenericMovementControlsErrorCode::ERRROR_NEAR_PZONE: + case MccGenericMovementControlsErrorCode::ERROR_NEAR_PZONE: return "mount is near zone"; + case MccGenericMovementControlsErrorCode::ERROR_SLEW_TIMEOUT: + return "a timeout occured while slewing"; + case MccGenericMovementControlsErrorCode::ERROR_STOP_TIMEOUT: + return "a timeout occured while mount stopping"; + case MccGenericMovementControlsErrorCode::ERROR_HARDWARE: + return "a hardware error occured"; case MccGenericMovementControlsErrorCode::ERROR_TELEMETRY_TIMEOUT: return "telemetry data timeout"; default: @@ -139,6 +150,15 @@ struct MccMovementPathFile { } } + // comment corresponded to addToPath(mcc_telemetry_data_c auto const& tdata) + void addDefaultComment() + { + addComment("Format (time is in milliseconds, coordinates are in degrees):"); + addComment( + " " + " "); + } + // general purpose method // template ... ArgTs> // void addToPath(std::format_string fmt, ArgTs&&... args) @@ -187,6 +207,10 @@ struct MccMovementPathFile { bool saveToFile(std::string const& filename, std::ios_base::openmode mode = std::ios_base::trunc) { + if (filename.empty()) { + return true; + } + std::ofstream fst(filename, mode); if (fst.is_open()) {