This commit is contained in:
2025-12-18 18:21:17 +03:00
parent 7948321cce
commit bc12777f18
4 changed files with 175 additions and 150 deletions

View File

@@ -10,7 +10,6 @@
#include <future>
#include <mutex>
#include <stop_token>
#include <thread>
#include "mcc_defaults.h"
@@ -181,12 +180,14 @@ public:
return mcc_deduce_error_code(ccte_err, MccTelemetryErrorCode::ERROR_COORD_TRANSFORM);
}
if (_data.entered_target.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS) {
_data.target.RA_ICRS = _data.entered_target.X;
_data.target.DEC_ICRS = _data.entered_target.Y;
}
// if (_data.entered_target.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS) {
// _data.target.RA_ICRS = _data.entered_target.X;
// _data.target.DEC_ICRS = _data.entered_target.Y;
// }
}
return MccTelemetryErrorCode::ERROR_OK;
if (stop_token.stop_requested()) {
return MccTelemetryErrorCode::ERROR_UPDATE_STOPPED;
}
@@ -232,8 +233,7 @@ public:
double eo;
_data.time_point =
std::chrono::time_point_cast<typename decltype(_data.time_point)::duration>(hw_pos.time_point);
mcc_tp2tp(hw_pos.time_point, hw_pos.time_point);
auto ccte_err = controls->timepointToJulday(_data.time_point, &_data.JD);
if (!ccte_err) {
@@ -261,6 +261,40 @@ public:
_data.speedX = (double)hw_pos.speedX;
_data.speedY = (double)hw_pos.speedY;
// 2025.12.18: according to addition RA/DEC_ICRS to mcc_eqt_hrz_coord_c ...
MccCelestialPoint pt;
mcc_tp2tp(_data.time_point, pt.time_point);
auto pcm_err = controls->computePCM(_data, &_data, &pt);
if (pcm_err) {
return mcc_deduce_error_code(pcm_err, MccTelemetryErrorCode::ERROR_PCM_COMP);
}
if constexpr (mccIsEquatorialMount(pcm_t::mountType)) {
pt.pair_kind = MccCoordPairKind::COORDS_KIND_HADEC_APP;
_data.pair_kind = MccCoordPairKind::COORDS_KIND_HADEC_APP;
} else if constexpr (mccIsAltAzMount(pcm_t::mountType)) {
pt.pair_kind = MccCoordPairKind::COORDS_KIND_AZALT;
_data.pair_kind = MccCoordPairKind::COORDS_KIND_AZALT;
} else {
static_assert(false, "UNKNOWN MOUNT TYPE!");
}
ccte_err = controls->transformCoordinates(pt, &_data);
if (!ccte_err) {
ccte_err = controls->refractionCorrection(_data, &_data.refCorr);
if (!ccte_err) {
return _updateTargetFunc(stop_token);
} else {
return mcc_deduce_error_code(ccte_err, MccTelemetryErrorCode::ERROR_COORD_TRANSFORM);
}
} else {
return mcc_deduce_error_code(ccte_err, MccTelemetryErrorCode::ERROR_COORD_TRANSFORM);
}
/*
// fill _data.pcmX, _data.pcmY and corresponded apparent coordinates
auto pcm_err = controls->computePCM(_data, &_data, &_data);
if (pcm_err) {
@@ -276,8 +310,7 @@ public:
if constexpr (mccIsEquatorialMount(pcm_t::mountType)) {
// NOTE: now it are OBSERVED (NOT APPARENT) RA, HA, DEC!!!
_data.RA_APP =
MccAngle((double)_data.LST - (double)_data.HA - eo).normalize<MccAngle::NORM_KIND_0_360>();
// MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
_data.X = _data.HA;
_data.Y = _data.DEC_APP;
@@ -304,8 +337,7 @@ public:
_data.HA = pt.X;
_data.DEC_APP = pt.Y;
_data.RA_APP =
MccAngle((double)_data.LST - (double)_data.HA - eo).normalize<MccAngle::NORM_KIND_0_360>();
// MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
}
} else {
@@ -367,6 +399,8 @@ public:
return mcc_deduce_error_code(ccte_err, MccTelemetryErrorCode::ERROR_COORD_TRANSFORM);
}
*/
return MccTelemetryErrorCode::ERROR_OK;
};
@@ -741,4 +775,5 @@ protected:
static_assert(mcc_telemetry_c<MccTelemetry>, "");
} // namespace mcc