Compare commits

..

4 Commits

Author SHA1 Message Date
Timur A. Fatkhullin
c174021c40 ... 2026-02-16 22:44:29 +03:00
Timur A. Fatkhullin
7b110fb7ff ... 2026-02-16 22:19:48 +03:00
Timur A. Fatkhullin
dff70225ef ... 2026-02-16 22:00:08 +03:00
Timur A. Fatkhullin
452bd1c3e4 ... 2026-02-16 21:48:22 +03:00
4 changed files with 24 additions and 15 deletions

View File

@@ -219,6 +219,14 @@ protected:
public: public:
PathFile(const std::string& filename = "") : _filename(filename), _st() {} PathFile(const std::string& filename = "") : _filename(filename), _st() {}
PathFile(const PathFile&) = delete;
PathFile(PathFile&&) = default;
~PathFile()
{
save();
}
void setFilename(const std::string& filename) void setFilename(const std::string& filename)
{ {
_filename = filename; _filename = filename;
@@ -229,11 +237,6 @@ protected:
return _filename; return _filename;
} }
~PathFile()
{
save();
}
friend PathFile& operator<<(PathFile& pf, auto&& v) friend PathFile& operator<<(PathFile& pf, auto&& v)
{ {
pf._st << std::forward<decltype(v)>(v); pf._st << std::forward<decltype(v)>(v);
@@ -715,6 +718,10 @@ public:
}; };
} }
virtual ~MccSimpleMovementControls() = default;
MccSimpleMovementControls(const MccSimpleMovementControls&) = delete;
MccSimpleMovementControls(MccSimpleMovementControls&&) = default;
error_t slewToTarget(bool slew_and_stop = false) error_t slewToTarget(bool slew_and_stop = false)
{ {

View File

@@ -293,7 +293,7 @@ public:
// to be computed as observed celestial X and Y cordinate according to mount type (HA-DEC or AZ-ZD) // to be computed as observed celestial X and Y cordinate according to mount type (HA-DEC or AZ-ZD)
double x, y; double x, y;
auto getXY = [&, this](auto& cp) { auto getXY = [&, this](auto& cp) -> error_t {
auto err = obs_skycoord.toAtSameEpoch(cp); auto err = obs_skycoord.toAtSameEpoch(cp);
if (err) { if (err) {
return mcc_deduced_err(err, MccDefaultPCMErrorCode::ERROR_CCTE); return mcc_deduced_err(err, MccDefaultPCMErrorCode::ERROR_CCTE);

View File

@@ -149,7 +149,7 @@ public:
return _inZoneFunc.size(); return _inZoneFunc.size();
} }
void clearZones() void clearPZones()
{ {
_inZoneFunc.clear(); _inZoneFunc.clear();
_timeToZoneFunc.clear(); _timeToZoneFunc.clear();

View File

@@ -104,12 +104,12 @@ inline std::error_code make_error_code(MccTelemetryErrorCode ec)
template <mcc_hardware_c HARDWARE_T> template <mcc_hardware_c HARDWARE_T>
class MccTelemetry class MccTelemetry : public mcc_telemetry_interface_t<MccError>
{ {
public: public:
typedef HARDWARE_T hardware_t; typedef HARDWARE_T hardware_t;
typedef std::error_code error_t; typedef MccError error_t;
struct telemetry_data_t { struct telemetry_data_t {
@@ -265,11 +265,12 @@ public:
// calculate reverse PCM corrections for the current target position and // calculate reverse PCM corrections for the current target position and
// its encoder XY // its encoder XY
auto pcm_err = pcm_ptr->pcmReverseCorrection( auto pcm_err = pcm_ptr->computeInversePCM(_tdataPtr->targetPos,
_tdataPtr->targetPos, &_tdataPtr->pcmReverseCorrection, &_tdataPtr->pcmReverseCorrection,
&_tdataPtr->targetXY); &_tdataPtr->targetXY);
if (pcm_err) { if (pcm_err) {
return mcc_deduced_err(pcm_err, MccTelemetryErrorCode::ERROR_PCM_COMP); _lastUpdateError =
mcc_deduced_err(pcm_err, MccTelemetryErrorCode::ERROR_PCM_COMP);
} }
} }
} }
@@ -361,9 +362,10 @@ public:
// //
// Set a timeout for the telemetry receiving process // Set a timeout for the telemetry receiving process
// //
void setTelemetryDataTimeout(traits::mcc_time_duration_c auto const& timeout) template <traits::mcc_time_duration_c DT>
void setTelemetryDataTimeout(DT const& timeout)
{ {
if constexpr (std::floating_point<typename decltype(timeout)::rep>) { if constexpr (std::floating_point<typename DT::rep>) {
if (utils::isEqual(timeout.count(), 0.0) || timeout.count() < 0.0) { if (utils::isEqual(timeout.count(), 0.0) || timeout.count() < 0.0) {
return; return;
} }