...
This commit is contained in:
@@ -14,7 +14,12 @@
|
||||
namespace mcc
|
||||
{
|
||||
|
||||
enum class MccDefaultPCMErrorCode : int { ERROR_OK, ERROR_INVALID_INPUTS_BISPLEV, ERROR_EXCEED_MAX_ITERS };
|
||||
enum class MccDefaultPCMErrorCode : int {
|
||||
ERROR_OK,
|
||||
ERROR_INVALID_INPUTS_BISPLEV,
|
||||
ERROR_EXCEED_MAX_ITERS,
|
||||
ERROR_NULLPTR
|
||||
};
|
||||
|
||||
/* error category definition */
|
||||
|
||||
@@ -38,6 +43,8 @@ struct MccDefaultPCMCategory : public std::error_category {
|
||||
return "invalid input arguments for bispev";
|
||||
case MccDefaultPCMErrorCode::ERROR_EXCEED_MAX_ITERS:
|
||||
return "exceed maximum of iterations number";
|
||||
case MccDefaultPCMErrorCode::ERROR_NULLPTR:
|
||||
return "nullptr input argument";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
@@ -183,10 +190,18 @@ public:
|
||||
error_t computePCM(mcc_celestial_point_c auto pt, mcc_PCM_c auto* res, T* app_pt = nullptr)
|
||||
requires(mcc_celestial_point_c<T> || mcc_eqt_hrz_coord_c<T> || std::same_as<T, std::nullptr_t>)
|
||||
{
|
||||
if (res == nullptr) {
|
||||
return MccDefaultPCMErrorCode::ERROR_NULLPTR;
|
||||
}
|
||||
|
||||
std::lock_guard lock(*_pcmDataMutex);
|
||||
|
||||
res->pcmX = 0.0;
|
||||
res->pcmY = 0.0;
|
||||
|
||||
if constexpr (mcc_is_equatorial_mount<MOUNT_TYPE>) { // equatorial
|
||||
if (_pcmData.type == MccDefaultPCMType::PCM_TYPE_GEOMETRY) {
|
||||
if (_pcmData.type == MccDefaultPCMType::PCM_TYPE_GEOMETRY ||
|
||||
_pcmData.type == MccDefaultPCMType::PCM_TYPE_GEOMETRY_BSPLINE) {
|
||||
const auto cosPhi = std::cos(_pcmData.siteLatitude);
|
||||
const auto sinPhi = std::sin(_pcmData.siteLatitude);
|
||||
const auto tanY = std::tan(pt.Y);
|
||||
|
||||
Reference in New Issue
Block a user