Bridge.OnFlowDetected(...), Config.Entities.Component.Parameters mapped to VARCHAR(12000), ver. 3.9.2125
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Config.Entities;
|
||||
@@ -19,7 +19,7 @@ namespace Config.Mappings
|
||||
Map(x => x.LogLevel);
|
||||
Map(x => x.Parameters)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
.CustomSqlType("varchar(12000)");
|
||||
HasMany(x => x.Corrections)
|
||||
.OrderBy("Measurement")
|
||||
.Cascade.All();
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.9.2123.0")]
|
||||
[assembly: AssemblyFileVersion("3.9.2123.0")]
|
||||
[assembly: AssemblyVersion("3.9.2125.0")]
|
||||
[assembly: AssemblyFileVersion("3.9.2125.0")]
|
||||
|
||||
@@ -423,9 +423,11 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
|
||||
|
||||
/// Update test results with the test flow determined from the detected switching flow
|
||||
double Qave_lps = (qfromAfterDetection + qtoAfterDetection) / 7.2;
|
||||
double testTimeFromDetectedFlow = test.Volume / Qave_lps; /// Test volume wont be changed
|
||||
double testTimeFromDetectedFlow = test.Volume / Qave_lps; /// Test volume wont be changed
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
||||
Bridge.OnFlowDetected(this, new FlowDetectedEventArgs(detectedFlow, qfromAfterDetection,
|
||||
qtoAfterDetection, testTimeFromDetectedFlow, 0));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
||||
|
||||
if (goBackToInitFlow)
|
||||
{
|
||||
|
||||
@@ -1941,6 +1941,7 @@
|
||||
<Compile Include="UiBridge\CompoundDetectionEventArgs.cs" />
|
||||
<Compile Include="UiBridge\EmergencyStopEventArgs.cs" />
|
||||
<Compile Include="UiBridge\Enums.cs" />
|
||||
<Compile Include="UiBridge\FlowDetectedEventArgs.cs" />
|
||||
<Compile Include="UiBridge\ImageEventArgs.cs" />
|
||||
<Compile Include="UiBridge\EventEventArgs.cs" />
|
||||
<Compile Include="UiBridge\MeasurementRequestArgs.cs" />
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace TBF.UI.Process
|
||||
Count
|
||||
}
|
||||
|
||||
int qfromIx;
|
||||
int qtoIx;
|
||||
int testtimeIx;
|
||||
int startMassIx;
|
||||
int massIx;
|
||||
int volumeIx;
|
||||
@@ -69,6 +72,16 @@ namespace TBF.UI.Process
|
||||
catch (Exception e) { log.ErrorFormat("ProcessTabPageCtrl.OnTestSelected() failed: {0}", e.Message); }
|
||||
};
|
||||
|
||||
Bridge.FlowDetectedHandler += delegate (object sender, FlowDetectedEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (InvokeRequired) Invoke(new EventHandler<FlowDetectedEventArgs>(OnFlowDetected), sender, args);
|
||||
else OnFlowDetected(sender, args);
|
||||
}
|
||||
catch (Exception e) { log.ErrorFormat("ProcessTabPageCtrl.OnFlowDetected() failed: {0}", e.Message); }
|
||||
};
|
||||
|
||||
Bridge.StateMachineTickHandler += delegate(object sndr, UiBridge.StateMachineTickEventArgs args)
|
||||
{
|
||||
if (InvokeRequired) { Invoke(new EventHandler<UiBridge.StateMachineTickEventArgs>(OnStateMachineTick), sndr, args); }
|
||||
@@ -203,52 +216,57 @@ namespace TBF.UI.Process
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Repetition,
|
||||
args != null ? string.Format("{0} / {1}", args.RepetitionNr, args.Test.Repeats) : "---",
|
||||
string.Empty
|
||||
string.Empty,
|
||||
}));
|
||||
|
||||
double qfrom = (args != null) ? args.Test.QfromM3ph() : 0;
|
||||
qfromIx = lv.Items.Count;
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Q_from,
|
||||
args != null ? Units.ConvertTo(ProcessData.FlowUnit, args.Test.QfromM3ph()).ToString() : "---",
|
||||
ProcessData.FlowUnit.ToDescription()
|
||||
(qfrom > 0) ? Units.ConvertTo(ProcessData.FlowUnit, qfrom).ToString() : "---",
|
||||
(ProcessData.FlowUnit == Unit.None ? Unit.m3ph : ProcessData.FlowUnit).ToDescription(),
|
||||
}));
|
||||
|
||||
double qto = (args != null) ? args.Test.QtoM3ph() : 0;
|
||||
qtoIx = lv.Items.Count;
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Q_to,
|
||||
args != null ? Units.ConvertTo(ProcessData.FlowUnit, args.Test.QtoM3ph()).ToString() : "---",
|
||||
ProcessData.FlowUnit.ToDescription()
|
||||
(qto > 0) ? Units.ConvertTo(ProcessData.FlowUnit, qto).ToString() : "---",
|
||||
(ProcessData.FlowUnit == Unit.None ? Unit.m3ph : ProcessData.FlowUnit).ToDescription(),
|
||||
}));
|
||||
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Target_volume,
|
||||
args != null ? Units.ConvertTo(ProcessData.VolumeUnit, args.Test.Volume).ToString() : "---",
|
||||
ProcessData.VolumeUnit.ToDescription()
|
||||
(ProcessData.VolumeUnit == Unit.None ? Unit.l : ProcessData.VolumeUnit).ToDescription(),
|
||||
}));
|
||||
|
||||
testtimeIx = lv.Items.Count;
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Test_time,
|
||||
args != null ? args.Test.TestTime.ToString() : "---",
|
||||
Unit.s.ToDescription()
|
||||
Unit.s.ToDescription(),
|
||||
}));
|
||||
|
||||
startMassIx = lv.Items.Count;
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Start_mass,
|
||||
"---",
|
||||
ProcessData.MassUnit.ToDescription()
|
||||
(ProcessData.MassUnit == Unit.None ? Unit.kg : ProcessData.MassUnit).ToDescription(),
|
||||
}));
|
||||
|
||||
massIx = lv.Items.Count;
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Mass,
|
||||
"---",
|
||||
ProcessData.MassUnit.ToDescription()
|
||||
(ProcessData.MassUnit == Unit.None ? Unit.kg : ProcessData.MassUnit).ToDescription(),
|
||||
}));
|
||||
|
||||
volumeIx = lv.Items.Count;
|
||||
lv.Items.Add(new ListViewItem(new string[] {
|
||||
Strings.Volume,
|
||||
"---",
|
||||
ProcessData.VolumeUnit.ToDescription()
|
||||
(ProcessData.VolumeUnit == Unit.None ? Unit.l : ProcessData.VolumeUnit).ToDescription(),
|
||||
}));
|
||||
|
||||
refErrorIx = lv.Items.Count;
|
||||
@@ -1078,6 +1096,18 @@ namespace TBF.UI.Process
|
||||
compoundDetectionTextBox.AppendText(args.Message + Environment.NewLine);
|
||||
}
|
||||
|
||||
void OnFlowDetected(object sender, FlowDetectedEventArgs args)
|
||||
{
|
||||
if (args != null && testDataListView.Items.Count > testtimeIx)
|
||||
{
|
||||
double qfrom = Units.ConvertTo(ProcessData.FlowUnit, args.Qfrom);
|
||||
testDataListView.Items[qfromIx].SubItems[1].Text = qfrom.ToString(Common.Utils.SignificantDigitsToFmt(qfrom, 3));
|
||||
double qto = Units.ConvertTo(ProcessData.FlowUnit, args.Qto);
|
||||
testDataListView.Items[qtoIx].SubItems[1].Text = qto.ToString(Common.Utils.SignificantDigitsToFmt(qto, 3));
|
||||
testDataListView.Items[testtimeIx].SubItems[1].Text = args.TestTime.ToString("F1");
|
||||
}
|
||||
}
|
||||
|
||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||
{
|
||||
if (args.TestRslt == null || ProcessData.RegisterReaders == null || ProcessData.BatchRslts == null
|
||||
|
||||
+18
-4
@@ -77,10 +77,24 @@ namespace TBF.UiBridge
|
||||
public static event EventHandler<TestSelectedEventArgs> TestSelectedHandler;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called from the state machine when progress bars need to be updated.
|
||||
/// </summary>
|
||||
public static void OnTestProgress(object sender, TestProgressEventArgs data)
|
||||
/// <summary>
|
||||
/// Called from the state machine when a test is selected and UI needs to be updated.
|
||||
/// </summary>
|
||||
public static void OnFlowDetected(object sender, FlowDetectedEventArgs data)
|
||||
{
|
||||
TBF.Rig.Sequences.ProcessData.ClearProcessValues();
|
||||
|
||||
if (FlowDetectedHandler == null) return;
|
||||
try { FlowDetectedHandler(sender, data); }
|
||||
catch (Exception e) { log.Error("FlowDetectedHandler(...) failed", e); }
|
||||
}
|
||||
public static event EventHandler<FlowDetectedEventArgs> FlowDetectedHandler;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called from the state machine when progress bars need to be updated.
|
||||
/// </summary>
|
||||
public static void OnTestProgress(object sender, TestProgressEventArgs data)
|
||||
{
|
||||
if (TestProgressHandler == null) return;
|
||||
try { TestProgressHandler(sender, data); }
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
///
|
||||
/// Copyright (c) 2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF.UiBridge
|
||||
{
|
||||
public class FlowDetectedEventArgs : EventArgs
|
||||
{
|
||||
public double Qdetected; /// Detected from in [m3/h]
|
||||
public double Qfrom; /// Lower limit for the test flow in [m3/h]
|
||||
public double Qto; /// Upper limit for the test flow in [m3/h]
|
||||
public double TestTime; /// Estimated test time in [s]
|
||||
public int TotalPulses; /// Total reference meter pulses
|
||||
|
||||
public FlowDetectedEventArgs(double qDetected, double qFrom, double qTo, double testTime, int totalPulses)
|
||||
{
|
||||
Qdetected = qDetected;
|
||||
Qfrom = qFrom;
|
||||
Qto = qTo;
|
||||
TestTime = testTime;
|
||||
TotalPulses = totalPulses;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user