From 12e9a3f94f448469bed244aa468844773888ccc5 Mon Sep 17 00:00:00 2001 From: Yoooi Date: Fri, 9 Feb 2024 23:16:59 +0100 Subject: [PATCH] Fix polled update TCode duration sent as seconds instead of milliseconds --- .../MultiFunPlayer/OutputTarget/ViewModels/PipeOutputTarget.cs | 2 +- .../OutputTarget/ViewModels/SerialOutputTarget.cs | 2 +- .../MultiFunPlayer/OutputTarget/ViewModels/TcpOutputTarget.cs | 2 +- .../MultiFunPlayer/OutputTarget/ViewModels/UdpOutputTarget.cs | 2 +- .../OutputTarget/ViewModels/WebSocketOutputTarget.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/MultiFunPlayer/OutputTarget/ViewModels/PipeOutputTarget.cs b/Source/MultiFunPlayer/OutputTarget/ViewModels/PipeOutputTarget.cs index 1f632f94..868dae8e 100644 --- a/Source/MultiFunPlayer/OutputTarget/ViewModels/PipeOutputTarget.cs +++ b/Source/MultiFunPlayer/OutputTarget/ViewModels/PipeOutputTarget.cs @@ -102,7 +102,7 @@ protected override void Run(CancellationToken token) var value = MathUtils.Lerp(settings.Minimum / 100, settings.Maximum / 100, snapshot.KeyframeTo.Value); var duration = snapshot.Duration; - var command = DeviceAxis.ToString(axis, value, duration); + var command = DeviceAxis.ToString(axis, value, duration * 1000); if (client.IsConnected && !string.IsNullOrWhiteSpace(command)) { Logger.Trace("Sending \"{0}\" to \"{1}\"", command, PipeName); diff --git a/Source/MultiFunPlayer/OutputTarget/ViewModels/SerialOutputTarget.cs b/Source/MultiFunPlayer/OutputTarget/ViewModels/SerialOutputTarget.cs index 4c3d3d86..91fb92a7 100644 --- a/Source/MultiFunPlayer/OutputTarget/ViewModels/SerialOutputTarget.cs +++ b/Source/MultiFunPlayer/OutputTarget/ViewModels/SerialOutputTarget.cs @@ -217,7 +217,7 @@ protected override void Run(CancellationToken token) var value = MathUtils.Lerp(settings.Minimum / 100, settings.Maximum / 100, snapshot.KeyframeTo.Value); var duration = snapshot.Duration; - var command = DeviceAxis.ToString(axis, value, duration); + var command = DeviceAxis.ToString(axis, value, duration * 1000); if (serialPort.IsOpen && !string.IsNullOrWhiteSpace(command)) { Logger.Trace("Sending \"{0}\" to \"{1}\"", command, SelectedSerialPortDeviceId); diff --git a/Source/MultiFunPlayer/OutputTarget/ViewModels/TcpOutputTarget.cs b/Source/MultiFunPlayer/OutputTarget/ViewModels/TcpOutputTarget.cs index 0a41c9c4..15256263 100644 --- a/Source/MultiFunPlayer/OutputTarget/ViewModels/TcpOutputTarget.cs +++ b/Source/MultiFunPlayer/OutputTarget/ViewModels/TcpOutputTarget.cs @@ -103,7 +103,7 @@ protected override void Run(CancellationToken token) var value = MathUtils.Lerp(settings.Minimum / 100, settings.Maximum / 100, snapshot.KeyframeTo.Value); var duration = snapshot.Duration; - var command = DeviceAxis.ToString(axis, value, duration); + var command = DeviceAxis.ToString(axis, value, duration * 1000); if (client.Connected && !string.IsNullOrWhiteSpace(command)) { Logger.Trace("Sending \"{0}\" to \"{1}\"", command, $"tcp://{Endpoint.ToUriString()}"); diff --git a/Source/MultiFunPlayer/OutputTarget/ViewModels/UdpOutputTarget.cs b/Source/MultiFunPlayer/OutputTarget/ViewModels/UdpOutputTarget.cs index e005520d..43acf21e 100644 --- a/Source/MultiFunPlayer/OutputTarget/ViewModels/UdpOutputTarget.cs +++ b/Source/MultiFunPlayer/OutputTarget/ViewModels/UdpOutputTarget.cs @@ -112,7 +112,7 @@ protected override void Run(CancellationToken token) var value = MathUtils.Lerp(settings.Minimum / 100, settings.Maximum / 100, snapshot.KeyframeTo.Value); var duration = snapshot.Duration; - var command = DeviceAxis.ToString(axis, value, duration); + var command = DeviceAxis.ToString(axis, value, duration * 1000); if (!string.IsNullOrWhiteSpace(command)) { Logger.Trace("Sending \"{0}\" to \"{1}\"", command, $"udp://{Endpoint.ToUriString()}"); diff --git a/Source/MultiFunPlayer/OutputTarget/ViewModels/WebSocketOutputTarget.cs b/Source/MultiFunPlayer/OutputTarget/ViewModels/WebSocketOutputTarget.cs index 78f78e99..2f9def20 100644 --- a/Source/MultiFunPlayer/OutputTarget/ViewModels/WebSocketOutputTarget.cs +++ b/Source/MultiFunPlayer/OutputTarget/ViewModels/WebSocketOutputTarget.cs @@ -114,7 +114,7 @@ await PolledUpdateAsync(DeviceAxis.All, () => !token.IsCancellationRequested, as var value = MathUtils.Lerp(settings.Minimum / 100, settings.Maximum / 100, snapshot.KeyframeTo.Value); var duration = snapshot.Duration; - var command = DeviceAxis.ToString(axis, value, duration); + var command = DeviceAxis.ToString(axis, value, duration * 1000); if (client.State == WebSocketState.Open && !string.IsNullOrWhiteSpace(command)) { Logger.Trace("Sending \"{0}\" to \"{1}\"", command, Uri.ToString());