<Merge-fix> Solve merge conflicts
This commit is contained in:
@@ -1780,4 +1780,13 @@
|
||||
<data name="Reload" xml:space="preserve">
|
||||
<value>Znovu otevřít</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Načítání</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simulace</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Nenačteno</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Výchozí kalibrační faktor:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Nominální surový kalibrační faktor odpovídající 100 %. Tato hodnota se používá pro výpočet položky „iPerl CalibFactor (%)“ v konfiguraci výsledků.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -2242,4 +2242,13 @@
|
||||
<data name="Opto_head_was_disabled_by_the_user" xml:space="preserve">
|
||||
<value>Abtastkopf wurde deaktiviert vom Benutzer!</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Laden</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simuliert</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Nicht geladen</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Standard-Kalibrierfaktor:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Roher Kalibrierfaktor, der 100 % entspricht. Dieser Wert wird zur Berechnung von „iPerl CalibFactor (%)“ in der Ergebnis-Konfiguration verwendet.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -138,13 +138,13 @@
|
||||
<data name="Units" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="Loading" xml:space="preserve">
|
||||
<value>Cargando</value>
|
||||
<data name="Loading" xml:space="preserve"><value>Cargando</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simulado</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>No cargado</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Factor de calibración predeterminado:</value>
|
||||
</data>
|
||||
<data name="Simulated" xml:space="preserve">
|
||||
<value>Simulado</value>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Factor de calibración bruto que representa el 100 %. Este valor se utiliza para calcular «iPerl CalibFactor (%)» en la configuración de resultados.</value>
|
||||
</data>
|
||||
<data name="Not_loaded" xml:space="preserve">
|
||||
<value>No cargado</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
||||
@@ -2041,4 +2041,13 @@
|
||||
<data name="Test_time_s_chdr" xml:space="preserve">
|
||||
<value>Temps test [s]</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Chargement</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simulé</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Non chargé</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Facteur d’étalonnage par défaut :</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Facteur d’étalonnage brut représentant 100 %. Cette valeur est utilisée pour calculer « iPerl CalibFactor (%) » dans la configuration des résultats.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -1816,4 +1816,13 @@
|
||||
<data name="Drain" xml:space="preserve">
|
||||
<value>Drenare</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Caricamento</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simulato</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Non caricato</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Fattore di calibrazione predefinito:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Fattore di calibrazione grezzo corrispondente al 100 %. Questo valore viene usato per calcolare «iPerl CalibFactor (%)» nella configurazione dei risultati.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -1717,4 +1717,13 @@
|
||||
<data name="Again" xml:space="preserve">
|
||||
<value>Jeszcze raz</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Ładowanie</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Symulacja</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Nie wczytano</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Domyślny współczynnik kalibracji:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Surowy współczynnik kalibracji odpowiadający 100 %. Ta wartość służy do obliczania „iPerl CalibFactor (%)” w konfiguracji wyników.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -2512,4 +2512,10 @@
|
||||
<data name="Not_loaded" xml:space="preserve">
|
||||
<value>Not loaded</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Default calibration factor:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Raw calibration factor representing 100 %. This value is used to calculate 'iPerl CalibFactor (%)' in the results configuration.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -865,4 +865,13 @@
|
||||
<data name="WMSN" xml:space="preserve">
|
||||
<value>seria</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Se încarcă</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simulat</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Neîncărcat</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Factor de calibrare implicit:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Factorul brut de calibrare care reprezintă 100 %. Această valoare este utilizată pentru calculul „iPerl CalibFactor (%)” în configurarea rezultatelor.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -1630,4 +1630,13 @@
|
||||
<data name="Again" xml:space="preserve">
|
||||
<value>Снова</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="Loading" xml:space="preserve"><value>Загрузка</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Симуляция</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Не загружено</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Номинальный коэффициент калибровки:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Необработанный коэффициент калибровки, соответствующий 100 %. Это значение используется для вычисления «iPerl CalibFactor (%)» в конфигурации результатов.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -265,13 +265,13 @@
|
||||
<data name="Test_in_calculation" xml:space="preserve">
|
||||
<value>Prebieha výpočet</value>
|
||||
</data>
|
||||
<data name="Loading" xml:space="preserve">
|
||||
<value>Načítavanie</value>
|
||||
<data name="Loading" xml:space="preserve"><value>Načítavanie</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>Simulácia</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>Nenačítané</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>Predvolený kalibračný faktor:</value>
|
||||
</data>
|
||||
<data name="Simulated" xml:space="preserve">
|
||||
<value>Simulácia</value>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>Nominálny surový kalibračný faktor zodpovedajúci 100 %. Táto hodnota sa používa na výpočet položky „iPerl CalibFactor (%)“ v konfigurácii výsledkov.</value>
|
||||
</data>
|
||||
<data name="Not_loaded" xml:space="preserve">
|
||||
<value>Nenačítané</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
||||
@@ -1219,4 +1219,22 @@
|
||||
<data name="Lats_changed_by" xml:space="preserve">
|
||||
<value>最后修改者</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="PulsesPerUnit" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="PulsesPerKilogram" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="Units" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="Loading" xml:space="preserve"><value>正在加载</value></data>
|
||||
<data name="Simulated" xml:space="preserve"><value>模拟</value></data>
|
||||
<data name="Not_loaded" xml:space="preserve"><value>未加载</value></data>
|
||||
<data name="IperlCalibFactorNominal" xml:space="preserve">
|
||||
<value>默认校准系数:</value>
|
||||
</data>
|
||||
<data name="IperlCalibFactorNominalTooltip" xml:space="preserve">
|
||||
<value>表示 100% 的原始校准系数。该值用于在结果配置中计算“iPerl CalibFactor (%)”。</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
public int HeadCommunicationComPortNr;
|
||||
public int OptoComPortNr;
|
||||
public int RfidComPortNr; /// 0 = use MuxBoardNr
|
||||
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4
|
||||
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4 in new 1 .. 10 - paralel genesis access
|
||||
public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort, 1 .. 10
|
||||
//public CommunicationInterface CommunicationInterface; /// Communication Interface: RFID or NFC
|
||||
public string CommunicationInterfaceBridge; /// Communication Interface: RFID or NFC
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
message += Environment.NewLine + "'Head communication serial port nr.' is not valid";
|
||||
}
|
||||
|
||||
if (!int.TryParse(muxBoardNrTextBox.Text, out dummy) || dummy < 1 || dummy > 4)
|
||||
if (!int.TryParse(muxBoardNrTextBox.Text, out dummy) || dummy < 1 || dummy > 10)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, muxBoardNrLabel.Text);
|
||||
|
||||
+84
-106
@@ -76,11 +76,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.tabPage1);
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Location = new System.Drawing.Point(3, 4);
|
||||
this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabControl1.Location = new System.Drawing.Point(2, 3);
|
||||
this.tabControl1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(687, 540);
|
||||
this.tabControl1.Size = new System.Drawing.Size(458, 351);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
@@ -99,40 +99,42 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.tabPage1.Controls.Add(this.nameTextBox);
|
||||
this.tabPage1.Controls.Add(this.nameLabel);
|
||||
this.tabPage1.Controls.Add(this.classNameLabel);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 29);
|
||||
this.tabPage1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage1.Size = new System.Drawing.Size(679, 507);
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(450, 325);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Config";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Location = new System.Drawing.Point(372, 55);
|
||||
this.label5.Location = new System.Drawing.Point(248, 36);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(100, 23);
|
||||
this.label5.Size = new System.Drawing.Size(67, 15);
|
||||
this.label5.TabIndex = 28;
|
||||
this.label5.Text = "Slot Nr:";
|
||||
//
|
||||
// textBoxSlotNr
|
||||
//
|
||||
this.textBoxSlotNr.Enabled = false;
|
||||
this.textBoxSlotNr.Location = new System.Drawing.Point(480, 55);
|
||||
this.textBoxSlotNr.Location = new System.Drawing.Point(320, 36);
|
||||
this.textBoxSlotNr.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.textBoxSlotNr.Name = "textBoxSlotNr";
|
||||
this.textBoxSlotNr.Size = new System.Drawing.Size(74, 26);
|
||||
this.textBoxSlotNr.Size = new System.Drawing.Size(51, 20);
|
||||
this.textBoxSlotNr.TabIndex = 27;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.headPortNrTextBox);
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Location = new System.Drawing.Point(11, 450);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(7, 292);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.groupBox2.Size = new System.Drawing.Size(621, 52);
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.groupBox2.Size = new System.Drawing.Size(414, 34);
|
||||
this.groupBox2.TabIndex = 26;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Head Communication";
|
||||
@@ -140,41 +142,37 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
// headPortNrTextBox
|
||||
//
|
||||
this.headPortNrTextBox.Enabled = false;
|
||||
this.headPortNrTextBox.Location = new System.Drawing.Point(494, 19);
|
||||
this.headPortNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.headPortNrTextBox.Location = new System.Drawing.Point(329, 12);
|
||||
this.headPortNrTextBox.Name = "headPortNrTextBox";
|
||||
this.headPortNrTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.headPortNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.headPortNrTextBox.TabIndex = 8;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(361, 22);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Location = new System.Drawing.Point(241, 14);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(107, 20);
|
||||
this.label2.Size = new System.Drawing.Size(72, 13);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "Serial port nr.:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(234, 126);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label4.Location = new System.Drawing.Point(156, 82);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(52, 20);
|
||||
this.label4.Size = new System.Drawing.Size(37, 13);
|
||||
this.label4.TabIndex = 25;
|
||||
this.label4.Text = "1 .. 10";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(234, 90);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Location = new System.Drawing.Point(156, 58);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(43, 20);
|
||||
this.label3.Size = new System.Drawing.Size(37, 13);
|
||||
this.label3.TabIndex = 24;
|
||||
this.label3.Text = "1 .. 4";
|
||||
this.label3.Text = "1 .. 10";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
@@ -182,11 +180,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Controls.Add(this.rfidPortNrTextBox);
|
||||
this.groupBox1.Controls.Add(this.rfidSerialPortNrLabel);
|
||||
this.groupBox1.Location = new System.Drawing.Point(11, 363);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.groupBox1.Location = new System.Drawing.Point(7, 236);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.groupBox1.Size = new System.Drawing.Size(621, 85);
|
||||
this.groupBox1.Size = new System.Drawing.Size(414, 55);
|
||||
this.groupBox1.TabIndex = 23;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "RFID / NFC communication (in case mux. board is not used)";
|
||||
@@ -195,38 +191,35 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
//
|
||||
this.comboBoxCommunicationInterface.Enabled = false;
|
||||
this.comboBoxCommunicationInterface.FormattingEnabled = true;
|
||||
this.comboBoxCommunicationInterface.Location = new System.Drawing.Point(202, 34);
|
||||
this.comboBoxCommunicationInterface.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.comboBoxCommunicationInterface.Location = new System.Drawing.Point(135, 22);
|
||||
this.comboBoxCommunicationInterface.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.comboBoxCommunicationInterface.Name = "comboBoxCommunicationInterface";
|
||||
this.comboBoxCommunicationInterface.Size = new System.Drawing.Size(152, 28);
|
||||
this.comboBoxCommunicationInterface.Size = new System.Drawing.Size(103, 21);
|
||||
this.comboBoxCommunicationInterface.TabIndex = 9;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(8, 38);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Location = new System.Drawing.Point(5, 25);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(187, 20);
|
||||
this.label1.Size = new System.Drawing.Size(124, 13);
|
||||
this.label1.TabIndex = 8;
|
||||
this.label1.Text = "Communication Interface";
|
||||
//
|
||||
// rfidPortNrTextBox
|
||||
//
|
||||
this.rfidPortNrTextBox.Enabled = false;
|
||||
this.rfidPortNrTextBox.Location = new System.Drawing.Point(494, 32);
|
||||
this.rfidPortNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.rfidPortNrTextBox.Location = new System.Drawing.Point(329, 21);
|
||||
this.rfidPortNrTextBox.Name = "rfidPortNrTextBox";
|
||||
this.rfidPortNrTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.rfidPortNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.rfidPortNrTextBox.TabIndex = 7;
|
||||
//
|
||||
// rfidSerialPortNrLabel
|
||||
//
|
||||
this.rfidSerialPortNrLabel.AutoSize = true;
|
||||
this.rfidSerialPortNrLabel.Location = new System.Drawing.Point(361, 38);
|
||||
this.rfidSerialPortNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.rfidSerialPortNrLabel.Location = new System.Drawing.Point(241, 25);
|
||||
this.rfidSerialPortNrLabel.Name = "rfidSerialPortNrLabel";
|
||||
this.rfidSerialPortNrLabel.Size = new System.Drawing.Size(107, 20);
|
||||
this.rfidSerialPortNrLabel.Size = new System.Drawing.Size(72, 13);
|
||||
this.rfidSerialPortNrLabel.TabIndex = 6;
|
||||
this.rfidSerialPortNrLabel.Text = "Serial port nr.:";
|
||||
//
|
||||
@@ -243,11 +236,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.optoDataGroupBox.Controls.Add(this.radioButton2);
|
||||
this.optoDataGroupBox.Controls.Add(this.optoSerialPortLabel);
|
||||
this.optoDataGroupBox.Controls.Add(this.optoSerialPortTextBox);
|
||||
this.optoDataGroupBox.Location = new System.Drawing.Point(11, 164);
|
||||
this.optoDataGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.optoDataGroupBox.Location = new System.Drawing.Point(7, 107);
|
||||
this.optoDataGroupBox.Name = "optoDataGroupBox";
|
||||
this.optoDataGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.optoDataGroupBox.Size = new System.Drawing.Size(621, 189);
|
||||
this.optoDataGroupBox.Size = new System.Drawing.Size(414, 123);
|
||||
this.optoDataGroupBox.TabIndex = 18;
|
||||
this.optoDataGroupBox.TabStop = false;
|
||||
this.optoDataGroupBox.Text = "Opto-data";
|
||||
@@ -257,9 +248,10 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.checkBox_EnableShowChanels.Checked = true;
|
||||
this.checkBox_EnableShowChanels.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkBox_EnableShowChanels.Enabled = false;
|
||||
this.checkBox_EnableShowChanels.Location = new System.Drawing.Point(351, 147);
|
||||
this.checkBox_EnableShowChanels.Location = new System.Drawing.Point(234, 96);
|
||||
this.checkBox_EnableShowChanels.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.checkBox_EnableShowChanels.Name = "checkBox_EnableShowChanels";
|
||||
this.checkBox_EnableShowChanels.Size = new System.Drawing.Size(238, 24);
|
||||
this.checkBox_EnableShowChanels.Size = new System.Drawing.Size(159, 16);
|
||||
this.checkBox_EnableShowChanels.TabIndex = 10;
|
||||
this.checkBox_EnableShowChanels.Text = "Enable Show Channels";
|
||||
this.checkBox_EnableShowChanels.UseVisualStyleBackColor = true;
|
||||
@@ -267,58 +259,56 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
// tBBeginDataFlush
|
||||
//
|
||||
this.tBBeginDataFlush.Enabled = false;
|
||||
this.tBBeginDataFlush.Location = new System.Drawing.Point(474, 105);
|
||||
this.tBBeginDataFlush.Location = new System.Drawing.Point(316, 68);
|
||||
this.tBBeginDataFlush.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tBBeginDataFlush.MaxLength = 8;
|
||||
this.tBBeginDataFlush.Name = "tBBeginDataFlush";
|
||||
this.tBBeginDataFlush.Size = new System.Drawing.Size(69, 26);
|
||||
this.tBBeginDataFlush.Size = new System.Drawing.Size(47, 20);
|
||||
this.tBBeginDataFlush.TabIndex = 9;
|
||||
this.tBBeginDataFlush.Text = "2000";
|
||||
this.tBBeginDataFlush.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// labelFlush
|
||||
//
|
||||
this.labelFlush.Location = new System.Drawing.Point(328, 109);
|
||||
this.labelFlush.Location = new System.Drawing.Point(219, 71);
|
||||
this.labelFlush.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelFlush.Name = "labelFlush";
|
||||
this.labelFlush.Size = new System.Drawing.Size(140, 22);
|
||||
this.labelFlush.Size = new System.Drawing.Size(93, 14);
|
||||
this.labelFlush.TabIndex = 8;
|
||||
this.labelFlush.Text = "Begin Data Flush:";
|
||||
//
|
||||
// tcpipPortLabel
|
||||
//
|
||||
this.tcpipPortLabel.AutoSize = true;
|
||||
this.tcpipPortLabel.Location = new System.Drawing.Point(46, 109);
|
||||
this.tcpipPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.tcpipPortLabel.Location = new System.Drawing.Point(31, 71);
|
||||
this.tcpipPortLabel.Name = "tcpipPortLabel";
|
||||
this.tcpipPortLabel.Size = new System.Drawing.Size(68, 20);
|
||||
this.tcpipPortLabel.Size = new System.Drawing.Size(47, 13);
|
||||
this.tcpipPortLabel.TabIndex = 4;
|
||||
this.tcpipPortLabel.Text = "Port nr..:";
|
||||
//
|
||||
// tcpipPortTextBox
|
||||
//
|
||||
this.tcpipPortTextBox.Enabled = false;
|
||||
this.tcpipPortTextBox.Location = new System.Drawing.Point(161, 105);
|
||||
this.tcpipPortTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.tcpipPortTextBox.Location = new System.Drawing.Point(107, 68);
|
||||
this.tcpipPortTextBox.Name = "tcpipPortTextBox";
|
||||
this.tcpipPortTextBox.Size = new System.Drawing.Size(57, 26);
|
||||
this.tcpipPortTextBox.Size = new System.Drawing.Size(39, 20);
|
||||
this.tcpipPortTextBox.TabIndex = 5;
|
||||
//
|
||||
// ipAddressLabel
|
||||
//
|
||||
this.ipAddressLabel.AutoSize = true;
|
||||
this.ipAddressLabel.Location = new System.Drawing.Point(46, 74);
|
||||
this.ipAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.ipAddressLabel.Location = new System.Drawing.Point(31, 48);
|
||||
this.ipAddressLabel.Name = "ipAddressLabel";
|
||||
this.ipAddressLabel.Size = new System.Drawing.Size(93, 20);
|
||||
this.ipAddressLabel.Size = new System.Drawing.Size(63, 13);
|
||||
this.ipAddressLabel.TabIndex = 2;
|
||||
this.ipAddressLabel.Text = "IP address.:";
|
||||
//
|
||||
// ipAddressTextBox
|
||||
//
|
||||
this.ipAddressTextBox.Enabled = false;
|
||||
this.ipAddressTextBox.Location = new System.Drawing.Point(161, 69);
|
||||
this.ipAddressTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.ipAddressTextBox.Location = new System.Drawing.Point(107, 45);
|
||||
this.ipAddressTextBox.Name = "ipAddressTextBox";
|
||||
this.ipAddressTextBox.Size = new System.Drawing.Size(145, 26);
|
||||
this.ipAddressTextBox.Size = new System.Drawing.Size(98, 20);
|
||||
this.ipAddressTextBox.TabIndex = 3;
|
||||
//
|
||||
// radioButton1
|
||||
@@ -326,10 +316,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.radioButton1.AutoSize = true;
|
||||
this.radioButton1.Checked = true;
|
||||
this.radioButton1.Enabled = false;
|
||||
this.radioButton1.Location = new System.Drawing.Point(33, 29);
|
||||
this.radioButton1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.radioButton1.Location = new System.Drawing.Point(22, 19);
|
||||
this.radioButton1.Name = "radioButton1";
|
||||
this.radioButton1.Size = new System.Drawing.Size(109, 24);
|
||||
this.radioButton1.Size = new System.Drawing.Size(83, 17);
|
||||
this.radioButton1.TabIndex = 0;
|
||||
this.radioButton1.TabStop = true;
|
||||
this.radioButton1.Text = "Use TCP/IP";
|
||||
@@ -339,10 +328,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
//
|
||||
this.radioButton2.AutoSize = true;
|
||||
this.radioButton2.Enabled = false;
|
||||
this.radioButton2.Location = new System.Drawing.Point(351, 29);
|
||||
this.radioButton2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.radioButton2.Location = new System.Drawing.Point(234, 19);
|
||||
this.radioButton2.Name = "radioButton2";
|
||||
this.radioButton2.Size = new System.Drawing.Size(129, 24);
|
||||
this.radioButton2.Size = new System.Drawing.Size(92, 17);
|
||||
this.radioButton2.TabIndex = 1;
|
||||
this.radioButton2.Text = "Use serial port";
|
||||
this.radioButton2.UseVisualStyleBackColor = true;
|
||||
@@ -350,108 +338,98 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
// optoSerialPortLabel
|
||||
//
|
||||
this.optoSerialPortLabel.AutoSize = true;
|
||||
this.optoSerialPortLabel.Location = new System.Drawing.Point(361, 69);
|
||||
this.optoSerialPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.optoSerialPortLabel.Location = new System.Drawing.Point(241, 45);
|
||||
this.optoSerialPortLabel.Name = "optoSerialPortLabel";
|
||||
this.optoSerialPortLabel.Size = new System.Drawing.Size(107, 20);
|
||||
this.optoSerialPortLabel.Size = new System.Drawing.Size(72, 13);
|
||||
this.optoSerialPortLabel.TabIndex = 6;
|
||||
this.optoSerialPortLabel.Text = "Serial port nr.:";
|
||||
//
|
||||
// optoSerialPortTextBox
|
||||
//
|
||||
this.optoSerialPortTextBox.Enabled = false;
|
||||
this.optoSerialPortTextBox.Location = new System.Drawing.Point(494, 65);
|
||||
this.optoSerialPortTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.optoSerialPortTextBox.Location = new System.Drawing.Point(329, 42);
|
||||
this.optoSerialPortTextBox.Name = "optoSerialPortTextBox";
|
||||
this.optoSerialPortTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.optoSerialPortTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.optoSerialPortTextBox.TabIndex = 7;
|
||||
//
|
||||
// groupTextBox
|
||||
//
|
||||
this.groupTextBox.Enabled = false;
|
||||
this.groupTextBox.Location = new System.Drawing.Point(172, 121);
|
||||
this.groupTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.groupTextBox.Location = new System.Drawing.Point(115, 79);
|
||||
this.groupTextBox.Name = "groupTextBox";
|
||||
this.groupTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.groupTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.groupTextBox.TabIndex = 22;
|
||||
//
|
||||
// groupLabel
|
||||
//
|
||||
this.groupLabel.AutoSize = true;
|
||||
this.groupLabel.Location = new System.Drawing.Point(7, 126);
|
||||
this.groupLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.groupLabel.Location = new System.Drawing.Point(5, 82);
|
||||
this.groupLabel.Name = "groupLabel";
|
||||
this.groupLabel.Size = new System.Drawing.Size(67, 20);
|
||||
this.groupLabel.Size = new System.Drawing.Size(45, 13);
|
||||
this.groupLabel.TabIndex = 21;
|
||||
this.groupLabel.Text = "Group 2";
|
||||
//
|
||||
// muxBoardNrTextBox
|
||||
//
|
||||
this.muxBoardNrTextBox.Enabled = false;
|
||||
this.muxBoardNrTextBox.Location = new System.Drawing.Point(172, 86);
|
||||
this.muxBoardNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.muxBoardNrTextBox.Location = new System.Drawing.Point(115, 56);
|
||||
this.muxBoardNrTextBox.Name = "muxBoardNrTextBox";
|
||||
this.muxBoardNrTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.muxBoardNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.muxBoardNrTextBox.TabIndex = 20;
|
||||
//
|
||||
// muxBoardNrLabel
|
||||
//
|
||||
this.muxBoardNrLabel.AutoSize = true;
|
||||
this.muxBoardNrLabel.Location = new System.Drawing.Point(7, 90);
|
||||
this.muxBoardNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.muxBoardNrLabel.Location = new System.Drawing.Point(5, 58);
|
||||
this.muxBoardNrLabel.Name = "muxBoardNrLabel";
|
||||
this.muxBoardNrLabel.Size = new System.Drawing.Size(159, 20);
|
||||
this.muxBoardNrLabel.Size = new System.Drawing.Size(106, 13);
|
||||
this.muxBoardNrLabel.TabIndex = 19;
|
||||
this.muxBoardNrLabel.Text = "Group 1 (mux. board)";
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(172, 50);
|
||||
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.nameTextBox.Location = new System.Drawing.Point(115, 32);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(180, 26);
|
||||
this.nameTextBox.Size = new System.Drawing.Size(121, 20);
|
||||
this.nameTextBox.TabIndex = 17;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(7, 55);
|
||||
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.nameLabel.Location = new System.Drawing.Point(5, 36);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(51, 20);
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 16;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(168, 14);
|
||||
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.classNameLabel.Location = new System.Drawing.Point(112, 9);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(90, 20);
|
||||
this.classNameLabel.Size = new System.Drawing.Size(60, 13);
|
||||
this.classNameLabel.TabIndex = 15;
|
||||
this.classNameLabel.Text = "ClassName";
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 29);
|
||||
this.tabPage2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage2.Size = new System.Drawing.Size(679, 507);
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(450, 325);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Test";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GenesisCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.Name = "GenesisCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(694, 548);
|
||||
this.Size = new System.Drawing.Size(463, 356);
|
||||
this.Load += new System.EventHandler(this.WaterMeterCfgCtrl_Load);
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GenesisCordonelInterface.API;
|
||||
using GenesisCordonelInterface.Core.Threading;
|
||||
using TBF.Rig.BridgeComponents.GciBridge;
|
||||
|
||||
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
{
|
||||
public class GciBridgeClient : IGciBridgeClient
|
||||
{
|
||||
private readonly GciBridge bridge;
|
||||
|
||||
public GciBridgeClient(GciBridge bridge)
|
||||
{
|
||||
this.bridge = bridge;
|
||||
}
|
||||
|
||||
public Task<RetryResult<PublicModels.RegisterReadResult>>
|
||||
ReadRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return bridge.ReadRegisterWithRetryAsync(
|
||||
slotId,
|
||||
registerName,
|
||||
token);
|
||||
}
|
||||
|
||||
public Task<RetryResult<PublicModels.RegisterWriteResult>>
|
||||
WriteRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
ushort value,
|
||||
bool verify,
|
||||
bool throwOnError,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return bridge.WriteRegisterWithRetryAsync(
|
||||
slotId,
|
||||
registerName,
|
||||
value,
|
||||
verify,
|
||||
throwOnError,
|
||||
token);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GenesisCordonelInterface.API;
|
||||
using GenesisCordonelInterface.Core.Threading;
|
||||
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
{
|
||||
public interface IGciBridgeClient
|
||||
{
|
||||
Task<RetryResult<PublicModels.RegisterReadResult>>
|
||||
ReadRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
CancellationToken token = default);
|
||||
|
||||
Task<RetryResult<PublicModels.RegisterWriteResult>>
|
||||
WriteRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
ushort value,
|
||||
bool verify,
|
||||
bool throwOnError,
|
||||
CancellationToken token = default);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,29 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GenesisCordonelInterface.API;
|
||||
using log4net;
|
||||
using TBF.Rig.BridgeComponents.GciBridge;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.common;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.communication.common;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication.communication.C4.diagnosticLed;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication.communication.C4.protocolCommons;
|
||||
using PublicModels = TBF.Rig.BridgeComponents.GciBridge.Interfaces.PublicModels;
|
||||
|
||||
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
{
|
||||
public class ReadPcbResult
|
||||
{
|
||||
public bool IsConnected { get; set; }
|
||||
|
||||
public bool IsLoggedOn { get; set; }
|
||||
|
||||
public bool IsValidPcb { get; set; }
|
||||
|
||||
public string PcbId { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
public class RadioService
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RadioService));
|
||||
@@ -18,6 +31,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
static string okResponse = "Command complete, no errors";
|
||||
static string errorResponse = "Unable to execute";
|
||||
|
||||
private bool bConnected = false;
|
||||
|
||||
private GciBridge _bridge;
|
||||
|
||||
public RadioService(GciBridge genesisHeadCommInterfaceBridgeComponent)
|
||||
@@ -26,260 +41,492 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
log.Debug("RadioService created with GciBridge= " + genesisHeadCommInterfaceBridgeComponent + "");
|
||||
}
|
||||
|
||||
public async Task<string> ReadRequest_PCBAsyn1(GenesisSmartReader iHead)
|
||||
private async Task<ReadPcbResult> EnsureConnectedAsync(
|
||||
GenesisSmartReader head,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return null;
|
||||
|
||||
var connectTask = iHead.CommInterfaceBridge.ConnectAsync(iHead.GetSlotNr);
|
||||
|
||||
// Wait either for ConnectAsync or timeout
|
||||
if (await Task.WhenAny(connectTask, Task.Delay(TimeSpan.FromMinutes(1))) != connectTask)
|
||||
log.Debug("EnsureConnectedAsync called for iHead: " + head);
|
||||
if (head?.CommInterfaceBridge == null)
|
||||
{
|
||||
// Timed out
|
||||
return null;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = "CommInterfaceBridge is null."
|
||||
};
|
||||
}
|
||||
|
||||
var slotInfo = await _bridge.GetSlotAsync(head.GetSlotNr);
|
||||
if (slotInfo == null || !slotInfo.Success)
|
||||
{
|
||||
//just no definet yet ?
|
||||
log.Debug("EnsureConnectedAsync() - SlotInfo is null.");
|
||||
}
|
||||
else if (slotInfo.IsConnected)
|
||||
{
|
||||
log.Debug("EnsureConnectedAsync() - Slot: " + slotInfo);
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = true,
|
||||
IsLoggedOn = slotInfo.IsLoggedOn,
|
||||
IsValidPcb = false,
|
||||
PcbId = slotInfo.PcbId,
|
||||
Message = "Already connected."
|
||||
};
|
||||
}
|
||||
|
||||
log.Debug("EnsureConnectedAsync() - Connecting...");
|
||||
|
||||
var connectTask = head.CommInterfaceBridge.ConnectAsync(head.GetSlotNr, token);
|
||||
var timeoutTask = Task.Delay(TimeSpan.FromMinutes(1), token);
|
||||
|
||||
var completedTask = await Task.WhenAny(connectTask, timeoutTask);
|
||||
|
||||
if (completedTask != connectTask)
|
||||
{
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = "Connect timeout."
|
||||
};
|
||||
}
|
||||
|
||||
var result = await connectTask;
|
||||
|
||||
if (result == null || !result.Success || !result.IsConnected)
|
||||
return null;
|
||||
|
||||
string pcbId = result.PcbId;
|
||||
|
||||
if (!string.IsNullOrEmpty(pcbId))
|
||||
if (result == null || !result.Success)
|
||||
{
|
||||
if (iHead.ConfigStruct != null)
|
||||
iHead.ConfigStruct.PCBNumberString = pcbId;
|
||||
|
||||
return pcbId;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = result == null ? "Connect result is null." : "Connect failed."
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = result.IsConnected,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = "Connected OK."
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<string> ReadRequest_PCBAsync(GenesisSmartReader iHead)
|
||||
|
||||
public async Task<PublicModels.UdsPasswordResult> FindKeyStone(
|
||||
string txtPCBId,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB called for iHead: " + iHead);
|
||||
string pcbId = txtPCBId?.Trim();
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return null;
|
||||
if (string.IsNullOrWhiteSpace(pcbId))
|
||||
throw new Exception("PCB ID is empty.");
|
||||
|
||||
using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(1));
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
PublicModels.GciConnectResult result;
|
||||
PublicModels.UdsPasswordResult result = await _bridge.GetPasswordAsync(pcbId, token);
|
||||
|
||||
try
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - calling ConnectAsync");
|
||||
log.Debug("GetPasswordAsync PCB=" + pcbId + " Result: " + result);
|
||||
|
||||
result = await iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr, cts.Token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
log.Debug("ReadRequest_PCB() - ConnectAsync completed");
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - ConnectAsync timeout/cancelled");
|
||||
return null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("ReadRequest_PCB() - ConnectAsync failed", ex);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (result == null || !result.Success || !result.IsConnected)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - invalid result: " + result);
|
||||
return null;
|
||||
}
|
||||
|
||||
string pcbId = result.PcbId;
|
||||
|
||||
if (string.IsNullOrEmpty(pcbId))
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - pcbId is empty");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (iHead.ConfigStruct != null)
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbId;
|
||||
log.Debug("ReadRequest_PCB() - PCBNumberString: " + pcbId);
|
||||
}
|
||||
|
||||
return pcbId;
|
||||
return result;
|
||||
}
|
||||
|
||||
public string ReadRequest_PCB(ref GenesisSmartReader iHead)
|
||||
public async Task<GenesisCordonelInterface.API.PublicModels.GciLoginResult> LoginByPasswordAsync(
|
||||
int slotId, string txtPassword,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
var head = iHead; // <-- copy to local (no longer ref)
|
||||
if (string.IsNullOrWhiteSpace(txtPassword))
|
||||
throw new Exception("LoginByPasswordAsync() - PASSWORD is empty.");
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - set password to: " + txtPassword.Substring(0, 4) + "************");
|
||||
var gciSetPasswordResult = await _bridge.SetPasswordAsync(slotId,txtPassword, token);
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - SetPasswordAsync Result: " + gciSetPasswordResult);
|
||||
|
||||
// LOGIN
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - START LOGIN");
|
||||
var gciSlotInfo = await _bridge.GetSlotAsync(slotId);
|
||||
log.Debug($"LoginByPasswordAsync( Checked before Login() Slot: {slotId}) - START LOGIN Slot: {gciSlotInfo}");
|
||||
GenesisCordonelInterface.API.PublicModels.GciLoginResult result = await _bridge.LoginAsync(slotId, token);
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) Result: " + result);
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - END LOGIN, Success: {result.Success}");
|
||||
// ~ LOGIN
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<ReadPcbResult> ReadRequest_PCBAsync( GenesisSmartReader head, bool bReload = false)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB called for iHead: " + head);
|
||||
|
||||
if (head?.CommInterfaceBridge == null)
|
||||
return null;
|
||||
{
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsValidPcb = false,
|
||||
Message = "CommInterfaceBridge is null."
|
||||
};
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var connectTask = Task.Run(async () =>
|
||||
await head.CommInterfaceBridge.ConnectAsync(head.GetSlotNr)
|
||||
);
|
||||
// CONNECT ONLY IF NEEDED
|
||||
var connectResult = await EnsureConnectedAsync(head);
|
||||
|
||||
var completedTask = Task.WhenAny(
|
||||
connectTask,
|
||||
Task.Delay(TimeSpan.FromMinutes(1))
|
||||
).GetAwaiter().GetResult();
|
||||
|
||||
if (completedTask != connectTask)
|
||||
if (!connectResult.IsConnected)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - Timeout happened");
|
||||
return null;
|
||||
return connectResult;
|
||||
}
|
||||
|
||||
var result = connectTask.GetAwaiter().GetResult();
|
||||
log.Debug("ReadRequest_PCB() - Result: " + result);
|
||||
log.Debug($"ReadRequest_PCB() connect - {connectResult.Message}");
|
||||
|
||||
if (result == null || !result.Success || !result.IsConnected)
|
||||
return null;
|
||||
|
||||
var pcbId = result.PcbId;
|
||||
log.Debug("Result pcbId: " + pcbId);
|
||||
|
||||
if (!string.IsNullOrEmpty(pcbId) && head.ConfigStruct != null)
|
||||
//Check if exist PCB
|
||||
if (!bReload)
|
||||
{
|
||||
head.ConfigStruct.PCBNumberString = pcbId;
|
||||
log.Debug("Result set to ConfigStruct.PCBNumberString = " + head.ConfigStruct.PCBNumberString);
|
||||
var gciSlotInfo = await head.CommInterfaceBridge.GetSlotAsync(head.GetSlotNr);
|
||||
|
||||
if (gciSlotInfo == null && gciSlotInfo.Success && string.IsNullOrEmpty(gciSlotInfo.PcbId))
|
||||
{
|
||||
log.Debug(
|
||||
$"BuildConnection() - SlotNr: {head.GetSlotNr} already exist PCB: {gciSlotInfo.PcbId}");
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = gciSlotInfo.IsConnected,
|
||||
IsValidPcb = true,
|
||||
PcbId = gciSlotInfo.PcbId,
|
||||
Message = "PCB already exist."
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return pcbId;
|
||||
// PCB READ LOOP
|
||||
string validPcbId = null;
|
||||
int maxAttempts = 5;
|
||||
DateTime startTime = DateTime.UtcNow;
|
||||
TimeSpan maxDuration = TimeSpan.FromSeconds(30);
|
||||
|
||||
//LOOP
|
||||
for (int attempt = 1; attempt <= maxAttempts; attempt++)
|
||||
{
|
||||
if (DateTime.UtcNow - startTime > maxDuration)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) - PCB max duration exceeded");
|
||||
break;
|
||||
}
|
||||
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) - PCB attempt {attempt}/{maxAttempts}");
|
||||
var pcbTask = head.CommInterfaceBridge.GetPcbIdAsync(head.GetSlotNr);
|
||||
var timeoutTaskPcb = Task.Delay(TimeSpan.FromSeconds(5));
|
||||
var completedTaskPcb = await Task.WhenAny(pcbTask, timeoutTaskPcb);
|
||||
|
||||
if (completedTaskPcb != pcbTask)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB() PCB attempt {attempt} - Timeout");
|
||||
continue;
|
||||
}
|
||||
|
||||
var resultPCB = await pcbTask;
|
||||
|
||||
// VALIDATION BLOCK
|
||||
{
|
||||
if (resultPCB == null)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - result is null");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!resultPCB.Success)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - Success=false");
|
||||
continue;
|
||||
}
|
||||
|
||||
string pcbId = resultPCB.PcbId;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pcbId))
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - PCB empty");
|
||||
continue;
|
||||
}
|
||||
|
||||
pcbId = pcbId.Trim();
|
||||
|
||||
if (pcbId.Length != 9)
|
||||
{
|
||||
log.Debug( $"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - Invalid PCB length: '{pcbId}', len={pcbId.Length}");
|
||||
continue;
|
||||
}
|
||||
|
||||
validPcbId = pcbId;
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB valid: {validPcbId}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(validPcbId))
|
||||
{
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = connectResult.IsConnected,
|
||||
IsValidPcb = false,
|
||||
PcbId = null,
|
||||
Message = "Valid PCB not found."
|
||||
};
|
||||
}
|
||||
|
||||
if (head.ConfigStruct != null)
|
||||
{
|
||||
head.ConfigStruct.PCBNumberString = validPcbId;
|
||||
}
|
||||
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = connectResult.IsConnected,
|
||||
IsValidPcb = true,
|
||||
PcbId = validPcbId,
|
||||
Message = "PCB OK"
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("ReadRequest_PCB() failed", ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
log.Error("ReadRequest_PCBAsync() failed", ex);
|
||||
|
||||
public string ReadRequest_PCB2(ref GenesisSmartReader iHead)
|
||||
{
|
||||
return ReadRequest_PCBAsync(iHead).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public string ReadRequest_PCB1(ref GenesisSmartReader iHead)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB called for iHead: " + iHead.ToString());
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return null;
|
||||
|
||||
// -- connection --
|
||||
var connectTask = iHead.CommInterfaceBridge.ConnectAsync(iHead.GetSlotNr);
|
||||
log.Debug("ReadRequest_PCB() - ConnectAsync created, Now waiting for result");
|
||||
|
||||
var completedTask = Task.WhenAny(
|
||||
connectTask,
|
||||
Task.Delay(TimeSpan.FromMinutes(1))
|
||||
).GetAwaiter().GetResult();
|
||||
|
||||
log.Debug("ReadRequest_PCB() - CompletedTask: " + completedTask);
|
||||
|
||||
// Timeout happened
|
||||
if (completedTask != connectTask)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - Timeout happened");
|
||||
return null;
|
||||
}
|
||||
|
||||
var result = connectTask.GetAwaiter().GetResult();
|
||||
log.Debug("ReadRequest_PCB() - ConnectAsync completed");
|
||||
|
||||
if (result == null || !result.Success || !result.IsConnected)
|
||||
return null;
|
||||
log.Debug("ReadRequest_PCB() - result: " + result);
|
||||
//~ -- connection --
|
||||
|
||||
string pcbId = result.PcbId;
|
||||
log.Debug("ReadRequest_PCB() - pcbId: " + pcbId);
|
||||
|
||||
if (!string.IsNullOrEmpty(pcbId))
|
||||
{
|
||||
if (iHead.ConfigStruct != null)
|
||||
return new ReadPcbResult
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbId;
|
||||
log.Debug("ReadRequest_PCB() - iHead.ConfigStruct.PCBNumberString: " +
|
||||
iHead.ConfigStruct.PCBNumberString);
|
||||
IsConnected = false,
|
||||
IsValidPcb = false,
|
||||
PcbId = null,
|
||||
Message = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> PrepareLoginAdnConnect_Async(
|
||||
GenesisSmartReader iHead,
|
||||
bool isConnected,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
var connectResult = await EnsureConnectedAsync(iHead, token);
|
||||
|
||||
if (!connectResult.IsConnected)
|
||||
return false;
|
||||
log.Debug($"PrepareLoginAdnConnect_Async() connect - {connectResult.Message}");
|
||||
|
||||
if (connectResult.IsLoggedOn)
|
||||
return true;
|
||||
|
||||
//get stored PCB - Keystone
|
||||
log.Debug("Have we PCB stored?");
|
||||
string pcb = iHead.ConfigStruct?.PCBNumberString;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
pcb = connectResult.PcbId;
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
pcb = iHead.SerialNr;
|
||||
}
|
||||
//GET PCB FROM Meter
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async() No PCB stored. Trying to get PCB from Meter");
|
||||
var pcbResult = await ReadRequest_PCBAsync(iHead);
|
||||
if (pcbResult.IsValidPcb)
|
||||
{
|
||||
pcb = pcbResult.PcbId;
|
||||
iHead.SerialNr = pcb;
|
||||
if (iHead.ConfigStruct != null)
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pcbId;
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async() No PCB stored. MISSING PCB!!!!!");
|
||||
return false;
|
||||
}
|
||||
|
||||
log.Debug( $"PrepareLoginAdnConnect_Async() Start Find Keystone Slot: {iHead.GetSlotNr} PCB:{iHead.SerialNr} Calib PCB:{pcb} - find keystone");
|
||||
|
||||
var keyStoneResult = await FindKeyStone(pcb, token);
|
||||
|
||||
if (keyStoneResult == null || !keyStoneResult.Success)
|
||||
return false;
|
||||
|
||||
//LOGIN
|
||||
|
||||
log.Debug( $"PrepareLoginAdnConnect_Async() Start Login Slot: {iHead.GetSlotNr} PCB:{iHead.SerialNr} Calib PCB:{pcb} - login");
|
||||
GenesisCordonelInterface.API.PublicModels.GciLoginResult loginByPasswordAsync =
|
||||
await LoginByPasswordAsync(iHead.GetSlotNr, keyStoneResult.Password, token);
|
||||
|
||||
if (loginByPasswordAsync == null || !loginByPasswordAsync.Success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
log.Debug($"PrepareLoginAdnConnect_Async() Login OK");
|
||||
return true;
|
||||
}
|
||||
|
||||
log.Debug("ReadRequest_PCB() - pcbId is empty");
|
||||
return null;
|
||||
}
|
||||
|
||||
public ProtocolStatuses GetActivityStatusMode(GenesisSmartReader iHead)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return ProtocolStatuses.Unknown;
|
||||
|
||||
var connectResult = iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
return ProtocolStatuses.Unknown;
|
||||
|
||||
var pcbResult = iHead.CommInterfaceBridge
|
||||
.GetPcbIdAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (pcbResult == null || !pcbResult.Success || string.IsNullOrWhiteSpace(pcbResult.PcbId))
|
||||
return ProtocolStatuses.Unknown;
|
||||
|
||||
if (iHead.ConfigStruct != null)
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbResult.PcbId;
|
||||
log.Debug("PrepareLoginAdnConnect_Async() canceled.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return ProtocolStatuses.Active;
|
||||
}
|
||||
|
||||
public DiagnosticLedState SetOptoStatusMode(GenesisSmartReader iHead, DiagnosticLedState opthoStatusMode)
|
||||
public static readonly String LedMode = "GENESISFLOW_LedMode";
|
||||
public static readonly String SampleRate = "GENESISFLOW_SampleRate";
|
||||
public static readonly String CalFactor1 = "GENESISFLOW_CalFactor1";
|
||||
public static readonly String CalFactor2 = "GENESISFLOW_CalFactor2";
|
||||
public static readonly String CalFactor3 = "GENESISFLOW_CalFactor3";
|
||||
public static readonly String ResetAccumulators = "GENESISFLOW_ResetAccumulators";
|
||||
public static readonly String ForwardArrow = "GENESISFLOW_ForwardArrow";
|
||||
public static readonly String StoreCalibration = "GENESISFLOW_StoreCalibration";
|
||||
public static readonly String TriggerIdle = "GENESISFLOW_TriggerIdle";
|
||||
public static readonly String MeterSize = "GENESISFLOW_MeterSize";
|
||||
|
||||
public async Task<LedState> GetActivityLedStatusMode_Async(
|
||||
GenesisSmartReader iHead,
|
||||
bool isConnected,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("GetActivityLedStatusMode_Async called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
return LedState.Unknown;
|
||||
|
||||
var connectResult = iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
|
||||
//SetDiagnosticLEDState
|
||||
|
||||
var pcbResult = iHead.CommInterfaceBridge
|
||||
.GetPcbIdAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (pcbResult == null || !pcbResult.Success || string.IsNullOrWhiteSpace(pcbResult.PcbId))
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
|
||||
if (iHead.ConfigStruct != null)
|
||||
try
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbResult.PcbId;
|
||||
var loginAdnConnectAsync = await PrepareLoginAdnConnect_Async(iHead, isConnected, token);
|
||||
|
||||
if (!loginAdnConnectAsync)
|
||||
return LedState.Unknown;
|
||||
|
||||
//Get Activity Status
|
||||
|
||||
var registerReadResult =
|
||||
await _bridge.ReadRegisterWithRetryAsync(iHead.GetSlotNr,LedMode, token);
|
||||
|
||||
if (registerReadResult == null || !registerReadResult.Success)
|
||||
{
|
||||
return LedState.Unknown;
|
||||
}
|
||||
log.Debug($"GetActivityStatusMode() Read Register OK Response: {registerReadResult}");
|
||||
try
|
||||
{
|
||||
byte[] bytes = HexFormatter.HexStringToByteArray(registerReadResult.Result.RawHex);
|
||||
//Convert byte array to int
|
||||
if (bytes == null || bytes.Length < 4)
|
||||
{
|
||||
log.Debug("Invalid byte array length");
|
||||
return LedState.Unknown;
|
||||
}
|
||||
|
||||
int value = BitConverter.ToInt32(bytes, 0);
|
||||
|
||||
// continue your real status logic here...
|
||||
return value == 6 ? LedState.active : LedState.inactive;
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error("GetActivityStatusMode() failed", ex);
|
||||
return LedState.Unknown;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
log.Debug("GetActivityLedStatusMode_Async() canceled.");
|
||||
return LedState.Unknown;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("GetActivityLedStatusMode_Async() failed", ex);
|
||||
return LedState.Unknown;
|
||||
}
|
||||
|
||||
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
}
|
||||
|
||||
public async Task<bool> SetLedMode_Async(GenesisSmartReader iHead, LedState ledMode, bool isConnected,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("SetLedMode_Async called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
var loginAdnConnectAsync = await PrepareLoginAdnConnect_Async(iHead, isConnected, token);
|
||||
|
||||
if (!loginAdnConnectAsync)
|
||||
return false;
|
||||
|
||||
//Get Activity Status
|
||||
byte valueLed = (ledMode == LedState.active) ? (byte)6 : (byte)0;
|
||||
log.Debug($"SetLedMode_Async() Set Led Mode: {valueLed}");
|
||||
var registerWriteResult =
|
||||
await _bridge.WriteRegisterAsync(iHead.GetSlotNr, LedMode, valueLed, false, false, token);
|
||||
|
||||
if (registerWriteResult == null || !registerWriteResult.Success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
log.Debug($"SetLedMode_Async() Write Register OK Response: {registerWriteResult}");
|
||||
return true;
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
log.Debug("GetActivityLedStatusMode_Async() canceled.");
|
||||
return false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("GetActivityLedStatusMode_Async() failed", ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
log.Debug("SetLedMode_Async() - End - DO DISCONNECT");
|
||||
var gciDisconnectResult = await _bridge.DisconnectAsync(iHead.GetSlotNr);
|
||||
log.Debug($"SetLedMode_Async() Disconnect Result: {gciDisconnectResult}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> Disconnect_Async(GenesisSmartReader iHead)
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Debug("Disconnect_Async() - Start");
|
||||
var gciSlotInfo = await _bridge.GetSlotAsync(iHead.GetSlotNr);
|
||||
log.Debug($"Disconnect_Async() - Slot: {iHead.GetSlotNr} - SlotInfo: {gciSlotInfo}");
|
||||
log.Debug("Disconnect_Async() - DO DISCONNECT");
|
||||
var gciDisconnectResult = await _bridge.DisconnectAsync(iHead.GetSlotNr);
|
||||
log.Debug($"Disconnect_Async() Disconnect Result: {gciDisconnectResult}");
|
||||
|
||||
return gciDisconnectResult.Success;
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error("Disconnect_Async() failed", ex);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static ushort SafeIntToUShort(int value)
|
||||
{
|
||||
@@ -316,29 +563,41 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
}
|
||||
|
||||
|
||||
public bool SetActivityMode_Active(GenesisSmartReader iHead)
|
||||
public async Task<bool> SetActivityMode_Active(GenesisSmartReader iHead,
|
||||
bool isConnected, CancellationToken token = default)
|
||||
{
|
||||
log.Debug("SetActivityMode_Active called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return false;
|
||||
|
||||
var connectResult = iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
try
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
var connectResult = await EnsureConnectedAsync(iHead, token);
|
||||
|
||||
if (!connectResult.IsConnected)
|
||||
return false;
|
||||
|
||||
isConnected = connectResult.IsConnected;
|
||||
|
||||
log.Debug($"SetActivityMode_Active() connect - {connectResult.Message}");
|
||||
|
||||
//Set LED to state 4
|
||||
// string version = _bridge?.GciExternalInterface?.GetPcbId(iHead.GetSlotNr);
|
||||
// if (!string.IsNullOrEmpty(version))
|
||||
// {
|
||||
// if (iHead.ConfigStruct != null) // store mechanism
|
||||
// {
|
||||
// iHead.ConfigStruct.Version = version;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
}catch(OperationCanceledException)
|
||||
{
|
||||
return false;
|
||||
|
||||
//Set LED to state 4
|
||||
// string version = _bridge?.GciExternalInterface?.GetPcbId(iHead.GetSlotNr);
|
||||
// if (!string.IsNullOrEmpty(version))
|
||||
// {
|
||||
// if (iHead.ConfigStruct != null) // store mechanism
|
||||
// {
|
||||
// iHead.ConfigStruct.Version = version;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication.common
|
||||
{
|
||||
public enum LedState : int
|
||||
{
|
||||
Unknown = -1,
|
||||
inactive = 0,
|
||||
active = 1,
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
if(Head != null && Head.OptoHeadTest != null)
|
||||
{
|
||||
Head.OptoHeadTest.CloseConnection();
|
||||
}
|
||||
|
||||
stopWorkerThread = true;
|
||||
if (optoThread != null)
|
||||
{
|
||||
|
||||
@@ -216,6 +216,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
|
||||
|
||||
public int ChannelsCount { get => iChanelsCount; }
|
||||
|
||||
private static int iChanelsCount = 3;
|
||||
private int firstChanel;
|
||||
|
||||
@@ -1339,16 +1341,6 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
void DataStreamPostProcessing()
|
||||
{
|
||||
PrepareCalculatedChannelData();
|
||||
try
|
||||
{
|
||||
log.DebugFormat("DataStreamPostProcessing() - harcoded call GetQ3Calibration(200.0, 120.0, 15625.0);");
|
||||
SetQ3Calibration(new double[]{15625.0,15625.0,15625.0 });
|
||||
CalculateQ3Calibration(200.0, 120.0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"DataStreamPostProcessing -- Q3 CALIBRATION -- failed: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1882,7 +1874,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
_readLoopTask = Task.Run(() =>
|
||||
{
|
||||
log.Debug($"OPTHO {OptoComPortNr} background read loop started.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} background read loop started.");
|
||||
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
@@ -1938,12 +1930,12 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} background read error: {ex.Message}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} background read error: {ex.Message}");
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"OPTHO {OptoComPortNr} background read loop stopped.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} background read loop stopped.");
|
||||
}, token);
|
||||
}
|
||||
|
||||
@@ -2024,7 +2016,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Debug($"OPTHO {OptoComPortNr} processing loop started.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} processing loop started.");
|
||||
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
@@ -2054,14 +2046,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
if (blockCompleted)
|
||||
{
|
||||
log.Debug("Processing loop completed flow block detected.");
|
||||
logStream.Debug("Processing loop completed flow block detected.");
|
||||
if (resetSerialBuffersOnCompletedFlowBlock)
|
||||
ResetDataBuffer();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"Processing loop failed: {ex}");
|
||||
logStream.Error($"Processing loop failed: {ex}");
|
||||
}
|
||||
|
||||
continue;
|
||||
@@ -2075,16 +2067,16 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} processing loop error: {ex}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} processing loop error: {ex}");
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"OPTHO {OptoComPortNr} processing loop stopped.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} processing loop stopped.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"StartProcessingLoop fatal error: {ex}");
|
||||
logStream.Error($"StartProcessingLoop fatal error: {ex}");
|
||||
}
|
||||
}, token);
|
||||
}
|
||||
@@ -2113,13 +2105,13 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
// 🔴 STEP 1: Check if we should start processing
|
||||
if (startDataProcessing && optoState == DataStreamState.ProcessAndSave)
|
||||
{
|
||||
log.DebugFormat("Read Opto Data Line timestamp:{0} to process from queue: {1}",timestamp.ToString("HH:mm:ss.fff") , line);
|
||||
logStream.DebugFormat("Read Opto Data Line timestamp:{0} to process from queue: {1}",timestamp.ToString("HH:mm:ss.fff") , line);
|
||||
bool blockCompleted;
|
||||
ProcessOptoLine(line, optoState, out blockCompleted);
|
||||
|
||||
if (blockCompleted)
|
||||
{
|
||||
log.Debug("ReadOptoData() completed flow block detected.");
|
||||
logStream.Debug("ReadOptoData() completed flow block detected.");
|
||||
if (resetSerialBuffersOnCompletedFlowBlock) // DO NOT call ResetDataBuffer() here
|
||||
ResetDataBuffer();
|
||||
}
|
||||
@@ -2127,7 +2119,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} processing queued line failed: {ex.Message}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} processing queued line failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2154,14 +2146,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
if (streamingDecode.DataFlowTest != null && streamingDecode.DataFlowTest.IsValid)
|
||||
{
|
||||
blockCompleted = HandleFlowMarker();
|
||||
log.Debug("ComPort: " + OptoComPortNr + " Decoded Flow data: " + streamingDecode.DataFlowTest +
|
||||
" OPTHO RX ← " + HexFormatter.ToSerialHex(bytes));
|
||||
logStream.Debug("ComPort: " + OptoComPortNr + " Decoded Flow data: " + streamingDecode.DataFlowTest +
|
||||
" OPTHO RX ← " + HexFormatter.ToSerialHex(bytes));
|
||||
}
|
||||
|
||||
if (calibData != null && calibData.IsValid)
|
||||
{
|
||||
log.Debug("ComPort: " + OptoComPortNr + " Decoded Calib: " + calibData + " OPTHO RX ← " +
|
||||
HexFormatter.ToSerialHex(bytes));
|
||||
logStream.Debug("ComPort: " + OptoComPortNr + " Decoded Calib: " + calibData + " OPTHO RX ← " +
|
||||
HexFormatter.ToSerialHex(bytes));
|
||||
|
||||
MarkCalibrationChannelSeen(calibData.Channel);
|
||||
}
|
||||
@@ -2181,7 +2173,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
if (optoData[bufferIx] == null)
|
||||
{
|
||||
log.ErrorFormat("{0}: optoData[{1}] was null, recreating.", Name, bufferIx);
|
||||
logStream.ErrorFormat("{0}: optoData[{1}] was null, recreating.", Name, bufferIx);
|
||||
optoData[bufferIx] = new OptoTelegramRaw();
|
||||
}
|
||||
|
||||
@@ -2194,7 +2186,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
int iChanel = calibData.Channel - 1;
|
||||
if (iChanel >= 0 && iChanel < iChanelsCount)
|
||||
{
|
||||
log.Debug(
|
||||
logStream.Debug(
|
||||
$"Before UpdateFromSmart ch={iChanel + 1}: " +
|
||||
$"volumeRawExtLast={volumeRawExtLast[iChanel]}, " +
|
||||
$"timestampExtLast={timestampExtLast[iChanel]}, " +
|
||||
@@ -2262,7 +2254,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
var encoding = optoSerialPort?.Encoding ?? Encoding.ASCII;
|
||||
byte[] bytes = encoding.GetBytes(line);
|
||||
received = HexFormatter.ToSerialHex(bytes);
|
||||
log.Debug("RX ← " + received);
|
||||
logStream.Debug("RX ← " + received);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -2271,19 +2263,19 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
CalibrationRecord data = _streamingDecode.DataCalib;
|
||||
if (data != null && data.IsValid)
|
||||
{
|
||||
log.Info($"OPTHO {OptoComPortNr} DataCalib Parsed opto data: " + data + " RX ← " +
|
||||
received);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} DataCalib Parsed opto data: " + data + " RX ← " +
|
||||
received);
|
||||
MarkCalibrationChannelSeen(data.Channel);
|
||||
}
|
||||
|
||||
FlowTestRecord dataFlow = _streamingDecode.DataFlowTest;
|
||||
if (dataFlow != null && dataFlow.IsValid)
|
||||
{
|
||||
log.Info($"OPTHO {OptoComPortNr} FLOW Parsed opto data: " + dataFlow + " RX ← " + received);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} FLOW Parsed opto data: " + dataFlow + " RX ← " + received);
|
||||
|
||||
if (HandleFlowMarker())
|
||||
{
|
||||
log.Debug("ReadOptoData() completed flow block detected.");
|
||||
logStream.Debug("ReadOptoData() completed flow block detected.");
|
||||
if (resetSerialBuffersOnCompletedFlowBlock)
|
||||
ResetDataBuffer(); // no ResetDataBuffer() here
|
||||
}
|
||||
@@ -2292,7 +2284,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
}
|
||||
|
||||
// string line = optoSerialPort.ReadExisting();
|
||||
@@ -2337,11 +2329,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
log.Debug($"ReadOptoData() OPTHO {OptoComPortNr} timeout - continuing.");
|
||||
logStream.Debug($"ReadOptoData() OPTHO {OptoComPortNr} timeout - continuing.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
logStream.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2357,11 +2349,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
optoSerialPort.DiscardInBuffer();
|
||||
optoSerialPort.DiscardOutBuffer();
|
||||
log.Debug("-- Reaset Data Buffer --");
|
||||
logStream.Debug("-- Reaset Data Buffer --");
|
||||
return;
|
||||
}
|
||||
}
|
||||
log.Debug("-- Reaset Data Buffer - no serial port --");
|
||||
logStream.Debug("-- Reaset Data Buffer - no serial port --");
|
||||
}
|
||||
|
||||
void ISmartReader.SetNfcInterface()
|
||||
@@ -2387,17 +2379,17 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
byte[] bytes = optoSerialPort.Encoding.GetBytes(line);
|
||||
string received = HexFormatter.ToSerialHex(bytes);
|
||||
|
||||
log.Debug("RX ← " + received);
|
||||
logStream.Debug("RX ← " + received);
|
||||
return line;
|
||||
}
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
log.Debug($"ReadOptoData() OPTHO {OptoComPortNr} ReadLine timeout (3s) - continuing.");
|
||||
logStream.Debug($"ReadOptoData() OPTHO {OptoComPortNr} ReadLine timeout (3s) - continuing.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
logStream.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
@@ -2408,7 +2400,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
if (completedTask == readTask)
|
||||
return await readTask;
|
||||
|
||||
log.Debug("ReadOptoData timeout after " + timeoutMs + " ms");
|
||||
logStream.Debug("ReadOptoData timeout after " + timeoutMs + " ms");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -2960,7 +2952,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
if (data == null || !data.IsValid)
|
||||
continue;
|
||||
|
||||
log.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
|
||||
int dch = data.Channel - 1;
|
||||
if (dch >= 0 && dch < iChanelsCount)
|
||||
@@ -2973,7 +2965,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
logStream.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2984,7 +2976,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
|
||||
|
||||
log.Debug($"Try get End Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr}");
|
||||
logStream.Debug($"Try get End Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr}");
|
||||
if (optoSerialPort != null && optoSerialPort.IsOpen) CloseOptoSerialPort();
|
||||
|
||||
if (!Double.IsNaN(volumeLtr[ch]))
|
||||
@@ -2995,12 +2987,12 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
//Solve roll over
|
||||
if (endWMState < beginWMState)
|
||||
{
|
||||
log.Debug($"Solve roll over! endWMState: {endWMState} < beginWMState: {beginWMState}");
|
||||
logStream.Debug($"Solve roll over! endWMState: {endWMState} < beginWMState: {beginWMState}");
|
||||
const double VOL_RANGE_LITERS = 16777216.0 * 0.00025; // 4,194.304 l
|
||||
endWMState += VOL_RANGE_LITERS;
|
||||
volumeLtr[ch] = endWMState;
|
||||
ReadPulses();
|
||||
log.Debug(
|
||||
logStream.Debug(
|
||||
$"Solve roll over! Upgraded endWMState: {endWMState}, beginWMState: {beginWMState}");
|
||||
}
|
||||
}
|
||||
@@ -3009,7 +3001,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
//}
|
||||
|
||||
log.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
logStream.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
return Double.NaN;
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -3019,14 +3011,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
if (ConfigStruct == null)
|
||||
{
|
||||
log.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
logStream.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
ConfigStruct = new ConfigStruct();
|
||||
}
|
||||
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
|
||||
log.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}");
|
||||
logStream.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}");
|
||||
|
||||
Start();
|
||||
|
||||
@@ -3050,7 +3042,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
StreamingDecoder _streamingDecode = new StreamingDecoder(true);
|
||||
_streamingDecode.DecodeMsg(readOptoDataWithTimeout);
|
||||
CalibrationRecord data = _streamingDecode.DataCalib;
|
||||
log.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
if (data == null || !data.IsValid)
|
||||
continue;
|
||||
|
||||
@@ -3066,7 +3058,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
logStream.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3076,7 +3068,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr0}");
|
||||
logStream.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr0}");
|
||||
if (optoSerialPort != null && optoSerialPort.IsOpen) CloseOptoSerialPort();
|
||||
|
||||
if (!Double.IsNaN(volumeLtr0[ch]))
|
||||
@@ -3087,7 +3079,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
//}
|
||||
|
||||
log.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
logStream.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
return Double.NaN;
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -3099,7 +3091,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
if (ConfigStruct == null)
|
||||
{
|
||||
log.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
logStream.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
ConfigStruct = new ConfigStruct();
|
||||
}
|
||||
|
||||
@@ -3109,11 +3101,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
|
||||
log.Debug($"Try get ReadSerialNr! COM: {this.RfidComPortNr}");
|
||||
logStream.Debug($"Try get ReadSerialNr! COM: {this.RfidComPortNr}");
|
||||
SerialNr = OptoHeadTest.ReadRequest_PCB();
|
||||
if (string.IsNullOrEmpty(SerialNr))
|
||||
{
|
||||
log.Debug("ReadSerialNr successful");
|
||||
logStream.Debug("ReadSerialNr successful");
|
||||
}
|
||||
|
||||
//optoHeadTest.CloseConnection();
|
||||
@@ -3898,7 +3890,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
_startupFlushActive = false;
|
||||
|
||||
log.WarnFormat(
|
||||
"Startup flush finished. Ignored {0} incoming opto lines.",
|
||||
"Startup flush finished. ({0}) Ignored {1} incoming opto lines.",
|
||||
Name,
|
||||
_startupFlushIgnoredLines);
|
||||
}
|
||||
}
|
||||
@@ -3915,7 +3908,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
_startupFlushActive = false;
|
||||
|
||||
log.WarnFormat(
|
||||
"Startup flush finished. Ignored {0} incoming opto lines. Window: {1:HH:mm:ss.fff} - {2:HH:mm:ss.fff}",
|
||||
"Startup flush finished. ({0}) Ignored {1} incoming opto lines. Window: {2:HH:mm:ss.fff} - {3:HH:mm:ss.fff}",
|
||||
Name,
|
||||
_startupFlushIgnoredLines,
|
||||
_startupFlushFirstIgnoredUtc,
|
||||
_startupFlushLastIgnoredUtc);
|
||||
@@ -3937,6 +3931,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
private double[] q3CalibInitial = {Double.NaN,Double.NaN,Double.NaN};
|
||||
private bool[] isChQ3CalibValid = { false,false,false};
|
||||
private double[] q3CalibCh = {Double.NaN,Double.NaN,Double.NaN};
|
||||
private double[] q3DiffPercentageCalibCh = {Double.NaN,Double.NaN,Double.NaN};
|
||||
|
||||
|
||||
public bool Q3CalibValid
|
||||
@@ -3954,6 +3949,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
|
||||
public double[] Q3CalibValue { get => q3CalibInitial; }
|
||||
public double[] Q3CalibDiffPercentageValue { get => q3DiffPercentageCalibCh; }
|
||||
|
||||
public bool Q3Calib_Ch1Valid { get => isChQ3CalibValid[0]; }
|
||||
public bool Q3Calib_Ch2Valid { get => isChQ3CalibValid[1]; }
|
||||
@@ -3964,14 +3960,48 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
public int GetSlotNr { get => genesisHeadCfg?.SlotNr ?? -1; }
|
||||
|
||||
void SetQ3Calibration(double[] q3CalibInitial) { this.q3CalibInitial = q3CalibInitial; }
|
||||
//TODO BUMI implement variable values for Q3Channel!
|
||||
public void SetQ3Calibration(double[] q3CalibInitial)
|
||||
{
|
||||
if (q3CalibInitial == null || q3CalibInitial.Length != 3 ||
|
||||
Array.Exists(q3CalibInitial, x => double.IsNaN(x) || double.IsInfinity(x) || x < 1 || x > ushort.MaxValue))
|
||||
throw new ArgumentException("Three valid Genesis calibration factors are required.", nameof(q3CalibInitial));
|
||||
this.q3CalibInitial = (double[])q3CalibInitial.Clone();
|
||||
refVolume = double.NaN;
|
||||
refTime = double.NaN;
|
||||
Array.Clear(isChQ3CalibValid, 0, isChQ3CalibValid.Length);
|
||||
}
|
||||
|
||||
private double refVolume = double.NaN;
|
||||
private double refTime = double.NaN;
|
||||
public double RefVolume { get => refVolume; set => refVolume = value; }
|
||||
public double RefTime { get => refTime; set => refTime = value; }
|
||||
|
||||
|
||||
public bool CalculateQ3Calibration()
|
||||
{
|
||||
if (Double.IsNaN(refVolume) || Double.IsInfinity(refVolume) || refVolume <= 0 || Double.IsNaN(refTime) || Double.IsInfinity(refTime) || refTime <= 0)
|
||||
{
|
||||
log.Debug("RefVolume or RefTime is NaN");
|
||||
return false;
|
||||
}
|
||||
|
||||
CalculateQ3Calibration( refVolume, refTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void CalculateQ3Calibration(double refVolume, double refTime)
|
||||
{
|
||||
GetQ3Calibration(refVolume, refTime, q3CalibInitial, ref isChQ3CalibValid, ref q3CalibCh);
|
||||
GetQ3Calibration(refVolume, refTime, q3CalibInitial, ref isChQ3CalibValid,ref q3DiffPercentageCalibCh, ref q3CalibCh);
|
||||
}
|
||||
|
||||
public void GetQ3Calibration(double refVolume, double refTime, double[] initCalibFactor, ref bool[] isChQ3CalibValid, ref double[] q3CalibCh)
|
||||
{
|
||||
var differences = new double[3];
|
||||
GetQ3Calibration(refVolume, refTime, initCalibFactor, ref isChQ3CalibValid, ref differences, ref q3CalibCh);
|
||||
}
|
||||
|
||||
public void GetQ3Calibration(double refVolume, double refTime, double[] initCalibFactor, ref bool[] isChQ3CalibValid, ref double[] calibDiffPercent, ref double[] q3CalibCh)
|
||||
{
|
||||
log.Debug("=== Q3 CALIBRATION START ===");
|
||||
|
||||
@@ -3991,7 +4021,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"Inputs: refVolume={refVolume}, refTime={refTime}, initCalibFactor={initCalibFactor}");
|
||||
log.Debug($"Inputs: refVolume={refVolume}, refTime={refTime}, initCalibFactors={string.Join(",", initCalibFactor)}");
|
||||
|
||||
if (_rawStartEndByChannel == null)
|
||||
{
|
||||
@@ -4081,25 +4111,13 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
q3CalibCh[iChannel] = (refVolume / recalculatedDeltaVolume) * initCalibFactor[iChannel];
|
||||
double diffPercent = Math.Abs((initCalibFactor[iChannel] - q3CalibCh[iChannel] ) / initCalibFactor[iChannel]) * 100.0;
|
||||
isChQ3CalibValid[iChannel] = diffPercent <= 5.0;
|
||||
isChQ3CalibValid[iChannel] = diffPercent <= 5.0 && !double.IsNaN(q3CalibCh[iChannel]) && !double.IsInfinity(q3CalibCh[iChannel]) && q3CalibCh[iChannel] >= 1 && q3CalibCh[iChannel] <= ushort.MaxValue;
|
||||
calibDiffPercent[iChannel] = diffPercent;
|
||||
log.Debug($"Calculated Q3Calib Ch[{iChannel}] ={q3CalibCh[iChannel]} DiffPercent={diffPercent}% isValid[{isChQ3CalibValid[iChannel]}] IninitCalibFactor={initCalibFactor}");
|
||||
|
||||
}
|
||||
|
||||
log.Debug("=== Q3 CALIBRATION END ===");
|
||||
}
|
||||
|
||||
|
||||
void newPokus()
|
||||
{
|
||||
//TODO BUMI implement genesis communication
|
||||
//volat z GCI Bridge
|
||||
|
||||
//vybere sa component - GCI bridge
|
||||
// - rozhranie
|
||||
// - database
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace TBF.Rig.Sequences
|
||||
//
|
||||
// /// 3th argument
|
||||
// IList<ITestParams> iPerlCommParams = new List<ITestParams>();
|
||||
// foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as iPerlCommunicationParams);
|
||||
// foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as TestMethods.iPerlCommunication.iPerlCommunicationParams);
|
||||
//
|
||||
// /*myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(iPerlCfg, tests, iPerlCommParams);
|
||||
// myRef.modelessDlg.Show();*/
|
||||
@@ -75,6 +75,14 @@ namespace TBF.Rig.Sequences
|
||||
// myRef.modelessDlg = new SmartCommunicationForm( testMethod , tests, iPerlCommParams);
|
||||
// myRef.modelessDlg.Show();
|
||||
|
||||
if (testMethod is TestMethods.GenesisCommunication.TestMethod genesisMethod)
|
||||
{
|
||||
var parameters = multiTestParams.Cast<TestMethods.GenesisCommunication.iPerlCommunicationParams>().ToList();
|
||||
myRef.modelessDlg = new TestMethods.GenesisCommunication.GenesisCommunicationForm(genesisMethod, tests, parameters);
|
||||
myRef.modelessDlg.Show();
|
||||
return;
|
||||
}
|
||||
|
||||
/// 1nd argument
|
||||
TestMethods.iPerlCommunication.TestMethodCfg iPerlCfg = cfg as TestMethods.iPerlCommunication.TestMethodCfg;
|
||||
|
||||
@@ -88,7 +96,7 @@ namespace TBF.Rig.Sequences
|
||||
myRef.modelessDlg.Show();*/
|
||||
|
||||
myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(
|
||||
testMethod as TBF.Rig.TestMethods.iPerlCommunication.TestMethod, tests, iPerlCommParams);
|
||||
testMethod as TestMethods.iPerlCommunication.TestMethod, tests, iPerlCommParams);
|
||||
myRef.modelessDlg.Show();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1477,15 +1485,24 @@ namespace TBF.Rig.Sequences
|
||||
for (int wmNr0 = BatchRslts.Batch.WaterMeters.Count - 1; wmNr0 >= 0; wmNr0--)
|
||||
{
|
||||
var wm = BatchRslts.Batch.WaterMeters[wmNr0];
|
||||
if (wm.Disabled)
|
||||
{
|
||||
/// Do not save disabled watermeters to DB, remove them from the list
|
||||
BatchRslts.Batch.WaterMeters.RemoveAt(wmNr0);
|
||||
if (wm.Q3Channel == 0){
|
||||
if (wm.Disabled)
|
||||
{
|
||||
/// Do not save disabled watermeters to DB, remove them from the list
|
||||
BatchRslts.Batch.WaterMeters.RemoveAt(wmNr0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Determine whether the watermeter passed all required tests
|
||||
wm.Passed = wm.PassedFromTests();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Determine whether the watermeter passed all required tests
|
||||
wm.Passed = wm.PassedFromAllTests();
|
||||
if (!wm.Disabled)
|
||||
{
|
||||
wm.Passed = wm.PassedFromTests();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1305,7 +1305,10 @@ namespace TBF.Rig.Sequences
|
||||
|
||||
var smryItems = DEItem.GetSummaryColumns();
|
||||
|
||||
for (int i = 0; i < BatchRslts.Batch.WaterMeters.Count; i++)
|
||||
//TODO BUMI check this part
|
||||
//Make channels showing the data
|
||||
int iWMCount = false ? BatchRslts.WMPositionsCount : BatchRslts.Batch.WaterMeters.Count;
|
||||
for (int i = 0; i < iWMCount; i++)
|
||||
{
|
||||
if (BatchRslts.Batch.WaterMeters != null &&
|
||||
BatchRslts.Batch.WaterMeters.Count > i &&
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace TBF.Rig
|
||||
new TestMethods.FlyingStartFirstRepetWithMassColl.HeatMeters.Factory(),
|
||||
new TestMethods.FlyingStartTankCollection.Single.Factory(),
|
||||
new TestMethods.FlyingStartTankCollection.Compound.Factory(),
|
||||
//new TestMethods.GenesisCommunication.GenesisHead.Factory(),
|
||||
new TestMethods.GenesisCommunication.Factory(),
|
||||
new TestMethods.GrabImage.Factory(),
|
||||
new TestMethods.iPerlCommunication.TestMethodFactory(), /// iPerlCommunication
|
||||
new TestMethods.LeakTest.Factory(),
|
||||
|
||||
@@ -12,6 +12,8 @@ using TBF.Rig;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
using TBF.Rig.Sequences;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
|
||||
using TBF.UiBridge;
|
||||
|
||||
@@ -464,6 +466,11 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
}
|
||||
while (!e.Contains(Event.TestCompleted) && !e.Contains(Event.Next)); /// 'Next' button is enabled in Debug version only
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_calculation);
|
||||
//------------------------------------------------
|
||||
|
||||
/// Measurement loop end
|
||||
StopRecordingStatistics();
|
||||
|
||||
@@ -532,7 +539,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
tstRslt.TimeBtwnMassMsrmnts = 0;
|
||||
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
|
||||
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
|
||||
double flowMID = tstRslt.TestTime == 0 ? 0 : 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
|
||||
|
||||
/// Corrected data
|
||||
tstRslt.MassStart = 0;
|
||||
@@ -542,7 +549,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
|
||||
/// Main result calculation
|
||||
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
|
||||
tstRslt.Flow = tstRslt.TestTime==0 ? 0 : 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
|
||||
tstRslt.ErrorMaster = 0.0; /// Not available without a mass measurement
|
||||
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
|
||||
|
||||
@@ -660,6 +667,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = regReader as TestMethods.iPerlCommunication.iPerlHead.IperlHead;
|
||||
GenericDevices.IRegReaderLiveCamera cameraRoi = regReader as GenericDevices.IRegReaderLiveCamera;
|
||||
//GenesisHead Genesis = regReader as GenesisHead;
|
||||
TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader GenesisSmart = regReader as TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader;
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
{
|
||||
@@ -711,6 +719,24 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
Genesis.Log(" MeterError = " + calError.ToString() + " %");
|
||||
}
|
||||
else*/
|
||||
if (GenesisSmart != null)
|
||||
{
|
||||
log.Debug("GenesisSmart - store data on end!");
|
||||
int CH1=0, CH2=1, CH3=2;
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt,GenesisSmart.TimestampSecStart, GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH2,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH3,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dstrReader != null)
|
||||
{
|
||||
@@ -918,6 +944,217 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
// }
|
||||
// }
|
||||
|
||||
private const int CountCh = 3;
|
||||
private static void WaterMeterParentCopy(int i, int iCH, string testName, MeterTestRslt meterRslt,
|
||||
GenesisSmartReader genesisSmart,
|
||||
TestRslt tstRslt)
|
||||
{
|
||||
try
|
||||
{
|
||||
WaterMeter waterMeterParent = BatchRslts.Batch.WaterMeters[i];
|
||||
int wmNrChX = (i * CountCh) + BatchRslts.WMPositionsCount + iCH + 1;
|
||||
String sSerialNr =
|
||||
(string.IsNullOrEmpty(waterMeterParent.SerialNr) ? (i + 1).ToString() : waterMeterParent.SerialNr) +
|
||||
"_CH" + (iCH + 1);
|
||||
WaterMeter chXWaterMeter = null;
|
||||
//------ add new water meter to batch ------
|
||||
if (BatchRslts.Batch.WaterMeters.Count < wmNrChX || BatchRslts.Batch.WaterMeters[wmNrChX - 1] == null)
|
||||
{
|
||||
log.Debug("add new water meter to batch, CH = " + (iCH + 1) + " CH = " + wmNrChX);
|
||||
chXWaterMeter = new WaterMeter()
|
||||
{
|
||||
MeterTestRslts = new List<MeterTestRslt>(),
|
||||
};
|
||||
//This will delete each setting before
|
||||
chXWaterMeter.CopyContentFrom(waterMeterParent);
|
||||
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
|
||||
BatchRslts.Batch.WaterMeters.Add(chXWaterMeter);
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter = BatchRslts.Batch.WaterMeters[wmNrChX - 1];
|
||||
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
}
|
||||
//~------ add new water meter to batch ------~
|
||||
|
||||
//create copy of meterRslt and add to additionalResultsByChannel
|
||||
MeterTestRslt meterTestRsltChX = new MeterTestRslt(chXWaterMeter, meterRslt.TestRslt,
|
||||
(CompoundMeterId)meterRslt.CompoundMeterId);
|
||||
meterTestRsltChX.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.MeterTestRslts.Add(meterTestRsltChX);
|
||||
MeterTestRslt chanelXMeterRslt =
|
||||
BatchRslts.GetMeterTestRslt(testName, wmNrChX - 1, Common.CompoundMeterId.Single);
|
||||
|
||||
if (chanelXMeterRslt != null)
|
||||
{
|
||||
chanelXMeterRslt?.CopyContentFrom(meterRslt);
|
||||
if (iCH == 0)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 1;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh1,
|
||||
genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1,
|
||||
genesisSmart.VolumeLtrEndRawCh1);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.GetCalibrationFactors(waterMeterParent).Count > 0)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.GetCalibrationFactors(waterMeterParent)[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.GetCalibrationFactors(waterMeterParent).Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 1;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh1;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh1;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh1;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh1;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH1", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 1)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 2;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh2,
|
||||
genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2,
|
||||
genesisSmart.VolumeLtrEndRawCh2);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.GetCalibrationFactors(waterMeterParent).Count > 1)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.GetCalibrationFactors(waterMeterParent)[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.GetCalibrationFactors(waterMeterParent).Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 2;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh2;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh2;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh2;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh2;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH2", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 2)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 3;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh3,
|
||||
genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3,
|
||||
genesisSmart.VolumeLtrEndRawCh3);
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.GetCalibrationFactors(waterMeterParent).Count > 2)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.GetCalibrationFactors(waterMeterParent)[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.GetCalibrationFactors(waterMeterParent).Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 3;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh3;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh3;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh3;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh3;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH3", ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (!genesisSmart.EnableShowChanels)
|
||||
{
|
||||
chXWaterMeter.Disabled = !genesisSmart.EnableShowChanels;
|
||||
//meterTestRsltChX.TestDone = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter.Disabled = false;
|
||||
meterTestRsltChX.TestDone = true;
|
||||
}
|
||||
|
||||
meterTestRsltChX.Passed = meterRslt.Passed;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in WaterMeterParentCopy", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CalculateMeterResults(MeterTestRslt meterRslt, IRegReaderDatastream dstrReader, TestRslt tstRslt, double dstrReaderTimestampSecStart, double dstrReaderTimestampSecEnd, double dstrReaderVolumeLtrStart, double dstrReaderVolumeLtrEnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
meterRslt.TimestampStart = dstrReaderTimestampSecStart;
|
||||
meterRslt.TimestampEnd = !dstrReader.NoSamples
|
||||
? dstrReaderTimestampSecEnd
|
||||
: (dstrReaderTimestampSecStart + tstRslt.TestTime);
|
||||
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||
meterRslt.VolumeStart = dstrReaderVolumeLtrStart; /// liter
|
||||
meterRslt.VolumeEnd = dstrReaderVolumeLtrEnd; /// liter
|
||||
meterRslt.VolumeMeter =
|
||||
Math.Abs(dstrReaderVolumeLtrEnd - dstrReaderVolumeLtrStart);
|
||||
meterRslt.VolumeRef = tstRslt.TestTime == 0
|
||||
? tstRslt.VolumeCTV
|
||||
: tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.PulsesMaster = tstRslt.TestTime == 0
|
||||
? tstRslt.PulsesMaster
|
||||
: tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter,
|
||||
meterRslt.VolumeRef); // Error based on volume difference
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error($"Error in calculate meter results, meterRslt.Name:{meterRslt.Name()} Calculation Bug Detail:", ex);
|
||||
}
|
||||
}
|
||||
|
||||
IList<Event> Simulate(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||
Compound.TestParams compoundTestParams,
|
||||
@@ -943,6 +1180,14 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
else if (test.Name.ToLower().Contains("q1")) MakeSimulated(test, 1, 0, -5.1f);
|
||||
else MakeSimulated(test, 1, 0, 0.9f);
|
||||
|
||||
//TODO bumi do simulate foe Q3 Calibration
|
||||
///
|
||||
/// Single meters
|
||||
///
|
||||
SimulateQ3CalibrationData(test,1, 0, -5.1f);
|
||||
|
||||
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Completed));
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
@@ -958,5 +1203,46 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
|
||||
return new List<Event> { TestAndLogUiCmdStop(test, e) ? Event.UiCmdStop : Event.Done };
|
||||
}
|
||||
|
||||
private void SimulateQ3CalibrationData(Test test,int repetitionNr, int part, float errorPctBase)
|
||||
{
|
||||
string testName = test.Name;
|
||||
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
|
||||
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
|
||||
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
|
||||
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt meterRslt =
|
||||
BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.Single);
|
||||
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[i];
|
||||
TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader GenesisSmart =
|
||||
regReader as TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader;
|
||||
|
||||
|
||||
if (GenesisSmart != null)
|
||||
{
|
||||
log.Debug("GenesisSmart - store data on end!");
|
||||
int CH1 = 0, CH2 = 1, CH3 = 2;
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt, GenesisSmart.TimestampSecStart,
|
||||
GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
WaterMeterParentCopy(i, CH2, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
WaterMeterParentCopy(i, CH3, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ using TBF.Rig.GenericDevices;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
using TBF.Rig.RegisterReaders.PoseidonReader;
|
||||
using TBF.Rig.RegisterReaders.PoseidonReader.implementations;
|
||||
using TBF.Rig.Sequences;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
|
||||
using TBF.UiBridge;
|
||||
|
||||
@@ -1106,12 +1107,13 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
bUpgradeCountOfMeters = true;
|
||||
int CH1=0, CH2=1, CH3=2;
|
||||
|
||||
//BatchRslts.Batch.WaterMeters.Add(ch1WaterMeter); //[i + BatchRslts.WMPositionsCount + CH1 + 1]
|
||||
//BatchRslts.Batch.WaterMeters.Add(ch1WaterMeter); //[i + BatchRslts.WMPositionsCount + CH2 + 1]
|
||||
//BatchRslts.Batch.WaterMeters.Add(ch1WaterMeter); //[i + BatchRslts.WMPositionsCount + CH3 + 1]
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt,GenesisSmart.TimestampSecStart, GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH2,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH3,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
@@ -1179,6 +1181,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
}
|
||||
#if IPERL
|
||||
meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor;
|
||||
meterRslt.WaterMeter.CalibFactorNominal = iPerl.CalibFactorNominal;
|
||||
meterRslt.FlipMode = iPerl.ConfigStruct != null && iPerl.ConfigStruct.FlipMode.HasValue
|
||||
? (int?)iPerl.ConfigStruct.FlipMode.Value
|
||||
: null;
|
||||
@@ -1375,91 +1378,212 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
GenesisSmartReader genesisSmart,
|
||||
TestRslt tstRslt)
|
||||
{
|
||||
WaterMeter waterMeterParent = BatchRslts.Batch.WaterMeters[i];
|
||||
int wmNrChX = (i*CountCh) + BatchRslts.WMPositionsCount + iCH + 1;
|
||||
String sSerialNr = waterMeterParent.SerialNr + "_CH" + (iCH + 1);
|
||||
WaterMeter chXWaterMeter = null;
|
||||
//------ add new water meter to batch ------
|
||||
if (BatchRslts.Batch.WaterMeters.Count < wmNrChX || BatchRslts.Batch.WaterMeters[wmNrChX-1] == null)
|
||||
try
|
||||
{
|
||||
log.Debug("add new water meter to batch, CH = " + (iCH + 1) + " CH = " + wmNrChX);
|
||||
chXWaterMeter = new WaterMeter()
|
||||
WaterMeter waterMeterParent = BatchRslts.Batch.WaterMeters[i];
|
||||
int wmNrChX = (i * CountCh) + BatchRslts.WMPositionsCount + iCH + 1;
|
||||
String sSerialNr =
|
||||
(string.IsNullOrEmpty(waterMeterParent.SerialNr) ? (i+1).ToString() : waterMeterParent.SerialNr) +
|
||||
"_CH" + (iCH + 1);
|
||||
WaterMeter chXWaterMeter = null;
|
||||
//------ add new water meter to batch ------
|
||||
if (BatchRslts.Batch.WaterMeters.Count < wmNrChX || BatchRslts.Batch.WaterMeters[wmNrChX - 1] == null)
|
||||
{
|
||||
Batch = BatchRslts.Batch,
|
||||
WaterMeterData = waterMeterParent.WaterMeterData,
|
||||
MeterTestRslts = new List<MeterTestRslt>(),
|
||||
SerialNr = sSerialNr,
|
||||
WMPosition = wmNrChX,
|
||||
YearOfProduction = 0,
|
||||
Disabled = false,
|
||||
};
|
||||
chXWaterMeter.CopyContentFrom(waterMeterParent);
|
||||
log.Debug("add new water meter to batch, CH = " + (iCH + 1) + " CH = " + wmNrChX);
|
||||
chXWaterMeter = new WaterMeter()
|
||||
{
|
||||
MeterTestRslts = new List<MeterTestRslt>(),
|
||||
};
|
||||
//This will delete each setting before
|
||||
chXWaterMeter.CopyContentFrom(waterMeterParent);
|
||||
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
|
||||
BatchRslts.Batch.WaterMeters.Add(chXWaterMeter);
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter = BatchRslts.Batch.WaterMeters[wmNrChX-1];
|
||||
}
|
||||
//~------ add new water meter to batch ------~
|
||||
|
||||
//create copy of meterRslt and add to additionalResultsByChannel
|
||||
MeterTestRslt meterTestRsltChX = new MeterTestRslt(chXWaterMeter, meterRslt.TestRslt, (CompoundMeterId)meterRslt.CompoundMeterId);
|
||||
chXWaterMeter.MeterTestRslts.Add(meterTestRsltChX);
|
||||
MeterTestRslt chanelXMeterRslt = BatchRslts.GetMeterTestRslt(testName, wmNrChX-1, Common.CompoundMeterId.Single);
|
||||
|
||||
if (chanelXMeterRslt != null)
|
||||
{
|
||||
chanelXMeterRslt?.CopyContentFrom(meterRslt);
|
||||
if (iCH == 0)
|
||||
{
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh1,
|
||||
genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1, genesisSmart.VolumeLtrEndRawCh1);
|
||||
}
|
||||
else if (iCH == 1)
|
||||
{
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh2,
|
||||
genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2, genesisSmart.VolumeLtrEndRawCh2);
|
||||
}
|
||||
else if (iCH == 2)
|
||||
{
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh3,
|
||||
genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3, genesisSmart.VolumeLtrEndRawCh3);
|
||||
}
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH+1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
|
||||
if (!genesisSmart.EnableShowChanels)
|
||||
{
|
||||
chXWaterMeter.Disabled = !genesisSmart.EnableShowChanels;
|
||||
meterTestRsltChX.TestDone = false;
|
||||
|
||||
BatchRslts.Batch.WaterMeters.Add(chXWaterMeter);
|
||||
}
|
||||
else
|
||||
{
|
||||
meterTestRsltChX.TestDone = true;
|
||||
}
|
||||
chXWaterMeter = BatchRslts.Batch.WaterMeters[wmNrChX - 1];
|
||||
|
||||
meterTestRsltChX.Passed = meterRslt.Passed;
|
||||
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH+1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
}
|
||||
//~------ add new water meter to batch ------~
|
||||
|
||||
//create copy of meterRslt and add to additionalResultsByChannel
|
||||
MeterTestRslt meterTestRsltChX = new MeterTestRslt(chXWaterMeter, meterRslt.TestRslt,
|
||||
(CompoundMeterId)meterRslt.CompoundMeterId);
|
||||
meterTestRsltChX.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.MeterTestRslts.Add(meterTestRsltChX);
|
||||
MeterTestRslt chanelXMeterRslt =
|
||||
BatchRslts.GetMeterTestRslt(testName, wmNrChX - 1, Common.CompoundMeterId.Single);
|
||||
|
||||
if (chanelXMeterRslt != null)
|
||||
{
|
||||
chanelXMeterRslt?.CopyContentFrom(meterRslt);
|
||||
if (iCH == 0)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 1;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh1,
|
||||
genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1,
|
||||
genesisSmart.VolumeLtrEndRawCh1);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.GetCalibrationFactors(waterMeterParent).Count > 0)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.GetCalibrationFactors(waterMeterParent)[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.GetCalibrationFactors(waterMeterParent).Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 1;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh1;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh1;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh1;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh1;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH1", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 1)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 2;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh2,
|
||||
genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2,
|
||||
genesisSmart.VolumeLtrEndRawCh2);
|
||||
try
|
||||
{
|
||||
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.GetCalibrationFactors(waterMeterParent).Count > 1)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.GetCalibrationFactors(waterMeterParent)[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.GetCalibrationFactors(waterMeterParent).Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 2;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh2;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh2;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh2;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh2;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH2", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 2)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 3;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh3,
|
||||
genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3,
|
||||
genesisSmart.VolumeLtrEndRawCh3);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.GetCalibrationFactors(waterMeterParent).Count > 2)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.GetCalibrationFactors(waterMeterParent)[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.GetCalibrationFactors(waterMeterParent).Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 3;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh3;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh3;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh3;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh3;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH3", ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (!genesisSmart.EnableShowChanels)
|
||||
{
|
||||
chXWaterMeter.Disabled = !genesisSmart.EnableShowChanels;
|
||||
//meterTestRsltChX.TestDone = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter.Disabled = false;
|
||||
meterTestRsltChX.TestDone = true;
|
||||
}
|
||||
|
||||
meterTestRsltChX.Passed = meterRslt.Passed;
|
||||
}
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error("Error in WaterMeterParentCopy", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CalculateMeterResults(MeterTestRslt meterRslt, IRegReaderDatastream dstrReader, TestRslt tstRslt, double dstrReaderTimestampSecStart, double dstrReaderTimestampSecEnd, double dstrReaderVolumeLtrStart, double dstrReaderVolumeLtrEnd)
|
||||
{
|
||||
meterRslt.TimestampStart = dstrReaderTimestampSecStart;
|
||||
meterRslt.TimestampEnd = !dstrReader.NoSamples
|
||||
? dstrReaderTimestampSecEnd
|
||||
: (dstrReaderTimestampSecStart + tstRslt.TestTime);
|
||||
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||
meterRslt.VolumeStart = dstrReaderVolumeLtrStart; /// liter
|
||||
meterRslt.VolumeEnd = dstrReaderVolumeLtrEnd; /// liter
|
||||
meterRslt.VolumeMeter =
|
||||
Math.Abs(dstrReaderVolumeLtrEnd - dstrReaderVolumeLtrStart);
|
||||
meterRslt.VolumeRef = tstRslt.TestTime==0? tstRslt.VolumeCTV : tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.PulsesMaster = tstRslt.TestTime == 0? tstRslt.PulsesMaster :
|
||||
tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
|
||||
try
|
||||
{
|
||||
meterRslt.TimestampStart = dstrReaderTimestampSecStart;
|
||||
meterRslt.TimestampEnd = !dstrReader.NoSamples
|
||||
? dstrReaderTimestampSecEnd
|
||||
: (dstrReaderTimestampSecStart + tstRslt.TestTime);
|
||||
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||
meterRslt.VolumeStart = dstrReaderVolumeLtrStart; /// liter
|
||||
meterRslt.VolumeEnd = dstrReaderVolumeLtrEnd; /// liter
|
||||
meterRslt.VolumeMeter = Math.Abs(dstrReaderVolumeLtrEnd - dstrReaderVolumeLtrStart);
|
||||
meterRslt.VolumeRef = tstRslt.TestTime == 0
|
||||
? tstRslt.VolumeCTV
|
||||
: tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.PulsesMaster = tstRslt.TestTime == 0
|
||||
? tstRslt.PulsesMaster
|
||||
: tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter,
|
||||
meterRslt.VolumeRef); // Error based on volume difference
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error($"Error in calculate meter results, meterRslt.Name:{meterRslt.Name()} Calculation Bug Detail:", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1503,6 +1627,12 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
MakeSimulated(test, repetitionNr, test.Part, errorPctBase + repetitionNr * 0.1f);
|
||||
}
|
||||
|
||||
//TODO bumi do simulate foe Q3 Calibration
|
||||
///
|
||||
/// Single meters
|
||||
///
|
||||
SimulateQ3CalibrationData(test,1, 0, -5.1f);
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Completed));
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
@@ -1519,6 +1649,64 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
return new List<Event> { TestAndLogUiCmdStop(test, e) ? Event.UiCmdStop : Event.Done };
|
||||
}
|
||||
|
||||
private void SimulateQ3CalibrationData(Test test,int repetitionNr, int part, float errorPctBase)
|
||||
{
|
||||
string testName = test.Name;
|
||||
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
|
||||
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
|
||||
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (WaterMeters.Count > i && WaterMeters[i] != null)
|
||||
WaterMeters[i].SerialNr = "Simul_" + (i + 1).ToString();
|
||||
}
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt meterRslt =
|
||||
BatchRslts.GetEachMeterTestRslt(testName, i, Common.CompoundMeterId.Single);
|
||||
if (meterRslt == null) continue;
|
||||
if (meterRslt?.WaterMeter == null) continue;
|
||||
if (string.IsNullOrEmpty(meterRslt.WaterMeter.SerialNr))
|
||||
{
|
||||
meterRslt.WaterMeter.SerialNr = "Simul_" + (i + 1).ToString();
|
||||
meterRslt.WaterMeter.SerialNrAux = "Simul_" + (i + 1).ToString();
|
||||
log.Debug("Simul_SerialNr: " + meterRslt.WaterMeter.SerialNr);
|
||||
}
|
||||
|
||||
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[i];
|
||||
TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader GenesisSmart =
|
||||
regReader as TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader;
|
||||
|
||||
|
||||
if (GenesisSmart != null)
|
||||
{
|
||||
log.Debug("GenesisSmart - store data on end!");
|
||||
int CH1 = 0, CH2 = 1, CH3 = 2;
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt, GenesisSmart.TimestampSecStart,
|
||||
GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
log.Debug($"GenesisSmart - i:{i}, CH1:{CH1}, testName:{testName}, meterRslt:{meterRslt.Id}, GenesisSmart:{GenesisSmart.Name}, tstRslt:{tstRslt.Id}");
|
||||
WaterMeterParentCopy(i, CH2, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
log.Debug($"GenesisSmart - i:{i}, CH2:{CH2}, testName:{testName}, meterRslt:{meterRslt.Id}, GenesisSmart:{GenesisSmart.Name}, tstRslt:{tstRslt.Id}");
|
||||
WaterMeterParentCopy(i, CH3, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
log.Debug($"GenesisSmart - i:{i}, CH3:{CH3}, testName:{testName}, meterRslt:{meterRslt.Id}, GenesisSmart:{GenesisSmart.Name}, tstRslt:{tstRslt.Id}");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IList<Event> Simulate2(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||
Compound.CombinedTestParams compoundTestParams,
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2019 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
|
||||
namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
{
|
||||
public class CommCompletedEventArgs : EventArgs
|
||||
{
|
||||
public int ThreadId;
|
||||
public int WMNr0; /// 0-based water meter position
|
||||
public GenesisSmartReader Ihead;
|
||||
public Results.Entities.WaterMeter Wm;
|
||||
public string CommMessage;
|
||||
public CommErr CommErr;
|
||||
|
||||
public CommCompletedEventArgs(int threadId, int wmNr0, GenesisSmartReader ihead, Results.Entities.WaterMeter wm, string commMessage, CommErr commErr)
|
||||
{
|
||||
this.ThreadId = threadId;
|
||||
this.WMNr0 = wmNr0;
|
||||
this.Ihead = ihead;
|
||||
this.Wm = wm;
|
||||
this.CommMessage = commMessage;
|
||||
this.CommErr = commErr;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Thread={0} WMNr0={1} IHead={2} WM={3} CommMsg={4} CommErr={5}",
|
||||
ThreadId,
|
||||
WMNr0,
|
||||
(Ihead != null) ? Ihead.Name : "null",
|
||||
(Wm != null) ? Wm.WMPosition : -1,
|
||||
(CommMessage != null) ? CommMessage : "null",
|
||||
CommErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
{
|
||||
public static class GenesisCalibrationFactors
|
||||
{
|
||||
// Preserve the special branch default only when no channel has been configured.
|
||||
public const ushort DefaultFactor = 15625;
|
||||
|
||||
public static bool TryParse(string text1, string text2, string text3,
|
||||
out double[] factors, out string error)
|
||||
{
|
||||
factors = null;
|
||||
error = null;
|
||||
var text = new[] { text1, text2, text3 };
|
||||
if (Array.TrueForAll(text, string.IsNullOrWhiteSpace))
|
||||
{
|
||||
factors = new double[] { DefaultFactor, DefaultFactor, DefaultFactor };
|
||||
return true;
|
||||
}
|
||||
|
||||
var parsed = new double[3];
|
||||
for (int channel = 0; channel < parsed.Length; channel++)
|
||||
{
|
||||
ushort value;
|
||||
if (!ushort.TryParse(text[channel]?.Trim(), NumberStyles.None,
|
||||
CultureInfo.InvariantCulture, out value) || value == 0)
|
||||
{
|
||||
error = "Genesis calibration Text" + (channel + 1) + " must be an integer from 1 to 65535. Set all three channels.";
|
||||
return false;
|
||||
}
|
||||
parsed[channel] = value;
|
||||
}
|
||||
factors = parsed;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+2903
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -32,15 +32,15 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
///
|
||||
delegate void iPerlCommFormDlgt(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, iPerlCommunicationParams testParams);
|
||||
delegate void iPerlCommFormDlgt(GenesisCommunicationSeq myRef, TestMethod method, Test test, iPerlCommunicationParams testParams);
|
||||
///
|
||||
void OpenIPerlCommForm(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, iPerlCommunicationParams testParams)
|
||||
void OpenIPerlCommForm(GenesisCommunicationSeq myRef, TestMethod method, Test test, iPerlCommunicationParams testParams)
|
||||
{
|
||||
|
||||
//TODO solve this wia SmartCommunicationForm
|
||||
throw new NotImplementedException();
|
||||
//myRef.modelessDlg = new iPerlCommunicationForm(method, test, testParams);
|
||||
//myRef.modelessDlg.Show();
|
||||
|
||||
myRef.modelessDlg = new GenesisCommunicationForm(method, test, testParams);
|
||||
myRef.modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
processDataLoggingOp = new TBF.Rig.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
string cmd;
|
||||
if (testParams.Activity.ToLower().Equals(cmd = iPerlCommunicationForm.GetDefaultQ2CorrectionsStr.ToLower()))
|
||||
if (testParams.Activity.ToLower().Equals(cmd = GenesisCommunicationForm.GetDefaultQ2CorrectionsStr.ToLower()))
|
||||
{
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
||||
|
||||
@@ -33,13 +33,13 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
TestMethodCfg()
|
||||
{
|
||||
Name = "SmartCommunication";
|
||||
Name = "SmartCommunicationGenesis";
|
||||
ParentName = string.Empty;
|
||||
CommTimeout = 1800; /// ms
|
||||
MaxCommRetries = 4;
|
||||
WaitTimeAfterFailure = 2200;
|
||||
PassThroughWaitTime = 1500;
|
||||
NrThreads = 2; /// 1, 2 or 4 threads
|
||||
NrThreads = 10; /// 1, 2 or 4 threads
|
||||
IperlCheckErrorsToStop = 10;
|
||||
MciTimeoutMs = 4000; // ms, NFC interface
|
||||
BaudRate = 57600; // NFC Interface
|
||||
|
||||
@@ -28,6 +28,14 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
public TestMethodCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
dfltQ2corrFactorsGroupBox.Visible = false;
|
||||
useWebServiceGroupBox.Visible = false;
|
||||
var factorHint = new System.Windows.Forms.Label
|
||||
{
|
||||
AutoSize = true, Location = dfltQ2corrFactorsGroupBox.Location,
|
||||
Text = "Q3 factors: Water meters / Text1, Text2, Text3 (CH1, CH2, CH3)."
|
||||
};
|
||||
Controls.Add(factorHint);
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
@@ -116,10 +124,10 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Comm. timeout' should be in range 0 .. 5000";
|
||||
}
|
||||
if (!int.TryParse(nrThreadsTextBox.Text, out dummy) || (dummy != 1 && dummy != 2 && dummy != 4))
|
||||
if (!int.TryParse(nrThreadsTextBox.Text, out dummy) || (dummy < 1 || dummy > 10))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Nr. threads' should be 1, 2 or 4";
|
||||
message += Environment.NewLine + "'Nr. threads' should be in range 1 .. 10";
|
||||
}
|
||||
if (!int.TryParse(iperlCheckErrorsToStopTextBox.Text, out dummy) || ((dummy < 1) && (dummy > 40)))
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@ using Config.Entities;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
|
||||
|
||||
namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
{
|
||||
@@ -31,7 +30,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
|
||||
public override void InitializeAll()
|
||||
{
|
||||
Activity = iPerlCommunicationForm.ReadConfigurationStr;
|
||||
Activity = GenesisCommunicationForm.SlotInitializeStr;
|
||||
SimultWithPrevious = false;
|
||||
SimultWithNext = false;
|
||||
}
|
||||
@@ -51,62 +50,79 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
if (i == 0)
|
||||
{
|
||||
var retVal = new List<string>();
|
||||
retVal.Add(iPerlCommunicationForm.ReadConfigurationStr);
|
||||
retVal.Add(iPerlCommunicationConstants.ReadAdditionalCommonParametersStr);
|
||||
retVal.Add(iPerlCommunicationForm.ReadSerialNrStr);
|
||||
retVal.Add(string.Format("{0} A0", iPerlCommunicationForm.SetTestModeStr));
|
||||
retVal.Add(string.Format("{0} A4", iPerlCommunicationForm.SetTestModeStr));
|
||||
retVal.Add(iPerlCommunicationForm.ReadCalibrationStr);
|
||||
retVal.Add(iPerlCommunicationForm.ReadCalibrationV4Str);
|
||||
retVal.Add(iPerlCommunicationForm.NormalizeCalibrationFactorStr);
|
||||
retVal.Add(iPerlCommunicationForm.NormalizeCalibrationV4FactorsStr);
|
||||
retVal.Add(iPerlCommunicationForm.GetDefaultQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.ReadQ2CorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.ResetQ2CorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteDefaultQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.InitOrReadQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteCalibrationFactorStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteCalibrationV4FactorsStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionPlusIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionPlusAltIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRIncl05Str);
|
||||
retVal.Add(iPerlCommunicationSeq.Q2correctedFromCmd + "Qx");
|
||||
retVal.Add(iPerlCommunicationSeq.StrictQ2ErrorCheckStr + "Qx");
|
||||
retVal.Add(iPerlCommunicationSeq.Q2correctionCheckCmd);
|
||||
retVal.Add(iPerlCommunicationSeq.IperlCheckCmd);
|
||||
retVal.Add(iPerlCommunicationForm.UpdateBothQ2FactorsTestRLOnlyStr);
|
||||
retVal.Add(iPerlCommunicationForm.UpdateBothQ2FactorsTestLROnlyStr);
|
||||
retVal.Add(iPerlCommunicationForm.UpdateQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrRLStr);
|
||||
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrLRStr);
|
||||
retVal.Add("Q2 corrected from Q2adj");
|
||||
retVal.Add("Q2 correction check Q2bc Q2ac");
|
||||
retVal.Add(iPerlCommunicationForm.SetActiveModeStr);
|
||||
retVal.Add(iPerlCommunicationForm.SetIdleModeStr);
|
||||
retVal.Add("---");
|
||||
retVal.Add(iPerlCommunicationForm.Reset2HzCorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.Write2HzCorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.DewaReworkRLStr);
|
||||
retVal.Add(iPerlCommunicationForm.DewaReworkLRStr);
|
||||
retVal.Add(iPerlCommunicationForm.StartTestingSealedMetersStr);
|
||||
retVal.Add(iPerlCommunicationForm.EndTestingSealedMetersStr);
|
||||
retVal.Add(string.Format("{0} if enabled", iPerlCommunicationForm.ReadConfigurationStr));
|
||||
retVal.Add(string.Format("{0} 80", iPerlCommunicationForm.SetTestModeStr));
|
||||
retVal.Add("iPerl_check prevWorkStep direction q2factors");
|
||||
for (iPerlCommunication.ConditionID id = iPerlCommunication.ConditionID.A; id < iPerlCommunication.ConditionID.Count; id++)
|
||||
{
|
||||
retVal.Add(string.Format(iPerlCommunication.SequenceConditionOp.ConditionNameFmt, id));
|
||||
}
|
||||
|
||||
retVal.Add(GenesisCommunicationForm.SlotInitializeStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotUpdateStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotConnectStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotPCBSlotStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotSetPasswordStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotLoginStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotGroupedLoginStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotSetTestModeStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotSetActiveModeStr);
|
||||
retVal.Add(GenesisCommunicationForm.SlotDisconnectStr);
|
||||
retVal.Add(GenesisCommunicationForm.PrepareSlotQ3CalibrationStr);
|
||||
retVal.Add(GenesisCommunicationForm.WriteSlotQ3CalibrationStr);
|
||||
retVal.Add(GenesisCommunicationForm.CheckMeterPrepareStr);
|
||||
retVal.Add(GenesisCommunicationForm.HoldSlotStr);
|
||||
|
||||
|
||||
|
||||
// retVal.Add(GenesisCommunicationForm.ReadConfigurationStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ReadSerialNrStr);
|
||||
// retVal.Add(string.Format("{0} A0", GenesisCommunicationForm.SetTestModeStr));
|
||||
// retVal.Add(string.Format("{0} A4", GenesisCommunicationForm.SetTestModeStr));
|
||||
// retVal.Add(GenesisCommunicationForm.ReadCalibrationStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ReadCalibrationV4Str);
|
||||
// retVal.Add(GenesisCommunicationForm.NormalizeCalibrationFactorStr);
|
||||
// retVal.Add(GenesisCommunicationForm.NormalizeCalibrationV4FactorsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.GetDefaultQ2CorrectionsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ReadQ2CorrectionStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ResetQ2CorrectionStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteDefaultQ2CorrectionsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.InitOrReadQ2CorrectionsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteCalibrationFactorStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteCalibrationV4FactorsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionAltStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionGreeceStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionRLStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionLRStr);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionIncl05Str);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionAltIncl05Str);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionPlusIncl05Str);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionPlusAltIncl05Str);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionGreeceIncl05Str);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionRLIncl05Str);
|
||||
// retVal.Add(GenesisCommunicationForm.WriteQ2CorrectionLRIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationSeq.Q2correctedFromCmd + "Qx");
|
||||
// retVal.Add(iPerlCommunicationSeq.StrictQ2ErrorCheckStr + "Qx");
|
||||
// retVal.Add(iPerlCommunicationSeq.Q2correctionCheckCmd);
|
||||
// retVal.Add(iPerlCommunicationSeq.IperlCheckCmd);
|
||||
// retVal.Add(GenesisCommunicationForm.UpdateBothQ2FactorsTestRLOnlyStr);
|
||||
// retVal.Add(GenesisCommunicationForm.UpdateBothQ2FactorsTestLROnlyStr);
|
||||
// retVal.Add(GenesisCommunicationForm.UpdateQ2CorrectionsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ConditnlUpdateQ2CorrectionsStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ConditnlUpdateQ2CorrRLStr);
|
||||
// retVal.Add(GenesisCommunicationForm.ConditnlUpdateQ2CorrLRStr);
|
||||
// retVal.Add("Q2 corrected from Q2adj");
|
||||
// retVal.Add("Q2 correction check Q2bc Q2ac");
|
||||
// retVal.Add(GenesisCommunicationForm.SetActiveModeStr);
|
||||
// retVal.Add(GenesisCommunicationForm.SetIdleModeStr);
|
||||
// retVal.Add("---");
|
||||
// retVal.Add(GenesisCommunicationForm.Reset2HzCorrectionStr);
|
||||
// retVal.Add(GenesisCommunicationForm.Write2HzCorrectionStr);
|
||||
// retVal.Add(GenesisCommunicationForm.DewaReworkRLStr);
|
||||
// retVal.Add(GenesisCommunicationForm.DewaReworkLRStr);
|
||||
// retVal.Add(GenesisCommunicationForm.StartTestingSealedMetersStr);
|
||||
// retVal.Add(GenesisCommunicationForm.EndTestingSealedMetersStr);
|
||||
// retVal.Add(string.Format("{0} if enabled", GenesisCommunicationForm.ReadConfigurationStr));
|
||||
// retVal.Add(string.Format("{0} 80", GenesisCommunicationForm.SetTestModeStr));
|
||||
// retVal.Add("iPerl_check prevWorkStep direction q2factors");
|
||||
// for (ConditionID id = ConditionID.A; id < ConditionID.Count; id++)
|
||||
// {
|
||||
// retVal.Add(string.Format(SequenceConditionOp.ConditionNameFmt, id));
|
||||
// }
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
public const int EndOptoDataCount = OptoDataBufferSize - StartOptoDataCount;
|
||||
public const int StartEndFilterSamplesCount2 = 1; //20 /// StartEndFilterSamplesCount = 2 * StartEndFilterSamplesCount2 + 1
|
||||
public const int FeatureVectorSize = 9;
|
||||
/// <summary>Default raw ViewCalibration value which represents 100 % according to the iPerl ASIC protocol.</summary>
|
||||
public const double DefaultCalibFactorNominal = 4096.0;
|
||||
|
||||
private const int StartSampleDelaySec = 5;
|
||||
private const int EndSampleDelayCount = 2;
|
||||
@@ -94,6 +96,15 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
public string QuantityUnits { get; set; }
|
||||
|
||||
public double CalibTarget { get { return iperlHeadCfg.ProcParams.CalibTarget; } }
|
||||
public double CalibFactorNominal
|
||||
{
|
||||
get
|
||||
{
|
||||
return iperlHeadCfg != null && iperlHeadCfg.CalibFactorNominal > 0.0
|
||||
? iperlHeadCfg.CalibFactorNominal
|
||||
: DefaultCalibFactorNominal;
|
||||
}
|
||||
}
|
||||
public ushort FactorLimitLo { get { return (ushort)iperlHeadCfg.ProcParams.FactorLimitLo; } }
|
||||
public ushort FactorLimitHi { get { return (ushort)iperlHeadCfg.ProcParams.FactorLimitHi; } }
|
||||
public Counting InitFlowDir { get { return (iperlHeadCfg != null && iperlHeadCfg.ProcParams != null) ? iperlHeadCfg.ProcParams.Counting : Counting.Arbitrary; } }
|
||||
@@ -157,6 +168,27 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Converts the raw two-byte ViewCalibration factor to its percentage representation.</summary>
|
||||
public static double CalculateCalibFactorPercentage(ushort rawCalibFactor)
|
||||
{
|
||||
return CalculateCalibFactorPercentage(rawCalibFactor, DefaultCalibFactorNominal);
|
||||
}
|
||||
|
||||
public static double CalculateCalibFactorPercentage(ushort rawCalibFactor, double nominalCalibFactor)
|
||||
{
|
||||
return nominalCalibFactor > 0.0 ? rawCalibFactor * 100.0 / nominalCalibFactor : 0.0;
|
||||
}
|
||||
|
||||
public double CalibFactorPercentage
|
||||
{
|
||||
get { return CalculateCalibFactorPercentage(CalibFactor, CalibFactorNominal); }
|
||||
}
|
||||
|
||||
public double CalibFactorCorrectionPercentage
|
||||
{
|
||||
get { return CalibFactorPercentage - 100.0; }
|
||||
}
|
||||
|
||||
public ushort OrigCalibFactorLNA;
|
||||
public ushort CalibFactorLNA { get { return (CalibrationStructV4 != null) ? CalibrationStructV4.CalibrationLNA : (ushort)0; } }
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4
|
||||
public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort, 1 .. 10
|
||||
public CommunicationInterface CommunicationInterface; /// Communication Interface: RFID or NFC
|
||||
public double CalibFactorNominal; /// Raw calibration factor representing 100 % in the results calculation
|
||||
|
||||
/// <summary> Procedure parameters </summary>
|
||||
[XmlIgnore]
|
||||
@@ -49,6 +50,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
ProcParams = CreateProcParamsProvider() as ProcParams;
|
||||
CommunicationInterface = CommunicationInterface.RFID;
|
||||
HeadCommunicationComPortNr = 0;
|
||||
CalibFactorNominal = IperlHead.DefaultCalibFactorNominal;
|
||||
}
|
||||
|
||||
public IperlHeadCfg(IComponentFactory factory)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
@@ -33,6 +34,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
private void WaterMeterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
nameLabel.Text = Strings.Name;
|
||||
calibFactorNominalLabel.Text = GetLocalizedString("IperlCalibFactorNominal", "Default calibration factor:");
|
||||
string calibFactorNominalTooltip = GetLocalizedString("IperlCalibFactorNominalTooltip", "Raw calibration factor representing 100 %. This value is used to calculate 'iPerl CalibFactor (%)' in the results configuration.");
|
||||
calibFactorNominalToolTip.SetToolTip(calibFactorNominalLabel, calibFactorNominalTooltip);
|
||||
calibFactorNominalToolTip.SetToolTip(calibFactorNominalTextBox, calibFactorNominalTooltip);
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
Redraw();
|
||||
}
|
||||
@@ -55,6 +60,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
muxBoardNrTextBox.Text = config.MuxBoardNr.ToString();
|
||||
groupTextBox.Text = config.Group.ToString();
|
||||
comboBoxCommunicationInterface.SelectedItem = config.CommunicationInterface.ToString();
|
||||
double nominalCalibFactor = config.CalibFactorNominal > 0.0
|
||||
? config.CalibFactorNominal
|
||||
: IperlHead.DefaultCalibFactorNominal;
|
||||
calibFactorNominalTextBox.Text = nominalCalibFactor.ToString(CultureInfo.CurrentCulture);
|
||||
tabPage2.Controls.Add(new IperlHeadTestCtrl(config));
|
||||
}
|
||||
|
||||
@@ -71,6 +80,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
muxBoardNrTextBox.Enabled = true;
|
||||
groupTextBox.Enabled = true;
|
||||
comboBoxCommunicationInterface.Enabled = true;
|
||||
calibFactorNominalTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
@@ -127,6 +137,13 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, groupLabel.Text);
|
||||
}
|
||||
|
||||
double nominalCalibFactor;
|
||||
if (!TryParseDouble(calibFactorNominalTextBox.Text, out nominalCalibFactor) || nominalCalibFactor <= 0.0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, calibFactorNominalLabel.Text);
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -155,8 +172,22 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
config.Group = int.Parse(groupTextBox.Text);
|
||||
config.CommunicationInterface = (CommunicationInterface)comboBoxCommunicationInterface.SelectedIndex;
|
||||
config.HeadCommunicationComPortNr = int.Parse(headPortNrTextBox.Text);
|
||||
double nominalCalibFactor;
|
||||
if (TryParseDouble(calibFactorNominalTextBox.Text, out nominalCalibFactor))
|
||||
config.CalibFactorNominal = nominalCalibFactor;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
private static bool TryParseDouble(string value, out double result)
|
||||
{
|
||||
return double.TryParse(value, NumberStyles.Float, CultureInfo.CurrentCulture, out result) ||
|
||||
double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out result);
|
||||
}
|
||||
|
||||
private static string GetLocalizedString(string resourceName, string fallback)
|
||||
{
|
||||
return Strings.ResourceManager.GetString(resourceName, Strings.Culture) ?? fallback;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+26
@@ -31,6 +31,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
@@ -60,6 +61,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.headPortNrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.calibFactorNominalLabel = new System.Windows.Forms.Label();
|
||||
this.calibFactorNominalTextBox = new System.Windows.Forms.TextBox();
|
||||
this.calibFactorNominalToolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
@@ -80,6 +84,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.groupBox2);
|
||||
this.tabPage1.Controls.Add(this.calibFactorNominalTextBox);
|
||||
this.tabPage1.Controls.Add(this.calibFactorNominalLabel);
|
||||
this.tabPage1.Controls.Add(this.label4);
|
||||
this.tabPage1.Controls.Add(this.label3);
|
||||
this.tabPage1.Controls.Add(this.groupBox1);
|
||||
@@ -364,6 +370,23 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
this.groupBox2.TabIndex = 26;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Head Communication";
|
||||
//
|
||||
// calibFactorNominalLabel
|
||||
//
|
||||
this.calibFactorNominalLabel.AutoSize = true;
|
||||
this.calibFactorNominalLabel.Location = new System.Drawing.Point(290, 76);
|
||||
this.calibFactorNominalLabel.Name = "calibFactorNominalLabel";
|
||||
this.calibFactorNominalLabel.Size = new System.Drawing.Size(142, 16);
|
||||
this.calibFactorNominalLabel.TabIndex = 27;
|
||||
this.calibFactorNominalLabel.Text = "Default calibration factor:";
|
||||
//
|
||||
// calibFactorNominalTextBox
|
||||
//
|
||||
this.calibFactorNominalTextBox.Enabled = false;
|
||||
this.calibFactorNominalTextBox.Location = new System.Drawing.Point(290, 96);
|
||||
this.calibFactorNominalTextBox.Name = "calibFactorNominalTextBox";
|
||||
this.calibFactorNominalTextBox.Size = new System.Drawing.Size(92, 22);
|
||||
this.calibFactorNominalTextBox.TabIndex = 28;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
@@ -437,5 +460,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.TextBox headPortNrTextBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label calibFactorNominalLabel;
|
||||
private System.Windows.Forms.TextBox calibFactorNominalTextBox;
|
||||
private System.Windows.Forms.ToolTip calibFactorNominalToolTip;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4678,4 +4678,18 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Compile Include="Rig\RegisterReaders\GenesisRegReader\communication\GciBridgeClient.cs" />
|
||||
<Compile Include="Rig\RegisterReaders\GenesisRegReader\communication\IGciBridgeClient.cs" />
|
||||
<Compile Include="Rig\RegisterReaders\GenesisRegReader\communication\common\LedState.cs" />
|
||||
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisCommunicationForm.cs" />
|
||||
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisCommunicationForm.designer.cs" />
|
||||
<EmbeddedResource Include="Rig\TestMethods\GenesisCommunication\GenesisCommunicationForm.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Rig\TestMethods\GenesisCommunication\CommCompletedEventArgs.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisCalibrationFactors.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user