Skip to content

Commit

Permalink
refactor: rename SensorsData to SensorData
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Bacis committed Jun 26, 2023
1 parent bc380c7 commit 8fe58fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 2 additions & 1 deletion WeArtCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ public struct TimeOfFlight
public int Distance { get; set; }
}

public class SensorsData
public class SensorData
{
[JsonIgnore]
public DateTime Timestamp { get; set; }

public Accelerometer Accelerometer { get; set; }
public Gyroscope Gyroscope { get; set; }
public TimeOfFlight TimeOfFlight { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions WeArtMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ public class RawDataOffMessage : WeArtJsonMessage { }
public class RawDataMessage : WeArtJsonMessage
{
public HandSide HandSide { get; set; }
public SensorsData Index { get; set; }
public SensorsData Thumb { get; set; }
public SensorsData Middle { get; set; }
public SensorsData Palm { get; set; }
public SensorData Index { get; set; }
public SensorData Thumb { get; set; }
public SensorData Middle { get; set; }
public SensorData Palm { get; set; }
}
}
12 changes: 5 additions & 7 deletions WeArtRawSensorsDataTrackingObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace WeArt.Components
/// </summary>
public class WeArtRawSensorsDataTrackingObject
{
public delegate void dRawSensorDataEvent(SensorsData sensorsData);
public delegate void dRawSensorDataEvent(SensorData sensorsData);

public event dRawSensorDataEvent DataReceived;

Expand All @@ -40,9 +40,7 @@ public ActuationPoint ActuationPoint
set => _actuationPoint = value;
}



public SensorsData LastSample { get; private set; }
public SensorData LastSample { get; private set; }

public WeArtRawSensorsDataTrackingObject(WeArtClient client, HandSide handSide = HandSide.Right, ActuationPoint actuationPoint = ActuationPoint.Index)
{
Expand All @@ -53,12 +51,12 @@ public WeArtRawSensorsDataTrackingObject(WeArtClient client, HandSide handSide =
_client.OnMessage += OnMessageReceived;
HandSide = handSide;
ActuationPoint = actuationPoint;
LastSample = new SensorsData { };
LastSample = new SensorData { };
}

internal void OnConnectionChanged(bool connected)
{
LastSample = new SensorsData { };
LastSample = new SensorData { };
}

private void OnMessageReceived(WeArtClient.MessageType type, IWeArtMessage message)
Expand All @@ -71,7 +69,7 @@ private void OnMessageReceived(WeArtClient.MessageType type, IWeArtMessage messa
if (rawDataMessage.HandSide != _handSide)
return;

SensorsData newSample;
SensorData newSample;
switch (ActuationPoint)
{
case ActuationPoint.Thumb: newSample = rawDataMessage.Thumb; break;
Expand Down

0 comments on commit 8fe58fa

Please sign in to comment.