rename FSGGloveTrackingSettings::GloveConnectivityCheckInterval to FSGGloveTrackingSettings::DataRetrievalRefreshRate

This commit is contained in:
Mamadou Babaei
2025-11-18 03:19:26 +01:00
parent 57fc62a1dc
commit c7a92d9bd3
6 changed files with 20 additions and 18 deletions
+1
View File
@@ -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
@@ -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).
@@ -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)
{
}
@@ -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);
};
@@ -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
{