...
This commit is contained in:
@@ -589,8 +589,8 @@ static constexpr MccCoordPairKind MccCoordStrToPairKind(R&& spair)
|
||||
return hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_RADEC_ICRS_STR) ? MccCoordPairKind::COORDS_KIND_RADEC_ICRS
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_RADEC_APP_STR) ? MccCoordPairKind::COORDS_KIND_RADEC_APP
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_HADEC_APP_STR) ? MccCoordPairKind::COORDS_KIND_HADEC_APP
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_AZALT_STR) ? MccCoordPairKind::COORDS_KIND_AZZD
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_AZZD_STR) ? MccCoordPairKind::COORDS_KIND_AZALT
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_AZALT_STR) ? MccCoordPairKind::COORDS_KIND_AZALT
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_AZZD_STR) ? MccCoordPairKind::COORDS_KIND_AZZD
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_XY_STR) ? MccCoordPairKind::COORDS_KIND_XY
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_LATLON_STR) ? MccCoordPairKind::COORDS_KIND_LATLON
|
||||
: hash == mcc::utils::FNV1aHash(MCC_COORDPAIR_KIND_GENERIC_STR) ? MccCoordPairKind::COORDS_KIND_GENERIC
|
||||
|
||||
@@ -1026,7 +1026,7 @@ protected:
|
||||
err = coordsFromTelemetryData(*mount_ptr, true, cp);
|
||||
if (!err) {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_TARGET_STR,
|
||||
cp);
|
||||
_coordFormat, _coordPrec, cp);
|
||||
}
|
||||
} else { // invalid command!!!
|
||||
err = vp.error();
|
||||
@@ -1050,7 +1050,8 @@ protected:
|
||||
cp.pair_kind = vp.value();
|
||||
err = coordsFromTelemetryData(*mount_ptr, false, cp);
|
||||
if (!err) {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_MOUNT_STR, cp);
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_MOUNT_STR,
|
||||
_coordFormat, _coordPrec, cp);
|
||||
}
|
||||
} else { // invalid command!!!
|
||||
err = vp.error();
|
||||
|
||||
@@ -411,7 +411,7 @@ protected:
|
||||
|
||||
sr(value, bytes);
|
||||
} else if constexpr (mcc_celestial_point_c<T>) {
|
||||
MccCelestialPointSerializer sr;
|
||||
static MccCelestialPointSerializer sr;
|
||||
|
||||
sr.setDelimiter(MCC_COMMPROTO_RANGEPARAM_DELIM_SEQ);
|
||||
sr.setFormat(_coordFmt);
|
||||
@@ -779,7 +779,8 @@ protected:
|
||||
{
|
||||
if constexpr (std::derived_from<std::remove_cvref_t<SerFuncT>, DefaultSerializer>) {
|
||||
if constexpr (std::same_as<T, MccCoordinateSerializer::SerializedCoordFormat>) {
|
||||
_defaultSerializer._coordFmt = par;
|
||||
// _defaultSerializer._coordFmt = par;
|
||||
ser_func._coordFmt = par;
|
||||
} else if constexpr (std::same_as<T, MccCoordinateSerializer::SexagesimalCoordPrec>) {
|
||||
_defaultSerializer._coordPrec = par;
|
||||
} else {
|
||||
|
||||
@@ -521,12 +521,15 @@ public:
|
||||
{
|
||||
using intv_t = std::remove_cvref_t<decltype(_currentUpdateInterval)>;
|
||||
|
||||
_internalUpdatingStopSource = std::stop_source{}; // reset state
|
||||
|
||||
*_internalUpdating = true;
|
||||
|
||||
_internalUpdatingFuture = std::async(
|
||||
std::launch::async,
|
||||
[this](std::stop_token stop_token) -> error_t {
|
||||
while (!stop_token.stop_requested()) {
|
||||
// while (!stop_token.stop_requested()) {
|
||||
while (true) {
|
||||
_lastUpdateError = updateTelemetryData(defaultInternalUpdateTimeout);
|
||||
if (_lastUpdateError) {
|
||||
*_internalUpdating = false;
|
||||
@@ -593,7 +596,9 @@ public:
|
||||
|
||||
*_isDataUpdated = false;
|
||||
|
||||
std::future<error_t> update_ft = std::async(std::launch::async, _updateFunc, stop_source.get_token());
|
||||
// std::future<error_t> update_ft = std::async(std::launch::async, _updateFunc, stop_source.get_token());
|
||||
std::future<error_t> update_ft =
|
||||
std::async(std::launch::async, _updateFunc, _internalUpdatingStopSource.get_token());
|
||||
auto status = update_ft.wait_for(timeout);
|
||||
|
||||
if (status == std::future_status::ready) {
|
||||
|
||||
Reference in New Issue
Block a user