MccGenericNetworkServer: fix client session thread pool behavior in

destructor
This commit is contained in:
2025-11-27 09:20:42 +03:00
parent 43638f383f
commit a825a6935b
2 changed files with 51 additions and 7 deletions

View File

@@ -106,6 +106,9 @@ AsibFM700ServoController::error_t AsibFM700ServoController::hardwareInit()
AsibFM700ServoController::error_t AsibFM700ServoController::hardwareSetState(hardware_state_t state)
{
static thread_local coordval_pair_t cvalpair{.X{0.0, 0.0}, .Y{0.0, 0.0}};
static thread_local coordpair_t cpair{.X = 0.0, .Y = 0.0};
// time point from sidservo library is 'double' number represented UNIXTIME with
// microseconds/nanoseconds precision
double tp = std::chrono::duration<double>(state.time_point.time_since_epoch()).count();
@@ -113,9 +116,16 @@ AsibFM700ServoController::error_t AsibFM700ServoController::hardwareSetState(har
std::lock_guard lock{*_setStateMutex};
// according to"SiTech protocol notes" X is DEC-axis and Y is HA-axis
coordval_pair_t cvalpair{.X{.val = state.Y, .t = tp}, .Y{.val = state.X, .t = tp}};
coordpair_t cpair{.X = state.Y, .Y = state.X};
// coordpair_t cpair{.X = state.Y, .Y = state.X + mcc::MccAngle(1.0_degs)};
// coordval_pair_t cvalpair{.X{.val = state.Y, .t = tp}, .Y{.val = state.X, .t = tp}};
// coordpair_t cpair{.X = state.Y, .Y = state.X};
// coordpair_t cpair{.X = state.Y + mcc::MccAngle(1.0_degs), .Y = state.X + mcc::MccAngle(1.0_degs)};
cvalpair.X = {.val = state.Y, .t = tp};
cvalpair.Y = {.val = state.X, .t = tp};
cpair.X = state.Y;
cpair.Y = state.X;
// correctTo is asynchronous function!!!
//