This commit is contained in:
Timur A. Fatkhullin
2025-11-18 22:36:08 +03:00
parent 273f239abb
commit c6b47d8ad6
4 changed files with 32 additions and 39 deletions

View File

@@ -281,6 +281,7 @@ public:
ccte_err = controls->juldayToAppSideral(_data.JD, &_data.LST, true);
if (!ccte_err) {
ccte_err = controls->equationOrigins(_data.JD, &eo);
_data.EO = eo;
}
}
@@ -311,7 +312,8 @@ public:
if constexpr (mccIsEquatorialMount(pcm_t::mountType)) {
_data.RA_APP =
MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
MccAngle((double)_data.LST - (double)_data.HA - eo).normalize<MccAngle::NORM_KIND_0_360>();
// MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
_data.X = _data.HA;
_data.Y = _data.DEC_APP;
@@ -338,7 +340,8 @@ public:
_data.HA = pt.X;
_data.DEC_APP = pt.Y;
_data.RA_APP =
MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
MccAngle((double)_data.LST - (double)_data.HA - eo).normalize<MccAngle::NORM_KIND_0_360>();
// MccAngle((double)_data.LST - (double)_data.HA + eo).normalize<MccAngle::NORM_KIND_0_360>();
}
} else {
@@ -388,35 +391,6 @@ public:
return MccTelemetryErrorCode::ERROR_OK;
};
// arm internal update loop
// _internalUpdatingStopSource = std::stop_source{};
// _internalUpdatingLoopFuture = std::async(
// std::launch::async,
// [this](std::stop_token stoken) {
// while (!(*_internalUpdatingLoopStop)) {
// {
// std::unique_lock ulock(*_internalUpdatingLoopMutex);
// _internalUpdatingLoopCondVar->wait(ulock, [this]() -> bool { return *_dataUpdatingRequested;
// });
// }
// {
// std::lock_guard lock_update(*_updateMutex);
// *_isDataUpdated = false;
// _lastUpdateError = _updateFunc(stoken);
// }
// *_isDataUpdated = true;
// // unlock all waiting threads
// _updateCondVar->notify_all();
// }
// },
// _internalUpdatingStopSource.get_token());
}
@@ -429,8 +403,6 @@ public:
virtual ~MccTelemetry()
{
*_internalUpdatingLoopStop = true;
stopInternalTelemetryDataUpdating();
if (_internalUpdatingFuture.valid()) {
@@ -747,11 +719,11 @@ protected:
std::unique_ptr<std::mutex> _updateMutex;
std::unique_ptr<std::condition_variable> _updateCondVar;
std::future<void> _internalUpdatingLoopFuture{};
std::unique_ptr<std::mutex> _internalUpdatingLoopMutex{new std::mutex()};
std::unique_ptr<std::condition_variable> _internalUpdatingLoopCondVar{new std::condition_variable()};
std::unique_ptr<std::atomic_bool> _internalUpdatingLoopStop{new std::atomic_bool{false}};
std::unique_ptr<std::atomic_bool> _dataUpdatingRequested{new std::atomic_bool{false}};
// std::future<void> _internalUpdatingLoopFuture{};
// std::unique_ptr<std::mutex> _internalUpdatingLoopMutex{new std::mutex()};
// std::unique_ptr<std::condition_variable> _internalUpdatingLoopCondVar{new std::condition_variable()};
// std::unique_ptr<std::atomic_bool> _internalUpdatingLoopStop{new std::atomic_bool{false}};
// std::unique_ptr<std::atomic_bool> _dataUpdatingRequested{new std::atomic_bool{false}};
error_t _lastUpdateError{MccTelemetryErrorCode::ERROR_OK};
};