From ba03832ce6d5f70e33d33abbda8a0ec42d8037df Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Fri, 27 Feb 2026 14:24:45 +0300 Subject: [PATCH] add hardwareShutdown method requirement to mcc_hardware_c concept --- include/mcc/mcc_concepts.h | 65 ++------------------------------------ 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/include/mcc/mcc_concepts.h b/include/mcc/mcc_concepts.h index 5565f24..fddf196 100644 --- a/include/mcc/mcc_concepts.h +++ b/include/mcc/mcc_concepts.h @@ -706,75 +706,12 @@ concept mcc_hardware_c = requires(T t) { }(); // to ensure 'mountType' can be used in compile-time context - // a type that defines at least HW_MOVE_ERROR, HW_MOVE_STOPPING, HW_MOVE_STOPPED, HW_MOVE_SLEWING, - // HW_MOVE_ADJUSTING, HW_MOVE_TRACKING and HW_MOVE_GUIDING compile-time constants. The main purpose of this type is - // a possible tunning of hardware hardwareSetState-related commands and detect the stop and error states from - // hardware - // - // e.g. an implementations can be as follows: - // enum class hardware_movement_state_t: int {HW_MOVE_ERROR = -1, HW_MOVE_STOPPED = 0, HW_MOVE_STOPPING, - // HW_MOVE_SLEWING, HW_MOVE_ADJUSTING, HW_MOVE_TRACKING, HW_MOVE_GUIDING} - // - // struct hardware_movement_state_t { - // static constexpr uint16_t HW_MOVE_STOPPED = 0; - // static constexpr uint16_t HW_MOVE_SLEWING = 111; - // static constexpr uint16_t HW_MOVE_ADJUSTING = 222; - // static constexpr uint16_t HW_MOVE_TRACKING = 333; - // static constexpr uint16_t HW_MOVE_GUIDING = 444; - // static constexpr uint16_t HW_MOVE_ERROR = 555; - // static constexpr uint16_t HW_MOVE_STOPPING = 666; - // } - requires mcc_hardware_movement_state_c; - // requires requires(typename T::hardware_movement_state_t type) { - // []() { - // // mount axes were stopped - // static constexpr auto v0 = T::hardware_movement_state_t::HW_MOVE_STOPPED; - - // // hardware was asked for slewing (move to given celestial point) - // static constexpr auto v1 = T::hardware_movement_state_t::HW_MOVE_SLEWING; - - // // hardware was asked for adjusting after slewing - // // (adjusting actual mount position to align with target celestial point at the end of slewing process) - // static constexpr auto v2 = T::hardware_movement_state_t::HW_MOVE_ADJUSTING; - - // // hardware was asked for tracking (track target celestial point) - // static constexpr auto v3 = T::hardware_movement_state_t::HW_MOVE_TRACKING; - - // // hardware was asked for guiding - // // (small corrections to align actual mount position with target celestial point) - // static constexpr auto v4 = T::hardware_movement_state_t::HW_MOVE_GUIDING; - - // // to detect possible hardware error - // static constexpr auto v5 = T::hardware_movement_state_t::HW_MOVE_ERROR; - // }(); - // }; - requires mcc_hardware_state_c && requires(typename T::hardware_state_t state) { requires std::same_as; }; - // requires requires(typename T::hardware_state_t state) { - // // encoder co-longitude and co-latiitude positions, as well as its measurement time point - // // the given constrains on coordinate pair kind can be used to deduce mount type - // requires mcc_coord_pair_c && - // ( // for equathorial mount: - // decltype(state.XY)::pairKind == impl::MccCoordPairKind::COORDS_KIND_HADEC_OBS || - // // for alt-azimuthal mount: - // decltype(state.XY)::pairKind == impl::MccCoordPairKind::COORDS_KIND_AZALT || - // decltype(state.XY)::pairKind == impl::MccCoordPairKind::COORDS_KIND_AZZD); - - // // co-longitude and co-latiitude axis angular speeds, as well as its measurement/computation time point - // requires mcc_coord_pair_c && - // (decltype(state.XY)::pairKind == impl::MccCoordPairKind::COORDS_KIND_GENERIC || - // decltype(state.XY)::pairKind == impl::MccCoordPairKind::COORDS_KIND_XY); - - - // requires std::same_as; - // }; - - // set hardware state: { t.hardwareSetState(std::declval()) } -> std::same_as; @@ -783,6 +720,8 @@ concept mcc_hardware_c = requires(T t) { // { t.hardwareStop() } -> std::same_as; // stop any moving { t.hardwareInit() } -> std::same_as; // initialize hardware + + { t.hardwareShutdown() } -> std::same_as; // shutdown hardware };