This commit is contained in:
2025-03-12 17:43:17 +03:00
parent a5bdf87a9b
commit 9e70ace4b7
4 changed files with 156 additions and 44 deletions

View File

@@ -10,6 +10,7 @@
#include <string_view>
#include "spdlog/sinks/null_sink.h"
#include "mount_astrom.h"
// low-level functions
namespace lowlevel
@@ -35,6 +36,60 @@ concept mcc_mount_state_c = requires(T t, const T t_const) {
};
class MccMountPosition
{
public:
typedef double mnt_coord_t;
typedef double mnt_speed_t;
typedef double time_point_t;
// time-related
std::chrono::system_clock::time_point utc;
time_point_t mjd; // modified Julian date
time_point_t ut1;
time_point_t tt;
time_point_t siderTime; // sideral time (in radians)
// apparent target (user-input) current coordinates (in radians)
mnt_coord_t tagRA, tagDEC;
mnt_coord_t tagHA;
mnt_coord_t tagAZ, tagZD;
// encoder-measured current mount coordinates (in radians)
mnt_coord_t mntRA, mntDEC;
mnt_coord_t mntHA;
mnt_coord_t mntAZ, mntZD;
// encoder-measured current mount moving speed (in radians/s)
mnt_speed_t mntSpeedX,
mntSpeedY; // X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ZD for horizontal-type one
// current refraction coefficient
mnt_coord_t currRefr;
// PCS (pointing correction system) corrections
mnt_coord_t pcsX, pcsY; // X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ZD for horizontal-type one
bool update(const std::chrono::system_clock::time_point& utc_time)
{
//
astro::mcc_julday(utc_time, mjd);
return true;
}
protected:
bool updateTime(const std::chrono::system_clock::time_point& utc_time)
{
// UTC to TAI
double tai;
return true;
}
};
// implements a Finite State Machine Pattern
template <MccMountType MOUNT_TYPE>