From dd52b9d139d4c2aeb8d34b69434707e75544c987 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Tue, 26 Oct 2021 19:32:11 +0200 Subject: [PATCH] Bug fixes : Oracle in Chennai, ver. 2.27.1783 --- TBF/Rig/Output/DB/SensusOracle/Database.cs | 11 ++++++----- .../iPerlCommunication/iPerlCommunicationSeq.cs | 11 ++++++----- .../SendAgainDBAndWMSelectionForm.Designer.cs | 16 +++++++++------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/TBF/Rig/Output/DB/SensusOracle/Database.cs b/TBF/Rig/Output/DB/SensusOracle/Database.cs index fd2207eb5..03c69e31f 100644 --- a/TBF/Rig/Output/DB/SensusOracle/Database.cs +++ b/TBF/Rig/Output/DB/SensusOracle/Database.cs @@ -236,9 +236,10 @@ namespace TBF.Rig.Output.DB.SensusOracle cmd = new OracleCommand("SELECT pruefungsnr, q_soll, pruefzeit, posfehlerkalt, negfehlerkalt, pruefbereichmin, pruefbereichmax, qbezeichnung " + "FROM vt_pruefpunkt_soll_sd " + - "WHERE anbid=4 AND id_wztyp=:1 AND rev_wztyp=:2", conn); - cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1 - cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:2 + "WHERE anbid=:1 AND id_wztyp=:2 AND rev_wztyp=:3", conn); + cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_Producer }); ///:1 + cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:2 + cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:3 /// dr = cmd.ExecuteReader(); while (dr.Read()) @@ -1022,7 +1023,7 @@ namespace TBF.Rig.Output.DB.SensusOracle void SaveOrUpdateIperl(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung) { int sekundaere_Adr = wm.Passed ? 1 : 0; - int idBenutzer = 6; // = wm.Batch.UserNumber; + int idBenutzer = (Anbid_Producer == 4) ? 6 : (Anbid_Producer == 8) ? 365 : 6; // = wm.Batch.UserNumber; if (dbCfg.DebugLevel == DebugMode.Normal) { @@ -1224,7 +1225,7 @@ namespace TBF.Rig.Output.DB.SensusOracle void SaveOrUpdateMechanicalMeter(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung) { - int idBenutzer = 6; // = wm.Batch.UserNumber; + int idBenutzer = (Anbid_Producer == 4) ? 6 : (Anbid_Producer == 8) ? 365 : 6; // = wm.Batch.UserNumber; string vt_identnummer = wm.SerialNr.Length > 8 ? wm.SerialNr.Substring(0, 8) : wm.SerialNr; if (dbCfg.DebugLevel == DebugMode.Normal) diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs index c65b68d9d..7702993a8 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs @@ -576,10 +576,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication if (iPerl == null || ((iPerl.Q2CorrRL == 0) && (iPerl.Q2CorrLR == 0))) { /// Either no iPerl head or no Q2 correction - meterRslt.VolumeStart = oriMeterRslt.VolumeStart; + meterRslt.Error = oriMeterRslt.Error; + meterRslt.VolumeMeter = oriMeterRslt.VolumeMeter; + meterRslt.VolumeStart = oriMeterRslt.VolumeStart; meterRslt.VolumeEnd = oriMeterRslt.VolumeEnd; - meterRslt.VolumeMeter = oriMeterRslt.VolumeMeter; - meterRslt.Error = oriMeterRslt.Error; meterRslt.Passed = oriMeterRslt.Passed; meterRslt.TestDone = true; tstRslt.TestDone = true; @@ -588,10 +588,11 @@ namespace TBF.Rig.TestMethods.iPerlCommunication { /// iPerl with Q2 correction => generate an artificial error equal to -1/10 of the original one (relative to Q2 target error) double targetError = iPerl.CalibTargetQ2; - meterRslt.VolumeStart = 0; - meterRslt.VolumeEnd = 0; meterRslt.Error = targetError - 0.1 * (oriMeterRslt.Error - targetError); meterRslt.VolumeMeter = oriMeterRslt.VolumeRef * (100.0 + meterRslt.Error) / 100.0; + meterRslt.VolumeStart = oriMeterRslt.VolumeStart; + double signature = (oriMeterRslt.VolumeEnd > oriMeterRslt.VolumeStart) ? (+1) : (-1); + meterRslt.VolumeEnd = meterRslt.VolumeStart + signature * meterRslt.VolumeMeter; meterRslt.Passed = true; meterRslt.TestDone = true; tstRslt.TestDone = true; diff --git a/TBF/UI/ResultsMI/SendAgainDBAndWMSelectionForm.Designer.cs b/TBF/UI/ResultsMI/SendAgainDBAndWMSelectionForm.Designer.cs index e0a256223..4e41323a3 100644 --- a/TBF/UI/ResultsMI/SendAgainDBAndWMSelectionForm.Designer.cs +++ b/TBF/UI/ResultsMI/SendAgainDBAndWMSelectionForm.Designer.cs @@ -39,7 +39,7 @@ // databaseComboBox // this.databaseComboBox.FormattingEnabled = true; - this.databaseComboBox.Location = new System.Drawing.Point(159, 27); + this.databaseComboBox.Location = new System.Drawing.Point(151, 27); this.databaseComboBox.Name = "databaseComboBox"; this.databaseComboBox.Size = new System.Drawing.Size(163, 21); this.databaseComboBox.TabIndex = 0; @@ -47,7 +47,7 @@ // databaseLabel // this.databaseLabel.AutoSize = true; - this.databaseLabel.Location = new System.Drawing.Point(44, 30); + this.databaseLabel.Location = new System.Drawing.Point(36, 30); this.databaseLabel.Name = "databaseLabel"; this.databaseLabel.Size = new System.Drawing.Size(53, 13); this.databaseLabel.TabIndex = 1; @@ -56,7 +56,7 @@ // waterMetersLabel // this.waterMetersLabel.AutoSize = true; - this.waterMetersLabel.Location = new System.Drawing.Point(44, 65); + this.waterMetersLabel.Location = new System.Drawing.Point(36, 65); this.waterMetersLabel.Name = "waterMetersLabel"; this.waterMetersLabel.Size = new System.Drawing.Size(70, 13); this.waterMetersLabel.TabIndex = 2; @@ -65,14 +65,15 @@ // waterMetersComboBox // this.waterMetersComboBox.FormattingEnabled = true; - this.waterMetersComboBox.Location = new System.Drawing.Point(159, 62); + this.waterMetersComboBox.Location = new System.Drawing.Point(151, 62); this.waterMetersComboBox.Name = "waterMetersComboBox"; this.waterMetersComboBox.Size = new System.Drawing.Size(163, 21); this.waterMetersComboBox.TabIndex = 3; // // okButton // - this.okButton.Location = new System.Drawing.Point(230, 121); + this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.okButton.Location = new System.Drawing.Point(106, 115); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(92, 40); this.okButton.TabIndex = 4; @@ -82,7 +83,8 @@ // // cancelButton // - this.cancelButton.Location = new System.Drawing.Point(108, 121); + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.Location = new System.Drawing.Point(222, 115); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(92, 40); this.cancelButton.TabIndex = 5; @@ -94,7 +96,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(385, 202); + this.ClientSize = new System.Drawing.Size(347, 181); this.Controls.Add(this.cancelButton); this.Controls.Add(this.okButton); this.Controls.Add(this.waterMetersComboBox);