OneWMResult...Ctrl caption with position, pruefindex, clean-up, more comments, ver. 2.28.1921

This commit is contained in:
Milan Hanajik
2022-05-30 11:44:49 +02:00
parent 420efb1ae0
commit 87a60be61f
10 changed files with 46 additions and 38 deletions
+2 -2
View File
@@ -95,7 +95,7 @@ namespace Results.Entities
public virtual string CompleteSerialNr { get; set; }
public virtual string OriRadioAddress { get; set; } /// Original radio address of a 640 water meter (AlbatrosID)
public virtual int WMTypeRevision { get; set; }
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
public virtual int Pruefindex { get; set; } /// >=1 ... pruefindex, 0 ... unknown (no reading from DB yet)
public virtual int HydrPruefung { get; set; }
public virtual object RawTestInfos { get; set; } /// Not mapped to DB !!! IList<SensusTestInfo> fetched from Oracle at the beginning of the cycle, not mapped to DB !!!
public virtual object CompleteTestInfos { get; set; } /// Not mapped to DB !!! SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
@@ -444,7 +444,7 @@ namespace Results.Entities
CompleteSerialNr = string.Empty;
OriRadioAddress = string.Empty;
WMTypeRevision = 0;
Pruefindex = 1;
Pruefindex = 0;
HydrPruefung = 0;
RawTestInfos = null;
CompleteTestInfos = null;
+7 -5
View File
@@ -41,6 +41,7 @@
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
@@ -48,12 +49,13 @@
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tBox);
this.splitContainer1.Panel1MinSize = 26;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lView);
this.splitContainer1.Size = new System.Drawing.Size(352, 318);
this.splitContainer1.SplitterDistance = 25;
this.splitContainer1.SplitterDistance = 26;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
@@ -62,7 +64,7 @@
this.tBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.tBox.Location = new System.Drawing.Point(0, 0);
this.tBox.Name = "tBox";
this.tBox.Size = new System.Drawing.Size(352, 20);
this.tBox.Size = new System.Drawing.Size(352, 26);
this.tBox.TabIndex = 0;
this.tBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tBox_MouseDoubleClick);
//
@@ -73,17 +75,17 @@
this.lView.GridLines = true;
this.lView.Location = new System.Drawing.Point(0, 0);
this.lView.Name = "lView";
this.lView.Size = new System.Drawing.Size(352, 292);
this.lView.Size = new System.Drawing.Size(352, 291);
this.lView.TabIndex = 0;
this.lView.UseCompatibleStateImageBehavior = false;
this.lView.View = System.Windows.Forms.View.Details;
//
// OneWMResultsCtrl
// OneWMResultsColumnsCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "OneWMResultsCtrl";
this.Name = "OneWMResultsColumnsCtrl";
this.Size = new System.Drawing.Size(352, 318);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
+5 -1
View File
@@ -85,7 +85,11 @@ namespace Results.Forms
/// Update caption
#if ORACLE_DB
tBox.Text = caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
tBox.Text = caption = string.Format("{0} ({1}) {2} {3}",
wMtr.WMPosition,
wMtr.Pruefindex == 0 ? "?" : string.Format("{0}x", wMtr.Pruefindex % 100),
(string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr),
message);
#else
tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
#endif
+7 -5
View File
@@ -48,21 +48,23 @@
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tBox);
this.splitContainer1.Panel1MinSize = 26;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lView);
this.splitContainer1.Size = new System.Drawing.Size(352, 318);
this.splitContainer1.SplitterDistance = 25;
this.splitContainer1.SplitterDistance = 26;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// tBox
//
this.tBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.tBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.tBox.Location = new System.Drawing.Point(0, 0);
this.tBox.Name = "tBox";
this.tBox.Size = new System.Drawing.Size(352, 20);
this.tBox.Size = new System.Drawing.Size(352, 26);
this.tBox.TabIndex = 0;
this.tBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tBox_MouseDoubleClick);
//
@@ -73,17 +75,17 @@
this.lView.GridLines = true;
this.lView.Location = new System.Drawing.Point(0, 0);
this.lView.Name = "lView";
this.lView.Size = new System.Drawing.Size(352, 292);
this.lView.Size = new System.Drawing.Size(352, 291);
this.lView.TabIndex = 0;
this.lView.UseCompatibleStateImageBehavior = false;
this.lView.View = System.Windows.Forms.View.Details;
//
// OneWMResultsCtrl
// OneWMResultsRowsCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "OneWMResultsCtrl";
this.Name = "OneWMResultsRowsCtrl";
this.Size = new System.Drawing.Size(352, 318);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
+5 -1
View File
@@ -97,7 +97,11 @@ namespace Results.Forms
/// Update caption
#if ORACLE_DB
tBox.Text = caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
tBox.Text = caption = string.Format("{0} ({1}) {2} {3}",
wMtr.WMPosition,
wMtr.Pruefindex == 0 ? "?" : string.Format("{0}x", wMtr.Pruefindex % 100),
(string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr),
message);
#else
tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
#endif
+5 -2
View File
@@ -102,7 +102,8 @@ namespace Results.Output
}
/// <summary>
/// Determines whether test infos are compatible with procedure tests.
/// Determines whether test infos are compatible with procedure tests:
/// For each 'cti'in candidate SensusTestInfo array there must exist a string 'cti.TestName' in testNames.
/// </summary>
/// <returns>true when compatible</returns>
public static bool AreCompatible(SensusTestInfo[] completeTestInfo, IList<string> testNames)
@@ -127,7 +128,9 @@ namespace Results.Output
/// <summary>
/// Determines whether Oracle and complete test infos are compatible.
/// Determines whether Oracle and complete test infos are compatible:
/// For each 'oti' in OracleTestInfo there must exist a compatible ...
/// ... cti.PruefungsNrDB + cti.QBezeichnungDB pair in candidate SensusTestInfo.
/// </summary>
/// <returns>true when compatible</returns>
public static bool AreCompatible(IList<SensusTestInfo> oracleTestInfo, SensusTestInfo[] completeTestInfo)
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.27.1917.0")]
[assembly: AssemblyFileVersion("2.27.1917.0")]
[assembly: AssemblyVersion("2.28.1921.0")]
[assembly: AssemblyFileVersion("2.28.1921.0")]
+3 -3
View File
@@ -526,7 +526,6 @@ namespace TBF.Rig.Output.DB.SensusOracle
int pruefreiheID = 0;
int wmPosition = 0;
bool passed = false;
int resultCode = 0;
int userId = 0;
int q2CorrectionRL = 0;
int q2CorrectionLR = 0;
@@ -560,8 +559,9 @@ namespace TBF.Rig.Output.DB.SensusOracle
///
/// Water meter with given PCB number was not found in ORACLE
///
log.ErrorFormat("Water meter {0} was not found in ORACLE database.", wm.SerialNr);
dr.Close();
wm.Pruefindex = 1;
log.ErrorFormat("Water meter {0} was not found in ORACLE database.", wm.SerialNr);
return StartInfoIsRequired ? Retv.Error : Retv.OK;
}
dr.Close();
@@ -663,7 +663,7 @@ namespace TBF.Rig.Output.DB.SensusOracle
///
/// Copy acquired data to WaterMeter object
///
wm.Pruefindex = maxPruefindex + 1; /// Increment the proefindex from Oracle so that it is the pruefindex of the current cycle
wm.Pruefindex = Math.Max(1, maxPruefindex + 1); /// Increment the proefindex from Oracle so that it is the pruefindex of the current cycle
log.InfoFormat("Data of water meter {0} successfully read from ORACLE database.", wm.SerialNr);
log.DebugFormat(" MaxPruefindex = {0}", wm.Pruefindex);
#if TURA_SPECIAL
@@ -2366,6 +2366,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
static CommErr InitOrReadQ2Corrections(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
if (wm.Pruefindex == 0) return CommErr.CommFailed; /// Unknown pruefindex
if (wm.Pruefindex == 1)
{
@@ -1,9 +1,11 @@
///
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Linq;
using log4net;
using Common;
using Common.Iperl;
@@ -398,11 +400,11 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
: base(cfg)
{
iperlHeadCfg = cfg as IperlHeadCfg;
x = new float[FeatureVectorSize];
}
public override void Initialize()
{
x = new float[FeatureVectorSize];
flowDirectionDetection = new FlowDirectionDetection();
/// Allocate memory for opto-data from iPerl
@@ -748,20 +750,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
/// Select or create appropriate 'qBezeichnung'
///
string fullTestName = Results.Utils.GetTestName(testName, testRepeats, repetitionNr);
string qBezeichnungOpto = null; /// To be determined from TestInfo-s (if there are any)
foreach (var ti in testInfos)
{
if ((ti.PruefungsNrOpto != 0) && (ti.TestName == fullTestName))
{
qBezeichnungOpto = string.IsNullOrEmpty(ti.QBezeichnungOpto) ? ti.PruefungsNrOpto.ToString("D2") : ti.QBezeichnungOpto;
break;
}
}
if (qBezeichnungOpto == null)
{
qBezeichnungOpto = fullTestName; /// No appropriate TestInfo found => set default opto data file name
}
var ti = testInfos.FirstOrDefault(x => x.PruefungsNrOpto != 0 && x.TestName == fullTestName);
string qBezeichnung = (ti == null) ? fullTestName /// No appropriate TestInfo found => set default opto data file name
: string.IsNullOrEmpty(ti.QBezeichnungOpto) ? ti.PruefungsNrOpto.ToString("D2")
: ti.QBezeichnungOpto;
///
/// Get other required pieces of information
///
@@ -773,7 +765,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
///
/// Return the file name
///
return string.Format("{0}_{1}_{2}_{3}.txt", pcbNr, wmPosition, qBezeichnungOpto, cycleStartTime);
return string.Format("{0}_{1}_{2}_{3}.txt", pcbNr, wmPosition, qBezeichnung, cycleStartTime);
}