- ReferenceFlowmeterCalibration method and sequence (ready for tests)
- FlyingStart method and sequence files prepared for implementation (copies of FlyingStartMassCollection)
This commit is contained in:
parent
fcd44e7a1a
commit
b8faca784e
@ -23,12 +23,11 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
public Generic.IComponentCfg Cfg { get { return flowMeterCfg; } }
|
||||
|
||||
public string Name { get { return flowMeterCfg.Name; } }
|
||||
public int Position { get { return flowMeterCfg.Position; } }
|
||||
public IList<Entities.MeasurementCorrection> Corrections { get { return flowMeterCfg.Corrections; } }
|
||||
|
||||
public readonly ControlBoardDev ControlBoard;
|
||||
|
||||
public readonly int Position; /// 1..4
|
||||
|
||||
readonly float nominalFlow;
|
||||
public float NominalFlow { get { return nominalFlow; } }
|
||||
|
||||
@ -40,8 +39,6 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
Position = cfg.Position;
|
||||
|
||||
nominalFlow = cfg.NominalFlow;
|
||||
ControlBoard.EtCalib[Position] = NominalFlow;
|
||||
|
||||
|
||||
@ -14,6 +14,11 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// </summary>
|
||||
float NominalFlow { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 1 based index of the reference flowmeter
|
||||
/// </summary>
|
||||
int Position { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Measurement correction table
|
||||
/// </summary>
|
||||
|
||||
@ -22,7 +22,8 @@ namespace TBF.BenchControl.Sequences
|
||||
/// Global static variables set only once.
|
||||
///------------------------------------------------------------
|
||||
public static BenchId.Component BenchId;
|
||||
public static IList<IRegulValve> RegulValves; /// list of regulation valves
|
||||
public static IList<IFlowMeter> FlowMeters; /// list of reference flowmeters
|
||||
public static IList<IRegulValve> RegulValves; /// list of regulation valves
|
||||
public static IList<IWaterMeter> WaterMeters; /// list of water meters
|
||||
public static IList<ICamera> Cameras; /// list of cameras
|
||||
|
||||
@ -31,7 +32,9 @@ namespace TBF.BenchControl.Sequences
|
||||
/// They are re-initialized when LoadProcedure() is called
|
||||
///------------------------------------------------------------
|
||||
protected static IList<Entities.TestResult> results;
|
||||
public static float Qrise;
|
||||
public static int ReferenceFlowmetersCount;
|
||||
public static float[] LtrPerRefPulse; /// Reference flowmeter coefficients
|
||||
public static float Qrise;
|
||||
public static float Qfall;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -196,6 +196,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>();
|
||||
SequenceBase.FlowMeters = new List<IFlowMeter>();
|
||||
SequenceBase.RegulValves = new List<IRegulValve>();
|
||||
SequenceBase.WaterMeters = new List<IWaterMeter>();
|
||||
SequenceBase.Cameras = new List<ICamera>();
|
||||
@ -204,6 +205,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
if (cmpnt is Elde.ControlBoardDev) ControlBoard = cmpnt as Elde.ControlBoardDev;
|
||||
if (cmpnt is BenchId.Component) SequenceBase.BenchId = cmpnt as BenchId.Component;
|
||||
if (cmpnt is IFlowMeter) SequenceBase.FlowMeters.Add(cmpnt as IFlowMeter);
|
||||
if (cmpnt is IRegulValve) SequenceBase.RegulValves.Add(cmpnt as IRegulValve);
|
||||
if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter);
|
||||
if (cmpnt is ICamera) SequenceBase.Cameras.Add(cmpnt as ICamera);
|
||||
@ -473,6 +475,14 @@ namespace TBF.BenchControl
|
||||
|
||||
try
|
||||
{
|
||||
Sequences.SequenceBase.ReferenceFlowmetersCount = SequenceBase.FlowMeters.Count;
|
||||
Sequences.SequenceBase.LtrPerRefPulse = new float[Sequences.SequenceBase.ReferenceFlowmetersCount];
|
||||
foreach (var flowmtr in SequenceBase.FlowMeters)
|
||||
{
|
||||
int ix = flowmtr.Position;
|
||||
SequenceBase.LtrPerRefPulse[ix - 1] = flowmtr.NominalFlow / 7200.0f;
|
||||
}
|
||||
|
||||
(new Sequences.MainSeq()).Execute(null);
|
||||
}
|
||||
catch (QuitStateMachineException)
|
||||
|
||||
@ -36,7 +36,9 @@ namespace TBF.BenchControl
|
||||
Factories.Add(new TestMethods.CombinedMeters.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.FixedStartMassCollection.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.FlyingStart.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.FlyingStartCollectionMethod.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.ReferenceFlowmeterCalibration.TestMethodFactory());
|
||||
Factories.Add(new WaterMeter.WaterMeterFactory());
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,388 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
public class FlyingStartSeq : Sequences.SequenceBase
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(FlyingStartSeq));
|
||||
private static readonly ILog allResults = LogManager.GetLogger("AllResults");
|
||||
private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults");
|
||||
|
||||
/// <summary>
|
||||
/// Flying start mass collection method sequence
|
||||
/// </summary>
|
||||
/// <param name="test">Test entity</param>
|
||||
/// <returns>
|
||||
/// Event.Done . . . . . . . OK
|
||||
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
||||
/// Event.OpArgumentError . Target flow is out of range
|
||||
/// Event.Error . . . . . . Unspecified error
|
||||
/// </returns>
|
||||
public IList<Event> Execute(Entities.Test test)
|
||||
{
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
|
||||
/// Operations running in more then one state
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
|
||||
/// 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)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h]
|
||||
|
||||
float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse]
|
||||
|
||||
int repetitionNr = 1; /// First test: repetitionNr=1
|
||||
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
//====================================
|
||||
loop:
|
||||
/// Start the test, initialize test results
|
||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||
Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single);
|
||||
|
||||
|
||||
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("FlyingStartCollectionMethod : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float 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:
|
||||
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
float estFlowSetTime = 10.0f;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
|
||||
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
//--------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
|
||||
|
||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.RegulValveTimeOut)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.Next)) goto flow_set;
|
||||
}
|
||||
while (!e.Contains(Event.FlowReached));
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
for (int i = 0; i < sensPath.RegisterReaders.Length; i++)
|
||||
{
|
||||
GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi;
|
||||
if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp());
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.MeasurementStarted));
|
||||
|
||||
/// Measurement loop - preparation
|
||||
readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
||||
readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||
|
||||
bool firstTime = true; /// To reset sums for averaging
|
||||
ResetAveragedData();
|
||||
|
||||
/// Measurement loop - begin
|
||||
while (true)
|
||||
{
|
||||
//--------------------------------
|
||||
switch (ReadRegistersTempPressAmbient(measureOperations, true))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
case Event.MeasurementCompleted: goto test_completed;
|
||||
}
|
||||
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
{
|
||||
logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]);
|
||||
}
|
||||
log.Info(logstr);
|
||||
|
||||
|
||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, cBrd.TTime, progress));
|
||||
}
|
||||
/// Measurement loop - end
|
||||
|
||||
test_completed:
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
///
|
||||
tstRslt.MassEndRaw = endMass.Val;
|
||||
tstRslt.TimeEnd = DateTime.Now;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_completed);
|
||||
//------------------------------------------------
|
||||
|
||||
///
|
||||
/// Populate TestResult data entity with data
|
||||
///
|
||||
tstRslt.TimeEnd = DateTime.Now;
|
||||
UpdateTestRsltWithAveragedData(tstRslt);
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster;
|
||||
/// Corrected master pulses per liter
|
||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
||||
{
|
||||
tstRslt.ErrorMaster = 0.1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
||||
}
|
||||
tstRslt.TimeDivStart0 = 0;
|
||||
tstRslt.TimeDivStart1 = 0;
|
||||
tstRslt.TimeDivStart2 = 0;
|
||||
tstRslt.TimeDivStart3 = 0;
|
||||
tstRslt.TimeDivStart4 = 0;
|
||||
tstRslt.TimeDivStart5 = 0;
|
||||
tstRslt.TimeDivEnd0 = 0;
|
||||
tstRslt.TimeDivEnd1 = 0;
|
||||
tstRslt.TimeDivEnd2 = 0;
|
||||
tstRslt.TimeDivEnd3 = 0;
|
||||
tstRslt.TimeDivEnd4 = 0;
|
||||
tstRslt.TimeDivEnd5 = 0;
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
{
|
||||
if (sensPath.RegisterReaders[i] != null)
|
||||
{
|
||||
tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString();
|
||||
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
||||
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
||||
if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
||||
else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
||||
tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
||||
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
||||
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
||||
if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
||||
{
|
||||
tstRslt.Meters[i].VolumeErrorPct =
|
||||
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
||||
/// %
|
||||
}
|
||||
else
|
||||
{
|
||||
tstRslt.Meters[i].VolumeErrorPct = -100;
|
||||
}
|
||||
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
|
||||
}
|
||||
}
|
||||
/// Add data - end
|
||||
|
||||
AddOrOverwriteResult(tstRslt);
|
||||
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
||||
|
||||
/// Append the results to the CSV-file
|
||||
allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0)));
|
||||
|
||||
FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt);
|
||||
|
||||
|
||||
if (++repetitionNr <= test.Repeats)
|
||||
{
|
||||
goto loop;
|
||||
}
|
||||
|
||||
|
||||
stopTest:
|
||||
|
||||
///----------------------///
|
||||
/// Quit this sequence ///
|
||||
///----------------------///
|
||||
|
||||
State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
/// Transition sequence at the end of test
|
||||
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
||||
switch (Transition(transitionStop, TransitionContext.TestEnd))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
|
||||
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
||||
IList<Event> retList = new List<Event>();
|
||||
retList.Add(retVal);
|
||||
return retList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
public class TestMethod : Generic.IComponent, GenericDevices.ITestMethod, ISequence
|
||||
{
|
||||
readonly TestMethodCfg testMethodCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return testMethodCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return testMethodCfg.Name; } }
|
||||
|
||||
public TestMethod(TestMethodCfg cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.testMethodCfg = cfg;
|
||||
}
|
||||
|
||||
public IList<Event> Execute(Entities.Test test)
|
||||
{
|
||||
return (new FlyingStartSeq()).Execute(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
/// Parameterless constructor
|
||||
public TestMethodCfg()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data entry form configuration parameters
|
||||
/// </summary>
|
||||
/// <param name="factory">Data entry form factory</param>
|
||||
/// <param name="name">Component name</param>
|
||||
public TestMethodCfg(IComponentFactory factory, string name)
|
||||
: base(factory, name)
|
||||
{
|
||||
}
|
||||
|
||||
public IComponentCfg Clone()
|
||||
{
|
||||
return new TestMethodCfg(Factory, Name);
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public TBF.Entities.Component CreateDbEntity()
|
||||
{
|
||||
using (var writer = new StringWriter())
|
||||
{
|
||||
(new XmlSerializer(GetType())).Serialize(writer, this);
|
||||
return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory)
|
||||
{
|
||||
using (var reader = new StringReader(component.Parameters))
|
||||
{
|
||||
TestMethodCfg config = (TestMethodCfg)(new XmlSerializer(typeof(TestMethodCfg))).Deserialize(reader);
|
||||
config.InitCfgBaseFromEntity(component, factory);
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl));
|
||||
|
||||
TestMethodCfg config;
|
||||
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as TestMethodCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public TestMethodCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
Redraw();
|
||||
}
|
||||
|
||||
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 CfgVerifyFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgVerifyFlags flags = CfgVerifyFlags.None;
|
||||
return flags;
|
||||
}
|
||||
|
||||
public void UpdateCfg()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
config.Name = nameTextBox.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
83
TestBenchFramework/BenchControl/TestMethods/FlyingStart/TestMethodCfgCtrl.designer.cs
generated
Normal file
83
TestBenchFramework/BenchControl/TestMethods/FlyingStart/TestMethodCfgCtrl.designer.cs
generated
Normal file
@ -0,0 +1,83 @@
|
||||
namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
partial class TestMethodCfgCtrl
|
||||
{
|
||||
/// <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.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(137, 57);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(27, 60);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(134, 33);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 3;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// BasicPrinterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "BasicPrinterCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 200);
|
||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
||||
@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
{
|
||||
public class TestMethodFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "FlyingStart"; } }
|
||||
public bool HasProcedureParams { get { return false; } }
|
||||
public bool HasTestParams { get { return false; } }
|
||||
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
|
||||
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
|
||||
|
||||
/// <summary>Max. number of components of this class in the system</summary>
|
||||
public int MaxCount { get { return 1; } }
|
||||
|
||||
|
||||
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
|
||||
{
|
||||
return new TestMethodCfg(this, "FlyingStart");
|
||||
}
|
||||
|
||||
public IComponentCfgCtrl CreateCfgCtrl()
|
||||
{
|
||||
return new TestMethodCfgCtrl();
|
||||
}
|
||||
|
||||
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
|
||||
{
|
||||
return new TestMethod((TestMethodCfg)config);
|
||||
}
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return TestMethodCfg.CreateFromDbEntity(component, this);
|
||||
}
|
||||
|
||||
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,384 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
{
|
||||
public class ReferenceFlowmeterCalibrationSeq : Sequences.SequenceBase
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReferenceFlowmeterCalibrationSeq));
|
||||
private static readonly ILog allResults = LogManager.GetLogger("AllResults");
|
||||
private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults");
|
||||
|
||||
/// <summary>
|
||||
/// Flying start mass collection method sequence
|
||||
/// </summary>
|
||||
/// <param name="test">Test entity</param>
|
||||
/// <returns>
|
||||
/// Event.Done . . . . . . . OK
|
||||
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
||||
/// Event.OpArgumentError . Target flow is out of range
|
||||
/// Event.Error . . . . . . Unspecified error
|
||||
/// </returns>
|
||||
public IList<Event> Execute(Entities.Test test)
|
||||
{
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
|
||||
/// Operations running in more then one state
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
|
||||
/// 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)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h]
|
||||
|
||||
float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse]
|
||||
|
||||
int repetitionNr = 1; /// First test: repetitionNr=1
|
||||
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
|
||||
//====================================
|
||||
loop:
|
||||
/// Start the test, initialize test results
|
||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||
Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single);
|
||||
|
||||
|
||||
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("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float 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:
|
||||
|
||||
int flowSetTime0 = StateMachine.Time;
|
||||
float estFlowSetTime = 10.0f;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
|
||||
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
//--------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
|
||||
|
||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.RegulValveTimeOut)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.Next)) goto flow_set;
|
||||
}
|
||||
while (!e.Contains(Event.FlowReached));
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.MeasurementStarted));
|
||||
|
||||
/// Measurement loop - preparation
|
||||
readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
||||
readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||
|
||||
bool firstTime = true; /// To reset sums for averaging
|
||||
ResetAveragedData();
|
||||
|
||||
/// Measurement loop - begin
|
||||
while (true)
|
||||
{
|
||||
//--------------------------------
|
||||
switch (ReadRegistersTempPressAmbient(null, true))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
case Event.MeasurementCompleted: goto test_completed;
|
||||
}
|
||||
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
{
|
||||
logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]);
|
||||
}
|
||||
log.Info(logstr);
|
||||
|
||||
|
||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, cBrd.TTime, progress));
|
||||
}
|
||||
/// Measurement loop - end
|
||||
|
||||
test_completed:
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
///
|
||||
tstRslt.MassEndRaw = endMass.Val;
|
||||
tstRslt.TimeEnd = DateTime.Now;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_completed);
|
||||
//------------------------------------------------
|
||||
|
||||
///
|
||||
/// Populate TestResult data entity with data
|
||||
///
|
||||
tstRslt.TimeEnd = DateTime.Now;
|
||||
UpdateTestRsltWithAveragedData(tstRslt);
|
||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
||||
{
|
||||
tstRslt.ErrorMaster = 0.1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
||||
|
||||
/// Update flowmeter constant with the measured one
|
||||
if (outPath.FlowMeter.Position > 0 && outPath.FlowMeter.Position <= ReferenceFlowmetersCount)
|
||||
{
|
||||
LtrPerRefPulse[outPath.FlowMeter.Position - 1] = tstRslt.ConstMaster;
|
||||
log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Position - 1, tstRslt.ConstMaster);
|
||||
}
|
||||
}
|
||||
tstRslt.TimeDivStart0 = 0;
|
||||
tstRslt.TimeDivStart1 = 0;
|
||||
tstRslt.TimeDivStart2 = 0;
|
||||
tstRslt.TimeDivStart3 = 0;
|
||||
tstRslt.TimeDivStart4 = 0;
|
||||
tstRslt.TimeDivStart5 = 0;
|
||||
tstRslt.TimeDivEnd0 = 0;
|
||||
tstRslt.TimeDivEnd1 = 0;
|
||||
tstRslt.TimeDivEnd2 = 0;
|
||||
tstRslt.TimeDivEnd3 = 0;
|
||||
tstRslt.TimeDivEnd4 = 0;
|
||||
tstRslt.TimeDivEnd5 = 0;
|
||||
//for (int i = 0; i < Program.WMsCount; i++)
|
||||
//{
|
||||
// if (sensPath.RegisterReaders[i] != null)
|
||||
// {
|
||||
// tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString();
|
||||
// tstRslt.Meters[i].VolumeStart = 0; /// liter
|
||||
// tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
||||
// if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
||||
// else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
||||
// tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
||||
// tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
||||
// tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
||||
// tstRslt.Meters[i].Time = cBrd.TTime;
|
||||
// if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
||||
// {
|
||||
// tstRslt.Meters[i].VolumeErrorPct =
|
||||
// 100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
||||
// /// %
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// tstRslt.Meters[i].VolumeErrorPct = -100;
|
||||
// }
|
||||
// tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
|
||||
// }
|
||||
//}
|
||||
/// Add data - end
|
||||
|
||||
AddOrOverwriteResult(tstRslt);
|
||||
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
||||
|
||||
/// Append the results to the CSV-file
|
||||
allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0)));
|
||||
|
||||
FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt);
|
||||
|
||||
|
||||
if (++repetitionNr <= test.Repeats)
|
||||
{
|
||||
goto loop;
|
||||
}
|
||||
|
||||
|
||||
stopTest:
|
||||
|
||||
///----------------------///
|
||||
/// Quit this sequence ///
|
||||
///----------------------///
|
||||
|
||||
State.Create("ReferenceFlowmeterCalibration : Stopping diverter, gate, etc.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
/// Transition sequence at the end of test
|
||||
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
||||
switch (Transition(transitionStop, TransitionContext.TestEnd))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
|
||||
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
||||
IList<Event> retList = new List<Event>();
|
||||
retList.Add(retVal);
|
||||
return retList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
{
|
||||
public class TestMethod : Generic.IComponent, GenericDevices.ITestMethod, ISequence
|
||||
{
|
||||
readonly TestMethodCfg testMethodCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return testMethodCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return testMethodCfg.Name; } }
|
||||
|
||||
public TestMethod(TestMethodCfg cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.testMethodCfg = cfg;
|
||||
}
|
||||
|
||||
public IList<Event> Execute(Entities.Test test)
|
||||
{
|
||||
return (new ReferenceFlowmeterCalibrationSeq()).Execute(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
{
|
||||
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
/// Parameterless constructor
|
||||
public TestMethodCfg()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data entry form configuration parameters
|
||||
/// </summary>
|
||||
/// <param name="factory">Data entry form factory</param>
|
||||
/// <param name="name">Component name</param>
|
||||
public TestMethodCfg(IComponentFactory factory, string name)
|
||||
: base(factory, name)
|
||||
{
|
||||
}
|
||||
|
||||
public IComponentCfg Clone()
|
||||
{
|
||||
return new TestMethodCfg(Factory, Name);
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public TBF.Entities.Component CreateDbEntity()
|
||||
{
|
||||
using (var writer = new StringWriter())
|
||||
{
|
||||
(new XmlSerializer(GetType())).Serialize(writer, this);
|
||||
return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory)
|
||||
{
|
||||
using (var reader = new StringReader(component.Parameters))
|
||||
{
|
||||
TestMethodCfg config = (TestMethodCfg)(new XmlSerializer(typeof(TestMethodCfg))).Deserialize(reader);
|
||||
config.InitCfgBaseFromEntity(component, factory);
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
{
|
||||
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl));
|
||||
|
||||
TestMethodCfg config;
|
||||
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as TestMethodCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public TestMethodCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
Redraw();
|
||||
}
|
||||
|
||||
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 CfgVerifyFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgVerifyFlags flags = CfgVerifyFlags.None;
|
||||
return flags;
|
||||
}
|
||||
|
||||
public void UpdateCfg()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
config.Name = nameTextBox.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
{
|
||||
partial class TestMethodCfgCtrl
|
||||
{
|
||||
/// <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.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(137, 57);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(27, 60);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(134, 33);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 3;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// BasicPrinterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "BasicPrinterCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 200);
|
||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
||||
@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
{
|
||||
public class TestMethodFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "ReferenceFlowmeterCalibration"; } }
|
||||
public bool HasProcedureParams { get { return false; } }
|
||||
public bool HasTestParams { get { return false; } }
|
||||
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
|
||||
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
|
||||
|
||||
/// <summary>Max. number of components of this class in the system</summary>
|
||||
public int MaxCount { get { return 1; } }
|
||||
|
||||
|
||||
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
|
||||
{
|
||||
return new TestMethodCfg(this, "ReferenceFlowmeterCalibration");
|
||||
}
|
||||
|
||||
public IComponentCfgCtrl CreateCfgCtrl()
|
||||
{
|
||||
return new TestMethodCfgCtrl();
|
||||
}
|
||||
|
||||
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
|
||||
{
|
||||
return new TestMethod((TestMethodCfg)config);
|
||||
}
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return TestMethodCfg.CreateFromDbEntity(component, this);
|
||||
}
|
||||
|
||||
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
|
||||
}
|
||||
}
|
||||
@ -418,6 +418,26 @@
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodFactory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\CameraRoiDetection\RoiDetectionCfgCtrl.designer.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStart\FlyingStartSeq.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethod.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethodCfg.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.designer.cs">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethodFactory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\ReferenceFlowmeterCalibrationSeq.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethod.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethodCfg.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethodCfgCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethodCfgCtrl.designer.cs">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethodFactory.cs" />
|
||||
<Compile Include="BenchControl\WaterMeter\ProcParams.cs" />
|
||||
<Compile Include="BenchControl\WaterMeter\WaterMeter.cs" />
|
||||
<Compile Include="BenchControl\WaterMeter\WaterMeterCfg.cs" />
|
||||
@ -954,6 +974,12 @@
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodCfgCtrl.resx">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.resx">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethodCfgCtrl.resx">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\WaterMeter\WaterMeterCfgCtrl.resx">
|
||||
<DependentUpon>WaterMeterCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user