From 68000877ee099d37ca80047b3e3b0800ae55c5ac Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 9 Sep 2025 09:24:24 +0200 Subject: [PATCH] rename FSGGloveTrackingSettings::GloveConnectivityCheckInterval to FSGGloveTrackingSettings::DataRetrievalRefreshRate --- Handbook/src/appendix/changelog.md | 1 + .../tracking/glove-tracking-settings.png | 4 ++-- .../plugin-settings/tracking/glove-tracking.md | 6 +++--- .../Private/SGSettings/SGGloveTrackingSettings.cpp | 6 +++--- .../Public/SGSettings/SGGloveTrackingSettings.h | 9 +++++---- .../Private/SGTracking/SGGloveTracker.cpp | 12 ++++++------ 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Handbook/src/appendix/changelog.md b/Handbook/src/appendix/changelog.md index 8f839f5e..5b19fc7d 100644 --- a/Handbook/src/appendix/changelog.md +++ b/Handbook/src/appendix/changelog.md @@ -32,6 +32,7 @@ This minor release focuses on delivering performance improvements, made possible - Bumped the SenseGlove libraries to `v2.303.0-4a2a57376`. This release of the SenseGlove libraries disables RTTI/Exceptions for the most parts and isolates it to a minor portion of the code base, which yields noticable performance gains. Futhermore, some optiomizations are done in the multi-threaded code, such as replacing Spinlocks with Adaptive Mutexes (a hybrid Mutex/Spinlock). - As a result of SenseGlove libraries >= `v2.300.0` changing it's directory structure, the `ThirdParty` folder's directory structure has been revamped. - Renamed third-party module `SGSerialThirdPartyLibs` to `SGWjwwoodSerialThirdPartyLibs` since SenseGlove libraries >= `v2.300.0` ships a new static library named `sgserial`. Thus, to avoid confusion and naming conflicts the third-party `serial` static library is now provided by the `SGWjwwoodSerialThirdPartyLibs` module and `sgserial` is provided by the `SGSerialThirdPartyLibs` module. +- `FSGGloveTrackingSettings::GloveConnectivityCheckInterval` settings have been renamed to `FSGGloveTrackingSettings::DataRetrievalRefreshRate` for adoption other than glove connectivity use cases. ### Removed diff --git a/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking-settings.png b/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking-settings.png index e9ea5aec..81a490ce 100644 --- a/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking-settings.png +++ b/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking-settings.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:de24e6cf88e51ea60b9a1249832e5761372941f6d3234978fe37400a63437aed -size 19651 +oid sha256:6697e29a8692043d830635d157ea555f9161c5d48df630b37efb3169d2bc288a +size 15590 diff --git a/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking.md b/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking.md index 67ea8ad0..f61f631c 100644 --- a/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking.md +++ b/Handbook/src/plugin-configuration/plugin-settings/tracking/glove-tracking.md @@ -4,8 +4,8 @@ Provides the tracking settings related to SenseGlove devices. ![The Glove-tracking Settings](glove-tracking-settings.png "The Glove-tracking Settings") -## GloveConnectivityCheckInterval +## DataRetrievalRefreshRate -The interval in which the tracking module checks for glove connectivity. +The glove data retrieval refresh rate. This affects the interval in which the tracking module checks for glove connectivity and data retrieval. -The default is `16.666666f` which means `60` times per second. +The default is s `60Hz` (data retrieval operations per second). \ No newline at end of file diff --git a/Source/SenseGloveSettings/Private/SGSettings/SGGloveTrackingSettings.cpp b/Source/SenseGloveSettings/Private/SGSettings/SGGloveTrackingSettings.cpp index 230a9da0..b002ad5f 100644 --- a/Source/SenseGloveSettings/Private/SGSettings/SGGloveTrackingSettings.cpp +++ b/Source/SenseGloveSettings/Private/SGSettings/SGGloveTrackingSettings.cpp @@ -37,13 +37,13 @@ FSGGloveTrackingSettings::FSGGloveTrackingSettings() : FSGGloveTrackingSettings{ - 1000.0f / 60.0f + 60.0f } { } FSGGloveTrackingSettings::FSGGloveTrackingSettings( - const float InGloveConnectivityCheckInterval) - : GloveConnectivityCheckInterval(InGloveConnectivityCheckInterval) + const float InDataRetrievalRefreshRate) + : DataRetrievalRefreshRate(InDataRetrievalRefreshRate) { } \ No newline at end of file diff --git a/Source/SenseGloveSettings/Public/SGSettings/SGGloveTrackingSettings.h b/Source/SenseGloveSettings/Public/SGSettings/SGGloveTrackingSettings.h index 862b372d..4edea9ab 100644 --- a/Source/SenseGloveSettings/Public/SGSettings/SGGloveTrackingSettings.h +++ b/Source/SenseGloveSettings/Public/SGSettings/SGGloveTrackingSettings.h @@ -51,16 +51,17 @@ struct SENSEGLOVESETTINGS_API FSGGloveTrackingSettings public: /** - * The interval in which the tracking module checks for glove connectivity (in milliseconds). + * The glove data retrieval refresh rate. This affects the interval in which + * the tracking module checks for glove connectivity and data retrieval. * - * The default is 16.666666f which means 60 times per second. + * The default is s 60Hz (data retrieval operations per second). */ UPROPERTY(Config, EditDefaultsOnly, Category="Glove Tracking") - float GloveConnectivityCheckInterval; + float DataRetrievalRefreshRate; public: FSGGloveTrackingSettings(); explicit FSGGloveTrackingSettings( - float InGloveConnectivityCheckInterval); + float InDataRetrievalRefreshRate); }; \ No newline at end of file diff --git a/Source/SenseGloveTracking/Private/SGTracking/SGGloveTracker.cpp b/Source/SenseGloveTracking/Private/SGTracking/SGGloveTracker.cpp index 012e8f71..b142dab4 100644 --- a/Source/SenseGloveTracking/Private/SGTracking/SGGloveTracker.cpp +++ b/Source/SenseGloveTracking/Private/SGTracking/SGGloveTracker.cpp @@ -58,7 +58,7 @@ struct USGGloveTracker::FImpl { const USGSettings* Settings{USGSettings::GetInstance()}; ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!")); - return Settings->GetTrackingSettings().GloveTrackingSettings.GloveConnectivityCheckInterval * 0.001f; + return 1.0f / Settings->GetTrackingSettings().GloveTrackingSettings.DataRetrievalRefreshRate; } /************************ @@ -124,24 +124,24 @@ void USGGloveTracker::Initialize(FSubsystemCollectionBase& Collection) { SGLOG("Starting the glove connectivity check timer..."); - const float GloveConnectivityCheckInterval = FImpl::GetGloveConnectivityCheckInterval(); + const float Interval = FImpl::GetGloveConnectivityCheckInterval(); - FTimerDelegate GloveConnectivityCheckHandler; - GloveConnectivityCheckHandler.BindLambda([= SG_CAPTURE_THIS]()-> void + FTimerDelegate Handler; + Handler.BindLambda([= SG_CAPTURE_THIS]()-> void { Pimpl->UpdateGloves(); }); FTimerManager& TimerManager = World->GetTimerManager(); TimerManager.SetTimer( - Pimpl->GloveConnectivityCheckTimer, GloveConnectivityCheckHandler, GloveConnectivityCheckInterval, + Pimpl->GloveConnectivityCheckTimer, Handler, Interval, true, -1.0f); if (ensureAlwaysMsgf(TimerManager.IsTimerActive(Pimpl->GloveConnectivityCheckTimer), TEXT("GloveConnectivityCheckTimer is not active"))) { SGLOG("The glove connectivity check timer has been started successfully!"); - SGLOG("The glove connectivity timer interval is: ", GloveConnectivityCheckInterval); + SGLOG("The glove connectivity timer interval is: ", Interval); } else {