Prepared: PID coefficient of the output path is ready to be used,
and not the regul.valve parameter. See // TODO PID: ... in source code. Database: 'PidCoef' float should be added to 'OutputPath' after col.'FlowMeter'
This commit is contained in:
parent
0160dc965d
commit
de90a4638a
@ -50,7 +50,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
{
|
||||
if (args.Command == CfgChangeCmd.CfgChange)
|
||||
{
|
||||
RegulValveCfg.PidCoef = tmpcfg.PidCoef;
|
||||
RegulValveCfg.PidCoef = tmpcfg.PidCoef; // TODO PID: Remove
|
||||
RegulValveCfg.StableTimeMs = tmpcfg.StableTimeMs;
|
||||
RegulValveCfg.FlowStableSec = tmpcfg.FlowStableSec;
|
||||
}
|
||||
@ -102,12 +102,13 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <param name="flowMeter">Flowmeter component</param>
|
||||
/// <param name="requiredFlowLo">Lower limit of the required flow [m3/h]</param>
|
||||
/// <param name="requiredFlowHi">Higher limit of the required flow [m3/h]</param>
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="pidCoef">PID coefficient (float)</param>
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout)
|
||||
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow, int timeout)
|
||||
{
|
||||
return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout);
|
||||
return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -120,9 +121,9 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout, float filterConstant)
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow, int timeout, float filterConstant)
|
||||
{
|
||||
return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, true);
|
||||
return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -17,7 +17,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
public int Idx1; /// 1..7
|
||||
public int DacValueClosed; /// 0..1023
|
||||
public int DacValueOpen; /// 0..1023
|
||||
public int PidCoef; /// 1..100
|
||||
public int PidCoef; /// 1..100 // TODO PID: Remove
|
||||
public int StableTimeMs; /// 200..1500 ms
|
||||
public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions
|
||||
public int FlowStableSec; /// 0..60 sec
|
||||
@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
Idx1 = 1;
|
||||
DacValueClosed = 100;
|
||||
DacValueOpen = 500;
|
||||
PidCoef = 20;
|
||||
PidCoef = 20; // TODO PID: Remove
|
||||
StableTimeMs = 500;
|
||||
StoredPositionReuse = false;
|
||||
FlowStableSec = 5;
|
||||
@ -55,7 +55,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
Idx1,
|
||||
DacValueClosed,
|
||||
DacValueOpen,
|
||||
PidCoef,
|
||||
PidCoef, // TODO PID: Remove
|
||||
StableTimeMs,
|
||||
StoredPositionReuse,
|
||||
FlowStableSec);
|
||||
|
||||
@ -72,7 +72,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
positionTextBox.Text = config.Idx1.ToString();
|
||||
dacClosedTextBox.Text = config.DacValueClosed.ToString();
|
||||
dacOpenTextBox.Text = config.DacValueOpen.ToString();
|
||||
pidCoefTextBox.Text = config.PidCoef.ToString();
|
||||
pidCoefTextBox.Text = config.PidCoef.ToString(); // TODO PID: Remove
|
||||
stableTimeTextBox.Text = config.StableTimeMs.ToString();
|
||||
storedPosReuseCheckBox.Checked = config.StoredPositionReuse;
|
||||
flowStableSecTextBox.Text = config.FlowStableSec.ToString();
|
||||
@ -180,6 +180,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
// TODO PID: Remove
|
||||
tmp = int.Parse(pidCoefTextBox.Text);
|
||||
if (config.PidCoef != tmp)
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(SetFlowOp));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("SetFlowOp({0},{1},{2})", regulValve.Name, reqFlowLo, reqFlowHi);
|
||||
return string.Format("SetFlowOp({0}, Qfrom={1}, Qto={2}, PID={3})", regulValve.Name, reqFlowLo, reqFlowHi, pidCoef);
|
||||
}
|
||||
|
||||
/// Set by the constructor
|
||||
@ -22,6 +22,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
readonly float reqFlowLo;
|
||||
readonly float reqFlowHi;
|
||||
readonly float reqFlowAve;
|
||||
readonly float pidCoef;
|
||||
readonly int timeout;
|
||||
readonly bool leaveMeasurementRunning;
|
||||
|
||||
@ -56,11 +57,13 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <param name="flowMeter">Flowmeter component</param>
|
||||
/// <param name="requiredFlowLo">Lower limit of the flow to be achieved in [m3/h]</param>
|
||||
/// <param name="requiredFlowHi">Upper limit of the flow to be achieved in [m3/h]</param>
|
||||
/// <param name="pidCoef">PID coefficient (float)</param>
|
||||
/// <param name="timeout">Timeout for the flow setting in [s]</param>
|
||||
/// <param name="leaveMeasurementRunning">true = Leave the measurement running after op. stop</param>
|
||||
/// <remarks>Only Elde.Valve flow are used, other flow on the lists are ignored</remarks>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regulValve, IFlowMeter flowMeter,
|
||||
float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout, bool leaveMeasurementRunning)
|
||||
float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow,
|
||||
int timeout, bool leaveMeasurementRunning)
|
||||
{
|
||||
if (controlBoard == null) throw new ArgumentNullException("ctrlBoard");
|
||||
this.controlBoard = controlBoard;
|
||||
@ -87,6 +90,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
this.reqFlowLo = requiredFlowLo;
|
||||
this.reqFlowHi = requiredFlowHi;
|
||||
this.reqFlowAve = (reqFlowLo + reqFlowHi) / 2.0f;
|
||||
this.pidCoef = pidCoef;
|
||||
this.measuredFlow = measuredFlow;
|
||||
|
||||
this.timeout = timeout;
|
||||
@ -101,8 +105,8 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter,
|
||||
float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, false)
|
||||
float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow, int timeout)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -111,8 +115,8 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter,
|
||||
float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, int.MaxValue, false)
|
||||
float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, pidCoef, requiredFlowHi, measuredFlow, int.MaxValue, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -174,6 +178,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
|
||||
TestMethods tm = 0;
|
||||
StopDevs sd = 0;
|
||||
// TODO PID: Replace 'regulValve.RegulValveCfg.PidCoef' by operation parameter 'pidCoef'
|
||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route, int.MaxValue, tm,
|
||||
0.0f, regulValve.RegulValveCfg.PidCoef, 0, sd);
|
||||
}
|
||||
|
||||
@ -23,10 +23,12 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// </summary>
|
||||
/// <param name="requiredFlowLo">Lower limit of the required flow [m3/h]</param>
|
||||
/// <param name="requiredFlowHi">Higher limit of the required flow [m3/h]</param>
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="pidCoef">PID coefficient (float)</param>
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
IOperation SetFlowOp(IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout);
|
||||
IOperation SetFlowOp(IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi,
|
||||
float pidCoef, FloatBox measuredFlow, int timeout);
|
||||
|
||||
/// <summary>
|
||||
/// Operation to set the water flow within tolerances. Leave the measurement running.
|
||||
@ -34,11 +36,13 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// </summary>
|
||||
/// <param name="requiredFlowLo">Lower limit of the required flow [m3/h]</param>
|
||||
/// <param name="requiredFlowHi">Higher limit of the required flow [m3/h]</param>
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="pidCoef">PID coefficient (float)</param>
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <param name="filter">Passed to SendCommand() as argument filterContant</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
IOperation SetFlowAndMeasureOp(IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout, float filter);
|
||||
IOperation SetFlowAndMeasureOp(IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi,
|
||||
float pidCoef, FloatBox measuredFlow, int timeout, float filter);
|
||||
|
||||
/// <summary>
|
||||
/// Operation to set the regulation valve to a required position
|
||||
|
||||
@ -11,6 +11,7 @@ namespace TBF.BenchControl
|
||||
public float Qto;
|
||||
public IRegulValve RegulValve;
|
||||
public IFlowMeter FlowMeter;
|
||||
public float PidCoef;
|
||||
public IValve StartValve;
|
||||
public IDiverter Diverter;
|
||||
public ITempMeter TempDiv;
|
||||
@ -26,6 +27,7 @@ namespace TBF.BenchControl
|
||||
Name = name;
|
||||
ValvesOpen = new List<IValve>();
|
||||
ValvesClose = new List<IValve>();
|
||||
PidCoef = 10.0f; /// TODO PID: remove
|
||||
}
|
||||
|
||||
/// Constructor from data entity
|
||||
@ -36,6 +38,7 @@ namespace TBF.BenchControl
|
||||
Qto = entity.Qto;
|
||||
RegulValve = (IRegulValve)TbfComponents.FindComponent(entity.RegulValve, components);
|
||||
FlowMeter = (IFlowMeter)TbfComponents.FindComponent(entity.FlowMeter, components);
|
||||
PidCoef = entity.PidCoef;
|
||||
StartValve = (IValve)TbfComponents.FindComponent(entity.StartValve, components);
|
||||
Diverter = (IDiverter)TbfComponents.FindComponent(entity.Diverter, components);
|
||||
TempDiv = (ITempMeter)TbfComponents.FindComponent(entity.TempDiv, components);
|
||||
|
||||
@ -58,7 +58,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
//--------------------------------
|
||||
State.Create("RoiDetection : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -125,7 +125,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
//--------------------------------
|
||||
State.Create("CombinedMeters : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -138,7 +138,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create("CombinedWithDetection : Set the initial flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600, (float)test.TolerRed)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600, (float)test.TolerRed)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -323,7 +323,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create("CombinedWithDetection : Switching flow detected, going back")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -344,7 +344,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
//State.Create("set_RV_position",
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, refFlow, 600)) /// timeout = 10 sec.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, outPath.PidCoef, refFlow, 600)) /// timeout = 10 sec.
|
||||
//.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -123,7 +123,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
//--------------------------------
|
||||
State.Create("FixedStartMassCollection : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -120,7 +120,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
//--------------------------------
|
||||
State.Create("FlyingStart : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -120,7 +120,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//--------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -120,7 +120,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
//--------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -12,6 +12,7 @@ namespace TBF.Entities
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string RegulValve { get; set; }
|
||||
public virtual string FlowMeter { get; set; }
|
||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||
public virtual string StartValve { get; set; }
|
||||
public virtual string Diverter { get; set; }
|
||||
public virtual string TempDiv { get; set; }
|
||||
@ -26,7 +27,8 @@ namespace TBF.Entities
|
||||
|
||||
public OutputPath()
|
||||
{
|
||||
}
|
||||
PidCoef = 10.0f; /// TODO PID: remove
|
||||
}
|
||||
|
||||
public OutputPath(string name, int itemNr)
|
||||
: this()
|
||||
@ -42,6 +44,7 @@ namespace TBF.Entities
|
||||
Qto = path.Qto;
|
||||
RegulValve = (path.RegulValve != null) ? path.RegulValve.Cfg.Name : null;
|
||||
FlowMeter = (path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : null;
|
||||
PidCoef = path.PidCoef;
|
||||
StartValve = (path.StartValve != null) ? path.StartValve.Cfg.Name : null;
|
||||
Diverter = (path.Diverter != null) ? path.Diverter.Cfg.Name : null;
|
||||
TempDiv = (path.TempDiv != null) ? path.TempDiv.Cfg.Name : null;
|
||||
@ -74,6 +77,7 @@ namespace TBF.Entities
|
||||
result.Qto = Qto;
|
||||
result.RegulValve = RegulValve;
|
||||
result.FlowMeter = FlowMeter;
|
||||
result.PidCoef = PidCoef;
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
|
||||
@ -14,6 +14,7 @@ namespace TBF.Mappings
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.RegulValve);
|
||||
Map(x => x.FlowMeter);
|
||||
//Map(x => x.PID); /// TODO PID: enable
|
||||
Map(x => x.StartValve);
|
||||
Map(x => x.Diverter);
|
||||
Map(x => x.TempDiv);
|
||||
|
||||
18
TestBenchFramework/Resources/Strings.Designer.cs
generated
18
TestBenchFramework/Resources/Strings.Designer.cs
generated
@ -726,6 +726,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Flowmeter.
|
||||
/// </summary>
|
||||
internal static string Flowmeter {
|
||||
get {
|
||||
return ResourceManager.GetString("Flowmeter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Get mass of water in the tank.
|
||||
/// </summary>
|
||||
@ -1203,6 +1212,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to PID.
|
||||
/// </summary>
|
||||
internal static string PID {
|
||||
get {
|
||||
return ResourceManager.GetString("PID", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please change the following settings:.
|
||||
/// </summary>
|
||||
|
||||
@ -780,4 +780,7 @@
|
||||
<data name="MoreBtnText" xml:space="preserve">
|
||||
<value>mehr</value>
|
||||
</data>
|
||||
<data name="Flowmeter" xml:space="preserve">
|
||||
<value>Durchflussmesser</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -874,4 +874,10 @@
|
||||
<data name="Changes_will_be_lost_Do_you_want_to_proceed" xml:space="preserve">
|
||||
<value>Changes will be lost. Do you want to proceed?</value>
|
||||
</data>
|
||||
<data name="PID" xml:space="preserve">
|
||||
<value>PID</value>
|
||||
</data>
|
||||
<data name="Flowmeter" xml:space="preserve">
|
||||
<value>Flowmeter</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -21,7 +21,8 @@ namespace TBF.UiControls
|
||||
Qfrom,
|
||||
Qto,
|
||||
RegulValve,
|
||||
Ref,
|
||||
RefFlowmtr,
|
||||
PidCoef,
|
||||
StartValve,
|
||||
Div,
|
||||
Tdiv,
|
||||
@ -60,12 +61,13 @@ namespace TBF.UiControls
|
||||
Columns.Add(Strings.Q_from_m3h, (ls.OutputColumnCount > 1) ? ls.OutputColumnWidths[1] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Q_to_m3h, (ls.OutputColumnCount > 2) ? ls.OutputColumnWidths[2] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Reg_valve, (ls.OutputColumnCount > 3) ? ls.OutputColumnWidths[3] : 80 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Reference, (ls.OutputColumnCount > 4) ? ls.OutputColumnWidths[4] : 85 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.StartValve, (ls.OutputColumnCount > 5) ? ls.OutputColumnWidths[5] : 80 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Diverter, (ls.OutputColumnCount > 6) ? ls.OutputColumnWidths[6] : 60 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.T_div, (ls.OutputColumnCount > 7) ? ls.OutputColumnWidths[7] : 70 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Balance, (ls.OutputColumnCount > 8) ? ls.OutputColumnWidths[8] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Emptying_valve, (ls.OutputColumnCount > 9) ? ls.OutputColumnWidths[9] : 80 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Flowmeter, (ls.OutputColumnCount > 4) ? ls.OutputColumnWidths[4] : 85 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.PID, (ls.OutputColumnCount > 5) ? ls.OutputColumnWidths[5] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.StartValve, (ls.OutputColumnCount > 6) ? ls.OutputColumnWidths[6] : 80 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Diverter, (ls.OutputColumnCount > 7) ? ls.OutputColumnWidths[7] : 60 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.T_div, (ls.OutputColumnCount > 8) ? ls.OutputColumnWidths[8] : 70 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Balance, (ls.OutputColumnCount > 9) ? ls.OutputColumnWidths[9] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Emptying_valve, (ls.OutputColumnCount > 10)? ls.OutputColumnWidths[10]: 80 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
int clmn = (int)Column.FixedColumnsCount;
|
||||
foreach (var vlv in parent.Valves)
|
||||
{
|
||||
@ -107,15 +109,16 @@ namespace TBF.UiControls
|
||||
|
||||
editors = new Control[fixedColumnsCount + 64];
|
||||
///
|
||||
editors[(int)Column.Name] = new TextBox(); /// Name
|
||||
editors[(int)Column.Qfrom] = new TextBox(); /// Q_from
|
||||
editors[(int)Column.Qto] = new TextBox(); /// Q_to
|
||||
editors[(int)Column.Name] = new TextBox(); /// Name
|
||||
editors[(int)Column.Qfrom] = new TextBox(); /// Q_from
|
||||
editors[(int)Column.Qto] = new TextBox(); /// Q_to
|
||||
editors[(int)Column.RegulValve] = regulValveComboBox;
|
||||
editors[(int)Column.Ref] = flowMeterComboBox;
|
||||
editors[(int)Column.StartValve] = startValveComboBox;
|
||||
editors[(int)Column.Div] = diverterComboBox;
|
||||
editors[(int)Column.Tdiv] = tempMeterDivComboBox;
|
||||
editors[(int)Column.Scale] = balanceComboBox;
|
||||
editors[(int)Column.RefFlowmtr] = flowMeterComboBox;
|
||||
editors[(int)Column.PidCoef] = new TextBox(); /// PID
|
||||
editors[(int)Column.StartValve] = startValveComboBox;
|
||||
editors[(int)Column.Div] = diverterComboBox;
|
||||
editors[(int)Column.Tdiv] = tempMeterDivComboBox;
|
||||
editors[(int)Column.Scale] = balanceComboBox;
|
||||
editors[(int)Column.EmptyValve] = emptyValveComboBox;
|
||||
/// Prepare valve combo-boxes (max. 64 valves)
|
||||
for (int i = 0; i < 64; i++)
|
||||
@ -158,6 +161,7 @@ namespace TBF.UiControls
|
||||
lvi.SubItems.Add(path.Qto.ToString());
|
||||
lvi.SubItems.Add((path.RegulValve != null) ? path.RegulValve.Cfg.Name : "---");
|
||||
lvi.SubItems.Add((path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : "---");
|
||||
lvi.SubItems.Add(path.PidCoef.ToString("F1"));
|
||||
lvi.SubItems.Add((path.StartValve != null) ? path.StartValve.Cfg.Name : "---");
|
||||
lvi.SubItems.Add((path.Diverter != null) ? path.Diverter.Cfg.Name : "---");
|
||||
lvi.SubItems.Add((path.TempDiv != null) ? path.TempDiv.Cfg.Name : "---");
|
||||
@ -203,8 +207,13 @@ namespace TBF.UiControls
|
||||
entity.Qto = Qto;
|
||||
|
||||
entity.RegulValve = lvi.SubItems[(int)Column.RegulValve].Text.Equals("---") ? null : lvi.SubItems[(int)Column.RegulValve].Text;
|
||||
entity.FlowMeter = lvi.SubItems[(int)Column.Ref].Text.Equals("---") ? null : lvi.SubItems[(int)Column.Ref].Text;
|
||||
entity.StartValve = lvi.SubItems[(int)Column.StartValve].Text.Equals("---") ? null : lvi.SubItems[(int)Column.StartValve].Text;
|
||||
entity.FlowMeter = lvi.SubItems[(int)Column.RefFlowmtr].Text.Equals("---") ? null : lvi.SubItems[(int)Column.RefFlowmtr].Text;
|
||||
|
||||
float pid;
|
||||
allOk &= Utils.TryParseSFloat(lvi.SubItems[(int)Column.PidCoef].Text, out pid);
|
||||
entity.PidCoef = pid;
|
||||
|
||||
entity.StartValve = lvi.SubItems[(int)Column.StartValve].Text.Equals("---") ? null : lvi.SubItems[(int)Column.StartValve].Text;
|
||||
entity.Diverter = lvi.SubItems[(int)Column.Div].Text.Equals("---") ? null : lvi.SubItems[(int)Column.Div].Text;
|
||||
entity.TempDiv = lvi.SubItems[(int)Column.Tdiv].Text.Equals("---") ? null : lvi.SubItems[(int)Column.Tdiv].Text;
|
||||
entity.Balance = lvi.SubItems[(int)Column.Scale].Text.Equals("---") ? null : lvi.SubItems[(int)Column.Scale].Text;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user