From d2b76cc58d3ed15ba7c8ce3decaafd853eb5ff62 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 21 May 2015 16:38:27 +0200 Subject: [PATCH] Various bug fixe, ValveMove to flow repeted 1x, version 1.4.42 --- .../DataEntry/Standard24/EntryForm.cs | 4 ++- .../BenchControl/Elde/RegulValve/SetFlowOp.cs | 25 ++++++++++++++++++- TestBenchFramework/Properties/AssemblyInfo.cs | 4 +-- .../Screens/ResultsTabPageCtrl.cs | 8 +++--- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs index 5cef70c1a..af806e729 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs @@ -196,8 +196,10 @@ namespace TBF.BenchControl.DataEntry.Standard24 else if (currentOp == CurrentOp.ShowFormAtCycleEnd) { CycleEndForm dlg = (modelessDlg as CycleEndForm); + int count = waterMeters.Count; + if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount; - for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++) + for (int i = 0; i < count; i++) { if (waterMeters[i] != null) { diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs index 0ce9c5efc..67b9f9535 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs @@ -38,6 +38,7 @@ namespace TBF.BenchControl.Elde.RegulValve ValveMoveToPosition, SettingPosition, ValveMoveToFlow, + ValveMoveToFlow2, SettingFlow, FlowReached, } @@ -243,9 +244,31 @@ namespace TBF.BenchControl.Elde.RegulValve new float[2] { freqLo, freqHi }, regulValve.StableTime); - opState = OpState.SettingFlow; + opState = OpState.ValveMoveToFlow2; return Event.None; } + else if (opState == OpState.ValveMoveToFlow2) + { + /// + /// Done once, issues an appropriate ValveMove(...) command + /// + if (reqFlowLo >= reqFlowHi || reqFlowLo > nominalFlow || reqFlowHi <= 0) + { + return Event.OpArgumentError; + } + + log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}", + regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi); + + float freqLo = 2000.0f * reqFlowLo / nominalFlow; + float freqHi = 2000.0f * reqFlowHi / nominalFlow; + controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, + new float[2] { freqLo, freqHi }, + regulValve.StableTime); + + opState = OpState.SettingFlow; + return Event.None; + } else if (opState == OpState.SettingFlow) { /// diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index b2c96ced3..117443578 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.4.41.1")] -[assembly: AssemblyFileVersion("1.4.41.1")] +[assembly: AssemblyVersion("1.4.42.1")] +[assembly: AssemblyFileVersion("1.4.42.1")] diff --git a/TestBenchFramework/Screens/ResultsTabPageCtrl.cs b/TestBenchFramework/Screens/ResultsTabPageCtrl.cs index 286cfcd13..533693677 100644 --- a/TestBenchFramework/Screens/ResultsTabPageCtrl.cs +++ b/TestBenchFramework/Screens/ResultsTabPageCtrl.cs @@ -165,14 +165,14 @@ namespace TBF.Screens if (MetersArrangement == Forms.ResultsConfig.Meters.Horizontally) { flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight; - lvWidth = (flowLayoutPanel.Width + 5) / metersInOneGroup - 5; - lvHeight = (flowLayoutPanel.Height + 5) / nrGroups - 5; + lvWidth = flowLayoutPanel.Width / metersInOneGroup - 6; + lvHeight = flowLayoutPanel.Height / nrGroups - 6; } else { flowLayoutPanel.FlowDirection = FlowDirection.TopDown; - lvWidth = (flowLayoutPanel.Width + 5) / nrGroups - 5; - lvHeight = (flowLayoutPanel.Height + 5) / metersInOneGroup - 5; + lvWidth = flowLayoutPanel.Width / nrGroups - 6; + lvHeight = flowLayoutPanel.Height / metersInOneGroup - 6; } flowLayoutPanel.Controls.Clear(); flowLayoutPanel.WrapContents = true;