Various bug fixe, ValveMove to flow repeted 1x, version 1.4.42

This commit is contained in:
Milan Hanajik 2015-05-21 16:38:27 +02:00
parent e94b4f2655
commit d2b76cc58d
4 changed files with 33 additions and 8 deletions

View File

@ -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)
{

View File

@ -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)
{
///

View File

@ -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")]

View File

@ -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;