finalcheck add
This commit is contained in:
@@ -155,7 +155,7 @@
|
|||||||
</site>
|
</site>
|
||||||
<site name="MeterProcessState" id="2">
|
<site name="MeterProcessState" id="2">
|
||||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||||
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\laa_production\Common\Service\MeterProcessState" />
|
<virtualDirectory path="/" physicalPath="C:\Users\drabesch_ro\Repo\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
|
||||||
</application>
|
</application>
|
||||||
<bindings>
|
<bindings>
|
||||||
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
|
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
|
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
|
||||||
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
|
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
|
||||||
@@ -102,6 +102,9 @@
|
|||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWin32Manifest>true</NoWin32Manifest>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||||
|
|||||||
@@ -48,5 +48,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd
|
|||||||
/// List of passwords.
|
/// List of passwords.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Byte[]> ListOfPasswords = new List<Byte[]>();
|
public List<Byte[]> ListOfPasswords = new List<Byte[]>();
|
||||||
|
/// <summary>
|
||||||
|
/// Ident for password server (BSI) can be radioaddress or pcbid
|
||||||
|
/// </summary>
|
||||||
|
public String PasswordFileIdent { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Ident from password server (BSI)
|
||||||
|
/// </summary>
|
||||||
|
public String KeySetId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//todo: roland umstellen auf localwebrequest
|
||||||
var http = (HttpWebRequest)WebRequest.Create(url + pcbId);
|
var http = (HttpWebRequest)WebRequest.Create(url + pcbId);
|
||||||
var response = (HttpWebResponse)http.GetResponse();
|
var response = (HttpWebResponse)http.GetResponse();
|
||||||
var responseStream = response.GetResponseStream();
|
var responseStream = response.GetResponseStream();
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1a3d4919c9c702245832d925951f2b7cb72fc333
|
5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
Progress = 100;
|
Progress = 100;
|
||||||
NewStatus("Zugang verifiziert");
|
NewStatus("Zugang verifiziert");
|
||||||
currentProcessState = ProductionProcessState.Done;
|
currentProcessState = ProductionProcessState.Done;
|
||||||
|
//RadioFrequencyMhz
|
||||||
asyncProgrammingParametersTask = new Task<IList<ProgrammingParameters>>(() =>
|
asyncProgrammingParametersTask = new Task<IList<ProgrammingParameters>>(() =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
+19
-7
@@ -119,6 +119,16 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SealDisplay",
|
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SealDisplay",
|
||||||
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
|
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
|
||||||
|
|
||||||
|
// keien frq aber radio parameter
|
||||||
|
if (!Meter.RadioFrequencyMhz.HasValue && myJsonResponse.Any(a => a.RegisterName.Contains("radio")))
|
||||||
|
{
|
||||||
|
throw new ApplicationException("Radio inconsistent between meter and programmingparameters");
|
||||||
|
}
|
||||||
|
// eine frequen aber keine radio parameter
|
||||||
|
if (Meter.RadioFrequencyMhz.HasValue && !myJsonResponse.Any(a => a.RegisterName.Contains("radio")))
|
||||||
|
{
|
||||||
|
throw new ApplicationException("Radio inconsistent between meter and programmingparameters");
|
||||||
|
}
|
||||||
foreach (var item in myJsonResponse.Where(m => m.Source == ProgrammingSource.Vako))
|
foreach (var item in myJsonResponse.Where(m => m.Source == ProgrammingSource.Vako))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -171,20 +181,22 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
|
|
||||||
overAllResult.Add(wirteRegisterInBetweenCheck("SYSTEM_CalendarSeconds", Convert.ToInt32(ts.TotalSeconds)));
|
overAllResult.Add(wirteRegisterInBetweenCheck("SYSTEM_CalendarSeconds", Convert.ToInt32(ts.TotalSeconds)));
|
||||||
overAllResult.Add(wirteRegisterInBetweenCheck("IRDA_MfgDate", Convert.ToInt32(ts.TotalSeconds)));
|
overAllResult.Add(wirteRegisterInBetweenCheck("IRDA_MfgDate", Convert.ToInt32(ts.TotalSeconds)));
|
||||||
overAllResult.Add(_currentGenesis_WriteRegister("LOGGER_TriggerLogFlush",
|
|
||||||
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray()));
|
|
||||||
|
|
||||||
overAllResult.Add(_currentGenesis_WriteRegister("NFC_EraseRMA",
|
overAllResult.Add(_currentGenesis_WriteRegister("NFC_EraseRMA",
|
||||||
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray()));
|
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray()));
|
||||||
|
|
||||||
if (hasRadio)
|
if (Meter.RadioFrequencyMhz.HasValue)
|
||||||
{
|
{
|
||||||
|
overAllResult.Add(_currentGenesis_WriteRegister("LOGGER_TriggerLogFlush",
|
||||||
|
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray()));
|
||||||
|
|
||||||
|
|
||||||
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_ResetCounter",
|
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_ResetCounter",
|
||||||
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray()));
|
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray()));
|
||||||
|
|
||||||
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SealDisplay",
|
|
||||||
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray(), true, true));
|
|
||||||
}
|
}
|
||||||
|
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SealDisplay",
|
||||||
|
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray(), true, true));
|
||||||
|
|
||||||
|
|
||||||
var ret = true;
|
var ret = true;
|
||||||
Int32 done = 0;
|
Int32 done = 0;
|
||||||
|
|||||||
+65
-55
@@ -1,4 +1,9 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using ProductionUiCordonel.ProductionProcesses.Enum;
|
||||||
|
using ProductionUiCordonel.UserControls.FinalTest;
|
||||||
|
using SIRTCOM;
|
||||||
|
using System;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
@@ -7,11 +12,6 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using ProductionUiCordonel.ProductionProcesses.Enum;
|
|
||||||
using ProductionUiCordonel.UserControls.FinalTest;
|
|
||||||
using SIRTCOM;
|
|
||||||
using Xylem.Common.CommonCore.Configuration;
|
using Xylem.Common.CommonCore.Configuration;
|
||||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
|
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
|
||||||
@@ -62,12 +62,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
{
|
{
|
||||||
if (SENSUSRADIO_WakeupInterval != null)
|
if (SENSUSRADIO_WakeupInterval != null)
|
||||||
{
|
{
|
||||||
var ret = Meter.WriteRegister("SENSUSRADIO_WakeupInterval", SENSUSRADIO_WakeupInterval,true,true);
|
var ret = Meter.WriteRegister("SENSUSRADIO_WakeupInterval", SENSUSRADIO_WakeupInterval, true, true);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
currentProcessState = ProductionProcessState.Error;
|
currentProcessState = ProductionProcessState.Error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//clear
|
//clear
|
||||||
}
|
}
|
||||||
@@ -78,42 +78,50 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
|
|
||||||
//readout adress, freq,
|
//readout adress, freq,
|
||||||
|
|
||||||
//FrequencyIndicator
|
if (Meter.RadioFrequencyMhz.HasValue)
|
||||||
var freq = RegisterConverter.ConvertTo<UInt32>(Meter.ReadRegister("SENSUSRADIO_FrequencyIndicator"));
|
|
||||||
RadioAdress = RegisterConverter.ConvertTo<UInt32>(Meter.ReadRegister("SENSUSRADIO_RadioAddress"));
|
|
||||||
|
|
||||||
|
|
||||||
Comport = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtComport{freq}"]);
|
|
||||||
var enc = Meter.ReadRegister("SENSUSRADIO_EncryptionKey", 16);
|
|
||||||
|
|
||||||
EncyptionKey = LocalWebRequest.GetRequest($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetEncryptionKey?PcbID={Meter.PcbId}", 80000).ToUpper().Trim('\"');
|
|
||||||
if (!EncyptionKey.Equals(BitConverter.ToString(enc.ToArray()).Replace("-", "")))
|
|
||||||
{
|
{
|
||||||
MessageBox.Show("Funkschlüssel überprüfen!");
|
|
||||||
|
|
||||||
|
var freq = RegisterConverter.ConvertTo<UInt32>(Meter.ReadRegister("SENSUSRADIO_FrequencyIndicator"));
|
||||||
|
RadioAdress = RegisterConverter.ConvertTo<UInt32>(Meter.ReadRegister("SENSUSRADIO_RadioAddress"));
|
||||||
|
|
||||||
|
|
||||||
|
Comport = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtComport{freq}"]);
|
||||||
|
var enc = Meter.ReadRegister("SENSUSRADIO_EncryptionKey", 16);
|
||||||
|
|
||||||
|
EncyptionKey = LocalWebRequest.GetRequest($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetEncryptionKey?PcbID={Meter.PcbId}", 80000).ToUpper().Trim('\"');
|
||||||
|
if (!EncyptionKey.Equals(BitConverter.ToString(enc.ToArray()).Replace("-", "")))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Funkschlüssel überprüfen!");
|
||||||
|
}
|
||||||
|
|
||||||
|
EncyptionKey = BitConverter.ToString(enc.ToArray()).Replace("-", "");
|
||||||
|
|
||||||
|
//if (freq == 868)
|
||||||
|
//{
|
||||||
|
// Comport = 8;
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// Comport = 7;
|
||||||
|
//}
|
||||||
|
BoxNr = Convert.ToByte(ConfigurationManager.AppSettings["SirtBoxNr"]);
|
||||||
|
|
||||||
|
DebugMessage($"Start RadioCheck Comport:{Comport} ,BoxNr:{BoxNr}, freq: {freq}, RadioAddress:{RadioAdress}s\r\n");
|
||||||
|
|
||||||
|
Meter.WriteRegister("SENSUSRADIO_IrDAModulePresent", 1, true, true);
|
||||||
|
|
||||||
|
|
||||||
|
SENSUSRADIO_WakeupInterval = Meter.ReadRegister("SENSUSRADIO_WakeupInterval");
|
||||||
|
Meter.WriteRegister("SENSUSRADIO_WakeupInterval", 0);
|
||||||
|
|
||||||
|
|
||||||
|
GetRssi();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
EncyptionKey = BitConverter.ToString(enc.ToArray()).Replace("-", "");
|
{
|
||||||
|
currentProcessState = ProductionProcessState.Done;
|
||||||
//if (freq == 868)
|
}
|
||||||
//{
|
|
||||||
// Comport = 8;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// Comport = 7;
|
|
||||||
//}
|
|
||||||
BoxNr = Convert.ToByte(ConfigurationManager.AppSettings["SirtBoxNr"]);
|
|
||||||
|
|
||||||
DebugMessage($"Start RadioCheck Comport:{Comport} ,BoxNr:{BoxNr}, freq: {freq}, RadioAddress:{RadioAdress}s\r\n");
|
|
||||||
|
|
||||||
Meter.WriteRegister("SENSUSRADIO_IrDAModulePresent", 1, true, true);
|
|
||||||
|
|
||||||
|
|
||||||
SENSUSRADIO_WakeupInterval = Meter.ReadRegister("SENSUSRADIO_WakeupInterval");
|
|
||||||
Meter.WriteRegister("SENSUSRADIO_WakeupInterval", 0);
|
|
||||||
|
|
||||||
|
|
||||||
GetRssi();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region FormerForm
|
#region FormerForm
|
||||||
@@ -162,7 +170,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
|
|
||||||
DebugMessage("");
|
DebugMessage("");
|
||||||
|
|
||||||
|
|
||||||
saveData = new SaveData();
|
saveData = new SaveData();
|
||||||
|
|
||||||
SetUi();
|
SetUi();
|
||||||
@@ -173,10 +181,10 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
//Meter.WriteRegister("SENSUSRADIO_PowerLevelOption", 59, true, true);
|
//Meter.WriteRegister("SENSUSRADIO_PowerLevelOption", 59, true, true);
|
||||||
//Meter.WriteRegister("SENSUSRADIO_ImpedanceCodeNew", 2992, true, true);
|
//Meter.WriteRegister("SENSUSRADIO_ImpedanceCodeNew", 2992, true, true);
|
||||||
//Meter.WriteRegister("SENSUSRADIO_ImpedanceCodeOption", 2936, true, true);
|
//Meter.WriteRegister("SENSUSRADIO_ImpedanceCodeOption", 2936, true, true);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
await GetRssiMinMaxAsync(BoxNr, Ordernumber);
|
await GetRssiMinMaxAsync(BoxNr, Ordernumber);
|
||||||
SetUi();
|
SetUi();
|
||||||
GetRSSI((Int32)RadioAdress, Comport, EncyptionKey);
|
GetRSSI((Int32)RadioAdress, Comport, EncyptionKey);
|
||||||
@@ -269,10 +277,10 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
RSSI_PAM_Max = 200;
|
RSSI_PAM_Max = 200;
|
||||||
RSSI_SEMI_Min = 100;
|
RSSI_SEMI_Min = 100;
|
||||||
RSSI_SEMI_Max = 200;
|
RSSI_SEMI_Max = 200;
|
||||||
// RSSI_PAM_Min RSSI_PAM_Max RSSI_SEMI_Min RSSI_SEMI_Max
|
// RSSI_PAM_Min RSSI_PAM_Max RSSI_SEMI_Min RSSI_SEMI_Max
|
||||||
//145 164 182
|
//145 164 182
|
||||||
|
|
||||||
// throw new Exception("Fehler in GetRssiMinMax()", ex);
|
// throw new Exception("Fehler in GetRssiMinMax()", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +291,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
RSSI_SEMI = null;
|
RSSI_SEMI = null;
|
||||||
|
|
||||||
stm = new Statemashine();
|
stm = new Statemashine();
|
||||||
|
|
||||||
Byte P81_1 = 0;
|
Byte P81_1 = 0;
|
||||||
|
|
||||||
saveData.RadioAdress = RadioAdress;
|
saveData.RadioAdress = RadioAdress;
|
||||||
@@ -291,7 +299,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
stm.initialise((Byte)ByteCOMPort);
|
stm.initialise((Byte)ByteCOMPort);
|
||||||
Wrapper wrp = new Wrapper();
|
Wrapper wrp = new Wrapper();
|
||||||
stm.StartLoggin("C:\\GenesisLog\\log.txt");
|
stm.StartLoggin("C:\\GenesisLog\\log.txt");
|
||||||
|
|
||||||
// ist wohl nicht nötig da der SIRT richtig konfiguroert ist:
|
// 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);
|
// wrp.ActivateSirt(byte modul1, byte modul2, byte actTimeout, out byte outP12_01, out byte outP12_02);
|
||||||
|
|
||||||
@@ -350,7 +358,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
saveData.RSSI_SEMI = Rssi_Semi_Sirt;
|
saveData.RSSI_SEMI = Rssi_Semi_Sirt;
|
||||||
|
|
||||||
saveData.Result = 1;
|
saveData.Result = 1;
|
||||||
|
|
||||||
if (RSSI_PAM < RSSI_PAM_Min)
|
if (RSSI_PAM < RSSI_PAM_Min)
|
||||||
{
|
{
|
||||||
saveData.Result = 0;
|
saveData.Result = 0;
|
||||||
@@ -405,7 +413,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
Byte[] SEMI_bytes = new Byte[HexbytesSEMI.Length / 2];
|
Byte[] SEMI_bytes = new Byte[HexbytesSEMI.Length / 2];
|
||||||
|
|
||||||
for (Int32 i = 0; i < HexbytesSEMI.Length; i += 2)
|
for (Int32 i = 0; i < HexbytesSEMI.Length; i += 2)
|
||||||
|
{
|
||||||
SEMI_bytes[i / 2] = Convert.ToByte(HexbytesSEMI.Substring(i, 2), 16);
|
SEMI_bytes[i / 2] = Convert.ToByte(HexbytesSEMI.Substring(i, 2), 16);
|
||||||
|
}
|
||||||
|
|
||||||
// SEMI Status
|
// SEMI Status
|
||||||
if (SEMI_bytes[19] == 0)
|
if (SEMI_bytes[19] == 0)
|
||||||
@@ -445,7 +455,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async Task<String> GetResponseAsync(String url)
|
private static async Task<String> GetResponseAsync(String url)
|
||||||
{
|
{
|
||||||
httpclient = new HttpClient();
|
httpclient = new HttpClient();
|
||||||
// 20 Sekunden Timeout
|
// 20 Sekunden Timeout
|
||||||
|
|||||||
+3
-4
@@ -51,10 +51,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
|
|||||||
Meter.SetLcdText(true, new Byte[] { 0x00, 0x00, 0x00, 0x01 });
|
Meter.SetLcdText(true, new Byte[] { 0x00, 0x00, 0x00, 0x01 });
|
||||||
|
|
||||||
Meter.ResetAlarm(GenesisMeter.Alarm.EMPTY_PIPE);//(true, new byte[] { 0x00, 0x00, 0x00, 0x01 });
|
Meter.ResetAlarm(GenesisMeter.Alarm.EMPTY_PIPE);//(true, new byte[] { 0x00, 0x00, 0x00, 0x01 });
|
||||||
if (!hasRadio && Meter.RadioFrequencyMhz.HasValue)
|
|
||||||
{
|
hasRadio = Meter.RadioFrequencyMhz.HasValue;
|
||||||
throw new Exception("Meter radio is incompatible with test");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (hasRadio)
|
if (hasRadio)
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
using System;
|
using Logic.ProductionToProductMapper.Cordonel;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -7,9 +10,6 @@ using System.Net.Http;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using Logic.ProductionToProductMapper.Cordonel;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Xylem.Common.Logic.ProductionOrderCore;
|
using Xylem.Common.Logic.ProductionOrderCore;
|
||||||
using Xylem.Common.Logic.ProductionOrderCore.KitronTestResults;
|
using Xylem.Common.Logic.ProductionOrderCore.KitronTestResults;
|
||||||
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
|
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
|
||||||
@@ -89,7 +89,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
builder.Append(t.ToString("x2"));
|
builder.Append(t.ToString("x2"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Request.CreateResponse(HttpStatusCode.OK, builder.ToString());
|
return Request.CreateResponse(HttpStatusCode.OK, builder.ToString());
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -397,23 +397,11 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
var jsonString = item["JSON"].ToString();
|
var jsonString = item["JSON"].ToString();
|
||||||
|
|
||||||
|
|
||||||
var jResults = JsonConvert.DeserializeObject<JToken>(jsonString);
|
var jResults = JsonConvert.DeserializeObject<JToken>(jsonString);
|
||||||
|
if (DateTimeOffset.TryParse(jResults["JsonObject"]["StartDT"].ToString(), out ret))
|
||||||
|
{
|
||||||
|
return ret;
|
||||||
//foreach (var o in jResults["JsonObject"])
|
}
|
||||||
//{
|
|
||||||
// //o.ToString().Contains("StartDT")
|
|
||||||
// if (o["StartDT"] != null && DateTimeOffset.TryParse(o["StartDT"].ToString(), out ret))
|
|
||||||
// {
|
|
||||||
// return ret;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -575,7 +563,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
sb.AppendLine($" Version, ");
|
sb.AppendLine($" Version, ");
|
||||||
sb.AppendLine($" Deleted ");
|
sb.AppendLine($" Deleted ");
|
||||||
sb.AppendLine($" FROM Cordonel_CurrentFw ");
|
sb.AppendLine($" FROM Cordonel_CurrentFw ");
|
||||||
|
|
||||||
|
|
||||||
sb.AppendLine($" where Deleted is null ");
|
sb.AppendLine($" where Deleted is null ");
|
||||||
sb.AppendLine($" and RadioFrequencyMhz = {FrequencyIndicator} ");
|
sb.AppendLine($" and RadioFrequencyMhz = {FrequencyIndicator} ");
|
||||||
@@ -961,7 +949,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
sb.AppendLine($" SELECT size.[Dn_InternalId], para.DnParameterId, para.ParameterName, para.ParameterValue ");
|
sb.AppendLine($" SELECT distinct size.[Dn_InternalId], para.DnParameterId, para.ParameterName, para.ParameterValue ");
|
||||||
sb.AppendLine($" FROM [Auftrag].[dbo].[CordonelMeterSizes] size ");
|
sb.AppendLine($" FROM [Auftrag].[dbo].[CordonelMeterSizes] size ");
|
||||||
sb.AppendLine($" inner join [Auftrag].[dbo].[CordonelMeterSizesParameter] para on size.Dn_InternalId = para.[Dn_InternalId] ");
|
sb.AppendLine($" inner join [Auftrag].[dbo].[CordonelMeterSizesParameter] para on size.Dn_InternalId = para.[Dn_InternalId] ");
|
||||||
sb.AppendLine($" where size.[Dn_InternalId] = {MeterSize.GetHashCode()} ");
|
sb.AppendLine($" where size.[Dn_InternalId] = {MeterSize.GetHashCode()} ");
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using Xylem.Common.CommonCore.Exceptions.WaterMeter;
|
|||||||
using Xylem.Common.CommonCore.Exceptions.Web;
|
using Xylem.Common.CommonCore.Exceptions.Web;
|
||||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile;
|
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile;
|
||||||
|
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd;
|
||||||
using Xylem.Common.Logic.ServiceCore;
|
using Xylem.Common.Logic.ServiceCore;
|
||||||
using Xylem.Common.Logic.SoftwareAccessHelper;
|
using Xylem.Common.Logic.SoftwareAccessHelper;
|
||||||
|
|
||||||
@@ -136,14 +137,22 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var searchKey = "Flash TestFirmware";
|
||||||
var dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBMETROLOGYTEST_PD] where [ID_PCB] = '{PcbId}' order by ID_TEST desc");
|
var dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBMETROLOGYTEST_PD] where [ID_PCB] = '{PcbId}' order by ID_TEST desc");
|
||||||
|
|
||||||
|
if (!dt.Select().Any())
|
||||||
|
{
|
||||||
|
dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBRADIOTEST_PD] where [ID_PCB] = '{PcbId}' order by ID_TEST desc");
|
||||||
|
searchKey = "Flash Firmware";
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var item in dt.Select())
|
foreach (var item in dt.Select())
|
||||||
{
|
{
|
||||||
var jsonString = item["JSON"].ToString();
|
var jsonString = item["JSON"].ToString();
|
||||||
var o = JsonConvert.DeserializeObject<JObject>(jsonString);
|
var o = JsonConvert.DeserializeObject<JObject>(jsonString);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var pwString = o["JsonObject"]["Flash TestFirmware"].ToString();
|
var pwString = o["JsonObject"][searchKey].ToString();
|
||||||
//FE081F0 E5250E5D084FA024 00 04 80 00 70 03 48 9E
|
//FE081F0 E5250E5D084FA024 00 04 80 00 70 03 48 9E
|
||||||
//0x 0413F059069BEB24
|
//0x 0413F059069BEB24
|
||||||
|
|
||||||
@@ -180,7 +189,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var logon = from p in o["TestStepResults"]["$values"] select p;
|
var logon = from p in o["TestStepResults"]["$values"] select p;
|
||||||
var logonnote = logon.Where(a => a["TestStepName"].ToString() == "Flash TestFirmware").ToList();
|
var logonnote = logon.Where(a => a["TestStepName"].ToString() == "searchKey").ToList();
|
||||||
var list = logonnote.Children().Where(a => ((JProperty)a).Name == "TestValue").First().Values().First();
|
var list = logonnote.Children().Where(a => ((JProperty)a).Name == "TestValue").First().Values().First();
|
||||||
|
|
||||||
|
|
||||||
@@ -401,20 +410,20 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
sbQuery.AppendLine($" where mps.MapPcbIdToSerialNumber_PcbId = '{PcbId}' ");
|
sbQuery.AppendLine($" where mps.MapPcbIdToSerialNumber_PcbId = '{PcbId}' ");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var result = new MeterPwdDb();
|
||||||
var result = new MeterPasswordContainer();
|
|
||||||
|
|
||||||
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||||
{
|
{
|
||||||
var dt = dataAccess.ExecuteQuery(sbQuery.ToString());
|
var dt = dataAccess.ExecuteQuery(sbQuery.ToString());
|
||||||
foreach (var item in dt.Select())
|
foreach (var item in dt.Select())
|
||||||
{
|
{
|
||||||
result.orderNumber = (Int32)item["FertigungsauftragNr"];
|
result.OrderNumber = (Int32)item["FertigungsauftragNr"];
|
||||||
result.radioAdress = (Int64)item["Adresse"];
|
result.RadioAddress = (Int64)item["Adresse"];
|
||||||
result.Skeleton = (String)item["Skeleton"];
|
result.Skeleton = (String)item["Skeleton"];
|
||||||
result.Password = (String)item["Password"];
|
result.Password = (String)item["Password"];
|
||||||
result.PasswordFileIdent = result.radioAdress.HasValue ? result.radioAdress.Value.ToString() : PcbId;
|
result.PasswordFileIdent = result.RadioAddress.HasValue ? result.RadioAddress.Value.ToString() : PcbId;
|
||||||
if (item["KeySetId"].GetType() != typeof(System.DBNull))
|
if (item["KeySetId"].GetType() != typeof(System.DBNull))
|
||||||
{
|
{
|
||||||
result.KeySetId = (String)item["KeySetId"];
|
result.KeySetId = (String)item["KeySetId"];
|
||||||
@@ -424,7 +433,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.orderNumber.HasValue)
|
if (!result.OrderNumber.HasValue)
|
||||||
{
|
{
|
||||||
return Request.CreateResponse(HttpStatusCode.InternalServerError, new PcbIdNotException(new Guid("160B4C44-6EF7-41DC-A48D-4B4105B4779B")));
|
return Request.CreateResponse(HttpStatusCode.InternalServerError, new PcbIdNotException(new Guid("160B4C44-6EF7-41DC-A48D-4B4105B4779B")));
|
||||||
}
|
}
|
||||||
@@ -439,15 +448,15 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
{
|
{
|
||||||
result.KeySetId = CreateKeySet(Request.Headers.GetValues("X-Node-Token").First(), 7);
|
result.KeySetId = CreateKeySet(Request.Headers.GetValues("X-Node-Token").First(), 7);
|
||||||
//mapp keyset
|
//mapp keyset
|
||||||
MapKeySet(Request.Headers.GetValues("X-Node-Token").First(), result.KeySetId, result.orderNumber.Value, result.PasswordFileIdent);
|
MapKeySet(Request.Headers.GetValues("X-Node-Token").First(), result.KeySetId, result.OrderNumber.Value, result.PasswordFileIdent);
|
||||||
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||||
{
|
{
|
||||||
var dt = dataAccess.ExecuteQuery(
|
var dt = dataAccess.ExecuteQuery(
|
||||||
$"update auftrag.[dbo].[Genesis_PcbPassword] set KeySetId = '{result.KeySetId}', [orderNumber] = {result.orderNumber.Value}, [radioAdress] = {result.PasswordFileIdent} where PcbId = '{PcbId}'; select * from auftrag.[dbo].[Genesis_PcbPassword] where PcbId = '{PcbId}'");
|
$"update auftrag.[dbo].[Genesis_PcbPassword] set KeySetId = '{result.KeySetId}', [orderNumber] = {result.OrderNumber.Value}, [radioAdress] = {result.PasswordFileIdent} where PcbId = '{PcbId}'; select * from auftrag.[dbo].[Genesis_PcbPassword] where PcbId = '{PcbId}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var passwords = getKeys(Request.Headers.GetValues("X-Node-Token").First(), result.orderNumber.Value.ToString(), result.PasswordFileIdent);
|
var passwords = getKeys(Request.Headers.GetValues("X-Node-Token").First(), result.OrderNumber.Value.ToString(), result.PasswordFileIdent);
|
||||||
//pw lvl
|
//pw lvl
|
||||||
passwords.Keys.Insert(2, new Key() { Index = 2, KeyKey = result.Skeleton });
|
passwords.Keys.Insert(2, new Key() { Index = 2, KeyKey = result.Skeleton });
|
||||||
|
|
||||||
@@ -466,11 +475,11 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|||||||
{
|
{
|
||||||
rawKey = rawKey.Substring(0, 12);
|
rawKey = rawKey.Substring(0, 12);
|
||||||
}
|
}
|
||||||
if (result.listOfPasswords.Count <= 7)
|
if (result.ListOfPasswords.Count <= 7)
|
||||||
{
|
{
|
||||||
result.listOfPasswords.Add(Encoding.UTF8.GetBytes(rawKey));
|
result.ListOfPasswords.Add(Encoding.UTF8.GetBytes(rawKey));
|
||||||
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(rawKey));
|
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(rawKey));
|
||||||
result.listOfHashes.Add(hash);
|
result.ListOfHashes.Add(hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -385,6 +385,10 @@
|
|||||||
<Project>{2C6378C6-6BA1-4CEE-8992-8404D8369A90}</Project>
|
<Project>{2C6378C6-6BA1-4CEE-8992-8404D8369A90}</Project>
|
||||||
<Name>GenesisFile</Name>
|
<Name>GenesisFile</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\Hardware\WaterMeter\Genesis\GenesisPwd\GenesisPwd.csproj">
|
||||||
|
<Project>{AC434B18-4D7B-49BA-9AD5-0527C79E8297}</Project>
|
||||||
|
<Name>GenesisPwd</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Hardware\WaterMeter\WaterMeterCore\WaterMeterCore.csproj">
|
<ProjectReference Include="..\..\Hardware\WaterMeter\WaterMeterCore\WaterMeterCore.csproj">
|
||||||
<Project>{8203ABB8-38E5-472E-A742-33F38B7A74A6}</Project>
|
<Project>{8203ABB8-38E5-472E-A742-33F38B7A74A6}</Project>
|
||||||
<Name>WaterMeterCore</Name>
|
<Name>WaterMeterCore</Name>
|
||||||
|
|||||||
@@ -210,10 +210,14 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
case BatchState.BatchIsReady:
|
case BatchState.BatchIsReady:
|
||||||
break;
|
break;
|
||||||
case BatchState.AddMeters:
|
case BatchState.AddMeters:
|
||||||
_currentState = AddAllMeters_Internal() ? BatchState.PrepareMeters : BatchState.Error;
|
|
||||||
|
var tAddMeters = Task<Boolean>.Factory.StartNew(() => { return AddAllMeters_Internal(); });
|
||||||
|
tAddMeters.ContinueWith(r => { _currentState = r.Result ? BatchState.PrepareMeters : BatchState.Error; });
|
||||||
break;
|
break;
|
||||||
case BatchState.PrepareMeters:
|
case BatchState.PrepareMeters:
|
||||||
_currentState = PrepareMeters_Internal() ? BatchState.MetersPrepared : BatchState.Error;
|
var tPrepareMeters = Task<Boolean>.Factory.StartNew(() => { return PrepareMeters_Internal(); });
|
||||||
|
tPrepareMeters.ContinueWith(r => { _currentState = r.Result ? BatchState.MetersPrepared : BatchState.Error; });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case BatchState.MetersPrepared:
|
case BatchState.MetersPrepared:
|
||||||
//Wait For Caller when every thing is setup
|
//Wait For Caller when every thing is setup
|
||||||
@@ -222,15 +226,17 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
//Wait for caller to start Measurement
|
//Wait for caller to start Measurement
|
||||||
break;
|
break;
|
||||||
case BatchState.StartMesurement:
|
case BatchState.StartMesurement:
|
||||||
_currentState = StartMeasurement_Internal() ? BatchState.MeasurementActive : BatchState.Error;
|
var tStartMesurement = Task<Boolean>.Factory.StartNew(() => { return StartMeasurement_Internal(); });
|
||||||
|
tStartMesurement.ContinueWith(r => { _currentState = r.Result ? BatchState.MeasurementActive : BatchState.Error; });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BatchState.MeasurementActive:
|
case BatchState.MeasurementActive:
|
||||||
// wait for signal that the measurement can be stopped
|
// wait for signal that the measurement can be stopped
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BatchState.StopMesurement:
|
case BatchState.StopMesurement:
|
||||||
_currentState = StopMeasurement_Internal() ? BatchState.MeasurementCompleted : BatchState.Error;
|
var tStopMesurement = Task<Boolean>.Factory.StartNew(() => { return StopMeasurement_Internal(); });
|
||||||
|
tStopMesurement.ContinueWith(r => { _currentState = r.Result ? BatchState.MeasurementCompleted : BatchState.Error; });
|
||||||
break;
|
break;
|
||||||
case BatchState.MeasurementCompleted:
|
case BatchState.MeasurementCompleted:
|
||||||
//Measurement waiting for caller to grab all the results
|
//Measurement waiting for caller to grab all the results
|
||||||
|
|||||||
Reference in New Issue
Block a user