diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 86918b9ab..209705df6 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.9.329.1")] -[assembly: AssemblyFileVersion("2.9.329.1")] +[assembly: AssemblyVersion("2.9.330.1")] +[assembly: AssemblyFileVersion("2.9.330.1")] diff --git a/TestBenchFramework/UiControls/PathsBenchCtrl.cs b/TestBenchFramework/UiControls/PathsBenchCtrl.cs index 579c79452..9434621e3 100644 --- a/TestBenchFramework/UiControls/PathsBenchCtrl.cs +++ b/TestBenchFramework/UiControls/PathsBenchCtrl.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2013-2015 Sensus Metering Systems /// using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Windows.Forms; using log4net; @@ -143,6 +144,10 @@ namespace TBF.UiControls void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) { + if (e.SubItem >= fixedColumnsCount) + { + e.Item.SubItems[e.SubItem].BackColor = e.DisplayText == Strings.open ? Color.LightGray : Color.White; + } } public override void DrawOne(object myItem) @@ -151,7 +156,9 @@ namespace TBF.UiControls BenchControl.BenchPath path = new BenchControl.BenchPath(entity, parent.TbfComponents); ListViewItem lvi = new ListViewItem(entity.Name); - lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.UseItemStyleForSubItems = false; + + lvi.SubItems.Add(path.Qfrom.ToString()); lvi.SubItems.Add(path.Qto.ToString()); lvi.SubItems.Add(path.TempIn != null ? path.TempIn.Cfg.Name : "---"); lvi.SubItems.Add(path.TempOut != null ? path.TempOut.Cfg.Name : "---"); @@ -166,14 +173,17 @@ namespace TBF.UiControls if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { lvi.SubItems.Add(Strings.open); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.LightGray; } else if (path.ValvesClose != null && path.ValvesClose.Contains(valve)) { lvi.SubItems.Add(Strings.close); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; } else { lvi.SubItems.Add("---"); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; } } } diff --git a/TestBenchFramework/UiControls/PathsFeedingCtrl.cs b/TestBenchFramework/UiControls/PathsFeedingCtrl.cs index 078a2ac84..f06911d21 100644 --- a/TestBenchFramework/UiControls/PathsFeedingCtrl.cs +++ b/TestBenchFramework/UiControls/PathsFeedingCtrl.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2013-2015 Sensus Metering Systems /// using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Windows.Forms; using log4net; @@ -115,7 +116,11 @@ namespace TBF.UiControls void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) { - } + if (e.SubItem >= fixedColumnsCount) + { + e.Item.SubItems[e.SubItem].BackColor = e.DisplayText == Strings.open ? Color.LightGray : Color.White; + } + } public override void DrawOne(object myItem) { @@ -123,7 +128,9 @@ namespace TBF.UiControls BenchControl.FeedingPath path = new BenchControl.FeedingPath(entity, parent.TbfComponents); ListViewItem lvi = new ListViewItem(entity.Name); - lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.UseItemStyleForSubItems = false; + + lvi.SubItems.Add(path.Qfrom.ToString()); lvi.SubItems.Add(path.Qto.ToString()); lvi.SubItems.Add(path.Pump != null ? path.Pump.Cfg.Name : "---"); @@ -134,14 +141,17 @@ namespace TBF.UiControls if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { lvi.SubItems.Add(Strings.open); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.LightGray; } else if (path.ValvesClose != null && path.ValvesClose.Contains(valve)) { lvi.SubItems.Add(Strings.close); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; } else { lvi.SubItems.Add("---"); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; } } } diff --git a/TestBenchFramework/UiControls/PathsOutputCtrl.cs b/TestBenchFramework/UiControls/PathsOutputCtrl.cs index 0f5878499..e4824d63f 100644 --- a/TestBenchFramework/UiControls/PathsOutputCtrl.cs +++ b/TestBenchFramework/UiControls/PathsOutputCtrl.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2013-2015 Sensus Metering Systems /// using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Windows.Forms; using log4net; @@ -157,7 +158,11 @@ namespace TBF.UiControls void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) { - } + if (e.SubItem >= fixedColumnsCount) + { + e.Item.SubItems[e.SubItem].BackColor = e.DisplayText == Strings.open ? Color.LightGray : Color.White; + } + } public override void DrawOne(object myItem) { @@ -165,7 +170,9 @@ namespace TBF.UiControls BenchControl.OutputPath path = new BenchControl.OutputPath(entity, parent.TbfComponents); ListViewItem lvi = new ListViewItem(entity.Name); - lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.UseItemStyleForSubItems = false; + + lvi.SubItems.Add(path.Qfrom.ToString()); lvi.SubItems.Add(path.Qto.ToString()); lvi.SubItems.Add((path.RegulValve != null) ? path.RegulValve.Cfg.Name : "---"); lvi.SubItems.Add((path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : "---"); @@ -183,15 +190,18 @@ namespace TBF.UiControls if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { lvi.SubItems.Add(Strings.open); - } + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.LightGray; + } else if (path.ValvesClose != null && path.ValvesClose.Contains(valve)) { lvi.SubItems.Add(Strings.close); - } + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; + } else { lvi.SubItems.Add("---"); - } + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; + } } } diff --git a/TestBenchFramework/UiControls/TransitionStepsCtrl.cs b/TestBenchFramework/UiControls/TransitionStepsCtrl.cs index 8e11352f0..1df67852f 100644 --- a/TestBenchFramework/UiControls/TransitionStepsCtrl.cs +++ b/TestBenchFramework/UiControls/TransitionStepsCtrl.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2013-2015 Sensus Metering Systems /// using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; using log4net; using Config.Entities; @@ -223,6 +224,10 @@ namespace TBF.UiControls e.DisplayText = e.Item.SubItems[e.SubItem].Text; e.Cancel = true; } + else + { + e.Item.SubItems[e.SubItem].BackColor = e.DisplayText == Strings.open ? Color.LightGray : Color.White; + } } } @@ -245,7 +250,9 @@ namespace TBF.UiControls } ListViewItem lvi = new ListViewItem(step.Duration.ToString()); - lvi.SubItems.Add(string.IsNullOrEmpty(step.Message) ? string.Empty : step.Message); + lvi.UseItemStyleForSubItems = false; + + lvi.SubItems.Add(string.IsNullOrEmpty(step.Message) ? string.Empty : step.Message); lvi.SubItems.Add((step.EndCondition == StepCondition.None) ? "---" : step.EndCondition.ToString()); string[] fmPumpsStr = (step.PumpWithFMPcts != null) ? step.PumpWithFMPcts.Split(new char[] { ';' }) @@ -269,14 +276,17 @@ namespace TBF.UiControls if (valvesOpen != null && valvesOpen.Contains(valve)) { lvi.SubItems.Add(Strings.open); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.LightGray; } else if (valvesClose != null && valvesClose.Contains(valve)) { lvi.SubItems.Add(Strings.close); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; } else { lvi.SubItems.Add("---"); + lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Color.White; } } } diff --git a/TestBenchFramework/UiControls/VirtualBenchStepsCtrl.cs b/TestBenchFramework/UiControls/VirtualBenchStepsCtrl.cs index 366289b12..ac0209ea2 100644 --- a/TestBenchFramework/UiControls/VirtualBenchStepsCtrl.cs +++ b/TestBenchFramework/UiControls/VirtualBenchStepsCtrl.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2013-2015 Sensus Metering Systems /// using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; using log4net; using Config.Entities; @@ -175,6 +176,11 @@ namespace TBF.UiControls // e.Cancel = true; // } //} + + if (e.SubItem >= fixedCount) + { + e.Item.SubItems[e.SubItem].BackColor = e.DisplayText == Strings.open ? Color.LightGray : Color.White; + } } public override void DrawOne(object myItem)