diff --git a/Results/Entities/TestRslt.cs b/Results/Entities/TestRslt.cs index 7b7ce36e8..d66d46b4b 100644 --- a/Results/Entities/TestRslt.cs +++ b/Results/Entities/TestRslt.cs @@ -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. diff --git a/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.Designer.cs b/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.Designer.cs index e7d8ae360..3b62b075e 100644 --- a/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.Designer.cs +++ b/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.Designer.cs @@ -31,49 +31,59 @@ namespace TBF.BenchControl.DataEntry.iPerl /// 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; } } \ No newline at end of file diff --git a/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.cs b/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.cs index 00baa4531..d2de1ad12 100644 --- a/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.cs +++ b/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.cs @@ -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 /// Number of water meters 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 /// /// Number of text boxes for serial numbers - 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)); + } } /// diff --git a/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.resx b/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.resx index 36ef9cca0..5e7e06de5 100644 --- a/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.resx +++ b/TBF/BenchControl/DataEntry/iPerl/CycleBeginningForm.resx @@ -144,13 +144,13 @@ $this - 1 + 2 - 90, 31 + 90, 32 - 376, 31 + 432, 31 0 @@ -174,7 +174,7 @@ 28, 12 - 537, 82 + 565, 82 0 @@ -192,6 +192,27 @@ $this + 1 + + + 28, 118 + + + 711, 497 + + + 8 + + + pictureBox + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -204,7 +225,7 @@ True - 801, 119 + 769, 639 Batch data diff --git a/TBF/BenchControl/DataEntry/iPerl/EntryForm.cs b/TBF/BenchControl/DataEntry/iPerl/EntryForm.cs index fef1bbacd..328ff4af7 100644 --- a/TBF/BenchControl/DataEntry/iPerl/EntryForm.cs +++ b/TBF/BenchControl/DataEntry/iPerl/EntryForm.cs @@ -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(); } /// diff --git a/TBF/BenchControl/DataEntry/iPerl/EntryFormCfg.cs b/TBF/BenchControl/DataEntry/iPerl/EntryFormCfg.cs index 33aaa0890..9f0421f91 100644 --- a/TBF/BenchControl/DataEntry/iPerl/EntryFormCfg.cs +++ b/TBF/BenchControl/DataEntry/iPerl/EntryFormCfg.cs @@ -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); } } } diff --git a/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.cs b/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.cs index efc3a31f5..270708733 100644 --- a/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.cs +++ b/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.cs @@ -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; } diff --git a/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.designer.cs b/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.designer.cs index 9f8354358..964e0c37c 100644 --- a/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.designer.cs +++ b/TBF/BenchControl/DataEntry/iPerl/EntryFormCfgCtrl.designer.cs @@ -31,62 +31,75 @@ namespace TBF.BenchControl.DataEntry.iPerl /// 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; } } diff --git a/TBF/BenchControl/Sequences/SequenceBase.cs b/TBF/BenchControl/Sequences/SequenceBase.cs index 63d99882c..fb2cd5472 100644 --- a/TBF/BenchControl/Sequences/SequenceBase.cs +++ b/TBF/BenchControl/Sequences/SequenceBase.cs @@ -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) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index 291f71d11..7c6ae93e6 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -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); diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 271d1d7bf..74fc4c7b0 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -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 diff --git a/TBF/Pictures/forward_dir.jpg b/TBF/Pictures/forward_dir.jpg new file mode 100644 index 000000000..720d648d7 Binary files /dev/null and b/TBF/Pictures/forward_dir.jpg differ diff --git a/TBF/Pictures/reversed_dir.jpg b/TBF/Pictures/reversed_dir.jpg new file mode 100644 index 000000000..ef82a2436 Binary files /dev/null and b/TBF/Pictures/reversed_dir.jpg differ diff --git a/TBF/Program.cs b/TBF/Program.cs index a9f65d6dd..863e7b336 100644 --- a/TBF/Program.cs +++ b/TBF/Program.cs @@ -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; diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 31563a7e9..ffe578187 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -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")] diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 2e574ad4e..a54b27585 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -3043,6 +3043,12 @@ + + Always + + + Always +