This commit is contained in:
2025-12-16 17:53:50 +03:00
parent d417c03f59
commit b12c0ec521
2 changed files with 42 additions and 12 deletions

View File

@@ -142,6 +142,10 @@ class MccSimpleMovingControls
return false;
}
if (_st.str().empty()) { // nothing to save
return true;
}
fst.open(_filename);
if (!fst.is_open()) {
@@ -164,6 +168,8 @@ class MccSimpleMovingControls
public:
typedef std::error_code error_t;
typedef MccSimpleMovingModelParams moving_params_t;
enum Mode { MOVING_MODE_SLEW, MOVING_MODE_TRACK, MOVING_MODE_ERROR };
// typedef std::CallbackFuncTion<void(Mode mode)> mode_switch_callback_t;
@@ -769,7 +775,7 @@ public:
return *_lastError;
}
error_t setMovingParams(MccSimpleMovingModelParams params)
error_t setMovingParams(moving_params_t params)
{
std::lock_guard lock{*_currentParamsMutex};
@@ -778,7 +784,7 @@ public:
return MccSimpleMovingControlsErrorCode::ERROR_OK;
}
MccSimpleMovingModelParams getMovingParams() const
moving_params_t getMovingParams() const
{
std::lock_guard lock{*_currentParamsMutex};
@@ -798,7 +804,7 @@ protected:
std::unique_ptr<std::atomic_bool> _stopMoving;
std::unique_ptr<std::mutex> _currentParamsMutex;
MccSimpleMovingModelParams _currentParams{};
moving_params_t _currentParams{};
std::unique_ptr<std::atomic<error_t>> _lastError;