From fedc3244106993f28707794ae1677b548d28edb1 Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Mon, 22 Sep 2025 17:46:52 +0300 Subject: [PATCH] ... --- asibfm700/asibfm700_common.h | 4 ++++ mcc/mcc_generics.h | 8 ++++++++ mcc/mcc_pcm.h | 8 ++++---- mcc/tests/ccte_test.cpp | 10 ++++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/asibfm700/asibfm700_common.h b/asibfm700/asibfm700_common.h index d7094e0..8b1c94e 100644 --- a/asibfm700/asibfm700_common.h +++ b/asibfm700/asibfm700_common.h @@ -105,6 +105,10 @@ struct Asibfm700MountConfigFileDefailts { std::string pzMinAltitude{"10.0"}; // minimal altitude in degrees std::string pzLimitSwitchHAMin{""}; // HA-axis limit switch minimal value std::string pzLimitSwitchHAMaz{""}; // HA-axis limit switch maximal value + + // hardware + std::string hwMaxRateHA{""}; // maximal moving rate along HA-axis (Y-axis of Sidereal servo microcontroller) + std::string hwMaxRateDEC{""}; // maximal moving rate along DEC-axis (X-axis of Sidereal servo microcontroller) }; } // namespace asibfm700 diff --git a/mcc/mcc_generics.h b/mcc/mcc_generics.h index 7a54101..eee3ba1 100644 --- a/mcc/mcc_generics.h +++ b/mcc/mcc_generics.h @@ -269,6 +269,14 @@ static constexpr void mcc_copy_eqt_hrz_coord(mcc_eqt_hrz_coord_c auto const& fro } +// nullptr_t or pointer to celestial/equatorial and horizontal coordinates class +template +concept mcc_coord_pointer_or_nullptr = + std::is_null_pointer_v || + (std::is_pointer_v> && (mcc_celestial_point_c>> || + mcc_eqt_hrz_coord_c>>)); + + /* CELESTIAL COORDINATES TRANSFORMATION ENGINE */ diff --git a/mcc/mcc_pcm.h b/mcc/mcc_pcm.h index 23b8db1..28073d2 100644 --- a/mcc/mcc_pcm.h +++ b/mcc/mcc_pcm.h @@ -193,9 +193,9 @@ public: // apparent_X = encoder_X + res.pcmX // apparent_Y = encoder_Y + res.pcmY // so, input x and y are assumed to be mount axis encoder coordinates - template - error_t computePCM(mcc_celestial_point_c auto pt, mcc_PCM_c auto* res, T* app_pt = nullptr) - requires(mcc_celestial_point_c || mcc_eqt_hrz_coord_c || std::same_as) + template + error_t computePCM(mcc_celestial_point_c auto pt, mcc_PCM_result_c auto* res, T* app_pt = nullptr) + requires(mcc_celestial_point_c || mcc_eqt_hrz_coord_c) { if (res == nullptr) { return MccDefaultPCMErrorCode::ERROR_NULLPTR; @@ -274,7 +274,7 @@ public: static_assert(false, "UNSUPPORTED"); } - if constexpr (!std::is_null_pointer_v) { + if (app_pt != nullptr) { if constexpr (mcc_eqt_hrz_coord_c) { if constexpr (mccIsEquatorialMount(mountType)) { app_pt->HA = pt.X + res->pcmX; diff --git a/mcc/tests/ccte_test.cpp b/mcc/tests/ccte_test.cpp index 65e5a7d..750fad4 100644 --- a/mcc/tests/ccte_test.cpp +++ b/mcc/tests/ccte_test.cpp @@ -143,11 +143,17 @@ int main() std::cout << "\n\n"; - std::string sc2{" 11:34:21.21 , 104.4567892"}; + // std::string sc2{" 11:34:21.21 , 104.4567892"}; + std::string sc2{" 11:34:21.21 , 1.044567892E02"}; auto p2 = mcc::utils::parseAnglePair(sc2); - std::cout << p2.first << ", " << p2.second << "\n"; + std::cout << "ORIG STR: '" << sc2 << "'\n"; + std::cout << p2.first << "; " << p2.second << "\n"; + mcc::MccAngle a1{p2.first, mcc::MccDegreeTag{}}; + mcc::MccAngle a2{p2.second, mcc::MccDegreeTag{}}; + + std::cout << a1.sexagesimal() << "\n" << a2.sexagesimal() << "\n"; return 0; }