...
This commit is contained in:
@@ -13,9 +13,95 @@ namespace mcc
|
||||
{
|
||||
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
/* enhanced telemetry data concept */
|
||||
/* in general it correspond to definitions used in astrometry engine (see its concept) */
|
||||
|
||||
template <typename T, typename ASTROM_ENGINE_T, typename PEC_T>
|
||||
concept mcc_mount_telemetry_enh_data_c = mcc_mount_telemetry_data_c<T> && requires(T t) {
|
||||
requires traits::mcc_astrom_engine_c<ASTROM_ENGINE_T>;
|
||||
requires traits::mcc_mount_pec_c<PEC_T>;
|
||||
|
||||
// check for types definitions and its consistency
|
||||
requires std::same_as<typename T::coord_t, typename ASTROM_ENGINE_T::coord_t>;
|
||||
|
||||
requires std::same_as<typename T::time_point_t, typename ASTROM_ENGINE_T::time_point_t>;
|
||||
|
||||
requires std::same_as<typename T::juldate_t,
|
||||
typename ASTROM_ENGINE_T::juldate_t>; // a type to represent Julian date
|
||||
|
||||
requires std::same_as<typename T::sideral_time_t,
|
||||
typename ASTROM_ENGINE_T::sideral_time_t>; // a type to represent sideral time
|
||||
|
||||
requires std::same_as<typename T::pa_t,
|
||||
typename ASTROM_ENGINE_T::pa_t>; // a type to represent parallactic angle
|
||||
// typename T::eo_t; // a type to represent equation of origins
|
||||
|
||||
requires std::same_as<decltype(t.jd), typename T::juldate_t>; // Julian date
|
||||
requires std::same_as<decltype(t.siderTime), typename T::sideral_time_t>; // sideral time
|
||||
requires std::same_as<decltype(t.mntRA), typename T::pa_t>; // parallactic angle
|
||||
|
||||
// encoder-measured (non-corrected for PCS) current mount position and moving speed (in radians, radians/s)
|
||||
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
requires std::same_as<decltype(t.mntPosX), typename T::coord_t>;
|
||||
requires std::same_as<decltype(t.mntPosY), typename T::coord_t>;
|
||||
|
||||
// current refraction coefficients
|
||||
requires std::same_as<decltype(t.currRefrCoeffs), typename PEC_T::pec_result_t>;
|
||||
// current refraction correction (for mntALT)
|
||||
requires std::same_as<decltype(t.currRefr), typename T::coord_t>;
|
||||
|
||||
// PEC (pointing error correction):
|
||||
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
requires std::same_as<decltype(t.pecX), typename T::coord_t>;
|
||||
requires std::same_as<decltype(t.pecY), typename T::coord_t>;
|
||||
};
|
||||
|
||||
} // namespace traits
|
||||
|
||||
|
||||
// default generic telemetry data definition
|
||||
template <traits::mcc_astrom_engine_c ASTROM_ENGINE_T, traits::mcc_mount_pec_c PEC_T>
|
||||
struct MccMountTelemetryData {
|
||||
typedef typename ASTROM_ENGINE_T::coord_t coord_t;
|
||||
typedef typename ASTROM_ENGINE_T::time_point_t time_point_t;
|
||||
typedef typename ASTROM_ENGINE_T::juldate_t juldate_t;
|
||||
typedef typename ASTROM_ENGINE_T::sideral_time_t sideral_time_t;
|
||||
typedef typename ASTROM_ENGINE_T::pa_t pa_t;
|
||||
|
||||
// time-related
|
||||
time_point_t utc; // time point of measurements, UTC
|
||||
juldate_t jd; // Julian date
|
||||
sideral_time_t siderTime; // local apperant sideral time
|
||||
|
||||
// encoder-measured current mount coordinates
|
||||
coord_t mntRA, mntDEC;
|
||||
coord_t mntHA;
|
||||
coord_t mntAZ, mntALT;
|
||||
pa_t mntPA;
|
||||
|
||||
// encoder-measured (non-corrected for PCS) current mount position
|
||||
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
coord_t mntPosX, mntPosY;
|
||||
|
||||
// current refraction coefficients
|
||||
typename PEC_T::pec_result_t currRefrCoeffs;
|
||||
|
||||
// current refraction correction (for mntALT)
|
||||
coord_t currRefr;
|
||||
|
||||
// PEC (pointing error correction):
|
||||
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
coord_t pecX, pecY;
|
||||
};
|
||||
|
||||
template <traits::mcc_astrom_engine_c ASTROM_ENGINE_T,
|
||||
traits::mcc_mount_pec_c PEC_T,
|
||||
traits::mcc_mount_hardware_c HARDWARE_T>
|
||||
traits::mcc_mount_hardware_c HARDWARE_T,
|
||||
traits::mcc_mount_telemetry_enh_data_c<ASTROM_ENGINE_T, PEC_T> DATA_T =
|
||||
MccMountTelemetryData<ASTROM_ENGINE_T, PEC_T>>
|
||||
class MccMountTelemetry
|
||||
{
|
||||
public:
|
||||
@@ -51,42 +137,44 @@ public:
|
||||
static_assert(std::convertible_to<typename hardware_t::time_point_t, typename astrom_engine_t::time_point_t>,
|
||||
"HARDWARE TIME-POINT TYPE MUST BE CONVERTIBLE TO ASTROMETRY ENGINE ONE!");
|
||||
|
||||
typedef DATA_T mount_telemetry_data_t;
|
||||
|
||||
// mount current telemetry data: time, position and related quantities
|
||||
struct mount_telemetry_data_t {
|
||||
typedef typename astrom_engine_t::coord_t coord_t;
|
||||
// struct mount_telemetry_data_t {
|
||||
// typedef typename astrom_engine_t::coord_t coord_t;
|
||||
|
||||
// time-related
|
||||
typename astrom_engine_t::time_point_t utc; // time point of measurements, UTC
|
||||
typename astrom_engine_t::juldate_t jd; // Julian date
|
||||
typename astrom_engine_t::sideral_time_t siderTime; // local apperant sideral time
|
||||
// typename astrom_engine_t::time_point_t ut1; // Universal time
|
||||
// typename astrom_engine_t::time_point_t tt; // Terrestial time
|
||||
// // time-related
|
||||
// typename astrom_engine_t::time_point_t utc; // time point of measurements, UTC
|
||||
// typename astrom_engine_t::juldate_t jd; // Julian date
|
||||
// typename astrom_engine_t::sideral_time_t siderTime; // local apperant sideral time
|
||||
// // typename astrom_engine_t::time_point_t ut1; // Universal time
|
||||
// // typename astrom_engine_t::time_point_t tt; // Terrestial time
|
||||
|
||||
// apparent target (user-input) current coordinates (in radians)
|
||||
coord_t tagRA, tagDEC;
|
||||
coord_t tagHA;
|
||||
coord_t tagAZ, tagALT;
|
||||
coord_t tagPA; // paralactic angle
|
||||
// // apparent target (user-input) current coordinates (in radians)
|
||||
// coord_t tagRA, tagDEC;
|
||||
// coord_t tagHA;
|
||||
// coord_t tagAZ, tagALT;
|
||||
// coord_t tagPA; // paralactic angle
|
||||
|
||||
// encoder-measured current mount coordinates (in radians)
|
||||
coord_t mntRA, mntDEC;
|
||||
coord_t mntHA;
|
||||
coord_t mntAZ, mntALT;
|
||||
typename astrom_engine_t::pa_t mntPA;
|
||||
// // encoder-measured current mount coordinates (in radians)
|
||||
// coord_t mntRA, mntDEC;
|
||||
// coord_t mntHA;
|
||||
// coord_t mntAZ, mntALT;
|
||||
// typename astrom_engine_t::pa_t mntPA;
|
||||
|
||||
// encoder-measured (non-corrected for PCS) current mount position and moving speed (in radians, radians/s)
|
||||
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
coord_t mntPosX, mntPosY;
|
||||
// // encoder-measured (non-corrected for PCS) current mount position and moving speed (in radians, radians/s)
|
||||
// // X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
// coord_t mntPosX, mntPosY;
|
||||
|
||||
// current refraction coefficients
|
||||
typename pec_t::pec_result_t currRefrCoeffs;
|
||||
// current refraction correction (for mntALT)
|
||||
coord_t currRefr;
|
||||
// // current refraction coefficients
|
||||
// typename pec_t::pec_result_t currRefrCoeffs;
|
||||
// // current refraction correction (for mntALT)
|
||||
// coord_t currRefr;
|
||||
|
||||
// PEC (pointing error correction):
|
||||
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
coord_t pecX, pecY;
|
||||
};
|
||||
// // PEC (pointing error correction):
|
||||
// // X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ALT for horizontal-type one
|
||||
// coord_t pecX, pecY;
|
||||
// };
|
||||
|
||||
MccMountTelemetry(astrom_engine_t& astrom_engine, pec_t& pec, hardware_t& hardware)
|
||||
: _astromEngine(astrom_engine), _pec(pec), _hardware(hardware)
|
||||
|
||||
Reference in New Issue
Block a user