This commit is contained in:
2025-08-27 17:55:57 +03:00
parent 9fb33e5bec
commit 45f655dc90
6 changed files with 229 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ namespace mcc
static constexpr double mcc_sideral_to_UT1_ratio = 1.002737909350795; // sideral/UT1
enum MccAltLimitPZErrorCode : int { ERROR_OK, ERROR_COORD_TRANSFROM };
enum MccAltLimitPZErrorCode : int { ERROR_OK, ERROR_NULLPTR, ERROR_COORD_TRANSFROM };
} // namespace mcc
@@ -54,6 +54,8 @@ struct MccAltLimitPZCategory : public std::error_category {
switch (err) {
case MccAltLimitPZErrorCode::ERROR_OK:
return "OK";
case MccAltLimitPZErrorCode::ERROR_NULLPTR:
return "input argument os nullptr";
case MccAltLimitPZErrorCode::ERROR_COORD_TRANSFROM:
return "coordinate transformation error";
default:
@@ -97,6 +99,10 @@ public:
_latLim(MccAltLimitPZ::pi2 - _altLimit)
{
_transformCoordinates = [ccte_engine](MccCelestialPoint from_pt, MccCelestialPoint* to_pt) -> error_t {
if (to_pt == nullptr) {
return MccAltLimitPZErrorCode::ERROR_NULLPTR;
}
auto err = ccte_engine->transformCoordinates(from_pt, to_pt);
if (!err) {
return MccAltLimitPZErrorCode::ERROR_OK;
@@ -128,6 +134,10 @@ public:
{
double alt;
if (result == nullptr) {
return MccAltLimitPZErrorCode::ERROR_NULLPTR;
}
error_t ret = MccAltLimitPZErrorCode::ERROR_OK;
if constexpr (mcc_eqt_hrz_coord_c<InputT>) {
@@ -157,6 +167,10 @@ public:
{
using res_t = std::remove_cvref_t<decltype(*res_time)>;
if (res_time == nullptr) {
return MccAltLimitPZErrorCode::ERROR_NULLPTR;
}
double ha, dec;
error_t ret = MccAltLimitPZErrorCode::ERROR_OK;
@@ -209,6 +223,10 @@ public:
{
using res_t = std::remove_cvref_t<decltype(*res_time)>;
if (res_time == nullptr) {
return MccAltLimitPZErrorCode::ERROR_NULLPTR;
}
double ha, dec;
error_t ret = MccAltLimitPZErrorCode::ERROR_OK;
@@ -266,6 +284,10 @@ public:
{
double ha, dec, az;
if (point == nullptr) {
return MccAltLimitPZErrorCode::ERROR_NULLPTR;
}
error_t ret = MccAltLimitPZErrorCode::ERROR_OK;
if constexpr (mcc_eqt_hrz_coord_c<InputT>) {