mountcontrol/cxx/mcc_mount_config.h
Timur A. Fatkhullin c7693b7fea ...
2025-07-08 00:04:29 +03:00

82 lines
2.5 KiB
C++

#pragma once
/* MOUNT CONTROL COMPONENTS LIBRARY */
#include "mcc_mount_astrom.h"
#include "mcc_mount_coord.h"
#include "mcc_mount_hardware.h"
namespace mcc
{
namespace traits
{
template <typename T>
concept mcc_mount_config_c = requires(T t) {
{ t.astromEngine() } -> traits::mcc_astrom_engine_c;
{ t.hardware() } -> traits::mcc_mount_hardware_c;
};
} // namespace traits
// meteo parameters (e.g. to compute refraction)
struct MccMountMeteo {
typedef double temp_t;
typedef double humid_t;
typedef double press_t;
temp_t temperature; // Temperature in C
humid_t humidity; // humidity in % ([0.0, 1.0])
press_t pressure; // atmospheric presure in hPa=mB
};
// mount site geographical location
struct MccMountSiteInfo {
typedef MccAngle mnt_site_coord_t;
typedef MccAngle mnt_site_elev_t;
mnt_site_coord_t latitude{"00:00:00.0"_dms}; //
mnt_site_coord_t longitude{0.0}; // positive to the East
mnt_site_elev_t elevation{0.0}; // in meters
std::string_view name{"ALL-ZERO"}; // just a human-readable name
};
// 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";
// mount configuration
template <MccMountType MOUNT_TYPE,
traits::mcc_astrom_engine_c ASTROM_ENGINE_TYPE,
traits::mcc_mount_hardware_c HARDWARE_TYPE>
struct MccMountConfig {
static constexpr MccMountType mountType = MOUNT_TYPE;
virtual ~MccMountConfig() = default;
MccMountSiteInfo siteInfo{.latitude = 0.0, .longitude = 0.0, .elevation = 0.0, .name{"ALL-ZERO"}};
MccMountMeteo ambientMeteo{.temperature = 0.0, .humidity = 0.5, .pressure = 1010.0};
// template <typename ComponentT, typename... CompCtorArgTs>
// auto update(this auto&& self, CompCtorArgTs... comp_ctor_args)
// {
// return std::forward<decltype(self)>(self).updateImpl(std::forward<CompCtorArgTs>(comp_ctor_args)...);
// }
};
} // namespace mcc