diff --git a/MobiFlight/ExecutionManager.cs b/MobiFlight/ExecutionManager.cs
index 7947a6ba0..6e83e485a 100644
--- a/MobiFlight/ExecutionManager.cs
+++ b/MobiFlight/ExecutionManager.cs
@@ -1233,7 +1233,7 @@ void testModeTimer_Tick(object sender, EventArgs args)
try
{
var currentGuid = (row.DataBoundItem as DataRowView).Row["guid"].ToString();
- ExecuteTestOn(cfg, currentGuid, null);
+ ExecuteTestOn(cfg, currentGuid, cfg.TestValue);
}
catch (IndexOutOfRangeException ex)
{
@@ -1323,6 +1323,10 @@ public void ExecuteTestOn(OutputConfigItem cfg, string configGuid, ConnectorValu
ExecuteDisplay(value?.ToString() ?? "1", cfg);
break;
+ case MobiFlightCustomDevice.TYPE:
+ ExecuteDisplay(value?.ToString() ?? "1", cfg);
+ break;
+
case "InputAction":
// Do nothing for the InputAction
break;
diff --git a/UI/Panels/OutputConfigPanel.Designer.cs b/UI/Panels/OutputConfigPanel.Designer.cs
index 69f2552ab..67b9399da 100644
--- a/UI/Panels/OutputConfigPanel.Designer.cs
+++ b/UI/Panels/OutputConfigPanel.Designer.cs
@@ -77,6 +77,8 @@ private void InitializeComponent()
this.guidDataColumn = new System.Data.DataColumn();
this.outputDataColumn = new System.Data.DataColumn();
this.outputTypeDataColumn = new System.Data.DataColumn();
+ this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
+ this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewConfig)).BeginInit();
this.dataGridViewContextMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataSetConfig)).BeginInit();
@@ -267,7 +269,9 @@ private void InitializeComponent()
this.pasteToolStripMenuItem,
this.toolStripMenuItem1,
this.duplicateRowToolStripMenuItem,
- this.deleteRowToolStripMenuItem});
+ this.deleteRowToolStripMenuItem,
+ this.toolStripMenuItem2,
+ this.testToolStripMenuItem});
this.dataGridViewContextMenuStrip.Name = "dataGridViewContextMenuStrip";
resources.ApplyResources(this.dataGridViewContextMenuStrip, "dataGridViewContextMenuStrip");
this.dataGridViewContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.DataGridViewContextMenuStrip_Opening);
@@ -432,6 +436,17 @@ private void InitializeComponent()
this.outputTypeDataColumn.ColumnMapping = System.Data.MappingType.Hidden;
this.outputTypeDataColumn.ColumnName = "OutputType";
//
+ // toolStripMenuItem2
+ //
+ this.toolStripMenuItem2.Name = "toolStripMenuItem2";
+ resources.ApplyResources(this.toolStripMenuItem2, "toolStripMenuItem2");
+ //
+ // testToolStripMenuItem
+ //
+ resources.ApplyResources(this.testToolStripMenuItem, "testToolStripMenuItem");
+ this.testToolStripMenuItem.Name = "testToolStripMenuItem";
+ this.testToolStripMenuItem.Click += new System.EventHandler(this.testToolStripMenuItem_Click);
+ //
// OutputConfigPanel
//
resources.ApplyResources(this, "$this");
@@ -485,5 +500,7 @@ private void InitializeComponent()
private System.Windows.Forms.DataGridViewTextBoxColumn fsuipcValueColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn arcazeValueColumn;
private System.Windows.Forms.DataGridViewButtonColumn EditButtonColumn;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
+ private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem;
}
}
diff --git a/UI/Panels/OutputConfigPanel.cs b/UI/Panels/OutputConfigPanel.cs
index b4dc0e7b6..9988381c1 100644
--- a/UI/Panels/OutputConfigPanel.cs
+++ b/UI/Panels/OutputConfigPanel.cs
@@ -55,6 +55,17 @@ private void Init()
DropTimer.Interval = 400;
DropTimer.Tick += DropTimer_Tick;
+
+ dataGridViewConfig.SelectionChanged += (s, e) => {
+ if (testToolStripMenuItem.Checked)
+ {
+ // this disables the currently tested item
+ UpdateSingleItemTestMode();
+ }
+
+ var AtLeastOneRowSelectedAndNotLastRow = dataGridViewConfig.SelectedRows.Count > 0 && !dataGridViewConfig.SelectedRows[0].IsNewRow;
+ testToolStripMenuItem.Enabled = AtLeastOneRowSelectedAndNotLastRow;
+ };
}
public ExecutionManager ExecutionManager { get; set; }
@@ -64,6 +75,8 @@ private void Init()
public DataGridView DataGridViewConfig { get { return dataGridViewConfig; } }
+ public OutputConfigItem ItemInTestMode { get; private set; }
+
void DataGridViewConfig_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
// if datagridviewconfig.RowCount == 1 this means that only the "new line" is added yet
@@ -1077,5 +1090,43 @@ private void DropTimer_Tick(object sender, EventArgs e)
DropTimer.Stop();
RemoveDragTargetHighlight();
}
+
+ private void testToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ UpdateSingleItemTestMode();
+ }
+
+ private void UpdateSingleItemTestMode()
+ {
+ var isTestOn = testToolStripMenuItem.Checked;
+
+ if (isTestOn && ItemInTestMode!=null)
+ {
+ ExecutionManager.ExecuteTestOff(ItemInTestMode, true);
+ ItemInTestMode = null;
+ testToolStripMenuItem.Checked = false;
+ return;
+ }
+
+ foreach (DataGridViewRow row in dataGridViewConfig.SelectedRows)
+ {
+ // ignore new rows since they cannot be copied nor deleted
+ if (row.IsNewRow) continue;
+
+ DataRow currentRow = (row.DataBoundItem as DataRowView)?.Row;
+ if (currentRow == null) continue;
+
+ OutputConfigItem cfg = currentRow["settings"] as OutputConfigItem;
+ var currentGuid = currentRow["guid"].ToString();
+
+ if (cfg == null) return;
+
+ ItemInTestMode = cfg;
+ ExecutionManager.ExecuteTestOn(cfg, currentGuid, cfg.TestValue);
+ testToolStripMenuItem.Checked = true;
+
+ return;
+ }
+ }
}
}
diff --git a/UI/Panels/OutputConfigPanel.resx b/UI/Panels/OutputConfigPanel.resx
index 770b5aa7d..a39e8fb79 100644
--- a/UI/Panels/OutputConfigPanel.resx
+++ b/UI/Panels/OutputConfigPanel.resx
@@ -255,7 +255,7 @@
- 147, 22
+ 180, 22
Copy
@@ -264,19 +264,19 @@
False
- 147, 22
+ 180, 22
Paste
- 144, 6
+ 177, 6
False
- 147, 22
+ 180, 22
Duplicate row
@@ -285,7 +285,7 @@
False
- 147, 22
+ 180, 22
Delete row(s)
@@ -293,8 +293,20 @@
Delete selected row(s)
+
+ 177, 6
+
+
+ False
+
+
+ 180, 22
+
+
+ Test
+
- 148, 98
+ 181, 148
dataGridViewContextMenuStrip
@@ -546,6 +558,18 @@
System.Data.DataColumn, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ toolStripMenuItem2
+
+
+ System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ testToolStripMenuItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
OutputConfigPanel