This commit is contained in:
2025-10-29 15:07:53 +03:00
parent 78e4bb182c
commit bc300bb3de
6 changed files with 508 additions and 166 deletions

View File

@@ -975,7 +975,7 @@ concept mcc_all_controls_c = mcc_position_controls_c<T> && mcc_telemetry_c<T> &&
// 2) prohibited zones related methods
// 3) slewing and tracking, stop and init mount methods
template <typename T>
concept mcc_generic_mount_c = mcc_telemetry_c<T> && mcc_pzone_container_c<T> && requires(T t) {
concept mcc_generic_mount_c = mcc_telemetry_c<T> && mcc_pzone_container_c<T> && requires(T t, const T t_const) {
// requires mcc_error_c<typename T::error_t>;
// slew mount to target (it is assumed that the target coordinates are determined in the telemetry data)
@@ -996,6 +996,42 @@ concept mcc_generic_mount_c = mcc_telemetry_c<T> && mcc_pzone_container_c<T> &&
// init mount
{ t.initMount() };
//
// minimal set of mount status mnemonic constants
//
requires requires(typename T::mount_status_t type) {
requires std::formattable<
std::conditional_t<std::is_enum_v<typename T::mount_status_t>,
std::underlying_type_t<typename T::mount_status_t>, typename T::mount_status_t>,
char>;
[]() {
// mount initialization
static constexpr auto v1 = T::mount_status_t::INITIALIZATION;
// IDLE
static constexpr auto v2 = T::mount_status_t::IDLE;
// mount is in state after the stopMount() method invoking
static constexpr auto v3 = T::mount_status_t::STOPPED;
// mount is slewing (move to given celestial point)
static constexpr auto v4 = T::mount_status_t::SLEWING;
// mount is adjusting its position in the end of slewing
// (adjusting actual mount position to align with target celestial point at the end of slewing process)
static constexpr auto v5 = T::mount_status_t::ADJUSTING;
// mount is tracking
static constexpr auto v6 = T::mount_status_t::TRACKING;
// an error occured while mount operation
static constexpr auto v7 = T::mount_status_t::ERROR;
}();
};
{ t_const.mountStatus() } -> std::same_as<typename T::mount_status_t>;
};
@@ -1011,6 +1047,4 @@ concept mcc_generic_fsm_mount_c = mcc_generic_mount_c<T> && std::derived_from<T,
template <typename T>
concept mcc_generic_fsm_log_mount_c =
mcc_generic_mount_c<T> && mcc_logger_c<T> && std::derived_from<T, fsm::MccFiniteStateMachine>;
} // namespace mcc