...
This commit is contained in:
@@ -104,7 +104,7 @@ public:
|
||||
|
||||
typedef std::error_code error_t;
|
||||
|
||||
MccMountTelemetryAstromTransform(astrom_engine_t& astrom_engine, pec_t& pec)
|
||||
MccMountTelemetryAstromTransform(astrom_engine_t* astrom_engine, pec_t* pec)
|
||||
: _astromEngine(astrom_engine), _pec(pec)
|
||||
{
|
||||
}
|
||||
@@ -166,9 +166,9 @@ public:
|
||||
typename pec_t::error_t pec_err;
|
||||
|
||||
auto get_jd_lst_eo = [&time_point, this](jd_t& jd, sideral_time_t& lst, eo_t& eo) {
|
||||
auto ast_err = _astromEngine.greg2jul(time_point, jd);
|
||||
auto ast_err = _astromEngine->greg2jul(time_point, jd);
|
||||
if (!ast_err) {
|
||||
ast_err = _astromEngine.apparentSiderTime(jd, lst, true);
|
||||
ast_err = _astromEngine->apparentSiderTime(jd, lst, true);
|
||||
|
||||
if (!ast_err) {
|
||||
ast_err = _astromEngine->eqOrigins(jd, eo);
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
|
||||
if (coord.coordPairKind == MccCoordPairKind::COORDS_KIND_XY) { // from encoder's
|
||||
typename pec_t::pec_result_t pec_res;
|
||||
pec_err = _pec.compute(coord.x, coord.y, pec_res);
|
||||
pec_err = _pec->compute(coord.x, coord.y, pec_res);
|
||||
if (!pec_err) {
|
||||
X_app = coord.x + pec_res.dx;
|
||||
Y_app = coord.y + pec_res.dy;
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
Y_app = coord.y;
|
||||
XX_app = HA;
|
||||
} else if constexpr (altAzMount) {
|
||||
ast_err = _astromEngine.hadec2azalt(HA, coord.y, X_app, Y_app);
|
||||
ast_err = _astromEngine->hadec2azalt(HA, coord.y, X_app, Y_app);
|
||||
} else {
|
||||
static_assert(false, "UNSUPPORTED MOUNT TYPE!");
|
||||
}
|
||||
@@ -217,15 +217,15 @@ public:
|
||||
Y_app = coord.y;
|
||||
XX_app = lst - coord.x + eo;
|
||||
} else if constexpr (altAzMount) {
|
||||
ast_err = _astromEngine.hadec2azalt(coord.x, coord.y, X_app, Y_app);
|
||||
ast_err = _astromEngine->hadec2azalt(coord.x, coord.y, X_app, Y_app);
|
||||
} else {
|
||||
static_assert(false, "UNSUPPORTED MOUNT TYPE!");
|
||||
}
|
||||
}
|
||||
} else if (coord.coordPairKind == MccCoordPairKind::COORDS_KIND_AZALT) { // from app AZ-ALT
|
||||
if constexpr (equatorialMount) {
|
||||
ast_err = _astromEngine.azalt2hadec(coord.x, coord.y, X_app, Y_app); // compute HA-DEC
|
||||
if (!ast_err) { // compute CIO RA (as XX_app)
|
||||
ast_err = _astromEngine->azalt2hadec(coord.x, coord.y, X_app, Y_app); // compute HA-DEC
|
||||
if (!ast_err) { // compute CIO RA (as XX_app)
|
||||
coord.coordPairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP;
|
||||
coord.x = X_app;
|
||||
coord.y = Y_app;
|
||||
@@ -250,9 +250,9 @@ public:
|
||||
// for alt-azimuthal mount:
|
||||
// X_app = AZ, Y_app = ALT
|
||||
|
||||
ast_err = _astromEngine.greg2jul(time_point, jd);
|
||||
ast_err = _astromEngine->greg2jul(time_point, jd);
|
||||
if (!ast_err) {
|
||||
ast_err = _astromEngine.icrs2obs(coord.x, coord.y, jd, X_app, Y_app, XX_app, az, alt, eo);
|
||||
ast_err = _astromEngine->icrs2obs(coord.x, coord.y, jd, X_app, Y_app, XX_app, az, alt, eo);
|
||||
|
||||
if (!ast_err) {
|
||||
if constexpr (equatorialMount) {
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
|
||||
if (coord.coordPairKind == MccCoordPairKind::COORDS_KIND_XY) { // from encoder's
|
||||
typename pec_t::pec_result_t pec_res;
|
||||
pec_err = _pec.compute(coord.x, coord.y, pec_res);
|
||||
pec_err = _pec->compute(coord.x, coord.y, pec_res);
|
||||
if (!pec_err) {
|
||||
coord.x += pec_res.dx;
|
||||
coord.y += pec_res.dy;
|
||||
@@ -332,9 +332,9 @@ public:
|
||||
if (coord.coordPairKind != MccCoordPairKind::COORDS_KIND_RADEC_ICRS) {
|
||||
typename astrom_engine_t::jd_t jd;
|
||||
|
||||
ast_err = _astromEngine.greg2jul(astrom_engine_t::timePointNow(), jd);
|
||||
ast_err = _astromEngine->greg2jul(astrom_engine_t::timePointNow(), jd);
|
||||
if (!ast_err) {
|
||||
ast_err = _astromEngine.obs2icrs(coord.coordPairKind, coord.x, coord.y, jd, RA, DEC);
|
||||
ast_err = _astromEngine->obs2icrs(coord.coordPairKind, coord.x, coord.y, jd, RA, DEC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,9 +371,9 @@ public:
|
||||
sideral_time_t lst;
|
||||
|
||||
auto get_jd_lst_eo = [&time_point, this](jd_t& jd, sideral_time_t& lst, eo_t& eo) {
|
||||
auto ast_err = _astromEngine.greg2jul(time_point, jd);
|
||||
auto ast_err = _astromEngine->greg2jul(time_point, jd);
|
||||
if (!ast_err) {
|
||||
ast_err = _astromEngine.apparentSiderTime(jd, lst, true);
|
||||
ast_err = _astromEngine->apparentSiderTime(jd, lst, true);
|
||||
|
||||
if (!ast_err) {
|
||||
ast_err = _astromEngine->eqOrigins(jd, eo);
|
||||
@@ -404,7 +404,7 @@ public:
|
||||
if constexpr (equatorialMount) {
|
||||
typename pec_t::pec_result_t pec_res;
|
||||
|
||||
pec_err = _pec.compute(coord.x, coord.y, pec_res);
|
||||
pec_err = _pec->compute(coord.x, coord.y, pec_res);
|
||||
if (!pec_err) {
|
||||
X = coord.x - pec_res.dx;
|
||||
Y = coord.y - pec_res.dy;
|
||||
@@ -413,7 +413,7 @@ public:
|
||||
}
|
||||
} else if constexpr (altAzMount) {
|
||||
coord_t az, alt;
|
||||
ast_err = _astromEngine.hadec2azalt(coord.x, coord.y, az, alt);
|
||||
ast_err = _astromEngine->hadec2azalt(coord.x, coord.y, az, alt);
|
||||
if (!ast_err) {
|
||||
coord.coordPairKind == MccCoordPairKind::COORDS_KIND_AZALT;
|
||||
coord.x = az;
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
} else if (coord.coordPairKind == MccCoordPairKind::COORDS_KIND_AZALT) { // from app AZ-ALT
|
||||
if constexpr (equatorialMount) {
|
||||
coord_t ha, dec;
|
||||
ast_err = _astromEngine.azalt2hadec(coord.x, coord.y, ha, dec);
|
||||
ast_err = _astromEngine->azalt2hadec(coord.x, coord.y, ha, dec);
|
||||
if (!ast_err) {
|
||||
coord.coordPairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP;
|
||||
coord.x = ha;
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
} else if constexpr (altAzMount) {
|
||||
typename pec_t::pec_result_t pec_res;
|
||||
|
||||
pec_err = _pec.compute(coord.x, coord.y, pec_res);
|
||||
pec_err = _pec->compute(coord.x, coord.y, pec_res);
|
||||
if (!pec_err) {
|
||||
X = coord.x - pec_res.dx;
|
||||
Y = coord.y - pec_res.dy;
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
coord_t ra, dec, ha, az, alt;
|
||||
eo_t eo;
|
||||
|
||||
ast_err = _astromEngine.greg2jul(time_point, jd);
|
||||
ast_err = _astromEngine->greg2jul(time_point, jd);
|
||||
if (!ast_err) {
|
||||
ast_err = icrs2obs(coord.x, coord.y, jd, ra, dec, ha, az, alt, eo);
|
||||
if (!ast_err) {
|
||||
@@ -499,8 +499,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
astrom_engine_t& _astromEngine;
|
||||
pec_t& _pec;
|
||||
astrom_engine_t* _astromEngine;
|
||||
pec_t* _pec;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user