Compare commits
34
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71d318e587 | ||
|
|
71cc77bee1 | ||
|
|
460b40c9cd | ||
|
|
c2e32c774e | ||
|
|
796d9fa554 | ||
|
|
8a8c6c9997 | ||
|
|
6e420250b4 | ||
|
|
4564f0424c | ||
|
|
099d635d3e | ||
|
|
d372a38e7d | ||
|
|
fc26b95bdb | ||
|
|
44735260ce | ||
|
|
6aa3cd96a6 | ||
|
|
e1eb582804 | ||
|
|
0ad4847972 | ||
|
|
323f2ede25 | ||
|
|
a64c547395 | ||
|
|
40f5079846 | ||
|
|
464dfc6dd1 | ||
|
|
c1b3cdde6d | ||
|
|
e688c4ba25 | ||
|
|
592823aa10 | ||
|
|
5ad871a7e0 | ||
|
|
049bbc8655 | ||
|
|
dcf6df293f | ||
|
|
0dd2245fe6 | ||
|
|
cd750cca2f | ||
|
|
5f2da63339 | ||
|
|
d420128b4b | ||
|
|
2ca5eec8e1 | ||
|
|
214a570ca6 | ||
|
|
8fb021da4c | ||
|
|
439d98f99d | ||
|
|
3c4fe34c1d |
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BERLIN;LANG_DE</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -28,7 +28,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;BERLIN;LANG_DE</DefineConstants>
|
||||
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class ComponentProcedure
|
||||
@@ -10,13 +13,32 @@ namespace Config.Entities
|
||||
public virtual string Parameters { get; set; }
|
||||
public virtual Procedure Procedure { get; set; }
|
||||
|
||||
public virtual ComponentProcedure Clone()
|
||||
public virtual ComponentProcedure Clone(Procedure newProcedure)
|
||||
{
|
||||
ComponentProcedure result = new ComponentProcedure();
|
||||
result.CmpntName = CmpntName;
|
||||
result.Parameters = Parameters;
|
||||
result.Procedure = Procedure;
|
||||
result.Procedure = newProcedure;
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
output.WriteLine(CmpntName);
|
||||
output.WriteLine(Parameters.Replace(Environment.NewLine, "~"));
|
||||
}
|
||||
|
||||
public static ComponentProcedure Import(StreamReader input, Procedure newProcedure)
|
||||
{
|
||||
string firstLine = input.ReadLine();
|
||||
|
||||
if (string.IsNullOrEmpty(firstLine)) return null;
|
||||
|
||||
ComponentProcedure result = new ComponentProcedure();
|
||||
result.CmpntName = firstLine;
|
||||
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine);
|
||||
result.Procedure = newProcedure;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class ComponentTest
|
||||
@@ -18,5 +21,24 @@ namespace Config.Entities
|
||||
result.Test = Test;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
output.WriteLine(CmpntName);
|
||||
output.WriteLine(Parameters.Replace(Environment.NewLine, "~"));
|
||||
}
|
||||
|
||||
public static ComponentTest Import(StreamReader input, Test newTest)
|
||||
{
|
||||
string firstLine = input.ReadLine();
|
||||
|
||||
if (string.IsNullOrEmpty(firstLine)) return null;
|
||||
|
||||
ComponentTest result = new ComponentTest();
|
||||
result.CmpntName = firstLine;
|
||||
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine);
|
||||
result.Test = newTest;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,6 +190,26 @@ namespace Config.Entities
|
||||
Count
|
||||
}
|
||||
|
||||
public enum MassMethod : byte
|
||||
{
|
||||
#if LANG_DE
|
||||
/// nemecky
|
||||
[Description("Waage")] Scale,
|
||||
[Description("Spanne")] Spread,
|
||||
[Description("Standardabw.")] StdDev,
|
||||
#elif LANG_CS
|
||||
/// cesky
|
||||
[Description("váhou")] Scale,
|
||||
[Description("max.rozdíl")] Spread,
|
||||
[Description("std.dev.")] StdDev,
|
||||
#else
|
||||
[Description("Scale")] Scale,
|
||||
[Description("Spread")] Spread,
|
||||
[Description("Std.dev.")] StdDev,
|
||||
#endif
|
||||
Count
|
||||
}
|
||||
|
||||
public enum TestRedType
|
||||
{
|
||||
Fix,
|
||||
|
||||
@@ -11,16 +11,16 @@ namespace Config.Entities
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string RegulValve { get; set; }
|
||||
public virtual string FlowMeter { get; set; }
|
||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||
public virtual string StartValve { get; set; }
|
||||
public virtual string Diverter { get; set; }
|
||||
public virtual string TempDiv { get; set; }
|
||||
public virtual string Balance { get; set; }
|
||||
public virtual string EmptyTankValve { get; set; }
|
||||
public virtual string Scale { get; set; }
|
||||
public virtual string EmptyTankValve { get; set; } /// Not used anywhere
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
@@ -54,7 +54,7 @@ namespace Config.Entities
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
result.Balance = Balance;
|
||||
result.Scale = Scale;
|
||||
result.EmptyTankValve = EmptyTankValve;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
@@ -40,9 +41,6 @@ namespace Config.Entities
|
||||
public virtual IList<ComponentProcedure> MoreParams { get; set; }
|
||||
public virtual IList<Test> Tests { get; set; }
|
||||
|
||||
////public virtual string MetrologicalClass { get; set; }
|
||||
////public virtual IList<WMType> WMTypes { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public Procedure()
|
||||
@@ -96,11 +94,77 @@ namespace Config.Entities
|
||||
result.TransitionStart = TransitionStart;
|
||||
result.TransitionEnd = TransitionEnd;
|
||||
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone(result)); }
|
||||
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
|
||||
|
||||
//result.MetrologicalClass = MetrologicalClass;
|
||||
//result.WMType = WMType.Clone();
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
output.WriteLine(ItemNr.ToString());
|
||||
output.WriteLine(Name);
|
||||
output.WriteLine(Description);
|
||||
output.WriteLine(CreationUser);
|
||||
output.WriteLine(CreationTime.ToString());
|
||||
output.WriteLine(LastChgUser);
|
||||
output.WriteLine(LastChgTime.ToString());
|
||||
output.WriteLine(MetersKind.ToString());
|
||||
output.WriteLine(Watermeters);
|
||||
output.WriteLine(ProtocolTitle);
|
||||
output.WriteLine(DataEntry);
|
||||
output.WriteLine(ResultsPrinter);
|
||||
output.WriteLine(ResultsWriter);
|
||||
output.WriteLine(TransitionStart);
|
||||
output.WriteLine(TransitionEnd);
|
||||
|
||||
foreach (var prms in MoreParams) { prms.Export(output); }
|
||||
output.WriteLine();
|
||||
|
||||
foreach (var test in Tests) { test.Export(output); }
|
||||
output.WriteLine();
|
||||
|
||||
output.Close();
|
||||
}
|
||||
|
||||
public static Procedure Import(StreamReader input)
|
||||
{
|
||||
Procedure result = new Procedure();
|
||||
|
||||
result.ItemNr = int.Parse(input.ReadLine());
|
||||
result.Name = input.ReadLine();
|
||||
result.Description = input.ReadLine();
|
||||
result.CreationUser = input.ReadLine();
|
||||
result.CreationTime = DateTime.Parse(input.ReadLine());
|
||||
result.LastChgUser = input.ReadLine();
|
||||
result.LastChgTime = DateTime.Parse(input.ReadLine());
|
||||
string line = input.ReadLine();
|
||||
result.MetersKind = line.Equals(MetersKind.Single.ToString()) ? MetersKind.Single : (line.Equals(MetersKind.Combined.ToString()) ? MetersKind.Combined : MetersKind.HeatMeter);
|
||||
result.Watermeters = input.ReadLine();
|
||||
result.ProtocolTitle = input.ReadLine();
|
||||
result.DataEntry = input.ReadLine();
|
||||
result.ResultsPrinter = input.ReadLine();
|
||||
result.ResultsWriter = input.ReadLine();
|
||||
result.TransitionStart = input.ReadLine();
|
||||
result.TransitionEnd = input.ReadLine();
|
||||
|
||||
while(true)
|
||||
{
|
||||
ComponentProcedure prms = ComponentProcedure.Import(input, result);
|
||||
if (prms == null)
|
||||
break;
|
||||
else
|
||||
result.MoreParams.Add(prms);
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
Test tst = Test.Import(input, result);
|
||||
if (tst == null)
|
||||
break;
|
||||
else
|
||||
result.Tests.Add(tst);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+118
-28
@@ -1,9 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajik
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
@@ -22,23 +22,23 @@ namespace Config.Entities
|
||||
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
|
||||
public virtual float Volume { get; set; } /// Test volume (target) in [l]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual string Method { get; set; }
|
||||
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
|
||||
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
|
||||
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
|
||||
public virtual int Repeats { get; set; }
|
||||
public virtual bool Emptying { get; set; }
|
||||
public virtual bool Draining { get; set; }
|
||||
public virtual bool Zeroing { get; set; }
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
|
||||
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
|
||||
public virtual bool MassMethod { get; set; } /// method of mass. measurement at the beginning/end of test: false=slow (precise), true=fast (immediate)
|
||||
public virtual int TimeBeforeFlow { get; set; } /// Delay time before the start of flow control in [s]
|
||||
public virtual int TimeFlow2Mass { get; set; } /// Delay time from the flow stable to the 1st mass measurement in [s]
|
||||
public virtual int TimePump2StartV { get; set; }/// Delay time from the start of the pump to opening the start valve in [s]
|
||||
public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
|
||||
public virtual double TolerRed { get; set; } /// = Filter
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
|
||||
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
|
||||
public virtual MassMethod MassMethod { get; set; } /// method of mass. measurement at the beginning/end of test: false=slow (precise), true=using immediate mass measurement and evaluation
|
||||
public virtual int TimeBeforeFlow { get; set; } /// Delay time before the start of flow control in [s]
|
||||
public virtual int TimeFlow2Mass { get; set; } /// Delay time from the flow stable to the 1st mass measurement in [s]
|
||||
public virtual int TimePump2StartV { get; set; } /// Delay time from the start of the pump to opening the start valve in [s]
|
||||
public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
|
||||
public virtual double TolerRed { get; set; } /// = Filter
|
||||
public virtual TestRedType RedType { get; set; }
|
||||
public virtual string FeedingPath { get; set; }
|
||||
public virtual string BenchPath { get; set; }
|
||||
@@ -68,23 +68,23 @@ namespace Config.Entities
|
||||
Publish = (sbyte)Config.Entities.Publish.Always;
|
||||
Evaluate = true;
|
||||
Repeats = 1;
|
||||
Emptying = false;
|
||||
Draining = false;
|
||||
Zeroing = false;
|
||||
ErrLimLo = -2.0f; /// [%] lower error limit
|
||||
ErrLimHi = 2.0f; /// [%] upper error limit
|
||||
ErrLimLo = -2.0f; /// [%] lower error limit
|
||||
ErrLimHi = 2.0f; /// [%] upper error limit
|
||||
Uncertainty = 0;
|
||||
PumpPower = 60.0f; /// [%]
|
||||
MassRepeats = 0; /// default
|
||||
MassSpread = 0; /// default
|
||||
MassMethod = false; /// default
|
||||
TimeBeforeFlow = 10; /// [s] time before the start of flow control in [s]
|
||||
TimeFlow2Mass = 5; /// [s] time from the flow stable to the 1st mass measurement in [s]
|
||||
TimePump2StartV = 1; /// [s] time from the 1st mass measurement to the test start in [s]
|
||||
TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement
|
||||
TolerRed = 0; /// = Filter parameter
|
||||
RelTransBefore = string.Empty;
|
||||
PumpPower = 60.0f; /// [%]
|
||||
MassRepeats = 0; /// default
|
||||
MassSpread = 0; /// default
|
||||
MassMethod = MassMethod.Scale; /// default
|
||||
TimeBeforeFlow = 10; /// [s] time before the start of flow control in [s]
|
||||
TimeFlow2Mass = 5; /// [s] time from the flow stable to the 1st mass measurement in [s]
|
||||
TimePump2StartV = 1; /// [s] time from the 1st mass measurement to the test start in [s]
|
||||
TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement
|
||||
TolerRed = 0; /// = Filter parameter
|
||||
RelTransBefore = string.Empty;
|
||||
RelTransBetween = string.Empty;
|
||||
RelTransAfter = string.Empty;
|
||||
RelTransAfter = string.Empty;
|
||||
TransitionAfter = string.Empty;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Config.Entities
|
||||
result.Volume = Volume;
|
||||
result.TstTime = TstTime;
|
||||
result.Repeats = Repeats;
|
||||
result.Emptying = Emptying;
|
||||
result.Draining = Draining;
|
||||
result.Zeroing = Zeroing;
|
||||
result.PumpPower = PumpPower;
|
||||
result.MassRepeats = MassRepeats;
|
||||
@@ -141,6 +141,96 @@ namespace Config.Entities
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
output.WriteLine(Name);
|
||||
output.WriteLine(Part.ToString());
|
||||
output.WriteLine(Publish.ToString());
|
||||
output.WriteLine(Evaluate.ToString());
|
||||
output.WriteLine(Qfrom.ToString());
|
||||
output.WriteLine(Qto.ToString());
|
||||
output.WriteLine(Volume.ToString());
|
||||
output.WriteLine(TstTime.ToString());
|
||||
output.WriteLine(Method);
|
||||
output.WriteLine(ErrLimLo.ToString());
|
||||
output.WriteLine(ErrLimHi.ToString());
|
||||
output.WriteLine(Uncertainty.ToString());
|
||||
output.WriteLine(Repeats.ToString());
|
||||
output.WriteLine(Draining.ToString());
|
||||
output.WriteLine(Zeroing.ToString());
|
||||
output.WriteLine(PumpPower.ToString());
|
||||
output.WriteLine(MassRepeats.ToString());
|
||||
output.WriteLine(MassSpread.ToString());
|
||||
output.WriteLine(((byte)MassMethod).ToString());
|
||||
output.WriteLine(TimeBeforeFlow.ToString());
|
||||
output.WriteLine(TimeFlow2Mass.ToString());
|
||||
output.WriteLine(TimePump2StartV.ToString());
|
||||
output.WriteLine(TimeStop2Mass.ToString());
|
||||
output.WriteLine(FeedingPath);
|
||||
output.WriteLine(BenchPath);
|
||||
output.WriteLine(OutputPath);
|
||||
output.WriteLine(MetersPath);
|
||||
output.WriteLine(RelTransBefore);
|
||||
output.WriteLine(RelTransBetween);
|
||||
output.WriteLine(RelTransAfter);
|
||||
output.WriteLine(TransitionAfter);
|
||||
|
||||
foreach (var prms in MoreParams) { prms.Export(output); }
|
||||
output.WriteLine();
|
||||
}
|
||||
|
||||
public static Test Import(StreamReader input, Procedure newProcedure)
|
||||
{
|
||||
string firstLine = input.ReadLine();
|
||||
|
||||
if (string.IsNullOrEmpty(firstLine)) return null;
|
||||
|
||||
Test tst = new Test();
|
||||
tst.Name = firstLine;
|
||||
tst.Part = int.Parse(input.ReadLine());
|
||||
tst.Publish = sbyte.Parse(input.ReadLine());
|
||||
tst.Evaluate = bool.Parse(input.ReadLine());
|
||||
tst.Qfrom = float.Parse(input.ReadLine());
|
||||
tst.Qto = float.Parse(input.ReadLine());
|
||||
tst.Volume = float.Parse(input.ReadLine());
|
||||
tst.TstTime = float.Parse(input.ReadLine());
|
||||
tst.Method = input.ReadLine();
|
||||
tst.ErrLimLo = float.Parse(input.ReadLine());
|
||||
tst.ErrLimHi = float.Parse(input.ReadLine());
|
||||
tst.Uncertainty = float.Parse(input.ReadLine());
|
||||
tst.Repeats = int.Parse(input.ReadLine());
|
||||
tst.Draining = bool.Parse(input.ReadLine());
|
||||
tst.Zeroing = bool.Parse(input.ReadLine());
|
||||
tst.PumpPower = float.Parse(input.ReadLine());
|
||||
tst.MassRepeats = int.Parse(input.ReadLine());
|
||||
tst.MassSpread = float.Parse(input.ReadLine());
|
||||
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine());
|
||||
tst.TimeBeforeFlow = int.Parse(input.ReadLine());
|
||||
tst.TimeFlow2Mass = int.Parse(input.ReadLine());
|
||||
tst.TimePump2StartV = int.Parse(input.ReadLine());
|
||||
tst.TimeStop2Mass = int.Parse(input.ReadLine());
|
||||
tst.FeedingPath = input.ReadLine();
|
||||
tst.BenchPath = input.ReadLine();
|
||||
tst.OutputPath = input.ReadLine();
|
||||
tst.MetersPath = input.ReadLine();
|
||||
tst.RelTransBefore = input.ReadLine();
|
||||
tst.RelTransBetween = input.ReadLine();
|
||||
tst.RelTransAfter = input.ReadLine();
|
||||
tst.TransitionAfter = input.ReadLine();
|
||||
|
||||
while (true)
|
||||
{
|
||||
ComponentTest prms = ComponentTest.Import(input, tst);
|
||||
if (prms == null)
|
||||
break;
|
||||
else
|
||||
tst.MoreParams.Add(prms);
|
||||
}
|
||||
|
||||
tst.Procedure = newProcedure;
|
||||
return tst;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty;
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Config.Entities
|
||||
Volume = test.Volume;
|
||||
TstTime = test.TstTime;
|
||||
Repeats = test.Repeats;
|
||||
Emptying = test.Emptying;
|
||||
Emptying = test.Draining;
|
||||
Zeroing = test.Zeroing;
|
||||
PumpPower = PumpPower;
|
||||
Time2MassMsrmt = test.TimeStop2Mass;
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace Config.Mappings
|
||||
Map(x => x.StartValve);
|
||||
Map(x => x.Diverter);
|
||||
Map(x => x.TempDiv);
|
||||
Map(x => x.Balance);
|
||||
Map(x => x.Scale)
|
||||
.Column("Balance");
|
||||
Map(x => x.EmptyTankValve);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
|
||||
@@ -22,12 +22,14 @@ namespace Config.Mappings
|
||||
Map(x => x.Volume);
|
||||
Map(x => x.TstTime);
|
||||
Map(x => x.Repeats);
|
||||
Map(x => x.Emptying);
|
||||
Map(x => x.Draining)
|
||||
.Column("Emptying");
|
||||
Map(x => x.Zeroing);
|
||||
Map(x => x.PumpPower);
|
||||
Map(x => x.MassRepeats);
|
||||
Map(x => x.MassSpread);
|
||||
Map(x => x.MassMethod);
|
||||
Map(x => x.MassMethod)
|
||||
.CustomType<byte>();
|
||||
Map(x => x.TimeBeforeFlow);
|
||||
Map(x => x.TimeFlow2Mass);
|
||||
Map(x => x.TimePump2StartV)
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.12.499.0")]
|
||||
[assembly: AssemblyFileVersion("2.12.499.0")]
|
||||
[assembly: AssemblyVersion("2.12.518.0")]
|
||||
[assembly: AssemblyFileVersion("2.12.518.0")]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Config.Entities;
|
||||
|
||||
@@ -27,8 +26,10 @@ namespace Results.Entities
|
||||
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
|
||||
public virtual double Q2ErrWOCorrection { get; set; }
|
||||
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||
public virtual double Q2Correction { get; set; } /// iPerl Q2 correction used during the test
|
||||
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
|
||||
public virtual double Q2Correction { get; set; } /// !!! obsolete
|
||||
public virtual int Q2CorrRFlow { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
|
||||
public virtual int Q2CorrLFlow { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
||||
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
|
||||
public virtual double Diff2Hz8Hz { get; set; }
|
||||
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||
public virtual int Hz2Correction { get; set; } /// iPerl Q2 correction used during the test
|
||||
|
||||
@@ -30,7 +30,9 @@ namespace Results.Mappings
|
||||
Map(x => x.Q2ErrWOCorrection);
|
||||
Map(x => x.Q2CorrectionDone);
|
||||
Map(x => x.Q2Correction);
|
||||
Map(x => x.Q2CorrFlowRight);
|
||||
Map(x => x.Q2CorrRFlow);
|
||||
Map(x => x.Q2CorrLFlow);
|
||||
Map(x => x.Q2CorrFlowRight);
|
||||
Map(x => x.Diff2Hz8Hz);
|
||||
Map(x => x.Hz2CorrectionDone);
|
||||
Map(x => x.Hz2Correction);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BERLIN;LANG_DE</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -27,7 +27,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;BERLIN;LANG_DE</DefineConstants>
|
||||
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BERLIN;LANG_DE</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -31,7 +31,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;BERLIN;LANG_DE</DefineConstants>
|
||||
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -533,8 +533,8 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
logger.WriteLine(string.Format("JustierWert=0,2")); /// 0,2
|
||||
logger.WriteLine(string.Format("Corrected2Hz={0}", wMtr.Hz2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2Corrected={0}", wMtr.Q2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2CorrectionRight={0}", (int)Math.Round(wMtr.Q2Correction / 2)));
|
||||
logger.WriteLine(string.Format("Q2CorrectionLeft={0}", (int)Math.Round(wMtr.Q2Correction)));
|
||||
logger.WriteLine(string.Format("Q2CorrectionRight={0}", wMtr.Q2CorrRFlow));
|
||||
logger.WriteLine(string.Format("Q2CorrectionLeft={0}", wMtr.Q2CorrLFlow));
|
||||
logger.WriteLine(string.Format("Q2CorrectionFlowRight={0}", wMtr.Q2CorrFlowRight));
|
||||
logger.WriteLine(string.Format("FlowDirectionRight={0}", wMtr.Q2CorrFlowRight));
|
||||
logger.WriteLine(string.Format("Position={0}", wMtr.WMPosition));
|
||||
@@ -1102,8 +1102,8 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
parm = new OracleParameter("WITHQ2CORRECTION", OracleDbType.Int32); parm.Value = wm.Q2CorrectionDone ? 1 : 0; cmd.Parameters.Add(parm); ///:7
|
||||
parm = new OracleParameter("ERRQ2", OracleDbType.Double); parm.Value = q2ErrWOCorrection; cmd.Parameters.Add(parm); ///:8
|
||||
parm = new OracleParameter("Q2CORRECTIONFLOWRIGHT", OracleDbType.Int32);parm.Value = wm.Q2CorrFlowRight;/*1=right to left*/ cmd.Parameters.Add(parm); ///:9
|
||||
parm = new OracleParameter("Q2CORRECTIONLEFT", OracleDbType.Int32); parm.Value = (int)Math.Round(wm.Q2Correction); cmd.Parameters.Add(parm); ///:10
|
||||
parm = new OracleParameter("Q2CORRECTIONRIGHT", OracleDbType.Int32); parm.Value = (int)Math.Round(wm.Q2Correction / 2); cmd.Parameters.Add(parm); ///:11
|
||||
parm = new OracleParameter("Q2CORRECTIONLEFT", OracleDbType.Int32); parm.Value = wm.Q2CorrLFlow; cmd.Parameters.Add(parm); ///:10
|
||||
parm = new OracleParameter("Q2CORRECTIONRIGHT", OracleDbType.Int32); parm.Value = wm.Q2CorrRFlow; cmd.Parameters.Add(parm); ///:11
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
log.InfoFormat("VT_IP_ZAEHLER_PINDEX_PD inserted, PcbNr={0}, pruefix={1}", wm.SerialNr, max_Pruefindex);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -40,6 +40,8 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
completed = false;
|
||||
enabledComboBoxes = new List<ComboBox>();
|
||||
|
||||
Height = 147 + WaterMetersCount * 90;
|
||||
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
@@ -76,10 +76,10 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (WaterMetersCount >= 1) EndStateText[0] = textBox1.Text;
|
||||
if (WaterMetersCount >= 2) EndStateText[1] = textBox3.Text;
|
||||
if (WaterMetersCount >= 3) EndStateText[2] = textBox4.Text;
|
||||
if (WaterMetersCount >= 4) EndStateText[3] = textBox5.Text;
|
||||
if (WaterMetersCount >= 5) EndStateText[4] = textBox6.Text;
|
||||
if (WaterMetersCount >= 2) EndStateText[1] = textBox2.Text;
|
||||
if (WaterMetersCount >= 3) EndStateText[2] = textBox3.Text;
|
||||
if (WaterMetersCount >= 4) EndStateText[3] = textBox4.Text;
|
||||
if (WaterMetersCount >= 5) EndStateText[4] = textBox5.Text;
|
||||
if (WaterMetersCount >= 6) EndStateText[5] = textBox6.Text;
|
||||
|
||||
completed = true;
|
||||
|
||||
@@ -124,25 +124,25 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
///
|
||||
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleBeginningForm(myRef.waterMeters.Length);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleEndForm(myRef.waterMeters.Length);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(myRef.waterMeters.Length, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(myRef.waterMeters.Length, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -242,8 +242,10 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
wm.CalibFactor = iPerl.CalibrationFactor;
|
||||
wm.Q2ErrWOCorrection = iPerl.Q2ErrorWOCorrection;
|
||||
wm.Q2CorrectionDone = iPerl.Q2CorrectionDone;
|
||||
wm.Q2Correction = iPerl.Q2CorrectionFactor;
|
||||
wm.Diff2Hz8Hz = iPerl.Diff2Hz8Hz;
|
||||
wm.Q2Correction = iPerl.Q2Correction;
|
||||
wm.Q2CorrRFlow = iPerl.Q2CorrRFlow;
|
||||
wm.Q2CorrLFlow = iPerl.Q2CorrLFlow;
|
||||
wm.Diff2Hz8Hz = iPerl.Diff2Hz8Hz;
|
||||
wm.Hz2CorrectionDone = iPerl.Hz2CorrectionDone;
|
||||
wm.Hz2Correction = iPerl.Hz2CorrectionFactor;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -8,7 +8,7 @@ using Config.Entities;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.Balance
|
||||
{
|
||||
public class Component : ComponentBase, GenericDevices.IBalance, IOperation
|
||||
public class Component : ComponentBase, GenericDevices.IScale, IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString()
|
||||
@@ -26,8 +26,9 @@ namespace TBF.BenchControl.Dummy.Balance
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public int BalanceNr { get { return 0; } }
|
||||
public int ScaleNr { get { return 0; } }
|
||||
public double Capacity { get { return 10000.0; } }
|
||||
public GenericDevices.IValve DrainValve { get { return null; } }
|
||||
public bool IsEmpty(double mass) { return true; }
|
||||
public bool IsEmpty() { return true; }
|
||||
public string Format { get { return "F3"; } }
|
||||
@@ -48,7 +49,7 @@ namespace TBF.BenchControl.Dummy.Balance
|
||||
return this;
|
||||
}
|
||||
|
||||
public IOperation ReadStableMassOp(ref TBF.Boxes.DoubleBox mass, int readingsCount, double maxSpread, bool method)
|
||||
public IOperation ReadStableMassOp(ref TBF.Boxes.DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
{
|
||||
mass.Val = 0;
|
||||
return this;
|
||||
|
||||
@@ -510,7 +510,7 @@ ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
|
||||
/// <returns>Created operation</returns>
|
||||
public IOperation SetValvesOp(IValve valveOpen, IValve valveClose)
|
||||
{
|
||||
return new Valve.SetValvesOp(this, valveOpen, valveClose);
|
||||
return new SetValvesOp(this, valveOpen, valveClose);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -522,7 +522,7 @@ ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
|
||||
/// <returns>Created operation</returns>
|
||||
public IOperation SetValvesOp(IList<IValve> valvesOpen, IList<IValve> valvesClose)
|
||||
{
|
||||
return new Valve.SetValvesOp(this, valvesOpen, valvesClose);
|
||||
return new SetValvesOp(this, valvesOpen, valvesClose);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+18
-18
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -7,7 +7,7 @@ using log4net;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using Dirichlet.Numerics;
|
||||
|
||||
namespace TBF.BenchControl.Elde.Valve
|
||||
namespace TBF.BenchControl.Elde
|
||||
{
|
||||
public class SetValvesOp : IOperation
|
||||
{
|
||||
@@ -21,8 +21,8 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
public int TimeSec; /// Relative time in [s] from the start of the operation
|
||||
public IList<IValve> VOpen; /// List of valves to open in this point of time
|
||||
public IList<IValve> VClose; /// List of valves to close in this point of time
|
||||
public UInt128 MasksOpen; /// OR-ed bitmasks of valves to open in this point of time
|
||||
public UInt128 MasksClose; /// OR-ed bitmasks of valves to close in this point of time
|
||||
public UInt128 MasksOpen; /// OR-ed bitmasks of valves to open in this point of time
|
||||
public UInt128 MasksClose; /// OR-ed bitmasks of valves to close in this point of time
|
||||
|
||||
public SwitchPoint(int time, IList<IValve> vOpen, IList<IValve> vClose)
|
||||
{
|
||||
@@ -42,9 +42,9 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
foreach (var vlv in VOpen)
|
||||
{
|
||||
/// Skip the delay evaluation and update in case the valve/pump have not changed
|
||||
if (vlv is Valve && ((vlv as Valve).Mask & changed) == 0) continue;
|
||||
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is Valve.Valve && ((vlv as Valve.Valve).Mask & changed) == 0) continue;
|
||||
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is Danfoss.VLT2800.Pump && ((vlv as Danfoss.VLT2800.Pump).Mask & changed) == 0) continue;
|
||||
|
||||
if ((vlv != null) && (vlv.Delay > max)) max = vlv.Delay;
|
||||
@@ -52,9 +52,9 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
foreach (var vlv in VClose)
|
||||
{
|
||||
/// Skip the delay evaluation and update in case the valve/pump have not changed
|
||||
if (vlv is Valve && ((vlv as Valve).Mask & changed) == 0) continue;
|
||||
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is Valve.Valve && ((vlv as Valve.Valve).Mask & changed) == 0) continue;
|
||||
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
||||
if (vlv is Danfoss.VLT2800.Pump && ((vlv as Danfoss.VLT2800.Pump).Mask & changed) == 0) continue;
|
||||
|
||||
if ((vlv != null) && (vlv.Delay > max)) max = vlv.Delay;
|
||||
@@ -152,20 +152,20 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
point.MasksOpen = 0;
|
||||
foreach (var valve in point.VOpen)
|
||||
{
|
||||
if (valve is Valve) point.MasksOpen |= (valve as Valve).Mask;
|
||||
if (valve is Pump.Pump) point.MasksOpen |= (valve as Pump.Pump).Mask;
|
||||
if (valve is PumpWithFM.Pump) point.MasksOpen |= (valve as PumpWithFM.Pump).Mask;
|
||||
if (valve is Valve.Valve) point.MasksOpen |= (valve as Valve.Valve).Mask;
|
||||
if (valve is Pump.Pump) point.MasksOpen |= (valve as Pump.Pump).Mask;
|
||||
if (valve is PumpWithFM.Pump) point.MasksOpen |= (valve as PumpWithFM.Pump).Mask;
|
||||
if (valve is Danfoss.VLT2800.Pump) point.MasksOpen |= (valve as Danfoss.VLT2800.Pump).Mask;
|
||||
if (valve is PumpTandem.Pump) point.MasksOpen |= (valve as PumpTandem.Pump).Mask;
|
||||
if (valve is PumpTandem.Pump) point.MasksOpen |= (valve as PumpTandem.Pump).Mask;
|
||||
}
|
||||
point.MasksClose = 0;
|
||||
foreach (var valve in point.VClose)
|
||||
{
|
||||
if (valve is Valve) point.MasksClose |= (valve as Valve).Mask;
|
||||
if (valve is Pump.Pump) point.MasksClose |= (valve as Pump.Pump).Mask;
|
||||
if (valve is PumpWithFM.Pump) point.MasksClose |= (valve as PumpWithFM.Pump).Mask;
|
||||
if (valve is Valve.Valve) point.MasksClose |= (valve as Valve.Valve).Mask;
|
||||
if (valve is Pump.Pump) point.MasksClose |= (valve as Pump.Pump).Mask;
|
||||
if (valve is PumpWithFM.Pump) point.MasksClose |= (valve as PumpWithFM.Pump).Mask;
|
||||
if (valve is Danfoss.VLT2800.Pump) point.MasksClose |= (valve as Danfoss.VLT2800.Pump).Mask;
|
||||
if (valve is PumpTandem.Pump) point.MasksClose |= (valve as PumpTandem.Pump).Mask;
|
||||
if (valve is PumpTandem.Pump) point.MasksClose |= (valve as PumpTandem.Pump).Mask;
|
||||
}
|
||||
point.TimeSec += timeShift;
|
||||
}
|
||||
@@ -169,6 +169,8 @@ namespace TBF.BenchControl
|
||||
No,
|
||||
Next, /// To move to the next state when debugging
|
||||
OK,
|
||||
Retry,
|
||||
Abort,
|
||||
TimerBusy,
|
||||
SetOutputsDone,
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface ICamera : Generic.IComponent
|
||||
{
|
||||
void ClearRois();
|
||||
void ClearRoiParams();
|
||||
|
||||
int RegisterRoi(string roiParams); /// returns 0=NOK or handle (=index)
|
||||
|
||||
int GetResult(int roiHandle); /// returns result for a registered ROI
|
||||
int GetResult(int roiHandle, out long timeMs); /// returns result for a registered ROI and camera time in ms
|
||||
|
||||
/// <summary>
|
||||
/// Display live image.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface ICameraDisplay : Generic.IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Display static images.
|
||||
/// </summary>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
IOperation ShowStaticImageOp(string[] imageFileNames, string title);
|
||||
|
||||
/// <summary>
|
||||
/// Display static images.
|
||||
/// </summary>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
IOperation ShowLiveStreamOp(string[] imageFileNames, string title);
|
||||
|
||||
|
||||
bool[] SelectedImages { get; }
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,18 @@ namespace TBF.BenchControl.GenericDevices
|
||||
public interface IRoi : IComponent, IRegisterReader
|
||||
{
|
||||
GenericDevices.ICamera Camera { get; }
|
||||
bool Detected { get; }
|
||||
string DetectedImageName { get; }
|
||||
|
||||
bool Detected { get; set; }
|
||||
void ClearRoi();
|
||||
|
||||
void RegisterRoiToCamera();
|
||||
|
||||
double VolumeStart { get; } /// in l
|
||||
double VolumeEnd { get; } /// in l
|
||||
double TimestampStart { get; } /// in s
|
||||
double TimestampEnd { get; } /// in s
|
||||
|
||||
/// <summary>
|
||||
/// Watermeter wheel/arrow detection process.
|
||||
/// </summary>
|
||||
|
||||
+9
-4
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
@@ -10,18 +10,23 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Basic balance functions
|
||||
/// </summary>
|
||||
public interface IBalance : IComponent
|
||||
public interface IScale : IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Balance number: 0-based index required for communication with the Elde component
|
||||
/// </summary>
|
||||
int BalanceNr { get; }
|
||||
int ScaleNr { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Balance water tank capacity in kg or ltr
|
||||
/// </summary>
|
||||
double Capacity { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Water tank drain valve or 'null'
|
||||
/// </summary>
|
||||
IValve DrainValve { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if tank s empty, mass is less then some threshold
|
||||
/// </summary>
|
||||
@@ -73,6 +78,6 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <param name="maxSpread">Maximum spread of measurements in kg (otherwise the measurement continues)</param>
|
||||
/// <param name="method">Method: false = slow (precise), true = fast (immediate)</param>
|
||||
/// <returns>ReadMassAverageOp instance reference casted to IOperaton</returns>
|
||||
IOperation ReadStableMassOp(ref DoubleBox mass, int readingsCount, double maxSpread, bool method);
|
||||
IOperation ReadStableMassOp(ref DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IBalance2 : IBalance, IComponent
|
||||
public interface IScale2 : IScale, IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Events: Done, Error
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IBalanceCfg : IComponentCfg
|
||||
public interface IScaleCfg : IComponentCfg
|
||||
{
|
||||
///
|
||||
/// Parameters displayed in Metrology tab page
|
||||
@@ -8,7 +8,9 @@ using System.Text;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface ITankDraining
|
||||
public interface ITankDraining : ISequenceCondition
|
||||
{
|
||||
IValve DrainValve { get; }
|
||||
bool IsEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace TBF.BenchControl.Keithley.Multimeter_2010_RS232
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
if (multimeterCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
if (serialPort == null) return;
|
||||
|
||||
receivedData.Append(serialPort.ReadExisting());
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace TBF.BenchControl.Keithley.Multimeter_2010_RS232
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceAfter()
|
||||
{
|
||||
if (multimeterCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
if (serialPort == null) return;
|
||||
|
||||
switch (scanState)
|
||||
{
|
||||
@@ -297,7 +297,11 @@ namespace TBF.BenchControl.Keithley.Multimeter_2010_RS232
|
||||
{
|
||||
if (multimeterCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
|
||||
serialPort.Close();
|
||||
if (serialPort != null)
|
||||
{
|
||||
serialPort.Close();
|
||||
serialPort = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
{
|
||||
public class BalanceCfg : ComponentCfgBase, GenericDevices.IBalanceCfg, GenericDevices.ICalibInfoCfg
|
||||
public class BalanceCfg : ComponentCfgBase, GenericDevices.IScaleCfg, GenericDevices.ICalibInfoCfg
|
||||
{
|
||||
public IComponentCfgCtrl GetControl() { return new BalanceCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
/// <note>
|
||||
/// Implemented and tested on 15.10.2013 by Milan Hanajik
|
||||
/// </note>
|
||||
public class BalanceDev : ComponentBase, IDevice, GenericDevices.IBalance
|
||||
public class BalanceDev : TankDraining, IDevice, GenericDevices.IScale
|
||||
{
|
||||
/// <summary>
|
||||
/// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..."
|
||||
@@ -48,7 +48,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
protected static SerialPort serialPort;
|
||||
protected static StringBuilder stringBuilder;
|
||||
|
||||
public int BalanceNr { get { return balanceNr; } }
|
||||
public int ScaleNr { get { return balanceNr; } }
|
||||
public int IdNr { get { return balanceCfg.IdNr; } }
|
||||
public double Capacity { get { return balanceCfg.Capacity; } }
|
||||
public double Resolution { get { return balanceCfg.Resolution; } }
|
||||
@@ -276,7 +276,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
/// <summary>Stop this device</summary>
|
||||
public void StopDevice()
|
||||
{
|
||||
if (balanceCfg.IdNr == 1 && serialPort != null)
|
||||
if ((balanceCfg.DebugLevel != DebugMode.Simulate) && (balanceCfg.IdNr == 1) && (serialPort != null))
|
||||
{
|
||||
serialPort.Close();
|
||||
serialPort = null;
|
||||
@@ -311,7 +311,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
/// <param name="maxSpread">Maximum spread of measurements in kg (otherwise the measurement continues)</param>
|
||||
/// <param name="method">Method: false = slow (precise), true = fast (immediate)</param>
|
||||
/// <returns>ReadMassAverageOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadStableMassOp(ref DoubleBox mass, int readingsCount, double maxSpread, bool method)
|
||||
public IOperation ReadStableMassOp(ref DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
{
|
||||
return new ReadStableMassOp(this, ref mass, readingsCount, maxSpread, method);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
@@ -22,8 +22,8 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
/// Set by the constructor
|
||||
BalanceDev balanceDev;
|
||||
int totalReadingsCount;
|
||||
double maxSpread; /// Maximum spread of measurements in kg (otherwise the measurement continues)
|
||||
bool method; /// false = slow (precise), true = fast (immediate)
|
||||
double maxSpread; /// Maximum spread of measurements in kg (otherwise the measurement continues)
|
||||
Config.Entities.MassMethod method; /// false = slow (precise), true = fast (immediate)
|
||||
DoubleBox result;
|
||||
|
||||
bool started;
|
||||
@@ -36,24 +36,14 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
/// <param name="readingsCount">Required mass readings count (>= 3)</param>
|
||||
/// <param name="maxSpread">Maximum spread of measurements in kg (otherwise the measurement continues)</param>
|
||||
/// <param name="method">Method: false = slow (precise), true = fast (immediate)</param>
|
||||
public ReadStableMassOp(BalanceDev balanceDev, ref DoubleBox result, int readingsCount, double maxSpread, bool method)
|
||||
public ReadStableMassOp(BalanceDev balanceDev, ref DoubleBox result, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
{
|
||||
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
|
||||
this.balanceDev = balanceDev;
|
||||
|
||||
if (readingsCount == 0)
|
||||
this.totalReadingsCount = 5;
|
||||
else if (readingsCount < 3)
|
||||
this.totalReadingsCount = 3;
|
||||
else
|
||||
this.totalReadingsCount = readingsCount;
|
||||
|
||||
if (maxSpread == 0)
|
||||
this.maxSpread = balanceDev.Capacity / 20000;
|
||||
else
|
||||
this.maxSpread = maxSpread;
|
||||
|
||||
this.method = method;
|
||||
this.totalReadingsCount = (readingsCount < 4) ? 5 : readingsCount; /// readingsCount is at least 4
|
||||
this.maxSpread = (maxSpread == 0) ? (balanceDev.Capacity / 20000.0) : maxSpread;
|
||||
this.method = method;
|
||||
|
||||
this.result = result;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
{
|
||||
public class BalanceCfg : ComponentCfgBase, GenericDevices.IBalanceCfg, GenericDevices.ICalibInfoCfg, GenericDevices.ITankDrainingCfg
|
||||
public class BalanceCfg : ComponentCfgBase, GenericDevices.IScaleCfg, GenericDevices.ICalibInfoCfg, GenericDevices.ITankDrainingCfg
|
||||
{
|
||||
public IComponentCfgCtrl GetControl() { return new BalanceCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// <note>
|
||||
/// Implemented and tested on 15.10.2013 by Milan Hanajik
|
||||
/// </note>
|
||||
public class BalanceDev : TankDraining, IDevice, GenericDevices.IBalance
|
||||
public class BalanceDev : TankDraining, IDevice, GenericDevices.IScale
|
||||
{
|
||||
/// <summary>
|
||||
/// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..."
|
||||
@@ -47,7 +47,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
protected SerialPort serialPort;
|
||||
protected StringBuilder stringBuilder;
|
||||
|
||||
public int BalanceNr { get { return balanceNr; } }
|
||||
public int ScaleNr { get { return balanceNr; } }
|
||||
public double Capacity { get { return balanceCfg.Capacity; } }
|
||||
public int EmptyTimeSec { get { return balanceCfg.DrainTimeSec; } }
|
||||
|
||||
@@ -102,6 +102,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
base.Initalize();
|
||||
|
||||
msrmntState = MsrmntState.Failed; /// Data not valid yet
|
||||
|
||||
if (balanceCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
@@ -115,7 +117,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
log.FatalFormat("Successfully initialized device {0}", ToString());
|
||||
}
|
||||
|
||||
public bool IsEmpty()
|
||||
public override bool IsEmpty()
|
||||
{
|
||||
return (this.mass <= balanceCfg.Empty);
|
||||
}
|
||||
@@ -242,6 +244,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// </summary>
|
||||
public virtual void RunDeviceBefore()
|
||||
{
|
||||
base.RunBefore();
|
||||
|
||||
if (balanceCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
Masses[balanceNr] = TestBenchSim.GetSimMass(balanceNr);
|
||||
@@ -442,19 +446,17 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceAfter()
|
||||
{
|
||||
}
|
||||
base.RunAfter();
|
||||
}
|
||||
|
||||
/// <summary>Stop this device</summary>
|
||||
public void StopDevice()
|
||||
{
|
||||
try
|
||||
if ((balanceCfg.DebugLevel != DebugMode.Simulate) && (serialPort != null))
|
||||
{
|
||||
serialPort.Close();
|
||||
serialPort = null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -485,7 +487,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// <param name="maxSpread">Maximum spread of measurements in kg (otherwise the measurement continues)</param>
|
||||
/// <param name="method">Method: false = slow (precise), true = fast (immediate)</param>
|
||||
/// <returns>ReadMassAverageOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadStableMassOp(ref DoubleBox mass, int readingsCount, double maxSpread, bool method)
|
||||
public IOperation ReadStableMassOp(ref DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
{
|
||||
return new ReadStableMassOp(this, ref mass, readingsCount, maxSpread, method);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Author: Milan Hanajik
|
||||
///
|
||||
using System;
|
||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// <note>
|
||||
/// Implemented and tested on 15.10.2013 by Milan Hanajik
|
||||
/// </note>
|
||||
public class BalanceNewDev : BalanceDev, IDevice, GenericDevices.IBalance2
|
||||
public class BalanceNewDev : BalanceDev, IDevice, GenericDevices.IScale2
|
||||
{
|
||||
/// <summary>
|
||||
/// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..."
|
||||
@@ -67,6 +67,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// </summary>
|
||||
public override void RunDeviceBefore()
|
||||
{
|
||||
base.RunBefore();
|
||||
|
||||
if (balanceCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
mass = TestBenchSim.GetSimMass(balanceNr);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -18,7 +18,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// <note>
|
||||
/// Implemented and tested on 15.10.2013 by Milan Hanajik
|
||||
/// </note>
|
||||
public class BalanceOld : BalanceDev, IDevice, GenericDevices.IBalance
|
||||
public class BalanceOld : BalanceDev, IDevice, GenericDevices.IScale
|
||||
{
|
||||
/// <summary>
|
||||
/// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..."
|
||||
@@ -61,6 +61,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// </summary>
|
||||
public override void RunDeviceBefore()
|
||||
{
|
||||
base.RunBefore();
|
||||
|
||||
if (balanceCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
mass = TestBenchSim.GetSimMass(balanceNr);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
@@ -15,46 +15,42 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadStableMassOp));
|
||||
public override string ToString() { return string.Format("ReadStableMassOp(.,{0},.)", totalReadingsCount); }
|
||||
|
||||
/// Set by the constructor
|
||||
BalanceDev balanceDev;
|
||||
int totalReadingsCount;
|
||||
double maxSpread; /// Maximum spread of measurements in kg (otherwise the measurement continues)
|
||||
Config.Entities.MassMethod method; /// by the scale, mass spread threshold or mass standard deviation threshold
|
||||
DoubleBox result;
|
||||
|
||||
/// Operation specific
|
||||
double[] massReadings;
|
||||
int currentReadingsCount;
|
||||
|
||||
/// Set by the constructor
|
||||
BalanceDev balanceDev;
|
||||
int totalReadingsCount;
|
||||
double maxSpread; /// Maximum spread of measurements in kg (otherwise the measurement continues)
|
||||
bool method; /// false = slow (precise), true = fast (immediate)
|
||||
DoubleBox result;
|
||||
bool measurementCompleted;
|
||||
|
||||
/// <summary>
|
||||
/// Events: BalanceDone, Error
|
||||
/// </summary>
|
||||
/// <param name="balanceDev">Balance device instance</param>
|
||||
/// <param name="result">Reference to the measured mass in kg</param>
|
||||
/// <param name="readingsCount">Required mass readings count (>= 3)</param>
|
||||
/// <param name="readingsCount">Required mass readings count (>= 4)</param>
|
||||
/// <param name="maxSpread">Maximum spread of measurements in kg (otherwise the measurement continues)</param>
|
||||
/// <param name="method">Method: false = slow (precise), true = fast (immediate)</param>
|
||||
public ReadStableMassOp(BalanceDev balanceDev, ref DoubleBox result, int readingsCount, double maxSpread, bool method)
|
||||
public ReadStableMassOp(BalanceDev balanceDev, ref DoubleBox result, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
{
|
||||
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
|
||||
this.balanceDev = balanceDev;
|
||||
|
||||
if (readingsCount == 0)
|
||||
this.totalReadingsCount = 5;
|
||||
else if (readingsCount < 3)
|
||||
this.totalReadingsCount = 3;
|
||||
else
|
||||
this.totalReadingsCount = readingsCount;
|
||||
|
||||
if (maxSpread == 0)
|
||||
this.maxSpread = balanceDev.Capacity / 20000;
|
||||
else
|
||||
this.maxSpread = maxSpread;
|
||||
|
||||
this.method = method;
|
||||
this.totalReadingsCount = (readingsCount < 4) ? 5 : readingsCount; /// readingsCount is at least 4
|
||||
this.maxSpread = (maxSpread == 0) ? (balanceDev.Capacity / 20000.0) : maxSpread;
|
||||
this.method = method;
|
||||
|
||||
this.result = result;
|
||||
|
||||
massReadings = new double[totalReadingsCount];
|
||||
currentReadingsCount = 0;
|
||||
measurementCompleted = false;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@@ -62,12 +58,12 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
public void Start()
|
||||
{
|
||||
currentReadingsCount = 0;
|
||||
massReadings = new double[totalReadingsCount];
|
||||
measurementCompleted = false;
|
||||
|
||||
if (method)
|
||||
balanceDev.GetImmediateMassMeasurement();
|
||||
else
|
||||
if (method == Config.Entities.MassMethod.Scale)
|
||||
balanceDev.GetStableMassMeasurement();
|
||||
else
|
||||
balanceDev.GetImmediateMassMeasurement();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
@@ -78,68 +74,103 @@ namespace TBF.BenchControl.MettlerToledo.Standard
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (currentReadingsCount >= totalReadingsCount) return Event.BalanceDone; /// Mass has already been calculated
|
||||
|
||||
if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.None;
|
||||
if (measurementCompleted) return Event.BalanceDone;
|
||||
|
||||
if (balanceDev.MsrmntState == MsrmntState.Busy)
|
||||
{
|
||||
return Event.None; /// Wait for a mass measurement
|
||||
}
|
||||
|
||||
if (balanceDev.MsrmntState == MsrmntState.Valid)
|
||||
{
|
||||
massReadings[currentReadingsCount++] = balanceDev.Mass;
|
||||
|
||||
if (currentReadingsCount == totalReadingsCount)
|
||||
/// Save the measurement
|
||||
if (currentReadingsCount < totalReadingsCount)
|
||||
{
|
||||
#if true /// OLD_WAY_OF_MASS_CALCULATION
|
||||
/// Exclude min. and max. value, calculate average
|
||||
Array.Sort(massReadings);
|
||||
double calcMass = 0;
|
||||
for (int i = 1; i < totalReadingsCount - 1; i++)
|
||||
{
|
||||
calcMass += massReadings[i];
|
||||
}
|
||||
calcMass = (calcMass / (totalReadingsCount - 2));
|
||||
log.InfoFormat("ReadStableMassOp.Run() ... valid mass={0} ... returning Event.BalanceDone", calcMass);
|
||||
result.Val = calcMass;
|
||||
return Event.BalanceDone; /// Mass has just been calculated
|
||||
#else
|
||||
double minimum = double.MaxValue;
|
||||
double maximum = double.MinValue;
|
||||
foreach (double val in massReadings)
|
||||
{
|
||||
if (val < minimum) minimum = val;
|
||||
if (val > maximum) maximum = val;
|
||||
}
|
||||
|
||||
if ((maximum - minimum) <= maxSpread)
|
||||
{
|
||||
double calcMass = 0;
|
||||
for (int i = 0; i < totalReadingsCount; i++)
|
||||
{
|
||||
calcMass += massReadings[i];
|
||||
}
|
||||
calcMass = (calcMass / totalReadingsCount);
|
||||
log.InfoFormat("ReadStableMassOp.Run() ... valid mass={0} ... returning Event.BalanceDone", calcMass);
|
||||
result.Val = calcMass;
|
||||
return Event.BalanceDone; /// Mass has just been calculated
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Shift data and decrement 'currentReadingsCount'
|
||||
for (int i = 0; i < totalReadingsCount - 1; i++)
|
||||
{
|
||||
massReadings[i] = massReadings[i + 1];
|
||||
}
|
||||
currentReadingsCount--;
|
||||
}
|
||||
#endif
|
||||
massReadings[currentReadingsCount++] = balanceDev.Mass;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Shift data in the (already full) buffer, save the mass into the last buffer item
|
||||
for (int i = 1; i < totalReadingsCount; i++)
|
||||
{
|
||||
massReadings[i - 1] = massReadings[i];
|
||||
}
|
||||
massReadings[totalReadingsCount - 1] = balanceDev.Mass;
|
||||
}
|
||||
}
|
||||
|
||||
if (method)
|
||||
balanceDev.GetImmediateMassMeasurement();
|
||||
else
|
||||
balanceDev.GetStableMassMeasurement();
|
||||
|
||||
return Event.None;
|
||||
if (currentReadingsCount >= totalReadingsCount)
|
||||
{
|
||||
Array.Sort(massReadings);
|
||||
|
||||
#if STABLE_MASS_EXTRAS
|
||||
if (method == Config.Entities.MassMethod.Spread)
|
||||
{
|
||||
/// Immediate mass measurement, end condition calculated below
|
||||
|
||||
if ((massReadings[totalReadingsCount - 2] - massReadings[1]) <= maxSpread)
|
||||
{
|
||||
double massSum = 0;
|
||||
for (int i = 1; i < totalReadingsCount - 1; i++) massSum += massReadings[i];
|
||||
result.Val = (massSum / (totalReadingsCount - 2));
|
||||
log.InfoFormat("ReadStableMassOp.Run() ... valid mass={0} ... returning Event.BalanceDone", result.Val);
|
||||
|
||||
measurementCompleted = true;
|
||||
return Event.BalanceDone; /// Mass has just been calculated
|
||||
}
|
||||
}
|
||||
else if (method == Config.Entities.MassMethod.StdDev)
|
||||
{
|
||||
/// Immediate mass measurement, end condition calculated below
|
||||
|
||||
double massSum = 0;
|
||||
for (int i = 1; i < totalReadingsCount - 1; i++) massSum += massReadings[i];
|
||||
double ave = (massSum / (totalReadingsCount - 2));
|
||||
double sdev = 0;
|
||||
for (int i = 1; i < totalReadingsCount - 1; i++) sdev += ((massReadings[i] - ave) * (massReadings[i] - ave));
|
||||
|
||||
if (Math.Sqrt(sdev / (totalReadingsCount - 2)) <= maxSpread)
|
||||
{
|
||||
result.Val = ave;
|
||||
log.InfoFormat("ReadStableMassOp.Run() ... valid mass={0} ... returning Event.BalanceDone", result.Val);
|
||||
|
||||
measurementCompleted = true;
|
||||
return Event.BalanceDone; /// Mass has just been calculated
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/// Stable mass measurement
|
||||
|
||||
/// Sort, exclude min. and max. values, calculate the average
|
||||
double massSum = 0;
|
||||
for (int i = 1; i < totalReadingsCount - 1; i++) massSum += massReadings[i];
|
||||
result.Val = (massSum / (totalReadingsCount - 2));
|
||||
log.InfoFormat("ReadStableMassOp.Run() ... valid mass={0} ... returning Event.BalanceDone", result.Val);
|
||||
|
||||
measurementCompleted = true;
|
||||
return Event.BalanceDone; /// Mass has just been calculated
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (measurementCompleted)
|
||||
{
|
||||
return Event.BalanceDone;
|
||||
}
|
||||
else
|
||||
{
|
||||
///
|
||||
/// Start a new measurement
|
||||
///
|
||||
if (method == Config.Entities.MassMethod.Scale)
|
||||
balanceDev.GetStableMassMeasurement();
|
||||
else
|
||||
balanceDev.GetImmediateMassMeasurement();
|
||||
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
|
||||
@@ -2,25 +2,155 @@
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.MettlerToledo
|
||||
{
|
||||
public class TankDraining : ComponentBase
|
||||
public enum DrainState
|
||||
{
|
||||
public GenericDevices.IValve DrainValve;
|
||||
None,
|
||||
OpeningDV_Start,
|
||||
OpeningDV_Run,
|
||||
OpeningDV_Stop,
|
||||
Draining,
|
||||
ClosingDV_Start,
|
||||
ClosingDV_Run,
|
||||
ClosingDV_Stop,
|
||||
TankClosed,
|
||||
}
|
||||
|
||||
public class TankDraining : ComponentBase, ITankDraining
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(TankDraining));
|
||||
|
||||
|
||||
readonly GenericDevices.ITankDrainingCfg tankDrainingCfg;
|
||||
|
||||
private IValve drainValve;
|
||||
public GenericDevices.IValve DrainValve { get { return drainValve; } }
|
||||
|
||||
private IOperation openDrainValveOp;
|
||||
private IOperation closeDrainValveOp;
|
||||
|
||||
|
||||
DrainState drainState;
|
||||
|
||||
GenericDevices.ITankDrainingCfg tankManagementCfg;
|
||||
|
||||
public TankDraining()
|
||||
: base()
|
||||
{
|
||||
CreateConditions(false);
|
||||
}
|
||||
|
||||
public TankDraining(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
tankManagementCfg = cfg as GenericDevices.ITankDrainingCfg;
|
||||
if (tankManagementCfg == null) throw new Exception(string.Format("Cannot create component {0}", cfg.Name));
|
||||
tankDrainingCfg = cfg as GenericDevices.ITankDrainingCfg;
|
||||
if (tankDrainingCfg == null) throw new Exception(string.Format("Cannot create component {0}", cfg.Name));
|
||||
CreateConditions(true);
|
||||
}
|
||||
|
||||
protected void Initalize()
|
||||
{
|
||||
drainValve = TbfComponents.FindComponent(tankDrainingCfg.DrainValve) as IValve;
|
||||
openDrainValveOp = new Elde.SetValvesOp(StateMachine.ControlBoard, drainValve, null);
|
||||
closeDrainValveOp = new Elde.SetValvesOp(StateMachine.ControlBoard, null, drainValve);
|
||||
}
|
||||
|
||||
protected void RunBefore()
|
||||
{
|
||||
switch (drainState)
|
||||
{
|
||||
case DrainState.OpeningDV_Start:
|
||||
openDrainValveOp.Start();
|
||||
drainState = DrainState.OpeningDV_Run;
|
||||
return;
|
||||
|
||||
case DrainState.OpeningDV_Run:
|
||||
if (openDrainValveOp.Run() == Event.ValvesSet) drainState = DrainState.OpeningDV_Stop;
|
||||
return;
|
||||
|
||||
case DrainState.OpeningDV_Stop:
|
||||
openDrainValveOp.Stop();
|
||||
return;
|
||||
|
||||
case DrainState.Draining:
|
||||
if (IsEmpty()) drainState = DrainState.ClosingDV_Start;
|
||||
return;
|
||||
|
||||
case DrainState.ClosingDV_Start:
|
||||
closeDrainValveOp.Start();
|
||||
drainState = DrainState.ClosingDV_Run;
|
||||
return;
|
||||
|
||||
case DrainState.ClosingDV_Run:
|
||||
if (closeDrainValveOp.Run() == Event.ValvesSet) drainState = DrainState.ClosingDV_Stop;
|
||||
return;
|
||||
|
||||
case DrainState.ClosingDV_Stop:
|
||||
closeDrainValveOp.Stop();
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected void RunAfter() { } /// Not used
|
||||
|
||||
|
||||
public virtual string GetName() { return string.Empty; }
|
||||
public virtual bool IsEmpty() { return false; }
|
||||
|
||||
///
|
||||
/// ISequenceCondition interface implementation (conditions in transition sequences)
|
||||
///
|
||||
IList<string> sequenceConditionNames;
|
||||
IList<IOperation> sequenceConditions;
|
||||
|
||||
public int ConditionsCount { get { return sequenceConditions != null ? sequenceConditions.Count : 0; } }
|
||||
|
||||
/// Strings are added to the combo-box for transition sequence condition selection
|
||||
public string ConditionName(int i)
|
||||
{
|
||||
if (sequenceConditionNames != null && i < sequenceConditionNames.Count && i >= 0)
|
||||
return sequenceConditionNames[i];
|
||||
else
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// Operations are executed as a part of a transition sequence
|
||||
public IOperation ConditionOp(int i)
|
||||
{
|
||||
if (sequenceConditions != null && i < sequenceConditions.Count && i >= 0)
|
||||
return sequenceConditions[i];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
void ClearConditions()
|
||||
{
|
||||
sequenceConditionNames = new List<string>();
|
||||
sequenceConditions = new List<IOperation>();
|
||||
}
|
||||
|
||||
void AddCondition(string conditionName, bool createOperation, IOperation conditionOperation)
|
||||
{
|
||||
sequenceConditionNames.Add(conditionName);
|
||||
if (createOperation) sequenceConditions.Add(conditionOperation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a list of conditions
|
||||
/// </summary>
|
||||
/// <param name="createOps">true = create names and condition operations, false = create names only</param>
|
||||
void CreateConditions(bool createOps)
|
||||
{
|
||||
ClearConditions();
|
||||
AddCondition(string.Format(Strings.Wait_until_0_tank_is_empty, GetName()), createOps, new WaitTankEmptyOp(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using log4net;
|
||||
|
||||
namespace TBF.BenchControl.MettlerToledo
|
||||
{
|
||||
public class WaitTankEmptyOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(WaitTankEmptyOp));
|
||||
public override string ToString() { return string.Format("WaitTankEmptyOp()"); }
|
||||
|
||||
readonly GenericDevices.ITankDraining tankDraining;
|
||||
|
||||
bool conditionMet;
|
||||
|
||||
/// <summary>
|
||||
/// Events: ConditionMet, ConditionNotMet
|
||||
/// </summary>
|
||||
/// <param name="tankDraining">Tank draining (Balance device) instance</param>
|
||||
public WaitTankEmptyOp(GenericDevices.ITankDraining tankDraining)
|
||||
{
|
||||
this.tankDraining = tankDraining;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
conditionMet = tankDraining.IsEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>
|
||||
/// Event.ConditionMet . . . tank is empty
|
||||
/// Event.ConditionNotMet . tank is not empty
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
conditionMet = conditionMet || tankDraining.IsEmpty();
|
||||
|
||||
return conditionMet ? Event.ConditionMet : Event.ConditionNotMet;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,26 +298,18 @@ namespace TBF.BenchControl.Modbus.TankSelector
|
||||
public string ConditionName(int i)
|
||||
{
|
||||
if (sequenceConditionNames != null && i < sequenceConditionNames.Count && i >= 0)
|
||||
{
|
||||
return sequenceConditionNames[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// Operations are executed as a part of a transition sequence
|
||||
public IOperation ConditionOp(int i)
|
||||
{
|
||||
if (sequenceConditions != null && i < sequenceConditions.Count && i >= 0)
|
||||
{
|
||||
return sequenceConditions[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearConditions()
|
||||
|
||||
@@ -77,7 +77,8 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
Session wscpSession;
|
||||
bool wscpOpened;
|
||||
bool closeWscpThread;
|
||||
string wscpFileName;
|
||||
string wscpSrcFileName;
|
||||
string wscpDstFileName;
|
||||
enum WscpCommand
|
||||
{
|
||||
None,
|
||||
@@ -90,9 +91,10 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
/// ROI related parameters
|
||||
///
|
||||
IList<string> roiParams;
|
||||
long cameraTimeMs;
|
||||
int[] result;
|
||||
///
|
||||
public void ClearRois() { roiParams.Clear(); }
|
||||
public void ClearRoiParams() { roiParams.Clear(); }
|
||||
public int RegisterRoi(string rParams)
|
||||
{
|
||||
this.roiParams.Add(rParams);
|
||||
@@ -101,8 +103,10 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
return newHandle;
|
||||
}
|
||||
///
|
||||
public int GetResult(int roiHandle)
|
||||
public int GetResult(int roiHandle, out long timeMs)
|
||||
{
|
||||
timeMs = cameraTimeMs;
|
||||
|
||||
if (roiHandle > 0 && roiHandle <= roiParams.Count)
|
||||
{
|
||||
return result[roiHandle - 1];
|
||||
@@ -113,6 +117,18 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
|
||||
|
||||
|
||||
///
|
||||
/// UDP Port number for 'MeasurementOp'
|
||||
///
|
||||
const int UdpPortRangeStart = 13800;
|
||||
const int UdpPortRangeEnd = 13850;
|
||||
static int nextUdpPortNr = UdpPortRangeStart;
|
||||
public static int GetNextUdpPortNr() { return nextUdpPortNr++; }
|
||||
///
|
||||
readonly int measurementUdpPortNr;
|
||||
UdpClient measurementListener;
|
||||
|
||||
|
||||
public Camera() {}
|
||||
|
||||
public Camera(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
@@ -125,6 +141,8 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
Telnet = null;
|
||||
terminalDlg = null;
|
||||
|
||||
measurementUdpPortNr = GetNextUdpPortNr();
|
||||
|
||||
roiParams = new List<string>();
|
||||
|
||||
running = false;
|
||||
@@ -156,7 +174,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
if (cameraDetected)
|
||||
{
|
||||
/// Open telnet clint and start the log-in process
|
||||
Telnet = new Telnet.TelnetClient(this, CameraCfg.Name, ClpUserName, ClpPassword, TelnetPrompt, TelnetSkipFirstLine);
|
||||
Telnet = new Telnet.TelnetClient(this, CameraCfg.Name, ClpUserName, ClpPassword, TelnetPrompt, TelnetSkipFirstLine, CameraCfg.DisplayTerminal);
|
||||
|
||||
if (CameraCfg.DisplayTerminal)
|
||||
{
|
||||
@@ -179,6 +197,10 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
Telnet.Enqueue(new Telnet.Command(Network.Telnet.CmdAction.CONNECT, ipAddress.ToString(), 10, 30));
|
||||
|
||||
|
||||
//measurementListener = new UdpClient(measurementUdpPortNr);
|
||||
//new Thread(new ThreadStart(MeasurementUdpListener)).Start();
|
||||
|
||||
|
||||
wscpThread = new Thread(new ThreadStart(WscpWorker));
|
||||
wscpThread.Start();
|
||||
|
||||
@@ -213,10 +235,10 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
|
||||
public void RunDeviceAfter()
|
||||
{
|
||||
if (running)
|
||||
{
|
||||
Console.WriteLine("Time={0} IP={1} scp={2}", StateMachine.Time, IPAddress, wscpOpened ? "Opened" : "Closed");
|
||||
}
|
||||
// if (running)
|
||||
// {
|
||||
// Console.WriteLine("Time={0} IP={1} scp={2}", StateMachine.Time, IPAddress, wscpOpened ? "Opened" : "Closed");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -346,6 +368,11 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
wscpSession = new WinSCP.Session();
|
||||
wscpSession.Open(wscpSessionOptions);
|
||||
|
||||
TransferOptions transferOptions = new TransferOptions();
|
||||
transferOptions.TransferMode = TransferMode.Binary;
|
||||
|
||||
TransferOperationResult transferResult;
|
||||
|
||||
wscpOpened = wscpSession.Opened;
|
||||
|
||||
if (wscpOpened)
|
||||
@@ -356,7 +383,8 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
{
|
||||
case WscpCommand.Get:
|
||||
wscpCommand = WscpCommand.None;
|
||||
wscpSession.GetFiles(wscpFileName, string.Format("c:\\TBF\\TftpRoot\\{0}-{1}", Name, wscpFileName));
|
||||
transferResult = wscpSession.GetFiles(wscpSrcFileName, wscpDstFileName, false, transferOptions);
|
||||
///transferResult.Check();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -372,15 +400,16 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
/// <summary>
|
||||
/// Transfer a file via SCP
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <param name="srcFileName"></param>
|
||||
/// <returns>0 (success), -1 (busy), -2 (no session)</returns>
|
||||
|
||||
public int WscpTransferFile(string fileName)
|
||||
|
||||
public int WscpTransferFile(string srcFileName, string dstFileName)
|
||||
{
|
||||
if (!wscpOpened) return -2;
|
||||
if (wscpCommand != WscpCommand.None) return -1;
|
||||
|
||||
wscpFileName = fileName;
|
||||
wscpSrcFileName = srcFileName;
|
||||
wscpDstFileName = dstFileName;
|
||||
wscpCommand = WscpCommand.Get;
|
||||
return 0;
|
||||
}
|
||||
@@ -422,8 +451,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
/// Prepare the telent command
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var s in roiParams) sb.AppendFormat(" {0}", s);
|
||||
command = string.Format("clp/Measurement -udp {0} {1}{2}{3} 1 1 0 0 0",
|
||||
ipAddress, 6378,
|
||||
command = string.Format("clp/Measurement -udp {0} {1}{2}{3} 1 7 0 0 0",
|
||||
NetAdapter.IPAddress,
|
||||
measurementUdpPortNr,
|
||||
CameraCfg.UseTestImages ? (" -l " + CameraCfg.TestImagesCount.ToString()) : string.Empty,
|
||||
sb);
|
||||
|
||||
@@ -469,14 +499,69 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
{
|
||||
string[] pulsesArr = msrmtData.MeasuredData.Split(new char[] { ';' });
|
||||
|
||||
if (result != null && result.Length + 1 == pulsesArr.Length)
|
||||
uint uiVal;
|
||||
if (result != null && result.Length + 1 == pulsesArr.Length && uint.TryParse(pulsesArr[0], out uiVal))
|
||||
{
|
||||
cameraTimeMs = (long)uiVal;
|
||||
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
int val;
|
||||
if (int.TryParse(pulsesArr[i + 1], out val)) result[i] = Math.Abs(val);
|
||||
if (int.TryParse(pulsesArr[i + 1], out val))
|
||||
{
|
||||
result[i] = Math.Abs(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MeasurementUdpListener()
|
||||
{
|
||||
StringBuilder toBeProcessed = new StringBuilder();
|
||||
IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, measurementUdpPortNr);
|
||||
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
byte[] byteArray = measurementListener.Receive(ref ipEndPoint);
|
||||
toBeProcessed.Append(Encoding.ASCII.GetString(byteArray, 0, byteArray.Length));
|
||||
log.DebugFormat("MeasurementUdpListener() ... toBeProcessed = {0}", toBeProcessed);
|
||||
|
||||
while (true)
|
||||
{
|
||||
int from = toBeProcessed.ToString().IndexOf('[');
|
||||
if (from < 0) break;
|
||||
|
||||
int len = toBeProcessed.ToString(from + 1, toBeProcessed.Length - from - 1).IndexOf(']');
|
||||
if (len < 0) break;
|
||||
|
||||
string[] pulsesArr = toBeProcessed.ToString(from + 1, len).Split(new char[] { ';' });
|
||||
|
||||
uint uiVal;
|
||||
if (result != null && result.Length + 1 == pulsesArr.Length && uint.TryParse(pulsesArr[0], out uiVal))
|
||||
{
|
||||
// cameraTimeMs = (long)uiVal;
|
||||
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
int val;
|
||||
if (int.TryParse(pulsesArr[i + 1], out val))
|
||||
{
|
||||
// result[i] = Math.Abs(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
toBeProcessed.Remove(0, from + len + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
log.FatalFormat("Camera : MeasurementUdpListener() thread failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using TBF.BenchControl.Network.Telnet;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
{
|
||||
public class MeasurementOp : IOperation
|
||||
{
|
||||
readonly CLP1611.Camera camera;
|
||||
readonly CLP1611.CameraCfg cameraCfg;
|
||||
readonly Telnet.TelnetClient telnet;
|
||||
|
||||
readonly string ipAddress;
|
||||
readonly int portNr;
|
||||
readonly IList<string> roiParams;
|
||||
|
||||
string command;
|
||||
bool measurementCommandSent;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.None or Event.Error
|
||||
/// </summary>
|
||||
/// <param name="camera">CLP1611.Camera reference</param>
|
||||
public MeasurementOp(Camera camera, string ipAddress, int portNr, IList<string> roiParams)
|
||||
{
|
||||
this.camera = camera;
|
||||
this.cameraCfg = camera.CameraCfg;
|
||||
this.telnet = camera.Telnet;
|
||||
this.ipAddress = ipAddress;
|
||||
this.portNr = portNr;
|
||||
this.roiParams = roiParams;
|
||||
|
||||
measurementCommandSent = false;
|
||||
}
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
measurementCommandSent = false;
|
||||
}
|
||||
|
||||
public Event Run()
|
||||
{
|
||||
if (!measurementCommandSent)
|
||||
{
|
||||
if (telnet.State == TelnetClient.TelnetState.Inactive)
|
||||
{
|
||||
//
|
||||
// Prepare and send (=enqueue) command
|
||||
//
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var s in roiParams)
|
||||
{
|
||||
sb.Append(" ");
|
||||
sb.Append(s);
|
||||
}
|
||||
command = string.Format("clp/Measurement -udp {0} {1}{2}{3} 1 1 0 0 0",
|
||||
ipAddress,
|
||||
portNr,
|
||||
cameraCfg.UseTestImages ? (" -l " + cameraCfg.TestImagesCount.ToString()) : string.Empty,
|
||||
sb);
|
||||
telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_STRING, command));
|
||||
measurementCommandSent = true;
|
||||
}
|
||||
}
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (measurementCommandSent)
|
||||
{
|
||||
telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_COMMAND, Telnet.TelnetClient.CtrlCCommand));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
public class Display : ComponentBase, IOperation, ICameraDisplay
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Display));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||
}
|
||||
|
||||
|
||||
public readonly DisplayCfg DisplayCfg;
|
||||
///
|
||||
public Display()
|
||||
{
|
||||
}
|
||||
///
|
||||
public Display(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
DisplayCfg = cfg as DisplayCfg;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool[] SelectedImages { get { return selectedImages; } }
|
||||
bool[] selectedImages;
|
||||
|
||||
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
StaticImage,
|
||||
LiveStream,
|
||||
}
|
||||
CurrentOp currentOp;
|
||||
DialogResult result;
|
||||
|
||||
string title;
|
||||
string[] imageFileNames;
|
||||
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
///
|
||||
delegate void DisplayFormDlgt(Display myRef);
|
||||
///
|
||||
void OpenStaticImageDisplay(Display myRef)
|
||||
{
|
||||
myRef.modelessDlg = new DisplayForm(imageFileNames, title);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenLiveStreamDisplay(Display myRef)
|
||||
{
|
||||
myRef.modelessDlg = new DisplayForm(imageFileNames, title);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowStaticImageOp(string[] imageFileNames, string title)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
|
||||
this.imageFileNames = imageFileNames;
|
||||
this.title = title;
|
||||
currentOp = CurrentOp.StaticImage;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowLiveStreamOp(string[] imageFileNames, string title)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
|
||||
this.imageFileNames = imageFileNames;
|
||||
this.title = title;
|
||||
currentOp = CurrentOp.LiveStream;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
result = DialogResult.None;
|
||||
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.StaticImage:
|
||||
Program.MainWnd.Invoke(new DisplayFormDlgt(OpenStaticImageDisplay), this);
|
||||
break;
|
||||
|
||||
case CurrentOp.LiveStream:
|
||||
Program.MainWnd.Invoke(new DisplayFormDlgt(OpenLiveStreamDisplay), this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.None</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
|
||||
{
|
||||
return Event.ModelessFormIsOpen;
|
||||
}
|
||||
|
||||
if ((result == DialogResult.None) && modelessDlg is DisplayForm)
|
||||
{
|
||||
/// Save the result (once)
|
||||
selectedImages = (modelessDlg as DisplayForm).SelectedImages;
|
||||
result = (modelessDlg as DisplayForm).Result;
|
||||
modelessDlg = null;
|
||||
}
|
||||
|
||||
if (result == DialogResult.OK) return Event.OK;
|
||||
else if (result == DialogResult.Retry) return Event.Retry;
|
||||
else if (result == DialogResult.Abort) return Event.Abort;
|
||||
else return Event.None; /// Should never happen
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
if (modelessDlg is IHasCompleted)
|
||||
{
|
||||
UiBridge.Bridge.OnCloseModelessForm(this, null);
|
||||
modelessDlg = null;
|
||||
}
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
public class DisplayCfg : ComponentCfgBase, IComponentCfg
|
||||
{
|
||||
public IComponentCfgCtrl GetControl() { return new DisplayCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
DisplayCfg() {}
|
||||
|
||||
public DisplayCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
public partial class DisplayCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(DisplayCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
DisplayCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as DisplayCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public DisplayCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void PumpCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
parent = ParentForm as ComponentParametersDlg;
|
||||
if (parent == null) return;
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
partial class DisplayCfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
this.classNameLabel = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(99, 34);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(174, 20);
|
||||
this.nameTextBox.TabIndex = 1;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(13, 37);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 0;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(96, 11);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(114, 13);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "ComponentClassName";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(-211, -147);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(57, 13);
|
||||
this.label1.TabIndex = 5;
|
||||
this.label1.Text = "Arguments";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Enabled = false;
|
||||
this.textBox1.Location = new System.Drawing.Point(-125, -150);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(372, 20);
|
||||
this.textBox1.TabIndex = 6;
|
||||
//
|
||||
// DisplayCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "DisplayCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(500, 300);
|
||||
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
using System.Drawing;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
public partial class DisplayForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(DisplayForm));
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
readonly string[] imageFileNames;
|
||||
readonly int imagesCount;
|
||||
|
||||
readonly GroupBox[] groupBoxes;
|
||||
readonly PictureBox[] pictureBoxes;
|
||||
readonly CheckBox[] checkBoxes;
|
||||
readonly int boxesCount;
|
||||
|
||||
Timer myTimer;
|
||||
|
||||
|
||||
public bool[] SelectedImages;
|
||||
public DialogResult Result; /// DialogResult.None OK Retry or Cancel
|
||||
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public DisplayForm(string[] imageFileNames, string title)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.imageFileNames = imageFileNames;
|
||||
this.imagesCount = (imageFileNames == null) ? 0 : imageFileNames.Length;
|
||||
|
||||
groupBoxes = new GroupBox[] { groupBox1, groupBox2, groupBox3, groupBox4, groupBox5, groupBox6 };
|
||||
pictureBoxes = new PictureBox[] { pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5, pictureBox6 };
|
||||
checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6 };
|
||||
boxesCount = pictureBoxes.Length;
|
||||
|
||||
Text = title;
|
||||
|
||||
int lastVisibleGroupBoxIx = 0;
|
||||
for (int i = 0; i < boxesCount; i++)
|
||||
{
|
||||
if (i < imagesCount && !string.IsNullOrEmpty(imageFileNames[i]))
|
||||
{
|
||||
groupBoxes[i].Text = string.Format("{0} {1}", Strings.Water_Meter, i + 1);
|
||||
checkBoxes[i].Checked = true;
|
||||
checkBoxes[i].Text = Strings.Retry;
|
||||
lastVisibleGroupBoxIx = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
groupBoxes[i].Visible = false;
|
||||
checkBoxes[i].Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
SelectedImages = new bool[imagesCount];
|
||||
|
||||
if (lastVisibleGroupBoxIx < 3) Height = 338;
|
||||
|
||||
Result = DialogResult.None;
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary> Parameterless constructor for all watermeters </summary>
|
||||
public DisplayForm()
|
||||
: this(null, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
private void CycleBeginningForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
retryButton.Text = Strings.Retry;
|
||||
abortButton.Text = Strings.Abort;
|
||||
|
||||
myTimer = new Timer();
|
||||
myTimer.Interval = (500); // 45 mins
|
||||
myTimer.Tick += new EventHandler(MyTimer_Tick);
|
||||
myTimer.Start();
|
||||
}
|
||||
|
||||
private void MyTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(imagesCount, boxesCount); i++)
|
||||
{
|
||||
if (imageFileNames[i] != null &&
|
||||
System.IO.File.Exists(imageFileNames[i]) &&
|
||||
pictureBoxes[i] != null &&
|
||||
pictureBoxes[i].Image == null)
|
||||
{
|
||||
pictureBoxes[i].Image = Image.FromFile(imageFileNames[i]); ;
|
||||
checkBoxes[i].Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UpdateData()
|
||||
{
|
||||
for (int i = 0; i < Math.Min(imagesCount, boxesCount); i++)
|
||||
{
|
||||
SelectedImages[i] = checkBoxes[i].Checked;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (myTimer != null) myTimer.Stop();
|
||||
UpdateData();
|
||||
Result = DialogResult.OK;
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void abortButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (myTimer != null) myTimer.Stop();
|
||||
UpdateData();
|
||||
Result = DialogResult.Abort;
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void retryButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (myTimer != null) myTimer.Stop();
|
||||
UpdateData();
|
||||
Result = DialogResult.Retry;
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
public void StartForceCloseHandler()
|
||||
{
|
||||
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
|
||||
{
|
||||
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
|
||||
else OnForceClose(sender, args);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
partial class DisplayForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DisplayForm));
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBox2 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox3 = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBox3 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox4 = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBox4 = new System.Windows.Forms.PictureBox();
|
||||
this.retryButton = new System.Windows.Forms.Button();
|
||||
this.abortButton = new System.Windows.Forms.Button();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox5 = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBox5 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox6 = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBox6 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
this.groupBox3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
|
||||
this.groupBox4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
|
||||
this.groupBox5.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
|
||||
this.groupBox6.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
resources.ApplyResources(this.okButton, "okButton");
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.checkBox1);
|
||||
this.groupBox1.Controls.Add(this.pictureBox1);
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
resources.ApplyResources(this.checkBox1, "checkBox1");
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
resources.ApplyResources(this.pictureBox1, "pictureBox1");
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.checkBox2);
|
||||
this.groupBox2.Controls.Add(this.pictureBox2);
|
||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.TabStop = false;
|
||||
//
|
||||
// checkBox2
|
||||
//
|
||||
resources.ApplyResources(this.checkBox2, "checkBox2");
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
resources.ApplyResources(this.pictureBox2, "pictureBox2");
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.TabStop = false;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.checkBox3);
|
||||
this.groupBox3.Controls.Add(this.pictureBox3);
|
||||
resources.ApplyResources(this.groupBox3, "groupBox3");
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.TabStop = false;
|
||||
//
|
||||
// checkBox3
|
||||
//
|
||||
resources.ApplyResources(this.checkBox3, "checkBox3");
|
||||
this.checkBox3.Name = "checkBox3";
|
||||
this.checkBox3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBox3
|
||||
//
|
||||
resources.ApplyResources(this.pictureBox3, "pictureBox3");
|
||||
this.pictureBox3.Name = "pictureBox3";
|
||||
this.pictureBox3.TabStop = false;
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.checkBox4);
|
||||
this.groupBox4.Controls.Add(this.pictureBox4);
|
||||
resources.ApplyResources(this.groupBox4, "groupBox4");
|
||||
this.groupBox4.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.TabStop = false;
|
||||
//
|
||||
// checkBox4
|
||||
//
|
||||
resources.ApplyResources(this.checkBox4, "checkBox4");
|
||||
this.checkBox4.Name = "checkBox4";
|
||||
this.checkBox4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBox4
|
||||
//
|
||||
resources.ApplyResources(this.pictureBox4, "pictureBox4");
|
||||
this.pictureBox4.Name = "pictureBox4";
|
||||
this.pictureBox4.TabStop = false;
|
||||
//
|
||||
// retryButton
|
||||
//
|
||||
resources.ApplyResources(this.retryButton, "retryButton");
|
||||
this.retryButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.retryButton.Name = "retryButton";
|
||||
this.retryButton.UseVisualStyleBackColor = true;
|
||||
this.retryButton.Click += new System.EventHandler(this.retryButton_Click);
|
||||
//
|
||||
// abortButton
|
||||
//
|
||||
resources.ApplyResources(this.abortButton, "abortButton");
|
||||
this.abortButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.abortButton.Name = "abortButton";
|
||||
this.abortButton.UseVisualStyleBackColor = true;
|
||||
this.abortButton.Click += new System.EventHandler(this.abortButton_Click);
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.checkBox5);
|
||||
this.groupBox5.Controls.Add(this.pictureBox5);
|
||||
resources.ApplyResources(this.groupBox5, "groupBox5");
|
||||
this.groupBox5.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.TabStop = false;
|
||||
//
|
||||
// checkBox5
|
||||
//
|
||||
resources.ApplyResources(this.checkBox5, "checkBox5");
|
||||
this.checkBox5.Name = "checkBox5";
|
||||
this.checkBox5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBox5
|
||||
//
|
||||
resources.ApplyResources(this.pictureBox5, "pictureBox5");
|
||||
this.pictureBox5.Name = "pictureBox5";
|
||||
this.pictureBox5.TabStop = false;
|
||||
//
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Controls.Add(this.checkBox6);
|
||||
this.groupBox6.Controls.Add(this.pictureBox6);
|
||||
resources.ApplyResources(this.groupBox6, "groupBox6");
|
||||
this.groupBox6.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.TabStop = false;
|
||||
//
|
||||
// checkBox6
|
||||
//
|
||||
resources.ApplyResources(this.checkBox6, "checkBox6");
|
||||
this.checkBox6.Name = "checkBox6";
|
||||
this.checkBox6.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBox6
|
||||
//
|
||||
resources.ApplyResources(this.pictureBox6, "pictureBox6");
|
||||
this.pictureBox6.Name = "pictureBox6";
|
||||
this.pictureBox6.TabStop = false;
|
||||
//
|
||||
// DisplayForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGray;
|
||||
this.Controls.Add(this.groupBox6);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.abortButton);
|
||||
this.Controls.Add(this.retryButton);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "DisplayForm";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
|
||||
this.groupBox6.ResumeLayout(false);
|
||||
this.groupBox6.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Button retryButton;
|
||||
private System.Windows.Forms.Button abortButton;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.PictureBox pictureBox2;
|
||||
private System.Windows.Forms.PictureBox pictureBox3;
|
||||
private System.Windows.Forms.PictureBox pictureBox4;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.PictureBox pictureBox5;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.PictureBox pictureBox6;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
private System.Windows.Forms.CheckBox checkBox3;
|
||||
private System.Windows.Forms.CheckBox checkBox4;
|
||||
private System.Windows.Forms.CheckBox checkBox5;
|
||||
private System.Windows.Forms.CheckBox checkBox6;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,807 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="okButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="okButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>1072, 19</value>
|
||||
</data>
|
||||
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>146, 58</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="okButton.Text" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name=">>okButton.Name" xml:space="preserve">
|
||||
<value>okButton</value>
|
||||
</data>
|
||||
<data name=">>okButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>okButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>okButton.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="checkBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="checkBox1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBox1.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="checkBox1.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 12pt</value>
|
||||
</data>
|
||||
<data name="checkBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>257, 19</value>
|
||||
</data>
|
||||
<data name="checkBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>70, 22</value>
|
||||
</data>
|
||||
<data name="checkBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="checkBox1.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name="checkBox1.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name=">>checkBox1.Name" xml:space="preserve">
|
||||
<value>checkBox1</value>
|
||||
</data>
|
||||
<data name=">>checkBox1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBox1.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>checkBox1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>7, 45</value>
|
||||
</data>
|
||||
<data name="pictureBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>320, 240</value>
|
||||
</data>
|
||||
<data name="pictureBox1.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>pictureBox1.Name" xml:space="preserve">
|
||||
<value>pictureBox1</value>
|
||||
</data>
|
||||
<data name=">>pictureBox1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox1.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>pictureBox1.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox1.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>15, 8</value>
|
||||
</data>
|
||||
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>335, 293</value>
|
||||
</data>
|
||||
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>Watermeter 1</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Name" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="checkBox2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="checkBox2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBox2.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="checkBox2.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 12pt</value>
|
||||
</data>
|
||||
<data name="checkBox2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="checkBox2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>257, 19</value>
|
||||
</data>
|
||||
<data name="checkBox2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>70, 22</value>
|
||||
</data>
|
||||
<data name="checkBox2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="checkBox2.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name="checkBox2.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name=">>checkBox2.Name" xml:space="preserve">
|
||||
<value>checkBox2</value>
|
||||
</data>
|
||||
<data name=">>checkBox2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBox2.Parent" xml:space="preserve">
|
||||
<value>groupBox2</value>
|
||||
</data>
|
||||
<data name=">>checkBox2.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="pictureBox2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>7, 45</value>
|
||||
</data>
|
||||
<data name="pictureBox2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>320, 240</value>
|
||||
</data>
|
||||
<data name="pictureBox2.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>pictureBox2.Name" xml:space="preserve">
|
||||
<value>pictureBox2</value>
|
||||
</data>
|
||||
<data name=">>pictureBox2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox2.Parent" xml:space="preserve">
|
||||
<value>groupBox2</value>
|
||||
</data>
|
||||
<data name=">>pictureBox2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox2.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>365, 8</value>
|
||||
</data>
|
||||
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>335, 293</value>
|
||||
</data>
|
||||
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="groupBox2.Text" xml:space="preserve">
|
||||
<value>Watermeter 2</value>
|
||||
</data>
|
||||
<data name=">>groupBox2.Name" xml:space="preserve">
|
||||
<value>groupBox2</value>
|
||||
</data>
|
||||
<data name=">>groupBox2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBox2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox2.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="checkBox3.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="checkBox3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBox3.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="checkBox3.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 12pt</value>
|
||||
</data>
|
||||
<data name="checkBox3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="checkBox3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>257, 19</value>
|
||||
</data>
|
||||
<data name="checkBox3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>70, 22</value>
|
||||
</data>
|
||||
<data name="checkBox3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="checkBox3.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name="checkBox3.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name=">>checkBox3.Name" xml:space="preserve">
|
||||
<value>checkBox3</value>
|
||||
</data>
|
||||
<data name=">>checkBox3.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBox3.Parent" xml:space="preserve">
|
||||
<value>groupBox3</value>
|
||||
</data>
|
||||
<data name=">>checkBox3.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="pictureBox3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>7, 45</value>
|
||||
</data>
|
||||
<data name="pictureBox3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>320, 240</value>
|
||||
</data>
|
||||
<data name="pictureBox3.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name=">>pictureBox3.Name" xml:space="preserve">
|
||||
<value>pictureBox3</value>
|
||||
</data>
|
||||
<data name=">>pictureBox3.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox3.Parent" xml:space="preserve">
|
||||
<value>groupBox3</value>
|
||||
</data>
|
||||
<data name=">>pictureBox3.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox3.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="groupBox3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>717, 8</value>
|
||||
</data>
|
||||
<data name="groupBox3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>335, 293</value>
|
||||
</data>
|
||||
<data name="groupBox3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="groupBox3.Text" xml:space="preserve">
|
||||
<value>Watermeter 3</value>
|
||||
</data>
|
||||
<data name=">>groupBox3.Name" xml:space="preserve">
|
||||
<value>groupBox3</value>
|
||||
</data>
|
||||
<data name=">>groupBox3.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBox3.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox3.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="checkBox4.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="checkBox4.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBox4.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="checkBox4.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 12pt</value>
|
||||
</data>
|
||||
<data name="checkBox4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="checkBox4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>257, 19</value>
|
||||
</data>
|
||||
<data name="checkBox4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>70, 22</value>
|
||||
</data>
|
||||
<data name="checkBox4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="checkBox4.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name="checkBox4.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name=">>checkBox4.Name" xml:space="preserve">
|
||||
<value>checkBox4</value>
|
||||
</data>
|
||||
<data name=">>checkBox4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBox4.Parent" xml:space="preserve">
|
||||
<value>groupBox4</value>
|
||||
</data>
|
||||
<data name=">>checkBox4.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="pictureBox4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>7, 45</value>
|
||||
</data>
|
||||
<data name="pictureBox4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>320, 240</value>
|
||||
</data>
|
||||
<data name="pictureBox4.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>pictureBox4.Name" xml:space="preserve">
|
||||
<value>pictureBox4</value>
|
||||
</data>
|
||||
<data name=">>pictureBox4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox4.Parent" xml:space="preserve">
|
||||
<value>groupBox4</value>
|
||||
</data>
|
||||
<data name=">>pictureBox4.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox4.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="groupBox4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>15, 306</value>
|
||||
</data>
|
||||
<data name="groupBox4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>335, 293</value>
|
||||
</data>
|
||||
<data name="groupBox4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="groupBox4.Text" xml:space="preserve">
|
||||
<value>Watermeter 4</value>
|
||||
</data>
|
||||
<data name=">>groupBox4.Name" xml:space="preserve">
|
||||
<value>groupBox4</value>
|
||||
</data>
|
||||
<data name=">>groupBox4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBox4.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox4.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="retryButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="retryButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="retryButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="retryButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>1072, 96</value>
|
||||
</data>
|
||||
<data name="retryButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>146, 58</value>
|
||||
</data>
|
||||
<data name="retryButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="retryButton.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name=">>retryButton.Name" xml:space="preserve">
|
||||
<value>retryButton</value>
|
||||
</data>
|
||||
<data name=">>retryButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>retryButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>retryButton.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="abortButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="abortButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="abortButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="abortButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>1072, 173</value>
|
||||
</data>
|
||||
<data name="abortButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>146, 58</value>
|
||||
</data>
|
||||
<data name="abortButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="abortButton.Text" xml:space="preserve">
|
||||
<value>Abort</value>
|
||||
</data>
|
||||
<data name=">>abortButton.Name" xml:space="preserve">
|
||||
<value>abortButton</value>
|
||||
</data>
|
||||
<data name=">>abortButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>abortButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>abortButton.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="checkBox5.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="checkBox5.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBox5.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="checkBox5.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 12pt</value>
|
||||
</data>
|
||||
<data name="checkBox5.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="checkBox5.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>257, 19</value>
|
||||
</data>
|
||||
<data name="checkBox5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>70, 22</value>
|
||||
</data>
|
||||
<data name="checkBox5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="checkBox5.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name="checkBox5.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name=">>checkBox5.Name" xml:space="preserve">
|
||||
<value>checkBox5</value>
|
||||
</data>
|
||||
<data name=">>checkBox5.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBox5.Parent" xml:space="preserve">
|
||||
<value>groupBox5</value>
|
||||
</data>
|
||||
<data name=">>checkBox5.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox5.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="pictureBox5.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>7, 45</value>
|
||||
</data>
|
||||
<data name="pictureBox5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>320, 240</value>
|
||||
</data>
|
||||
<data name="pictureBox5.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>pictureBox5.Name" xml:space="preserve">
|
||||
<value>pictureBox5</value>
|
||||
</data>
|
||||
<data name=">>pictureBox5.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox5.Parent" xml:space="preserve">
|
||||
<value>groupBox5</value>
|
||||
</data>
|
||||
<data name=">>pictureBox5.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox5.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="groupBox5.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>365, 306</value>
|
||||
</data>
|
||||
<data name="groupBox5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>335, 293</value>
|
||||
</data>
|
||||
<data name="groupBox5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="groupBox5.Text" xml:space="preserve">
|
||||
<value>Watermeter 5</value>
|
||||
</data>
|
||||
<data name=">>groupBox5.Name" xml:space="preserve">
|
||||
<value>groupBox5</value>
|
||||
</data>
|
||||
<data name=">>groupBox5.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBox5.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox5.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="checkBox6.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="checkBox6.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBox6.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="checkBox6.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 12pt</value>
|
||||
</data>
|
||||
<data name="checkBox6.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="checkBox6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>257, 19</value>
|
||||
</data>
|
||||
<data name="checkBox6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>70, 22</value>
|
||||
</data>
|
||||
<data name="checkBox6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="checkBox6.Text" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
<data name="checkBox6.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name=">>checkBox6.Name" xml:space="preserve">
|
||||
<value>checkBox6</value>
|
||||
</data>
|
||||
<data name=">>checkBox6.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBox6.Parent" xml:space="preserve">
|
||||
<value>groupBox6</value>
|
||||
</data>
|
||||
<data name=">>checkBox6.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox6.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="pictureBox6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>7, 45</value>
|
||||
</data>
|
||||
<data name="pictureBox6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>320, 240</value>
|
||||
</data>
|
||||
<data name="pictureBox6.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>pictureBox6.Name" xml:space="preserve">
|
||||
<value>pictureBox6</value>
|
||||
</data>
|
||||
<data name=">>pictureBox6.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox6.Parent" xml:space="preserve">
|
||||
<value>groupBox6</value>
|
||||
</data>
|
||||
<data name=">>pictureBox6.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="groupBox6.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="groupBox6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>717, 306</value>
|
||||
</data>
|
||||
<data name="groupBox6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>335, 293</value>
|
||||
</data>
|
||||
<data name="groupBox6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="groupBox6.Text" xml:space="preserve">
|
||||
<value>Watermeter 6</value>
|
||||
</data>
|
||||
<data name=">>groupBox6.Name" xml:space="preserve">
|
||||
<value>groupBox6</value>
|
||||
</data>
|
||||
<data name=">>groupBox6.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBox6.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox6.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>1237, 613</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>DisplayForm</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Display.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Display(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Display(cfg, components); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new DisplayCfg(this.GetType().Namespace.Substring(17), this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(DisplayCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,15 +14,27 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
|
||||
{
|
||||
public float PulsesPerLtr; /// [l^-1]
|
||||
public int DetectionImagesCount;
|
||||
public int DetectionPeriod1;
|
||||
public int DetectionPeriod2;
|
||||
public string RoiParams;
|
||||
|
||||
public override void InitializeAll()
|
||||
{
|
||||
PulsesPerLtr = 1.0f;
|
||||
DetectionImagesCount = 10;
|
||||
DetectionPeriod1 = 1;
|
||||
DetectionPeriod2 = 19;
|
||||
RoiParams = "160 160 79 79 20 79 0 0 360 360 1 50 0 0 50 0";
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
Strings.PulsesPerLtr,
|
||||
"Images count",
|
||||
"Period1",
|
||||
"Period2",
|
||||
"Parameters"
|
||||
};
|
||||
public override string ParamName(int i) { return paramNames[i]; }
|
||||
public override int ParamsCount() { return paramNames.Length; }
|
||||
@@ -32,6 +44,10 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
switch (i)
|
||||
{
|
||||
case 0: return PulsesPerLtr.ToString();
|
||||
case 1: return DetectionImagesCount.ToString();
|
||||
case 2: return DetectionPeriod1.ToString();
|
||||
case 3: return DetectionPeriod2.ToString();
|
||||
case 4: return RoiParams;
|
||||
default: return string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -42,6 +58,10 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
switch (i)
|
||||
{
|
||||
case 0: PulsesPerLtr = Utils.ParseUFloat(strValue); return;
|
||||
case 1: DetectionImagesCount = int.Parse(strValue); return;
|
||||
case 2: DetectionPeriod1 = int.Parse(strValue); return;
|
||||
case 3: DetectionPeriod2 = int.Parse(strValue); return;
|
||||
case 4: RoiParams = strValue; return;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
@@ -52,11 +72,19 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
message = string.Empty;
|
||||
|
||||
float dummy;
|
||||
int idummy;
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if (Utils.TryParseUFloat(strValue, out dummy)) return true;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if (int.TryParse(strValue, out idummy) && idummy >= 1 && idummy <= 50) return true;
|
||||
break;
|
||||
case 4:
|
||||
return true;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
@@ -69,6 +97,10 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
void CopyContentTo(ProcedureParams prms)
|
||||
{
|
||||
prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
prms.DetectionImagesCount = this.DetectionImagesCount;
|
||||
prms.DetectionPeriod1 = this.DetectionPeriod1;
|
||||
prms.DetectionPeriod2 = this.DetectionPeriod2;
|
||||
prms.RoiParams = this.RoiParams;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
|
||||
@@ -35,25 +35,39 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
public double PulsesPerLtr { get { return (double)RoiCfg.ProcParams.PulsesPerLtr; } }
|
||||
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); ; } }
|
||||
|
||||
int wmPulses;
|
||||
public int WMPulses { get { return wmPulses; } }
|
||||
int cameraPulses;
|
||||
int pulsesDelta; /// = (WMPulses - cameraPulses) ... WMPulses = cameraPulses + pulsesDelta, Clear() calculates pulsesDelta
|
||||
public int WMPulses { get { return cameraPulses + pulsesDelta; } }
|
||||
|
||||
long cameraTime;
|
||||
long timeDelta; /// = (WMTestTime - cameraTime) ... WMTestTime = cameraTime + timeDelta, Clear() calculates timeDelta
|
||||
public double WMTestTime { get { return (cameraTime + timeDelta) / 1000.0; } }
|
||||
|
||||
int wmRefPulses;
|
||||
public int WMRefPulses { get { return wmRefPulses; } }
|
||||
|
||||
public double WMVolume { get { return LtrsPerPulse * (double)wmPulses; } }
|
||||
public double WMVolume { get { return LtrsPerPulse * (double)WMPulses; } }
|
||||
|
||||
public double BeginWMState { get { return 0; } } /// Always 0
|
||||
public double EndWMState { get { return WMVolume; } } /// Derived from WMVolume
|
||||
public double BeginWMState { get { return 0; } } /// Always 0
|
||||
public double EndWMState { get { return WMVolume; } } /// Derived from WMVolume
|
||||
|
||||
|
||||
double volumeStart;
|
||||
public double VolumeStart { get { return volumeStart; } } /// in l
|
||||
|
||||
double volumeEnd;
|
||||
public double VolumeEnd { get { return volumeEnd; } } /// in l
|
||||
|
||||
double timestampStart;
|
||||
public double TimestampStart { get { return timestampStart; } } /// in s
|
||||
|
||||
double timestampEnd;
|
||||
public double TimestampEnd { get { return timestampEnd; } } /// in s
|
||||
|
||||
///
|
||||
/// Roi specific
|
||||
///
|
||||
public bool Detected
|
||||
{
|
||||
get { return detected; }
|
||||
set { detected = value; }
|
||||
}
|
||||
public bool Detected { get { return detected; } }
|
||||
bool detected;
|
||||
///
|
||||
public Boxes.IntBox RoiX;
|
||||
@@ -61,6 +75,23 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
public Boxes.IntBox RoiWid;
|
||||
public Boxes.IntBox RoiHgh;
|
||||
///
|
||||
public void ClearRoi()
|
||||
{
|
||||
detected = false;
|
||||
}
|
||||
///
|
||||
public void SetRoi(int x, int y, int wid, int hgh)
|
||||
{
|
||||
RoiX.Val = x;
|
||||
RoiY.Val = y;
|
||||
RoiWid.Val = wid;
|
||||
RoiHgh.Val = hgh;
|
||||
detected = true;
|
||||
}
|
||||
///
|
||||
public string DetectedImageName { get { return detectedImageName; } }
|
||||
string detectedImageName;
|
||||
///
|
||||
private int roiHandle;
|
||||
///
|
||||
public void RegisterRoiToCamera()
|
||||
@@ -115,11 +146,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
{
|
||||
if (args.Command == CfgChangeCmd.CfgChange)
|
||||
{
|
||||
RoiCfg.RoiParams = tmpcfg.RoiParams;
|
||||
RoiCfg.UseTestImages = tmpcfg.UseTestImages;
|
||||
RoiCfg.DetectionImagesCount = tmpcfg.DetectionImagesCount;
|
||||
RoiCfg.DetectionPeriod1 = tmpcfg.DetectionPeriod1;
|
||||
RoiCfg.DetectionPeriod2 = tmpcfg.DetectionPeriod2;
|
||||
RoiCfg.LoadImages = tmpcfg.LoadImages;
|
||||
RoiCfg.SaveImages = tmpcfg.SaveImages;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -129,7 +157,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
wmPulses = 0;
|
||||
pulsesDelta = -cameraPulses;
|
||||
timeDelta = -cameraTime;
|
||||
wmRefPulses = 0;
|
||||
}
|
||||
|
||||
@@ -140,8 +169,9 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
{
|
||||
if (NetCamera != null && NetCamera.Telnet != null)
|
||||
{
|
||||
Telnet = NetCamera.Telnet;
|
||||
return new RoiDetectionOp(this, RoiX, RoiY, RoiWid, RoiHgh);
|
||||
Telnet = NetCamera.Telnet;
|
||||
detectedImageName = string.Format("{0}{1}-det-{2}.jpg", Program.ImagesDir, RoiCfg.Name, StateMachine.Time);
|
||||
return new RoiDetectionOp(this, RoiX, RoiY, RoiWid, RoiHgh);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -157,7 +187,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
{
|
||||
if (detected && roiHandle != 0)
|
||||
{
|
||||
wmPulses = NetCamera.GetResult(roiHandle);
|
||||
cameraPulses = NetCamera.GetResult(roiHandle, out cameraTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +203,9 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
public void Start()
|
||||
{
|
||||
UdatePulses();
|
||||
Clear();
|
||||
volumeStart = WMVolume;
|
||||
timestampStart = WMTestTime;
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
@@ -180,6 +213,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
public Event Run()
|
||||
{
|
||||
UdatePulses();
|
||||
volumeEnd = WMVolume;
|
||||
timestampEnd = WMTestTime;
|
||||
return Event.ReadRegisterDone;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string PreviousRoi;
|
||||
public string RoiParams;
|
||||
public int DetectionImagesCount;
|
||||
public int DetectionPeriod1;
|
||||
public int DetectionPeriod2;
|
||||
public bool UseTestImages;
|
||||
public bool LoadImages;
|
||||
public bool SaveImages;
|
||||
|
||||
/// <summary> Procedure parameters </summary>
|
||||
[XmlIgnore]
|
||||
@@ -32,6 +29,12 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
return procParams;
|
||||
}
|
||||
|
||||
public int DetectionImagesCount { get { return ProcParams.DetectionImagesCount; } }
|
||||
public int DetectionPeriod1 { get { return ProcParams.DetectionPeriod1; } }
|
||||
public int DetectionPeriod2 { get { return ProcParams.DetectionPeriod2; } }
|
||||
public string RoiParams { get { return ProcParams.RoiParams; } }
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
RoiCfg()
|
||||
{
|
||||
@@ -44,15 +47,11 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
ParentName = "Camera";
|
||||
RoiParams = string.Empty;
|
||||
DetectionImagesCount = 15;
|
||||
DetectionPeriod1 = 1;
|
||||
DetectionPeriod2 = 1;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Parent={1}, Params={2}", Name, ParentName, RoiParams);
|
||||
return string.Format("{0} ({1}) {2}", Name, ParentName, (LoadImages ? " load images" : (SaveImages ? " save images" : "")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,11 +68,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
nameTextBox.Text = config.Name;
|
||||
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
|
||||
previousRoiComboBox.Text = string.IsNullOrEmpty(config.PreviousRoi) ? "---" : config.PreviousRoi;
|
||||
argsTextBox.Text = config.RoiParams;
|
||||
useTestImagesCheckBox.Checked = config.UseTestImages;
|
||||
imagesCountTextBox.Text = config.DetectionImagesCount.ToString();
|
||||
period1TextBox.Text = config.DetectionPeriod1.ToString();
|
||||
period2TextBox.Text = config.DetectionPeriod2.ToString();
|
||||
loadImagesCheckBox.Checked = config.LoadImages;
|
||||
saveImagesCheckBox.Checked = config.SaveImages;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
@@ -80,75 +77,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
nameTextBox.Enabled = true;
|
||||
parentNameComboBox.Enabled = true;
|
||||
previousRoiComboBox.Enabled = true;
|
||||
argsTextBox.Enabled = true;
|
||||
useTestImagesCheckBox.Enabled = true;
|
||||
imagesCountTextBox.Enabled = true;
|
||||
period1TextBox.Enabled = true;
|
||||
period2TextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
|
||||
if (config.ParentName != newParentName)
|
||||
{
|
||||
config.ParentName = newParentName;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
string newPreviousRoi = previousRoiComboBox.Text.Equals("---") ? string.Empty : previousRoiComboBox.Text;
|
||||
if (config.PreviousRoi != newPreviousRoi)
|
||||
{
|
||||
config.PreviousRoi = newPreviousRoi;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.RoiParams != argsTextBox.Text)
|
||||
{
|
||||
config.RoiParams = argsTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.UseTestImages != useTestImagesCheckBox.Checked)
|
||||
{
|
||||
config.UseTestImages = useTestImagesCheckBox.Checked;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DetectionImagesCount != int.Parse(imagesCountTextBox.Text))
|
||||
{
|
||||
config.DetectionImagesCount = int.Parse(imagesCountTextBox.Text);
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DetectionPeriod1 != int.Parse(period1TextBox.Text))
|
||||
{
|
||||
config.DetectionPeriod1 = int.Parse(period1TextBox.Text);
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DetectionPeriod2 != int.Parse(period2TextBox.Text))
|
||||
{
|
||||
config.DetectionPeriod2 = int.Parse(period2TextBox.Text);
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
return flags;
|
||||
loadImagesCheckBox.Enabled = true;
|
||||
saveImagesCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
@@ -167,31 +97,56 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
message += Environment.NewLine + "Invalid 'Previous RoI'";
|
||||
}
|
||||
|
||||
int cnt, p1, p2;
|
||||
if (!int.TryParse(imagesCountTextBox.Text, out cnt) || cnt < 1 || cnt > 50)
|
||||
if (loadImagesCheckBox.Checked && saveImagesCheckBox.Checked)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Images count' should be between 1 and 50";
|
||||
message += Environment.NewLine + "Images cannot be Loaded and Saved at the same time";
|
||||
}
|
||||
if (!int.TryParse(period1TextBox.Text, out p1) || p1 < 1 || p1 > 50)
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Period 1' should be between 1 and 50";
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
if (!int.TryParse(period2TextBox.Text, out p2) || p2 < 1 || p2 > 50)
|
||||
|
||||
string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
|
||||
if (config.ParentName != newParentName)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Period 2' should be between 1 and 50";
|
||||
config.ParentName = newParentName;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
if (p2 < p1)
|
||||
|
||||
string newPreviousRoi = previousRoiComboBox.Text.Equals("---") ? string.Empty : previousRoiComboBox.Text;
|
||||
if (config.PreviousRoi != newPreviousRoi)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Period2 should >= Period1";
|
||||
config.PreviousRoi = newPreviousRoi;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
if (p2 > p1 && (cnt % 2) != 0)
|
||||
|
||||
if (config.LoadImages != loadImagesCheckBox.Checked)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "When Period2 > Period1, 'Images count' should be even";
|
||||
config.LoadImages = loadImagesCheckBox.Checked;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.SaveImages != saveImagesCheckBox.Checked)
|
||||
{
|
||||
config.SaveImages = saveImagesCheckBox.Checked;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
return flags;
|
||||
|
||||
+36
-129
@@ -31,8 +31,6 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.argsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.argsLabel = new System.Windows.Forms.Label();
|
||||
this.parentNameLabel = new System.Windows.Forms.Label();
|
||||
this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
@@ -44,41 +42,17 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.previousRoiLabel = new System.Windows.Forms.Label();
|
||||
this.helpLabel1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.imagesCountTextBox = new System.Windows.Forms.TextBox();
|
||||
this.imagesCountLabel = new System.Windows.Forms.Label();
|
||||
this.useTestImagesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.period1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.period1Label = new System.Windows.Forms.Label();
|
||||
this.period2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.period2Label = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.loadImagesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.saveImagesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// argsTextBox
|
||||
//
|
||||
this.argsTextBox.Enabled = false;
|
||||
this.argsTextBox.Location = new System.Drawing.Point(92, 19);
|
||||
this.argsTextBox.Name = "argsTextBox";
|
||||
this.argsTextBox.Size = new System.Drawing.Size(361, 20);
|
||||
this.argsTextBox.TabIndex = 7;
|
||||
//
|
||||
// argsLabel
|
||||
//
|
||||
this.argsLabel.AutoSize = true;
|
||||
this.argsLabel.Location = new System.Drawing.Point(6, 22);
|
||||
this.argsLabel.Name = "argsLabel";
|
||||
this.argsLabel.Size = new System.Drawing.Size(57, 13);
|
||||
this.argsLabel.TabIndex = 6;
|
||||
this.argsLabel.Text = "Arguments";
|
||||
//
|
||||
// parentNameLabel
|
||||
//
|
||||
this.parentNameLabel.AutoSize = true;
|
||||
this.parentNameLabel.Location = new System.Drawing.Point(13, 60);
|
||||
this.parentNameLabel.Name = "parentNameLabel";
|
||||
this.parentNameLabel.Size = new System.Drawing.Size(69, 13);
|
||||
this.parentNameLabel.TabIndex = 2;
|
||||
this.parentNameLabel.TabIndex = 3;
|
||||
this.parentNameLabel.Text = "Parent Name";
|
||||
//
|
||||
// nameTextBox
|
||||
@@ -87,7 +61,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.nameTextBox.Location = new System.Drawing.Point(99, 34);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(174, 20);
|
||||
this.nameTextBox.TabIndex = 1;
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
@@ -95,7 +69,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.nameLabel.Location = new System.Drawing.Point(13, 37);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 0;
|
||||
this.nameLabel.TabIndex = 1;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
@@ -114,7 +88,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.parentNameComboBox.Location = new System.Drawing.Point(99, 57);
|
||||
this.parentNameComboBox.Name = "parentNameComboBox";
|
||||
this.parentNameComboBox.Size = new System.Drawing.Size(174, 21);
|
||||
this.parentNameComboBox.TabIndex = 3;
|
||||
this.parentNameComboBox.TabIndex = 4;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
@@ -140,7 +114,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.previousRoiComboBox.Location = new System.Drawing.Point(99, 81);
|
||||
this.previousRoiComboBox.Name = "previousRoiComboBox";
|
||||
this.previousRoiComboBox.Size = new System.Drawing.Size(174, 21);
|
||||
this.previousRoiComboBox.TabIndex = 5;
|
||||
this.previousRoiComboBox.TabIndex = 6;
|
||||
//
|
||||
// previousRoiLabel
|
||||
//
|
||||
@@ -148,117 +122,60 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.previousRoiLabel.Location = new System.Drawing.Point(13, 84);
|
||||
this.previousRoiLabel.Name = "previousRoiLabel";
|
||||
this.previousRoiLabel.Size = new System.Drawing.Size(68, 13);
|
||||
this.previousRoiLabel.TabIndex = 4;
|
||||
this.previousRoiLabel.TabIndex = 5;
|
||||
this.previousRoiLabel.Text = "Previous RoI";
|
||||
//
|
||||
// helpLabel1
|
||||
//
|
||||
this.helpLabel1.AutoSize = true;
|
||||
this.helpLabel1.Location = new System.Drawing.Point(91, 44);
|
||||
this.helpLabel1.Location = new System.Drawing.Point(38, 186);
|
||||
this.helpLabel1.Name = "helpLabel1";
|
||||
this.helpLabel1.Size = new System.Drawing.Size(379, 13);
|
||||
this.helpLabel1.TabIndex = 8;
|
||||
this.helpLabel1.TabIndex = 2;
|
||||
this.helpLabel1.Text = "roiWid roiHgh cx cy innerR outerR R3 ang1 ang2 fullAngle teethCount ..." +
|
||||
"";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(90, 62);
|
||||
this.label2.Location = new System.Drawing.Point(68, 204);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(350, 13);
|
||||
this.label2.TabIndex = 9;
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "... angSpeed( - ccw +cw) initSpeed minMvmt maxFwdMvmt bkgndCorr";
|
||||
//
|
||||
// imagesCountTextBox
|
||||
// loadImagesCheckBox
|
||||
//
|
||||
this.imagesCountTextBox.Enabled = false;
|
||||
this.imagesCountTextBox.Location = new System.Drawing.Point(92, 84);
|
||||
this.imagesCountTextBox.Name = "imagesCountTextBox";
|
||||
this.imagesCountTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.imagesCountTextBox.TabIndex = 19;
|
||||
this.loadImagesCheckBox.AutoSize = true;
|
||||
this.loadImagesCheckBox.Enabled = false;
|
||||
this.loadImagesCheckBox.Location = new System.Drawing.Point(99, 117);
|
||||
this.loadImagesCheckBox.Name = "loadImagesCheckBox";
|
||||
this.loadImagesCheckBox.Size = new System.Drawing.Size(112, 17);
|
||||
this.loadImagesCheckBox.TabIndex = 6;
|
||||
this.loadImagesCheckBox.Text = "Load images (test)";
|
||||
this.loadImagesCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// imagesCountLabel
|
||||
// saveImagesCheckBox
|
||||
//
|
||||
this.imagesCountLabel.AutoSize = true;
|
||||
this.imagesCountLabel.Location = new System.Drawing.Point(6, 87);
|
||||
this.imagesCountLabel.Name = "imagesCountLabel";
|
||||
this.imagesCountLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.imagesCountLabel.TabIndex = 18;
|
||||
this.imagesCountLabel.Text = "Images count";
|
||||
//
|
||||
// useTestImagesCheckBox
|
||||
//
|
||||
this.useTestImagesCheckBox.AutoSize = true;
|
||||
this.useTestImagesCheckBox.Enabled = false;
|
||||
this.useTestImagesCheckBox.Location = new System.Drawing.Point(183, 87);
|
||||
this.useTestImagesCheckBox.Name = "useTestImagesCheckBox";
|
||||
this.useTestImagesCheckBox.Size = new System.Drawing.Size(101, 17);
|
||||
this.useTestImagesCheckBox.TabIndex = 17;
|
||||
this.useTestImagesCheckBox.Text = "Use test images";
|
||||
this.useTestImagesCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// period1TextBox
|
||||
//
|
||||
this.period1TextBox.Enabled = false;
|
||||
this.period1TextBox.Location = new System.Drawing.Point(92, 107);
|
||||
this.period1TextBox.Name = "period1TextBox";
|
||||
this.period1TextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.period1TextBox.TabIndex = 21;
|
||||
//
|
||||
// period1Label
|
||||
//
|
||||
this.period1Label.AutoSize = true;
|
||||
this.period1Label.Location = new System.Drawing.Point(6, 110);
|
||||
this.period1Label.Name = "period1Label";
|
||||
this.period1Label.Size = new System.Drawing.Size(46, 13);
|
||||
this.period1Label.TabIndex = 20;
|
||||
this.period1Label.Text = "Period 1";
|
||||
//
|
||||
// period2TextBox
|
||||
//
|
||||
this.period2TextBox.Enabled = false;
|
||||
this.period2TextBox.Location = new System.Drawing.Point(92, 130);
|
||||
this.period2TextBox.Name = "period2TextBox";
|
||||
this.period2TextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.period2TextBox.TabIndex = 23;
|
||||
//
|
||||
// period2Label
|
||||
//
|
||||
this.period2Label.AutoSize = true;
|
||||
this.period2Label.Location = new System.Drawing.Point(6, 133);
|
||||
this.period2Label.Name = "period2Label";
|
||||
this.period2Label.Size = new System.Drawing.Size(46, 13);
|
||||
this.period2Label.TabIndex = 22;
|
||||
this.period2Label.Text = "Period 2";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.argsTextBox);
|
||||
this.groupBox1.Controls.Add(this.period2TextBox);
|
||||
this.groupBox1.Controls.Add(this.argsLabel);
|
||||
this.groupBox1.Controls.Add(this.period2Label);
|
||||
this.groupBox1.Controls.Add(this.helpLabel1);
|
||||
this.groupBox1.Controls.Add(this.period1TextBox);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Controls.Add(this.period1Label);
|
||||
this.groupBox1.Controls.Add(this.useTestImagesCheckBox);
|
||||
this.groupBox1.Controls.Add(this.imagesCountTextBox);
|
||||
this.groupBox1.Controls.Add(this.imagesCountLabel);
|
||||
this.groupBox1.Location = new System.Drawing.Point(7, 110);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(477, 169);
|
||||
this.groupBox1.TabIndex = 24;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "ROI Detection";
|
||||
this.saveImagesCheckBox.AutoSize = true;
|
||||
this.saveImagesCheckBox.Enabled = false;
|
||||
this.saveImagesCheckBox.Location = new System.Drawing.Point(99, 140);
|
||||
this.saveImagesCheckBox.Name = "saveImagesCheckBox";
|
||||
this.saveImagesCheckBox.Size = new System.Drawing.Size(132, 17);
|
||||
this.saveImagesCheckBox.TabIndex = 7;
|
||||
this.saveImagesCheckBox.Text = "Save images (analyze)";
|
||||
this.saveImagesCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// RoiCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.helpLabel1);
|
||||
this.Controls.Add(this.saveImagesCheckBox);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.previousRoiComboBox);
|
||||
this.Controls.Add(this.previousRoiLabel);
|
||||
this.Controls.Add(this.loadImagesCheckBox);
|
||||
this.Controls.Add(this.parentNameComboBox);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
@@ -269,8 +186,6 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
this.Name = "RoiCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(500, 300);
|
||||
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -278,8 +193,6 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox argsTextBox;
|
||||
private System.Windows.Forms.Label argsLabel;
|
||||
private System.Windows.Forms.Label parentNameLabel;
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
@@ -291,13 +204,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
private System.Windows.Forms.Label previousRoiLabel;
|
||||
private System.Windows.Forms.Label helpLabel1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox imagesCountTextBox;
|
||||
private System.Windows.Forms.Label imagesCountLabel;
|
||||
private System.Windows.Forms.CheckBox useTestImagesCheckBox;
|
||||
private System.Windows.Forms.TextBox period1TextBox;
|
||||
private System.Windows.Forms.Label period1Label;
|
||||
private System.Windows.Forms.TextBox period2TextBox;
|
||||
private System.Windows.Forms.Label period2Label;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.CheckBox loadImagesCheckBox;
|
||||
private System.Windows.Forms.CheckBox saveImagesCheckBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
using TBF.BenchControl.Network.Telnet;
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Network.Telnet;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Roi
|
||||
{
|
||||
public class RoiDetectionOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RoiDetectionOp));
|
||||
public override string ToString() { return string.Format("RoiDetectionOp()"); }
|
||||
|
||||
|
||||
readonly Roi roi;
|
||||
readonly RoiCfg roiCfg;
|
||||
readonly CLP1611.Camera camera;
|
||||
@@ -93,9 +102,10 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
previous.RoiWid.Val, previous.RoiHgh.Val);
|
||||
previous = previous.PreviousRoi;
|
||||
}
|
||||
command = string.Format("clp/RoiDetection{0}{1}{2}{3} {4}",
|
||||
command = string.Format("clp/RoiDetection{0}{1}{2}{3}{4} {5}",
|
||||
masks,
|
||||
string.Format(roiCfg.UseTestImages ? " -l {0}" : " -n {0}", roiCfg.DetectionImagesCount),
|
||||
string.Format(roiCfg.LoadImages ? " -l {0}" : " -n {0}", roiCfg.DetectionImagesCount),
|
||||
roiCfg.SaveImages ? " -s" : "",
|
||||
string.Format(" -p1 {0}", roiCfg.DetectionPeriod1),
|
||||
string.Format(" -p2 {0}", roiCfg.DetectionPeriod2),
|
||||
roiCfg.RoiParams);
|
||||
@@ -109,13 +119,41 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
}
|
||||
return Event.CameraBusy;
|
||||
}
|
||||
else if (passed)
|
||||
{
|
||||
if (transferringDetectedImage)
|
||||
{
|
||||
/// ROI detection passed and image transfer is in progress
|
||||
return Event.RoiDetectionPassed;
|
||||
}
|
||||
else if (0 == camera.WscpTransferFile("detected.jpg", roi.DetectedImageName))
|
||||
{
|
||||
/// Start the file transfer
|
||||
transferringDetectedImage = true;
|
||||
return Event.RoiDetectionPassed;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Wait until the previous image transfer completes
|
||||
return Event.CameraBusy;
|
||||
}
|
||||
}
|
||||
else if (failed)
|
||||
{
|
||||
/// ROI detection failed, there in no image to transfer
|
||||
return Event.RoiDetectionFailed;
|
||||
}
|
||||
else if (previousFailed)
|
||||
{
|
||||
return Event.RoiDetectionPreviousFailed;
|
||||
}
|
||||
else if (response != null)
|
||||
{
|
||||
int from = response.IndexOf('[');
|
||||
int to = response.IndexOf(']');
|
||||
if (!response.Contains("RESULT=0\r\n") || from < 0 || to < 0 || to < from)
|
||||
{
|
||||
roi.Detected = false;
|
||||
roi.ClearRoi();
|
||||
failed = true;
|
||||
return Event.RoiDetectionFailed;
|
||||
}
|
||||
@@ -127,47 +165,30 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
if (terms.Length != 5 || !int.TryParse(terms[0], out x) || !int.TryParse(terms[1], out y)
|
||||
|| !int.TryParse(terms[2], out w) || !int.TryParse(terms[3], out h))
|
||||
{
|
||||
roi.Detected = false;
|
||||
roi.ClearRoi();
|
||||
failed = true;
|
||||
return Event.RoiDetectionFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
roiX.Val = x;
|
||||
roiY.Val = y;
|
||||
roiWid.Val = w;
|
||||
roiHgh.Val = h;
|
||||
|
||||
roi.Detected = true;
|
||||
roi.SetRoi(x, y, w, h);
|
||||
passed = true;
|
||||
return Event.RoiDetectionPassed;
|
||||
|
||||
///
|
||||
/// Start the file transfer
|
||||
///
|
||||
if (0 == camera.WscpTransferFile("detected.jpg", roi.DetectedImageName))
|
||||
{
|
||||
transferringDetectedImage = true;
|
||||
return Event.RoiDetectionPassed;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.CameraBusy; /// File transfer not started
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (passed)
|
||||
{
|
||||
if (transferringDetectedImage)
|
||||
{
|
||||
return Event.RoiDetectionPassed;
|
||||
}
|
||||
else if (0 == camera.WscpTransferFile("detected.jpg"))
|
||||
{
|
||||
transferringDetectedImage = true;
|
||||
return Event.RoiDetectionPassed;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.CameraBusy;
|
||||
}
|
||||
}
|
||||
else if (failed)
|
||||
{
|
||||
return Event.RoiDetectionFailed;
|
||||
}
|
||||
else if (previousFailed)
|
||||
{
|
||||
return Event.RoiDetectionPreviousFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.CameraBusy;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.Network.Telnet
|
||||
{
|
||||
public class DummyVT : IVirtualTerminal
|
||||
{
|
||||
public DummyVT() { }
|
||||
|
||||
public void ClearScreen() { }
|
||||
public void WriteVt(char c) { }
|
||||
public void WriteVt(string txt) { }
|
||||
public string Text { get { return string.Empty; } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.Network.Telnet
|
||||
{
|
||||
public interface IVirtualTerminal
|
||||
{
|
||||
void ClearScreen();
|
||||
void WriteVt(char c);
|
||||
void WriteVt(string txt);
|
||||
string Text { get; }
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ namespace TBF.BenchControl.Network.Telnet
|
||||
/// Private fields
|
||||
///
|
||||
object objRef; /// Reference to object to be included in info sent by event handlers
|
||||
VirtualTerminal vt; /// Virtual terminal
|
||||
IVirtualTerminal vt; /// Virtual terminal
|
||||
string hostname; /// Telnet server host name or IP address.
|
||||
int portNr = DefaultTelnetPortNumber; /// Telnet server port number.
|
||||
TcpClient tcp = null; /// Reference to TcpClient
|
||||
@@ -223,7 +223,7 @@ namespace TBF.BenchControl.Network.Telnet
|
||||
/// Hostname (IP address) and the port number is passed to worker thread
|
||||
/// in a Command with CmdAction.CONNECT and str=hostname.
|
||||
/// </summary>
|
||||
public TelnetClient(object objRef, string threadId, string userName, string password, string defaultPrompt, bool skipFirstLine)
|
||||
public TelnetClient(object objRef, string threadId, string userName, string password, string defaultPrompt, bool skipFirstLine, bool useVT)
|
||||
{
|
||||
this.objRef = objRef;
|
||||
this.telnetUserName = userName;
|
||||
@@ -232,7 +232,17 @@ namespace TBF.BenchControl.Network.Telnet
|
||||
this.skipFirstLine = skipFirstLine;
|
||||
|
||||
state = TelnetState.Inactive; /// Device's icon is being updated by HNIP
|
||||
vt = new VirtualTerminal(); /// TODO: pass a VirtualTerminal reference
|
||||
///
|
||||
if (useVT)
|
||||
{
|
||||
vt = new VirtualTerminal();
|
||||
}
|
||||
else
|
||||
{
|
||||
vt = new DummyVT();
|
||||
}
|
||||
|
||||
/// TODO: pass a VirtualTerminal reference
|
||||
this.portNr = DefaultTelnetPortNumber;
|
||||
queueEvent = new AutoResetEvent(false);
|
||||
disconnectDone = new AutoResetEvent(false);
|
||||
@@ -986,7 +996,7 @@ namespace TBF.BenchControl.Network.Telnet
|
||||
///
|
||||
/// Public properties (read only)
|
||||
///
|
||||
public VirtualTerminal Vt { get { return vt; } }
|
||||
public IVirtualTerminal Vt { get { return vt; } }
|
||||
public string Hostname { get { return hostname; } }
|
||||
public string NotificationText { get { return notificationText; } }
|
||||
public string ErrorText { get { return fatalErrorText; } }
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Network.Telnet
|
||||
/// - ClearScreen() and WriteVt() methods called from one thread only
|
||||
/// - properties Text, etc. can be safely read from an arbitrary thread
|
||||
/// </summary>
|
||||
public class VirtualTerminal
|
||||
public class VirtualTerminal : IVirtualTerminal
|
||||
{
|
||||
const uint DefaultVtRowsCount = 80; /// Default VT height (number of rows)
|
||||
const uint DefaultVtColumnsCount = 132; /// Default VT width (number of columns)
|
||||
|
||||
@@ -85,9 +85,9 @@ namespace TBF.BenchControl.Operations
|
||||
case UI2BenchCmd.Stop: return Event.UiCmdStop;
|
||||
case UI2BenchCmd.PurgeBegin: return Event.UiCmdPurgeBegin;
|
||||
case UI2BenchCmd.PurgeEnd: return Event.UiCmdPurgeEnd;
|
||||
case UI2BenchCmd.EmptyTank1: return Event.UiCmdEmptyTank1;
|
||||
case UI2BenchCmd.EmptyTank2: return Event.UiCmdEmptyTank2;
|
||||
case UI2BenchCmd.EmptyTank3: return Event.UiCmdEmptyTank3;
|
||||
case UI2BenchCmd.DrainTank1: return Event.UiCmdEmptyTank1;
|
||||
case UI2BenchCmd.DrainTank2: return Event.UiCmdEmptyTank2;
|
||||
case UI2BenchCmd.DrainTank3: return Event.UiCmdEmptyTank3;
|
||||
case UI2BenchCmd.Break: return Event.UiCmdBreak;
|
||||
case UI2BenchCmd.ResetResults: return Event.UiCmdResetResults;
|
||||
case UI2BenchCmd.AcceptResults: return Event.UiCmdAcceptResults;
|
||||
|
||||
@@ -37,4 +37,12 @@ namespace TBF.BenchControl.Output.FileWriters
|
||||
Semicolon,
|
||||
Count
|
||||
}
|
||||
|
||||
public enum Culture
|
||||
{
|
||||
EN,
|
||||
DE,
|
||||
SK,
|
||||
Count
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
/// Items to print
|
||||
///
|
||||
string header;
|
||||
IList<Results.WMeterRsltItemSpec> commonItems1;
|
||||
string rootTag;
|
||||
string testTag;
|
||||
IList<Results.WMeterRsltItemSpec> commonItems;
|
||||
IList<Results.WMeterRsltItemSpec> testItems;
|
||||
IList<Results.WMeterRsltItemSpec> commonItems2;
|
||||
string footer;
|
||||
|
||||
|
||||
Thread thread1; /// Thread where one file is saved
|
||||
@@ -51,21 +51,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
|
||||
void ApplyConfig()
|
||||
{
|
||||
switch (writerCfg.Separator)
|
||||
{
|
||||
default:
|
||||
case Separator.None: separatorStr = string.Empty; break;
|
||||
case Separator.Space: separatorStr = " "; break;
|
||||
case Separator.Tabulator: separatorStr = "\t"; break;
|
||||
case Separator.Comma: separatorStr = ","; break;
|
||||
case Separator.Semicolon: separatorStr = ";"; break;
|
||||
}
|
||||
|
||||
/// TODO: Apply culture info
|
||||
rootTag = writerCfg.RootTag;
|
||||
testTag = writerCfg.RootTag;
|
||||
header = string.IsNullOrEmpty(writerCfg.Header) ? string.Empty : writerCfg.Header.Replace("~", Environment.NewLine);
|
||||
commonItems1 = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.CommonItems1);
|
||||
testItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.SelectedItems); /// TestID info will be overwritten later on
|
||||
commonItems2 = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.CommonItems2);
|
||||
footer = string.IsNullOrEmpty(writerCfg.Footer) ? string.Empty : writerCfg.Footer.Replace("~", Environment.NewLine);
|
||||
commonItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.CommonItems);
|
||||
testItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.TestItems); /// TestID info will be overwritten later on
|
||||
}
|
||||
|
||||
|
||||
@@ -95,12 +86,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
writerCfg.MonthFolders = newCfg.MonthFolders;
|
||||
writerCfg.DayFolders = newCfg.DayFolders;
|
||||
writerCfg.FileNameFormat = newCfg.FileNameFormat;
|
||||
writerCfg.Separator = newCfg.Separator;
|
||||
writerCfg.CommonItems1 = newCfg.CommonItems1;
|
||||
writerCfg.SelectedItems = newCfg.SelectedItems;
|
||||
writerCfg.CommonItems2 = newCfg.CommonItems2;
|
||||
writerCfg.Culture = newCfg.Culture;
|
||||
writerCfg.Header = newCfg.Header;
|
||||
writerCfg.Footer = newCfg.Footer;
|
||||
writerCfg.RootTag = newCfg.RootTag;
|
||||
writerCfg.TestTag = newCfg.TestTag;
|
||||
writerCfg.CommonItems = newCfg.CommonItems;
|
||||
writerCfg.TestItems = newCfg.TestItems;
|
||||
|
||||
ApplyConfig();
|
||||
}
|
||||
@@ -264,9 +255,10 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
{
|
||||
/// Header
|
||||
if (!string.IsNullOrEmpty(writerCfg.Header)) wr.Write(header);
|
||||
wr.WriteLine(string.Format("<{0}>", rootTag));
|
||||
|
||||
/// Common items 1
|
||||
foreach (var v in commonItems1)
|
||||
foreach (var v in commonItems)
|
||||
{
|
||||
if (abort) return;
|
||||
|
||||
@@ -285,7 +277,7 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
|
||||
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
|
||||
{
|
||||
wr.WriteLine(" <prueflauf>");
|
||||
wr.WriteLine(string.Format(" <{0}>", testTag));
|
||||
for (int i = 0; i < testItems.Count; i++)
|
||||
{
|
||||
/// Fetch the item and strip color information
|
||||
@@ -296,26 +288,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
/// Print the item
|
||||
wr.WriteLine(" <{0}>{1}</{0}>", testItems[i].Caption, itemText);
|
||||
}
|
||||
wr.WriteLine(" </prueflauf>");
|
||||
wr.WriteLine(string.Format(" </{0}>", testTag));
|
||||
}
|
||||
}
|
||||
|
||||
/// Common items 2
|
||||
foreach (var v in commonItems2)
|
||||
{
|
||||
if (abort) return;
|
||||
|
||||
/// Fetch the item and strip color information
|
||||
string itemText = v.Print(wm);
|
||||
string[] texts = itemText.Split(new char[] { '|' });
|
||||
if (texts.Length == 2) { itemText = texts[0]; }
|
||||
|
||||
wr.WriteLine(" <{0}>{1}</{0}>", v.Caption, itemText);
|
||||
}
|
||||
|
||||
/// Footer
|
||||
if (abort) return;
|
||||
if (!string.IsNullOrEmpty(writerCfg.Footer)) wr.Write(footer);
|
||||
wr.WriteLine(string.Format("</{0}>", rootTag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
public MonthFolders MonthFolders;
|
||||
public DayFolders DayFolders;
|
||||
public string FileNameFormat;
|
||||
public Separator Separator;
|
||||
public Culture Culture;
|
||||
public string Header;
|
||||
public string[] CommonItems1;
|
||||
public string[] SelectedItems;
|
||||
public string[] CommonItems2;
|
||||
public string Footer;
|
||||
public string RootTag;
|
||||
public string TestTag;
|
||||
public string[] CommonItems;
|
||||
public string[] TestItems;
|
||||
|
||||
[XmlIgnore]
|
||||
public Config.Entities.MetersKind MetersKind;
|
||||
@@ -47,23 +47,24 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
DestinationPath2 = string.Empty;
|
||||
YearFolders = YearFolders.FourDigit;
|
||||
MonthFolders = MonthFolders.Digit;
|
||||
DayFolders = DayFolders.Digit;
|
||||
DayFolders = DayFolders.Digit;
|
||||
FileNameFormat = "{0:yyMMdd-HHmm}-{2:D2}.xml";
|
||||
Separator = Separator.None;
|
||||
Header = string.Empty;
|
||||
Footer = string.Empty;
|
||||
Culture = Culture.EN;
|
||||
Header = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
|
||||
RootTag = "gwzPruefung";
|
||||
TestTag = "prueflauf";
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Separator={6}",
|
||||
return string.Format("Name={0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Culture={6}",
|
||||
Name,
|
||||
DestinationPath,
|
||||
YearFolders,
|
||||
MonthFolders,
|
||||
DayFolders,
|
||||
FileNameFormat,
|
||||
Separator);
|
||||
Culture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,8 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
}
|
||||
|
||||
string header;
|
||||
string[] commonItems1;
|
||||
string[] commonItems;
|
||||
string[] testItems;
|
||||
string[] commonItems2;
|
||||
string footer;
|
||||
|
||||
public WriterCfgCtrl()
|
||||
{
|
||||
@@ -43,21 +41,14 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
|
||||
private void WriterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
for (Separator s = 0; s < Separator.Count; s++) separatorComboBox.Items.Add(s.ToString());
|
||||
for (YearFolders s = 0; s < YearFolders.Count; s++) yearFoldersComboBox.Items.Add(s.ToString());
|
||||
for (MonthFolders s = 0; s < MonthFolders.Count; s++) monthFoldersComboBox.Items.Add(s.ToString());
|
||||
for (DayFolders s = 0; s < DayFolders.Count; s++) dayFoldersComboBox.Items.Add(s.ToString());
|
||||
|
||||
for (int i = 0; i < (int)Separator.Count; i++)
|
||||
{
|
||||
separatorComboBox.Items.Add(((Separator)i).ToString());
|
||||
}
|
||||
for (Culture s = 0; s < Culture.Count; s++) cultureComboBox.Items.Add(s.ToString());
|
||||
|
||||
header = config.Header;
|
||||
commonItems1 = config.CommonItems1;
|
||||
testItems = config.SelectedItems;
|
||||
commonItems2 = config.CommonItems2;
|
||||
footer = config.Footer;
|
||||
commonItems = config.CommonItems;
|
||||
testItems = config.TestItems;
|
||||
|
||||
Redraw();
|
||||
}
|
||||
@@ -71,12 +62,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
monthFoldersLabel.Text = "Month folders";
|
||||
dayFoldersLabel.Text = "Day folders";
|
||||
fileNameFmtLabel.Text = "File name format";
|
||||
separatorLabel.Text = "Separator";
|
||||
cultureLabel.Text = "Culture";
|
||||
headerButton.Text = Strings.Header;
|
||||
commonItemsButton1.Text = "Common items 1";
|
||||
testItemsButton.Text = "Test items";
|
||||
commonItemsButton2.Text = "Common items 2";
|
||||
footerButton.Text = Strings.Footer;
|
||||
rootTagLabel.Text = "Root tag";
|
||||
commonItemsButton.Text = "Common items";
|
||||
testTagLabel.Text = "Test tag";
|
||||
testItemsButton.Text = "Test items";
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
@@ -94,7 +85,9 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
monthFoldersComboBox.Text = config.MonthFolders.ToString();
|
||||
dayFoldersComboBox.Text = config.DayFolders.ToString();
|
||||
fileNameFmtTextBox.Text = config.FileNameFormat;
|
||||
separatorComboBox.Text = config.Separator.ToString();
|
||||
cultureComboBox.Text = config.Culture.ToString();
|
||||
rootTagTextBox.Text = config.RootTag;
|
||||
testTagTextBox.Text = config.TestTag;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
@@ -108,12 +101,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
monthFoldersComboBox.Enabled = true;
|
||||
dayFoldersComboBox.Enabled = true;
|
||||
fileNameFmtTextBox.Enabled = true;
|
||||
separatorComboBox.Enabled = true;
|
||||
cultureComboBox.Enabled = true;
|
||||
headerButton.Enabled = true;
|
||||
commonItemsButton1.Enabled = true;
|
||||
testItemsButton.Enabled = true;
|
||||
commonItemsButton2.Enabled = true;
|
||||
footerButton.Enabled = true;
|
||||
rootTagTextBox.Enabled = true;
|
||||
commonItemsButton.Enabled = true;
|
||||
testTagTextBox.Enabled = true;
|
||||
testItemsButton.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
@@ -138,11 +131,24 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
message += Environment.NewLine + "Invalid day folder selection";
|
||||
}
|
||||
|
||||
if (!separatorComboBox.Items.Contains(separatorComboBox.Text))
|
||||
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid separator";
|
||||
message += Environment.NewLine + "Invalid culture";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(rootTagTextBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Root tag field is empty";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(testTagTextBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Test tag field is empty";
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -208,48 +214,47 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
|
||||
for (Separator i = 0; i < Separator.Count; i++)
|
||||
for (Culture i = 0; i < Culture.Count; i++)
|
||||
{
|
||||
if (i.ToString().Equals(separatorComboBox.Text) && (config.Separator != i))
|
||||
if (i.ToString().Equals(cultureComboBox.Text) && (config.Culture != i))
|
||||
{
|
||||
config.Separator = i;
|
||||
config.Culture = i;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (config.Header != header)
|
||||
{
|
||||
config.Header = header;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.CommonItems1 != commonItems1)
|
||||
{
|
||||
config.CommonItems1 = commonItems1;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.SelectedItems != testItems)
|
||||
{
|
||||
config.SelectedItems = testItems;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.CommonItems2 != commonItems2)
|
||||
if (config.RootTag != rootTagTextBox.Text)
|
||||
{
|
||||
config.CommonItems2 = commonItems2;
|
||||
config.RootTag = rootTagTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.CommonItems != commonItems)
|
||||
{
|
||||
config.CommonItems = commonItems;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.Footer != footer)
|
||||
{
|
||||
config.Footer = footer;
|
||||
if (config.TestTag != testTagTextBox.Text)
|
||||
{
|
||||
config.TestTag = testTagTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.TestItems != testItems)
|
||||
{
|
||||
config.TestItems = testItems;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
@@ -273,12 +278,12 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
}
|
||||
}
|
||||
|
||||
private void commonItemsButton1_Click(object sender, EventArgs e)
|
||||
private void commonItemsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
|
||||
{
|
||||
MetersKind = config.MetersKind,
|
||||
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems1),
|
||||
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
|
||||
AvailableItems = new List<Results.WMeterRsltItemSpec>()
|
||||
};
|
||||
|
||||
@@ -286,27 +291,10 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
commonItems1 = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
}
|
||||
}
|
||||
|
||||
private void commonItemsButton2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
|
||||
{
|
||||
MetersKind = config.MetersKind,
|
||||
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems2),
|
||||
AvailableItems = new List<Results.WMeterRsltItemSpec>()
|
||||
};
|
||||
|
||||
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
commonItems2 = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
}
|
||||
}
|
||||
|
||||
private void testItemsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(true)
|
||||
@@ -324,15 +312,6 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
}
|
||||
}
|
||||
|
||||
private void footerButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HeaderFooterDlg dlg = new HeaderFooterDlg(false, string.IsNullOrEmpty(footer) ? string.Empty : footer.Replace("~", Environment.NewLine));
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
footer = dlg.EditedText.Replace(Environment.NewLine, "~");
|
||||
}
|
||||
}
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCmdResponse(object sender, CmdResponseArgs args)
|
||||
|
||||
+78
-60
@@ -37,8 +37,8 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
this.destinationTextBox = new System.Windows.Forms.TextBox();
|
||||
this.destinationLabel = new System.Windows.Forms.Label();
|
||||
this.destinationButton = new System.Windows.Forms.Button();
|
||||
this.separatorLabel = new System.Windows.Forms.Label();
|
||||
this.separatorComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.cultureLabel = new System.Windows.Forms.Label();
|
||||
this.cultureComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.testItemsButton = new System.Windows.Forms.Button();
|
||||
this.yearFoldersLabel = new System.Windows.Forms.Label();
|
||||
this.monthFoldersLabel = new System.Windows.Forms.Label();
|
||||
@@ -52,9 +52,11 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
|
||||
this.fileNameFmtLabel = new System.Windows.Forms.Label();
|
||||
this.headerButton = new System.Windows.Forms.Button();
|
||||
this.footerButton = new System.Windows.Forms.Button();
|
||||
this.commonItemsButton1 = new System.Windows.Forms.Button();
|
||||
this.commonItemsButton2 = new System.Windows.Forms.Button();
|
||||
this.commonItemsButton = new System.Windows.Forms.Button();
|
||||
this.rootTagTextBox = new System.Windows.Forms.TextBox();
|
||||
this.rootTagLabel = new System.Windows.Forms.Label();
|
||||
this.testTagLabel = new System.Windows.Forms.Label();
|
||||
this.testTagTextBox = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
@@ -111,31 +113,31 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
this.destinationButton.UseVisualStyleBackColor = true;
|
||||
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
|
||||
//
|
||||
// separatorLabel
|
||||
// cultureLabel
|
||||
//
|
||||
this.separatorLabel.AutoSize = true;
|
||||
this.separatorLabel.Location = new System.Drawing.Point(17, 184);
|
||||
this.separatorLabel.Name = "separatorLabel";
|
||||
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
|
||||
this.separatorLabel.TabIndex = 17;
|
||||
this.separatorLabel.Text = "Separator";
|
||||
this.cultureLabel.AutoSize = true;
|
||||
this.cultureLabel.Location = new System.Drawing.Point(17, 184);
|
||||
this.cultureLabel.Name = "cultureLabel";
|
||||
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
|
||||
this.cultureLabel.TabIndex = 17;
|
||||
this.cultureLabel.Text = "Cullture";
|
||||
//
|
||||
// separatorComboBox
|
||||
// cultureComboBox
|
||||
//
|
||||
this.separatorComboBox.Enabled = false;
|
||||
this.separatorComboBox.FormattingEnabled = true;
|
||||
this.separatorComboBox.Location = new System.Drawing.Point(108, 181);
|
||||
this.separatorComboBox.Name = "separatorComboBox";
|
||||
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
|
||||
this.separatorComboBox.TabIndex = 18;
|
||||
this.cultureComboBox.Enabled = false;
|
||||
this.cultureComboBox.FormattingEnabled = true;
|
||||
this.cultureComboBox.Location = new System.Drawing.Point(108, 181);
|
||||
this.cultureComboBox.Name = "cultureComboBox";
|
||||
this.cultureComboBox.Size = new System.Drawing.Size(146, 21);
|
||||
this.cultureComboBox.TabIndex = 18;
|
||||
//
|
||||
// testItemsButton
|
||||
//
|
||||
this.testItemsButton.Enabled = false;
|
||||
this.testItemsButton.Location = new System.Drawing.Point(108, 255);
|
||||
this.testItemsButton.Location = new System.Drawing.Point(108, 294);
|
||||
this.testItemsButton.Name = "testItemsButton";
|
||||
this.testItemsButton.Size = new System.Drawing.Size(146, 23);
|
||||
this.testItemsButton.TabIndex = 21;
|
||||
this.testItemsButton.TabIndex = 25;
|
||||
this.testItemsButton.Text = "Test items";
|
||||
this.testItemsButton.UseVisualStyleBackColor = true;
|
||||
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
|
||||
@@ -241,7 +243,7 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
// headerButton
|
||||
//
|
||||
this.headerButton.Enabled = false;
|
||||
this.headerButton.Location = new System.Drawing.Point(108, 205);
|
||||
this.headerButton.Location = new System.Drawing.Point(108, 204);
|
||||
this.headerButton.Name = "headerButton";
|
||||
this.headerButton.Size = new System.Drawing.Size(146, 23);
|
||||
this.headerButton.TabIndex = 19;
|
||||
@@ -249,46 +251,60 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
this.headerButton.UseVisualStyleBackColor = true;
|
||||
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
|
||||
//
|
||||
// footerButton
|
||||
// commonItemsButton
|
||||
//
|
||||
this.footerButton.Enabled = false;
|
||||
this.footerButton.Location = new System.Drawing.Point(108, 305);
|
||||
this.footerButton.Name = "footerButton";
|
||||
this.footerButton.Size = new System.Drawing.Size(146, 23);
|
||||
this.footerButton.TabIndex = 23;
|
||||
this.footerButton.Text = "Footer";
|
||||
this.footerButton.UseVisualStyleBackColor = true;
|
||||
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
|
||||
this.commonItemsButton.Enabled = false;
|
||||
this.commonItemsButton.Location = new System.Drawing.Point(108, 249);
|
||||
this.commonItemsButton.Name = "commonItemsButton";
|
||||
this.commonItemsButton.Size = new System.Drawing.Size(146, 23);
|
||||
this.commonItemsButton.TabIndex = 22;
|
||||
this.commonItemsButton.Text = "Common items";
|
||||
this.commonItemsButton.UseVisualStyleBackColor = true;
|
||||
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
|
||||
//
|
||||
// commonItemsButton1
|
||||
// rootTagTextBox
|
||||
//
|
||||
this.commonItemsButton1.Enabled = false;
|
||||
this.commonItemsButton1.Location = new System.Drawing.Point(108, 230);
|
||||
this.commonItemsButton1.Name = "commonItemsButton1";
|
||||
this.commonItemsButton1.Size = new System.Drawing.Size(146, 23);
|
||||
this.commonItemsButton1.TabIndex = 20;
|
||||
this.commonItemsButton1.Text = "Common items 1";
|
||||
this.commonItemsButton1.UseVisualStyleBackColor = true;
|
||||
this.commonItemsButton1.Click += new System.EventHandler(this.commonItemsButton1_Click);
|
||||
this.rootTagTextBox.Enabled = false;
|
||||
this.rootTagTextBox.Location = new System.Drawing.Point(108, 228);
|
||||
this.rootTagTextBox.Name = "rootTagTextBox";
|
||||
this.rootTagTextBox.Size = new System.Drawing.Size(146, 20);
|
||||
this.rootTagTextBox.TabIndex = 21;
|
||||
//
|
||||
// commonItemsButton2
|
||||
// rootTagLabel
|
||||
//
|
||||
this.commonItemsButton2.Enabled = false;
|
||||
this.commonItemsButton2.Location = new System.Drawing.Point(108, 280);
|
||||
this.commonItemsButton2.Name = "commonItemsButton2";
|
||||
this.commonItemsButton2.Size = new System.Drawing.Size(146, 23);
|
||||
this.commonItemsButton2.TabIndex = 22;
|
||||
this.commonItemsButton2.Text = "Common items 2";
|
||||
this.commonItemsButton2.UseVisualStyleBackColor = true;
|
||||
this.commonItemsButton2.Click += new System.EventHandler(this.commonItemsButton2_Click);
|
||||
this.rootTagLabel.AutoSize = true;
|
||||
this.rootTagLabel.Location = new System.Drawing.Point(17, 231);
|
||||
this.rootTagLabel.Name = "rootTagLabel";
|
||||
this.rootTagLabel.Size = new System.Drawing.Size(48, 13);
|
||||
this.rootTagLabel.TabIndex = 20;
|
||||
this.rootTagLabel.Text = "Root tag";
|
||||
//
|
||||
// testTagLabel
|
||||
//
|
||||
this.testTagLabel.AutoSize = true;
|
||||
this.testTagLabel.Location = new System.Drawing.Point(17, 276);
|
||||
this.testTagLabel.Name = "testTagLabel";
|
||||
this.testTagLabel.Size = new System.Drawing.Size(46, 13);
|
||||
this.testTagLabel.TabIndex = 23;
|
||||
this.testTagLabel.Text = "Test tag";
|
||||
//
|
||||
// testTagTextBox
|
||||
//
|
||||
this.testTagTextBox.Enabled = false;
|
||||
this.testTagTextBox.Location = new System.Drawing.Point(108, 273);
|
||||
this.testTagTextBox.Name = "testTagTextBox";
|
||||
this.testTagTextBox.Size = new System.Drawing.Size(146, 20);
|
||||
this.testTagTextBox.TabIndex = 24;
|
||||
//
|
||||
// WriterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.commonItemsButton2);
|
||||
this.Controls.Add(this.commonItemsButton1);
|
||||
this.Controls.Add(this.footerButton);
|
||||
this.Controls.Add(this.testTagLabel);
|
||||
this.Controls.Add(this.testTagTextBox);
|
||||
this.Controls.Add(this.rootTagLabel);
|
||||
this.Controls.Add(this.rootTagTextBox);
|
||||
this.Controls.Add(this.commonItemsButton);
|
||||
this.Controls.Add(this.headerButton);
|
||||
this.Controls.Add(this.fileNameFmtTextBox);
|
||||
this.Controls.Add(this.fileNameFmtLabel);
|
||||
@@ -302,8 +318,8 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
this.Controls.Add(this.monthFoldersLabel);
|
||||
this.Controls.Add(this.yearFoldersLabel);
|
||||
this.Controls.Add(this.testItemsButton);
|
||||
this.Controls.Add(this.separatorComboBox);
|
||||
this.Controls.Add(this.separatorLabel);
|
||||
this.Controls.Add(this.cultureComboBox);
|
||||
this.Controls.Add(this.cultureLabel);
|
||||
this.Controls.Add(this.destinationButton);
|
||||
this.Controls.Add(this.destinationTextBox);
|
||||
this.Controls.Add(this.destinationLabel);
|
||||
@@ -326,8 +342,8 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
private System.Windows.Forms.TextBox destinationTextBox;
|
||||
private System.Windows.Forms.Label destinationLabel;
|
||||
private System.Windows.Forms.Button destinationButton;
|
||||
private System.Windows.Forms.Label separatorLabel;
|
||||
private System.Windows.Forms.ComboBox separatorComboBox;
|
||||
private System.Windows.Forms.Label cultureLabel;
|
||||
private System.Windows.Forms.ComboBox cultureComboBox;
|
||||
private System.Windows.Forms.Button testItemsButton;
|
||||
private System.Windows.Forms.Label yearFoldersLabel;
|
||||
private System.Windows.Forms.Label monthFoldersLabel;
|
||||
@@ -340,9 +356,11 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
|
||||
private System.Windows.Forms.Label destination2Label;
|
||||
private System.Windows.Forms.TextBox fileNameFmtTextBox;
|
||||
private System.Windows.Forms.Label fileNameFmtLabel;
|
||||
private System.Windows.Forms.Button headerButton;
|
||||
private System.Windows.Forms.Button footerButton;
|
||||
private System.Windows.Forms.Button commonItemsButton1;
|
||||
private System.Windows.Forms.Button commonItemsButton2;
|
||||
private System.Windows.Forms.Button headerButton;
|
||||
private System.Windows.Forms.Button commonItemsButton;
|
||||
private System.Windows.Forms.TextBox rootTagTextBox;
|
||||
private System.Windows.Forms.Label rootTagLabel;
|
||||
private System.Windows.Forms.Label testTagLabel;
|
||||
private System.Windows.Forms.TextBox testTagTextBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
@@ -18,8 +18,7 @@ namespace TBF.BenchControl
|
||||
public IValve StartValve;
|
||||
public IDiverter Diverter;
|
||||
public ITempMeter TempDiv;
|
||||
public IBalance Balance;
|
||||
public IValve EmptyTankValve;
|
||||
public IScale Scale;
|
||||
public IList<IValve> ValvesOpen;
|
||||
public IList<IValve> ValvesClose;
|
||||
|
||||
@@ -44,8 +43,7 @@ namespace TBF.BenchControl
|
||||
StartValve = (IValve)TbfComponents.FindComponent(entity.StartValve, components);
|
||||
Diverter = (IDiverter)TbfComponents.FindComponent(entity.Diverter, components);
|
||||
TempDiv = (ITempMeter)TbfComponents.FindComponent(entity.TempDiv, components);
|
||||
Balance = (IBalance)TbfComponents.FindComponent(entity.Balance, components);
|
||||
EmptyTankValve = (IValve)TbfComponents.FindComponent(entity.EmptyTankValve, components);
|
||||
Scale = (IScale)TbfComponents.FindComponent(entity.Scale, components);
|
||||
|
||||
string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' });
|
||||
ValvesOpen = new List<IValve>();
|
||||
@@ -63,7 +61,7 @@ namespace TBF.BenchControl
|
||||
(RegulValve != null) ? RegulValve.Name : "---",
|
||||
(FlowMeter != null) ? FlowMeter.Name : "---",
|
||||
(Diverter != null) ? Diverter.Name : "---",
|
||||
(Balance != null) ? Balance.Name : "---");
|
||||
(Scale != null) ? Scale.Name : "---");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,29 +126,29 @@ namespace TBF.BenchControl.Sequences
|
||||
IntBox remainingTime = new IntBox();
|
||||
State startNew = State.Create("MainSeq : Emptying tanks")
|
||||
.AddOperation(checkUiOp);
|
||||
IList<IValve> allEmptyingValves = new List<IValve>();
|
||||
if (StateMachine.EmptyTankValve1 != null) allEmptyingValves.Add(StateMachine.EmptyTankValve1);
|
||||
if (StateMachine.EmptyTankValve2 != null) allEmptyingValves.Add(StateMachine.EmptyTankValve2);
|
||||
if (StateMachine.EmptyTankValve3 != null) allEmptyingValves.Add(StateMachine.EmptyTankValve3);
|
||||
IList<IValve> allDrainValves = new List<IValve>();
|
||||
if (StateMachine.DrainValve1 != null) allDrainValves.Add(StateMachine.DrainValve1);
|
||||
if (StateMachine.DrainValve2 != null) allDrainValves.Add(StateMachine.DrainValve2);
|
||||
if (StateMachine.DrainValve3 != null) allDrainValves.Add(StateMachine.DrainValve3);
|
||||
|
||||
// Determine the tank emptying time (the maximum for all balances)
|
||||
int balanceEmptyTime = 0;
|
||||
if (StateMachine.Balance1 != null && StateMachine.Balance1.EmptyTimeSec > balanceEmptyTime)
|
||||
int scaleDrainTime = 0;
|
||||
if (StateMachine.Scale1 != null && StateMachine.Scale1.EmptyTimeSec > scaleDrainTime)
|
||||
{
|
||||
balanceEmptyTime = StateMachine.Balance1.EmptyTimeSec;
|
||||
scaleDrainTime = StateMachine.Scale1.EmptyTimeSec;
|
||||
}
|
||||
if (StateMachine.Balance2 != null && StateMachine.Balance2.EmptyTimeSec > balanceEmptyTime)
|
||||
if (StateMachine.Scale2 != null && StateMachine.Scale2.EmptyTimeSec > scaleDrainTime)
|
||||
{
|
||||
balanceEmptyTime = StateMachine.Balance2.EmptyTimeSec;
|
||||
scaleDrainTime = StateMachine.Scale2.EmptyTimeSec;
|
||||
}
|
||||
if (StateMachine.Balance3 != null && StateMachine.Balance3.EmptyTimeSec > balanceEmptyTime)
|
||||
if (StateMachine.Scale3 != null && StateMachine.Scale3.EmptyTimeSec > scaleDrainTime)
|
||||
{
|
||||
balanceEmptyTime = StateMachine.Balance3.EmptyTimeSec;
|
||||
scaleDrainTime = StateMachine.Scale3.EmptyTimeSec;
|
||||
}
|
||||
if (balanceEmptyTime > 0)
|
||||
if (scaleDrainTime > 0)
|
||||
{
|
||||
startNew.AddOperation(new TimerOp(balanceEmptyTime, remainingTime))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(allEmptyingValves, null));
|
||||
startNew.AddOperation(new TimerOp(scaleDrainTime, remainingTime))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(allDrainValves, null));
|
||||
}
|
||||
|
||||
startNew.EnterState();
|
||||
@@ -177,7 +177,7 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------------------------------------------------------------------
|
||||
State stopEmptying = State.Create("MainSeq : Stop emptying of water tanks")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, allEmptyingValves))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, allDrainValves))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -190,9 +190,9 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------------------------------------------------------------------
|
||||
State taraAll = State.Create("MainSeq : Reset all balances").AddOperation(checkUiOp);
|
||||
DoubleBox tara = new DoubleBox(0);
|
||||
if (StateMachine.Balance1 != null) taraAll.AddOperation(StateMachine.Balance1.TaringOp(ref tara));
|
||||
if (StateMachine.Balance2 != null) taraAll.AddOperation(StateMachine.Balance2.TaringOp(ref tara));
|
||||
if (StateMachine.Balance3 != null) taraAll.AddOperation(StateMachine.Balance3.TaringOp(ref tara));
|
||||
if (StateMachine.Scale1 != null) taraAll.AddOperation(StateMachine.Scale1.TaringOp(ref tara));
|
||||
if (StateMachine.Scale2 != null) taraAll.AddOperation(StateMachine.Scale2.TaringOp(ref tara));
|
||||
if (StateMachine.Scale3 != null) taraAll.AddOperation(StateMachine.Scale3.TaringOp(ref tara));
|
||||
taraAll.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -516,9 +516,9 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
|
||||
/// Update format for the water mass
|
||||
Mass.Format = outPath.Balance.Format;
|
||||
StartMass.Format = outPath.Balance.Format;
|
||||
EndMass.Format = outPath.Balance.Format;
|
||||
Mass.Format = outPath.Scale.Format;
|
||||
StartMass.Format = outPath.Scale.Format;
|
||||
EndMass.Format = outPath.Scale.Format;
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ITestMethod testMethodSequence = TbfComponents.FindComponent(test.Method) as ITestMethod;
|
||||
@@ -658,9 +658,9 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
|
||||
/// Update format for the water mass
|
||||
Mass.Format = outPath.Balance.Format;
|
||||
StartMass.Format = outPath.Balance.Format;
|
||||
EndMass.Format = outPath.Balance.Format;
|
||||
Mass.Format = outPath.Scale.Format;
|
||||
StartMass.Format = outPath.Scale.Format;
|
||||
EndMass.Format = outPath.Scale.Format;
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ITestMethod testMethodSequence = TbfComponents.FindComponent(test.Method) as ITestMethod;
|
||||
@@ -754,9 +754,9 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
|
||||
/// Update format for the water mass
|
||||
Mass.Format = outPath.Balance.Format;
|
||||
StartMass.Format = outPath.Balance.Format;
|
||||
EndMass.Format = outPath.Balance.Format;
|
||||
Mass.Format = outPath.Scale.Format;
|
||||
StartMass.Format = outPath.Scale.Format;
|
||||
EndMass.Format = outPath.Scale.Format;
|
||||
|
||||
ITestMethod testMethodSequence = TbfComponents.FindComponent(test.Method) as ITestMethod;
|
||||
if (testMethodSequence != null && testMethodSequence.CanTest(StateMachine.Procedure.MetersKind))
|
||||
@@ -1046,9 +1046,9 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
/// Handled inside MakeSelection()
|
||||
None,
|
||||
EmptyTank1,
|
||||
EmptyTank2,
|
||||
EmptyTank3,
|
||||
DrainTank1,
|
||||
DrainTank2,
|
||||
DrainTank3,
|
||||
CloseTank1,
|
||||
CloseTank2,
|
||||
CloseTank3,
|
||||
@@ -1086,9 +1086,9 @@ namespace TBF.BenchControl.Sequences
|
||||
private Selection MakeSelection(MKSelContext context)
|
||||
{
|
||||
/// Tank emptying valves states
|
||||
bool emptying1 = false;
|
||||
bool emptying2 = false;
|
||||
bool emptying3 = false;
|
||||
bool draining1 = false;
|
||||
bool draining2 = false;
|
||||
bool draining3 = false;
|
||||
|
||||
/// Measured masses to control emptying
|
||||
DoubleBox mass1 = new DoubleBox();
|
||||
@@ -1101,7 +1101,7 @@ namespace TBF.BenchControl.Sequences
|
||||
while (true)
|
||||
{
|
||||
/// Display an appropriate activity message
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
if (draining1 || draining2 || draining3)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
}
|
||||
@@ -1118,7 +1118,7 @@ namespace TBF.BenchControl.Sequences
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn |
|
||||
ButtonsEtc.StopBtnEn |
|
||||
((emptying1 || emptying2 || emptying3) ? 0 :
|
||||
((draining1 || draining2 || draining3) ? 0 :
|
||||
(ButtonsEtc.StartCycleBtnEn |
|
||||
ButtonsEtc.StartTestBtnsEn |
|
||||
ButtonsEtc.PurgeBeginBtnEn |
|
||||
@@ -1126,16 +1126,16 @@ namespace TBF.BenchControl.Sequences
|
||||
ButtonsEtc.SensitivityTestBtnEn |
|
||||
((Cameras.Count > 0) ? ButtonsEtc.CalibrationBtnEn : 0) |
|
||||
ButtonsEtc.Break)) |
|
||||
(((StateMachine.Balance1 != null) && (StateMachine.EmptyTankValve1 != null) && !emptying1) ? ButtonsEtc.EmptyTankBtn1En : 0) |
|
||||
(((StateMachine.Balance2 != null) && (StateMachine.EmptyTankValve2 != null) && !emptying2) ? ButtonsEtc.EmptyTankBtn2En : 0) |
|
||||
(((StateMachine.Balance3 != null) && (StateMachine.EmptyTankValve3 != null) && !emptying3) ? ButtonsEtc.EmptyTankBtn3En : 0));
|
||||
(((StateMachine.Scale1 != null) && (StateMachine.DrainValve1 != null) && !draining1) ? ButtonsEtc.DrainTankBtn1En : 0) |
|
||||
(((StateMachine.Scale2 != null) && (StateMachine.DrainValve2 != null) && !draining2) ? ButtonsEtc.DrainTankBtn2En : 0) |
|
||||
(((StateMachine.Scale3 != null) && (StateMachine.DrainValve3 != null) && !draining3) ? ButtonsEtc.DrainTankBtn3En : 0));
|
||||
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Select an activity")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((StateMachine.Balance1 != null) ? StateMachine.Balance1.ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Balance2 != null) ? StateMachine.Balance2.ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Balance3 != null) ? StateMachine.Balance3.ReadMassOp(ref mass3) : null)
|
||||
.AddOperation((StateMachine.Scale1 != null) ? StateMachine.Scale1.ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Scale2 != null) ? StateMachine.Scale2.ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Scale3 != null) ? StateMachine.Scale3.ReadMassOp(ref mass3) : null)
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
@@ -1144,12 +1144,12 @@ namespace TBF.BenchControl.Sequences
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
else if (e.Contains(Event.UiCmdStop)) selection = Selection.Stop;
|
||||
else if (e.Contains(Event.UiCmdCameraTest)) selection = Selection.CameraTest;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.EmptyTank1;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.EmptyTank2;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.EmptyTank3;
|
||||
else if (emptying1 && StateMachine.Balance1.IsEmpty(mass1.Val)) selection = Selection.CloseTank1;
|
||||
else if (emptying2 && StateMachine.Balance2.IsEmpty(mass2.Val)) selection = Selection.CloseTank2;
|
||||
else if (emptying3 && StateMachine.Balance3.IsEmpty(mass3.Val)) selection = Selection.CloseTank3;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.DrainTank1;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.DrainTank2;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.DrainTank3;
|
||||
else if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val)) selection = Selection.CloseTank1;
|
||||
else if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val)) selection = Selection.CloseTank2;
|
||||
else if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val)) selection = Selection.CloseTank3;
|
||||
else if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin; /// Value used to branch the code later on
|
||||
else if (e.Contains(Event.UiCmdPurgeEnd)) return Selection.PurgeEnd;
|
||||
else if (e.Contains(Event.UiCmdBreak) && context == MKSelContext.InsideProcedure) return Selection.Break;
|
||||
@@ -1168,60 +1168,60 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
else if (selection == Selection.Stop)
|
||||
{
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
if (draining1 || draining2 || draining3)
|
||||
{
|
||||
IList<IValve> valvesClose = new List<IValve>();
|
||||
if (emptying1) valvesClose.Add(StateMachine.EmptyTankValve1);
|
||||
if (emptying2) valvesClose.Add(StateMachine.EmptyTankValve2);
|
||||
if (emptying3) valvesClose.Add(StateMachine.EmptyTankValve3);
|
||||
if (draining1) valvesClose.Add(StateMachine.DrainValve1);
|
||||
if (draining2) valvesClose.Add(StateMachine.DrainValve2);
|
||||
if (draining3) valvesClose.Add(StateMachine.DrainValve3);
|
||||
|
||||
State.Create("MainSeq : Close emptying valve(s)")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, valvesClose))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = emptying2 = emptying3 = false;
|
||||
draining1 = draining2 = draining3 = false;
|
||||
}
|
||||
selection = Selection.None;
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank1) && !emptying1)
|
||||
else if ((selection == Selection.DrainTank1) && !draining1)
|
||||
{
|
||||
emptying1 = true;
|
||||
draining1 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying2 ? 0 : ButtonsEtc.EmptyTankBtn2En) |
|
||||
(emptying3 ? 0 : ButtonsEtc.EmptyTankBtn3En));
|
||||
(draining2 ? 0 : ButtonsEtc.DrainTankBtn2En) |
|
||||
(draining3 ? 0 : ButtonsEtc.DrainTankBtn3En));
|
||||
State.Create("MainSeq : Open tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve1, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DrainValve1, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank2) && !emptying2)
|
||||
else if ((selection == Selection.DrainTank2) && !draining2)
|
||||
{
|
||||
emptying2 = true;
|
||||
draining2 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En) |
|
||||
(emptying3 ? 0 : ButtonsEtc.EmptyTankBtn3En));
|
||||
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
|
||||
(draining3 ? 0 : ButtonsEtc.DrainTankBtn3En));
|
||||
State.Create("MainSeq : Open tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve2, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DrainValve2, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank3) && !emptying3)
|
||||
else if ((selection == Selection.DrainTank3) && !draining3)
|
||||
{
|
||||
emptying3 = true;
|
||||
draining3 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En) |
|
||||
(emptying2 ? 0 : ButtonsEtc.EmptyTankBtn2En));
|
||||
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
|
||||
(draining2 ? 0 : ButtonsEtc.DrainTankBtn2En));
|
||||
State.Create("MainSeq : Open tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve3, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DrainValve3, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
@@ -1229,29 +1229,29 @@ namespace TBF.BenchControl.Sequences
|
||||
else if (selection == Selection.CloseTank1)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve1))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve1))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = false;
|
||||
draining1 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank2)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve2))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve2))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying2 = false;
|
||||
draining2 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank3)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve3))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve3))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying3 = false;
|
||||
draining3 = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,39 +171,39 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
|
||||
|
||||
protected Event EmptyTheTank(IValve emptyTankValve, IBalance balance)
|
||||
protected Event DrainTheTank(IValve drainValve, IScale scale)
|
||||
{
|
||||
return EmptyTheTank(emptyTankValve, balance, new List<IOperation>());
|
||||
return DrainTheTank(drainValve, scale, new List<IOperation>());
|
||||
}
|
||||
|
||||
protected Event EmptyTheTank(IValve emptyTankValve, IBalance balance, IOperation extraOperation)
|
||||
protected Event DrainTheTank(IValve drainValve, IScale scale, IOperation extraOperation)
|
||||
{
|
||||
IList<IOperation> extraOperations = new List<IOperation>();
|
||||
extraOperations.Add(extraOperation);
|
||||
return EmptyTheTank(emptyTankValve, balance, extraOperations);
|
||||
return DrainTheTank(drainValve, scale, extraOperations);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Empties the tank: opens the emptying valve and measures the weight.
|
||||
/// </summary>
|
||||
/// <param name="emptyTankValve">Valve to empty the tank</param>
|
||||
/// <param name="balance">Balance underneath the tank</param>
|
||||
/// <param name="drainValve">Valve to empty the tank</param>
|
||||
/// <param name="scale">Balance underneath the tank</param>
|
||||
/// <returns>Event.Done or Event.Error</returns>
|
||||
protected Event EmptyTheTank(IValve emptyTankValve, IBalance balance, IList<IOperation> extraOperations)
|
||||
protected Event DrainTheTank(IValve drainValve, IScale scale, IList<IOperation> extraOperations)
|
||||
{
|
||||
bool stopped = false;
|
||||
|
||||
//------------------------------------------------
|
||||
//------------------------------------------------------------
|
||||
Bridge.OnActivity(this, TBF.Resources.Strings.Emptying_tank);
|
||||
//------------------------------------------------
|
||||
//------------------------------------------------------------
|
||||
|
||||
IList<Event> e;
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
|
||||
|
||||
State.Create("SequenceBase : Opening the emptying valve")
|
||||
State.Create("SequenceBase : Drain valve opened")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(emptyTankValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(drainValve, null))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -214,9 +214,9 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
do
|
||||
{
|
||||
State.Create("SequenceBase : Emptying the tank")
|
||||
State.Create("SequenceBase : Draining the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
@@ -236,16 +236,16 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
if (stopped) break;
|
||||
}
|
||||
while (!balance.IsEmpty(Mass.Val));
|
||||
while (!scale.IsEmpty(Mass.Val));
|
||||
|
||||
//
|
||||
// Quit emptying
|
||||
//
|
||||
State.Create("SequenceBase : Closing the emptying valve")
|
||||
State.Create("SequenceBase : Drain valve closed")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, emptyTankValve))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, drainValve))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -259,7 +259,7 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
State.Create("SequenceBase : Updating the weight")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(new Operations.TimerOp(5))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperations(extraOperations)
|
||||
@@ -720,7 +720,7 @@ namespace TBF.BenchControl.Sequences
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefHi2))
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1))
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation(realTest ? outPath.Balance.ReadMassOp(ref Mass) : null)
|
||||
.AddOperation(realTest ? outPath.Scale.ReadMassOp(ref Mass) : null)
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi)
|
||||
@@ -774,7 +774,7 @@ namespace TBF.BenchControl.Sequences
|
||||
sb.Append(";"); sb.Append("0");
|
||||
sb.Append(";"); sb.Append(outPath.FlowMeter.Idx1);
|
||||
sb.Append(";"); sb.Append(" ");
|
||||
sb.Append(";"); if (outPath.Balance != null) sb.Append(outPath.Balance.Name);
|
||||
sb.Append(";"); if (outPath.Scale != null) sb.Append(outPath.Scale.Name);
|
||||
sb.Append(";"); sb.Append(tstRslt.AmbTempMean);
|
||||
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.mbar, tstRslt.AmbPressMean).ToString("F0")); /// [mbar]
|
||||
sb.Append(";"); sb.Append(tstRslt.AmbHumiMean); /// [%]
|
||||
@@ -1084,7 +1084,7 @@ namespace TBF.BenchControl.Sequences
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
}
|
||||
@@ -1208,7 +1208,7 @@ namespace TBF.BenchControl.Sequences
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
}
|
||||
@@ -1335,7 +1335,7 @@ namespace TBF.BenchControl.Sequences
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace TBF.BenchControl
|
||||
public class State
|
||||
{
|
||||
/// <summary>
|
||||
/// DEBUG: all state changes and all operations
|
||||
/// INFO: all state changes and operations that returned evnt != Event.None
|
||||
/// WARN: only state changes
|
||||
/// DEBUG: operation.Start(), operation.Stop()
|
||||
/// INFO: operation.Run() when returned event != Event.None
|
||||
/// WARN: EnterState() only state changes
|
||||
/// </summary>
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(State));
|
||||
public override string ToString() { return Name + (Label==null ? "" : ", label=" + Label); }
|
||||
@@ -193,9 +193,13 @@ namespace TBF.BenchControl
|
||||
Event evnt = operation.Run();
|
||||
if (evnt != Event.None)
|
||||
{
|
||||
log.DebugFormat("Operation {0} returned {1}", operation, evnt);
|
||||
log.InfoFormat("Operation {0}.Run() returned {1}", operation, evnt);
|
||||
events.Add(evnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
log.DebugFormat("Operation {0}.Run() returned {1}", operation, evnt);
|
||||
}
|
||||
}
|
||||
|
||||
LastEvents = events;
|
||||
@@ -209,7 +213,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
foreach (IOperation operation in currentState.Operations)
|
||||
{
|
||||
log.InfoFormat("stopping {0}", operation);
|
||||
log.DebugFormat("stopping {0}", operation);
|
||||
operation.Stop();
|
||||
}
|
||||
}
|
||||
@@ -226,7 +230,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
if (!newState.Operations.Contains(operation))
|
||||
{
|
||||
log.InfoFormat("stopping {0}", operation);
|
||||
log.DebugFormat("stopping {0}", operation);
|
||||
operation.Stop();
|
||||
}
|
||||
}
|
||||
@@ -238,7 +242,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
if (!previousState.Operations.Contains(operation))
|
||||
{
|
||||
log.InfoFormat("starting {0}", operation);
|
||||
log.DebugFormat("starting {0}", operation);
|
||||
operation.Start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ namespace TBF.BenchControl
|
||||
/// Public components
|
||||
public static Elde.ControlBoardDev ControlBoard;
|
||||
public static GenericDevices.IAmbient Ambient;
|
||||
public static GenericDevices.IBalance Balance1;
|
||||
public static GenericDevices.IBalance Balance2;
|
||||
public static GenericDevices.IBalance Balance3;
|
||||
public static GenericDevices.IValve EmptyTankValve1;
|
||||
public static GenericDevices.IValve EmptyTankValve2;
|
||||
public static GenericDevices.IValve EmptyTankValve3;
|
||||
public static GenericDevices.IScale Scale1;
|
||||
public static GenericDevices.IScale Scale2;
|
||||
public static GenericDevices.IScale Scale3;
|
||||
public static GenericDevices.IValve DrainValve1;
|
||||
public static GenericDevices.IValve DrainValve2;
|
||||
public static GenericDevices.IValve DrainValve3;
|
||||
public static IList<IValve> MasterValves; /// list of directly controlled valves
|
||||
public static IList<IValve> CoupledValves; /// list of coupled valves
|
||||
public static IList<Elde.ValveEx.Valve> ExtendedValves; /// list of extended valves
|
||||
@@ -85,8 +85,8 @@ namespace TBF.BenchControl
|
||||
{
|
||||
return GenericDevices.ValveBase.Merge(
|
||||
Utils.ValvesOpen((feedingPaths != null && feedingPaths.Count > 0) ? feedingPaths[0] : null),
|
||||
Utils.ValvesOpen((benchPaths != null && benchPaths.Count > 0) ? benchPaths[0] : null),
|
||||
Utils.ValvesOpen((outputPaths != null && outputPaths.Count > 0) ? outputPaths[0] : null)
|
||||
Utils.ValvesOpen((benchPaths != null && benchPaths.Count > 0) ? benchPaths[0] : null),
|
||||
Utils.ValvesOpen((outputPaths != null && outputPaths.Count > 0) ? outputPaths[0] : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -97,8 +97,8 @@ namespace TBF.BenchControl
|
||||
{
|
||||
return GenericDevices.ValveBase.Merge(
|
||||
Utils.ValvesClose((feedingPaths != null && feedingPaths.Count > 0) ? feedingPaths[0] : null),
|
||||
Utils.ValvesClose((benchPaths != null && benchPaths.Count > 0) ? benchPaths[0] : null),
|
||||
Utils.ValvesClose((outputPaths != null && outputPaths.Count > 0) ? outputPaths[0] : null)
|
||||
Utils.ValvesClose((benchPaths != null && benchPaths.Count > 0) ? benchPaths[0] : null),
|
||||
Utils.ValvesClose((outputPaths != null && outputPaths.Count > 0) ? outputPaths[0] : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ namespace TBF.BenchControl
|
||||
|
||||
/// Find all balances (to initialize tank capacities in the control board)
|
||||
/// Find the control board
|
||||
IList<IBalance> balances = new List<IBalance>();
|
||||
IList<IScale> balances = new List<IScale>();
|
||||
SequenceBase.FlowMeters = new List<IFlowMeter>();
|
||||
SequenceBase.RegulValves = new List<IRegulValve>();
|
||||
SequenceBase.PumpsWithFM = new List<IPumpFM>();
|
||||
@@ -230,14 +230,14 @@ namespace TBF.BenchControl
|
||||
if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter);
|
||||
if (cmpnt is ICamera) SequenceBase.Cameras.Add(cmpnt as ICamera);
|
||||
if (cmpnt is GenericDevices.IAmbient) Ambient = cmpnt as GenericDevices.IAmbient;
|
||||
if (cmpnt is IBalance)
|
||||
if (cmpnt is IScale)
|
||||
{
|
||||
IBalance balance = cmpnt as IBalance;
|
||||
balances.Add(balance);
|
||||
IScale scale = cmpnt as IScale;
|
||||
balances.Add(scale);
|
||||
|
||||
if (balance.BalanceNr == 0) Balance1 = balance;
|
||||
else if (balance.BalanceNr == 1) Balance2 = balance;
|
||||
else if (balance.BalanceNr == 2) Balance3 = balance;
|
||||
if (scale.ScaleNr == 0) Scale1 = scale;
|
||||
else if (scale.ScaleNr == 1) Scale2 = scale;
|
||||
else if (scale.ScaleNr == 2) Scale3 = scale;
|
||||
}
|
||||
|
||||
Elde.Valve.Valve eldeValve = (cmpnt as Elde.Valve.Valve);
|
||||
@@ -291,7 +291,10 @@ namespace TBF.BenchControl
|
||||
|
||||
CurrentlyInitializedDeviceName = "---";
|
||||
|
||||
/// Propagate debug levels from parents to children when necessary
|
||||
///
|
||||
/// (1) Propagate debug levels from parents to children when necessary
|
||||
/// (2) Set drain valves DrainValve1, DrainValve2 and DrainValve3
|
||||
///
|
||||
foreach (var cmpnt in components)
|
||||
{
|
||||
if (cmpnt.Cfg is IChildComponentCfg && !string.IsNullOrEmpty(cmpnt.Cfg.ParentName) &&
|
||||
@@ -302,6 +305,30 @@ namespace TBF.BenchControl
|
||||
if (par.Cfg.Name.Equals(cmpnt.Cfg.ParentName)) { cmpnt.Cfg.DebugLevel = par.Cfg.DebugLevel; break; }
|
||||
}
|
||||
}
|
||||
|
||||
if (cmpnt is IScale)
|
||||
{
|
||||
IScale balance = cmpnt as IScale;
|
||||
|
||||
if (balance.ScaleNr == 0)
|
||||
{
|
||||
DrainValve1 = balance.DrainValve;
|
||||
log.WarnFormat("InitializeBoardEtc() ... Scale1={0} Draining valve1={1}",
|
||||
balance.Name, (DrainValve1 != null) ? DrainValve1.Name : "---");
|
||||
}
|
||||
else if (balance.ScaleNr == 1)
|
||||
{
|
||||
DrainValve2 = balance.DrainValve;
|
||||
log.WarnFormat("InitializeBoardEtc() ... Scale2={0} Draining valve2={1}",
|
||||
balance.Name, (DrainValve2 != null) ? DrainValve2.Name : "---");
|
||||
}
|
||||
else if (balance.ScaleNr == 2)
|
||||
{
|
||||
DrainValve3 = balance.DrainValve;
|
||||
log.WarnFormat("InitializeBoardEtc() ... Scale3={0} Draining valve3={1}",
|
||||
balance.Name, (DrainValve3 != null) ? DrainValve3.Name : "---");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (anyComponentIsInSimulMode)
|
||||
@@ -348,23 +375,6 @@ namespace TBF.BenchControl
|
||||
#if HEAT_METERS
|
||||
heatMetersPaths = session.QueryOver<Config.Entities.HeatMetersPath>().OrderBy(x => x.ItemNr).Asc.List();
|
||||
#endif
|
||||
|
||||
// Automatic detection of empty tank valves
|
||||
foreach (var opath in outputPaths)
|
||||
{
|
||||
if ((EmptyTankValve1 == null) && (Balance1 != null) && (opath.Balance == Balance1.Cfg.Name))
|
||||
{
|
||||
EmptyTankValve1 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve;
|
||||
}
|
||||
if ((EmptyTankValve2 == null) && (Balance2 != null) && (opath.Balance == Balance2.Cfg.Name))
|
||||
{
|
||||
EmptyTankValve2 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve;
|
||||
}
|
||||
if ((EmptyTankValve3 == null) && (Balance3 != null) && (opath.Balance == Balance3.Cfg.Name))
|
||||
{
|
||||
EmptyTankValve3 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve;
|
||||
}
|
||||
}
|
||||
|
||||
if (loadPathsOnly) return;
|
||||
|
||||
@@ -495,7 +505,7 @@ namespace TBF.BenchControl
|
||||
if (tr.Name == test.TransitionAfter) transitionAfter = tr;
|
||||
}
|
||||
|
||||
if (pout.Balance == null)
|
||||
if (pout.Scale == null)
|
||||
{
|
||||
errorMsg = string.Format("No balance specified in path {0}", test.OutputPath);
|
||||
return false;
|
||||
@@ -608,11 +618,6 @@ namespace TBF.BenchControl
|
||||
}
|
||||
catch (QuitStateMachineException)
|
||||
{
|
||||
State.StopOperations();
|
||||
foreach (var device in devices) device.StopDevice();
|
||||
|
||||
quitStateMachine = false;
|
||||
stateMachineRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,15 +625,31 @@ namespace TBF.BenchControl
|
||||
/// <summary>
|
||||
/// Do stuff that is repeated in the state execution loops most often
|
||||
/// </summary>
|
||||
/// <returns>List of Event-s returned from the state operations</returns>
|
||||
/// <returns>List of Event-s returned from the state operations, null == quit</returns>
|
||||
public static IList<Event> WaitRunDevsRunOps()
|
||||
{
|
||||
foreach (var device in devices) device.RunDeviceAfter();
|
||||
WaitNextTick();
|
||||
|
||||
if (WaitNextTick())
|
||||
{
|
||||
///
|
||||
/// Executed when the state machine is stopped
|
||||
///
|
||||
foreach (var device in devices) device.RunDeviceBefore();
|
||||
State.StopOperations();
|
||||
foreach (var device in devices) device.StopDevice();
|
||||
stateMachineRunning = false;
|
||||
|
||||
throw new QuitStateMachineException();
|
||||
}
|
||||
|
||||
foreach (var device in devices) device.RunDeviceBefore();
|
||||
|
||||
IList<Event> events = State.RunOperations();
|
||||
return events;
|
||||
///
|
||||
/// This is followed by a state change in the sequence
|
||||
///
|
||||
}
|
||||
|
||||
|
||||
@@ -636,7 +657,7 @@ namespace TBF.BenchControl
|
||||
/// Wait time period - synchronize
|
||||
/// </summary>
|
||||
/// <returns>true when interrupted by 'quitStateMachine', otherwise false</returns>
|
||||
public static void WaitNextTick()
|
||||
public static bool WaitNextTick()
|
||||
{
|
||||
currentTimeSec += Period;
|
||||
|
||||
@@ -644,16 +665,17 @@ namespace TBF.BenchControl
|
||||
DateTime nextLoopDateTime = startDateTime + timeFromStart;
|
||||
while (DateTime.Now < nextLoopDateTime)
|
||||
{
|
||||
if (quitStateMachine)
|
||||
Thread.Sleep(100);
|
||||
|
||||
if (quitStateMachine)
|
||||
{
|
||||
quitStateMachine = false;
|
||||
wlog.Info("quitStateMachine == true ... going to stop the StateMachine()");
|
||||
throw new QuitStateMachineException();
|
||||
return true;
|
||||
}
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
wlog.DebugFormat(" currentTime = {0}s", currentTimeSec);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ namespace TBF.BenchControl
|
||||
Factories.Add(new Modbus.TankSelector.Factory()); /// Modbus.TankSelector
|
||||
Factories.Add(new Network.Adapter.Factory());
|
||||
Factories.Add(new Network.Camera.CLP1611.Factory());
|
||||
Factories.Add(new Network.Camera.Display.Factory());
|
||||
Factories.Add(new Network.Camera.Roi.Factory());
|
||||
Factories.Add(new Output.FileWriters.Basic.FactorySingle());
|
||||
Factories.Add(new Output.FileWriters.Basic.FactoryCompound());
|
||||
|
||||
@@ -180,7 +180,11 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -189,7 +193,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
roi.Camera.ClearRoiParams();
|
||||
cameras.Add(roi.Camera);
|
||||
}
|
||||
}
|
||||
@@ -383,7 +387,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
+15
-11
@@ -141,12 +141,12 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
Qrise = 0;
|
||||
Qfall = 0;
|
||||
|
||||
if (!test.Emptying) /// Do not skip emptying if test.Emptying==true
|
||||
if (!test.Draining) /// Do not skip emptying if test.Emptying==true
|
||||
{
|
||||
//--------------------------------
|
||||
State.Create("CombinedWithDetection : Get the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -157,14 +157,14 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
double estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
if (estimatedEndMass < outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto switching_flow_detection; /// Enough room in the tank -> skip emptying
|
||||
}
|
||||
}
|
||||
|
||||
// Empty the water tank
|
||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
|
||||
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale))
|
||||
{
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTest;
|
||||
@@ -185,7 +185,11 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -194,7 +198,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
roi.Camera.ClearRoiParams();
|
||||
cameras.Add(roi.Camera);
|
||||
}
|
||||
}
|
||||
@@ -463,7 +467,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create(Strings.Measure_the_mass)
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -548,7 +552,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
//------------------------------------------------
|
||||
State.Create(Strings.Measure_the_mass)
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -656,9 +660,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||
tstRslt.MassStartRaw = StartMass.Val;
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
|
||||
tstRslt.MassEndRaw = EndMass.Val;
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
|
||||
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
|
||||
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
@@ -729,7 +733,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
@@ -158,7 +158,11 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -167,7 +171,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
roi.Camera.ClearRoiParams();
|
||||
cameras.Add(roi.Camera);
|
||||
}
|
||||
}
|
||||
@@ -424,7 +428,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
+234
-229
@@ -30,33 +30,33 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
{
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
|
||||
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
||||
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
||||
|
||||
/// Notes:
|
||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
||||
/// float timeSec = 3600.0f * timeHr;
|
||||
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
|
||||
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
|
||||
/// Notes:
|
||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
||||
/// float timeSec = 3600.0f * timeHr;
|
||||
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
|
||||
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
|
||||
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr=1
|
||||
int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr=1
|
||||
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
//====================================
|
||||
loop:
|
||||
loop:
|
||||
/// Start the test, initialize test results
|
||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
@@ -65,12 +65,49 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
if (!test.Draining)
|
||||
{
|
||||
///
|
||||
/// Measure the weight in case there is no unconditional draining
|
||||
///
|
||||
State.Create("FixedStartAdvanced : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
}
|
||||
///
|
||||
/// Skip draining in case there is enough room in the tank
|
||||
///
|
||||
if (test.Draining || (Mass.Val + test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor))
|
||||
{
|
||||
///
|
||||
/// Drain the water tank
|
||||
///
|
||||
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||
//------------------------------------------------
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
|
||||
State.Create("FixedStartAdvanced : Waiting 5 sec")
|
||||
@@ -83,7 +120,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.TimerExpired));
|
||||
|
||||
@@ -98,68 +135,32 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
|
||||
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
||||
{
|
||||
///
|
||||
/// Measure the weight and skip emptying if there is enough room in the tank
|
||||
///
|
||||
State.Create("FixedStartAdvanced : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
set_flow:
|
||||
|
||||
double estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Empty the water tank
|
||||
///
|
||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
set_flow:
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||
//------------------------------------------------
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||
//------------------------------------------------
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
State.Create("FixedStartAdvanced : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
//--------------------------------
|
||||
//--------------------------------
|
||||
State.Create("FixedStartAdvanced : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
@@ -170,8 +171,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.RegulValveTimeOut))
|
||||
{
|
||||
Bridge.OnError(this, Strings.Timeout);
|
||||
@@ -182,27 +183,27 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
}
|
||||
while (!e.Contains(Event.FlowReached));
|
||||
|
||||
flow_set:
|
||||
flow_set:
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartAdvanced : Closing the start/stop valve before the fixed start test")
|
||||
.AddOperation(checkUiOp)
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartAdvanced : Closing the start/stop valve before the fixed start test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, outPath.StartValve))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
|
||||
int time = StateMachine.Time;
|
||||
double currentFlow = RefFlow.Val;
|
||||
int time = StateMachine.Time;
|
||||
double currentFlow = RefFlow.Val;
|
||||
|
||||
|
||||
///
|
||||
@@ -213,7 +214,11 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -222,7 +227,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
roi.Camera.ClearRoiParams();
|
||||
cameras.Add(roi.Camera);
|
||||
}
|
||||
}
|
||||
@@ -236,120 +241,120 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
|
||||
|
||||
|
||||
///
|
||||
/// Enter watermeter begin states here
|
||||
///
|
||||
///
|
||||
/// Enter watermeter begin states here
|
||||
///
|
||||
GenericDevices.IHasWMStatesForm dataEntryCmpnt =
|
||||
TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm;
|
||||
if (dataEntryCmpnt != null)
|
||||
{
|
||||
if (dataEntryCmpnt != null)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Enter_water_meter_data);
|
||||
State.Create("FixedStartAdvanced : Enter begin-state")
|
||||
.AddOperation((dataEntryCmpnt as GenericDevices.IHasWMStatesForm).ShowTestStartFormOp())
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ModelessFormClosed));
|
||||
State.Create("FixedStartAdvanced : Enter begin-state")
|
||||
.AddOperation((dataEntryCmpnt as GenericDevices.IHasWMStatesForm).ShowTestStartFormOp())
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ModelessFormClosed));
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||
|
||||
if (registerReader != null) registerReader.BeginWMState = dataEntryCmpnt.WMStartState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartAdvanced : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
|
||||
.AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressMtrUp.ReadPressureOp(ref PressUp))
|
||||
.AddOperation(benchPath.PressMtrDown.ReadPressureOp(ref PressDown))
|
||||
.AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressMtrUp.ReadPressureOp(ref PressUp))
|
||||
.AddOperation(benchPath.PressMtrDown.ReadPressureOp(ref PressDown))
|
||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
TestStartTime = DateTime.Now;
|
||||
Mass.Val = StartMass.Val;
|
||||
TestStartTime = DateTime.Now;
|
||||
Mass.Val = StartMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
//------------------------------------------------
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartAdvanced : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
test.Qfrom, test.Qto, 2 * totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.MeasurementStarted));
|
||||
|
||||
|
||||
State.Create("FixedStartAdvanced : Opening the start/stop valve at the beginning of the fixed start test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(outPath.StartValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
State.Create("FixedStartAdvanced : Opening the start/stop valve at the beginning of the fixed start test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(outPath.StartValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
|
||||
/// Measurement loop - preparation
|
||||
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
|
||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
|
||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||
|
||||
ClearAllStatistics();
|
||||
ClearAllStatistics();
|
||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||
|
||||
/// Measurement loop - begin
|
||||
do
|
||||
{
|
||||
//--------------------------------
|
||||
switch (ReadRegistersTempPressAmbient(measureOperations, true))
|
||||
{
|
||||
case Event.Error:
|
||||
retVal = Event.Error;
|
||||
goto stopTest;
|
||||
/// Measurement loop - begin
|
||||
do
|
||||
{
|
||||
//--------------------------------
|
||||
switch (ReadRegistersTempPressAmbient(measureOperations, true))
|
||||
{
|
||||
case Event.Error:
|
||||
retVal = Event.Error;
|
||||
goto stopTest;
|
||||
|
||||
case Event.UiCmdStop:
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTest;
|
||||
case Event.UiCmdStop:
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTest;
|
||||
|
||||
case Event.MeasurementCompleted:
|
||||
goto test_completed;
|
||||
}
|
||||
case Event.MeasurementCompleted:
|
||||
goto test_completed;
|
||||
}
|
||||
|
||||
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
|
||||
if (remainingTime > 60)
|
||||
@@ -362,28 +367,28 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
}
|
||||
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
UpdateAllStatistics();
|
||||
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||
}
|
||||
while (cBrd.EtPulses(0) < totalPulses);
|
||||
/// Measurement loop - end
|
||||
while (cBrd.EtPulses(0) < totalPulses);
|
||||
/// Measurement loop - end
|
||||
|
||||
test_completed:
|
||||
test_completed:
|
||||
|
||||
State.Create("FixedStartAdvanced : Closing the start/stop valve at the end of the fixed start test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, outPath.StartValve))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
}
|
||||
while (e.Contains(Event.ValvesBusy));
|
||||
State.Create("FixedStartAdvanced : Closing the start/stop valve at the end of the fixed start test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, outPath.StartValve))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
}
|
||||
while (e.Contains(Event.ValvesBusy));
|
||||
|
||||
|
||||
State.Create("FixedStartAdvanced : Waiting before 2nd mass measurement")
|
||||
@@ -396,7 +401,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@@ -405,7 +410,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.TimerExpired));
|
||||
|
||||
@@ -423,7 +428,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -431,7 +436,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
///
|
||||
@@ -439,56 +444,56 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
|
||||
|
||||
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
|
||||
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Balance.Corrections);
|
||||
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Balance.Corrections);
|
||||
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Scale.Corrections);
|
||||
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Scale.Corrections);
|
||||
double densityOut = Formulas.WaterDensityFromTemp(TempDownStat.Average);
|
||||
double volumeCTV = 1.00103f * 1000.0f * (massEnd - massStart) / densityOut;
|
||||
|
||||
///
|
||||
/// Enter watermeter end states here
|
||||
///
|
||||
if (dataEntryCmpnt != null)
|
||||
{
|
||||
///
|
||||
/// Enter watermeter end states here
|
||||
///
|
||||
if (dataEntryCmpnt != null)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Enter_water_meter_data);
|
||||
State.Create("FixedStartAdvanced : Enter end-state")
|
||||
State.Create("FixedStartAdvanced : Enter end-state")
|
||||
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(volumeCTV, test.ErrLimLo + test.Uncertainty,
|
||||
test.ErrLimHi - test.Uncertainty))
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ModelessFormClosed));
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ModelessFormClosed));
|
||||
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||
|
||||
if (registerReader != null) registerReader.EndWMState = dataEntryCmpnt.WMEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_completed);
|
||||
//------------------------------------------------
|
||||
|
||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||
|
||||
///
|
||||
@@ -544,48 +549,48 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
tstRslt.TempDivEnd = (float)TempDivStat.Last;
|
||||
tstRslt.TempDivMin = (float)TempDivStat.Min;
|
||||
tstRslt.TempDivMax = (float)TempDivStat.Max;
|
||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
|
||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
|
||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
|
||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
|
||||
|
||||
/// Main results
|
||||
tstRslt.StartTime = TestStartTime;
|
||||
tstRslt.EndTime = TestEndTime;
|
||||
tstRslt.FlowSetTime = flowSetTime;
|
||||
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.StartTime = TestStartTime;
|
||||
tstRslt.EndTime = TestEndTime;
|
||||
tstRslt.FlowSetTime = flowSetTime;
|
||||
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||
tstRslt.MassStartRaw = StartMass.Val;
|
||||
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
|
||||
tstRslt.MassEndRaw = EndMass.Val;
|
||||
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
|
||||
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
|
||||
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
|
||||
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
|
||||
tstRslt.MassEndRaw = EndMass.Val;
|
||||
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
|
||||
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
|
||||
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
|
||||
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||
|
||||
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
|
||||
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
{
|
||||
meterRslt.PulsesPerLiter = 1.0f;
|
||||
meterRslt.VolumeStart = regReader.BeginWMState;
|
||||
meterRslt.VolumeEnd = regReader.EndWMState;
|
||||
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV; /// liter
|
||||
meterRslt.PulsesMeter = meterRslt.VolumeMeter;
|
||||
meterRslt.VolumeStart = regReader.BeginWMState;
|
||||
meterRslt.VolumeEnd = regReader.EndWMState;
|
||||
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV; /// liter
|
||||
meterRslt.PulsesMeter = meterRslt.VolumeMeter;
|
||||
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
meterRslt.TestDone = true;
|
||||
@@ -598,7 +603,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
@@ -631,7 +636,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
@@ -639,7 +644,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
||||
switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
|
||||
|
||||
+89
-73
@@ -49,6 +49,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
|
||||
int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr=1
|
||||
|
||||
|
||||
if (test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTestWOTransitionAfter;
|
||||
}
|
||||
|
||||
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
@@ -68,45 +77,84 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
|
||||
|
||||
if (test.Volume >= outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
retVal = Event.Error;
|
||||
goto stopTest;
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Optionally display prompt to emerge temperature meters to appropriate baths for heat meters test
|
||||
///
|
||||
IOperation heatMetersPromptOp = null;
|
||||
if (heatMetersTestParams != null && !string.IsNullOrEmpty(heatMetersTestParams.Prompt))
|
||||
{
|
||||
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||
/// Make sure the CycleBeginForm is closed
|
||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||
|
||||
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!test.Draining)
|
||||
{
|
||||
///
|
||||
/// Measure the weight in case there is no unconditional draining
|
||||
///
|
||||
State.Create("FixedStartMassCollection : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
}
|
||||
///
|
||||
/// Skip draining in case there is enough room in the tank
|
||||
///
|
||||
if (test.Draining || (Mass.Val + test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor))
|
||||
{
|
||||
///
|
||||
/// Drain the water tank
|
||||
///
|
||||
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale, heatMetersPromptOp))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
}
|
||||
///
|
||||
/// Make sure the drain valve is closed
|
||||
///
|
||||
State.Create("FixedStartMassCollection : Make sure the drain valve is closed")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, outPath.Scale.DrainValve))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet) || !e.Contains(Event.BalanceDone));
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||
//------------------------------------------------
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
|
||||
State.Create("FixedStartMassCollection : Waiting before starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(new Operations.TimerOp(5))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.TimerExpired));
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
///
|
||||
State.Create("FixedStartMassCollection : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
@@ -128,44 +176,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||
|
||||
|
||||
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
||||
{
|
||||
///
|
||||
/// Measure the weight and skip emptying if there is enough room in the tank
|
||||
///
|
||||
State.Create("FixedStartMassCollection : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
double estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Empty the water tank
|
||||
///
|
||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance, heatMetersPromptOp))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
set_flow:
|
||||
|
||||
if (debugLevel == Config.Entities.DebugMode.Simulate) goto flow_set;
|
||||
|
||||
@@ -308,7 +318,11 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -317,7 +331,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
roi.Camera.ClearRoiParams();
|
||||
cameras.Add(roi.Camera);
|
||||
}
|
||||
}
|
||||
@@ -402,7 +416,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -587,7 +601,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@@ -618,7 +632,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -645,8 +659,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
|
||||
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Balance.Corrections);
|
||||
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Balance.Corrections);
|
||||
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Scale.Corrections);
|
||||
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Scale.Corrections);
|
||||
double densityOut = Formulas.WaterDensityFromTemp(TempDownStat.Average); /// [kg/m3]
|
||||
double volumeCTV = 1001.03 * (massEnd - massStart) / densityOut;
|
||||
double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l]
|
||||
@@ -942,7 +956,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
@@ -982,10 +996,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
||||
switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
|
||||
stopTestWOTransitionAfter:
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
|
||||
|
||||
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
||||
|
||||
@@ -252,7 +252,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -261,7 +265,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
roi.Camera.ClearRoiParams();
|
||||
cameras.Add(roi.Camera);
|
||||
}
|
||||
}
|
||||
@@ -566,6 +570,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];
|
||||
WaterMeters.iPerl.WaterMeter iPerl = regReader as WaterMeters.iPerl.WaterMeter;
|
||||
GenericDevices.IRoi cameraRoi = regReader as GenericDevices.IRoi;
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
{
|
||||
@@ -585,12 +590,26 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
iPerl.VolumeLtrRef = meterRslt.VolumeRef;
|
||||
#if IPERL
|
||||
meterRslt.WaterMeter.CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
|
||||
meterRslt.WaterMeter.Q2Correction = iPerl.Q2CorrectionFactor;
|
||||
meterRslt.WaterMeter.Q2Correction = iPerl.Q2Correction;
|
||||
meterRslt.WaterMeter.Q2CorrRFlow = iPerl.Q2CorrRFlow;
|
||||
meterRslt.WaterMeter.Q2CorrLFlow = iPerl.Q2CorrLFlow;
|
||||
#endif
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlow = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
else if (cameraRoi != null)
|
||||
{
|
||||
meterRslt.TimestampStart = cameraRoi.TimestampStart; /// second
|
||||
meterRslt.TimestampEnd = cameraRoi.TimestampEnd; /// second
|
||||
meterRslt.TestTime = cameraRoi.TimestampEnd - cameraRoi.TimestampStart; /// second
|
||||
|
||||
meterRslt.VolumeStart = cameraRoi.VolumeStart; /// liter
|
||||
meterRslt.VolumeEnd = cameraRoi.VolumeEnd; /// liter
|
||||
meterRslt.VolumeMeter = cameraRoi.VolumeEnd - cameraRoi.VolumeStart; /// liter
|
||||
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
|
||||
@@ -614,7 +633,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
+76
-37
@@ -101,6 +101,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
|
||||
int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr = 1
|
||||
|
||||
|
||||
if (test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTestWOTransitionAfter;
|
||||
}
|
||||
|
||||
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
@@ -118,29 +127,21 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
TestStartTime = DateTime.Now;
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Checking_tank_capacity);
|
||||
//------------------------------------------------
|
||||
if (test.Volume >= outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
retVal = Event.Error;
|
||||
goto stopTest;
|
||||
}
|
||||
bool drainTheTank = test.Draining;
|
||||
|
||||
bool emptyTheTank = test.Emptying;
|
||||
|
||||
if (!emptyTheTank) /// If condition met => skip measuring and force emptying
|
||||
if (!drainTheTank) /// If condition met => skip measuring and force emptying
|
||||
{
|
||||
///
|
||||
/// Measure the weight and skip emptying if there is enough room in the tank
|
||||
///
|
||||
State.Create("FlyingStartMassCollection : Checking available tank capacity")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -151,27 +152,38 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
double estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass >= outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
if (estimatedEndMass >= outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
emptyTheTank = true;
|
||||
drainTheTank = true;
|
||||
}
|
||||
}
|
||||
///
|
||||
if (emptyTheTank)
|
||||
if (drainTheTank)
|
||||
{
|
||||
#if BERLIN
|
||||
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
drainTheTank = false;
|
||||
#else
|
||||
State.Create("FlyingStartMassCollection : Opening the emptying valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(outPath.EmptyTankValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(outPath.Scale.DrainValve, null))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Optionally display prompt to emerge temperature meters to appropriate baths for heat meters test
|
||||
///
|
||||
@@ -184,10 +196,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||
//------------------------------------------------
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
///
|
||||
State.Create("FlyingStartMassCollection : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
@@ -356,11 +373,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
/// Prepare cameras, ROI-s and measurementOperations
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
/// Find successfully detected ROI-s
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) rois.Add(rr as GenericDevices.IRoi);
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
@@ -369,8 +390,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
{
|
||||
if (roi.Camera != null && !cameras.Contains(roi.Camera))
|
||||
{
|
||||
roi.Camera.ClearRois();
|
||||
cameras.Add(roi.Camera);
|
||||
roi.Camera.ClearRoiParams();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,8 +403,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
foreach (var camera in cameras) measureOperations.Add(camera.MeasurementOp());
|
||||
|
||||
|
||||
|
||||
if (emptyTheTank)
|
||||
if (drainTheTank)
|
||||
{
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Closing_the_tank);
|
||||
@@ -400,15 +420,16 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
extraOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
|
||||
extraOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
|
||||
}
|
||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance, extraOps))
|
||||
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale, extraOps))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
emptyTheTank = false;
|
||||
drainTheTank = false;
|
||||
}
|
||||
|
||||
|
||||
if (test.TimeFlow2Mass > 0)
|
||||
{
|
||||
State.Create("FlyingStartMassCollection : Waiting before 1st mass measurement")
|
||||
@@ -454,7 +475,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -533,7 +554,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefHi2))
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1))
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi)
|
||||
@@ -587,7 +608,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||
}
|
||||
while (true);
|
||||
while (!e.Contains(Event.Next)); /// 'Next' button can be used in Debug version
|
||||
|
||||
/// Measurement loop - end
|
||||
|
||||
test_completed:
|
||||
@@ -623,7 +645,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@@ -634,7 +656,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.TimerExpired));
|
||||
while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone));
|
||||
|
||||
if (heatMetersPath == null)
|
||||
LogProcessHeader(processDataLogger, "End mass");
|
||||
@@ -655,7 +677,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -744,9 +766,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||
tstRslt.MassStartRaw = StartMass.Val;
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
|
||||
tstRslt.MassEndRaw = EndMass.Val;
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
|
||||
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
@@ -893,6 +915,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];
|
||||
WaterMeters.iPerl.WaterMeter iPerl = regReader as WaterMeters.iPerl.WaterMeter;
|
||||
GenericDevices.IRoi cameraRoi = regReader as GenericDevices.IRoi;
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
{
|
||||
@@ -912,15 +935,29 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
iPerl.VolumeLtrRef = meterRslt.VolumeRef;
|
||||
#if IPERL
|
||||
meterRslt.WaterMeter.CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
|
||||
meterRslt.WaterMeter.Q2Correction = iPerl.Q2CorrectionFactor;
|
||||
meterRslt.WaterMeter.Q2Correction = iPerl.Q2Correction;
|
||||
meterRslt.WaterMeter.Q2CorrRFlow = iPerl.Q2CorrRFlow;
|
||||
meterRslt.WaterMeter.Q2CorrLFlow = iPerl.Q2CorrLFlow;
|
||||
#endif
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlow = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
else if (cameraRoi != null)
|
||||
{
|
||||
meterRslt.TimestampStart = cameraRoi.TimestampStart; /// second
|
||||
meterRslt.TimestampEnd = cameraRoi.TimestampEnd; /// second
|
||||
meterRslt.TestTime = cameraRoi.TimestampEnd - cameraRoi.TimestampStart; /// second
|
||||
|
||||
meterRslt.VolumeStart = cameraRoi.VolumeStart; /// liter
|
||||
meterRslt.VolumeEnd = cameraRoi.VolumeEnd; /// liter
|
||||
meterRslt.VolumeMeter = cameraRoi.VolumeEnd - cameraRoi.VolumeStart; /// liter
|
||||
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
|
||||
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
|
||||
meterRslt.VolumeStart = 0; /// liter
|
||||
meterRslt.VolumeEnd = 0; /// liter
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
@@ -940,7 +977,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
@@ -983,6 +1020,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
|
||||
stopTestWOTransitionAfter:
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
|
||||
|
||||
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
||||
|
||||
@@ -401,7 +401,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
+10
-10
@@ -103,14 +103,14 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
|
||||
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
||||
if (!test.Draining) /// If condition met => skip measuring and force emptying
|
||||
{
|
||||
///
|
||||
/// Measure the weight and skip emptying if there is enough room in the tank
|
||||
///
|
||||
State.Create("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -124,7 +124,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
double estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
if (estimatedEndMass < outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
///
|
||||
/// Empty the water tank
|
||||
///
|
||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
|
||||
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@@ -182,7 +182,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -251,7 +251,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@@ -277,7 +277,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.EnterState();
|
||||
@@ -362,9 +362,9 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||
tstRslt.MassStartRaw = StartMass.Val;
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
|
||||
tstRslt.MassEndRaw = EndMass.Val;
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
|
||||
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
@@ -388,7 +388,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
|
||||
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
|
||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
public bool Publish(Test test) { return false; }
|
||||
public bool CanTest(MetersKind meters) { return true; }
|
||||
|
||||
|
||||
public RoiDetection()
|
||||
{
|
||||
}
|
||||
@@ -28,9 +29,21 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
public IList<Event> Execute(Test test, bool outerLoopMode, int outerLoopCounter)
|
||||
{
|
||||
return (new RoiDetectionSeq()).Execute(test, outerLoopMode, outerLoopCounter);
|
||||
GenericDevices.ICameraDisplay display = null;
|
||||
|
||||
foreach (var cmpnt in StateMachine.Components)
|
||||
{
|
||||
if (cmpnt is GenericDevices.ICameraDisplay)
|
||||
{
|
||||
display = (cmpnt as GenericDevices.ICameraDisplay);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (new RoiDetectionSeq()).Execute(test, display, outerLoopMode, outerLoopCounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
using TBF.UiBridge;
|
||||
using System.IO;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
{
|
||||
@@ -16,7 +17,7 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RoiDetectionSeq));
|
||||
|
||||
|
||||
public IList<Event> Execute(Test test, bool outerLoopMode, int outerLoopCounter)
|
||||
public IList<Event> Execute(Test test, GenericDevices.ICameraDisplay display, bool outerLoopMode, int outerLoopCounter)
|
||||
{
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
|
||||
@@ -58,9 +59,9 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
//------------------------------------------------
|
||||
//-------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||
//------------------------------------------------
|
||||
//-------------------------------------------------
|
||||
///
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||
State.Create("RoiDetection : Starting the pump")
|
||||
@@ -107,23 +108,36 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
int time = StateMachine.Time;
|
||||
double currentFlow = RefFlow.Val;
|
||||
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
string[] imageNames = new string[sensPath.RegisterReaders.Length];
|
||||
|
||||
for (int i = 0; i < sensPath.RegisterReaders.Length; i++)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi) (rr as GenericDevices.IRoi).Detected = false;
|
||||
GenericDevices.IRoi roi = sensPath.RegisterReaders[i] as GenericDevices.IRoi;
|
||||
if (roi != null)
|
||||
{
|
||||
roi.ClearRoi();
|
||||
}
|
||||
else
|
||||
{
|
||||
imageNames[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
detection_loop:
|
||||
|
||||
//------------------------------------------------
|
||||
//---------------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.ROI_Detection_in_Progress);
|
||||
//------------------------------------------------
|
||||
//---------------------------------------------------------
|
||||
|
||||
State detection = State.Create("RoiDetection : Detection of ROI-s")
|
||||
.AddOperation(checkUiOp);
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
for (int i = 0; i < sensPath.RegisterReaders.Length; i++)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi && !(rr as GenericDevices.IRoi).Detected)
|
||||
GenericDevices.IRoi roi = sensPath.RegisterReaders[i] as GenericDevices.IRoi;
|
||||
if (roi != null && !roi.Detected)
|
||||
{
|
||||
detection.AddOperation((rr as GenericDevices.IRoi).RoiDetectionOp());
|
||||
detection.AddOperation(roi.RoiDetectionOp());
|
||||
imageNames[i] = roi.DetectedImageName;
|
||||
}
|
||||
}
|
||||
detection.EnterState();
|
||||
@@ -138,37 +152,59 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
retVal = Event.Error;
|
||||
goto stopTest;
|
||||
}
|
||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(test,e))
|
||||
{
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTest;
|
||||
}
|
||||
}
|
||||
while (e.Contains(Event.CameraBusy));
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
if (e.Contains(Event.RoiDetectionPreviousFailed)) Bridge.OnActivity(this, Strings.Camera_error);
|
||||
else if (e.Contains(Event.RoiDetectionFailed)) Bridge.OnActivity(this, Strings.Detection_failed);
|
||||
else Bridge.OnActivity(this, Strings.Detection_completed);
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
|
||||
if (e.Contains(Event.RoiDetectionPreviousFailed))
|
||||
{
|
||||
retVal = Event.Error;
|
||||
Bridge.OnActivity(this, Strings.Camera_error);
|
||||
}
|
||||
else if (e.Contains(Event.RoiDetectionFailed))
|
||||
{
|
||||
retVal = Event.Error;
|
||||
Bridge.OnActivity(this, Strings.Detection_failed);
|
||||
State.Create("RoiDetection : Do you want to retry RoI detection?")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(new Operations.AskYesNoOp(Strings.Do_you_want_to_retry_RoI_detection))
|
||||
.EnterState();
|
||||
do
|
||||
string title = Strings.Select_images_and_press_Retry_to_retry_RoI_detection;
|
||||
State.Create("RoiDetection : Select images and press Retry to retry RoI detection")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((display == null) ? null : display.ShowStaticImageOp(imageNames, title))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
if (TestAndLogUiCmdStop(test, e))
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
while (!e.Contains(Event.Yes)) goto detection_loop;
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTest;
|
||||
}
|
||||
while (!e.Contains(Event.No));
|
||||
}
|
||||
while (e.Contains(Event.ModelessFormIsOpen));
|
||||
|
||||
if (e.Contains(Event.Retry))
|
||||
{
|
||||
for (int i = 0; i < display.SelectedImages.Length; i++)
|
||||
{
|
||||
GenericDevices.IRoi roi = sensPath.RegisterReaders[i] as GenericDevices.IRoi;
|
||||
if (roi != null && display.SelectedImages[i])
|
||||
{
|
||||
roi.ClearRoi();
|
||||
}
|
||||
}
|
||||
|
||||
goto detection_loop;
|
||||
}
|
||||
else if (e.Contains(Event.Abort))
|
||||
{
|
||||
retVal = Event.UiCmdStop;
|
||||
goto stopTest;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
//---------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Detection_completed);
|
||||
//------------------------------------------------
|
||||
//---------------------------------------------------
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.TransitionAfter));
|
||||
|
||||
|
||||
+60
-96
@@ -675,8 +675,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
else if (activity.ToLower().Contains(WriteCalibrationFactorStr.ToLower())) error = WriteCalibrationFactor(wm, ref resultStr);
|
||||
else if (activity.ToLower().Equals(NormalizeCalibrationFactorStr.ToLower())) error = NormalizeCalibrationFactor(wm, ref resultStr);
|
||||
else if (activity.ToLower().Equals(ResetQ2CorrectionStr.ToLower())) error = ResetQ2Correction(wm, ref resultStr);
|
||||
else if (activity.ToLower().Equals(WriteQ2CorrectionStr.ToLower())) error = WriteQ2Correction(wm, ref resultStr);
|
||||
else if (activity.ToLower().Equals(WriteQ2CorrectionAltStr.ToLower())) error = WriteQ2CorrectionAlt(wm, ref resultStr);
|
||||
else if (activity.ToLower().Equals(WriteQ2CorrectionStr.ToLower())) error = WriteQ2Correction(wm, ref resultStr, false); /// standard iPerl
|
||||
else if (activity.ToLower().Equals(WriteQ2CorrectionAltStr.ToLower())) error = WriteQ2Correction(wm, ref resultStr, true); /// DEWA iPerl
|
||||
else if (activity.ToLower().Equals(Reset2HzCorrectionStr.ToLower())) error = Reset2HzCorrection(wm, ref resultStr);
|
||||
else if (activity.ToLower().Equals(Write2HzCorrectionStr.ToLower())) error = Write2HzCorrection(wm, ref resultStr);
|
||||
else
|
||||
@@ -1190,7 +1190,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
if (error == CommErr.None)
|
||||
{
|
||||
resultStr = "Q2 corrections reset to 0";
|
||||
wm.Q2CorrectionFactor = 0;
|
||||
wm.Q2CorrRFlow = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1270,28 +1270,70 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <param name="wm">Water meter object</param>
|
||||
/// <param name="resultStr">String passed to caller</param>
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr WriteQ2Correction(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
static CommErr WriteQ2Correction(WaterMeters.iPerl.WaterMeter wm, ref string resultStr, bool DEWA)
|
||||
{
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
if (wm.LastTestResult == null) return CommErr.CommFailed; /// This should never happen
|
||||
|
||||
wm.Q2ErrorWOCorrection = wm.LastTestResult.Error;
|
||||
wm.Q2CorrectionDone = false;
|
||||
wm.Q2CorrRFlow = 0;
|
||||
|
||||
double q2CorrectionFactor;
|
||||
bool wmOK = wm.CalculateQ2CorrectionFactor(wm.LastTestResult, out q2CorrectionFactor);
|
||||
double q2Correction = 0;
|
||||
Byte q2CorrRFlow = 0;
|
||||
Byte q2CorrLFlow = 0;
|
||||
|
||||
if (q2CorrectionFactor == 0)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
}
|
||||
if (DEWA == false)
|
||||
{
|
||||
///
|
||||
/// Standard process
|
||||
///
|
||||
if (Math.Abs(wm.LastTestResult.Error) <= 0.5)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
}
|
||||
|
||||
if (!wm.CalculateQ2CorrectionFactor(wm.LastTestResult, out q2Correction))
|
||||
{
|
||||
return CommErr.None; /// Q2 error is too large, water meter failed anyhow
|
||||
}
|
||||
|
||||
q2CorrRFlow = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
|
||||
q2CorrLFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF);
|
||||
}
|
||||
else
|
||||
{
|
||||
///
|
||||
/// DEWA process
|
||||
///
|
||||
if (wm.LastTestResult.Error >= 0 && wm.LastTestResult.Error <= 1.0)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
}
|
||||
|
||||
if (!wm.CalculateQ2CorrectionFactor(wm.LastTestResult, out q2Correction))
|
||||
{
|
||||
return CommErr.None; /// Q2 error is too large, water meter failed anyhow
|
||||
}
|
||||
|
||||
if (wm.LastTestResult.Error < 0)
|
||||
{
|
||||
q2CorrRFlow = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
|
||||
q2CorrLFlow = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
|
||||
}
|
||||
else /// if (wm.LastTestResult.Error > 1.0)
|
||||
{
|
||||
q2CorrRFlow = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
|
||||
q2CorrLFlow = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
|
||||
}
|
||||
}
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
CommErr error = CommErr.Write;
|
||||
|
||||
Byte q2CorrRFlow = (byte)((int)Math.Round(q2CorrectionFactor / 2) & 0x000000FF);
|
||||
Byte q2CorrLFlow = (byte)((int)Math.Round(q2CorrectionFactor) & 0x000000FF);
|
||||
byte[] wrData = new byte[2] { q2CorrRFlow, q2CorrLFlow };
|
||||
///
|
||||
for (int j = 0; j < cfg.MaxCommRetries; j++)
|
||||
@@ -1333,8 +1375,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
resultStr = string.Format("Q2 correction: R-flow={0}, L-flow={1}", (SByte)q2CorrRFlow, (SByte)q2CorrLFlow);
|
||||
rfidDataLogger.Warn(wm.Name + ": " + resultStr);
|
||||
wm.Q2CorrectionDone = true;
|
||||
wm.Q2CorrectionFactor = q2CorrectionFactor;
|
||||
}
|
||||
wm.Q2Correction = q2Correction;
|
||||
wm.Q2CorrRFlow = (int)q2CorrRFlow;
|
||||
wm.Q2CorrLFlow = (int)q2CorrLFlow;
|
||||
}
|
||||
#endif
|
||||
|
||||
ClosePort(wm); /// Close RFID port
|
||||
@@ -1343,86 +1387,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Write the calculated Q2 correction factors to the memory.
|
||||
/// Read them back to verify factors were written correctly.
|
||||
/// </summary>
|
||||
/// <param name="wm">Water meter object</param>
|
||||
/// <param name="resultStr">String passed to caller</param>
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr WriteQ2CorrectionAlt(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
wm.Q2ErrorWOCorrection = wm.LastTestResult.Error;
|
||||
wm.Q2CorrectionDone = false;
|
||||
|
||||
double q2CorrectionFactor;
|
||||
bool wmOK = wm.CalculateQ2CorrectionFactor(wm.LastTestResult, out q2CorrectionFactor);
|
||||
|
||||
if (q2CorrectionFactor == 0)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
}
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
CommErr error = CommErr.Write;
|
||||
|
||||
Byte q2CorrRFlow = (byte)((int)Math.Round(q2CorrectionFactor) & 0x000000FF);
|
||||
Byte q2CorrLFlow = (byte)((int)Math.Round(q2CorrectionFactor) & 0x000000FF);
|
||||
byte[] wrData = new byte[2] { q2CorrRFlow, q2CorrLFlow };
|
||||
///
|
||||
for (int j = 0; j < cfg.MaxCommRetries; j++)
|
||||
{
|
||||
if (0 == WriteRequestPort(wm, MessageID.MetrologyMemory, Q2CorrFactorsAddr, wrData.Length, wrData, cfg.CommTimeout))
|
||||
{
|
||||
error = CommErr.None;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Verification disabled on 16.02.2016
|
||||
///
|
||||
#if false
|
||||
if (error == CommErr.None)
|
||||
{
|
||||
error = CommErr.Verify;
|
||||
|
||||
/// Read calibration
|
||||
byte[] rdData = null;
|
||||
for (int j = 0; j < cfg.MaxCommRetries; j++)
|
||||
{
|
||||
if ((0 == ReadRequestPort(wm, MessageID.MetrologyMemory, Q2CorrFactorsAddr, 2, out rdData, cfg.CommTimeout)) &&
|
||||
(rdData != null) && (rdData.Length == 2) && (rdData[0] == q2CorrRFlow) && (rdData[1] == q2CorrLFlow))
|
||||
{
|
||||
error = CommErr.None;
|
||||
resultStr = string.Format("Q2 factors: R-flow={0}, L-flow={1}", (SByte)q2CorrRFlow, (SByte)q2CorrLFlow);
|
||||
rfidDataLogger.Warn(wm.Name + ": " + resultStr);
|
||||
wm.Q2CorrectionDone = true;
|
||||
wm.Q2CorrectionFactor = q2CorrectionFactor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (error == CommErr.None)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction: R-flow={0}, L-flow={1}", (SByte)q2CorrRFlow, (SByte)q2CorrLFlow);
|
||||
rfidDataLogger.Warn(wm.Name + ": " + resultStr);
|
||||
wm.Q2CorrectionDone = true;
|
||||
wm.Q2CorrectionFactor = q2CorrectionFactor;
|
||||
}
|
||||
#endif
|
||||
|
||||
ClosePort(wm); /// Close RFID port
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Write the calculated 2Hz correction factor to the memory.
|
||||
/// </summary>
|
||||
|
||||
@@ -148,7 +148,9 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
|
||||
public double Q2ErrorWOCorrection;
|
||||
public bool Q2CorrectionDone;
|
||||
public double Q2CorrectionFactor;
|
||||
public double Q2Correction;
|
||||
public int Q2CorrRFlow;
|
||||
public int Q2CorrLFlow;
|
||||
|
||||
public double Diff2Hz8Hz;
|
||||
public bool Hz2CorrectionDone;
|
||||
@@ -226,14 +228,14 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
{
|
||||
q2CorrectionFactor = 0;
|
||||
|
||||
if (q2TestResult == null)
|
||||
{
|
||||
return false; /// Q2 test result is missing ==> water meter failed
|
||||
}
|
||||
if (q2TestResult == null) return false; /// Q2 test result is missing ==> water meter failed
|
||||
|
||||
if (Math.Abs(q2TestResult.Error) <= 0.5)
|
||||
double errLimitLo = q2TestResult.ErrLimLo() + q2TestResult.Uncertainty();
|
||||
double errLimitHi = q2TestResult.ErrLimHi() - q2TestResult.Uncertainty();
|
||||
|
||||
if ((q2TestResult.Error < errLimitLo) || (q2TestResult.Error > errLimitHi))
|
||||
{
|
||||
return true; /// error < +/-0.5 % ==> no Q2 correction
|
||||
return false; /// Q2 error too large ==> water meter failed
|
||||
}
|
||||
|
||||
double A = 16.0 / ScalingFactor(); /// Raw units per ml: DN15=16, DN20=8, DN25=4, DN32=2, DN40=1
|
||||
@@ -243,20 +245,6 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
double F = D / (NominalTestFlow * 10.0); /// Error corrected with 8 Raw Units per minute [%]
|
||||
double G = F / B; /// Error corrected with 1 Raw Unit per minute [%]
|
||||
|
||||
double errLimitLo = q2TestResult.ErrLimLo() + q2TestResult.Uncertainty();
|
||||
double errLimitHi = q2TestResult.ErrLimHi() - q2TestResult.Uncertainty();
|
||||
|
||||
if ((q2TestResult.Error < errLimitLo) || (q2TestResult.Error > errLimitHi))
|
||||
{
|
||||
return false; /// Q2 error too large ==> water meter failed
|
||||
}
|
||||
|
||||
double volumeMeterErrLimLo = q2TestResult.VolumeRef * (100.0 + errLimitLo) / 100.0;
|
||||
double volumeMeterErrLimHi = q2TestResult.VolumeRef * (100.0 + errLimitHi) / 100.0;
|
||||
|
||||
double corrFactorHi = (-1) * (errLimitLo / G) * (q2TestResult.VolumeRef / volumeMeterErrLimLo); /// > 0
|
||||
double corrFactorLo = (-1) * (errLimitHi / G) * (q2TestResult.VolumeRef / volumeMeterErrLimHi); /// < 0
|
||||
|
||||
q2CorrectionFactor = (-1) * (q2TestResult.Error / G) * (q2TestResult.VolumeRef / q2TestResult.VolumeMeter);
|
||||
|
||||
log.WarnFormat("Q2 correction: Pos={0}, PCB#={1}, corrFactor={2}, error={3}% [Lo={4}%, Hi={5}%]",
|
||||
@@ -420,7 +408,7 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
OriginalCalibFactor = 0;
|
||||
Q2ErrorWOCorrection = 0;
|
||||
Q2CorrectionDone = false;
|
||||
Q2CorrectionFactor = 0;
|
||||
Q2CorrRFlow = 0;
|
||||
|
||||
optoDataCount = 0;
|
||||
}
|
||||
|
||||
Generated
+2
-2
@@ -54,9 +54,9 @@ namespace TBF
|
||||
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.mainTabControl = new System.Windows.Forms.TabControl();
|
||||
this.homeTabPage = new System.Windows.Forms.TabPage();
|
||||
this.ctrlBrdComponent = new ControlComponent_Izrael2014.UserControl1();
|
||||
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
|
||||
this.processTabPage = new System.Windows.Forms.TabPage();
|
||||
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl6();
|
||||
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl24();
|
||||
this.insertTabPage = new System.Windows.Forms.TabPage();
|
||||
this.resultsTabPage = new System.Windows.Forms.TabPage();
|
||||
this.resultsTabPageCtrl = new TBF.Screens.ResultsTabPageCtrl();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace TBF
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgBalanceTab uiControl = new MetrologyDlgBalanceTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.BalanceCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.IBalanceCfg;
|
||||
uiControl.BalanceCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.IScaleCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
|
||||
@@ -783,9 +783,9 @@ namespace TBF
|
||||
Qfrom,
|
||||
Qto,
|
||||
PumpPower,
|
||||
#if STABLE_MASS_EXTRAS
|
||||
MassRepeats,
|
||||
MassSpread,
|
||||
#if STABLE_MASS_EXTRAS
|
||||
MassSpread,
|
||||
MassMethod,
|
||||
#endif
|
||||
Time_Pump2StartV,
|
||||
@@ -804,9 +804,9 @@ namespace TBF
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_from_m3h, Width = 80 });
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_to_m3h, Width = 80 });
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Pump_power_pct, Width = 90 });
|
||||
#if STABLE_MASS_EXTRAS
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Mass_repeats, Width = 90 });
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Mass_spread_kg, Width = 110 });
|
||||
#if STABLE_MASS_EXTRAS
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Mass_spread_kg, Width = 110 });
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Mass_method, Width = 90 });
|
||||
#endif
|
||||
parametersListViewEx.Columns.Add(new ColumnHeader { Text = Strings.TimePump2StartV_chdr, Width = 70 });
|
||||
@@ -821,8 +821,8 @@ namespace TBF
|
||||
new TextBox(), /// Qfrom
|
||||
new TextBox(), /// Qto
|
||||
new ComboBox(), /// PumpPower
|
||||
#if STABLE_MASS_EXTRAS
|
||||
new TextBox(), /// MassRepeats
|
||||
#if STABLE_MASS_EXTRAS
|
||||
new TextBox(), /// MassSpread
|
||||
new ComboBox(), /// MassMethod
|
||||
#endif
|
||||
@@ -848,8 +848,10 @@ namespace TBF
|
||||
((ComboBox)parametersEditors[(int)ParametersClmn.PumpPower]).Items.Add("98");
|
||||
((ComboBox)parametersEditors[(int)ParametersClmn.PumpPower]).Items.Add("100");
|
||||
#if STABLE_MASS_EXTRAS
|
||||
((ComboBox)parametersEditors[(int)ParametersClmn.MassMethod]).Items.Add(Strings.stable);
|
||||
((ComboBox)parametersEditors[(int)ParametersClmn.MassMethod]).Items.Add(Strings.fast);
|
||||
for (MassMethod mm = 0; mm < MassMethod.Count; mm++)
|
||||
{
|
||||
((ComboBox)parametersEditors[(int)ParametersClmn.MassMethod]).Items.Add(mm.ToDescription());
|
||||
}
|
||||
#endif
|
||||
foreach (var ctrl in parametersEditors)
|
||||
{
|
||||
@@ -904,7 +906,7 @@ namespace TBF
|
||||
lviMetrlg1.SubItems.Add(test.Volume.ToString());
|
||||
lviMetrlg1.SubItems.Add(test.TstTime.ToString());
|
||||
lviMetrlg1.SubItems.Add(test.Repeats.ToString());
|
||||
lviMetrlg1.SubItems.Add(test.Emptying ? Strings.yes : Strings.no);
|
||||
lviMetrlg1.SubItems.Add(test.Draining ? Strings.yes : Strings.no);
|
||||
//lviMetrlg1.SubItems.Add(test.Zeroing ? Strings.yes : Strings.no);
|
||||
lviMetrlg1.SubItems.Add((test.Method != null) ? test.Method.ToString() : string.Empty);
|
||||
|
||||
@@ -941,10 +943,10 @@ namespace TBF
|
||||
/// Process subitems FeedingPath, ...
|
||||
///
|
||||
lviParameters.SubItems.Add(test.PumpPower.ToString("F1"));
|
||||
lviParameters.SubItems.Add((test.MassRepeats < 4 ? 5 : test.MassRepeats).ToString());
|
||||
#if STABLE_MASS_EXTRAS
|
||||
lviParameters.SubItems.Add(test.MassRepeats.ToString());
|
||||
lviParameters.SubItems.Add(test.MassSpread.ToString("F4"));
|
||||
lviParameters.SubItems.Add(test.MassMethod ? "fast" : "stable");
|
||||
lviParameters.SubItems.Add(test.MassSpread.ToString("F4"));
|
||||
lviParameters.SubItems.Add(test.MassMethod.ToDescription());
|
||||
#endif
|
||||
lviParameters.SubItems.Add(test.TimePump2StartV.ToString());
|
||||
lviParameters.SubItems.Add(test.TimeBeforeFlow.ToString());
|
||||
@@ -982,8 +984,8 @@ namespace TBF
|
||||
int itmp;
|
||||
if (int.TryParse(lvi.SubItems[(int)MtrlgyClmn.Repeats].Text, out itmp)) entity.Repeats = itmp;
|
||||
|
||||
if (lvi.SubItems[(int)MtrlgyClmn.Emptying].Text.Equals(Strings.yes)) entity.Emptying = true;
|
||||
else if (lvi.SubItems[(int)MtrlgyClmn.Emptying].Text.Equals(Strings.no)) entity.Emptying = false;
|
||||
if (lvi.SubItems[(int)MtrlgyClmn.Emptying].Text.Equals(Strings.yes)) entity.Draining = true;
|
||||
else if (lvi.SubItems[(int)MtrlgyClmn.Emptying].Text.Equals(Strings.no)) entity.Draining = false;
|
||||
|
||||
|
||||
if (methodCBox.Items.Contains(lvi.SubItems[(int)MtrlgyClmn.Method].Text))
|
||||
@@ -1109,18 +1111,21 @@ namespace TBF
|
||||
entity.PumpPower = powerPct;
|
||||
}
|
||||
|
||||
int itmp;
|
||||
#if STABLE_MASS_EXTRAS
|
||||
if (int.TryParse(lvi.SubItems[(int)ParametersClmn.MassRepeats].Text, out itmp)) entity.MassRepeats = itmp;
|
||||
entity.MassRepeats = int.Parse(lvi.SubItems[(int)ParametersClmn.MassRepeats].Text);
|
||||
|
||||
float massSpread;
|
||||
#if STABLE_MASS_EXTRAS
|
||||
float massSpread;
|
||||
if (Utils.TryParseUFloat(lvi.SubItems[(int)ParametersClmn.MassSpread].Text, out massSpread) && massSpread >= 0)
|
||||
{
|
||||
entity.MassSpread = massSpread;
|
||||
}
|
||||
|
||||
entity.MassMethod = lvi.SubItems[(int)ParametersClmn.MassMethod].Text.Equals(Strings.fast);
|
||||
for (MassMethod mm = 0; mm < MassMethod.Count; mm++)
|
||||
{
|
||||
if (mm.ToDescription().Equals(lvi.SubItems[(int)ParametersClmn.MassMethod].Text)) entity.MassMethod = mm;
|
||||
}
|
||||
#endif
|
||||
int itmp;
|
||||
if (int.TryParse(lvi.SubItems[(int)ParametersClmn.Time_Pump2StartV].Text, out itmp)) entity.TimePump2StartV = itmp;
|
||||
if (int.TryParse(lvi.SubItems[(int)ParametersClmn.Time_BeforeFlow].Text, out itmp)) entity.TimeBeforeFlow = itmp;
|
||||
if (int.TryParse(lvi.SubItems[(int)ParametersClmn.Time_Flow2Mass].Text, out itmp)) entity.TimeFlow2Mass = itmp;
|
||||
@@ -1483,6 +1488,38 @@ namespace TBF
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
if ((e.SubItem == (int)ParametersClmn.MassRepeats) &&
|
||||
(!int.TryParse(e.DisplayText, out itmp) || itmp < 4 || itmp > 100))
|
||||
{
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
#if STABLE_MASS_EXTRAS
|
||||
if ((e.SubItem == (int)ParametersClmn.MassSpread) && !Utils.TryParseUFloat(e.DisplayText, out powerPct))
|
||||
{
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
if (e.SubItem == (int)ParametersClmn.MassMethod)
|
||||
{
|
||||
bool mmIsOk = false;
|
||||
for (MassMethod mm = 0; mm < MassMethod.Count; mm++)
|
||||
{
|
||||
if (mm.ToDescription().Equals(e.DisplayText))
|
||||
{
|
||||
mmIsOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!mmIsOk)
|
||||
{
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1653,6 +1690,7 @@ namespace TBF
|
||||
|
||||
/// Add a test
|
||||
Test test = new Test(newName, listViewEx.Items.Count, LoadedProcedure);
|
||||
TestWizard.RoiData roiData = new TestWizard.RoiData();
|
||||
|
||||
/// Run a create new test wizard
|
||||
TestWizard.MethodSelection methodDlg = new TestWizard.MethodSelection(true, false, test, TestMethods);
|
||||
@@ -1660,9 +1698,16 @@ namespace TBF
|
||||
TestWizard.VolumeAndErrorSelection volumeDlg = new TestWizard.VolumeAndErrorSelection(false, true, test);
|
||||
TestWizard.PressureSelection pressureDlg = new TestWizard.PressureSelection(false, true, test);
|
||||
TestWizard.HeatMetersSelection heatMetersDlg = new TestWizard.HeatMetersSelection(false, false, test);
|
||||
//TestWizard.SensorsSelection sensorsDlg = new TestWizard.SensorsSelection(test);
|
||||
TestWizard.Roi1 roi1Dlg = new TestWizard.Roi1(false, false, roiData);
|
||||
TestWizard.Roi2 roi2Dlg = new TestWizard.Roi2(false, false, roiData);
|
||||
TestWizard.Roi3 roi3Dlg = new TestWizard.Roi3(false, false, roiData);
|
||||
roiData.Calculate();
|
||||
test.Qfrom = (float)(roiData.Q * 0.95);
|
||||
test.Qto = (float)(roiData.Q * 1.05);
|
||||
//test.
|
||||
|
||||
methodLabel:
|
||||
|
||||
switch (methodDlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
@@ -1682,6 +1727,27 @@ namespace TBF
|
||||
#if HEAT_METERS
|
||||
if (selectedMethod.CanTest(MetersKind.HeatMeter)) goto heat_meters_label;
|
||||
#endif
|
||||
if (!(selectedMethod is BenchControl.TestMethods.RoiDetection.RoiDetection)) goto flowLabel;
|
||||
|
||||
roi_detection_label_1:
|
||||
switch (roi1Dlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto methodLabel;
|
||||
}
|
||||
|
||||
roi_detection_label_2:
|
||||
switch (roi2Dlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto roi_detection_label_1;
|
||||
}
|
||||
|
||||
switch (roi3Dlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto roi_detection_label_2;
|
||||
}
|
||||
|
||||
flowLabel:
|
||||
switch (flowDlg.ShowDialog())
|
||||
@@ -1690,12 +1756,19 @@ namespace TBF
|
||||
case DialogResult.Retry: goto methodLabel;
|
||||
}
|
||||
|
||||
if (selectedMethod is BenchControl.TestMethods.RoiDetection.RoiDetection)
|
||||
{
|
||||
goto select_paths;
|
||||
}
|
||||
|
||||
switch (volumeDlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto flowLabel;
|
||||
}
|
||||
|
||||
select_paths:
|
||||
|
||||
/// Depending on the chosen Q select the paths
|
||||
float Qaver = (test.Qfrom + test.Qto) / 2.0f;
|
||||
foreach (var path in feedingPaths)
|
||||
@@ -1736,7 +1809,7 @@ namespace TBF
|
||||
}
|
||||
goto flowLabel;
|
||||
#endif
|
||||
|
||||
|
||||
pressure_label:
|
||||
|
||||
switch (pressureDlg.ShowDialog())
|
||||
@@ -1983,5 +2056,52 @@ namespace TBF
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.Middle);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds ROI data/process data prepared by the wizard to ROI-components in the selected sensors path
|
||||
/// </summary>
|
||||
/// <param name="procedure">Loaded procedure</param>
|
||||
/// <param name="sensorsPath">Selected sensors path</param>
|
||||
/// <param name="roiData">ROI data</param>
|
||||
void AddProcessDataToRoiComponents(Config.Entities.Procedure procedure, string sensorsPathName, TestWizard.RoiData roiData)
|
||||
{
|
||||
/// Create controls for each sensors path used in this procedure.
|
||||
/// Initialize it with its components (sensors or cameras) and add it to the list.
|
||||
try
|
||||
{
|
||||
MetersPath sensorsPath = metersPaths.First<MetersPath>(x => (x.Name == sensorsPathName));
|
||||
|
||||
if (sensorsPath != null)
|
||||
{
|
||||
IList<IComponent> cmpntsInMPath = new List<IComponent>();
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
IComponent sensor = TbfComponents.FirstOrDefault<IComponent>(x => (x.Cfg.Name.Equals(sensorsPath.GetSensor(i))));
|
||||
cmpntsInMPath.Add(sensor);
|
||||
}
|
||||
|
||||
foreach (var cmpnt in cmpntsInMPath)
|
||||
{
|
||||
if (cmpnt != null && (cmpnt.Cfg.GetProcedureParams() != null))
|
||||
{
|
||||
IParamsProvider procedureParams = cmpnt.Cfg.CreateProcedureParams(procedure);
|
||||
BenchControl.Network.Camera.Roi.ProcedureParams roiParams = procedureParams as BenchControl.Network.Camera.Roi.ProcedureParams;
|
||||
if (roiParams != null)
|
||||
{
|
||||
roiParams.PulsesPerLtr = (float)roiData.PulsesPerLiter;
|
||||
roiParams.DetectionImagesCount = roiData.N;
|
||||
roiParams.DetectionPeriod1 = roiData.P1;
|
||||
roiParams.DetectionPeriod2 = roiData.P2;
|
||||
roiParams.RoiParams = roiData.GetRoiParams();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ namespace TBF
|
||||
//
|
||||
this.sharedButtons.Location = new System.Drawing.Point(1, 0);
|
||||
this.sharedButtons.Name = "sharedButtons";
|
||||
this.sharedButtons.Size = new System.Drawing.Size(100, 521);
|
||||
this.sharedButtons.Size = new System.Drawing.Size(100, 649);
|
||||
this.sharedButtons.TabIndex = 0;
|
||||
//
|
||||
// ProceduresDlg
|
||||
|
||||
@@ -29,7 +29,8 @@ namespace TBF
|
||||
sharedButtons.RequiredGroupMembership = Users.Grp.GID.TestingSpecialists;
|
||||
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove |
|
||||
SharedButtons.Buttons.Up | SharedButtons.Buttons.Down |
|
||||
SharedButtons.Buttons.Edit | SharedButtons.Buttons.Copy;
|
||||
SharedButtons.Buttons.Edit | SharedButtons.Buttons.Copy |
|
||||
SharedButtons.Buttons.Export | SharedButtons.Buttons.Import;
|
||||
|
||||
sharedButtons.Unlocked += Unlocked;
|
||||
sharedButtons.OKClicked += okButton_Click;
|
||||
@@ -40,7 +41,9 @@ namespace TBF
|
||||
sharedButtons.DownClicked += downButton_Click;
|
||||
sharedButtons.EditClicked += proceduresCtrl.editButton_Click;
|
||||
sharedButtons.CopyClicked += proceduresCtrl.copyButton_Click;
|
||||
}
|
||||
sharedButtons.ExportClicked += proceduresCtrl.exportButton_Click;
|
||||
sharedButtons.ImportClicked += proceduresCtrl.importButton_Click;
|
||||
}
|
||||
|
||||
private void ProceduresDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace TBF
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public const string HomeDir = "C:\\Tbf\\"; /// Contains subdirectories Results, Logs, Images, ...
|
||||
public const string HomeDir = "C:\\Tbf\\"; /// Contains subdirectories Results, Logs, Images, ...
|
||||
public const string ImagesDir = "C:\\Tbf\\Images\\";
|
||||
|
||||
/// log4net
|
||||
static ILog log;
|
||||
@@ -92,6 +93,10 @@ namespace TBF
|
||||
{
|
||||
Environment.CurrentDirectory = locAppDataDir;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(ImagesDir)) Directory.CreateDirectory(ImagesDir);
|
||||
IEnumerable<string> files = Directory.EnumerateFiles(ImagesDir);
|
||||
foreach (var file in files) File.Delete(file);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.12.514.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.514.1")]
|
||||
[assembly: AssemblyVersion("2.12.536.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.536.1")]
|
||||
|
||||
+30
@@ -60,6 +60,36 @@ namespace TBF.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap RoiStyle1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("RoiStyle1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap RoiStyle2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("RoiStyle2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap RoiStyle3 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("RoiStyle3", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -136,4 +136,13 @@
|
||||
<data name="TestPassedImage2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\TestPassedImage2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="RoiStyle1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\RoiStyle1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="RoiStyle2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\RoiStyle2.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="RoiStyle3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\RoiStyle3.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user