(1) DataEntry.iPerl.CycleBeginningForm displays iPerl dir. (2) iPerlCommFrm: CalLNA logged ok (3) FlyStMassCollProlonged and SmryResults modif, ver. 2.18.1067

This commit is contained in:
Milan Hanajik 2018-11-15 12:39:29 +01:00
parent 89eddaa3c2
commit 31a684f03a
16 changed files with 242 additions and 163 deletions

View File

@ -25,7 +25,8 @@ namespace Results.Entities
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; }
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.

View File

@ -31,49 +31,59 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.orderGroupBox.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.TabStop = false;
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.Name = "orderComboBox";
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.orderGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.orderGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.TabStop = false;
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.Name = "orderComboBox";
//
// pictureBox
//
resources.ApplyResources(this.pictureBox, "pictureBox");
this.pictureBox.Name = "pictureBox";
this.pictureBox.TabStop = false;
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.pictureBox);
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.orderGroupBox.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
}
@ -82,5 +92,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox orderGroupBox;
private System.Windows.Forms.ComboBox orderComboBox;
private System.Windows.Forms.PictureBox pictureBox;
}
}

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
using System.Drawing;
namespace TBF.BenchControl.DataEntry.iPerl
{
@ -15,6 +16,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// <summary> Number of water meters </summary>
public readonly int WaterMetersCount;
public readonly bool reversedDirection;
/// To be retrieved after the form is closed
public string PurchaseOrder;
@ -41,10 +43,11 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
public CycleBeginningForm(int waterMetersCount, bool reversedDirection)
: this()
{
this.WaterMetersCount = waterMetersCount;
this.reversedDirection = reversedDirection;
SNText = null;
Disabled = null;
}
@ -56,6 +59,14 @@ namespace TBF.BenchControl.DataEntry.iPerl
orderGroupBox.Text = Strings.Purchase_order;
okButton.Text = Strings.OkBtnText;
PrepareOrderCombo(orderComboBox);
if (reversedDirection)
{
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir.jpg", Program.ExecutableDir, true));
}
else
{
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\forward_dir.jpg", Program.ExecutableDir, true));
}
}
/// <summary>

View File

@ -144,13 +144,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="orderComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>90, 31</value>
<value>90, 32</value>
</data>
<data name="orderComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>376, 31</value>
<value>432, 31</value>
</data>
<data name="orderComboBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -174,7 +174,7 @@
<value>28, 12</value>
</data>
<data name="orderGroupBox.Size" type="System.Drawing.Size, System.Drawing">
<value>537, 82</value>
<value>565, 82</value>
</data>
<data name="orderGroupBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -192,6 +192,27 @@
<value>$this</value>
</data>
<data name="&gt;&gt;orderGroupBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="pictureBox.Location" type="System.Drawing.Point, System.Drawing">
<value>28, 118</value>
</data>
<data name="pictureBox.Size" type="System.Drawing.Size, System.Drawing">
<value>711, 497</value>
</data>
<data name="pictureBox.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;pictureBox.Name" xml:space="preserve">
<value>pictureBox</value>
</data>
<data name="&gt;&gt;pictureBox.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;pictureBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -204,7 +225,7 @@
<value>True</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>801, 119</value>
<value>769, 639</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Batch data</value>

View File

@ -124,7 +124,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
///
void OpenBeginningDlg(EntryForm myRef)
{
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount, myRef.entryFormCfg.ReversedDirection);
modelessDlg.Show();
}
///

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -20,6 +20,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// Serialized parameters
///
public bool ShowCycleEndForm;
public bool ReversedDirection;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
@ -27,6 +28,8 @@ namespace TBF.BenchControl.DataEntry.iPerl
Name = "DataEntry-iPerl";
ParentName = string.Empty;
ShowCycleEndForm = false;
ReversedDirection = false;
}
public EntryFormCfg(IComponentFactory factory)
@ -37,7 +40,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
public string ToString(int i)
{
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm);
return string.Format("Name={0}, ShowEndForm={1}, ReversedDir={2}", Name, ShowCycleEndForm, ReversedDirection);
}
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@ -50,12 +50,14 @@ namespace TBF.BenchControl.DataEntry.iPerl
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
reversedIperlDirectionCheckBox.Checked = config.ReversedDirection;
}
public void Unlock()
{
nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true;
reversedIperlDirectionCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@ -72,6 +74,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
config.ReversedDirection = reversedIperlDirectionCheckBox.Checked;
return flags;
}

View File

@ -31,62 +31,75 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// </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.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(131, 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(32, 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(128, 32);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// showCycleEndFormCheckBox
//
this.showCycleEndFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.TabIndex = 13;
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.showCycleEndFormCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
this.reversedIperlDirectionCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(131, 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(32, 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(128, 32);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// showCycleEndFormCheckBox
//
this.showCycleEndFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.TabIndex = 13;
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
//
// reversedIperlDirectionCheckBox
//
this.reversedIperlDirectionCheckBox.AutoSize = true;
this.reversedIperlDirectionCheckBox.Enabled = false;
this.reversedIperlDirectionCheckBox.Location = new System.Drawing.Point(131, 113);
this.reversedIperlDirectionCheckBox.Name = "reversedIperlDirectionCheckBox";
this.reversedIperlDirectionCheckBox.Size = new System.Drawing.Size(158, 17);
this.reversedIperlDirectionCheckBox.TabIndex = 14;
this.reversedIperlDirectionCheckBox.Text = "Reversed direction of iPerl-s";
this.reversedIperlDirectionCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.reversedIperlDirectionCheckBox);
this.Controls.Add(this.showCycleEndFormCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@ -96,5 +109,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showCycleEndFormCheckBox;
private System.Windows.Forms.CheckBox reversedIperlDirectionCheckBox;
}
}

View File

@ -1057,7 +1057,7 @@ namespace TBF.BenchControl.Sequences
sb.Append(";"); sb.Append(tstRslt.FlowMin); /// BG Qm [kg/h]
sb.Append(";"); sb.Append(tstRslt.FlowVolume); /// BH Qv [l/h]
sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// BI Vet . . . komercne prava hodnota - podla vahy
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// BJ Velm . . . . objem podla etalonu
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// BJ Velm . . . . objem podla etalonu (Prolonged: objem do vahy podla impulzov do vahy)
sb.Append(";"); sb.Append(" "); /// BK Vmass . . . objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame)
sb.Append(";"); sb.Append(tstRslt.TestTime); /// BL t
sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// BM Eelm . . . chyba etalonu voci komercne pravej hodnote
@ -1074,13 +1074,13 @@ namespace TBF.BenchControl.Sequences
sb.Append(";"); sb.Append(tstRslt.TempDownMax); /// BV [°C]
sb.Append(";"); sb.Append(tstRslt.TempUpMin); /// BW [°C]
sb.Append(";"); sb.Append(tstRslt.TempDownMin); /// BX [°C]
sb.Append(";"); sb.Append(isPMaxTest ? tstRslt.TestTime : 0); /// BY [s] Duration of the pressure test
sb.Append(";"); sb.Append(isPMaxTest ? tstRslt.TestTime : 0); /// BY [s] Duration of the pressure test
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.C, tstRslt.AmbTempEnd)); /// BZ [°C]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.mbar, tstRslt.AmbPressEnd)); /// CA [mbar]
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.RPct, tstRslt.AmbHumiEnd)); /// CB [R%]
sb.Append(";"); sb.Append(tstRslt.PulsesMaster); /// CC Celkovy pocet et. pulzov skusky
sb.Append(";"); sb.Append(" "); /// CD - '' - pre druhy
sb.Append(";"); sb.Append(tstRslt.PulsesMaster); /// CC Celkovy pocet et. pulzov skusky (Prolonged : do vahy)
sb.Append(";"); sb.Append((tstRslt.TotalPulsesMstr != 0) ? tstRslt.TotalPulsesMstr.ToString() : " "); /// CD - '' - pre druhy (Prolonged : celkovy pocet)
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
{
if (ProcessData.BatchRslts.WaterMeters[i] != null)
@ -1117,8 +1117,10 @@ namespace TBF.BenchControl.Sequences
#endif
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter : 0); /// CQ WM Phi_start - pri hodnotach z kamery
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter : 0); /// CR WM Phi_end - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.TimestampStart : 0); /// CS WM Time_start - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.TimestampEnd : 0); /// CT WM Time_end - ' ' -
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// CS WM Time_start - ' ' -
sb.Append(";"); sb.Append(mtrRslt.TimestampEnd); /// CT WM Time_end - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU WM Degree per liter
sb.Append(";"); sb.Append(0); /// CV Analog out 1 (max mA)

View File

@ -748,33 +748,32 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
double massPulses = Convert.ToDouble(cBrd.EtPulsesK);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = totalPulses; /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600 * (tstRslt.MassEnd - tstRslt.MassStart) * totalPulses / (tstRslt.TestTime * massPulses); /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
double collectedVoluemCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityLine; /// [l] commercially true volume of collected water
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time (TODO: or cBrd.ImpulseTime(0) ???)
tstRslt.PulsesMaster = massPulses; /// Pulses of the master flow meter (test total)
tstRslt.TotalPulsesMstr = totalPulses;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600 * (tstRslt.MassEnd - tstRslt.MassStart) * totalPulses / (tstRslt.TestTime * massPulses); /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * totalPulses / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityLine; /// [l] commercially true volume of collected water
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (massPulses == 0) ? tstRslt.ConstMasterCorr : (collectedVoluemCTV / massPulses);
/// Calculated master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * totalPulses;
tstRslt.VolumeMaster = LtrPerRefPulse * totalPulses; /// [l] volume from the master flow meter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = (massPulses == 0) ? tstRslt.ConstMasterCorr : (tstRslt.VolumeCTV / massPulses);
tstRslt.VolumeMaster = LtrPerRefPulse * massPulses; /// [l] volume from the master flow meter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.DiverterStart = switchTimeStart.Val;
tstRslt.DivStart10 = 0;
@ -825,7 +824,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
if (meterRslt.PulsesMaster != 0)
{
meterRslt.VolumeMeter *= (tstRslt.PulsesMaster / meterRslt.PulsesMaster);
meterRslt.VolumeMeter *= (totalPulses / meterRslt.PulsesMaster);
}
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
@ -838,7 +837,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
{
compoundMeterRslt.VolumeRef = tstRslt.VolumeCTV;
compoundMeterRslt.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
compoundMeterRslt.PulsesMaster = totalPulses;
compoundMeterRslt.TestTime = tstRslt.TestTime;
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
@ -908,7 +907,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
energyRslt.PulsesMaster = Convert.ToDouble(energyRegReader.WMRefPulses);
energyRslt.VolumeStart = 0;
energyRslt.VolumeEnd = 0;
energyRslt.VolumeRef = tstRslt.RefEnergy * (energyRslt.PulsesMaster / tstRslt.PulsesMaster); /// [J]
energyRslt.VolumeRef = tstRslt.RefEnergy * (energyRslt.PulsesMaster / totalPulses); /// [J]
energyRslt.VolumeMeter = energyRslt.PulsesMeter * Config.Units.ConvertFrom(Config.Unit.kWh, energyRegReader.LtrsPerPulse); /// [J]
energyRslt.TestTime = cBrd.ImpulseTime(i + 1); /// [s]
@ -951,8 +950,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
meterRslt.VolumeStart = dstrReader.VolumeLtrStart; /// liter
meterRslt.VolumeEnd = dstrReader.VolumeLtrEnd; /// liter
meterRslt.VolumeMeter = Math.Abs(dstrReader.VolumeLtrEnd - dstrReader.VolumeLtrStart);
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
meterRslt.PulsesMaster = tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime * totalPulses / (tstRslt.TestTime * massPulses);
meterRslt.PulsesMaster = totalPulses * meterRslt.TestTime / tstRslt.TestTime;
if (iPerl != null)
{
@ -969,25 +968,25 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
}
else if (cameraRoi != null)
{
meterRslt.TimestampStart = cameraRoi.TimestampStart; /// second
meterRslt.TimestampEnd = cameraRoi.TimestampEnd; /// second
meterRslt.TestTime = cameraRoi.TimestampEnd - cameraRoi.TimestampStart; /// second
meterRslt.TimestampStart = cameraRoi.TimestampStart; /// second
meterRslt.TimestampEnd = cameraRoi.TimestampEnd; /// second
meterRslt.TestTime = cameraRoi.TimestampEnd - cameraRoi.TimestampStart; /// second
meterRslt.VolumeStart = cameraRoi.VolumeStart; /// liter
meterRslt.VolumeEnd = cameraRoi.VolumeEnd; /// liter
meterRslt.VolumeMeter = cameraRoi.VolumeEnd - cameraRoi.VolumeStart; /// liter
meterRslt.VolumeStart = cameraRoi.VolumeStart; /// liter
meterRslt.VolumeEnd = cameraRoi.VolumeEnd; /// liter
meterRslt.VolumeMeter = cameraRoi.VolumeEnd - cameraRoi.VolumeStart; /// liter
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
meterRslt.PulsesMaster = tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime * totalPulses / (tstRslt.TestTime * massPulses);
meterRslt.PulsesMaster = totalPulses * meterRslt.TestTime / tstRslt.TestTime;
}
else
{
meterRslt.TestTime = cBrd.ImpulseTime(i + 1); /// TODO: Malo by sa citat z dosky
meterRslt.TestTime = cBrd.ImpulseTime(i + 1); /// TODO: Malo by sa citat z dosky
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeRef = totalPulses * tstRslt.ConstMaster; /// liter
}
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);

View File

@ -226,9 +226,14 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
if (messageID == MessageID.Calibration && offset == 2)
{
UInt16 calibFactor = (UInt16)(pBuf[0] + 256 * pBuf[1]);
rfidDataLogger.InfoFormat("{0}: WriteRequestPort(calibFactor={1}) returned {2} {3}", name, calibFactor, retv, (retv != 0) ? "!" : "");
rfidDataLogger.InfoFormat("{0}: WriteRequestPort(Cal={1}) returned {2} {3}", name, calibFactor, retv, (retv != 0) ? "!" : "");
}
else
else if (messageID == MessageID.Calibration && offset == 34)
{
UInt16 calibFactor = (UInt16)(pBuf[0] + 256 * pBuf[1]);
rfidDataLogger.InfoFormat("{0}: WriteRequestPort(CalLNA={1}) returned {2} {3}", name, calibFactor, retv, (retv != 0) ? "!" : "");
}
else
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
}
else

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -20,6 +20,8 @@ namespace TBF
public const string ImagesDir = "C:\\Tbf\\Images\\";
public const string TempImagesDir = "C:\\Tbf\\Images\\Temp\\";
public static string ExecutableDir;
/// log4net
static ILog log;
const string log4netConfigFName = "log4netConfig.xml";
@ -64,7 +66,8 @@ namespace TBF
/// Program version string
System.Reflection.Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
Version ver = thisAssembly.GetName().Version;
ExecutableDir = Path.GetDirectoryName(thisAssembly.Location);
Version ver = thisAssembly.GetName().Version;
Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
BuildDateTime = new System.IO.FileInfo(thisAssembly.Location).LastWriteTime;

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.1066.0")]
[assembly: AssemblyFileVersion("2.18.1066.0")]
[assembly: AssemblyVersion("2.18.1067.0")]
[assembly: AssemblyFileVersion("2.18.1067.0")]

View File

@ -3043,6 +3043,12 @@
<None Include="Resources\RoiStyle1.bmp" />
<None Include="Resources\RoiStyle2.bmp" />
<None Include="Resources\RoiStyle3.bmp" />
<Content Include="Pictures\forward_dir.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Pictures\reversed_dir.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Resources\empty.png" />
<Content Include="Resources\switch-off.png" />
<Content Include="Resources\switch-on.png" />