radio system state need a logout to refresh

This commit is contained in:
Roland Drabesch
2023-01-16 11:40:39 +01:00
parent cd3de05b81
commit af20391d8c
9 changed files with 54 additions and 29 deletions
+1 -1
View File
@@ -155,7 +155,7 @@
</site>
<site name="MeterProcessState" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\ProgrammeSensus\Repo\Lab\La_Operations\laa_production\Common\Service\MeterProcessState" />
<virtualDirectory path="/" physicalPath="C:\Users\drabesch_ro\Repo\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:56011:localhost" />
@@ -1 +1 @@
1a3d4919c9c702245832d925951f2b7cb72fc333
5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3
@@ -70,7 +70,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={base.Meter.PcbId}";
var url = $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetProgrammingParameters?PcbID={base.Meter.PcbId}";
var csdRet = LocalWebRequest.GetRequest(url, 80000);
return Newtonsoft.Json.JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet);
return Newtonsoft.Json.JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet);
}
catch (Exception ex)
@@ -1,12 +1,8 @@
using ProductionUiCordonel.ProductionProcesses.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading;
using System;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
@@ -39,7 +35,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
//clear
}
public override void StartProcess()
{
try
@@ -73,10 +69,18 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Meter.ReadRegister(dic.GetIdent(), 32);
break;
default:
Meter.ReadRegister(dic.GetIdent());
if (dic.DataType == typeof(UInt64) || dic.DataType == typeof(Int64))
{
Meter.ReadRegister(dic.GetIdent(), 32);
}
else
{
Meter.ReadRegister(dic.GetIdent());
}
break;
}
}
base.Progress = (Int32)Math.Round(((Double)done / (Double)total.Count) * 100, 0);
}
@@ -97,7 +101,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
currentProcessState = ProductionProcessState.Error;
}
}
@@ -291,6 +291,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
stm.initialise((byte)ByteCOMPort);
SIRTCOM.Wrapper wrp = new SIRTCOM.Wrapper();
stm.StartLoggin("C:\\GenesisLog\\log.txt");
// ist wohl nicht nötig da der SIRT richtig konfiguroert ist:
// wrp.ActivateSirt(byte modul1, byte modul2, byte actTimeout, out byte outP12_01, out byte outP12_02);
@@ -85,8 +85,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Meter.WriteLog("Login failed");
}
}
if ( writeList.All(a => a == true) )
if (writeList.All(a => a == true))
{
if (doRestart)
{
@@ -101,10 +101,10 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
StoreConfigEnable = true
};
var rebootSucceeded = _meterResetPsu.MeterResetPsuExecute();
Thread.Sleep(10000);
Meter.Login();
bool? hasDiffrences = null;
foreach (var item in CheckValuesAufterBoot)
@@ -124,22 +124,26 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (rebootSucceeded && hasDiffrences.HasValue && !hasDiffrences.Value)
{
Meter.WriteRegister("SENSUSRADIO_SystemState", 0xFF, true, false);
Meter.Logout();
Thread.Sleep(5000);
Meter.Login();
var SENSUSRADIO_MainAlarmMask = Meter.ReadRegister("SENSUSRADIO_MainAlarmMask");
var SENSUSRADIO_ExtendedAlarmMask = Meter.ReadRegister("SENSUSRADIO_ExtendedAlarmMask");
var SENSUSRADIO_SystemState = Meter.ReadRegister("SENSUSRADIO_SystemState");
if (SENSUSRADIO_SystemState[0] == 0x02 && SENSUSRADIO_MainAlarmMask[0] != 0)
{
base.currentProcessState = ProductionProcessState.Done;
}else
{
}
else
{
Meter.WriteLog("resetRadio Failed");
base.currentProcessState = ProductionProcessState.Error;
}
}
else
{
@@ -149,7 +153,22 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
}
else
{
base.currentProcessState = ProductionProcessState.Done;
Meter.WriteRegister("SENSUSRADIO_SystemState", 0xFF, true, false);
Meter.Logout();
Thread.Sleep(5000);
Meter.Login();
var SENSUSRADIO_MainAlarmMask = Meter.ReadRegister("SENSUSRADIO_MainAlarmMask");
var SENSUSRADIO_ExtendedAlarmMask = Meter.ReadRegister("SENSUSRADIO_ExtendedAlarmMask");
var SENSUSRADIO_SystemState = Meter.ReadRegister("SENSUSRADIO_SystemState");
if (SENSUSRADIO_SystemState[0] == 0x02 && SENSUSRADIO_MainAlarmMask[0] != 0)
{
base.currentProcessState = ProductionProcessState.Done;
}
else
{
Meter.WriteLog("resetRadio Failed");
base.currentProcessState = ProductionProcessState.Error;
}
}
}
@@ -179,11 +198,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
StoreConfigEnable = true
};
var rebootSucceeded = _meterResetPsu.MeterResetPsuExecute();
Thread.Sleep(10000);
Meter.Login();
bool? hasDiffrences = null;
foreach (var item in CheckValuesAufterBoot)
{
@@ -1 +1 @@
81d60b90addc793525740e9993e19bf6665bd401
0d85a5b3a7561b41163c20e5dc7713bcd0d65555
+1 -1
View File
@@ -296,7 +296,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
//
// calibrationResultBindingSource
//
this.calibrationResultBindingSource.DataSource = typeof(Logic.ProductionToProductMapper.Cordonel.CalibrationResult);
//this.calibrationResultBindingSource.DataSource = typeof(Logic.ProductionOrderCore.Cordonel.CalibrationResult);
//
// dgvAdditionalLoginfo
//
+1 -1
View File
@@ -334,7 +334,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
var regdef =
(String)registerGridView.Rows[e.RowIndex].Cells[0].Value;
_currentGenesis.WriteRegister(regdef, array, checkRegister: true);
//_currentGenesis.Logout();
//var funkadresse = new List<byte>();
//funkadresse.AddRange((new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }).ToArray());