Unreal SDK  v1.3.0
Loading...
Searching...
No Matches
WeArtStatusTracker.h
Go to the documentation of this file.
1
2#pragma once
3
4#include "CoreMinimal.h"
5#include "GameFramework/Actor.h"
6#include "WeArtCommon.h"
7#include "WeArtMessages.h"
9
14USTRUCT(BlueprintType)
16 GENERATED_BODY()
17public:
18 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
19 TEnumAsByte <EActuationPoint> id;
20 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
21 bool connected;
22 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
23 int statusCode;
24 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
25 FString errorDesc;
26};
27
32USTRUCT(BlueprintType)
34 GENERATED_BODY()
35public:
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
37 FString macAddress;
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
39 TEnumAsByte <EHandSide> handSide;
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
41 int batteryLevel;
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
43 bool charging;
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
45 TArray<FThimbleStatus> thimbles;
46};
47
52USTRUCT(BlueprintType)
54 GENERATED_BODY()
55public:
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
57 FString macAddress = "";
58
59 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
60 TEnumAsByte <EHandSide> handSide = EHandSide::Left;
61};
62
67USTRUCT(BlueprintType)
69 GENERATED_BODY()
70public:
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
72 FString timestamp = "";
73
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
75 FString status = "DISCONNECTED";
76
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
78 FString version = "";
79
80 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
81 FString statusCode = "";
82
83 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
84 FString errorDesc = "";
85
86 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
87 bool actuationsEnabled = false;
88
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReflectionPoint")
90 TArray<FMiddlewareConnectedDevice> connectedDevices;
91};
92
93DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStatusCalibrationStartSignature, EHandSide, handSide);
94DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStatusCalibrationFinishSignature, EHandSide, handSide);
95DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStatusCalibrationResultSuccessSignature, EHandSide, handSide);
96DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStatusCalibrationResultFailSignature, EHandSide, handSide);
97DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStatusCalibrationStopSignature);
98DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnMiddlewareSignature);
100
105UCLASS()
107{
108 GENERATED_BODY()
109public:
110 // Sets default values for this actor's properties
112
114
115 UPROPERTY(BlueprintReadWrite, Category = "ReflectionPoint")
116 FMiddlewareStatusData middlewareStatusData;
117
118 // Connected device status
119 ConnectedDeviceStatus connectedDeviceStatusRightCPP;
120 ConnectedDeviceStatus connectedDeviceStatusLeftCPP;
121
122 UPROPERTY(BlueprintReadWrite, Category = "ReflectionPoint")
123 FConnectedDeviceStatus connectedDeviceStatusRight;
124
125 UPROPERTY(BlueprintReadWrite, Category = "ReflectionPoint")
126 FConnectedDeviceStatus connectedDeviceStatusLeft;
127
128
129protected:
130 // Called when the game starts or when spawned
131 virtual void BeginPlay() override;
132 bool isInitiated = false;
133
134public:
135 // Called every frame
136 virtual void Tick(float DeltaTime) override;
137
138 // Delegates for calibration status
139 UPROPERTY(BlueprintAssignable)
140 FOnStatusCalibrationStartSignature OnStatusMiddlewareCalibrationStart;
141
142 UFUNCTION(BlueprintImplementableEvent)
143 void OnStatusCalibrationStart(EHandSide handSide);
144
145 UPROPERTY(BlueprintAssignable)
146 FOnStatusCalibrationFinishSignature OnStatusMiddlewareCalibrationFinish;
147
148 UFUNCTION(BlueprintImplementableEvent)
149 void OnStatusCalibrationFinish(EHandSide handSide);
150
151 UPROPERTY(BlueprintAssignable)
152 FOnStatusCalibrationResultSuccessSignature OnStatusMiddlewareCalibrationResultSuccess;
153
154 UFUNCTION(BlueprintImplementableEvent)
155 void OnStatusCalibrationResultSuccess(EHandSide handSide);
156
157 UPROPERTY(BlueprintAssignable)
158 FOnStatusCalibrationResultFailSignature OnStatusMiddlewareCalibrationResultFail;
159
160 UFUNCTION(BlueprintImplementableEvent)
161 void OnStatusCalibrationResultFail(EHandSide handSide);
162
163 UPROPERTY(BlueprintAssignable)
164 FOnStatusCalibrationStopSignature OnStatusMiddlewareCalibrationStop;
165
166 UFUNCTION(BlueprintImplementableEvent)
167 void OnStatusCalibrationStop();
168
169 // Delegate for middleware status
170 UPROPERTY(BlueprintAssignable)
171 FOnMiddlewareSignature OnMiddlewareSignature;
172
173 UFUNCTION(BlueprintImplementableEvent)
174 void OnMiddlewareStatus();
175
176 UPROPERTY(BlueprintAssignable)
177 FOnDevicesSignature OnDevicesSignature;
178
179 // Delegate for device status
180 UFUNCTION(BlueprintImplementableEvent)
181 void OnDevicesStatus();
182
184 void SetMiddlewareStatus(MiddlewareStatusData statusData);
186 void SetConnectedDevicesStatus(std::vector<ConnectedDeviceStatus> devices);
187};
188
#define WEARTPLUGIN_API
Definition: Definitions.WEARTPlugin.h:26
EHandSide
Definition: WeArtCommon.h:8
@ Left
Definition: WeArtCommon.h:10
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStatusCalibrationStartSignature, EHandSide, handSide)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStatusCalibrationStopSignature)
Tracks the status of connected devices and middleware.
Definition: WeArtStatusTracker.h:107
MiddlewareStatusData middlewareStatusDataCPP
Definition: WeArtStatusTracker.h:113
Definition: json.hpp:5292
Status of a connected TouchDIVER device.
Definition: WeArtCommon.h:135
Represents the status of a connected device.
Definition: WeArtStatusTracker.h:33
Represents a connected device in the middleware.
Definition: WeArtStatusTracker.h:53
Represents the status data of the middleware.
Definition: WeArtStatusTracker.h:68
Represents the status of a thimble.
Definition: WeArtStatusTracker.h:15
Definition: WeArtCommon.h:110