add service ports

This commit is contained in:
Roland Drabesch 2025-09-25 09:33:14 +02:00
parent f56420268c
commit d5bac80bbc
8 changed files with 181 additions and 93 deletions

View File

@ -171,7 +171,7 @@
</site>
<site name="MeterProcessState(2)" id="4">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\LAA_PRODUCTION\Common\Service\MeterProcessState" />
<virtualDirectory path="/" physicalPath="E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:50075:localhost" />

View File

@ -27,6 +27,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig
{
SirtComport433MHz = null;
SirtComport868MHz = null;
ServiceSirtComport868MHz = null;
ServiceSirtComport433MHz = null;
SirtBoxNo = null;
StationId = null;
return false;
@ -38,6 +40,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig
var sirtConfig = JsonConvert.DeserializeObject<SirtConfig>(tr.ReadToEnd());
SirtComport433MHz = sirtConfig.SirtComport433MHz;
SirtComport868MHz = sirtConfig.SirtComport868MHz;
ServiceSirtComport433MHz = sirtConfig.ServiceSirtComport433MHz; ;
ServiceSirtComport868MHz = sirtConfig.ServiceSirtComport868MHz; ;
SirtBoxNo = sirtConfig.SirtBoxNo;
StationId = sirtConfig.StationId;
}
@ -77,5 +81,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig
/// </summary>
public Int32? StationId { get; set; }
/// <summary>
/// Service Comport for SIRT interface with 433MHz radio frequency
/// </summary>
public String ServiceSirtComport433MHz { get; set; }
/// <summary>
/// Service Comport for SIRT interface with 868MHz radio frequency
/// </summary>
public String ServiceSirtComport868MHz { get; set; }
}
}

View File

@ -1 +1 @@
8cb55c312de586b683d72cf58c13e2801d10e14b767777d98338d3e1473a1213
b03dfbada453427a2bb1275645a5f1b525f29900

@ -1 +1 @@
Subproject commit 9b62d21bbb6aa7a13c7902c65a8e7c3ee5a0d1df
Subproject commit 41c1163d102dbb63572e60c6ffd501e1765d848c

View File

@ -2,9 +2,11 @@
using Newtonsoft.Json.Linq;
using SIRTCOM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
using System.Windows.Interop;
using System.Windows.Threading;
using System.Xml.Linq;
using Xylem.Common.CommonCore.Configuration;
@ -14,6 +16,7 @@ using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.ProductionOrderCore;
using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum;
using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams;
using Xylem.Common.Production.ProductionUiCordonel.Properties;
using Xylem.Common.Production.ProductionUiCordonel.UserControls;
using Xylem.Common.Utils.Logging;
@ -283,7 +286,19 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
int.TryParse(sirtConfig.SirtComport868MHz.Replace("COM", ""), out _sirtComport);
}
if (sirtConfig.SirtBoxNo != null)
var ServicePorts = new List<int>();
var cport = 0;
if (sirtConfig.ServiceSirtComport433MHz != null && int.TryParse(sirtConfig.ServiceSirtComport433MHz.Replace("COM", ""), out cport))
{
ServicePorts.Add(cport);
}
if (sirtConfig.ServiceSirtComport868MHz != null && int.TryParse(sirtConfig.ServiceSirtComport868MHz.Replace("COM", ""), out cport))
{
ServicePorts.Add(cport);
}
if (sirtConfig.SirtBoxNo != null)
_sirtBoxNr = (Byte)sirtConfig.SirtBoxNo;
var ucRadio = (UcRadioCheck)UserControl;
@ -294,9 +309,22 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// Tell the radio that something is in the slot which will impact the radio transmission
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_IrDAModulePresent",
new Byte[] { 1 }, ProgrammingSource.ProgramInternal));
ActualProcessProgress++;
if (ServicePorts.Any())
{
try
{
SIRTServer.StartServer(new Action<string>((s) => { SuccessMsgDispatcher(s); }), new Action<string>((s) => { ErrorMsgDispatcher(s); }), ServicePorts.ToArray());
SIRTServer.StartProgramming(Convert.ToInt32(freq) , _radioAddressCordonel, meterEncryptionKey, 3);
}
catch (Exception ex)
{
}
}
// Clear the measurement as on a retry started from main control the old values will be displayed
ClearRssiMeasurement();
// kick off RSSI test

View File

@ -53,6 +53,9 @@
this.tabPage3 = new System.Windows.Forms.TabPage();
this.cmdAddOffline = new System.Windows.Forms.Button();
this.dgvofflinePw = new System.Windows.Forms.DataGridView();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.offlinePaswordItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tabPage4 = new System.Windows.Forms.TabPage();
this.lblGlobalCurrentPath = new System.Windows.Forms.Label();
this.btnGlobalSearch = new System.Windows.Forms.Button();
@ -68,26 +71,27 @@
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.lblSirtStation = new System.Windows.Forms.Label();
this.lblSirtBoxNo = new System.Windows.Forms.Label();
this.lblSirtComport433MHz = new System.Windows.Forms.Label();
this.lblSirtComport868MHz = new System.Windows.Forms.Label();
this.tbxSirtStationId = new System.Windows.Forms.TextBox();
this.tbxSirtBoxNo = new System.Windows.Forms.TextBox();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.offlinePaswordItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.cbxSirtComport433MHz = new System.Windows.Forms.ComboBox();
this.cbxSirtComport868MHz = new System.Windows.Forms.ComboBox();
this.cbxSirtComport433MHz = new System.Windows.Forms.ComboBox();
this.tbxSirtBoxNo = new System.Windows.Forms.TextBox();
this.tbxSirtStationId = new System.Windows.Forms.TextBox();
this.lblSirtComport868MHz = new System.Windows.Forms.Label();
this.lblSirtComport433MHz = new System.Windows.Forms.Label();
this.lblSirtBoxNo = new System.Windows.Forms.Label();
this.lblSirtStation = new System.Windows.Forms.Label();
this.cbxSirtService868MHz = new System.Windows.Forms.ComboBox();
this.cbxSirtService433MHz = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvConfig)).BeginInit();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvofflinePw)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.offlinePaswordItemBindingSource)).BeginInit();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.offlinePaswordItemBindingSource)).BeginInit();
this.SuspendLayout();
//
// btnReload
@ -331,6 +335,22 @@
this.dgvofflinePw.Size = new System.Drawing.Size(345, 170);
this.dgvofflinePw.TabIndex = 16;
//
// dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "PcbID";
this.dataGridViewTextBoxColumn1.HeaderText = "PcbID";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "Password";
this.dataGridViewTextBoxColumn2.HeaderText = "Password";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
//
// offlinePaswordItemBindingSource
//
this.offlinePaswordItemBindingSource.DataSource = typeof(Xylem.Common.Ui.GenesisToolBox.OfflinePasswordItem);
//
// tabPage4
//
this.tabPage4.Controls.Add(this.lblGlobalCurrentPath);
@ -478,6 +498,10 @@
//
// tabPage5
//
this.tabPage5.Controls.Add(this.cbxSirtService868MHz);
this.tabPage5.Controls.Add(this.cbxSirtService433MHz);
this.tabPage5.Controls.Add(this.label5);
this.tabPage5.Controls.Add(this.label7);
this.tabPage5.Controls.Add(this.cbxSirtComport868MHz);
this.tabPage5.Controls.Add(this.cbxSirtComport433MHz);
this.tabPage5.Controls.Add(this.tbxSirtBoxNo);
@ -493,32 +517,35 @@
this.tabPage5.Text = "SIRT";
this.tabPage5.UseVisualStyleBackColor = true;
//
// lblSirtStation
// cbxSirtComport868MHz
//
this.lblSirtStation.AutoSize = true;
this.lblSirtStation.Location = new System.Drawing.Point(22, 24);
this.lblSirtStation.Name = "lblSirtStation";
this.lblSirtStation.Size = new System.Drawing.Size(57, 13);
this.lblSirtStation.TabIndex = 2;
this.lblSirtStation.Text = "Station ID:";
this.cbxSirtComport868MHz.FormattingEnabled = true;
this.cbxSirtComport868MHz.Location = new System.Drawing.Point(142, 102);
this.cbxSirtComport868MHz.Name = "cbxSirtComport868MHz";
this.cbxSirtComport868MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtComport868MHz.TabIndex = 9;
//
// lblSirtBoxNo
// cbxSirtComport433MHz
//
this.lblSirtBoxNo.AutoSize = true;
this.lblSirtBoxNo.Location = new System.Drawing.Point(22, 51);
this.lblSirtBoxNo.Name = "lblSirtBoxNo";
this.lblSirtBoxNo.Size = new System.Drawing.Size(45, 13);
this.lblSirtBoxNo.TabIndex = 3;
this.lblSirtBoxNo.Text = "Box No:";
this.cbxSirtComport433MHz.FormattingEnabled = true;
this.cbxSirtComport433MHz.Location = new System.Drawing.Point(142, 75);
this.cbxSirtComport433MHz.Name = "cbxSirtComport433MHz";
this.cbxSirtComport433MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtComport433MHz.TabIndex = 8;
//
// lblSirtComport433MHz
// tbxSirtBoxNo
//
this.lblSirtComport433MHz.AutoSize = true;
this.lblSirtComport433MHz.Location = new System.Drawing.Point(22, 78);
this.lblSirtComport433MHz.Name = "lblSirtComport433MHz";
this.lblSirtComport433MHz.Size = new System.Drawing.Size(95, 13);
this.lblSirtComport433MHz.TabIndex = 4;
this.lblSirtComport433MHz.Text = "Comport 433 MHz:";
this.tbxSirtBoxNo.Location = new System.Drawing.Point(142, 44);
this.tbxSirtBoxNo.Name = "tbxSirtBoxNo";
this.tbxSirtBoxNo.Size = new System.Drawing.Size(100, 20);
this.tbxSirtBoxNo.TabIndex = 7;
//
// tbxSirtStationId
//
this.tbxSirtStationId.Location = new System.Drawing.Point(142, 17);
this.tbxSirtStationId.Name = "tbxSirtStationId";
this.tbxSirtStationId.Size = new System.Drawing.Size(100, 20);
this.tbxSirtStationId.TabIndex = 6;
//
// lblSirtComport868MHz
//
@ -529,51 +556,66 @@
this.lblSirtComport868MHz.TabIndex = 5;
this.lblSirtComport868MHz.Text = "Comport 868 MHz:";
//
// tbxSirtStationId
// lblSirtComport433MHz
//
this.tbxSirtStationId.Location = new System.Drawing.Point(142, 17);
this.tbxSirtStationId.Name = "tbxSirtStationId";
this.tbxSirtStationId.Size = new System.Drawing.Size(100, 20);
this.tbxSirtStationId.TabIndex = 6;
this.lblSirtComport433MHz.AutoSize = true;
this.lblSirtComport433MHz.Location = new System.Drawing.Point(22, 78);
this.lblSirtComport433MHz.Name = "lblSirtComport433MHz";
this.lblSirtComport433MHz.Size = new System.Drawing.Size(95, 13);
this.lblSirtComport433MHz.TabIndex = 4;
this.lblSirtComport433MHz.Text = "Comport 433 MHz:";
//
// tbxSirtBoxNo
// lblSirtBoxNo
//
this.tbxSirtBoxNo.Location = new System.Drawing.Point(142, 44);
this.tbxSirtBoxNo.Name = "tbxSirtBoxNo";
this.tbxSirtBoxNo.Size = new System.Drawing.Size(100, 20);
this.tbxSirtBoxNo.TabIndex = 7;
this.lblSirtBoxNo.AutoSize = true;
this.lblSirtBoxNo.Location = new System.Drawing.Point(22, 51);
this.lblSirtBoxNo.Name = "lblSirtBoxNo";
this.lblSirtBoxNo.Size = new System.Drawing.Size(45, 13);
this.lblSirtBoxNo.TabIndex = 3;
this.lblSirtBoxNo.Text = "Box No:";
//
// dataGridViewTextBoxColumn1
// lblSirtStation
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "PcbID";
this.dataGridViewTextBoxColumn1.HeaderText = "PcbID";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
this.lblSirtStation.AutoSize = true;
this.lblSirtStation.Location = new System.Drawing.Point(22, 24);
this.lblSirtStation.Name = "lblSirtStation";
this.lblSirtStation.Size = new System.Drawing.Size(57, 13);
this.lblSirtStation.TabIndex = 2;
this.lblSirtStation.Text = "Station ID:";
//
// dataGridViewTextBoxColumn2
// cbxSirtService868MHz
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "Password";
this.dataGridViewTextBoxColumn2.HeaderText = "Password";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
this.cbxSirtService868MHz.FormattingEnabled = true;
this.cbxSirtService868MHz.Location = new System.Drawing.Point(142, 164);
this.cbxSirtService868MHz.Name = "cbxSirtService868MHz";
this.cbxSirtService868MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtService868MHz.TabIndex = 13;
//
// offlinePaswordItemBindingSource
// cbxSirtService433MHz
//
this.offlinePaswordItemBindingSource.DataSource = typeof(Xylem.Common.Ui.GenesisToolBox.OfflinePasswordItem);
this.cbxSirtService433MHz.FormattingEnabled = true;
this.cbxSirtService433MHz.Location = new System.Drawing.Point(142, 137);
this.cbxSirtService433MHz.Name = "cbxSirtService433MHz";
this.cbxSirtService433MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtService433MHz.TabIndex = 12;
//
// cbxSirtComport433MHz
// label5
//
this.cbxSirtComport433MHz.FormattingEnabled = true;
this.cbxSirtComport433MHz.Location = new System.Drawing.Point(142, 75);
this.cbxSirtComport433MHz.Name = "cbxSirtComport433MHz";
this.cbxSirtComport433MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtComport433MHz.TabIndex = 8;
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(22, 168);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(114, 13);
this.label5.TabIndex = 11;
this.label5.Text = "Service Port 868 MHz:";
//
// cbxSirtComport868MHz
// label7
//
this.cbxSirtComport868MHz.FormattingEnabled = true;
this.cbxSirtComport868MHz.Location = new System.Drawing.Point(142, 102);
this.cbxSirtComport868MHz.Name = "cbxSirtComport868MHz";
this.cbxSirtComport868MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtComport868MHz.TabIndex = 9;
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(22, 140);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(114, 13);
this.label7.TabIndex = 10;
this.label7.Text = "Service Port 433 MHz:";
//
// FrmSetup
//
@ -594,11 +636,11 @@
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvofflinePw)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.offlinePaswordItemBindingSource)).EndInit();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.offlinePaswordItemBindingSource)).EndInit();
this.ResumeLayout(false);
}
@ -655,5 +697,9 @@
private System.Windows.Forms.TextBox tbxSirtStationId;
private System.Windows.Forms.ComboBox cbxSirtComport868MHz;
private System.Windows.Forms.ComboBox cbxSirtComport433MHz;
private System.Windows.Forms.ComboBox cbxSirtService868MHz;
private System.Windows.Forms.ComboBox cbxSirtService433MHz;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label7;
}
}

View File

@ -106,6 +106,23 @@ namespace Xylem.Common.Ui.GenesisToolBox
cbxSirtComport433MHz.Text = cbxSirtComport433MHz.Items[0].ToString();
cbxSirtComport868MHz.Text = cbxSirtComport868MHz.Items[0].ToString();
if (_sirtConfig.ServiceSirtComport433MHz != null)
cbxSirtService433MHz.Items.Add(_sirtConfig.ServiceSirtComport433MHz);
if (_sirtConfig.ServiceSirtComport868MHz != null)
cbxSirtService868MHz.Items.Add(_sirtConfig.ServiceSirtComport868MHz);
foreach (var comPort in comPorts.Where(comPort => !cbxSirtService433MHz.Items.Contains(comPort)))
{
cbxSirtService433MHz.Items.Add(comPort);
}
foreach (var comPort in comPorts.Where(comPort => !cbxSirtService868MHz.Items.Contains(comPort)))
{
cbxSirtService868MHz.Items.Add(comPort);
}
cbxSirtService433MHz.Text = cbxSirtService433MHz.Items[0].ToString();
cbxSirtService868MHz.Text = cbxSirtService868MHz.Items[0].ToString();
}
private void BtnReload_Click(Object sender, EventArgs e)
@ -136,6 +153,9 @@ namespace Xylem.Common.Ui.GenesisToolBox
_sirtConfig.SirtComport433MHz = cbxSirtComport433MHz.Text;
_sirtConfig.SirtComport868MHz = cbxSirtComport868MHz.Text;
_sirtConfig.ServiceSirtComport433MHz = cbxSirtService433MHz.Text;
_sirtConfig.ServiceSirtComport868MHz = cbxSirtService868MHz.Text;
_sirtConfig.Update();
}

View File

@ -138,31 +138,10 @@
<metadata name="btcDetectStreaming.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tbcSlot.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cbcRequestPort.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cbcRequestType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cbcStreamingPort.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cbcSlotType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btcDetectRequest.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btcDetectStreaming.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="offlinePaswordItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="offlinePaswordItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>