Compare commits

...
Author SHA1 Message Date
Milan Hanajik 3e80abf53e Reconfigured for Warszawa PT50 2023-11-09 18:01:35 +01:00
Milan Hanajik 38983990c2 PL language (Uzytkownici), ver. 2.33.2127 2023-11-09 18:00:52 +01:00
Milan Hanajik e02411d180 ProcedureDlg changes : wider ComboBox-es, PL language, etc., ver. 2.33.2120 2023-11-08 10:06:38 +01:00
Milan Hanajik 69f729b713 ver. 2.33.2113 2023-10-25 11:36:27 +02:00
Milan Hanajik f773e26fa3 SensusOracle.Database.ReadStartInfoFromProcedure( ) bug fix for PT7, ver. 2.33.2112 2023-10-23 14:36:11 +02:00
Milan Hanajik 9fed5148b6 TestWizard improvements 2023-10-23 14:36:11 +02:00
Milan Hanajik ab3a16bdc5 ver. 2.33.2111 2023-10-20 08:53:15 +02:00
Milan Hanajik 6e3f0dad0e iPerlCommunication : simulate iperls 2023-10-19 12:57:21 +02:00
Milan Hanajik ed066a005f MoreWMResultsDlg fixes. 2023-10-19 12:57:21 +02:00
Milan Hanajik d3126bd9ea SendAgain function in PreviousResultsDlg made fool proof for iPERL production, PW protection, etc. 2023-10-19 12:57:20 +02:00
Milan Hanajik 1c638b3f87 Range of q2CorrRL and q2CorrLR limitted to -128 .. +127. 2023-10-19 12:57:20 +02:00
Milan Hanajik f0afcd57a2 Metrology contains links to certificates saved as PDF files, CalibCertificateCtrl, ver. 2.33.2110 2023-10-18 15:32:40 +02:00
Milan Hanajik 769cb230e3 Results.ItemID.cs synchronized with ver. 3 branch. 2023-10-05 12:38:54 +02:00
Milan Hanajik 3c52e54e02 ver. 2.33.2105 2023-09-26 11:04:37 +02:00
Milan Hanajik 068b7fb3a2 Possibility to bypass "production tracing check" for a selected number of cycles, ver. 2.33.2104 2023-09-26 09:31:57 +02:00
Milan Hanajik 2ba6586a0e ver. 2.33.2102 2023-09-25 10:06:36 +02:00
Milan Hanajik fa403a322a TURA_SPECIAL WMsCount = 6, ver. 2.33.2101 2023-09-25 08:54:53 +02:00
Milan Hanajik 30627abc6a iPerlCommunication.OpticalHeadTest rectified. 2023-09-25 08:54:53 +02:00
Milan Hanajik 78772df3a0 Previous results : Possibility to save tracing records into a tracing DB (similarly to saving to Oracle). 2023-08-16 12:13:55 +02:00
Milan Hanajik 426bb0cce9 ProductionTracing : 1. No alternative tracing DB, 2. SaveTracingRecords( ) is public 2023-08-16 12:11:06 +02:00
Milan Hanajik 3da6fcfe73 Q2 correction clean-up, etc. 2023-08-15 17:07:32 +02:00
Milan Hanajik 8f27d1a448 ver. 2.33.2085 2023-08-09 11:39:28 +02:00
Milan Hanajik c5752f21a9 Q2 correction factor calculation bug fix, case when the original factor was not zero and the error target is not zero, ver. 2.33.2084 2023-08-09 11:15:22 +02:00
Milan Hanajik 8c30cb21e2 ver. 2.33.2081 2023-08-08 12:13:39 +02:00
Milan Hanajik 5181f75217 Bug fix in Q2 correction factor calculation when volume = 0, ver. 2.33.2080 2023-08-08 12:08:23 +02:00
Milan Hanajik 7ee41afba2 ver. 2.33.2079 2023-08-08 09:31:44 +02:00
83 changed files with 1803 additions and 1690 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;WARSAW_50;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;WARSAW_50;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+7 -1
View File
@@ -38,12 +38,18 @@ namespace Config
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif RUM_MOB || TURA_SPECIAL
#elif RUM_MOB
public const int WMsCount = 8;
public const int LineSize = 8;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_SPECIAL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif DEWA_300 || FUZHOU_100 || ROMA_200 || LUXEMBURG_40
public const int WMsCount = 10;
public const int LineSize = 10;
-5
View File
@@ -99,7 +99,6 @@ namespace Results.Entities
public virtual int HydrPruefung { get; set; }
#endif
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session)
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
public virtual WaterMeterData WaterMeterData { get; set; }
@@ -458,7 +457,6 @@ namespace Results.Entities
HydrPruefung = 0;
#endif
ProcessId = 0;
SessionId = 0;
LastRecordIsNok = false;
}
@@ -520,7 +518,6 @@ namespace Results.Entities
HydrPruefung = src.HydrPruefung;
#endif
ProcessId = src.ProcessId; /// Not mapped to DB
SessionId = src.SessionId; /// Not mapped to DB
LastRecordIsNok = src.LastRecordIsNok; /// Not mapped to DB
foreach (var mtr in MeterTestRslts)
@@ -700,7 +697,6 @@ namespace Results.Entities
writer.Write(HydrPruefung);
#endif
writer.Write(ProcessId);
writer.Write(SessionId);
writer.Write(LastRecordIsNok);
/// Save WaterMeterData or WaterMeterData.Id
@@ -780,7 +776,6 @@ namespace Results.Entities
HydrPruefung = reader.ReadInt32();
#endif
ProcessId = reader.ReadInt32();
SessionId = reader.ReadInt32();
LastRecordIsNok = reader.ReadBoolean();
/// Retrieve TestData
+24 -10
View File
@@ -29,13 +29,15 @@
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.allResultsTabPage = new System.Windows.Forms.TabPage();
this.graphsTabPage = new System.Windows.Forms.TabPage();
this.productionTracingTabPage = new System.Windows.Forms.TabPage();
this.productionTracingSplitContainer = new System.Windows.Forms.SplitContainer();
this.messageLabel = new System.Windows.Forms.Label();
this.tracingResultsListView = new System.Windows.Forms.ListView();
this.allResultsTabPage = new System.Windows.Forms.TabPage();
this.oneWMResultsCtrl = new Results.Forms.OneWMResultsRowsCtrl();
this.tabControl1.SuspendLayout();
this.allResultsTabPage.SuspendLayout();
this.productionTracingTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.productionTracingSplitContainer)).BeginInit();
this.productionTracingSplitContainer.Panel1.SuspendLayout();
@@ -55,6 +57,17 @@
this.tabControl1.Size = new System.Drawing.Size(1195, 448);
this.tabControl1.TabIndex = 0;
//
// allResultsTabPage
//
this.allResultsTabPage.Controls.Add(this.oneWMResultsCtrl);
this.allResultsTabPage.Location = new System.Drawing.Point(4, 22);
this.allResultsTabPage.Name = "allResultsTabPage";
this.allResultsTabPage.Padding = new System.Windows.Forms.Padding(3);
this.allResultsTabPage.Size = new System.Drawing.Size(1187, 422);
this.allResultsTabPage.TabIndex = 0;
this.allResultsTabPage.Text = "All results";
this.allResultsTabPage.UseVisualStyleBackColor = true;
//
// graphsTabPage
//
this.graphsTabPage.Location = new System.Drawing.Point(4, 22);
@@ -113,6 +126,7 @@
//
this.tracingResultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.tracingResultsListView.GridLines = true;
this.tracingResultsListView.HideSelection = false;
this.tracingResultsListView.Location = new System.Drawing.Point(0, 0);
this.tracingResultsListView.Name = "tracingResultsListView";
this.tracingResultsListView.Size = new System.Drawing.Size(1187, 366);
@@ -120,15 +134,14 @@
this.tracingResultsListView.UseCompatibleStateImageBehavior = false;
this.tracingResultsListView.View = System.Windows.Forms.View.Details;
//
// allResultsTabPage
// oneWMResultsRowsCtrl
//
this.allResultsTabPage.Location = new System.Drawing.Point(4, 22);
this.allResultsTabPage.Name = "allResultsTabPage";
this.allResultsTabPage.Padding = new System.Windows.Forms.Padding(3);
this.allResultsTabPage.Size = new System.Drawing.Size(1187, 422);
this.allResultsTabPage.TabIndex = 0;
this.allResultsTabPage.Text = "All results";
this.allResultsTabPage.UseVisualStyleBackColor = true;
this.oneWMResultsCtrl.Caption = "---";
this.oneWMResultsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.oneWMResultsCtrl.Location = new System.Drawing.Point(3, 3);
this.oneWMResultsCtrl.Name = "oneWMResultsRowsCtrl";
this.oneWMResultsCtrl.Size = new System.Drawing.Size(1181, 416);
this.oneWMResultsCtrl.TabIndex = 0;
//
// MoreWMResultsDlg
//
@@ -140,6 +153,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Water meter results";
this.tabControl1.ResumeLayout(false);
this.allResultsTabPage.ResumeLayout(false);
this.productionTracingTabPage.ResumeLayout(false);
this.productionTracingSplitContainer.Panel1.ResumeLayout(false);
this.productionTracingSplitContainer.Panel1.PerformLayout();
@@ -153,12 +167,12 @@
#endregion
private System.Windows.Forms.TabControl tabControl1;
private OneWMResultsRowsCtrl oneWMResultsCtrl;
private System.Windows.Forms.TabPage graphsTabPage;
private System.Windows.Forms.TabPage productionTracingTabPage;
private System.Windows.Forms.SplitContainer productionTracingSplitContainer;
private System.Windows.Forms.Label messageLabel;
private System.Windows.Forms.ListView tracingResultsListView;
private System.Windows.Forms.TabPage allResultsTabPage;
private OneWMResultsRowsCtrl oneWMResultsCtrl;
}
}
+45 -45
View File
@@ -59,57 +59,57 @@ namespace Results.Forms
/// <param name="wMtr">Water meter entity</param>
void ShowAllResults(Results.Entities.WaterMeter wMtr)
{
// string message;
// Color commonBackColor = wMtr.GetColorOfResults(false, out message); /// Ony message is used later on
//#if ORACLE_DB
// oneWMResultsCtrl.Caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
//#else
// oneWMResultsCtrl.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
//#endif
string message;
Color commonBackColor = wMtr.GetColorOfResults(false, out message); /// Ony message is used later on
#if ORACLE_DB
oneWMResultsCtrl.Caption = string.Format("{0} ({1}) {2}", wMtr.SerialNr ?? string.Empty, wMtr.Pruefindex % 100, message);
#else
oneWMResultsCtrl.Caption = string.Format("s/n = {0}", wMtr.SerialNr ?? string.Empty);
#endif
// IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.AllItems;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.AllItems;
// // Header
// oneWMResultsCtrl.Columns.Add(wMtr.WMPosition.ToString(), 100);
// int i = 1;
// foreach (var str in wMtr.GetAllDecoratedTestNames())
// {
// oneWMResultsCtrl.Columns.Add(str, 100);
// i++;
// }
// Header
oneWMResultsCtrl.Columns.Add(wMtr.WMPosition.ToString(), 100);
int i = 1;
foreach (var str in wMtr.GetAllDecoratedTestNames())
{
oneWMResultsCtrl.Columns.Add(str, 100);
i++;
}
// foreach (var item in items)
// {
// ListViewItem lvi = new ListViewItem(item.Name);
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.Name);
// foreach (var mtr in wMtr.MeterTestRslts)
// {
// if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Publish.Never &&
// mtr.Publish() != Publish.Internal)
// {
// string str = item.Print(wMtr, mtr.Name());
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Common.Publish.Never &&
mtr.Publish() != Common.Publish.Internal)
{
string str = item.Print(wMtr, mtr.Name());
// string[] texts = str.Split(new char[] { '|' });
// if (texts.Length == 1)
// {
// lvi.SubItems.Add(str);
// }
// else if (texts.Length == 2)
// {
// Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
// lvi.UseItemStyleForSubItems = false;
// lvi.SubItems.Add(texts[0]);
// lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
// }
// else
// {
// lvi.SubItems.Add(string.Empty);
// }
// }
// }
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
// oneWMResultsCtrl.Items.Add(lvi);
// }
oneWMResultsCtrl.Items.Add(lvi);
}
}
+7 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
using System;
using System.Drawing;
@@ -24,13 +24,16 @@ namespace Results.Forms
}
}
public string Caption { set { caption = value; } get { return caption; } }
public ListView.ListViewItemCollection Items { get { return lView.Items; } }
bool disabled;
int wmPosition; /// 1-based water meter position
string caption;
Color bkColor;
int[] columnWidths;
IList<Results.WMeterRsltItemSpec> items;
IList<WMeterRsltItemSpec> items;
public bool Disabled { get { return disabled; } } /// Read only
@@ -45,7 +48,7 @@ namespace Results.Forms
wmPosition = 0;
tBox.Text = caption = "---";
tBox.BackColor = lView.BackColor = bkColor = Color.White;
items = new List<Results.WMeterRsltItemSpec>();
items = new List<WMeterRsltItemSpec>();
columnWidths = new int[0];
}
@@ -62,7 +65,7 @@ namespace Results.Forms
}
}
public void Update(IList<Results.WMeterRsltItemSpec> items)
public void Update(IList<WMeterRsltItemSpec> items)
{
this.items = items;
+5
View File
@@ -343,6 +343,11 @@ namespace Results
X9, /// 291
RadioAddress, /// 292
OriRadioAddress, /// 293
Pls_per_ltr_aux, /// 294 Compound water meter constant (water meter data, not used in calculations)
Pulses_main, /// 295 Compound main meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
Pulses_aux, /// 296 Compound aux meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
Count,
}
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG;WARSAW_50;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;WARSAW_50;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG;WARSAW_50;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -32,7 +32,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;WARSAW_50;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.33.2070.0")]
[assembly: AssemblyFileVersion("2.33.2070.0")]
[assembly: AssemblyVersion("2.33.2127.0")]
[assembly: AssemblyFileVersion("2.33.2127.0")]
+55 -10
View File
@@ -19,7 +19,7 @@ namespace TBF.Resources {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Strings {
@@ -294,6 +294,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to All files.
/// </summary>
internal static string All_files {
get {
return ResourceManager.GetString("All_files", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to All tests must be completed.
/// </summary>
@@ -645,6 +654,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Calibration certificate.
/// </summary>
internal static string Calibration_certificate {
get {
return ResourceManager.GetString("Calibration_certificate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Calibration certificate validity expired.
/// </summary>
@@ -2274,6 +2292,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Get number of cycles to bypass.
/// </summary>
internal static string Get_number_of_cycles_to_bypass {
get {
return ResourceManager.GetString("Get_number_of_cycles_to_bypass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Grab.
/// </summary>
@@ -3615,6 +3642,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to PDF files.
/// </summary>
internal static string PDF_files {
get {
return ResourceManager.GetString("PDF_files", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PID.
/// </summary>
@@ -5091,6 +5127,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Set number of cycles to bypass.
/// </summary>
internal static string Set_number_of_cycles_to_bypass {
get {
return ResourceManager.GetString("Set_number_of_cycles_to_bypass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Set route.
/// </summary>
@@ -5424,15 +5469,6 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string String1 {
get {
return ResourceManager.GetString("String1", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sun.
/// </summary>
@@ -6273,6 +6309,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Unlock a bypass.
/// </summary>
internal static string Unlock_bypass {
get {
return ResourceManager.GetString("Unlock_bypass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unlock.
/// </summary>
+20 -2
View File
@@ -673,7 +673,7 @@
<value>Tiskárna</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Prodedura</value>
<value>Procedura</value>
</data>
<data name="Procedures" xml:space="preserve">
<value>Procedury</value>
@@ -1177,7 +1177,7 @@
<value>Tisk výsledků</value>
</data>
<data name="Procedure_name" xml:space="preserve">
<value>Jméno postupu</value>
<value>Jméno procedury</value>
</data>
<data name="Process" xml:space="preserve">
<value>Proces</value>
@@ -1683,4 +1683,22 @@
<data name="default_printer" xml:space="preserve">
<value>předvolená tiskárna</value>
</data>
<data name="Get_number_of_cycles_to_bypass" xml:space="preserve">
<value>Zjisti počet cyklů bez kontroly</value>
</data>
<data name="Set_number_of_cycles_to_bypass" xml:space="preserve">
<value>Nastav počet cyklů bez kontroly</value>
</data>
<data name="Unlock_bypass" xml:space="preserve">
<value>Odemknout vypnutí kontroly</value>
</data>
<data name="All_files" xml:space="preserve">
<value>Všechny soubory</value>
</data>
<data name="Calibration_certificate" xml:space="preserve">
<value>Kalibrační certifikát</value>
</data>
<data name="PDF_files" xml:space="preserve">
<value>PDF soubory</value>
</data>
</root>
+21
View File
@@ -2314,4 +2314,25 @@
<data name="default_printer" xml:space="preserve">
<value>default printer</value>
</data>
<data name="Get_number_of_cycles_to_bypass" xml:space="preserve">
<value>Get number of cycles to bypass</value>
</data>
<data name="Set_number_of_cycles_to_bypass" xml:space="preserve">
<value>Set number of cycles to bypass</value>
</data>
<data name="Unlock_bypass" xml:space="preserve">
<value>Unlock a bypass</value>
</data>
<data name="Error_reading_configuration_database" xml:space="preserve">
<value>Error reading configuration database</value>
</data>
<data name="All_files" xml:space="preserve">
<value>All files</value>
</data>
<data name="Calibration_certificate" xml:space="preserve">
<value>Calibration certificate</value>
</data>
<data name="PDF_files" xml:space="preserve">
<value>PDF files</value>
</data>
</root>
+19
View File
@@ -0,0 +1,19 @@
///
/// Copyright (c) 2023 Sensus Slovensko a.s.
///
using System;
namespace TBF.Rig
{
public class DataChangeArgs : EventArgs
{
public CfgChangeCmd Command;
public object Data;
public DataChangeArgs(CfgChangeCmd command, object data)
{
Command = command;
Data = data;
}
}
}
@@ -47,6 +47,7 @@ namespace TBF.Rig.DataContainers.BenchInfo.iPerl
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -88,6 +89,7 @@ namespace TBF.Rig.DataContainers.BenchInfo.iPerl
MaxTestIndex = 4;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -349,6 +351,10 @@ namespace TBF.Rig.DataContainers.BenchInfo.iPerl
prms.LenghtUnit = this.LenghtUnit;
prms.Side = this.Side;
prms.MaxTestIndex = this.MaxTestIndex;
prms.CalibCertificateNr = this.CalibCertificateNr;
prms.CertPath = this.CertPath;
prms.CalibDate = this.CalibDate;
prms.CalibValidDate = this.CalibValidDate;
}
public IParamsProvider Clone()
@@ -27,6 +27,7 @@ namespace TBF.Rig.DataContainers.Buoyancy
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -50,6 +51,7 @@ namespace TBF.Rig.DataContainers.Buoyancy
Buoyancy = 1.00103;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -112,6 +114,10 @@ namespace TBF.Rig.DataContainers.Buoyancy
void CopyContentTo(ComponentCfg prms)
{
prms.Buoyancy = this.Buoyancy;
prms.CalibCertificateNr = this.CalibCertificateNr;
prms.CertPath = this.CertPath;
prms.CalibDate = this.CalibDate;
prms.CalibValidDate = this.CalibValidDate;
}
public IParamsProvider Clone()
@@ -28,6 +28,7 @@ namespace TBF.Rig.DataContainers.Density
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -52,6 +53,7 @@ namespace TBF.Rig.DataContainers.Density
AtTemperature = 20.0; /// °C
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -122,6 +124,10 @@ namespace TBF.Rig.DataContainers.Density
{
prms.RealDensity = this.RealDensity;
prms.AtTemperature = this.AtTemperature;
prms.CalibCertificateNr = this.CalibCertificateNr;
prms.CertPath = this.CertPath;
prms.CalibDate = this.CalibDate;
prms.CalibValidDate = this.CalibValidDate;
}
public IParamsProvider Clone()
@@ -21,6 +21,7 @@ namespace TBF.Rig.DataContainers.Evaporation
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -42,6 +43,7 @@ namespace TBF.Rig.DataContainers.Evaporation
public void InitializeAll()
{
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
+2
View File
@@ -31,6 +31,7 @@ namespace TBF.Rig.Elde.Diverter
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -53,6 +54,7 @@ namespace TBF.Rig.Elde.Diverter
ThresholdHi = 90;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
+34
View File
@@ -54,6 +54,12 @@ namespace TBF.Rig.Elde.FlowMeter
public string CalibCertificate3;
public string CalibCertificate4;
public string CalibCertificate5;
public string CertPath;
public string CertPath1;
public string CertPath2;
public string CertPath3;
public string CertPath4;
public string CertPath5;
public DateTime CalibDate;
public DateTime CalibDate1;
public DateTime CalibDate2;
@@ -166,6 +172,34 @@ namespace TBF.Rig.Elde.FlowMeter
}
}
public string GetCertPath(int rangeIx1)
{
switch (rangeIx1)
{
default:
case 0: return CertPath;
case 1: return CertPath1;
case 2: return CertPath2;
case 3: return CertPath3;
case 4: return CertPath4;
case 5: return CertPath5;
}
}
public void SetCertPath(int rangeIx1, string certificate)
{
switch (rangeIx1)
{
default:
case 0: CertPath = certificate; return;
case 1: CertPath1 = certificate; return;
case 2: CertPath2 = certificate; return;
case 3: CertPath3 = certificate; return;
case 4: CertPath4 = certificate; return;
case 5: CertPath5 = certificate; return;
}
}
public DateTime GetCalibDate(int rangeIx1)
{
switch (rangeIx1)
+35 -2
View File
@@ -1,9 +1,8 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.Rig.Generic;
@@ -55,6 +54,12 @@ namespace TBF.Rig.Elde.FlowMeterDewa
public string CalibCertificate3;
public string CalibCertificate4;
public string CalibCertificate5;
public string CertPath;
public string CertPath1;
public string CertPath2;
public string CertPath3;
public string CertPath4;
public string CertPath5;
public DateTime CalibDate;
public DateTime CalibDate1;
public DateTime CalibDate2;
@@ -167,6 +172,34 @@ namespace TBF.Rig.Elde.FlowMeterDewa
}
}
public string GetCertPath(int rangeIx1)
{
switch (rangeIx1)
{
default:
case 0: return CertPath;
case 1: return CertPath1;
case 2: return CertPath2;
case 3: return CertPath3;
case 4: return CertPath4;
case 5: return CertPath5;
}
}
public void SetCertPath(int rangeIx1, string certificate)
{
switch (rangeIx1)
{
default:
case 0: CertPath = certificate; return;
case 1: CertPath1 = certificate; return;
case 2: CertPath2 = certificate; return;
case 3: CertPath3 = certificate; return;
case 4: CertPath4 = certificate; return;
case 5: CertPath5 = certificate; return;
}
}
public DateTime GetCalibDate(int rangeIx1)
{
switch (rangeIx1)
+1 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -26,6 +26,7 @@ namespace TBF.Rig.Elde.PressureMeter
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -29,6 +29,7 @@ namespace TBF.Rig.Elde.PressureMeterInternal
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
+2
View File
@@ -29,6 +29,7 @@ namespace TBF.Rig.Elde.TempMeter
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -51,6 +52,7 @@ namespace TBF.Rig.Elde.TempMeter
DefaultTemperature = 20.0;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -29,6 +29,7 @@ namespace TBF.Rig.Elde.TempMeterInternal
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -51,6 +52,7 @@ namespace TBF.Rig.Elde.TempMeterInternal
A5 = 0;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -44,6 +44,7 @@ namespace TBF.Rig.Elde.TempMeterMeret
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -69,6 +70,7 @@ namespace TBF.Rig.Elde.TempMeterMeret
MeretIdx0 = 4;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -172,6 +174,10 @@ namespace TBF.Rig.Elde.TempMeterMeret
prms.TempIdx0 = this.TempIdx0;
prms.ModbusAddress = this.ModbusAddress;
prms.MeretIdx0 = this.MeretIdx0;
prms.CalibCertificateNr = this.CalibCertificateNr;
prms.CertPath = this.CertPath;
prms.CalibDate = this.CalibDate;
prms.CalibValidDate = this.CalibValidDate;
}
+3 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
namespace TBF.Rig
{
@@ -31,6 +31,8 @@ namespace TBF.Rig
GetAdc, /// Get regul.valve or diverter ADC
GetAdc1, /// Get regul.valve or diverter ADC feedback value #1
GetAdc2, /// Get regul.valve or diverter ADC feedback value #2
SetData, /// Generic set
GetData, /// Generic get
}
public enum ValveCategory
+5 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2018 Sensus Metering Systems
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
///
using System;
using TBF.Rig.Generic;
@@ -11,8 +11,9 @@ namespace TBF.Rig.GenericDevices
///
/// Parameters displayed in Metrology tab page
///
string CalibCertificateNr { get; set; } /// calibration certificate number
DateTime CalibDate { get; set; } /// date of calibration
DateTime CalibValidDate { get; set; } /// calibration valid until (date)
string CalibCertificateNr { get; set; } /// Calibration certificate ID
string CertPath { get; set; } /// Path to a calibration certificate PDF document
DateTime CalibDate { get; set; } /// Date of calibration
DateTime CalibValidDate { get; set; } /// Calibration is valid until (date)
}
}
+5 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using TBF.Rig.Generic;
@@ -20,11 +20,13 @@ namespace TBF.Rig.GenericDevices
double GetPressHi(int rangeIx1);
string GetCalibCertificate(int rangeIx1); /// Get calibration certificate number
string GetCertPath(int rangeIx1); /// Get path to a calibration certificate PDF document
DateTime GetCalibDate(int rangeIx1); /// Get the date of calibration
DateTime GetCalibValidDate(int rangeIx1); /// Get calibration valid until (date)
void SetCalibCertificate(int rangeIx1, string certificate); /// Set calibration certificate number
void SetCalibDate(int rangeIx1, DateTime date); /// Get the date of calibration
void SetCalibValidDate(int rangeIx1, DateTime date); /// Get calibration valid until (date)
void SetCertPath(int rangeIx1, string certPath); /// Set path to a calibration certificate PDF document
void SetCalibDate(int rangeIx1, DateTime date); /// Set the date of calibration
void SetCalibValidDate(int rangeIx1, DateTime date); /// Set calibration valid until (date)
}
}
+7 -4
View File
@@ -1,13 +1,10 @@
///
/// Copyright (c) 2018-2021 Sensus Slovensko a.s.
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
namespace TBF.Rig.Hart.Nivotrack
@@ -38,6 +35,7 @@ namespace TBF.Rig.Hart.Nivotrack
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -63,6 +61,7 @@ namespace TBF.Rig.Hart.Nivotrack
Par2 = 8;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -179,6 +178,10 @@ namespace TBF.Rig.Hart.Nivotrack
prms.Address = this.Address;
prms.Par1 = this.Par1;
prms.Par2 = this.Par2;
prms.CalibCertificateNr = this.CalibCertificateNr;
prms.CertPath = this.CertPath;
prms.CalibDate = this.CalibDate;
prms.CalibValidDate = this.CalibValidDate;
}
+2 -2
View File
@@ -1,9 +1,8 @@
///
/// Copyright (c) 2016-2021 Sensus Metering Systems
/// Copyright (c) 2016-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.Rig.Generic;
@@ -37,6 +36,7 @@ namespace TBF.Rig.Keithley.TempMeter
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
+18 -50
View File
@@ -1,8 +1,7 @@
///
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
@@ -48,56 +47,20 @@ namespace TBF.Rig.MettlerToledo.Multi
public StopBits StopBits;
public Handshake Handshake;
///
/// Buoyancy related serialized parameters - Displayed in Metrology tab page
///
float buoyancyTemp;
float buoyancyPress;
float buoyancyHumi;
float weightStandardDensity;
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
///
public float BuoyancyTemp
{
get { return buoyancyTemp; }
set { buoyancyTemp = value; }
}
public float BuoyancyPress
{
get { return buoyancyPress; }
set { buoyancyPress = value; }
}
public float BuoyancyHumi
{
get { return buoyancyHumi; }
set { buoyancyHumi = value; }
}
public float WeightStandardDensity
{
get { return weightStandardDensity; }
set { weightStandardDensity = value; }
}
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Buoyancy related serialized parameters displayed in Metrology tab page
public float BuoyancyTemp { get; set; }
public float BuoyancyPress { get; set; }
public float BuoyancyHumi { get; set; }
public float WeightStandardDensity { get; set; }
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
BalanceCfg()
BalanceCfg()
{
Name = "Balance";
ParentName = string.Empty;
@@ -119,6 +82,11 @@ namespace TBF.Rig.MettlerToledo.Multi
BuoyancyTemp = 20.0f;
BuoyancyPress = 1.0f;
BuoyancyHumi = 40.0f;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
public BalanceCfg(IComponentFactory factory)
+3 -2
View File
@@ -1,8 +1,7 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
@@ -52,6 +51,7 @@ namespace TBF.Rig.MettlerToledo.Standard
/// Calibration info serialized parameters displayed in Metrology tab page
public string CalibCertificateNr { get; set; }
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
@@ -88,6 +88,7 @@ namespace TBF.Rig.MettlerToledo.Standard
BuoyancyHumi = 40.0f;
CalibCertificateNr = string.Empty;
CertPath = string.Empty;
CalibDate = TBF.UI.Constants.MinDate;
CalibValidDate = TBF.UI.Constants.MaxDate;
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2023 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using System.Xml.Serialization;
@@ -19,7 +19,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
public string ConnStr;
public string ConnStr2;
public string NetAdapter;
public bool CheckPreviousRecords;
public bool SaveTracingRecords;
@@ -30,8 +29,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
{
ParentName = string.Empty;
NetAdapter = string.Empty;
ConnStr = "server=10.42.128.24; database=sledovanie2020; uid=vyroba2020; pwd=qwerty; charset=utf8;";
ConnStr2 = "server=10.42.128.24; database=sledovanie2019; uid=vyroba2019; pwd=qwerty; charset=utf8;";
ConnStr = "server=10.42.128.35; database=sledovanie2019; uid=sledovanie2019; pwd=velka-javorina-970; charset=utf8;";
CheckPreviousRecords = true;
SaveTracingRecords = true;
}
@@ -45,12 +43,11 @@ namespace TBF.Rig.Output.DB.ProductionTracing
public string ToString(int i)
{
return string.Format("Name={0}, CheckPrev.={1}, SaveRecords={2}, ConnStr={3}, , ConnStr2={4}",
return string.Format("Name={0}, CheckPrev={1}, SaveRecords={2}, ConnStr={3}",
Name,
CheckPreviousRecords,
SaveTracingRecords,
ConnStr,
ConnStr2);
ConnStr);
}
}
}
+57 -108
View File
@@ -3,7 +3,6 @@
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using log4net;
using FluentNHibernate.Cfg;
@@ -11,9 +10,7 @@ using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Criterion;
using Common;
using Config.Entities;
using TracingDB.Entities;
using Events.Entities;
namespace TBF.Rig.Output.DB.ProductionTracing
{
@@ -78,17 +75,11 @@ namespace TBF.Rig.Output.DB.ProductionTracing
/// </summary>
Results.Entities.Batch batch;
ISessionFactory sessionFactory; /// Factory to create database sessions that is initialized in the constructor
IList<Process> processes;
Dictionary<int, Process> processDictionary;
Dictionary<int, IList<Workstep>> workstepsDictionary;
ISessionFactory sessionFactory2; /// Factory to create database sessions that is initialized in the constructor
IList<Process> processes2;
Dictionary<int, Process> processDictionary2;
Dictionary<int, IList<Workstep>> workstepsDictionary2;
///
/// Previous workstep verification info
///
@@ -97,7 +88,9 @@ namespace TBF.Rig.Output.DB.ProductionTracing
Workstep verifiedWorkstep;
Part verifiedPart; /// Applicable when verifyReferencePart == false
bool verifyReferencePart;
int CyclesToSkip;
public Tracing() {}
@@ -127,18 +120,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
.SetProperty("hibernate.connection.connect_timeout", Const.MySqlConnectTimeoutSec)
.BuildSessionFactory();
/// Session factory 2 is used to create the 2nd database sessions
if (!string.IsNullOrEmpty(tracingCfg.ConnStr2))
{
sessionFactory2 = Fluently.Configure()
.Database(FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard.ConnectionString(tracingCfg.ConnStr2))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<TracingDB.Entities.Process>())
.ExposeConfiguration(TracingDB.DB.BuildSchema)
.BuildConfiguration()
.SetProperty("hibernate.connection.connect_timeout", Const.MySqlConnectTimeoutSec)
.BuildSessionFactory();
}
/// Register this test bench in the tracing DB for approx. 2 weeks
var session = sessionFactory.OpenSession();
#if !DEBUG
@@ -155,6 +136,9 @@ namespace TBF.Rig.Output.DB.ProductionTracing
session.Close();
TracingDB.DB.SessionFactory = sessionFactory;
CyclesToSkip = 0;
log.FatalFormat("{0} initialized: {1}", Name, this);
}
else
@@ -163,6 +147,35 @@ namespace TBF.Rig.Output.DB.ProductionTracing
}
}
#region Configuration Change Handling
public static void OnDataChange(object sender, DataChangeArgs args)
{
if (DataChangeHandler == null) return;
try { DataChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<DataChangeArgs> DataChangeHandler;
public override void StartChangeHandler()
{
DataChangeHandler += delegate (object sender, DataChangeArgs args)
{
var intbox = args.Data as Boxes.IntBox;
if (args.Command == CfgChangeCmd.SetData && intbox != null)
{
CyclesToSkip = intbox.Val;
}
else if (args.Command == CfgChangeCmd.GetData)
{
TracingCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(CfgChangeCmd.GetData, 0, CyclesToSkip));
}
};
}
#endregion Configuration Change Handling
///
/// IDevice interface implementation
///
@@ -260,7 +273,16 @@ namespace TBF.Rig.Output.DB.ProductionTracing
{
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
opCompleted = true;
if (CheckPreviousRecords(waterMeters) != Retv.OK) anyError = true;
if (CyclesToSkip > 0)
{
CyclesToSkip--;
}
else if (CheckPreviousRecords(waterMeters) != Retv.OK)
{
anyError = true;
}
return anyError ? Event.InfoNotRead : Event.InfoRead;
}
else
@@ -359,7 +381,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
if ((wm != null) && !wm.Disabled)
{
CheckPreviousRecordOfSingleWM(session, wm, 1);
CheckPreviousRecordOfSingleWM(session, wm);
if (wm.LastRecordIsNok)
{
isAtLeastOneNOK = true;
@@ -370,34 +392,15 @@ namespace TBF.Rig.Output.DB.ProductionTracing
retVal = Retv.OK;
}
if (isAtLeastOneNOK && (sessionFactory2 != null))
{
using (ISession session2 = sessionFactory2.OpenSession())
{
for (int i = 0; i < waterMeters.Count; i++)
{
Results.Entities.WaterMeter wm = waterMeters[i];
if ((wm != null) && !wm.Disabled && wm.LastRecordIsNok)
{
CheckPreviousRecordOfSingleWM(session2, wm, 2);
}
}
retVal = Retv.OK;
}
}
return retVal;
}
Retv CheckPreviousRecordOfSingleWM(ISession session, Results.Entities.WaterMeter wm, int sessionId)
Retv CheckPreviousRecordOfSingleWM(ISession session, Results.Entities.WaterMeter wm)
{
if (string.IsNullOrEmpty(wm.SerialNr))
{
/// S/N is missing
wm.ProcessId = 0;
wm.SessionId = 0;
wm.LastRecordIsNok = false; /// OK, this is an RFID comm. error, not a production tracing error
return Retv.OK;
}
@@ -431,7 +434,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
{
/// No records found
wm.ProcessId = 0;
wm.SessionId = sessionId;
wm.LastRecordIsNok = true; /// NOK
///
return Retv.OK;
@@ -479,7 +481,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
wm.ProcessId = currentProcess.Id;
wm.SessionId = sessionId;
wm.LastRecordIsNok = true; /// NOK (=default if no matching record found)
foreach (var rcrd in records)
{
@@ -500,7 +501,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
/// </summary>
/// <param name="session">DB session</param>
/// <param name="batch">Batch entity</param>
Retv SaveTracingRecords(Results.Entities.Batch batch)
public Retv SaveTracingRecords(Results.Entities.Batch batch)
{
ITransaction transaction = null;
ISession session = null;
@@ -516,10 +517,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
int writtenRecordsCount = 0;
foreach (var wMtr in batch.WaterMeters)
{
if (wMtr.SessionId == 1)
{
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
}
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
}
transaction.Commit();
session.Flush();
@@ -545,51 +543,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
}
}
if (sessionFactory2 != null)
{
///
/// Save to alternative tracing DB
///
transaction = null;
session = null;
try
{
session = sessionFactory2.OpenSession();
transaction = session.BeginTransaction();
int writtenRecordsCount = 0;
foreach (var wMtr in batch.WaterMeters)
{
if (wMtr.SessionId == 2)
{
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
}
}
transaction.Commit();
session.Flush();
log.ErrorFormat("Batch {0}: {1} of {2} watermeters written to the alternative production tracing DB",
batch.BatchNr, writtenRecordsCount, batch.WaterMeters.Count);
}
catch (Exception exc)
{
if (transaction != null && !transaction.WasCommitted) transaction.Rollback();
log.WarnFormat("Failed to write results of batch {0} to production tracing DB: {1}",
batch.BatchNr, exc.Message);
return Retv.Error;
}
finally
{
if (session != null)
{
session.Close();
session.Dispose();
}
}
}
return Retv.OK;
}
@@ -602,12 +555,12 @@ namespace TBF.Rig.Output.DB.ProductionTracing
/// <returns>Number of written reference record</returns>
int SaveSingleWM2DB(ISession session, Results.Entities.WaterMeter wm)
{
if (string.IsNullOrEmpty(wm.SerialNr) || (wm.ProcessId == 0))
if (string.IsNullOrEmpty(wm.SerialNr))
{
/// Without PCB number there is no DB activity
return 0;
}
else if ((currentProcess != null) && (wm.ProcessId == currentProcess.Id))
else if (wm.ProcessId != 0 && currentProcess != null && wm.ProcessId == currentProcess.Id)
{
/// Process is already loaded => save a reference record for this WM
session.SaveOrUpdate(new ReferenceRecord(currentProcess, currentWorkstep, wm.SerialNr, Users.CurrentUser.UserName(), workplace, wm.Passed ? 0 : 1));
@@ -639,23 +592,19 @@ namespace TBF.Rig.Output.DB.ProductionTracing
///
/// Get all already existing reference records with Code == wm.SerialNr, refRecords[0] will be the most recent one
IList<ReferenceRecord> refRecords;
int trialsCount = 0;
do
{
if (trialsCount > 0) ReadProcessesFromDB(session);
ReadProcessesFromDB(session);
refRecords = session.QueryOver<ReferenceRecord>()
var refRecords = session.QueryOver<ReferenceRecord>()
.Where(rr => (rr.Code == wm.SerialNr))
.OrderBy(rr => rr.TimeStamp).Desc
.List();
trialsCount++;
}
while (refRecords.Count == 0 && trialsCount <= 2);
/// Save a new reference record from this test bench if workstep "Test_bench" is defined in the obtained WM process
IList<Workstep> worksteps;
if ((refRecords.Count > 0) && workstepsDictionary.TryGetValue(refRecords[0].Process.Id, out worksteps) && (worksteps.Count == 1))
if (refRecords.Count > 0 &&
workstepsDictionary.TryGetValue(refRecords[0].Process.Id, out worksteps) &&
worksteps != null &&
worksteps.Count == 1)
{
session.SaveOrUpdate(new ReferenceRecord(refRecords[0].Process, worksteps[0], wm.SerialNr, Users.CurrentUser.UserName(), workplace, wm.Passed ? 0 : 1));
return 1;
@@ -1,19 +1,24 @@
///
/// Copyright (c) 2018-2019 Sensus Slovensko a.s.
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using System.Collections.Generic;
using System.Net;
using System.Windows.Forms;
using log4net;
using Common;
using TBF.Resources;
using TBF.Rig.Generic;
using TBF.Rig.Elde.Diverter;
using TBF.Boxes;
namespace TBF.Rig.Output.DB.ProductionTracing
{
public partial class TracingCfgCtrl : Configs.ConfigCtrlUtils, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
static readonly ILog log = LogManager.GetLogger(typeof(TracingCfgCtrl));
public bool ShowMore { get { return false; } }
MonitoringCfg config;
public IComponentCfg Config
@@ -34,21 +39,30 @@ namespace TBF.Rig.Output.DB.ProductionTracing
private void WriterCfgCtrl_Load(object sender, EventArgs e)
{
if (config == null) return;
Localize();
Redraw();
}
StartResponseHandler();
}
public void Closing()
public void Closing()
{
}
StopResponseHandler();
}
void Redraw()
void Localize()
{
unlockBypassButton.Text = Strings.Unlock_bypass;
setCyclesToBypassButton.Text = Strings.Set_number_of_cycles_to_bypass;
getCyclesToBypassButton.Text = Strings.Get_number_of_cycles_to_bypass;
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
connStrTextBox.Text = config.ConnStr;
connStr2TextBox.Text = config.ConnStr2;
checkPreviousRecordsCheckBox.Checked = config.CheckPreviousRecords;
saveTracingRecordsCheckBox.Checked = config.SaveTracingRecords;
@@ -104,13 +118,30 @@ namespace TBF.Rig.Output.DB.ProductionTracing
{
nameTextBox.Enabled = true;
connStrTextBox.Enabled = true;
connStr2TextBox.Enabled = true;
netAdapterComboBox.Enabled = true;
checkPreviousRecordsCheckBox.Enabled = true;
saveTracingRecordsCheckBox.Enabled = true;
cyclesToBypassTextBox.Enabled = true;
setCyclesToBypassButton.Enabled = true;
unlockBypassButton.Enabled = false;
}
public CfgUpdateFlags VerifyCfg(ref string message)
private void unlockSkipCyclesButton_Click(object sender, EventArgs e)
{
var reqrdGrpMembership = new GID[] { GID.TraceabilityManagement, GID.HeadOfLab };
if (!Users.CurrentUser.IsMemberOf(reqrdGrpMembership))
{
if (new Users.Forms.LoginDlg(TBF.DB.UserSessionFactories, reqrdGrpMembership, ParentForm).ShowDialog() != DialogResult.OK)
return;
}
cyclesToBypassTextBox.Enabled = true;
setCyclesToBypassButton.Enabled = true;
unlockBypassButton.Enabled = false;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
return CfgUpdateFlags.None;
}
@@ -128,7 +159,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
}
flags |= UpdateDifferent(ref config.ConnStr, connStrTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.ConnStr2, connStr2TextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.CheckPreviousRecords, checkPreviousRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.SaveTracingRecords, saveTracingRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
@@ -144,5 +174,54 @@ namespace TBF.Rig.Output.DB.ProductionTracing
return flags;
}
}
private void setCyclesToSkipButton_Click(object sender, EventArgs e)
{
int cyclesToSkip = 0;
if (!int.TryParse(cyclesToBypassTextBox.Text, out cyclesToSkip) || cyclesToSkip < 0 || cyclesToSkip > 20)
{
MessageBox.Show(string.Format(Strings.Invalid_0, "(0..20)"));
return;
}
Tracing.OnDataChange(this, new DataChangeArgs(CfgChangeCmd.SetData, new IntBox(cyclesToSkip)));
}
private void getCyclesToSkipButton_Click(object sender, EventArgs e)
{
Tracing.OnDataChange(this, new DataChangeArgs(CfgChangeCmd.GetData, null));
}
#region Data Change Handling
public static void OnCmdResponse(object sender, CmdResponseArgs args)
{
if (CmdResponseHandler == null) return;
try { CmdResponseHandler(sender, args); }
catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); }
}
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
public void StartResponseHandler()
{
CmdResponseHandler += DoCmdResponse;
}
public void StopResponseHandler()
{
CmdResponseHandler -= DoCmdResponse;
}
void DoCmdResponse(object sender, CmdResponseArgs args)
{
if (args.Command == CfgChangeCmd.GetData)
{
cyclesToBypassTextBox2.Text = args.Response.ToString();
}
}
#endregion Configuration Change Handling
}
}
+103 -27
View File
@@ -40,8 +40,15 @@ namespace TBF.Rig.Output.DB.ProductionTracing
this.checkPreviousRecordsCheckBox = new System.Windows.Forms.CheckBox();
this.netAdapterLabel = new System.Windows.Forms.Label();
this.netAdapterComboBox = new System.Windows.Forms.ComboBox();
this.connStr2TextBox = new System.Windows.Forms.TextBox();
this.connStr2Label = new System.Windows.Forms.Label();
this.cyclesToBypassTextBox = new System.Windows.Forms.TextBox();
this.setCyclesToBypassButton = new System.Windows.Forms.Button();
this.getCyclesToBypassButton = new System.Windows.Forms.Button();
this.cyclesToBypassTextBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.bypassGroupBox = new System.Windows.Forms.GroupBox();
this.unlockBypassButton = new System.Windows.Forms.Button();
this.bypassGroupBox.SuspendLayout();
this.SuspendLayout();
//
// nameTextBox
@@ -73,7 +80,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
// connStrTextBox
//
this.connStrTextBox.Enabled = false;
this.connStrTextBox.Location = new System.Drawing.Point(8, 74);
this.connStrTextBox.Location = new System.Drawing.Point(8, 79);
this.connStrTextBox.Name = "connStrTextBox";
this.connStrTextBox.Size = new System.Drawing.Size(435, 20);
this.connStrTextBox.TabIndex = 4;
@@ -81,7 +88,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
// connStrLabel
//
this.connStrLabel.AutoSize = true;
this.connStrLabel.Location = new System.Drawing.Point(5, 58);
this.connStrLabel.Location = new System.Drawing.Point(5, 63);
this.connStrLabel.Name = "connStrLabel";
this.connStrLabel.Size = new System.Drawing.Size(92, 13);
this.connStrLabel.TabIndex = 3;
@@ -91,7 +98,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
//
this.saveTracingRecordsCheckBox.AutoSize = true;
this.saveTracingRecordsCheckBox.Enabled = false;
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(117, 221);
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(117, 181);
this.saveTracingRecordsCheckBox.Name = "saveTracingRecordsCheckBox";
this.saveTracingRecordsCheckBox.Size = new System.Drawing.Size(177, 17);
this.saveTracingRecordsCheckBox.TabIndex = 10;
@@ -102,7 +109,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
//
this.checkPreviousRecordsCheckBox.AutoSize = true;
this.checkPreviousRecordsCheckBox.Enabled = false;
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(117, 199);
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(117, 159);
this.checkPreviousRecordsCheckBox.Name = "checkPreviousRecordsCheckBox";
this.checkPreviousRecordsCheckBox.Size = new System.Drawing.Size(138, 17);
this.checkPreviousRecordsCheckBox.TabIndex = 9;
@@ -112,7 +119,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
// netAdapterLabel
//
this.netAdapterLabel.AutoSize = true;
this.netAdapterLabel.Location = new System.Drawing.Point(5, 147);
this.netAdapterLabel.Location = new System.Drawing.Point(5, 107);
this.netAdapterLabel.Name = "netAdapterLabel";
this.netAdapterLabel.Size = new System.Drawing.Size(89, 13);
this.netAdapterLabel.TabIndex = 7;
@@ -122,34 +129,95 @@ namespace TBF.Rig.Output.DB.ProductionTracing
//
this.netAdapterComboBox.Enabled = false;
this.netAdapterComboBox.FormattingEnabled = true;
this.netAdapterComboBox.Location = new System.Drawing.Point(8, 163);
this.netAdapterComboBox.Location = new System.Drawing.Point(8, 123);
this.netAdapterComboBox.Name = "netAdapterComboBox";
this.netAdapterComboBox.Size = new System.Drawing.Size(435, 21);
this.netAdapterComboBox.TabIndex = 8;
//
// connStr2TextBox
// cyclesToBypassTextBox
//
this.connStr2TextBox.Enabled = false;
this.connStr2TextBox.Location = new System.Drawing.Point(8, 118);
this.connStr2TextBox.Name = "connStr2TextBox";
this.connStr2TextBox.Size = new System.Drawing.Size(434, 20);
this.connStr2TextBox.TabIndex = 6;
this.cyclesToBypassTextBox.Enabled = false;
this.cyclesToBypassTextBox.Location = new System.Drawing.Point(41, 25);
this.cyclesToBypassTextBox.Name = "cyclesToBypassTextBox";
this.cyclesToBypassTextBox.Size = new System.Drawing.Size(50, 20);
this.cyclesToBypassTextBox.TabIndex = 11;
//
// connStr2Label
// setCyclesToBypassButton
//
this.connStr2Label.AutoSize = true;
this.connStr2Label.Location = new System.Drawing.Point(5, 102);
this.connStr2Label.Name = "connStr2Label";
this.connStr2Label.Size = new System.Drawing.Size(101, 13);
this.connStr2Label.TabIndex = 5;
this.connStr2Label.Text = "Connection string 2:";
this.setCyclesToBypassButton.Enabled = false;
this.setCyclesToBypassButton.Location = new System.Drawing.Point(113, 23);
this.setCyclesToBypassButton.Name = "setCyclesToBypassButton";
this.setCyclesToBypassButton.Size = new System.Drawing.Size(163, 23);
this.setCyclesToBypassButton.TabIndex = 13;
this.setCyclesToBypassButton.Text = "Set number of cycles to bypass";
this.setCyclesToBypassButton.UseVisualStyleBackColor = true;
this.setCyclesToBypassButton.Click += new System.EventHandler(this.setCyclesToSkipButton_Click);
//
// getCyclesToBypassButton
//
this.getCyclesToBypassButton.Location = new System.Drawing.Point(41, 59);
this.getCyclesToBypassButton.Name = "getCyclesToBypassButton";
this.getCyclesToBypassButton.Size = new System.Drawing.Size(163, 23);
this.getCyclesToBypassButton.TabIndex = 14;
this.getCyclesToBypassButton.Text = "Get number of cycles to bypass";
this.getCyclesToBypassButton.UseVisualStyleBackColor = true;
this.getCyclesToBypassButton.Click += new System.EventHandler(this.getCyclesToSkipButton_Click);
//
// cyclesToBypassTextBox2
//
this.cyclesToBypassTextBox2.Location = new System.Drawing.Point(226, 61);
this.cyclesToBypassTextBox2.Name = "cyclesToBypassTextBox2";
this.cyclesToBypassTextBox2.Size = new System.Drawing.Size(50, 20);
this.cyclesToBypassTextBox2.TabIndex = 15;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(93, 28);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(19, 13);
this.label1.TabIndex = 16;
this.label1.Text = "-->";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(205, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(19, 13);
this.label2.TabIndex = 17;
this.label2.Text = "-->";
//
// bypassGroupBox
//
this.bypassGroupBox.Controls.Add(this.getCyclesToBypassButton);
this.bypassGroupBox.Controls.Add(this.label2);
this.bypassGroupBox.Controls.Add(this.cyclesToBypassTextBox);
this.bypassGroupBox.Controls.Add(this.label1);
this.bypassGroupBox.Controls.Add(this.setCyclesToBypassButton);
this.bypassGroupBox.Controls.Add(this.cyclesToBypassTextBox2);
this.bypassGroupBox.Location = new System.Drawing.Point(118, 222);
this.bypassGroupBox.Name = "bypassGroupBox";
this.bypassGroupBox.Size = new System.Drawing.Size(324, 99);
this.bypassGroupBox.TabIndex = 18;
this.bypassGroupBox.TabStop = false;
//
// unlockBypassButton
//
this.unlockBypassButton.Location = new System.Drawing.Point(8, 228);
this.unlockBypassButton.Name = "unlockBypassButton";
this.unlockBypassButton.Size = new System.Drawing.Size(100, 93);
this.unlockBypassButton.TabIndex = 19;
this.unlockBypassButton.Text = "Unlock a bypass";
this.unlockBypassButton.UseVisualStyleBackColor = true;
this.unlockBypassButton.Click += new System.EventHandler(this.unlockSkipCyclesButton_Click);
//
// TracingCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.connStr2TextBox);
this.Controls.Add(this.connStr2Label);
this.Controls.Add(this.unlockBypassButton);
this.Controls.Add(this.bypassGroupBox);
this.Controls.Add(this.netAdapterComboBox);
this.Controls.Add(this.netAdapterLabel);
this.Controls.Add(this.saveTracingRecordsCheckBox);
@@ -160,8 +228,10 @@ namespace TBF.Rig.Output.DB.ProductionTracing
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "TracingCfgCtrl";
this.Size = new System.Drawing.Size(450, 250);
this.Size = new System.Drawing.Size(450, 350);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.bypassGroupBox.ResumeLayout(false);
this.bypassGroupBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -178,7 +248,13 @@ namespace TBF.Rig.Output.DB.ProductionTracing
private System.Windows.Forms.CheckBox checkPreviousRecordsCheckBox;
private System.Windows.Forms.Label netAdapterLabel;
private System.Windows.Forms.ComboBox netAdapterComboBox;
private System.Windows.Forms.TextBox connStr2TextBox;
private System.Windows.Forms.Label connStr2Label;
}
private System.Windows.Forms.TextBox cyclesToBypassTextBox;
private System.Windows.Forms.Button setCyclesToBypassButton;
private System.Windows.Forms.Button getCyclesToBypassButton;
private System.Windows.Forms.TextBox cyclesToBypassTextBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox bypassGroupBox;
private System.Windows.Forms.Button unlockBypassButton;
}
}
+38 -33
View File
@@ -16,6 +16,7 @@ using Config.Entities;
using Results.Output;
using System.Text;
using Events.Entities;
using Results;
namespace TBF.Rig.Output.DB.SensusOracle
{
@@ -394,10 +395,42 @@ namespace TBF.Rig.Output.DB.SensusOracle
currentOpState = OpState.None;
}
#if ORACLE_DB
void GetTestInofFromProcedure(string logCaption)
{
///
/// Select or create appropriate test infos
///
IList<LUTestData> testsToSave = new List<LUTestData>();
int maxPruefungsNr = 0;
foreach (var td in Sequences.ProcessData.BatchRslts.Batch.Tests)
{
for (int repNr = 1; repNr <= td.Repeats; repNr++)
{
int testId = td.OraId + (td.Repeats - repNr) * td.OraIdRepetMulti;
if (testId != 0)
{
testsToSave.Add(new LUTestData(td, repNr));
if (Math.Abs(testId) > maxPruefungsNr) maxPruefungsNr = Math.Abs(testId);
}
}
}
LUTestData[] testsToSaveArr = testsToSave.ToArray();
Array.Sort(testsToSaveArr, new LUTestDataComparer());
completeTestInfo = testsToSaveArr;
log.WarnFormat("{0} selected test infos:", logCaption);
foreach (var cti in completeTestInfo)
{
log.WarnFormat(" ID={0} Rev={1} Test={2} PrfNrDB={3} QBzDB={4}",
wmTypeId, wmTypeRevision, cti.TestName, cti.Id, cti.Designation);
}
}
public Retv ReadStartInfoFromDB(OracleConnection conn)
{
GetTestInofFromProcedure("ReadStartInfoFromDB"); /// Create appropriate test infos
bool anyError = false;
try
{
@@ -420,9 +453,9 @@ namespace TBF.Rig.Output.DB.SensusOracle
return anyError ? Retv.Error : Retv.OK;
}
/// <summary>
/// Read start info of one water meter from the database
/// </summary>
/// <summary>
/// Read start info of one water meter from the database
/// </summary>
/// <param name="conn">Oracke DB connection</param>
/// <param name="wm">Water meter entity</param>
/// <returns>Retv.OK when successful, Retv.Error on error</returns>
@@ -790,35 +823,7 @@ namespace TBF.Rig.Output.DB.SensusOracle
throw new Exception(string.Format("Cannot save batch {0} to Oracle, missing entry in VT_WZTYP_SD", bat.BatchNr));
}
///
/// Select or create appropriate test infos
///
IList<LUTestData> testsToSave = new List<LUTestData>();
int maxPruefungsNr = 0;
double totalTestTime = 0;
foreach (var td in bat.Tests)
{
for (int repNr = 1; repNr <= td.Repeats; repNr++)
{
int testId = td.OraId + (td.Repeats - repNr) * td.OraIdRepetMulti;
if (testId != 0)
{
testsToSave.Add(new LUTestData(td, repNr));
if (Math.Abs(testId) > maxPruefungsNr) maxPruefungsNr = Math.Abs(testId);
totalTestTime += td.TargetTime;
}
}
}
LUTestData[] testsToSaveArr = testsToSave.ToArray();
Array.Sort(testsToSaveArr, new LUTestDataComparer());
completeTestInfo = testsToSaveArr;
foreach (var cti in completeTestInfo)
{
log.WarnFormat("Selected test info : ID={0} Rev={1} Test={2} PrfNrDB={3} QBzDB={4}",
wmTypeId, wmTypeRevision, cti.TestName, cti.Id, cti.Designation);
}
GetTestInofFromProcedure("SaveBatchData"); /// Create appropriate test infos
if (dbCfg.DebugLevel == DebugMode.Normal)
{
@@ -47,6 +47,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return RfidCommands.SetTestMode($"COM{iHead.RfidComPortNr}") ? "OK" : "Error Set Test Mode";
}
#if IPERL
internal static string TurnOffRadio(IperlHead iHead)
{
try
@@ -54,7 +55,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
string payload = "03";
RfidCommunicationService rfidCommunicationService = new RfidCommunicationService { ComPort = $"COM{iHead.RfidComPortNr}", WaitTimeAfterFailure = 2200, PassThroughWaitTime = 1500, MaxRetries = 3, TimeOut = 5000 };
rfidCommunicationService.RfidWrite(Params.u8_WakeUpInterval, payload);
return rfidCommunicationService.RfidRead(Params.u8_WakeUpInterval).ToString() == payload? "OK" : "Error";
return rfidCommunicationService.RfidRead<string>(Params.u8_WakeUpInterval).ToString() == payload ? "OK" : "Error";
}
catch (Exception ex)
{
@@ -70,7 +71,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
RfidCommunicationService rfidCommunicationService = new RfidCommunicationService { ComPort = $"COM{iHead.RfidComPortNr}", WaitTimeAfterFailure = 2200, PassThroughWaitTime = 1500, MaxRetries = 3, TimeOut = 5000 };
rfidCommunicationService.RfidWrite(SystemInfo.u8_system_state, payload);
Thread.Sleep(1000); // must be for pass thru params
return rfidCommunicationService.RfidRead(SystemInfo.u8_system_state).ToString() == payload ? "OK" : "Error";
return rfidCommunicationService.RfidRead<string>(SystemInfo.u8_system_state).ToString() == payload ? "OK" : "Error";
}
catch (Exception ex)
{
@@ -88,7 +89,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
{
RfidCommunicationService rfidCommunicationService = new RfidCommunicationService { ComPort = $"COM{iHead.RfidComPortNr}", WaitTimeAfterFailure = 2200, PassThroughWaitTime = 1500, MaxRetries = 3, TimeOut = 5000 };
//rfidCommunicationService.RfidWrite(Params.u8_Customer_Text, custText);
return rfidCommunicationService.RfidRead(Params.u8_Customer_Text).ToString();
return rfidCommunicationService.RfidRead<string>(Params.u8_Customer_Text).ToString();
}
}
catch (Exception ex)
@@ -97,5 +98,6 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
}
return $"Error COM{iHead.RfidComPortNr}";
}
#endif /// IPERL
}
}
@@ -24,6 +24,8 @@ using Sensus.iPerl.RfidCom.Helper;
using Sensus.iPerl.RfidCom.Model.Enums;
using Sensus.iPerl.RfidCom.Services;
using Sensus.iPerl.RfidCom.Structures;
using Results.Entities;
using Results;
namespace TBF.Rig.TestMethods.iPerlCommunication
{
@@ -100,6 +102,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
public const string DewaReworkLRStr = "DEWA rework L-R";
public const string StartTestingSealedMetersStr = "Start testing sealed meters";
public const string EndTestingSealedMetersStr = "End testing sealed meters";
public const string SimulateCmd = "simulate ";
public static Color DisabledColor = Color.DarkGray;
public static Color OptoAndDirOKColor = Color.Green;
@@ -341,6 +344,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
activityLabel.Text = Strings.Optical_heads;
ShuffleTextBoxes(ProcessData.WMsCount, ProcessData.LineSize);
#if IPERL
ContextMenu cm = new ContextMenu();
cm.MenuItems.Add(NewMenuItem("Read PCB Number" , "ReadPCB"));
cm.MenuItems.Add(NewMenuItem("Enter Test Mode" , "StartTestMode"));
@@ -353,6 +357,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
cm.MenuItems.Add(NewMenuItem("Open sealing", "OpenSealing"));
}
this.ContextMenu = cm;
#endif
}
}
@@ -744,7 +749,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
int count = 0;
for (int wmNr0 = 0; wmNr0 < iperlHeads.Count; wmNr0++)
{
Results.Entities.WaterMeter wm = (ProcessData.BatchRslts.Batch.WaterMeters != null && ProcessData.BatchRslts.Batch.WaterMeters.Count > wmNr0)
WaterMeter wm = (ProcessData.BatchRslts.Batch.WaterMeters != null && ProcessData.BatchRslts.Batch.WaterMeters.Count > wmNr0)
? ProcessData.BatchRslts.Batch.WaterMeters[wmNr0] : null;
IperlHead ihead = iperlHeads[wmNr0];
@@ -792,7 +797,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
{
wmFound = true;
Results.Entities.WaterMeter wm = null;
WaterMeter wm = null;
if (ProcessData.BatchRslts.Batch.WaterMeters != null)
{
foreach (var w in ProcessData.BatchRslts.Batch.WaterMeters)
@@ -855,6 +860,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
else if (currentActivity.ToLower() == DewaReworkLRStr.ToLower()) error = DewaRework(ihead, wm, FlowDir.L_R, ref resultStr);
else if (currentActivity.ToLower().Contains(StartTestingSealedMetersStr.ToLower())) error = StartTestingSealedMeter(ihead, wm, ref resultStr);
else if (currentActivity.ToLower().Contains(EndTestingSealedMetersStr.ToLower())) error = EndTestingSealedMeter(ihead, wm, ref resultStr);
else if (currentActivity.ToLower().Contains(SimulateCmd.ToLower())) error = Simulate(ihead, wm, ref resultStr);
#endif
else
{
@@ -953,7 +959,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="wm">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr ReadConfiguration(IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr ReadConfiguration(IperlHead ihead, WaterMeter wm, ref string resultStr)
{
///
/// The activity is "Read configuration" (this enables the watermeter, resets error flag)
@@ -1143,7 +1149,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr ReadCalibration(IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr ReadCalibration(IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -1177,7 +1183,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr ReadCalibrationV4(IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr ReadCalibrationV4(IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -1215,7 +1221,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="wm">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr WriteCalibrationFactor(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr WriteCalibrationFactor(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed || (ihead.CalibrationStruct == null)) return CommErr.CommFailed;
@@ -1350,7 +1356,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="wm">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr WriteCalibrationV4Factors(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr WriteCalibrationV4Factors(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed || (ihead.CalibrationStructV4 == null)) return CommErr.CommFailed;
@@ -1511,7 +1517,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="wm">Water meter</param>
/// <param name="testData">TestData (name and repetitions)</param>
/// <returns>(1) selected MeterTestRslt or (2) average of repeated MTR-s or (3) null when at least one MTR is missing</returns>
static Results.Entities.MeterTestRslt GetAverageTestRslt(Results.Entities.WaterMeter wm, Results.Entities.TestData testData)
static Results.Entities.MeterTestRslt GetAverageTestRslt(WaterMeter wm, Results.Entities.TestData testData)
{
Results.Entities.MeterTestRslt avgTestRslt;
@@ -1543,7 +1549,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr NormalizeCalibrationFactor(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr NormalizeCalibrationFactor(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed || (ihead.CalibrationStruct == null)) return CommErr.CommFailed;
@@ -1612,7 +1618,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr NormalizeCalibrationV4Factors(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr NormalizeCalibrationV4Factors(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed || (ihead.CalibrationStructV4 == null)) return CommErr.CommFailed;
@@ -1682,7 +1688,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr ReadQ2Correction(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr ReadQ2Correction(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -1713,7 +1719,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr ResetQ2Correction(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr ResetQ2Correction(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, 0, 0);
}
@@ -1725,7 +1731,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr WriteDefaultQ2Corrections(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr WriteDefaultQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -1781,7 +1787,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr WriteQ2Corrections(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr, int factorLR, int factorRL)
static CommErr WriteQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr, int factorLR, int factorRL)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -1826,7 +1832,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
}
static CommErr InitOrReadQ2Corrections(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr InitOrReadQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
if (wm.Pruefindex == 0) return CommErr.CommFailed; /// Unknown pruefindex
@@ -1890,7 +1896,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr Reset2HzCorrection(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr Reset2HzCorrection(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -1948,7 +1954,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr CalculateAndWriteQ2Corrections(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm,
static CommErr CalculateAndWriteQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm,
Test test, ref string resultStr, Q2CorrType q2CorrType, string restOfLine)
{
var args = string.IsNullOrEmpty(restOfLine) ? new string[0] : restOfLine.Split(new char[] { ' ' });
@@ -2060,30 +2066,12 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return CommErr.None; /// No Q2 correction when doing conditional update and WM passed
}
double errLimitLo = test.ErrLimLo + test.Uncertainty;
double errLimitLo = test.ErrLimLo + test.Uncertainty;
double errLimitHi = test.ErrLimHi - test.Uncertainty;
///
/// Calculate Q2 correction factor(s) from an error measured at Q2
/// Calculate Q2 correction factor(s)
///
double q2Correction = 0;
double q2Correction2 = 0; /// L-R direction in case of Q2CorrType.Update and Q2CorrType.ConditionalUpdate
if (q2CorrType == Q2CorrType.Update || q2CorrType == Q2CorrType.ConditionalUpdate)
{
/// Calculate two Q2 correction factors from two tests done in both directions
q2Correction = ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData.Qfrom, q2adjResult.Q2CorrRL);
q2Correction2 = ihead.CalculateQ2CorrectionFactor(q2adjResult2, q2adjTestData2.Qfrom, q2adjResult2.Q2CorrLR);
}
else
{
/// Calculate Q2 correction factors from a single test
q2Correction = ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData.Qfrom, q2adjResult.Q2CorrRL);
q2Correction2 = ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData.Qfrom, q2adjResult.Q2CorrLR);
}
int q2CorrRL = 0;
int q2CorrLR = 0;
///
@@ -2096,7 +2084,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// No 2nd Q2 test, MakeQ2CorrectedFrom(...) is used to calculate Q2 error
/// Do not forget to modify iPerlCommunicationSeq.MakeQ2CorrectedFrom(...)
///
q2CorrRL = (q3error * q2adjResult.Error < 0) ? Convert.ToInt32(0.9 * q2Correction) : Convert.ToInt32(1.1 * q2Correction);
double errorTarget = (q3error * q2adjResult.Error < 0) ? (0.1 * q2adjResult.Error) : (-0.1 * q2adjResult.Error);
q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom, errorTarget))));
}
else if (q2CorrType == Q2CorrType.Dewa ||
q2CorrType == Q2CorrType.Dewa_incl_05 ||
@@ -2107,7 +2096,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// No 2nd Q2 test, MakeQ2CorrectedFrom(...) is used to calculate Q2 error
/// Do not forget to modify iPerlCommunicationSeq.MakeQ2CorrectedFrom(...)
///
q2CorrLR = (q3error * q2adjResult.Error < 0) ? Convert.ToInt32(0.9 * q2Correction) : Convert.ToInt32(1.1 * q2Correction);
double errorTarget = (q3error * q2adjResult.Error < 0) ? (0.1 * q2adjResult.Error) : (-0.1 * q2adjResult.Error);
q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrLR, q2adjTestData.Qfrom, errorTarget))));
}
else if (q2CorrType == Q2CorrType.RL ||
q2CorrType == Q2CorrType.RL_incl_05 ||
@@ -2124,7 +2114,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return CommErr.None;
}
q2CorrRL = Convert.ToInt32(q2Correction);
q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom))));
}
else if (q2CorrType == Q2CorrType.LR ||
q2CorrType == Q2CorrType.LR_incl_05 ||
@@ -2141,7 +2131,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return CommErr.None;
}
q2CorrLR = Convert.ToInt32(q2Correction2);
q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrLR, q2adjTestData.Qfrom))));
}
else if (q2CorrType == Q2CorrType.Update || q2CorrType == Q2CorrType.ConditionalUpdate)
{
@@ -2150,8 +2140,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// Assuming the 2nd Q2 tests are done afterwards
/// MakeQ2CorrectedFrom(...) is not used
///
q2CorrRL = Convert.ToInt32(q2Correction);
q2CorrLR = Convert.ToInt32(q2Correction2);
q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom))));
q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult2, q2adjResult2.Q2CorrLR, q2adjTestData2.Qfrom))));
}
else if (q2CorrType == Q2CorrType.Greece || q2CorrType == Q2CorrType.Greece_incl_05 || q2CorrType == Q2CorrType.UpdateBothQ2FactorsTestLRDir)
{
@@ -2164,15 +2154,16 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return CommErr.None;
}
q2CorrRL = Convert.ToInt32(2.0 * q2Correction2);
q2CorrLR = Convert.ToInt32(1.0 * q2Correction2);
}
q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrLR, q2adjTestData.Qfrom))));
q2CorrRL = q2CorrLR;
}
else if (q2CorrType == Q2CorrType.UpdateBothQ2FactorsTestRLDir)
{
///
/// Another strange process
///
q2CorrRL = (q3error * q2adjResult.Error < 0) ? Convert.ToInt32(0.9 * q2Correction) : Convert.ToInt32(1.1 * q2Correction);
double errorTarget = (q3error * q2adjResult.Error < 0) ? (0.1 * q2adjResult.Error) : (-0.1 * q2adjResult.Error);
q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom, errorTarget))));
q2CorrLR = q2CorrRL;
}
@@ -2244,7 +2235,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
(q2adjResult.Error < errLimitLo || errLimitHi < q2adjResult.Error ||
(q2adjResult2 != null && (q2adjResult2.Error < errLimitLo || errLimitHi < q2adjResult2.Error))))
{
resultStr = resultStr + " (OoR)";
resultStr += " (OoR)";
/// At least one of Q2 errors is out of range for Q2 correction
log.WarnFormat("OoR => anyhow Q2 correction was done: Pos={0}, PCB#={1}, ***Q2_RL err={2}%***, ***Q2_LR err={3}%***, [Lo={4}%, Hi={5}%]",
@@ -2314,7 +2305,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="ihead">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr Write2HzCorrection(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr Write2HzCorrection(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -2384,7 +2375,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="flowDir">Arrow direction</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr DewaRework(IperlHead ihead, Results.Entities.WaterMeter wm, FlowDir flowDir, ref string resultStr)
static CommErr DewaRework(IperlHead ihead, WaterMeter wm, FlowDir flowDir, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -2466,7 +2457,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="wm">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr StartTestingSealedMeter(IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr StartTestingSealedMeter(IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -2536,7 +2527,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// <param name="wm">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr EndTestingSealedMeter(IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr EndTestingSealedMeter(IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
@@ -2587,7 +2578,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
}
}
static CommErr GetQ2PreCorrectionsFormRest(int threadId, IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr GetQ2PreCorrectionsFormRest(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr)
{
if (!ProcessData.IsQ2PreCorrectionCalculated)
{
@@ -2614,6 +2605,27 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return CommErr.None;
}
static CommErr Simulate(IperlHead ihead, WaterMeter wm, ref string resultStr)
{
string[] arguments = multiTestParams[currentActivityStep].Activity.Split(new char[] { ' ' });
if (arguments.Length < 2 || arguments[1].ToLower() != "iperls") return CommErr.None;
if (ihead.CommFailed) return CommErr.CommFailed;
string[] pcbNrs = new string[] { "831232435539", "831232435562",
"831232435587", "831232432141",
"831232432497", "831232763641" };
if (wm.WMPosition > 0 && wm.WMPosition <= pcbNrs.Length)
{
ihead.SerialNr = wm.SerialNr = pcbNrs[wm.WMPosition - 1];
}
resultStr = string.Format("PCB Nr. = {0}", wm.SerialNr ?? "<null>");
return CommErr.None;
}
#endif /// IPERL
#endregion
@@ -2792,6 +2804,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
UiBridge.Bridge.OnTestCompleted(this, new UiBridge.TestCompletedEventArgs(string.Empty, null));
}
#if IPERL
private MenuItem NewMenuItem(string text, string tag)
{
MenuItem menuItem = new MenuItem { Text = text, Tag = tag };
@@ -2841,6 +2854,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
Application.DoEvents(); // Refresh UI
}
}
#endif /// IPERL
#region Check boxes edit mode support
@@ -12,6 +12,8 @@ using TBF.Rig.Sequences;
using TBF.Resources;
using TBF.UiBridge;
using Results;
using Results.Entities;
using TBF.Rig.TestMethods.iPerlCommunication.iPerlHead;
namespace TBF.Rig.TestMethods.iPerlCommunication
{
@@ -23,9 +25,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
public const string StrictQ2ErrorCheckStr = "Strict Q2 error check ";
public const string Q2correctionCheckCmd = "Q2 correction check ";
public const string IperlCheckCmd = "iPERL_check ";
public const string SimulateCmd = "simulate ";
System.Windows.Forms.Form modelessDlg;
System.Windows.Forms.Form modelessDlg;
///
delegate void iPerlCommFormDlgt(iPerlCommunicationSeq myRef, TestMethod method, Test test, iPerlCommunicationParams testParams);
///
@@ -72,6 +75,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// Get 'wmType' from IperlHead procedure parameters
int wmType = 0;
#if IPERL
foreach (var wm in ProcessData.BatchRslts.Batch.WaterMeters)
{
if (wm != null && !wm.Disabled && wm.WMTypeId() > 0)
@@ -80,6 +84,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
break;
}
}
#endif
if (cfg.UseWebService)
{
@@ -286,7 +291,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
return new List<Event> { Event.Done };
}
else if (testParams.Activity.ToLower().Contains(cmd = "simulate "))
else if (testParams.Activity.ToLower().Contains(cmd = SimulateCmd))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
@@ -299,6 +304,46 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound nok") MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound rise") MakeSimulatedCompound(test, 1, 0, 0.7f, 0.0f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound fall") MakeSimulatedCompound(test, 1, 0, 0.7f, 0.9f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "iperls")
{
string[] pcbNrs = new string[] { "831232435539", "831232435562", "831232435587",
"831232432141", "831232432497", "831232763641" };
TestRslt tstRslt = BatchRslts.GetTestRslt(test.Name, test.Part);
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Auxiliary results ... not required
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.TestDone = true;
tstRslt.StartTime = tstRslt.Batch.StartTime;
tstRslt.EndTime = DateTime.Now;
tstRslt.FlowSetTime = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.TestTime = 1;
for (int i = 0; i < BatchRslts.Batch.WaterMeters.Count; i++)
{
MeterTestRslt meterRslt =
BatchRslts.GetMeterTestRslt(test.Name, i, CompoundMeterId.Single);
if (meterRslt != null)
{
meterRslt.WaterMeter.SerialNr = pcbNrs[i % pcbNrs.Length];
meterRslt.Passed = true;
meterRslt.TestDone = true;
}
//if (iperlHeads[i] != null)
//{
// iperlHeads[i].CommFailed = iperlHeads[i].Disabled = false;
// iperlHeads[i].SerialNr = pcbNrs[i % pcbNrs.Length];
//}
}
}
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Common.Utils.GetTestName(test.Name, 1, 1), 0)));
@@ -309,8 +354,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
//------------------------------------------------
State.Create(string.Format("iPerlCommunicationSeq : {0}", testParams.Activity))
.AddOperation(checkUiOp)
.EnterState();
.AddOperation(checkUiOp)
.EnterState();
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e))
@@ -68,10 +68,17 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
{
get
{
if (ConfigStruct != null) return ConfigStruct.GetPcbNrString();
else return string.Empty;
if (ConfigStruct != null)
return ConfigStruct.GetPcbNrString();
else if (simulatedPcbNr != null)
return simulatedPcbNr;
else
return string.Empty;
}
set
{
simulatedPcbNr = value;
}
set { }
}
public bool Disabled;
@@ -152,6 +159,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
public double WMVolume { get { return wmVolume; } }
public double WMTestTime { get { return wmTestTime; } }
string simulatedPcbNr = null;
int wmPulses;
int wmRefPulses;
double beginWMState;
@@ -213,9 +222,11 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
/// <param name="nominalFlow">Nominal flow in m3/h</param>
/// <param name="currentFactor">0 or the current Q2 correction factor when updating the factor</param>
/// <returns>Calculated Q2 correction factor</returns>
public double CalculateQ2CorrectionFactor(Results.Entities.MeterTestRslt q2adjResult, double nominalFlow, int currentFactor = 0)
public double CalculateQ2CorrectionFactor(Results.Entities.MeterTestRslt currentQ2Result, int currentFactor, double nominalFlow, double errorTarget = 0)
{
double nominalTestFlowLph = Units.ConvertTo(Unit.lph, nominalFlow);
double volumeRefShiftedToTarget = currentQ2Result.VolumeRef * (1.0 + errorTarget / 100.0);
double q2adjErrorShiftedToTarget = Config.Formulas.ErrorFromVolumes(currentQ2Result.VolumeMeter, volumeRefShiftedToTarget);
double A = 16.0 / ScalingFactor(); /// Raw units per ml: DN15=16, DN20=8, DN25=4, DN32=2, DN40=1
const double B = 8.0; /// Raw units per minute, 8
@@ -224,13 +235,16 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
double F = D / (nominalTestFlowLph * 10.0); /// Error corrected with 8 Raw Units per minute [%]
double G = F / B; /// Error corrected with 1 Raw Unit per minute [%]
double q2CorrectionFactor = Convert.ToDouble(currentFactor)
- (q2adjResult.Error / G) * (q2adjResult.VolumeRef / q2adjResult.VolumeMeter);
/// Do not change the factor for an invalid measurement (q2adjResult.VolumeMeter == 0)
double q2CorrectionFactor = (Math.Abs(currentQ2Result.VolumeMeter) <= float.Epsilon) ? Convert.ToDouble(currentFactor) :
Convert.ToDouble(currentFactor) - (q2adjErrorShiftedToTarget / G) * (volumeRefShiftedToTarget / currentQ2Result.VolumeMeter);
log.WarnFormat("CalculateQ2CorrectionFactor() : Pos={0}, PCB#={1}, Error={2}%, Q2CorrFactor={3}",
log.WarnFormat("CalculateQ2CorrectionFactor() : Pos={0}, PCB#={1}, Error={2}%, Target={3}%, Current factor={4} New factor={5}",
Name,
SerialNr,
q2adjResult.Error.ToString("F2"),
currentQ2Result.Error.ToString("F2"),
errorTarget.ToString("F3"),
currentFactor.ToString("F1"),
q2CorrectionFactor.ToString("F1"));
return q2CorrectionFactor;
@@ -457,6 +471,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
Q2CorrRL = 0;
Q2CorrLR = 0;
simulatedPcbNr = null;
dataStreamState = DataStreamState.Flush;
currentFlowDir = InitFlowDir;
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
///
using System;
using System.IO;
+21 -11
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;WARSAW_50;STABLE_MASS_EXTRAS;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -50,7 +50,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;WARSAW_50;STABLE_MASS_EXTRAS;LANG_PL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -60,7 +60,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;WARSAW_50;STABLE_MASS_EXTRAS;LANG_PL</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -70,7 +70,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;WARSAW_50;STABLE_MASS_EXTRAS;LANG_PL</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -101,8 +101,8 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3Munich">
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
<Reference Include="ControlComponent3U">
<HintPath>..\packages\ControlBoard\Warsaw-50\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -187,6 +187,7 @@
<Compile Include="Rig\Configs\ParamsProvider\ComponentCfgCtrl.designer.cs">
<DependentUpon>ComponentCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\DataChangeArgs.cs" />
<Compile Include="Rig\DataContainers\BackupAndSecurityOptions\Component.cs" />
<Compile Include="Rig\DataContainers\BackupAndSecurityOptions\ComponentCfg.cs" />
<Compile Include="Rig\DataContainers\BackupAndSecurityOptions\ComponentFactory.cs" />
@@ -2219,6 +2220,12 @@
<Compile Include="UI\Bench\Components\SelectComponentClassDlg.designer.cs">
<DependentUpon>SelectComponentClassDlg.cs</DependentUpon>
</Compile>
<Compile Include="UI\Bench\Metrology\CalibCertificateCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Bench\Metrology\CalibCertificateCtrl.Designer.cs">
<DependentUpon>CalibCertificateCtrl.cs</DependentUpon>
</Compile>
<Compile Include="UI\Bench\Metrology\IMetrologyDlgTab.cs" />
<Compile Include="UI\Bench\Metrology\MetrologyDlg.cs">
<SubType>Form</SubType>
@@ -2226,11 +2233,11 @@
<Compile Include="UI\Bench\Metrology\MetrologyDlg.designer.cs">
<DependentUpon>MetrologyDlg.cs</DependentUpon>
</Compile>
<Compile Include="UI\Bench\Metrology\MetrologyDlgBalanceTab.cs">
<Compile Include="UI\Bench\Metrology\MetrologyDlgScaleTab.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Bench\Metrology\MetrologyDlgBalanceTab.designer.cs">
<DependentUpon>MetrologyDlgBalanceTab.cs</DependentUpon>
<Compile Include="UI\Bench\Metrology\MetrologyDlgScaleTab.designer.cs">
<DependentUpon>MetrologyDlgScaleTab.cs</DependentUpon>
</Compile>
<Compile Include="UI\Bench\Metrology\MetrologyDlgBuoyancyTab.cs">
<SubType>UserControl</SubType>
@@ -3431,11 +3438,14 @@
<EmbeddedResource Include="UI\Bench\Components\SelectComponentClassDlg.resx">
<DependentUpon>SelectComponentClassDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\CalibCertificateCtrl.resx">
<DependentUpon>CalibCertificateCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlg.resx">
<DependentUpon>MetrologyDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlgBalanceTab.resx">
<DependentUpon>MetrologyDlgBalanceTab.cs</DependentUpon>
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlgScaleTab.resx">
<DependentUpon>MetrologyDlgScaleTab.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlgBuoyancyTab.resx">
<DependentUpon>MetrologyDlgBuoyancyTab.cs</DependentUpon>
+162
View File
@@ -0,0 +1,162 @@
namespace TBF.UI.Bench.Metrology
{
partial class CalibCertificateCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox = new System.Windows.Forms.GroupBox();
this.openCertificateButton = new System.Windows.Forms.Button();
this.showCertificateButton = new System.Windows.Forms.Button();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.certIdLabel = new System.Windows.Forms.Label();
this.groupBox.SuspendLayout();
this.SuspendLayout();
//
// groupBox
//
this.groupBox.Controls.Add(this.certIdLabel);
this.groupBox.Controls.Add(this.openCertificateButton);
this.groupBox.Controls.Add(this.showCertificateButton);
this.groupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.groupBox.Controls.Add(this.calibDateTimePicker);
this.groupBox.Controls.Add(this.calibValidDateLabel);
this.groupBox.Controls.Add(this.calibDateLabel);
this.groupBox.Controls.Add(this.calibCertificateNrTextBox);
this.groupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox.Location = new System.Drawing.Point(0, 0);
this.groupBox.Name = "groupBox";
this.groupBox.Size = new System.Drawing.Size(240, 100);
this.groupBox.TabIndex = 0;
this.groupBox.TabStop = false;
this.groupBox.Text = "Calibration certificate";
//
// openCertificateButton
//
this.openCertificateButton.Enabled = false;
this.openCertificateButton.Location = new System.Drawing.Point(177, 22);
this.openCertificateButton.Name = "openCertificateButton";
this.openCertificateButton.Size = new System.Drawing.Size(56, 26);
this.openCertificateButton.TabIndex = 28;
this.openCertificateButton.Text = "Path";
this.openCertificateButton.UseVisualStyleBackColor = true;
this.openCertificateButton.Click += new System.EventHandler(this.openCertificateButton_Click);
//
// showCertificateButton
//
this.showCertificateButton.Location = new System.Drawing.Point(177, 48);
this.showCertificateButton.Name = "showCertificateButton";
this.showCertificateButton.Size = new System.Drawing.Size(56, 39);
this.showCertificateButton.TabIndex = 27;
this.showCertificateButton.Text = "Show";
this.showCertificateButton.UseVisualStyleBackColor = true;
this.showCertificateButton.Click += new System.EventHandler(this.showCertificateButton_Click);
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(74, 67);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(97, 20);
this.calibExpirationDateTimePicker.TabIndex = 26;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(74, 45);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(97, 20);
this.calibDateTimePicker.TabIndex = 25;
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(9, 70);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 24;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(9, 48);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 23;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(74, 23);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(97, 20);
this.calibCertificateNrTextBox.TabIndex = 22;
//
// certIdLabel
//
this.certIdLabel.AutoSize = true;
this.certIdLabel.Location = new System.Drawing.Point(9, 26);
this.certIdLabel.Name = "certIdLabel";
this.certIdLabel.Size = new System.Drawing.Size(18, 13);
this.certIdLabel.TabIndex = 29;
this.certIdLabel.Text = "ID";
//
// CalibCertificateCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox);
this.Name = "CalibCertificateCtrl";
this.Size = new System.Drawing.Size(240, 100);
this.groupBox.ResumeLayout(false);
this.groupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox;
private System.Windows.Forms.Button openCertificateButton;
private System.Windows.Forms.Button showCertificateButton;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label certIdLabel;
}
}
@@ -0,0 +1,140 @@
///
/// Copyright (c) 2023 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Windows.Forms;
using TBF.Resources;
using TBF.Rig.GenericDevices;
namespace TBF.UI.Bench.Metrology
{
public partial class CalibCertificateCtrl : UserControl
{
string certPath; /// Path to a calibration certificate PDF document
ToolTip toolTip;
public CalibCertificateCtrl()
{
InitializeComponent();
Localize();
certPath = string.Empty;
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toolTip = new ToolTip();
toolTip.UseFading = true;
toolTip.UseAnimation = true;
toolTip.IsBalloon = true;
toolTip.ShowAlways = true;
toolTip.AutoPopDelay = 1000;
toolTip.InitialDelay = 1000;
toolTip.ReshowDelay = 500;
toolTip.SetToolTip(showCertificateButton, certPath);
}
void Localize()
{
groupBox.Text = Strings.Calibration_certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
showCertificateButton.Text = Strings.Show;
}
public void Unlock()
{
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
openCertificateButton.Enabled = true;
showCertificateButton.Enabled = true;
}
public void Refresh(ICalibInfoCfg calibInfoCfg)
{
calibCertificateNrTextBox.Text = calibInfoCfg.CalibCertificateNr;
certPath = calibInfoCfg.CertPath;
calibDateTimePicker.Value = (calibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : calibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (calibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : calibInfoCfg.CalibValidDate;
toolTip.SetToolTip(showCertificateButton, certPath);
}
public void Update(ICalibInfoCfg calibInfoCfg)
{
calibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
calibInfoCfg.CertPath = certPath;
calibInfoCfg.CalibDate = calibDateTimePicker.Value;
calibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value;
}
public void Refresh(ICalibRangesCfg calibRangesCfg, int rngIx)
{
calibCertificateNrTextBox.Text = calibRangesCfg.GetCalibCertificate(rngIx);
certPath = calibRangesCfg.GetCertPath(rngIx);
calibDateTimePicker.Value = (calibRangesCfg.GetCalibDate(rngIx) < Constants.MinDate) ? Constants.MinDate : calibRangesCfg.GetCalibDate(rngIx);
calibExpirationDateTimePicker.Value = (calibRangesCfg.GetCalibValidDate(rngIx) < Constants.MinDate) ? Constants.MinDate : calibRangesCfg.GetCalibValidDate(rngIx);
toolTip.SetToolTip(showCertificateButton, certPath);
}
public void Update(ICalibRangesCfg calibRangesCfg, int rngIx)
{
calibRangesCfg.SetCalibCertificate(rngIx, calibCertificateNrTextBox.Text);
calibRangesCfg.SetCertPath(rngIx, certPath);
calibRangesCfg.SetCalibDate(rngIx, calibDateTimePicker.Value);
calibRangesCfg.SetCalibValidDate(rngIx, calibExpirationDateTimePicker.Value);
}
private void openCertificateButton_Click(object sender, EventArgs e)
{
var openFileDialog = new OpenFileDialog()
{
CheckFileExists = true,
InitialDirectory = @"C:\TBF\Certificates",
Filter = string.Format("{0} (*.pdf)|*.pdf|{1} (*.*)|*.*", Strings.PDF_files, Strings.All_files),
};
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
certPath = openFileDialog.FileName;
toolTip.SetToolTip(showCertificateButton, certPath);
}
}
private void showCertificateButton_Click(object sender, EventArgs e)
{
var apps = new string[] { @"C:\Program Files\Microsoft\Edge\Application\msedge.exe",
@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
@"C:\Program Files\Mozilla Firefox\firefox.exe",
@"C:\Program Files (x86)\Mozilla Firefox\firefox.exe",
@"C:\Program Files\Google\Chrome\Application\chrome.exe",
@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" };
if (!string.IsNullOrEmpty(certPath) && File.Exists(certPath))
{
foreach (var app in apps)
{
if (File.Exists(app))
{
using (var process = new System.Diagnostics.Process())
{
process.StartInfo.FileName = app;
process.StartInfo.Arguments = certPath.Replace(" ", "%20"); ///argument
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.Start();
}
break;
}
}
}
}
}
}
+1 -1
View File
@@ -105,7 +105,7 @@ namespace TBF.UI.Bench.Metrology
{
balancesCount++;
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
MetrologyDlgBalanceTab uiControl = new MetrologyDlgBalanceTab();
MetrologyDlgScaleTab uiControl = new MetrologyDlgScaleTab();
uiControl.MeterEntity = cmpnt;
uiControl.BalanceCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as Rig.GenericDevices.IScaleCfg;
uiControl.Dock = DockStyle.Fill;
+1 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2019 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
using System;
using System.Collections.Generic;
+17 -95
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -32,23 +32,16 @@ namespace TBF.UI.Bench.Metrology
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.densityCorrTextBox = new System.Windows.Forms.TextBox();
this.densityCorrLabel = new System.Windows.Forms.Label();
this.temperatureTextBox = new System.Windows.Forms.TextBox();
this.temperatureLabel = new System.Windows.Forms.Label();
this.densityTextBox = new System.Windows.Forms.TextBox();
this.densityLabel = new System.Windows.Forms.Label();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
@@ -61,7 +54,7 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.densityCorrTextBox);
this.splitContainer1.Panel1.Controls.Add(this.densityCorrLabel);
this.splitContainer1.Panel1.Controls.Add(this.temperatureTextBox);
@@ -69,63 +62,13 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel1.Controls.Add(this.densityTextBox);
this.splitContainer1.Panel1.Controls.Add(this.densityLabel);
this.splitContainer1.Size = new System.Drawing.Size(554, 300);
this.splitContainer1.SplitterDistance = 110;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 1;
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(323, 16);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(208, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(120, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(54, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate";
//
// densityCorrTextBox
//
this.densityCorrTextBox.Enabled = false;
this.densityCorrTextBox.Location = new System.Drawing.Point(185, 81);
this.densityCorrTextBox.Location = new System.Drawing.Point(178, 81);
this.densityCorrTextBox.Name = "densityCorrTextBox";
this.densityCorrTextBox.Size = new System.Drawing.Size(110, 20);
this.densityCorrTextBox.TabIndex = 5;
@@ -133,7 +76,7 @@ namespace TBF.UI.Bench.Metrology
// densityCorrLabel
//
this.densityCorrLabel.AutoSize = true;
this.densityCorrLabel.Location = new System.Drawing.Point(37, 84);
this.densityCorrLabel.Location = new System.Drawing.Point(30, 84);
this.densityCorrLabel.Name = "densityCorrLabel";
this.densityCorrLabel.Size = new System.Drawing.Size(132, 13);
this.densityCorrLabel.TabIndex = 4;
@@ -142,7 +85,7 @@ namespace TBF.UI.Bench.Metrology
// temperatureTextBox
//
this.temperatureTextBox.Enabled = false;
this.temperatureTextBox.Location = new System.Drawing.Point(185, 43);
this.temperatureTextBox.Location = new System.Drawing.Point(178, 43);
this.temperatureTextBox.Name = "temperatureTextBox";
this.temperatureTextBox.Size = new System.Drawing.Size(110, 20);
this.temperatureTextBox.TabIndex = 3;
@@ -151,7 +94,7 @@ namespace TBF.UI.Bench.Metrology
// temperatureLabel
//
this.temperatureLabel.AutoSize = true;
this.temperatureLabel.Location = new System.Drawing.Point(37, 46);
this.temperatureLabel.Location = new System.Drawing.Point(30, 46);
this.temperatureLabel.Name = "temperatureLabel";
this.temperatureLabel.Size = new System.Drawing.Size(112, 13);
this.temperatureLabel.TabIndex = 2;
@@ -160,7 +103,7 @@ namespace TBF.UI.Bench.Metrology
// densityTextBox
//
this.densityTextBox.Enabled = false;
this.densityTextBox.Location = new System.Drawing.Point(185, 17);
this.densityTextBox.Location = new System.Drawing.Point(178, 17);
this.densityTextBox.Name = "densityTextBox";
this.densityTextBox.Size = new System.Drawing.Size(110, 20);
this.densityTextBox.TabIndex = 1;
@@ -169,31 +112,18 @@ namespace TBF.UI.Bench.Metrology
// densityLabel
//
this.densityLabel.AutoSize = true;
this.densityLabel.Location = new System.Drawing.Point(37, 20);
this.densityLabel.Location = new System.Drawing.Point(30, 20);
this.densityLabel.Name = "densityLabel";
this.densityLabel.Size = new System.Drawing.Size(82, 13);
this.densityLabel.TabIndex = 0;
this.densityLabel.Text = "Density [kg/m3]";
//
// calibExpirationDateTimePicker
// calibCertificateCtrl
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(120, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(120, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
this.calibCertificateCtrl.Location = new System.Drawing.Point(307, 7);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 6;
//
// MetrologyDlgDensityTab
//
@@ -207,8 +137,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.ResumeLayout(false);
}
@@ -222,12 +150,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label densityLabel;
private System.Windows.Forms.TextBox densityCorrTextBox;
private System.Windows.Forms.Label densityCorrLabel;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,11 +1,12 @@
///
/// Copyright (c) 2013-2019 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using Common;
using Config;
using Config.Entities;
using TBF.Resources;
@@ -32,16 +33,11 @@ namespace TBF.UI.Bench.Metrology
public IList<MeasurementCorrection> ToBeRemoved { get; set; }
MetrologyDlg parent;
bool unlocked;
bool valuesModified;
bool valuesModified;
public MetrologyDlgDensityTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
ToBeRemoved = new List<MeasurementCorrection>();
valuesModified = false;
}
@@ -55,9 +51,9 @@ namespace TBF.UI.Bench.Metrology
Localize();
/// Panel1
densityLabel.Text = string.Format("{0} [{1}]", Strings.Density, Common.Unit.kgpm3.ToDescription());
temperatureLabel.Text = string.Format("{0} [{1}]", Strings.At_temperature, Common.Unit.C.ToDescription());
densityCorrLabel.Text = string.Format("{0} [{1}]", Strings.Density_correction, Common.Unit.kgpm3.ToDescription());
densityLabel.Text = string.Format("{0} [{1}]", Strings.Density, Unit.kgpm3.ToDescription());
temperatureLabel.Text = string.Format("{0} [{1}]", Strings.At_temperature, Unit.C.ToDescription());
densityCorrLabel.Text = string.Format("{0} [{1}]", Strings.Density_correction, Unit.kgpm3.ToDescription());
/// Panel2
@@ -66,22 +62,16 @@ namespace TBF.UI.Bench.Metrology
void Localize()
{
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
}
void RefreshAll()
void RefreshAll()
{
if (DensityCfg != null)
{
densityTextBox.Text = DensityCfg.RealDensity.ToString();
temperatureTextBox.Text = DensityCfg.AtTemperature.ToString();
densityCorrTextBox.Text = Config.Formulas.DensityCorrection(DensityCfg.RealDensity, DensityCfg.AtTemperature).ToString("F5");
calibCertificateNrTextBox.Text = DensityCfg.CalibCertificateNr;
calibDateTimePicker.Value = (DensityCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : DensityCfg.CalibDate;
calibExpirationDateTimePicker.Value = (DensityCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : DensityCfg.CalibValidDate;
densityCorrTextBox.Text = Formulas.DensityCorrection(DensityCfg.RealDensity, DensityCfg.AtTemperature).ToString("F5");
calibCertificateCtrl.Refresh(DensityCfg);
}
}
@@ -89,9 +79,7 @@ namespace TBF.UI.Bench.Metrology
{
densityTextBox.Enabled = true;
temperatureTextBox.Enabled = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
}
public void OkBtnClicked()
@@ -106,9 +94,7 @@ namespace TBF.UI.Bench.Metrology
Config.Data.AtTemperature = DensityCfg.AtTemperature = Utils.ParseUDouble(temperatureTextBox.Text);
}
DensityCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
DensityCfg.CalibDate = calibDateTimePicker.Value.Date;
DensityCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(DensityCfg);
Component modified = DensityCfg.CreateDbEntity();
MeterEntity.Parameters = modified.Parameters;
@@ -157,7 +143,7 @@ namespace TBF.UI.Bench.Metrology
if (Utils.TryParseUDouble(densityTextBox.Text, out density) &&
Utils.TryParseUDouble(temperatureTextBox.Text, out temp))
{
densityCorrTextBox.Text = Config.Formulas.DensityCorrection(density, temp).ToString();
densityCorrTextBox.Text = Formulas.DensityCorrection(density, temp).ToString();
}
}
+20 -98
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -32,11 +32,6 @@ namespace TBF.UI.Bench.Metrology
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.nameGroupBox = new System.Windows.Forms.GroupBox();
this.pressFromToLabel = new System.Windows.Forms.Label();
this.tempFromToLabel = new System.Windows.Forms.Label();
@@ -47,13 +42,11 @@ namespace TBF.UI.Bench.Metrology
this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
@@ -68,7 +61,7 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
//
@@ -76,59 +69,9 @@ namespace TBF.UI.Bench.Metrology
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 400);
this.splitContainer1.SplitterDistance = 102;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(186, 10);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(228, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(140, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(69, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate nr.";
//
// nameGroupBox
//
this.nameGroupBox.Controls.Add(this.pressFromToLabel);
@@ -136,7 +79,7 @@ namespace TBF.UI.Bench.Metrology
this.nameGroupBox.Controls.Add(this.cmpntNameLabel);
this.nameGroupBox.Location = new System.Drawing.Point(16, 10);
this.nameGroupBox.Name = "nameGroupBox";
this.nameGroupBox.Size = new System.Drawing.Size(160, 86);
this.nameGroupBox.Size = new System.Drawing.Size(160, 99);
this.nameGroupBox.TabIndex = 5;
this.nameGroupBox.TabStop = false;
this.nameGroupBox.Text = "Component";
@@ -172,16 +115,16 @@ namespace TBF.UI.Bench.Metrology
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(424, 10);
this.testGroupBox.Location = new System.Drawing.Point(428, 10);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(170, 88);
this.testGroupBox.Size = new System.Drawing.Size(170, 99);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Correction test";
//
// correctedTextBox
//
this.correctedTextBox.Location = new System.Drawing.Point(91, 37);
this.correctedTextBox.Location = new System.Drawing.Point(87, 54);
this.correctedTextBox.Name = "correctedTextBox";
this.correctedTextBox.ReadOnly = true;
this.correctedTextBox.Size = new System.Drawing.Size(73, 20);
@@ -189,7 +132,7 @@ namespace TBF.UI.Bench.Metrology
//
// measuredTextBox
//
this.measuredTextBox.Location = new System.Drawing.Point(91, 15);
this.measuredTextBox.Location = new System.Drawing.Point(87, 28);
this.measuredTextBox.Name = "measuredTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(73, 20);
this.measuredTextBox.TabIndex = 4;
@@ -198,7 +141,7 @@ namespace TBF.UI.Bench.Metrology
// correctedLabel
//
this.correctedLabel.AutoSize = true;
this.correctedLabel.Location = new System.Drawing.Point(17, 40);
this.correctedLabel.Location = new System.Drawing.Point(13, 57);
this.correctedLabel.Name = "correctedLabel";
this.correctedLabel.Size = new System.Drawing.Size(53, 13);
this.correctedLabel.TabIndex = 3;
@@ -207,7 +150,7 @@ namespace TBF.UI.Bench.Metrology
// measuredLabel
//
this.measuredLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(17, 18);
this.measuredLabel.Location = new System.Drawing.Point(13, 31);
this.measuredLabel.Name = "measuredLabel";
this.measuredLabel.Size = new System.Drawing.Size(54, 13);
this.measuredLabel.TabIndex = 2;
@@ -220,33 +163,21 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 294);
this.listViewEx.Size = new System.Drawing.Size(650, 284);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// calibExpirationDateTimePicker
// calibCertificateCtrl
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(140, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(140, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
this.calibCertificateCtrl.Location = new System.Drawing.Point(182, 10);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 6;
//
// MetrologyDlgDiverterTab
//
@@ -260,8 +191,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
this.nameGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
@@ -281,15 +210,8 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label correctedLabel;
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.GroupBox nameGroupBox;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.Label pressFromToLabel;
private System.Windows.Forms.Label tempFromToLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,13 +1,13 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Common.Forms;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
@@ -52,10 +52,6 @@ namespace TBF.UI.Bench.Metrology
public MetrologyDlgDiverterTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
}
@@ -97,11 +93,6 @@ namespace TBF.UI.Bench.Metrology
{
nameGroupBox.Text = Strings.Component;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
testGroupBox.Text = Strings.Test_measured_corrected;
measuredLabel.Text = Strings.Measured;
correctedLabel.Text = Strings.Corrected;
@@ -111,9 +102,7 @@ namespace TBF.UI.Bench.Metrology
{
if (CalibInfoCfg != null)
{
calibCertificateNrTextBox.Text = CalibInfoCfg.CalibCertificateNr;
calibDateTimePicker.Value = (CalibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (CalibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibValidDate;
calibCertificateCtrl.Refresh(CalibInfoCfg);
}
listViewEx.Items.Clear();
@@ -209,9 +198,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
if (listViewEx.SelectedItems.Count == 1)
{
@@ -228,10 +215,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
CalibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
CalibInfoCfg.CalibDate = calibDateTimePicker.Value.Date;
CalibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(CalibInfoCfg);
Component modified = CalibInfoCfg.CreateDbEntity();
MeterEntity.Parameters = modified.Parameters;
}
@@ -332,7 +316,7 @@ namespace TBF.UI.Bench.Metrology
CultureInfo.InvariantCulture,
out measured))
{
double corrected = MeasurementCorrection.CorrectedValue(measured, meterEntity.Corrections);
double corrected = MeasurementCorrection.CorrectedValue(measured, meterEntity.Corrections);
correctedTextBox.Text = corrected.ToString();
}
}
+20 -98
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -32,11 +32,6 @@ namespace TBF.UI.Bench.Metrology
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.nameGroupBox = new System.Windows.Forms.GroupBox();
this.pressFromToLabel = new System.Windows.Forms.Label();
this.tempFromToLabel = new System.Windows.Forms.Label();
@@ -47,13 +42,11 @@ namespace TBF.UI.Bench.Metrology
this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
@@ -68,7 +61,7 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
//
@@ -76,59 +69,9 @@ namespace TBF.UI.Bench.Metrology
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 400);
this.splitContainer1.SplitterDistance = 102;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(186, 10);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(228, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(140, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(69, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate nr.";
//
// nameGroupBox
//
this.nameGroupBox.Controls.Add(this.pressFromToLabel);
@@ -136,7 +79,7 @@ namespace TBF.UI.Bench.Metrology
this.nameGroupBox.Controls.Add(this.cmpntNameLabel);
this.nameGroupBox.Location = new System.Drawing.Point(16, 10);
this.nameGroupBox.Name = "nameGroupBox";
this.nameGroupBox.Size = new System.Drawing.Size(160, 86);
this.nameGroupBox.Size = new System.Drawing.Size(160, 99);
this.nameGroupBox.TabIndex = 5;
this.nameGroupBox.TabStop = false;
this.nameGroupBox.Text = "Component";
@@ -172,16 +115,16 @@ namespace TBF.UI.Bench.Metrology
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(424, 10);
this.testGroupBox.Location = new System.Drawing.Point(429, 10);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(170, 88);
this.testGroupBox.Size = new System.Drawing.Size(170, 99);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Correction test";
//
// correctedTextBox
//
this.correctedTextBox.Location = new System.Drawing.Point(91, 37);
this.correctedTextBox.Location = new System.Drawing.Point(91, 50);
this.correctedTextBox.Name = "correctedTextBox";
this.correctedTextBox.ReadOnly = true;
this.correctedTextBox.Size = new System.Drawing.Size(73, 20);
@@ -189,7 +132,7 @@ namespace TBF.UI.Bench.Metrology
//
// measuredTextBox
//
this.measuredTextBox.Location = new System.Drawing.Point(91, 15);
this.measuredTextBox.Location = new System.Drawing.Point(91, 25);
this.measuredTextBox.Name = "measuredTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(73, 20);
this.measuredTextBox.TabIndex = 4;
@@ -198,7 +141,7 @@ namespace TBF.UI.Bench.Metrology
// correctedLabel
//
this.correctedLabel.AutoSize = true;
this.correctedLabel.Location = new System.Drawing.Point(17, 40);
this.correctedLabel.Location = new System.Drawing.Point(17, 53);
this.correctedLabel.Name = "correctedLabel";
this.correctedLabel.Size = new System.Drawing.Size(53, 13);
this.correctedLabel.TabIndex = 3;
@@ -207,7 +150,7 @@ namespace TBF.UI.Bench.Metrology
// measuredLabel
//
this.measuredLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(17, 18);
this.measuredLabel.Location = new System.Drawing.Point(17, 28);
this.measuredLabel.Name = "measuredLabel";
this.measuredLabel.Size = new System.Drawing.Size(54, 13);
this.measuredLabel.TabIndex = 2;
@@ -220,33 +163,21 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 294);
this.listViewEx.Size = new System.Drawing.Size(650, 284);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// calibExpirationDateTimePicker
// calibCertificateCtrl
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(140, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(140, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
this.calibCertificateCtrl.Location = new System.Drawing.Point(183, 10);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 6;
//
// MetrologyDlgEvaporationTab
//
@@ -260,8 +191,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
this.nameGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
@@ -281,15 +210,8 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label correctedLabel;
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.GroupBox nameGroupBox;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.Label pressFromToLabel;
private System.Windows.Forms.Label tempFromToLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,13 +1,13 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Common.Forms;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
@@ -52,10 +52,6 @@ namespace TBF.UI.Bench.Metrology
public MetrologyDlgEvaporationTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
}
@@ -97,11 +93,6 @@ namespace TBF.UI.Bench.Metrology
{
nameGroupBox.Text = Strings.Component;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
testGroupBox.Text = Strings.Test_measured_corrected;
measuredLabel.Text = Strings.Measured;
correctedLabel.Text = Strings.Corrected;
@@ -109,12 +100,7 @@ namespace TBF.UI.Bench.Metrology
void RefreshAll()
{
if (CalibInfoCfg != null)
{
calibCertificateNrTextBox.Text = CalibInfoCfg.CalibCertificateNr;
calibDateTimePicker.Value = (CalibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (CalibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibValidDate;
}
if (CalibInfoCfg != null) calibCertificateCtrl.Refresh(CalibInfoCfg);
listViewEx.Items.Clear();
foreach (var corr in MeterEntity.Corrections)
@@ -209,9 +195,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
if (listViewEx.SelectedItems.Count == 1)
{
@@ -228,10 +212,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
CalibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
CalibInfoCfg.CalibDate = calibDateTimePicker.Value.Date;
CalibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(CalibInfoCfg);
Component modified = CalibInfoCfg.CreateDbEntity();
MeterEntity.Parameters = modified.Parameters;
}
+17 -95
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -32,15 +32,9 @@ namespace TBF.UI.Bench.Metrology
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.nameGroupBox = new System.Windows.Forms.GroupBox();
this.pressFromToLabel = new System.Windows.Forms.Label();
this.tempFromToLabel = new System.Windows.Forms.Label();
@@ -55,7 +49,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
@@ -70,9 +63,9 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
//
@@ -80,9 +73,16 @@ namespace TBF.UI.Bench.Metrology
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 400);
this.splitContainer1.SplitterDistance = 102;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// calibCertificateCtrl
//
this.calibCertificateCtrl.Location = new System.Drawing.Point(182, 10);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 11;
//
// unitLabel
//
this.unitLabel.AutoSize = true;
@@ -101,76 +101,6 @@ namespace TBF.UI.Bench.Metrology
this.unitComboBox.TabIndex = 9;
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(186, 10);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(228, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(140, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(140, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(140, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(69, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate nr.";
//
// nameGroupBox
//
this.nameGroupBox.Controls.Add(this.pressFromToLabel);
@@ -214,9 +144,9 @@ namespace TBF.UI.Bench.Metrology
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(424, 10);
this.testGroupBox.Location = new System.Drawing.Point(428, 10);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(170, 88);
this.testGroupBox.Size = new System.Drawing.Size(170, 99);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Correction test";
@@ -262,9 +192,10 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 294);
this.listViewEx.Size = new System.Drawing.Size(650, 284);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
@@ -283,8 +214,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
this.nameGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
@@ -304,17 +233,10 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label correctedLabel;
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.GroupBox nameGroupBox;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.Label pressFromToLabel;
private System.Windows.Forms.Label tempFromToLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -8,6 +8,7 @@ using System.Windows.Forms;
using log4net;
using Common;
using Common.Forms;
using Config;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
@@ -61,10 +62,6 @@ namespace TBF.UI.Bench.Metrology
public MetrologyDlgFlowMeterTab(int rangeIx1, bool isLastFlowMeterRange)
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
this.rangeIx = rangeIx1;
this.isLastFlowMeterRange = isLastFlowMeterRange;
toBeRemoved = new List<MeasurementCorrection>();
@@ -127,11 +124,6 @@ namespace TBF.UI.Bench.Metrology
void Localize()
{
nameGroupBox.Text = Strings.Component;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
testGroupBox.Text = Strings.Test_measured_corrected;
}
@@ -139,9 +131,7 @@ namespace TBF.UI.Bench.Metrology
{
if (CalibInfoCfg != null)
{
calibCertificateNrTextBox.Text = CalibInfoCfg.GetCalibCertificate(rangeIx1);
calibDateTimePicker.Value = (CalibInfoCfg.GetCalibDate(rangeIx1) < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.GetCalibDate(rangeIx1);
calibExpirationDateTimePicker.Value = (CalibInfoCfg.GetCalibValidDate(rangeIx1) < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.GetCalibValidDate(rangeIx1);
calibCertificateCtrl.Refresh(CalibInfoCfg, rangeIx1);
}
listViewEx.Items.Clear();
@@ -169,7 +159,7 @@ namespace TBF.UI.Bench.Metrology
}
else
{
double error = Config.Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
}
@@ -222,7 +212,7 @@ namespace TBF.UI.Bench.Metrology
{
correction = Units.IsDefaultUnit(currentUnit) ? difference
: Units.ConvertFrom(currentUnit, oriMeasurement + difference) - Units.ConvertFrom(currentUnit, oriMeasurement);
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -244,7 +234,7 @@ namespace TBF.UI.Bench.Metrology
/// Update error (if possible)
if (measurement != 0)
{
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -268,7 +258,7 @@ namespace TBF.UI.Bench.Metrology
{
if (Utils.TryParseEDouble(item.SubItems[1].Text, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) != 0)
{
correction = Config.Formulas.CorrectionFromError(measurement, error);
correction = Formulas.CorrectionFromError(measurement, error);
(item.Tag as MeasurementCorrection).Correction = correction;
difference = Units.IsDefaultUnit(currentUnit)
? correction
@@ -289,9 +279,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
if (listViewEx.SelectedItems.Count == 1)
{
@@ -308,9 +296,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
CalibInfoCfg.SetCalibCertificate(rangeIx, calibCertificateNrTextBox.Text);
CalibInfoCfg.SetCalibDate(rangeIx, calibDateTimePicker.Value.Date);
CalibInfoCfg.SetCalibValidDate(rangeIx, calibExpirationDateTimePicker.Value.Date);
calibCertificateCtrl.Update(CalibInfoCfg, rangeIx);
}
catch
{
+20 -98
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2018 Senus Slovensko a.s.
/// Copyright (c) 2018-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -32,11 +32,6 @@ namespace TBF.UI.Bench.Metrology
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.nameGroupBox = new System.Windows.Forms.GroupBox();
this.pressFromToLabel = new System.Windows.Forms.Label();
this.tempFromToLabel = new System.Windows.Forms.Label();
@@ -47,13 +42,11 @@ namespace TBF.UI.Bench.Metrology
this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
@@ -68,7 +61,7 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
//
@@ -76,59 +69,9 @@ namespace TBF.UI.Bench.Metrology
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 400);
this.splitContainer1.SplitterDistance = 102;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(186, 10);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(228, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(140, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(69, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate nr.";
//
// nameGroupBox
//
this.nameGroupBox.Controls.Add(this.pressFromToLabel);
@@ -136,7 +79,7 @@ namespace TBF.UI.Bench.Metrology
this.nameGroupBox.Controls.Add(this.cmpntNameLabel);
this.nameGroupBox.Location = new System.Drawing.Point(16, 10);
this.nameGroupBox.Name = "nameGroupBox";
this.nameGroupBox.Size = new System.Drawing.Size(160, 86);
this.nameGroupBox.Size = new System.Drawing.Size(160, 99);
this.nameGroupBox.TabIndex = 5;
this.nameGroupBox.TabStop = false;
this.nameGroupBox.Text = "Component";
@@ -172,16 +115,16 @@ namespace TBF.UI.Bench.Metrology
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(424, 10);
this.testGroupBox.Location = new System.Drawing.Point(428, 10);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(170, 88);
this.testGroupBox.Size = new System.Drawing.Size(170, 99);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Correction test";
//
// correctedTextBox
//
this.correctedTextBox.Location = new System.Drawing.Point(91, 37);
this.correctedTextBox.Location = new System.Drawing.Point(88, 43);
this.correctedTextBox.Name = "correctedTextBox";
this.correctedTextBox.ReadOnly = true;
this.correctedTextBox.Size = new System.Drawing.Size(73, 20);
@@ -189,7 +132,7 @@ namespace TBF.UI.Bench.Metrology
//
// measuredTextBox
//
this.measuredTextBox.Location = new System.Drawing.Point(91, 15);
this.measuredTextBox.Location = new System.Drawing.Point(88, 18);
this.measuredTextBox.Name = "measuredTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(73, 20);
this.measuredTextBox.TabIndex = 4;
@@ -198,7 +141,7 @@ namespace TBF.UI.Bench.Metrology
// correctedLabel
//
this.correctedLabel.AutoSize = true;
this.correctedLabel.Location = new System.Drawing.Point(17, 40);
this.correctedLabel.Location = new System.Drawing.Point(14, 46);
this.correctedLabel.Name = "correctedLabel";
this.correctedLabel.Size = new System.Drawing.Size(53, 13);
this.correctedLabel.TabIndex = 3;
@@ -207,7 +150,7 @@ namespace TBF.UI.Bench.Metrology
// measuredLabel
//
this.measuredLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(17, 18);
this.measuredLabel.Location = new System.Drawing.Point(14, 21);
this.measuredLabel.Name = "measuredLabel";
this.measuredLabel.Size = new System.Drawing.Size(54, 13);
this.measuredLabel.TabIndex = 2;
@@ -220,33 +163,21 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 294);
this.listViewEx.Size = new System.Drawing.Size(650, 284);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// calibExpirationDateTimePicker
// calibCertificateCtrl
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(140, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(140, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
this.calibCertificateCtrl.Location = new System.Drawing.Point(182, 10);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 6;
//
// MetrologyDlgLevelMeterTab
//
@@ -260,8 +191,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
this.nameGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
@@ -281,15 +210,8 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label correctedLabel;
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.GroupBox nameGroupBox;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.Label pressFromToLabel;
private System.Windows.Forms.Label tempFromToLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,13 +1,13 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Common.Forms;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
@@ -52,10 +52,6 @@ namespace TBF.UI.Bench.Metrology
public MetrologyDlgLevelMeterTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
}
@@ -97,11 +93,6 @@ namespace TBF.UI.Bench.Metrology
{
nameGroupBox.Text = Strings.Component;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
testGroupBox.Text = Strings.Test_measured_corrected;
measuredLabel.Text = Strings.Measured;
correctedLabel.Text = Strings.Corrected;
@@ -109,12 +100,7 @@ namespace TBF.UI.Bench.Metrology
void RefreshAll()
{
if (CalibInfoCfg != null)
{
calibCertificateNrTextBox.Text = CalibInfoCfg.CalibCertificateNr;
calibDateTimePicker.Value = (CalibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (CalibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibValidDate;
}
if (CalibInfoCfg != null) calibCertificateCtrl.Refresh(CalibInfoCfg);
listViewEx.Items.Clear();
foreach (var corr in MeterEntity.Corrections)
@@ -209,9 +195,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
if (listViewEx.SelectedItems.Count == 1)
{
@@ -228,10 +212,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
CalibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
CalibInfoCfg.CalibDate = calibDateTimePicker.Value.Date;
CalibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(CalibInfoCfg);
Component modified = CalibInfoCfg.CreateDbEntity();
MeterEntity.Parameters = modified.Parameters;
}
@@ -332,7 +313,7 @@ namespace TBF.UI.Bench.Metrology
CultureInfo.InvariantCulture,
out measured))
{
double corrected = MeasurementCorrection.CorrectedValue(measured, meterEntity.Corrections);
double corrected = MeasurementCorrection.CorrectedValue(measured, meterEntity.Corrections);
correctedTextBox.Text = corrected.ToString();
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -40,11 +40,6 @@ namespace TBF.UI.Bench.Metrology
this.resistanceLabel = new System.Windows.Forms.Label();
this.temperatureLabel = new System.Windows.Forms.Label();
this.resistanceTextBox = new System.Windows.Forms.TextBox();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.its90CalibrationCoefficientsGroupBox = new System.Windows.Forms.GroupBox();
this.c7TextBox = new System.Windows.Forms.TextBox();
this.c7Label = new System.Windows.Forms.Label();
@@ -62,13 +57,11 @@ namespace TBF.UI.Bench.Metrology
this.r0TextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.its90CalibrationCoefficientsGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout();
this.its27CalibrationCoefficientsGroupBox.SuspendLayout();
@@ -93,21 +86,21 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.radioButton2);
this.splitContainer1.Panel1.Controls.Add(this.radioButton1);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.its90CalibrationCoefficientsGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.its27CalibrationCoefficientsGroupBox);
this.splitContainer1.Size = new System.Drawing.Size(668, 400);
this.splitContainer1.SplitterDistance = 300;
this.splitContainer1.Size = new System.Drawing.Size(700, 400);
this.splitContainer1.SplitterDistance = 250;
this.splitContainer1.TabIndex = 1;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(462, 24);
this.radioButton2.Location = new System.Drawing.Point(498, 14);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(187, 17);
this.radioButton2.TabIndex = 11;
@@ -118,7 +111,7 @@ namespace TBF.UI.Bench.Metrology
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Location = new System.Drawing.Point(235, 24);
this.radioButton1.Location = new System.Drawing.Point(271, 14);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(187, 17);
this.radioButton1.TabIndex = 10;
@@ -132,9 +125,9 @@ namespace TBF.UI.Bench.Metrology
this.testGroupBox.Controls.Add(this.resistanceLabel);
this.testGroupBox.Controls.Add(this.temperatureLabel);
this.testGroupBox.Controls.Add(this.resistanceTextBox);
this.testGroupBox.Location = new System.Drawing.Point(16, 155);
this.testGroupBox.Location = new System.Drawing.Point(16, 164);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(208, 77);
this.testGroupBox.Size = new System.Drawing.Size(240, 77);
this.testGroupBox.TabIndex = 9;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Test";
@@ -173,56 +166,6 @@ namespace TBF.UI.Bench.Metrology
this.resistanceTextBox.TabIndex = 4;
this.resistanceTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged);
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(16, 54);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(208, 95);
this.calibrationGroupBox.TabIndex = 6;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 68);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 43);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(105, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(95, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(54, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate";
//
// its90CalibrationCoefficientsGroupBox
//
this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.c7TextBox);
@@ -233,7 +176,7 @@ namespace TBF.UI.Bench.Metrology
this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.b7Label);
this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.a7Label);
this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.r0Label);
this.its90CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(230, 54);
this.its90CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(266, 40);
this.its90CalibrationCoefficientsGroupBox.Name = "its90CalibrationCoefficientsGroupBox";
this.its90CalibrationCoefficientsGroupBox.Size = new System.Drawing.Size(220, 140);
this.its90CalibrationCoefficientsGroupBox.TabIndex = 5;
@@ -313,7 +256,7 @@ namespace TBF.UI.Bench.Metrology
this.nameGroupBox.Controls.Add(this.cmpntNameLabel);
this.nameGroupBox.Location = new System.Drawing.Point(16, 10);
this.nameGroupBox.Name = "nameGroupBox";
this.nameGroupBox.Size = new System.Drawing.Size(208, 40);
this.nameGroupBox.Size = new System.Drawing.Size(240, 40);
this.nameGroupBox.TabIndex = 4;
this.nameGroupBox.TabStop = false;
this.nameGroupBox.Text = "Component";
@@ -326,7 +269,7 @@ namespace TBF.UI.Bench.Metrology
this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.r0TextBox);
this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.label2);
this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.label3);
this.its27CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(459, 54);
this.its27CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(495, 40);
this.its27CalibrationCoefficientsGroupBox.Name = "its27CalibrationCoefficientsGroupBox";
this.its27CalibrationCoefficientsGroupBox.Size = new System.Drawing.Size(190, 140);
this.its27CalibrationCoefficientsGroupBox.TabIndex = 3;
@@ -384,25 +327,12 @@ namespace TBF.UI.Bench.Metrology
this.label3.TabIndex = 8;
this.label3.Text = "R0";
//
// calibDateTimePicker
// calibCertificateCtrl
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(105, 40);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(95, 20);
this.calibDateTimePicker.TabIndex = 17;
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(105, 64);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(95, 20);
this.calibExpirationDateTimePicker.TabIndex = 18;
this.calibCertificateCtrl.Location = new System.Drawing.Point(16, 58);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 12;
//
// MetrologyDlgPlatinumResistanceTMeterTab
//
@@ -410,7 +340,7 @@ namespace TBF.UI.Bench.Metrology
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "MetrologyDlgPlatinumResistanceTMeterTab";
this.Size = new System.Drawing.Size(668, 400);
this.Size = new System.Drawing.Size(700, 400);
this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
@@ -418,8 +348,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.ResumeLayout(false);
this.testGroupBox.ResumeLayout(false);
this.testGroupBox.PerformLayout();
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.its90CalibrationCoefficientsGroupBox.ResumeLayout(false);
this.its90CalibrationCoefficientsGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
@@ -449,11 +377,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label r0Label;
private System.Windows.Forms.TextBox c7TextBox;
private System.Windows.Forms.Label c7Label;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.GroupBox testGroupBox;
private System.Windows.Forms.TextBox bTextBox;
private System.Windows.Forms.Label label1;
@@ -463,7 +386,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label label3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,11 +1,11 @@
///
/// Copyright (c) 2016-2020 Senus Slovensko a.s.
/// Copyright (c) 2016-2023 Senus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using log4net;
using Config;
using Config.Entities;
using TBF.Resources;
@@ -19,12 +19,7 @@ namespace TBF.UI.Bench.Metrology
/// Component entity that has a list of 'measurement-correction' pairs
/// to be updated in the database on OK.
/// </summary>
public Component MeterEntity
{
get { return meterEntity; }
set { meterEntity = value; }
}
Component meterEntity;
public Component MeterEntity { get; set; }
/// <summary>
/// Balance configuration (with buoyancy parameters)
@@ -34,30 +29,19 @@ namespace TBF.UI.Bench.Metrology
/// <summary>
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
/// </summary>
public IList<MeasurementCorrection> ToBeRemoved
{
get { return toBeRemoved; }
set { toBeRemoved = value; }
}
IList<MeasurementCorrection> toBeRemoved;
public IList<MeasurementCorrection> ToBeRemoved { get; set; }
MetrologyDlg parent;
bool unlocked;
public MetrologyDlgPlatinumResistanceTMeterTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
ToBeRemoved = new List<MeasurementCorrection>();
}
private void MetrologyDlgBalanceTab_Load(object sender, System.EventArgs e)
{
if (meterEntity == null) return;
if (MeterEntity == null) return;
parent = ParentForm as MetrologyDlg;
@@ -75,11 +59,6 @@ namespace TBF.UI.Bench.Metrology
{
nameGroupBox.Text = Strings.Component;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
testGroupBox.Text = Strings.Test;
resistanceLabel.Text = string.Format("{0} [Ω]", Strings.Resistance);
temperatureLabel.Text = string.Format("{0} [°C]", Strings.Temperature);
@@ -95,9 +74,7 @@ namespace TBF.UI.Bench.Metrology
{
if (TempMeterCfg != null)
{
calibCertificateNrTextBox.Text = TempMeterCfg.CalibCertificateNr;
calibDateTimePicker.Value = (TempMeterCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : TempMeterCfg.CalibDate;
calibExpirationDateTimePicker.Value = (TempMeterCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : TempMeterCfg.CalibValidDate;
calibCertificateCtrl.Refresh(TempMeterCfg);
radioButton1.Checked = TempMeterCfg.UseITS90;
radioButton2.Checked = !TempMeterCfg.UseITS90;
@@ -115,11 +92,7 @@ namespace TBF.UI.Bench.Metrology
public void Unlock()
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
radioButton1.Enabled = true;
radioButton2.Enabled = true;
@@ -140,9 +113,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
TempMeterCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
TempMeterCfg.CalibDate = calibDateTimePicker.Value.Date;
TempMeterCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(TempMeterCfg);
TempMeterCfg.UseITS90 = radioButton1.Checked;
@@ -182,14 +153,14 @@ namespace TBF.UI.Bench.Metrology
double a7 = Utils.ParseEDouble(a7TextBox.Text);
double b7 = Utils.ParseEDouble(b7TextBox.Text);
double c7 = Utils.ParseEDouble(c7TextBox.Text);
temperature = Config.Formulas.PlatinumResistanceTM_ITS90_R2T(resistance, R001C, a7, b7, c7);
temperature = Formulas.PlatinumResistanceTM_ITS90_R2T(resistance, R001C, a7, b7, c7);
}
else
{
double R0 = Utils.ParseUDouble(r0TextBox.Text);
double a = Utils.ParseEDouble(aTextBox.Text);
double b = Utils.ParseEDouble(bTextBox.Text);
temperature = Config.Formulas.PlatinumResistanceTM_ITS27_R2T(resistance, R0, a, b);
temperature = Formulas.PlatinumResistanceTM_ITS27_R2T(resistance, R0, a, b);
}
temperatureTextBox.Text = temperature.ToString();
}
@@ -203,25 +174,11 @@ namespace TBF.UI.Bench.Metrology
}
}
public void CancelBtnClicked()
{
}
public void AddOne()
{
}
public void RemoveSelected()
{
}
public void MoveUpSelected()
{
}
public void MoveDownSelected()
{
}
public void CancelBtnClicked() { }
public void AddOne() { }
public void RemoveSelected() { }
public void MoveUpSelected() { }
public void MoveDownSelected() { }
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
+17 -95
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -34,13 +34,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.testGroupBox = new System.Windows.Forms.GroupBox();
this.correctedTextBox = new System.Windows.Forms.TextBox();
this.measuredTextBox = new System.Windows.Forms.TextBox();
@@ -49,11 +42,11 @@ namespace TBF.UI.Bench.Metrology
this.componentLabel = new System.Windows.Forms.Label();
this.cmpntNameLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
//
@@ -67,9 +60,9 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.componentLabel);
this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel);
@@ -78,7 +71,7 @@ namespace TBF.UI.Bench.Metrology
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 300);
this.splitContainer1.SplitterDistance = 110;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// unitLabel
@@ -99,85 +92,15 @@ namespace TBF.UI.Bench.Metrology
this.unitComboBox.TabIndex = 9;
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(204, 12);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(208, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(117, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(117, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(117, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(54, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate";
//
// testGroupBox
//
this.testGroupBox.Controls.Add(this.correctedTextBox);
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(428, 12);
this.testGroupBox.Location = new System.Drawing.Point(442, 9);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(200, 86);
this.testGroupBox.Size = new System.Drawing.Size(200, 100);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Test";
@@ -241,14 +164,22 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 186);
this.listViewEx.Size = new System.Drawing.Size(650, 184);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// calibCertificateCtrl
//
this.calibCertificateCtrl.Location = new System.Drawing.Point(196, 9);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 11;
//
// MetrologyDlgPressMeterTab
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -262,8 +193,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
this.testGroupBox.PerformLayout();
this.ResumeLayout(false);
@@ -281,15 +210,8 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.TextBox measuredTextBox;
private System.Windows.Forms.Label correctedLabel;
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -8,6 +8,7 @@ using System.Windows.Forms;
using log4net;
using Common;
using Common.Forms;
using Config;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
@@ -57,10 +58,6 @@ namespace TBF.UI.Bench.Metrology
public MetrologyDlgPressMeterTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
}
@@ -113,20 +110,11 @@ namespace TBF.UI.Bench.Metrology
{
componentLabel.Text = Strings.Component;
testGroupBox.Text = Strings.Test_measured_corrected;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
}
void RefreshAll()
void RefreshAll()
{
if (CalibInfoCfg != null)
{
calibCertificateNrTextBox.Text = CalibInfoCfg.CalibCertificateNr;
calibDateTimePicker.Value = (CalibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (CalibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibValidDate;
}
if (CalibInfoCfg != null) calibCertificateCtrl.Refresh(CalibInfoCfg);
listViewEx.Items.Clear();
foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr);
@@ -150,7 +138,7 @@ namespace TBF.UI.Bench.Metrology
}
else
{
double error = Config.Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
}
@@ -204,7 +192,7 @@ namespace TBF.UI.Bench.Metrology
{
correction = Units.IsDefaultUnit(currentUnit) ? difference
: Units.ConvertFrom(currentUnit, oriMeasurement + difference) - Units.ConvertFrom(currentUnit, oriMeasurement);
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -226,7 +214,7 @@ namespace TBF.UI.Bench.Metrology
/// Update error (if possible)
if (measurement != 0)
{
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -250,7 +238,7 @@ namespace TBF.UI.Bench.Metrology
{
if (Utils.TryParseEDouble(item.SubItems[1].Text, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) != 0)
{
correction = Config.Formulas.CorrectionFromError(measurement, error);
correction = Formulas.CorrectionFromError(measurement, error);
(item.Tag as MeasurementCorrection).Correction = correction;
difference = Units.IsDefaultUnit(currentUnit)
? correction
@@ -271,9 +259,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
if (listViewEx.SelectedItems.Count == 1)
{
@@ -290,10 +276,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
CalibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
CalibInfoCfg.CalibDate = calibDateTimePicker.Value.Date;
CalibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(CalibInfoCfg);
Component modified = CalibInfoCfg.CreateDbEntity();
MeterEntity.Parameters = modified.Parameters;
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -8,15 +8,16 @@ using System.Windows.Forms;
using log4net;
using Common;
using Common.Forms;
using Config;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
namespace TBF.UI.Bench.Metrology
{
public partial class MetrologyDlgBalanceTab : UserControl, IMetrologyDlgTab
public partial class MetrologyDlgScaleTab : UserControl, IMetrologyDlgTab
{
static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlgBalanceTab));
static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlgScaleTab));
public const int SignifDigits = 5;
@@ -54,13 +55,9 @@ namespace TBF.UI.Bench.Metrology
Unit currentUnit;
public MetrologyDlgBalanceTab()
public MetrologyDlgScaleTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
}
@@ -112,13 +109,7 @@ namespace TBF.UI.Bench.Metrology
void Localize()
{
nameGroupBox.Text = Strings.Component;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
buoyancyTempLabel.Text = string.Format("{0} [°C]", Strings.Ambient_temperature);
buoyancyTempLabel.Text = string.Format("{0} [°C]", Strings.Ambient_temperature);
buoyancyPressLabel.Text = string.Format("{0} [mbar]", Strings.Ambient_pressure);
buoyancyHumiLabel.Text = string.Format("{0} [%]", Strings.Ambient_humidity);
airDensityLabel.Text = Strings.Air_density_kg_m3;
@@ -130,9 +121,7 @@ namespace TBF.UI.Bench.Metrology
{
if (BalanceCfg != null)
{
calibCertificateNrTextBox.Text = BalanceCfg.CalibCertificateNr;
calibDateTimePicker.Value = (BalanceCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : BalanceCfg.CalibDate;
calibExpirationDateTimePicker.Value = (BalanceCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : BalanceCfg.CalibValidDate;
calibCertificateCtrl.Refresh(BalanceCfg);
buoyancyTempTextBox.Text = BalanceCfg.BuoyancyTemp.ToString("F2");
buoyancyPressTextBox.Text = BalanceCfg.BuoyancyPress.ToString("F4");
@@ -163,7 +152,7 @@ namespace TBF.UI.Bench.Metrology
}
else
{
double error = Config.Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
}
@@ -216,7 +205,7 @@ namespace TBF.UI.Bench.Metrology
{
correction = Units.IsDefaultUnit(currentUnit) ? difference
: Units.ConvertFrom(currentUnit, oriMeasurement + difference) - Units.ConvertFrom(currentUnit, oriMeasurement);
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -238,7 +227,7 @@ namespace TBF.UI.Bench.Metrology
/// Update error (if possible)
if (measurement != 0)
{
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -262,7 +251,7 @@ namespace TBF.UI.Bench.Metrology
{
if (Utils.TryParseEDouble(item.SubItems[1].Text, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) != 0)
{
correction = Config.Formulas.CorrectionFromError(measurement, error);
correction = Formulas.CorrectionFromError(measurement, error);
(item.Tag as MeasurementCorrection).Correction = correction;
difference = Units.IsDefaultUnit(currentUnit)
? correction
@@ -283,9 +272,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
buoyancyTempTextBox.Enabled = true;
buoyancyPressTextBox.Enabled = true;
@@ -307,9 +294,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
BalanceCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
BalanceCfg.CalibDate = calibDateTimePicker.Value.Date;
BalanceCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(BalanceCfg);
BalanceCfg.BuoyancyTemp = Utils.ParseSFloat(buoyancyTempTextBox.Text);
BalanceCfg.BuoyancyPress = Utils.ParseUFloat(buoyancyPressTextBox.Text);
@@ -1,9 +1,9 @@
///
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
/// Copyright (c) 2013-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
partial class MetrologyDlgBalanceTab
partial class MetrologyDlgScaleTab
{
/// <summary>
/// Required designer variable.
@@ -35,13 +35,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.buoancyGroupBox = new System.Windows.Forms.GroupBox();
this.weightStandardDensityTextBox = new System.Windows.Forms.TextBox();
this.weightStandardDensityLabel = new System.Windows.Forms.Label();
@@ -60,11 +53,11 @@ namespace TBF.UI.Bench.Metrology
this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.buoancyGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
@@ -89,9 +82,9 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.buoancyGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
@@ -99,14 +92,14 @@ namespace TBF.UI.Bench.Metrology
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(668, 400);
this.splitContainer1.SplitterDistance = 150;
this.splitContainer1.Size = new System.Drawing.Size(700, 400);
this.splitContainer1.SplitterDistance = 160;
this.splitContainer1.TabIndex = 1;
//
// unitLabel
//
this.unitLabel.AutoSize = true;
this.unitLabel.Location = new System.Drawing.Point(507, 116);
this.unitLabel.Location = new System.Drawing.Point(537, 121);
this.unitLabel.Name = "unitLabel";
this.unitLabel.Size = new System.Drawing.Size(68, 13);
this.unitLabel.TabIndex = 12;
@@ -115,82 +108,12 @@ namespace TBF.UI.Bench.Metrology
// unitComboBox
//
this.unitComboBox.FormattingEnabled = true;
this.unitComboBox.Location = new System.Drawing.Point(592, 113);
this.unitComboBox.Location = new System.Drawing.Point(622, 118);
this.unitComboBox.Name = "unitComboBox";
this.unitComboBox.Size = new System.Drawing.Size(62, 21);
this.unitComboBox.TabIndex = 11;
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(16, 54);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(208, 86);
this.calibrationGroupBox.TabIndex = 6;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(120, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 17;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(120, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 16;
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(120, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(54, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate";
//
// buoancyGroupBox
//
this.buoancyGroupBox.Controls.Add(this.weightStandardDensityTextBox);
@@ -203,9 +126,9 @@ namespace TBF.UI.Bench.Metrology
this.buoancyGroupBox.Controls.Add(this.buoyancyHumiLabel);
this.buoancyGroupBox.Controls.Add(this.buoyancyPressLabel);
this.buoancyGroupBox.Controls.Add(this.buoyancyTempLabel);
this.buoancyGroupBox.Location = new System.Drawing.Point(233, 10);
this.buoancyGroupBox.Location = new System.Drawing.Point(262, 10);
this.buoancyGroupBox.Name = "buoancyGroupBox";
this.buoancyGroupBox.Size = new System.Drawing.Size(248, 130);
this.buoancyGroupBox.Size = new System.Drawing.Size(248, 146);
this.buoancyGroupBox.TabIndex = 5;
this.buoancyGroupBox.TabStop = false;
this.buoancyGroupBox.Text = "Buoyancy";
@@ -213,7 +136,7 @@ namespace TBF.UI.Bench.Metrology
// weightStandardDensityTextBox
//
this.weightStandardDensityTextBox.Enabled = false;
this.weightStandardDensityTextBox.Location = new System.Drawing.Point(160, 103);
this.weightStandardDensityTextBox.Location = new System.Drawing.Point(156, 107);
this.weightStandardDensityTextBox.Name = "weightStandardDensityTextBox";
this.weightStandardDensityTextBox.Size = new System.Drawing.Size(82, 20);
this.weightStandardDensityTextBox.TabIndex = 9;
@@ -221,7 +144,7 @@ namespace TBF.UI.Bench.Metrology
// weightStandardDensityLabel
//
this.weightStandardDensityLabel.AutoSize = true;
this.weightStandardDensityLabel.Location = new System.Drawing.Point(17, 106);
this.weightStandardDensityLabel.Location = new System.Drawing.Point(13, 110);
this.weightStandardDensityLabel.Name = "weightStandardDensityLabel";
this.weightStandardDensityLabel.Size = new System.Drawing.Size(133, 13);
this.weightStandardDensityLabel.TabIndex = 8;
@@ -230,7 +153,7 @@ namespace TBF.UI.Bench.Metrology
// airDensityTextBox
//
this.airDensityTextBox.Enabled = false;
this.airDensityTextBox.Location = new System.Drawing.Point(160, 81);
this.airDensityTextBox.Location = new System.Drawing.Point(156, 85);
this.airDensityTextBox.Name = "airDensityTextBox";
this.airDensityTextBox.Size = new System.Drawing.Size(82, 20);
this.airDensityTextBox.TabIndex = 7;
@@ -238,7 +161,7 @@ namespace TBF.UI.Bench.Metrology
// airDensityLabel
//
this.airDensityLabel.AutoSize = true;
this.airDensityLabel.Location = new System.Drawing.Point(17, 84);
this.airDensityLabel.Location = new System.Drawing.Point(13, 88);
this.airDensityLabel.Name = "airDensityLabel";
this.airDensityLabel.Size = new System.Drawing.Size(95, 13);
this.airDensityLabel.TabIndex = 6;
@@ -247,7 +170,7 @@ namespace TBF.UI.Bench.Metrology
// buoyancyHumiTextBox
//
this.buoyancyHumiTextBox.Enabled = false;
this.buoyancyHumiTextBox.Location = new System.Drawing.Point(160, 59);
this.buoyancyHumiTextBox.Location = new System.Drawing.Point(156, 63);
this.buoyancyHumiTextBox.Name = "buoyancyHumiTextBox";
this.buoyancyHumiTextBox.Size = new System.Drawing.Size(82, 20);
this.buoyancyHumiTextBox.TabIndex = 5;
@@ -255,7 +178,7 @@ namespace TBF.UI.Bench.Metrology
// buoyancyPressTextBox
//
this.buoyancyPressTextBox.Enabled = false;
this.buoyancyPressTextBox.Location = new System.Drawing.Point(160, 37);
this.buoyancyPressTextBox.Location = new System.Drawing.Point(156, 41);
this.buoyancyPressTextBox.Name = "buoyancyPressTextBox";
this.buoyancyPressTextBox.Size = new System.Drawing.Size(82, 20);
this.buoyancyPressTextBox.TabIndex = 4;
@@ -263,7 +186,7 @@ namespace TBF.UI.Bench.Metrology
// buoyancyTempTextBox
//
this.buoyancyTempTextBox.Enabled = false;
this.buoyancyTempTextBox.Location = new System.Drawing.Point(160, 15);
this.buoyancyTempTextBox.Location = new System.Drawing.Point(156, 19);
this.buoyancyTempTextBox.Name = "buoyancyTempTextBox";
this.buoyancyTempTextBox.Size = new System.Drawing.Size(82, 20);
this.buoyancyTempTextBox.TabIndex = 3;
@@ -271,7 +194,7 @@ namespace TBF.UI.Bench.Metrology
// buoyancyHumiLabel
//
this.buoyancyHumiLabel.AutoSize = true;
this.buoyancyHumiLabel.Location = new System.Drawing.Point(17, 62);
this.buoyancyHumiLabel.Location = new System.Drawing.Point(13, 66);
this.buoyancyHumiLabel.Name = "buoyancyHumiLabel";
this.buoyancyHumiLabel.Size = new System.Drawing.Size(72, 13);
this.buoyancyHumiLabel.TabIndex = 2;
@@ -280,7 +203,7 @@ namespace TBF.UI.Bench.Metrology
// buoyancyPressLabel
//
this.buoyancyPressLabel.AutoSize = true;
this.buoyancyPressLabel.Location = new System.Drawing.Point(17, 40);
this.buoyancyPressLabel.Location = new System.Drawing.Point(13, 44);
this.buoyancyPressLabel.Name = "buoyancyPressLabel";
this.buoyancyPressLabel.Size = new System.Drawing.Size(76, 13);
this.buoyancyPressLabel.TabIndex = 1;
@@ -289,7 +212,7 @@ namespace TBF.UI.Bench.Metrology
// buoyancyTempLabel
//
this.buoyancyTempLabel.AutoSize = true;
this.buoyancyTempLabel.Location = new System.Drawing.Point(17, 18);
this.buoyancyTempLabel.Location = new System.Drawing.Point(13, 22);
this.buoyancyTempLabel.Name = "buoyancyTempLabel";
this.buoyancyTempLabel.Size = new System.Drawing.Size(83, 13);
this.buoyancyTempLabel.TabIndex = 0;
@@ -300,7 +223,7 @@ namespace TBF.UI.Bench.Metrology
this.nameGroupBox.Controls.Add(this.cmpntNameLabel);
this.nameGroupBox.Location = new System.Drawing.Point(16, 10);
this.nameGroupBox.Name = "nameGroupBox";
this.nameGroupBox.Size = new System.Drawing.Size(208, 40);
this.nameGroupBox.Size = new System.Drawing.Size(240, 40);
this.nameGroupBox.TabIndex = 4;
this.nameGroupBox.TabStop = false;
this.nameGroupBox.Text = "Component";
@@ -311,7 +234,7 @@ namespace TBF.UI.Bench.Metrology
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(490, 10);
this.testGroupBox.Location = new System.Drawing.Point(516, 10);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(170, 88);
this.testGroupBox.TabIndex = 3;
@@ -320,7 +243,7 @@ namespace TBF.UI.Bench.Metrology
//
// correctedTextBox
//
this.correctedTextBox.Location = new System.Drawing.Point(91, 37);
this.correctedTextBox.Location = new System.Drawing.Point(91, 47);
this.correctedTextBox.Name = "correctedTextBox";
this.correctedTextBox.ReadOnly = true;
this.correctedTextBox.Size = new System.Drawing.Size(73, 20);
@@ -328,7 +251,7 @@ namespace TBF.UI.Bench.Metrology
//
// measuredTextBox
//
this.measuredTextBox.Location = new System.Drawing.Point(91, 15);
this.measuredTextBox.Location = new System.Drawing.Point(91, 19);
this.measuredTextBox.Name = "measuredTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(73, 20);
this.measuredTextBox.TabIndex = 4;
@@ -337,7 +260,7 @@ namespace TBF.UI.Bench.Metrology
// correctedLabel
//
this.correctedLabel.AutoSize = true;
this.correctedLabel.Location = new System.Drawing.Point(11, 40);
this.correctedLabel.Location = new System.Drawing.Point(11, 50);
this.correctedLabel.Name = "correctedLabel";
this.correctedLabel.Size = new System.Drawing.Size(53, 13);
this.correctedLabel.TabIndex = 3;
@@ -346,7 +269,7 @@ namespace TBF.UI.Bench.Metrology
// measuredLabel
//
this.measuredLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(11, 18);
this.measuredLabel.Location = new System.Drawing.Point(11, 22);
this.measuredLabel.Name = "measuredLabel";
this.measuredLabel.Size = new System.Drawing.Size(54, 13);
this.measuredLabel.TabIndex = 2;
@@ -359,29 +282,35 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(668, 246);
this.listViewEx.Size = new System.Drawing.Size(700, 236);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// MetrologyDlgBalanceTab
// calibCertificateCtrl
//
this.calibCertificateCtrl.Location = new System.Drawing.Point(16, 56);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 13;
//
// MetrologyDlgScaleTab
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "MetrologyDlgBalanceTab";
this.Size = new System.Drawing.Size(668, 400);
this.Name = "MetrologyDlgScaleTab";
this.Size = new System.Drawing.Size(700, 400);
this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.buoancyGroupBox.ResumeLayout(false);
this.buoancyGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
@@ -414,14 +343,8 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label weightStandardDensityLabel;
private System.Windows.Forms.TextBox airDensityTextBox;
private System.Windows.Forms.Label airDensityLabel;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+18 -96
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Senus Slovensko a.s.
/// Copyright (c) 2017-2023 Senus Slovensko a.s.
///
namespace TBF.UI.Bench.Metrology
{
@@ -32,15 +32,9 @@ namespace TBF.UI.Bench.Metrology
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox();
this.calibrationGroupBox = new System.Windows.Forms.GroupBox();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.calibCertificateNrLabel = new System.Windows.Forms.Label();
this.testGroupBox = new System.Windows.Forms.GroupBox();
this.correctedTextBox = new System.Windows.Forms.TextBox();
this.measuredTextBox = new System.Windows.Forms.TextBox();
@@ -53,7 +47,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.calibrationGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
//
@@ -67,9 +60,9 @@ namespace TBF.UI.Bench.Metrology
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.componentLabel);
this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel);
@@ -78,9 +71,16 @@ namespace TBF.UI.Bench.Metrology
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 300);
this.splitContainer1.SplitterDistance = 110;
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// calibCertificateCtrl
//
this.calibCertificateCtrl.Location = new System.Drawing.Point(195, 7);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 9;
//
// unitLabel
//
this.unitLabel.AutoSize = true;
@@ -93,90 +93,20 @@ namespace TBF.UI.Bench.Metrology
// unitComboBox
//
this.unitComboBox.FormattingEnabled = true;
this.unitComboBox.Location = new System.Drawing.Point(123, 57);
this.unitComboBox.Location = new System.Drawing.Point(121, 57);
this.unitComboBox.Name = "unitComboBox";
this.unitComboBox.Size = new System.Drawing.Size(62, 21);
this.unitComboBox.TabIndex = 1;
//
// calibrationGroupBox
//
this.calibrationGroupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibDateTimePicker);
this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibDateLabel);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox);
this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel);
this.calibrationGroupBox.Location = new System.Drawing.Point(204, 12);
this.calibrationGroupBox.Name = "calibrationGroupBox";
this.calibrationGroupBox.Size = new System.Drawing.Size(208, 86);
this.calibrationGroupBox.TabIndex = 7;
this.calibrationGroupBox.TabStop = false;
this.calibrationGroupBox.Text = "Calibration";
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(117, 59);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibExpirationDateTimePicker.TabIndex = 19;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(117, 37);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(82, 20);
this.calibDateTimePicker.TabIndex = 18;
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13);
this.calibValidDateLabel.TabIndex = 14;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(17, 40);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(30, 13);
this.calibDateLabel.TabIndex = 12;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(117, 15);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20);
this.calibCertificateNrTextBox.TabIndex = 11;
//
// calibCertificateNrLabel
//
this.calibCertificateNrLabel.AutoSize = true;
this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18);
this.calibCertificateNrLabel.Name = "calibCertificateNrLabel";
this.calibCertificateNrLabel.Size = new System.Drawing.Size(54, 13);
this.calibCertificateNrLabel.TabIndex = 10;
this.calibCertificateNrLabel.Text = "Certificate";
//
// testGroupBox
//
this.testGroupBox.Controls.Add(this.correctedTextBox);
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(428, 12);
this.testGroupBox.Location = new System.Drawing.Point(441, 7);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(200, 86);
this.testGroupBox.Size = new System.Drawing.Size(200, 100);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Test";
@@ -240,9 +170,10 @@ namespace TBF.UI.Bench.Metrology
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 186);
this.listViewEx.Size = new System.Drawing.Size(650, 184);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
@@ -261,8 +192,6 @@ namespace TBF.UI.Bench.Metrology
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.calibrationGroupBox.ResumeLayout(false);
this.calibrationGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
this.testGroupBox.PerformLayout();
this.ResumeLayout(false);
@@ -280,15 +209,8 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.TextBox measuredTextBox;
private System.Windows.Forms.Label correctedLabel;
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.GroupBox calibrationGroupBox;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label calibCertificateNrLabel;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox;
}
private CalibCertificateCtrl calibCertificateCtrl;
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2022 Sensus Slovensko a.s.
/// Copyright (c) 2017-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -8,6 +8,7 @@ using System.Windows.Forms;
using log4net;
using Common;
using Common.Forms;
using Config;
using Config.Entities;
using TBF.Resources;
using TBF.UI.Shared;
@@ -57,10 +58,6 @@ namespace TBF.UI.Bench.Metrology
public MetrologyDlgTempMeterTab()
{
InitializeComponent();
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toBeRemoved = new List<MeasurementCorrection>();
unlocked = false;
}
@@ -113,19 +110,13 @@ namespace TBF.UI.Bench.Metrology
{
componentLabel.Text = Strings.Component;
testGroupBox.Text = Strings.Test_measured_corrected;
calibrationGroupBox.Text = Strings.Calibration;
calibCertificateNrLabel.Text = Strings.Certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
}
void RefreshAll()
{
if (CalibInfoCfg != null)
{
calibCertificateNrTextBox.Text = CalibInfoCfg.CalibCertificateNr;
calibDateTimePicker.Value = (CalibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (CalibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : CalibInfoCfg.CalibValidDate;
calibCertificateCtrl.Refresh(CalibInfoCfg);
}
listViewEx.Items.Clear();
@@ -150,7 +141,7 @@ namespace TBF.UI.Bench.Metrology
}
else
{
double error = Config.Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
}
@@ -203,7 +194,7 @@ namespace TBF.UI.Bench.Metrology
{
correction = Units.IsDefaultUnit(currentUnit) ? difference
: Units.ConvertFrom(currentUnit, oriMeasurement + difference) - Units.ConvertFrom(currentUnit, oriMeasurement);
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -225,7 +216,7 @@ namespace TBF.UI.Bench.Metrology
/// Update error (if possible)
if (measurement != 0)
{
error = Config.Formulas.ErrorFromVolumes(measurement, measurement + correction);
error = Formulas.ErrorFromVolumes(measurement, measurement + correction);
item.SubItems[3].Text = Common.Utils.ToNiceString(error, SignifDigits);
}
else
@@ -249,7 +240,7 @@ namespace TBF.UI.Bench.Metrology
{
if (Utils.TryParseEDouble(item.SubItems[1].Text, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) != 0)
{
correction = Config.Formulas.CorrectionFromError(measurement, error);
correction = Formulas.CorrectionFromError(measurement, error);
(item.Tag as MeasurementCorrection).Correction = correction;
difference = Units.IsDefaultUnit(currentUnit)
? correction
@@ -270,9 +261,7 @@ namespace TBF.UI.Bench.Metrology
{
unlocked = true;
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
calibCertificateCtrl.Unlock();
if (listViewEx.SelectedItems.Count == 1)
{
@@ -289,9 +278,7 @@ namespace TBF.UI.Bench.Metrology
{
try
{
CalibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
CalibInfoCfg.CalibDate = calibDateTimePicker.Value.Date;
CalibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value.Date;
calibCertificateCtrl.Update(CalibInfoCfg);
Component modified = CalibInfoCfg.CreateDbEntity();
MeterEntity.Parameters = modified.Parameters;
+2 -2
View File
@@ -54,9 +54,9 @@ namespace TBF.UI
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl6();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl24();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.UI.ResultsMI.ResultsTabPageCtrl();
+5
View File
@@ -594,6 +594,7 @@ namespace TBF.UI.Procedures
this.historyListViewEx.DoubleClickActivation = false;
this.historyListViewEx.FullRowSelect = true;
this.historyListViewEx.GridLines = true;
this.historyListViewEx.HideSelection = false;
this.historyListViewEx.Name = "historyListViewEx";
this.historyListViewEx.UseCompatibleStateImageBehavior = false;
this.historyListViewEx.View = System.Windows.Forms.View.Details;
@@ -613,6 +614,7 @@ namespace TBF.UI.Procedures
this.metrology1ListViewEx.DoubleClickActivation = false;
this.metrology1ListViewEx.FullRowSelect = true;
this.metrology1ListViewEx.GridLines = true;
this.metrology1ListViewEx.HideSelection = false;
this.metrology1ListViewEx.Name = "metrology1ListViewEx";
this.metrology1ListViewEx.UseCompatibleStateImageBehavior = false;
this.metrology1ListViewEx.View = System.Windows.Forms.View.Details;
@@ -632,6 +634,7 @@ namespace TBF.UI.Procedures
this.metrology2ListViewEx.DoubleClickActivation = false;
this.metrology2ListViewEx.FullRowSelect = true;
this.metrology2ListViewEx.GridLines = true;
this.metrology2ListViewEx.HideSelection = false;
this.metrology2ListViewEx.Name = "metrology2ListViewEx";
this.metrology2ListViewEx.UseCompatibleStateImageBehavior = false;
this.metrology2ListViewEx.View = System.Windows.Forms.View.Details;
@@ -651,6 +654,7 @@ namespace TBF.UI.Procedures
this.processListViewEx.DoubleClickActivation = false;
this.processListViewEx.FullRowSelect = true;
this.processListViewEx.GridLines = true;
this.processListViewEx.HideSelection = false;
this.processListViewEx.Name = "processListViewEx";
this.processListViewEx.UseCompatibleStateImageBehavior = false;
this.processListViewEx.View = System.Windows.Forms.View.Details;
@@ -670,6 +674,7 @@ namespace TBF.UI.Procedures
this.parametersListViewEx.DoubleClickActivation = false;
this.parametersListViewEx.FullRowSelect = true;
this.parametersListViewEx.GridLines = true;
this.parametersListViewEx.HideSelection = false;
this.parametersListViewEx.Name = "parametersListViewEx";
this.parametersListViewEx.UseCompatibleStateImageBehavior = false;
this.parametersListViewEx.View = System.Windows.Forms.View.Details;
+1 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
#if LANG_PL
#define SHOW_Q_TG
+44 -44
View File
@@ -139,7 +139,7 @@
<value>NoControl</value>
</data>
<data name="eventTrigger3NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 409</value>
<value>475, 409</value>
</data>
<data name="eventTrigger3NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -175,7 +175,7 @@
<value>NoControl</value>
</data>
<data name="eventTrigger2NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 386</value>
<value>475, 386</value>
</data>
<data name="eventTrigger2NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -211,7 +211,7 @@
<value>NoControl</value>
</data>
<data name="eventTrigger1NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 363</value>
<value>475, 363</value>
</data>
<data name="eventTrigger1NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -247,7 +247,7 @@
<value>NoControl</value>
</data>
<data name="fileWriter5NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 340</value>
<value>475, 340</value>
</data>
<data name="fileWriter5NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -283,7 +283,7 @@
<value>NoControl</value>
</data>
<data name="fileWriter4NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 317</value>
<value>475, 317</value>
</data>
<data name="fileWriter4NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -319,7 +319,7 @@
<value>NoControl</value>
</data>
<data name="fileWriter3NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 294</value>
<value>475, 294</value>
</data>
<data name="fileWriter3NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -355,7 +355,7 @@
<value>NoControl</value>
</data>
<data name="fileWriter2NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 271</value>
<value>475, 271</value>
</data>
<data name="fileWriter2NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -391,7 +391,7 @@
<value>NoControl</value>
</data>
<data name="fileWriter1NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 248</value>
<value>475, 248</value>
</data>
<data name="fileWriter1NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -427,7 +427,7 @@
<value>NoControl</value>
</data>
<data name="printer2NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 225</value>
<value>475, 225</value>
</data>
<data name="printer2NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -463,7 +463,7 @@
<value>NoControl</value>
</data>
<data name="printer1NokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 202</value>
<value>475, 202</value>
</data>
<data name="printer1NokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -499,7 +499,7 @@
<value>NoControl</value>
</data>
<data name="transitionEndNokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 179</value>
<value>475, 179</value>
</data>
<data name="transitionEndNokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -535,7 +535,7 @@
<value>NoControl</value>
</data>
<data name="transitionStartNokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 156</value>
<value>475, 156</value>
</data>
<data name="transitionStartNokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -571,7 +571,7 @@
<value>NoControl</value>
</data>
<data name="dataEntryNokLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>373, 133</value>
<value>475, 133</value>
</data>
<data name="dataEntryNokLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>11, 13</value>
@@ -631,7 +631,7 @@
<value>188, 335</value>
</data>
<data name="fileWriter5ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="fileWriter5ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>46</value>
@@ -652,7 +652,7 @@
<value>188, 404</value>
</data>
<data name="eventTrigger3ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="eventTrigger3ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>45</value>
@@ -673,7 +673,7 @@
<value>188, 381</value>
</data>
<data name="eventTrigger2ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="eventTrigger2ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>44</value>
@@ -694,7 +694,7 @@
<value>188, 358</value>
</data>
<data name="eventTrigger1ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="eventTrigger1ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>43</value>
@@ -745,7 +745,7 @@
<value>False</value>
</data>
<data name="testProfileTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>550, 13</value>
<value>652, 13</value>
</data>
<data name="testProfileTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 20</value>
@@ -772,7 +772,7 @@
<value>NoControl</value>
</data>
<data name="testProfileLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>438, 16</value>
<value>540, 16</value>
</data>
<data name="testProfileLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 13</value>
@@ -796,7 +796,7 @@
<value>20</value>
</data>
<data name="altProcPeriodTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>733, 382</value>
<value>835, 382</value>
</data>
<data name="altProcPeriodTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 20</value>
@@ -826,7 +826,7 @@
<value>NoControl</value>
</data>
<data name="altProcPeriodLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>450, 385</value>
<value>552, 385</value>
</data>
<data name="altProcPeriodLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>116, 13</value>
@@ -853,7 +853,7 @@
<value>22</value>
</data>
<data name="altProcNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>550, 358</value>
<value>652, 358</value>
</data>
<data name="altProcNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 20</value>
@@ -883,7 +883,7 @@
<value>NoControl</value>
</data>
<data name="altProcNameLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>450, 360</value>
<value>552, 360</value>
</data>
<data name="altProcNameLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>84, 13</value>
@@ -916,7 +916,7 @@
<value>NoControl</value>
</data>
<data name="manualControlDisabledCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>593, 181</value>
<value>695, 181</value>
</data>
<data name="manualControlDisabledCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>138, 17</value>
@@ -946,7 +946,7 @@
<value>NoControl</value>
</data>
<data name="mustBeCompleteCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>593, 160</value>
<value>695, 160</value>
</data>
<data name="mustBeCompleteCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>152, 17</value>
@@ -976,7 +976,7 @@
<value>NoControl</value>
</data>
<data name="protectedCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>593, 139</value>
<value>695, 139</value>
</data>
<data name="protectedCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>123, 17</value>
@@ -1006,7 +1006,7 @@
<value>NoControl</value>
</data>
<data name="metersKindRadioButton3.Location" type="System.Drawing.Point, System.Drawing">
<value>444, 180</value>
<value>546, 180</value>
</data>
<data name="metersKindRadioButton3.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 17</value>
@@ -1033,7 +1033,7 @@
<value>188, 312</value>
</data>
<data name="fileWriter4ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="fileWriter4ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
@@ -1054,7 +1054,7 @@
<value>188, 289</value>
</data>
<data name="fileWriter3ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="fileWriter3ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>28</value>
@@ -1075,7 +1075,7 @@
<value>188, 220</value>
</data>
<data name="printer2ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="printer2ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
@@ -1096,7 +1096,7 @@
<value>188, 266</value>
</data>
<data name="fileWriter2ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="fileWriter2ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>27</value>
@@ -1120,7 +1120,7 @@
<value>NoControl</value>
</data>
<data name="metersKindRadioButton2.Location" type="System.Drawing.Point, System.Drawing">
<value>444, 159</value>
<value>546, 159</value>
</data>
<data name="metersKindRadioButton2.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 17</value>
@@ -1150,7 +1150,7 @@
<value>NoControl</value>
</data>
<data name="metersKindRadioButton1.Location" type="System.Drawing.Point, System.Drawing">
<value>444, 138</value>
<value>546, 138</value>
</data>
<data name="metersKindRadioButton1.Size" type="System.Drawing.Size, System.Drawing">
<value>54, 17</value>
@@ -1177,7 +1177,7 @@
<value>188, 174</value>
</data>
<data name="transitionEndComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="transitionEndComboBox.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
@@ -1228,7 +1228,7 @@
<value>188, 151</value>
</data>
<data name="transitionStartComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="transitionStartComboBox.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
@@ -1279,7 +1279,7 @@
<value>188, 243</value>
</data>
<data name="fileWriter1ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="fileWriter1ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
@@ -1300,7 +1300,7 @@
<value>188, 197</value>
</data>
<data name="printer1ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="printer1ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
@@ -1321,7 +1321,7 @@
<value>188, 128</value>
</data>
<data name="dataEntryComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 21</value>
<value>282, 21</value>
</data>
<data name="dataEntryComboBox.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
@@ -1429,7 +1429,7 @@
<value>44</value>
</data>
<data name="notesTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>402, 220</value>
<value>504, 220</value>
</data>
<data name="notesTextBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1459,7 +1459,7 @@
<value>NoControl</value>
</data>
<data name="label18.Location" type="System.Drawing.Point, System.Drawing">
<value>399, 202</value>
<value>501, 202</value>
</data>
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
<value>35, 13</value>
@@ -1486,7 +1486,7 @@
<value>188, 105</value>
</data>
<data name="watermetersTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>579, 20</value>
<value>681, 20</value>
</data>
<data name="watermetersTextBox.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
@@ -1741,7 +1741,7 @@
<value>188, 36</value>
</data>
<data name="descriptionTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>579, 20</value>
<value>681, 20</value>
</data>
<data name="descriptionTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@@ -1792,7 +1792,7 @@
<value>188, 13</value>
</data>
<data name="procNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 20</value>
<value>317, 20</value>
</data>
<data name="procNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -2170,7 +2170,7 @@
<value>sharedButtons</value>
</data>
<data name="&gt;&gt;sharedButtons.Type" xml:space="preserve">
<value>TBF.UI.Shared.SharedButtons, TBF, Version=2.32.2027.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.Shared.SharedButtons, TBF, Version=2.33.2119.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;sharedButtons.Parent" xml:space="preserve">
<value>mainSplitContainer.Panel2</value>
+1
View File
@@ -846,6 +846,7 @@ namespace TBF.UI.Procedures
newProcedure.ObtainedByCopy = false;
newProcedure.CreationUser = Users.CurrentUser.UserName();
newProcedure.CreationTime = DateTime.Now;
newProcedure.ResultsPrinter = dlg.SelectedProfile.Name;
if (new ProcedureDlg(Session, newProcedure, GetUsedNames(false), ProcedureDlg.Mode.Unlocked, parent).ShowDialog() == DialogResult.OK)
{
@@ -62,7 +62,8 @@ namespace TBF.UI.Procedures.TestWizard
this.selectorValues = selectorValues;
flowUnit = test.FlowUnit;
unitComboBox.Text = unit2ComboBox.Text = unit3ComboBox.Text = flowUnit.ToDescription();
unitComboBox.Text = unit2ComboBox.Text = unit3ComboBox.Text =
(flowUnit == Unit.None) ? Unit.m3ph.ToDescription() : flowUnit.ToDescription();
if (first) backButton.Visible = false;
@@ -54,7 +54,7 @@ namespace TBF.UI.Procedures.TestWizard
this.test = test;
volumeUnit = test.VolumeUnit;
unitComboBox.Text = volumeUnit.ToDescription();
unitComboBox.Text = (volumeUnit == Unit.None) ? Unit.l.ToDescription() : volumeUnit.ToDescription();
if (first) backButton.Visible = false;
if (last) nextButton.Text = Strings.FinishBtnText;
+2 -2
View File
@@ -237,7 +237,7 @@ namespace TBF.UI.ResultsMI
{
if ((TracingDB.DB.SessionFactory == null) || string.IsNullOrEmpty(wm.SerialNr))
{
new Results.Forms.MoreWMResultsDlg(wm, null).ShowDialog();
new MoreWMResultsDlg(wm, null).ShowDialog();
}
else
{
@@ -270,7 +270,7 @@ namespace TBF.UI.ResultsMI
}
}
new Results.Forms.MoreWMResultsDlg(wm, refRecords).ShowDialog();
new MoreWMResultsDlg(wm, refRecords).ShowDialog();
}
}
}
+43 -36
View File
@@ -280,51 +280,58 @@ namespace TBF.UI.ResultsMI
{
if (b.BatchNr == data.BatchNr)
{
#if ORACLE_DB
if (ProcessData.OracleDB == null)
{
MessageBox.Show("No database");
return;
}
var dlg = new SendAgainDBAndWMSelectionForm();
if (dlg.ShowDialog() != DialogResult.OK) return;
OracleConnection conn;
switch (dlg.SelectedDB)
bool isSuccessful = dlg.SaveToOracle || dlg.SaveToProductionTracing; /// At least one must be selected to be successful
#if ORACLE_DB
if (dlg.SaveToOracle)
{
default:
case DBUsed.Production: conn = ProcessData.OracleDB.ProductionDB; break;
case DBUsed.Quality: conn = ProcessData.OracleDB.QualityDB; break;
case DBUsed.Test: conn = ProcessData.OracleDB.TestDB; break;
}
if (ProcessData.OracleDB.WriteResultsToDB(conn, b, dlg.SelectedWM, true) == Retv.OK)
{
b.RsltsSent = true; /// Result was successfully sent
session.SaveOrUpdate(b); /// Update MySQL DB
session.Flush();
(sender as PreviousResultCtrl).Sent = true; /// Update UI
Redraw();
}
#elif MUNICH
string docVersion = string.Empty;
foreach (var cmp in TBF.Rig.StateMachine.Components)
{
if (cmp.ClassName == "Output.Printers.Munich")
if (ProcessData.OracleDB != null)
{
docVersion = (cmp as TBF.Rig.Output.Printers.Munich.Printer).Version;
break;
OracleConnection conn;
switch (dlg.SelectedDB)
{
default:
case DBUsed.Production: conn = ProcessData.OracleDB.ProductionDB; break;
case DBUsed.Quality: conn = ProcessData.OracleDB.QualityDB; break;
case DBUsed.Test: conn = ProcessData.OracleDB.TestDB; break;
}
isSuccessful = isSuccessful && (ProcessData.OracleDB.WriteResultsToDB(conn, b, dlg.SelectedWM, true) == Retv.OK);
}
else
{
isSuccessful = false;
MessageBox.Show("No Oracle database");
}
}
foreach (var wm in b.WaterMeters)
{
new Results.Output.Printers.Munich.MunichPrintDocument(docVersion, wm, PageOrientation.Portrait).Print();
}
#endif
if (dlg.SaveToProductionTracing)
{
if (ProcessData.TracingDB != null)
{
isSuccessful = isSuccessful && (ProcessData.TracingDB.SaveTracingRecords(b) == Rig.Output.DB.ProductionTracing.Retv.OK);
}
else
{
isSuccessful = false;
MessageBox.Show("No production tracing database");
}
}
if (isSuccessful)
{
b.RsltsSent = true; /// Result was successfully sent
session.SaveOrUpdate(b); /// Update MySQL DB
session.Flush();
(sender as PreviousResultCtrl).Sent = true; /// Update UI
Redraw();
}
}
}
}
}
}
public event EventHandler<PreviousResultIdEventArgs> ShowResultsHandler;
+77 -14
View File
@@ -34,20 +34,26 @@
this.waterMetersComboBox = new System.Windows.Forms.ComboBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.oracleDbGroupBox = new System.Windows.Forms.GroupBox();
this.oracleDbCheckBox = new System.Windows.Forms.CheckBox();
this.productionTracingCheckBox = new System.Windows.Forms.CheckBox();
this.unlockButton = new System.Windows.Forms.Button();
this.oracleDbGroupBox.SuspendLayout();
this.SuspendLayout();
//
// databaseComboBox
//
this.databaseComboBox.FormattingEnabled = true;
this.databaseComboBox.Location = new System.Drawing.Point(151, 27);
this.databaseComboBox.Location = new System.Drawing.Point(161, 17);
this.databaseComboBox.Name = "databaseComboBox";
this.databaseComboBox.Size = new System.Drawing.Size(163, 21);
this.databaseComboBox.TabIndex = 0;
this.databaseComboBox.Text = "Production";
//
// databaseLabel
//
this.databaseLabel.AutoSize = true;
this.databaseLabel.Location = new System.Drawing.Point(36, 30);
this.databaseLabel.Location = new System.Drawing.Point(46, 20);
this.databaseLabel.Name = "databaseLabel";
this.databaseLabel.Size = new System.Drawing.Size(53, 13);
this.databaseLabel.TabIndex = 1;
@@ -56,7 +62,7 @@
// waterMetersLabel
//
this.waterMetersLabel.AutoSize = true;
this.waterMetersLabel.Location = new System.Drawing.Point(36, 65);
this.waterMetersLabel.Location = new System.Drawing.Point(46, 48);
this.waterMetersLabel.Name = "waterMetersLabel";
this.waterMetersLabel.Size = new System.Drawing.Size(70, 13);
this.waterMetersLabel.TabIndex = 2;
@@ -65,15 +71,16 @@
// waterMetersComboBox
//
this.waterMetersComboBox.FormattingEnabled = true;
this.waterMetersComboBox.Location = new System.Drawing.Point(151, 62);
this.waterMetersComboBox.Location = new System.Drawing.Point(161, 44);
this.waterMetersComboBox.Name = "waterMetersComboBox";
this.waterMetersComboBox.Size = new System.Drawing.Size(163, 21);
this.waterMetersComboBox.TabIndex = 3;
this.waterMetersComboBox.Text = "iPERL";
//
// okButton
//
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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(411, 19);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(92, 40);
this.okButton.TabIndex = 4;
@@ -83,8 +90,8 @@
//
// cancelButton
//
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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Location = new System.Drawing.Point(411, 65);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(92, 40);
this.cancelButton.TabIndex = 5;
@@ -92,20 +99,72 @@
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// oracleDbGroupBox
//
this.oracleDbGroupBox.Controls.Add(this.oracleDbCheckBox);
this.oracleDbGroupBox.Controls.Add(this.waterMetersComboBox);
this.oracleDbGroupBox.Controls.Add(this.databaseComboBox);
this.oracleDbGroupBox.Controls.Add(this.databaseLabel);
this.oracleDbGroupBox.Controls.Add(this.waterMetersLabel);
this.oracleDbGroupBox.Enabled = false;
this.oracleDbGroupBox.Location = new System.Drawing.Point(19, 13);
this.oracleDbGroupBox.Name = "oracleDbGroupBox";
this.oracleDbGroupBox.Size = new System.Drawing.Size(357, 75);
this.oracleDbGroupBox.TabIndex = 6;
this.oracleDbGroupBox.TabStop = false;
//
// oracleDbCheckBox
//
this.oracleDbCheckBox.AutoSize = true;
this.oracleDbCheckBox.Checked = true;
this.oracleDbCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.oracleDbCheckBox.Enabled = false;
this.oracleDbCheckBox.Location = new System.Drawing.Point(23, -1);
this.oracleDbCheckBox.Name = "oracleDbCheckBox";
this.oracleDbCheckBox.Size = new System.Drawing.Size(115, 17);
this.oracleDbCheckBox.TabIndex = 7;
this.oracleDbCheckBox.Text = "Save to Oracle DB";
this.oracleDbCheckBox.UseVisualStyleBackColor = true;
this.oracleDbCheckBox.CheckedChanged += new System.EventHandler(this.oracleDbCheckBox_CheckedChanged);
//
// productionTracingCheckBox
//
this.productionTracingCheckBox.AutoSize = true;
this.productionTracingCheckBox.Enabled = false;
this.productionTracingCheckBox.Location = new System.Drawing.Point(42, 105);
this.productionTracingCheckBox.Name = "productionTracingCheckBox";
this.productionTracingCheckBox.Size = new System.Drawing.Size(169, 17);
this.productionTracingCheckBox.TabIndex = 7;
this.productionTracingCheckBox.Text = "Save to production tracing DB";
this.productionTracingCheckBox.UseVisualStyleBackColor = true;
//
// unlockButton
//
this.unlockButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.unlockButton.Location = new System.Drawing.Point(411, 111);
this.unlockButton.Name = "unlockButton";
this.unlockButton.Size = new System.Drawing.Size(92, 40);
this.unlockButton.TabIndex = 8;
this.unlockButton.Text = "Unlock";
this.unlockButton.UseVisualStyleBackColor = true;
this.unlockButton.Click += new System.EventHandler(this.unlockButton_Click);
//
// SendAgainDBAndWMSelectionForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(347, 181);
this.ClientSize = new System.Drawing.Size(530, 181);
this.Controls.Add(this.unlockButton);
this.Controls.Add(this.productionTracingCheckBox);
this.Controls.Add(this.oracleDbGroupBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.waterMetersComboBox);
this.Controls.Add(this.waterMetersLabel);
this.Controls.Add(this.databaseLabel);
this.Controls.Add(this.databaseComboBox);
this.Name = "SendAgainDBAndWMSelectionForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Database and water meter selection";
this.Text = "p";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SendAgainDBAndWMSelectionForm_FormClosing);
this.oracleDbGroupBox.ResumeLayout(false);
this.oracleDbGroupBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -119,5 +178,9 @@
private System.Windows.Forms.ComboBox waterMetersComboBox;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.GroupBox oracleDbGroupBox;
private System.Windows.Forms.CheckBox oracleDbCheckBox;
private System.Windows.Forms.CheckBox productionTracingCheckBox;
private System.Windows.Forms.Button unlockButton;
}
}
@@ -1,22 +1,32 @@
///
/// Copyright (c) 2021 Sensus Slovensko a.s.
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using TBF.Rig.Output.DB.SensusOracle;
using TBF.Resources;
using System.Drawing;
using static TBF.UI.Shared.SharedButtons;
using Common;
namespace TBF.UI.ResultsMI
{
public partial class SendAgainDBAndWMSelectionForm : Form
{
public bool SaveToOracle;
public DBUsed SelectedDB;
public WMKind SelectedWM;
public bool SaveToProductionTracing;
bool unlocked = false;
GID[] RequiredGroupMembership = new GID[] { GID.TestingSpecialists, GID.Metrologists };
public SendAgainDBAndWMSelectionForm()
{
InitializeComponent();
ManageCheckGroupBox(oracleDbCheckBox, oracleDbGroupBox);
Localize();
databaseComboBox.Items.Add(DBUsed.Production);
@@ -40,25 +50,40 @@ namespace TBF.UI.ResultsMI
private void okButton_Click(object sender, EventArgs e)
{
for (DBUsed db = DBUsed.Production; db < DBUsed.Count; db++)
bool isValid = true;
SaveToOracle = oracleDbCheckBox.Checked;
SaveToProductionTracing = productionTracingCheckBox.Checked;
if (SaveToOracle)
{
if (db.ToString() == databaseComboBox.Text)
isValid = false;
for (DBUsed db = DBUsed.Production; db < DBUsed.Count; db++)
{
SelectedDB = db;
for (WMKind wm = WMKind.iPERL; wm < WMKind.Count; wm++)
if (db.ToString() == databaseComboBox.Text)
{
if (wm.ToString() == waterMetersComboBox.Text)
SelectedDB = db;
for (WMKind wm = WMKind.iPERL; wm < WMKind.Count; wm++)
{
SelectedWM = wm;
DialogResult = DialogResult.OK;
Close();
return;
if (wm.ToString() == waterMetersComboBox.Text)
{
SelectedWM = wm;
isValid = true;
}
}
}
}
}
MessageBox.Show("Invalid selection");
if (isValid)
{
DialogResult = DialogResult.OK;
Close();
}
else
{
MessageBox.Show("Invalid selection");
}
}
private void cancelButton_Click(object sender, EventArgs e)
@@ -66,5 +91,59 @@ namespace TBF.UI.ResultsMI
DialogResult = DialogResult.Cancel;
Close();
}
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
{
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
if (chk.Parent == grp)
{
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
}
/// Enable or disable the GroupBox.
grp.Enabled = chk.Checked;
}
private void oracleDbCheckBox_CheckedChanged(object sender, EventArgs e)
{
ManageCheckGroupBox(oracleDbCheckBox, oracleDbGroupBox);
}
private void unlockButton_Click(object sender, EventArgs e)
{
if (!unlocked)
{
if (!Users.CurrentUser.IsMemberOf(RequiredGroupMembership))
{
if (new Users.Forms.LoginDlg(TBF.DB.UserSessionFactories,
RequiredGroupMembership, this).ShowDialog() != DialogResult.OK)
return;
}
else if (Program.LocalSettings.AlwaysAskPasswdWhenUnlocking)
{
if (new Users.Forms.LoginDlg(TBF.DB.UserSessionFactories,
Users.CurrentUser.UserName(),
RequiredGroupMembership, this).ShowDialog() != DialogResult.OK)
return;
}
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
oracleDbCheckBox.Enabled = true;
oracleDbGroupBox.Enabled = true;
productionTracingCheckBox.Enabled = true;
unlockButton.Enabled = false;
unlocked = true;
}
}
private void SendAgainDBAndWMSelectionForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (Users.CurrentUser.Restore(this)) Program.MainWnd.UpdateUser();
}
}
}
+13 -4
View File
@@ -184,14 +184,14 @@
<value>Zamknij</value>
</data>
<data name="administrator" xml:space="preserve">
<value>Administrator</value>
<value>Użytkownik stanowiska</value>
</data>
<data name="calibration_specialist" xml:space="preserve">
<value>Legalizator</value>
<comment>Specjalista ds. kalibracji</comment>
</data>
<data name="head_of_lab" xml:space="preserve">
<value>Kierownik Laboratorium</value>
<value>Kierownik laboratorium</value>
</data>
<data name="maintenance" xml:space="preserve">
<value>Konserwator</value>
@@ -200,9 +200,18 @@
<value>Metrolog</value>
</data>
<data name="specialist" xml:space="preserve">
<value>Specjalista ds. testów</value>
<value>Specjalista</value>
</data>
<data name="tester" xml:space="preserve">
<value>Pracownik przeprowadzający testy</value>
<value>Pracownik</value>
</data>
<data name="metrological_authority" xml:space="preserve">
<value>GUM (Główny Urząd Miar)</value>
</data>
<data name="production_tracing_administrator" xml:space="preserve">
<value>Production tracing administrator</value>
</data>
<data name="water_meter_authority" xml:space="preserve">
<value>OUM (Okręgowy Urząd Miar)</value>
</data>
</root>