diff --git a/src/DCSFPCommon b/src/DCSFPCommon
index 6bcc136af..4f52368f9 160000
--- a/src/DCSFPCommon
+++ b/src/DCSFPCommon
@@ -1 +1 @@
-Subproject commit 6bcc136afda8f67129d3071f5febf86caf51d18f
+Subproject commit 4f52368f99bb55bc5a747b27a47b03aee50fd633
diff --git a/src/DCSFlightpanels.sln.DotSettings b/src/DCSFlightpanels.sln.DotSettings
index e40191991..e77f63f77 100644
--- a/src/DCSFlightpanels.sln.DotSettings
+++ b/src/DCSFlightpanels.sln.DotSettings
@@ -10,6 +10,7 @@
ARN
AV
BIOS
+ BIP
BIPS
BLUE
BNA
@@ -25,6 +26,7 @@
DCSBIOSU
DCSFP
DED
+ DRO
EUFD
FA
FM
@@ -49,10 +51,12 @@
LCD
LCDPZ
LE
+ LED
LF
MB
MK
MT
+ NADIR
NOUSE
NS
OK
@@ -60,6 +64,7 @@
OS
OSCOMMANDS
PURPLE
+ PZ
RED
REF
SA
@@ -108,7 +113,9 @@
XPDR
True
True
+ True
True
+ True
True
True
@@ -159,6 +166,7 @@
True
True
True
+ True
True
True
True
diff --git a/src/NonVisuals/BindingClasses/DCSBIOSBindings/DCSBIOSActionBindingBase.cs b/src/NonVisuals/BindingClasses/DCSBIOSBindings/DCSBIOSActionBindingBase.cs
index 8aeeb98c1..fe5893cfb 100644
--- a/src/NonVisuals/BindingClasses/DCSBIOSBindings/DCSBIOSActionBindingBase.cs
+++ b/src/NonVisuals/BindingClasses/DCSBIOSBindings/DCSBIOSActionBindingBase.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using System.Threading;
+using System.Threading.Tasks;
using ClassLibraryCommon;
using DCS_BIOS.Serialized;
using Newtonsoft.Json;
@@ -25,8 +26,9 @@ public abstract class DCSBIOSActionBindingBase : IDisposable
internal static Logger Logger = LogManager.GetCurrentClassLogger();
private bool _whenOnTurnedOn = true;
private string _description;
- [NonSerialized] private Thread _sendDCSBIOSCommandsThread;
private volatile List _dcsbiosInputs;
+ private Task _sendingCommandsTask;
+
[JsonIgnore] public bool HasSequence => _dcsbiosInputs.Count > 1;
internal abstract void ImportSettings(string settings);
public abstract string ExportSettings();
@@ -61,14 +63,7 @@ public void Dispose()
public bool IsRunning()
{
- if (_sendDCSBIOSCommandsThread != null && (_sendDCSBIOSCommandsThread.ThreadState == ThreadState.Running ||
- _sendDCSBIOSCommandsThread.ThreadState == ThreadState.WaitSleepJoin ||
- _sendDCSBIOSCommandsThread.ThreadState == ThreadState.Unstarted))
- {
- return true;
- }
-
- return false;
+ return _sendingCommandsTask != null && _sendingCommandsTask.Status == TaskStatus.Running;
}
@@ -83,17 +78,8 @@ public bool IsRunning()
*
* 3) Command is repeatable, for single commands only. Just keep executing the command, use thread.
*/
- public void SendDCSBIOSCommands(CancellationToken cancellationToken)
+ public async Task SendDCSBIOSCommandsAsync(CancellationToken cancellationToken)
{
- var repeatable = false;
-
-
- if (this is ActionTypeDCSBIOS)
- {
- //Ugly, only Streamdeck has IsRepeatable
- repeatable = ((ActionTypeDCSBIOS)this).IsRepeatable();
- }
-
if (DCSBIOSInputs.Count == 0)
{
return;
@@ -101,7 +87,7 @@ public void SendDCSBIOSCommands(CancellationToken cancellationToken)
if (_isSequenced && _sequenceIndex <= DCSBIOSInputs.Count - 1)
{
- DCSBIOSInputs[_sequenceIndex].SelectedDCSBIOSInterface.SendCommand();
+ await DCSBIOSInputs[_sequenceIndex].SelectedDCSBIOSInterface.SendCommand();
_sequenceIndex++;
if (_sequenceIndex >= DCSBIOSInputs.Count)
@@ -116,12 +102,11 @@ public void SendDCSBIOSCommands(CancellationToken cancellationToken)
{
Thread.Sleep(200);
}
-
- _sendDCSBIOSCommandsThread = new Thread(() => SendDCSBIOSCommandsThread(DCSBIOSInputs, cancellationToken));
- _sendDCSBIOSCommandsThread.Start();
+
+ _sendingCommandsTask = Task.Run(() => SendDCSBIOSCommandsAsync(DCSBIOSInputs, cancellationToken));
}
- private void SendDCSBIOSCommandsThread(List dcsbiosInputs, CancellationToken cancellationToken)
+ private async Task SendDCSBIOSCommandsAsync(List dcsbiosInputs, CancellationToken cancellationToken)
{
try
{
@@ -129,7 +114,7 @@ private void SendDCSBIOSCommandsThread(List dcsbiosInputs, Cancell
{
Thread.Sleep(dcsbiosInput.SelectedDCSBIOSInterface.Delay);
- dcsbiosInput.SelectedDCSBIOSInterface.SendCommand();
+ await dcsbiosInput.SelectedDCSBIOSInterface.SendCommand();
if (_shutdownCommandsThread || cancellationToken.IsCancellationRequested)
{
@@ -137,8 +122,6 @@ private void SendDCSBIOSCommandsThread(List dcsbiosInputs, Cancell
}
}
}
- catch (ThreadAbortException)
- { }
catch (Exception ex)
{
Logger.Error(ex);
diff --git a/src/NonVisuals/CockpitMaster/Panels/CDU737PanelBase.cs b/src/NonVisuals/CockpitMaster/Panels/CDU737PanelBase.cs
index b9e2cd7b8..a3d3d5a20 100644
--- a/src/NonVisuals/CockpitMaster/Panels/CDU737PanelBase.cs
+++ b/src/NonVisuals/CockpitMaster/Panels/CDU737PanelBase.cs
@@ -1,4 +1,6 @@
-namespace NonVisuals.CockpitMaster.Panels
+using System.Threading.Tasks;
+
+namespace NonVisuals.CockpitMaster.Panels
{
using System;
using System.Collections.Generic;
@@ -210,9 +212,8 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}
- protected override void GamingPanelKnobChanged(bool isFirstReport, IEnumerable