This commit is contained in:
2025-07-15 17:32:48 +03:00
parent 62258a991b
commit 46e4b1e95f
8 changed files with 383 additions and 226 deletions

View File

@@ -16,22 +16,6 @@ namespace mcc
{
// namespace traits
// {
// template <typename T, typename XT, typename YT>
// concept mcc_mount_pec_c = requires(T t, const T t_const, XT x, YT y) {
// typename T::pec_data_t;
// typename T::pec_result_t;
// { t.setData(std::declval<typename T::pec_data_t>()) };
// { t_const.getData() } -> std::same_as<typename T::pec_data_t>;
// { t.compute(std::declval<const XT&>(), std::declval<const YT&>()) } -> std::same_as<typename T::pec_result_t>;
// };
// } // namespace traits
// type of PEC corrections (algorithm used):
// PEC_TYPE_GEOMETRY - "classic" geometry-based correction coefficients
// PEC_TYPE_GEOMETRY_BSPLINE - previous one and additional 2D B-spline corrections
@@ -39,7 +23,7 @@ namespace mcc
enum class MccMountDefaultPECType { PEC_TYPE_GEOMETRY, PEC_TYPE_GEOMETRY_BSPLINE, PEC_TYPE_BSPLINE };
template <MccMountType MOUNT_TYPE>
class MccMountDefaultPEC
class MccMountDefaultPEC final
{
public:
static constexpr MccMountType mountType = MOUNT_TYPE;
@@ -47,7 +31,7 @@ public:
typedef MccAngle coord_t;
struct pec_result_t {
MccAngle dx, dy;
coord_t dx, dy;
};
// "classic" geometric PEC coefficients
@@ -161,8 +145,11 @@ public:
res.dy = _geomCoeffs.zeroPointY + _geomCoeffs.misalignErr1 * sinX + _geomCoeffs.misalignErr2 * cosX +
_geomCoeffs.tubeFlexure * (cosPhi * cosX * std::sin(y) - sinPhi * cosY);
if (!utils::isEqual(cosX, 0.0)) {
res.dy += _geomCoeffs.forkFlexure / cosX;
if constexpr (mountType == MccMountType::FORK_TYPE) {
if (!utils::isEqual(cosX, 0.0)) {
res.dy += _geomCoeffs.forkFlexure / cosX;
}
}
}
@@ -212,4 +199,8 @@ private:
mutable std::mutex _pecDataMutex;
};
typedef MccMountDefaultPEC<MccMountType::ALTAZ_TYPE> MccMountDefaultAltAzPec;
typedef MccMountDefaultPEC<MccMountType::FORK_TYPE> MccMountDefaultForkPec;
} // namespace mcc