Files
Plugin/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGNovaGloveInfoKismetLibrary.h
T

150 lines
5.8 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
* Contains information on Nova's hardware, extracted from the device.
*/
#pragma once
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGNovaGloveInfoKismetLibrary.generated.h"
class USGNovaGloveInfo;
/**
* Device information extracted from a Nova Glove.
*/
UCLASS(meta=(ScriptName = "SesneGloveNovaGloveInfoKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGNovaGloveInfoKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/**
* The default constructor.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Nova | Nova Glove Info",
meta=(WorldContext="WorldContextObject"))
static USGNovaGloveInfo* MakeNovaGloveInfo(UObject* WorldContextObject);
/**
* Create a new instance of a NovaGloveInfo.
*/
UFUNCTION(BlueprintCallable, DisplayName="Make Nova Glove Info",
Category="SenseGlove | Core | Nova | Nova Glove Info", meta=(WorldContext="WorldContextObject"))
static USGNovaGloveInfo* MakeNovaGloveInfo_DI_HV_FV_SFV_bRH_IC_NOS(
UObject* WorldContextObject,
const FString& DeviceId, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, const FQuat& ImuCorrection, int32 NumberOfSensors);
/**
* Parse an constants string into a NovaGloveInfo class.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Nova | Nova Glove Info",
meta=(WorldContext="WorldContextObject"))
static bool Parse(UObject* WorldContextObject, const FString& ConstantsString, USGNovaGloveInfo* OutGloveInfo);
/**
* Convert a string representation back into a NovaGloveInfo class.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Nova | Nova Glove Info",
meta=(WorldContext="WorldContextObject"))
static USGNovaGloveInfo* Deserialize(UObject* WorldContextObject, const FString& SerializedString);
/**
* Unique identifier of this device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static FString GetDeviceId(const USGNovaGloveInfo* NovaGloveInfo);
/**
* Hardware (sub) version of this Sense Glove Device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static FString GetHardwareVersion(const USGNovaGloveInfo* NovaGloveInfo);
/**
* Firmware version running on the device's MicroController. (as v4.12, this is the 4).
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static int32 GetFirmwareVersion(const USGNovaGloveInfo* NovaGloveInfo);
/**
* Sub firmware version running on the device's microcontroller (as v4.12, this is the .12).
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static int32 GetSubFirmwareVersion(const USGNovaGloveInfo* NovaGloveInfo);
/**
* Determines if this is a right-handed Nova.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static bool IsRight(const USGNovaGloveInfo* NovaGloveInfo);
/**
* The IMU correction of this Nova.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Imu Correction", Category="SenseGlove | Core | Nova | Nova Glove Info")
static FQuat GetImuCorrection_FQuat(const USGNovaGloveInfo* NovaGloveInfo);
/**
* The IMU correction of this Nova.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Imu Correction", Category="SenseGlove | Core | Nova | Nova Glove Info")
static FRotator GetImuCorrection_FRotator(const USGNovaGloveInfo* NovaGloveInfo);
/**
* The number of sensors in this device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static int32 GetNumberOfSensors(const USGNovaGloveInfo* NovaGloveInfo);
/**
* Returns true if this GloveInfo contains the same information as another.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static bool Equals(const USGNovaGloveInfo* A, const USGNovaGloveInfo* B);
/**
* Create a string representation of this Glove Info.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Nova | Nova Glove Info")
static FString ToString(const USGNovaGloveInfo* NovaGloveInfo);
/**
* Convert this class into a string representation so it can be unpacked later.
*/
UFUNCTION(BlueprintPure, DisplayName="Serialize", Category="SenseGlove | Core | Nova | Nova Glove Info")
static FString SGSerialize(const USGNovaGloveInfo* NovaGloveInfo);
};