diff --git a/TouchSenderInterpreter.ConsoleAppDemo/Program.cs b/TouchSenderInterpreter.ConsoleAppDemo/Program.cs index 5d251b1..4c68ac1 100644 --- a/TouchSenderInterpreter.ConsoleAppDemo/Program.cs +++ b/TouchSenderInterpreter.ConsoleAppDemo/Program.cs @@ -1,5 +1,4 @@ using System.Net.Sockets; -using System.Text; using System.Text.Json; using TouchSenderInterpreter.Models; @@ -66,7 +65,6 @@ static async Task ReceiveTouchSenderPayload(CancellationToken cts) while (true) { var receivedResults = await udpClient.ReceiveAsync(cts); - var receivedText = Encoding.UTF8.GetString(receivedResults.Buffer); touchSenderResult = Interpreter.Read(receivedResults.Buffer); } } diff --git a/TouchSenderInterpreter.Test/InterpreterTest.cs b/TouchSenderInterpreter.Test/InterpreterTest.cs index c25bbdd..641eff0 100644 --- a/TouchSenderInterpreter.Test/InterpreterTest.cs +++ b/TouchSenderInterpreter.Test/InterpreterTest.cs @@ -11,8 +11,8 @@ namespace TouchSenderInterpreter.Test internal class TestDataGenerator { static readonly int ExampleId = 10; - static readonly Deviceinfo FullDeviceInfo = new(Width: 1920, Height: 1080); - static readonly Singletouch FullSingleTouch = new(X: 0.5, Y: 0.5); + static readonly DeviceInfo FullDeviceInfo = new(Width: 1920, Height: 1080); + static readonly SingleTouch FullSingleTouch = new(X: 0.5, Y: 0.5); static readonly TouchSenderPayload FullPayload = new(ExampleId, FullDeviceInfo, FullSingleTouch); public static IEnumerable FullPayloads() { diff --git a/TouchSenderInterpreter/Models/TouchSenderPayload.cs b/TouchSenderInterpreter/Models/TouchSenderPayload.cs index 6621dc4..0b1eb20 100644 --- a/TouchSenderInterpreter/Models/TouchSenderPayload.cs +++ b/TouchSenderInterpreter/Models/TouchSenderPayload.cs @@ -2,15 +2,15 @@ { public record TouchSenderPayload( int Id, - Deviceinfo DeviceInfo, - Singletouch SingleTouch + DeviceInfo DeviceInfo, + SingleTouch SingleTouch ) { - public Singletouch SingleTouchRatio + public SingleTouch SingleTouchRatio { get { - return new Singletouch( + return new SingleTouch( X: SingleTouch.X / DeviceInfo.Width, Y: SingleTouch.Y / DeviceInfo.Height ); @@ -18,12 +18,12 @@ public Singletouch SingleTouchRatio } }; - public record Deviceinfo( + public record DeviceInfo( int Width, int Height ); - public record Singletouch( + public record SingleTouch( double? X, double? Y );