This commit is contained in:
Timur A. Fatkhullin
2025-08-19 00:23:31 +03:00
parent 3640882874
commit da46ab3e3b
5 changed files with 326 additions and 33 deletions

View File

@@ -21,6 +21,46 @@ namespace mcc
// mount construction type (only the most common ones)
enum class MccMountType : uint8_t { GERMAN_TYPE, FORK_TYPE, CROSSAXIS_TYPE, ALTAZ_TYPE };
template <MccMountType TYPE>
static constexpr std::string_view MccMountTypeStr = TYPE == MccMountType::GERMAN_TYPE ? "GERMAN"
: TYPE == MccMountType::FORK_TYPE ? "FORK"
: TYPE == MccMountType::CROSSAXIS_TYPE ? "CROSSAXIS"
: TYPE == MccMountType::ALTAZ_TYPE ? "ALTAZ"
: "UNKNOWN";
template <MccMountType TYPE>
static constexpr bool mcc_is_equatorial_mount = TYPE == MccMountType::GERMAN_TYPE ? true
: TYPE == MccMountType::FORK_TYPE ? true
: TYPE == MccMountType::CROSSAXIS_TYPE ? true
: TYPE == MccMountType::ALTAZ_TYPE ? false
: false;
template <MccMountType TYPE>
static constexpr bool mcc_is_altaz_mount = TYPE == MccMountType::GERMAN_TYPE ? false
: TYPE == MccMountType::FORK_TYPE ? false
: TYPE == MccMountType::CROSSAXIS_TYPE ? false
: TYPE == MccMountType::ALTAZ_TYPE ? true
: false;
static consteval bool mccIsEquatorialMount(const MccMountType type)
{
return type == MccMountType::GERMAN_TYPE ? true
: type == MccMountType::FORK_TYPE ? true
: type == MccMountType::CROSSAXIS_TYPE ? true
: type == MccMountType::ALTAZ_TYPE ? false
: false;
};
static consteval bool mccIsAltAzMount(const MccMountType type)
{
return type == MccMountType::GERMAN_TYPE ? false
: type == MccMountType::FORK_TYPE ? false
: type == MccMountType::CROSSAXIS_TYPE ? false
: type == MccMountType::ALTAZ_TYPE ? true
: false;
};
// enum MccCoordPairKind : size_t {
// COORDS_KIND_GENERIC,
// COORDS_KIND_RADEC_ICRS,
@@ -68,6 +108,8 @@ concept mcc_time_point_c = requires(T t) { []<typename CT, typename DT>(std::chr
template <typename T>
concept mcc_julday_c = mcc_fp_type_like_c<T> && requires(const T v) {
// modified Julian Day
{ v.MJD() } -> std::convertible_to<double>;
// comparison operators
v <=> v;
};
@@ -145,7 +187,7 @@ struct mcc_CCTE_interface_t {
return std::forward<SelfT>(self).transformCoordinates(std::move(from_pt), to_pt);
}
// NOTE: ASSUMING THE AZINUTH IS COUNTED FROM THE SOUTH THROUGH THE WEST!!!
// NOTE: ASSUMING THE AZIMUTH IS COUNTED FROM THE SOUTH THROUGH THE WEST!!!
template <std::derived_from<mcc_CCTE_interface_t> SelfT>
RetT transformCoordinates(this SelfT&& self, mcc_celestial_point_c auto from_pt, mcc_eqt_hrz_coord_c auto* to_pt)
{
@@ -275,7 +317,7 @@ concept mcc_hardware_c = requires(T t, const T t_const) {
// a class that contains at least time point of measurement, coordinates for x,y axes and its moving rates
requires requires(typename T::axes_pos_t pos) {
requires mcc_time_point_c<typename T::time_point_t>; // time point
requires mcc_time_point_c<decltype(pos.time_point)>; // time point
requires mcc_angle_c<decltype(pos.X)>; // target or current co-longitude coordinate
requires mcc_angle_c<decltype(pos.Y)>; // target or current co-latitude coordinate