'EndCondiiton' and 'Communication' added to TransitionStep (transition sequence). TODO: EndConditions functionality, version 1.5.44
This commit is contained in:
parent
49f6aaf670
commit
edb6d5e8b6
@ -255,7 +255,7 @@ namespace TBF.BenchControl.Sequences
|
||||
string errorMsg;
|
||||
if (!StateMachine.GetPaths(test, out inPath, out benchPath,
|
||||
out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop,
|
||||
out transitionBefore, out transitionAfter,
|
||||
out errorMsg))
|
||||
{
|
||||
UiBridge.Bridge.OnError(this, errorMsg);
|
||||
@ -270,7 +270,7 @@ namespace TBF.BenchControl.Sequences
|
||||
string errorMsg;
|
||||
if (!StateMachine.GetPaths(test, out inPath, out benchPath,
|
||||
out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop,
|
||||
out transitionBefore, out transitionAfter,
|
||||
out errorMsg))
|
||||
{
|
||||
UiBridge.Bridge.OnError(this, errorMsg);
|
||||
@ -318,7 +318,7 @@ namespace TBF.BenchControl.Sequences
|
||||
string errorMsg;
|
||||
if (!StateMachine.GetPaths(test, out inPath, out benchPath,
|
||||
out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop,
|
||||
out transitionBefore, out transitionAfter,
|
||||
out errorMsg))
|
||||
{
|
||||
UiBridge.Bridge.OnError(this, errorMsg);
|
||||
|
||||
@ -125,8 +125,8 @@ namespace TBF.BenchControl.Sequences
|
||||
protected static BenchControl.BenchPath benchPath;
|
||||
protected static BenchControl.OutputPath outPath;
|
||||
protected static BenchControl.MetersPath sensPath;
|
||||
protected static Entities.TransitionSequence transitionStart;
|
||||
protected static Entities.TransitionSequence transitionStop;
|
||||
protected static Entities.TransitionSequence transitionBefore;
|
||||
protected static Entities.TransitionSequence transitionAfter;
|
||||
|
||||
|
||||
#region Temperature_Pressure_Humidity
|
||||
@ -364,8 +364,8 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
PurgeBegin,
|
||||
PurgeEnd,
|
||||
TestStart,
|
||||
TestEnd,
|
||||
BeforeTest,
|
||||
AfterTest,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -387,8 +387,8 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break;
|
||||
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
||||
case TransitionContext.TestStart: message = Strings.Test_start_sequence_i_n; break;
|
||||
case TransitionContext.TestEnd: message = Strings.Test_stop_sequence_i_n; break;
|
||||
case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break;
|
||||
case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break;
|
||||
default: message = "Transition"; break;
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
/// No transition sequence defined --> Default action
|
||||
///
|
||||
if (context == TransitionContext.TestStart)
|
||||
if (context == TransitionContext.BeforeTest)
|
||||
{
|
||||
State.Create("SequenceBase : Transition : TestStart - Default action")
|
||||
.AddOperation(checkUiOp).AddOperation(StateMachine.ControlBoard
|
||||
@ -411,7 +411,7 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
while (e.Contains(Event.ValvesBusy));
|
||||
}
|
||||
else if (context == TransitionContext.TestEnd)
|
||||
else if (context == TransitionContext.AfterTest)
|
||||
{
|
||||
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
||||
.AddOperation(checkUiOp).AddOperation(StateMachine.ControlBoard
|
||||
@ -548,7 +548,7 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
}
|
||||
|
||||
if (context == TransitionContext.TestEnd)
|
||||
if (context == TransitionContext.AfterTest)
|
||||
{
|
||||
///
|
||||
/// Stop the pump at the end of test
|
||||
|
||||
@ -390,16 +390,16 @@ namespace TBF.BenchControl
|
||||
out BenchPath pben,
|
||||
out OutputPath pout,
|
||||
out MetersPath pmtrs,
|
||||
out Entities.TransitionSequence transitionStart,
|
||||
out Entities.TransitionSequence transitionEnd,
|
||||
out Entities.TransitionSequence transitionBefore,
|
||||
out Entities.TransitionSequence transitionAfter,
|
||||
out string errorMsg)
|
||||
{
|
||||
pfeed = null;
|
||||
pben = null;
|
||||
pout = null;
|
||||
pmtrs = null;
|
||||
transitionStart = null;
|
||||
transitionEnd = null;
|
||||
transitionBefore = null;
|
||||
transitionAfter = null;
|
||||
|
||||
foreach (var path in feedingPaths)
|
||||
{
|
||||
@ -433,10 +433,10 @@ namespace TBF.BenchControl
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var transition in TransitionSequences)
|
||||
foreach (var tr in TransitionSequences)
|
||||
{
|
||||
if (transition.Name == test.TransitionStart) transitionStart = transition;
|
||||
if (transition.Name == test.TransitionEnd) transitionEnd = transition;
|
||||
if (tr.Name == test.RelTransBefore) transitionBefore = tr;
|
||||
if (tr.Name == test.TransitionAfter) transitionAfter = tr;
|
||||
}
|
||||
|
||||
if ((pfeed == null) || (pben == null) || (pout == null) || (pmtrs == null))
|
||||
|
||||
@ -60,7 +60,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -351,7 +351,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -37,7 +37,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -146,7 +146,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -54,7 +54,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -466,7 +466,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -69,7 +69,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTest;
|
||||
@ -665,7 +665,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
|
||||
|
||||
/// Transition or SetRoute - End
|
||||
switch (Transition(transitionStop, TransitionContext.TestEnd))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTest;
|
||||
|
||||
@ -52,7 +52,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -597,7 +597,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -49,7 +49,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -314,7 +314,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -49,7 +49,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -485,7 +485,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -38,7 +38,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
|
||||
|
||||
// Transition or SetRoute - Start
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -333,7 +333,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -38,7 +38,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
|
||||
|
||||
// Transition or SetRoute - Start
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -252,7 +252,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -49,7 +49,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -436,7 +436,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
|
||||
/// 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))
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
|
||||
@ -16,22 +16,15 @@ namespace TBF.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flow set method Std/ComposedMeter
|
||||
/// Transition step is finished when this condition is fulfilled
|
||||
/// </summary>
|
||||
public enum QSetMethod
|
||||
public enum StepCondition
|
||||
{
|
||||
Standard,
|
||||
CombinedMeter,
|
||||
Count,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Procedure method FSS/SSS
|
||||
/// </summary>
|
||||
public enum TestMethod2
|
||||
{
|
||||
FSS,
|
||||
SSS,
|
||||
None,
|
||||
Scale1Empty,
|
||||
Scale2Empty,
|
||||
Scale3Empty,
|
||||
AllScalesEmpty,
|
||||
Count,
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajik
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -37,8 +38,10 @@ namespace TBF.Entities
|
||||
public virtual string BenchPath { get; set; }
|
||||
public virtual string OutputPath { get; set; }
|
||||
public virtual string MetersPath { get; set; }
|
||||
public virtual string TransitionStart { get; set; }
|
||||
public virtual string TransitionEnd { get; set; }
|
||||
public virtual string RelTransBefore { get; set; }
|
||||
public virtual string RelTransBetween { get; set; }
|
||||
public virtual string RelTransAfter { get; set; }
|
||||
public virtual string TransitionAfter { get; set; }
|
||||
|
||||
public virtual IList<ComponentTest> MoreParams { get; set; }
|
||||
|
||||
@ -63,7 +66,7 @@ namespace TBF.Entities
|
||||
TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement
|
||||
ErrLimLo = -2.0f; /// [%] lower error limit
|
||||
ErrLimHi = 2.0f; /// [%] upper error limit
|
||||
TolerRed = 5.0; /// = Filter parameter
|
||||
TolerRed = 0.0; /// = Filter parameter
|
||||
}
|
||||
|
||||
public Test(string name, int itemNr, Procedure procedure)
|
||||
|
||||
@ -9,13 +9,15 @@ namespace TBF.Entities
|
||||
public class TransitionStep : IHasItemNr, IHasValves
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; } /// Order of the preparation step
|
||||
public virtual int Duration { get; set; } /// Duration in seconds
|
||||
public virtual string Message { get; set; } /// Message
|
||||
public virtual string ValvesOpen { get; set; } /// List of valves to be opened
|
||||
public virtual string ValvesClose { get; set; } /// List of valves to be closed
|
||||
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
public virtual string PumpWithFMPcts { get; set; } /// Power of FM controlled pumps in % separated by ';'
|
||||
public virtual int ItemNr { get; set; } /// Order of the preparation step
|
||||
public virtual int Duration { get; set; } /// Duration in seconds
|
||||
public virtual string Message { get; set; } /// Message
|
||||
public virtual StepCondition EndCondition { get; set; } /// Condition when transition step is finished (next to the duration)
|
||||
public virtual string Communication { get; set; } /// String specifying type of communication with water meters
|
||||
public virtual string ValvesOpen { get; set; } /// List of valves to be opened
|
||||
public virtual string ValvesClose { get; set; } /// List of valves to be closed
|
||||
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
public virtual string PumpWithFMPcts { get; set; } /// Power of FM controlled pumps in % separated by ';'
|
||||
|
||||
public virtual TransitionSequence TransitionSequence { get; set; }
|
||||
|
||||
@ -24,6 +26,7 @@ namespace TBF.Entities
|
||||
public TransitionStep()
|
||||
{
|
||||
Duration = 5; /// sec.
|
||||
EndCondition = (int)StepCondition.None;
|
||||
}
|
||||
|
||||
public TransitionStep(int itemNr, TransitionSequence sequence)
|
||||
@ -38,6 +41,8 @@ namespace TBF.Entities
|
||||
TransitionStep result = new TransitionStep(ItemNr, TransitionSequence);
|
||||
result.Duration = Duration;
|
||||
result.Message = Message;
|
||||
result.EndCondition = EndCondition;
|
||||
result.Communication = Communication;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
result.RegulValvesPct = RegulValvesPct;
|
||||
@ -51,6 +56,8 @@ namespace TBF.Entities
|
||||
result += indent + "ItemNr = " + ItemNr.ToString() + ", ";
|
||||
result += indent + "Duration = " + Duration.ToString() + ", ";
|
||||
result += indent + "Message = " + Message + ", ";
|
||||
result += indent + "EndCondition = " + EndCondition.ToString() + ", ";
|
||||
result += indent + "Communication = " + Communication + ", ";
|
||||
result += indent + "ValvesOpen = " + ValvesOpen.ToString() + ", ";
|
||||
result += indent + "ValvesClose = " + ValvesClose.ToString() + ", ";
|
||||
result += indent + "RegulValvesPct = " + RegulValvesPct.ToString() + ", ";
|
||||
|
||||
@ -246,6 +246,12 @@ namespace TBF.Entities
|
||||
return hashString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns 'true' when authentication data are valid for a power user.
|
||||
/// </summary>
|
||||
/// <param name="userName">User name</param>
|
||||
/// <param name="password">Password</param>
|
||||
/// <returns>true = authenticated, false = refused</returns>
|
||||
public static bool IsPowerUser(string userName, string password)
|
||||
{
|
||||
return (userName.Equals("milan") && password.Equals("napajedla")) ||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajik
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
@ -35,8 +36,10 @@ namespace TBF.Mappings
|
||||
Map(x => x.BenchPath);
|
||||
Map(x => x.OutputPath);
|
||||
Map(x => x.MetersPath);
|
||||
Map(x => x.TransitionStart);
|
||||
Map(x => x.TransitionEnd);
|
||||
Map(x => x.RelTransBefore);
|
||||
Map(x => x.RelTransBetween);
|
||||
Map(x => x.RelTransAfter);
|
||||
Map(x => x.TransitionAfter);
|
||||
HasMany(x => x.MoreParams)
|
||||
.Cascade.All();
|
||||
References(x => x.Procedure);
|
||||
|
||||
@ -14,6 +14,8 @@ namespace TBF.Mappings
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Duration);
|
||||
Map(x => x.Message);
|
||||
Map(x => x.EndCondition);
|
||||
Map(x => x.Communication);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
@ -640,8 +640,8 @@ namespace TBF
|
||||
lviProcess.SubItems.Add(test.BenchPath);
|
||||
lviProcess.SubItems.Add(test.OutputPath);
|
||||
lviProcess.SubItems.Add(test.MetersPath);
|
||||
lviProcess.SubItems.Add(string.IsNullOrEmpty(test.TransitionStart) ? "---" : test.TransitionStart);
|
||||
lviProcess.SubItems.Add(string.IsNullOrEmpty(test.TransitionEnd) ? "---" : test.TransitionEnd);
|
||||
lviProcess.SubItems.Add(string.IsNullOrEmpty(test.RelTransBefore) ? "---" : test.RelTransBefore);
|
||||
lviProcess.SubItems.Add(string.IsNullOrEmpty(test.TransitionAfter) ? "---" : test.TransitionAfter);
|
||||
|
||||
processListViewEx.Items.Add(lviProcess);
|
||||
|
||||
@ -757,11 +757,11 @@ namespace TBF
|
||||
}
|
||||
if ((processEditors[(int)ProcessClmn.TrnStart] as ComboBox).Items.Contains(lvi.SubItems[(int)ProcessClmn.TrnStart].Text))
|
||||
{
|
||||
entity.TransitionStart = lvi.SubItems[(int)ProcessClmn.TrnStart].Text.Equals("---") ? string.Empty : lvi.SubItems[(int)ProcessClmn.TrnStart].Text;
|
||||
entity.RelTransBefore = lvi.SubItems[(int)ProcessClmn.TrnStart].Text.Equals("---") ? string.Empty : lvi.SubItems[(int)ProcessClmn.TrnStart].Text;
|
||||
}
|
||||
if ((processEditors[(int)ProcessClmn.TrnStop] as ComboBox).Items.Contains(lvi.SubItems[(int)ProcessClmn.TrnStop].Text))
|
||||
{
|
||||
entity.TransitionEnd = lvi.SubItems[(int)ProcessClmn.TrnStop].Text.Equals("---") ? string.Empty : lvi.SubItems[(int)ProcessClmn.TrnStop].Text;
|
||||
entity.TransitionAfter = lvi.SubItems[(int)ProcessClmn.TrnStop].Text.Equals("---") ? string.Empty : lvi.SubItems[(int)ProcessClmn.TrnStop].Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.4.43.1")]
|
||||
[assembly: AssemblyFileVersion("1.4.43.1")]
|
||||
[assembly: AssemblyVersion("1.5.44.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.44.1")]
|
||||
|
||||
18
TestBenchFramework/Resources/Strings.Designer.cs
generated
18
TestBenchFramework/Resources/Strings.Designer.cs
generated
@ -393,6 +393,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Communication.
|
||||
/// </summary>
|
||||
internal static string Communication {
|
||||
get {
|
||||
return ResourceManager.GetString("Communication", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Component.
|
||||
/// </summary>
|
||||
@ -744,6 +753,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to End condition.
|
||||
/// </summary>
|
||||
internal static string End_Condition {
|
||||
get {
|
||||
return ResourceManager.GetString("End_Condition", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to End State.
|
||||
/// </summary>
|
||||
|
||||
@ -1048,4 +1048,10 @@
|
||||
<data name="Show_cycle_end_form" xml:space="preserve">
|
||||
<value>Show cycle end form</value>
|
||||
</data>
|
||||
<data name="End_Condition" xml:space="preserve">
|
||||
<value>End condition</value>
|
||||
</data>
|
||||
<data name="Communication" xml:space="preserve">
|
||||
<value>Communication</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -215,11 +215,20 @@ namespace TBF
|
||||
|
||||
using (var transaction = Session.BeginTransaction())
|
||||
{
|
||||
foreach (var transSeq in TransitionSequences) Session.SaveOrUpdate(transSeq);
|
||||
foreach (var vBnchSeq in VirtualBenchSequences) Session.SaveOrUpdate(vBnchSeq);
|
||||
try
|
||||
{
|
||||
foreach (var transSeq in TransitionSequences)
|
||||
Session.SaveOrUpdate(transSeq);
|
||||
foreach (var vBnchSeq in VirtualBenchSequences)
|
||||
Session.SaveOrUpdate(vBnchSeq);
|
||||
|
||||
try { transaction.Commit(); }
|
||||
catch { log.Error("Update of sequences in the database failed"); }
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception e2)
|
||||
{
|
||||
MessageBox.Show("Cannot save changes", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
log.ErrorFormat("Update of sequences in the database failed: {0}", e2.Message);
|
||||
}
|
||||
}
|
||||
|
||||
Program.LocalSettings.TransitionsDlgLeft = Location.X;
|
||||
|
||||
@ -21,6 +21,8 @@ namespace TBF.UiControls
|
||||
{
|
||||
Duration,
|
||||
Message,
|
||||
Condition,
|
||||
Communication,
|
||||
FixedColumnsCount,
|
||||
}
|
||||
readonly int fixedCount = (int)Column.FixedColumnsCount;
|
||||
@ -60,6 +62,8 @@ namespace TBF.UiControls
|
||||
///
|
||||
Columns.Add(Strings.Duration_s, 70 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Message, 100 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.End_Condition, 80 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Communication, 85 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
foreach (var vlv in parent.Valves)
|
||||
{
|
||||
if (vlv is BenchControl.GenericDevices.IPumpFM)
|
||||
@ -84,15 +88,29 @@ namespace TBF.UiControls
|
||||
///
|
||||
/// Prepare valve combo-boxes
|
||||
///
|
||||
editors = new Control[fixedCount + vCount + fmPumpCount + regvCount];
|
||||
editors = new Control[fixedCount + fmPumpCount + regvCount + vCount];
|
||||
|
||||
/// Duration
|
||||
editors[0] = new TextBox();
|
||||
parent.Controls.Add(editors[0]);
|
||||
editors[(int)Column.Duration] = new TextBox();
|
||||
parent.Controls.Add(editors[(int)Column.Duration]);
|
||||
|
||||
/// Message
|
||||
editors[1] = new TextBox();
|
||||
parent.Controls.Add(editors[1]);
|
||||
editors[(int)Column.Message] = new TextBox();
|
||||
parent.Controls.Add(editors[(int)Column.Message]);
|
||||
|
||||
/// End condition
|
||||
ComboBox condCombo = new ComboBox();
|
||||
condCombo.Items.Add("---");
|
||||
for (int i = 1; i < (int)Entities.StepCondition.Count; i++)
|
||||
{
|
||||
condCombo.Items.Add(((Entities.StepCondition)i).ToString());
|
||||
}
|
||||
editors[(int)Column.Condition] = condCombo;
|
||||
parent.Controls.Add(editors[(int)Column.Condition]);
|
||||
|
||||
/// Communication
|
||||
editors[(int)Column.Communication] = new TextBox();
|
||||
parent.Controls.Add(editors[(int)Column.Communication]);
|
||||
|
||||
/// FM controlled pumps
|
||||
for (int i = fixedCount; i < fixedCount + fmPumpCount; i++)
|
||||
@ -169,7 +187,24 @@ namespace TBF.UiControls
|
||||
if (e.DisplayText.Length >= 255)
|
||||
{
|
||||
// Message too long
|
||||
e.DisplayText = e.Item.Text;
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
else if (e.SubItem == (int)Column.Condition)
|
||||
{
|
||||
if (!((ComboBox)editors[(int)Column.Condition]).Items.Contains(e.DisplayText))
|
||||
{
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
else if (e.SubItem == (int)Column.Communication)
|
||||
{
|
||||
if (e.DisplayText.Length >= 255)
|
||||
{
|
||||
// Communication string too long
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
@ -224,6 +259,8 @@ namespace TBF.UiControls
|
||||
|
||||
ListViewItem lvi = new ListViewItem(step.Duration.ToString());
|
||||
lvi.SubItems.Add(string.IsNullOrEmpty(step.Message) ? string.Empty : step.Message);
|
||||
lvi.SubItems.Add((step.EndCondition == Entities.StepCondition.None) ? "---" : step.EndCondition.ToString());
|
||||
lvi.SubItems.Add(string.IsNullOrEmpty(step.Communication) ? string.Empty : step.Communication);
|
||||
|
||||
string[] fmPumpsStr = (step.PumpWithFMPcts != null) ? step.PumpWithFMPcts.Split(new char[] { ';' })
|
||||
: new string[0];
|
||||
@ -267,33 +304,53 @@ namespace TBF.UiControls
|
||||
{
|
||||
Entities.TransitionStep step = (Entities.TransitionStep)myItem;
|
||||
|
||||
///
|
||||
/// Duration
|
||||
///
|
||||
int duration;
|
||||
if (int.TryParse(lvi.Text, out duration) && duration > 0)
|
||||
{
|
||||
step.Duration = duration;
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.Text = step.Duration.ToString();
|
||||
}
|
||||
|
||||
///
|
||||
/// Message
|
||||
///
|
||||
if (lvi.SubItems[(int)Column.Message].Text.Length == 0)
|
||||
{
|
||||
step.Message = null;
|
||||
}
|
||||
step.Message = string.Empty;
|
||||
else
|
||||
{
|
||||
step.Message = lvi.SubItems[(int)Column.Message].Text;
|
||||
|
||||
///
|
||||
/// Condition
|
||||
///
|
||||
step.EndCondition = Entities.StepCondition.None; /// When item text is "---" or a wrong value
|
||||
for (int cond = 1; cond < (int)Entities.StepCondition.Count; cond++)
|
||||
{
|
||||
if (lvi.SubItems[(int)Column.Condition].Text.Equals(((Entities.StepCondition)cond).ToString()))
|
||||
{
|
||||
step.EndCondition = (Entities.StepCondition)cond;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Communication string
|
||||
///
|
||||
if (lvi.SubItems[(int)Column.Communication].Text.Length == 0)
|
||||
step.Communication = string.Empty;
|
||||
else
|
||||
step.Communication = lvi.SubItems[(int)Column.Communication].Text;
|
||||
|
||||
|
||||
/// Required for pumps with FM and valves
|
||||
string valvesOpen = string.Empty;
|
||||
string valvesClose = string.Empty;
|
||||
string regulValvesPct = string.Empty;
|
||||
string fmPumpsPcts = string.Empty;
|
||||
|
||||
///
|
||||
/// Pumps with FM control
|
||||
///
|
||||
string fmPumpsPcts = string.Empty;
|
||||
int i = 0;
|
||||
foreach (var valve in parent.Valves)
|
||||
{
|
||||
@ -328,8 +385,12 @@ namespace TBF.UiControls
|
||||
}
|
||||
}
|
||||
}
|
||||
step.PumpWithFMPcts = fmPumpsPcts;
|
||||
|
||||
///
|
||||
/// Regulation valves
|
||||
///
|
||||
string regulValvesPct = string.Empty;
|
||||
for (int k = fixedCount + fmPumpCount; k < fixedCount + fmPumpCount + regvCount; k++)
|
||||
{
|
||||
if (regulValvesPct.Length > 0) regulValvesPct += ";";
|
||||
@ -340,8 +401,11 @@ namespace TBF.UiControls
|
||||
regulValvesPct += lvi.SubItems[k].Text;
|
||||
}
|
||||
}
|
||||
step.RegulValvesPct = regulValvesPct;
|
||||
|
||||
///
|
||||
/// Valves
|
||||
///
|
||||
for (int j = 0, k = 0; j < vCount; j++)
|
||||
{
|
||||
if (!(parent.Valves[j] is BenchControl.GenericDevices.IPumpFM))
|
||||
@ -359,9 +423,6 @@ namespace TBF.UiControls
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
step.PumpWithFMPcts = fmPumpsPcts;
|
||||
step.RegulValvesPct = regulValvesPct;
|
||||
step.ValvesOpen = valvesOpen;
|
||||
step.ValvesClose = valvesClose;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user