This commit is contained in:
Timur A. Fatkhullin 2025-11-17 23:42:04 +03:00
parent 771619b832
commit 14e583a244
2 changed files with 16 additions and 5 deletions

View File

@ -503,7 +503,7 @@ public:
// first, compute HA from CIO-based RA!!!
lst_eo();
if (!ret) {
ha = lst - from_pt.X + eo;
ha = MccAngle(lst - from_pt.X + eo).normalize<MccAngle::NORM_KIND_0_360>();
} else {
return ret;
}

View File

@ -120,12 +120,21 @@ public:
*_isDataUpdated = false;
*_internalUpdating = false;
_data.target.pair_kind = MccCoordPairKind::COORDS_KIND_RADEC_ICRS;
// using ccte_t = std::remove_cvref_t<decltype(*ccte)>;
using pcm_t = std::remove_cvref_t<decltype(*controls)>;
using hardware_t = std::remove_cvref_t<decltype(*controls)>;
if constexpr (mccIsEquatorialMount(pcm_t::mountType)) {
_data.pair_kind = MccCoordPairKind::COORDS_KIND_HADEC_APP;
_data.target.pair_kind = MccCoordPairKind::COORDS_KIND_HADEC_APP;
} else if constexpr (mccIsAltAzMount(pcm_t::mountType)) {
_data.pair_kind = MccCoordPairKind::COORDS_KIND_AZZD;
_data.target.pair_kind = MccCoordPairKind::COORDS_KIND_AZZD;
} else {
static_assert(false, "UNKNOWN MOUNT TYPE!");
}
_updateTargetFunc = [controls, this](std::stop_token stop_token) -> error_t {
MccPCMResult pcm_res;
@ -300,7 +309,8 @@ public:
MccCelestialPoint pt{.pair_kind = MccCoordPairKind::COORDS_KIND_AZALT, .time_point = _data.time_point};
if constexpr (mccIsEquatorialMount(pcm_t::mountType)) {
_data.RA_APP = (double)_data.LST - (double)_data.HA + eo;
_data.RA_APP =
MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
_data.X = _data.HA;
_data.Y = _data.DEC_APP;
@ -326,7 +336,8 @@ public:
if (!ccte_err) {
_data.HA = pt.X;
_data.DEC_APP = pt.Y;
_data.RA_APP = (double)_data.LST - (double)_data.HA + eo;
_data.RA_APP =
MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
}
} else {
@ -447,7 +458,7 @@ public:
{
using d_t = std::remove_cvref_t<decltype(interval)>;
std::lock_guard lock{_currentUpdateIntervalMutex};
std::lock_guard lock{*_currentUpdateIntervalMutex};
if constexpr (std::floating_point<typename d_t::rep>) {
_currentUpdateInterval = utils::isEqual(interval.count(), 0.0) ? defaultUpdateInterval : interval;