This commit is contained in:
Timur A. Fatkhullin 2025-09-22 17:46:52 +03:00
parent 1a4d998141
commit fedc324410
4 changed files with 24 additions and 6 deletions

View File

@ -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

View File

@ -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 <typename T>
concept mcc_coord_pointer_or_nullptr =
std::is_null_pointer_v<T> ||
(std::is_pointer_v<std::decay_t<T>> && (mcc_celestial_point_c<std::remove_pointer_t<std::decay_t<T>>> ||
mcc_eqt_hrz_coord_c<std::remove_pointer_t<std::decay_t<T>>>));
/* CELESTIAL COORDINATES TRANSFORMATION ENGINE */

View File

@ -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 <typename T = std::nullptr_t>
error_t computePCM(mcc_celestial_point_c auto pt, mcc_PCM_c auto* res, T* app_pt = nullptr)
requires(mcc_celestial_point_c<T> || mcc_eqt_hrz_coord_c<T> || std::same_as<T, std::nullptr_t>)
template <typename T>
error_t computePCM(mcc_celestial_point_c auto pt, mcc_PCM_result_c auto* res, T* app_pt = nullptr)
requires(mcc_celestial_point_c<T> || mcc_eqt_hrz_coord_c<T>)
{
if (res == nullptr) {
return MccDefaultPCMErrorCode::ERROR_NULLPTR;
@ -274,7 +274,7 @@ public:
static_assert(false, "UNSUPPORTED");
}
if constexpr (!std::is_null_pointer_v<T>) {
if (app_pt != nullptr) {
if constexpr (mcc_eqt_hrz_coord_c<T>) {
if constexpr (mccIsEquatorialMount(mountType)) {
app_pt->HA = pt.X + res->pcmX;

View File

@ -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;
}