radio param change

This commit is contained in:
Roland Drabesch
2022-07-13 17:39:04 +02:00
parent 91ae00f85c
commit 5de78cb4b1
8 changed files with 16936 additions and 16895 deletions
@@ -47,7 +47,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
UserControl = new UcBarcodeInput();
}
public override UserControl GetControl()
{
if (UserControl == null)
@@ -87,7 +87,13 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
}
updateImage(UserControl.WriteToMeter, ret);
base.Progress = base.Progress + 16;
//Check if new password is in the meter ... even the file wirte wasnt succesfull
if (!ret)
{
Meter.Logout();
ret = Meter.Login(Encoding.UTF8.GetString(pwContainer.listOfPasswords.Last()));
}
if (ret)
{
ret = UpdatePasswordinDb();
@@ -177,16 +183,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var newPs = Encoding.UTF8.GetString(pwContainer.listOfPasswords.Last());
var passwordSetServiceUrl = ServiceUrls.GenesisSetPasswordServiceUrl();
var http = (HttpWebRequest)WebRequest.Create(passwordSetServiceUrl + Meter.PcbId + "&Password=" + newPs + "&keepOldPw=true");
var response = (HttpWebResponse)http.GetResponse();
var responseStream = response.GetResponseStream();
if (responseStream == null)
{
return false;
}
var sr = new StreamReader(responseStream);
var responseJson = sr.ReadToEnd();
var responseJson = LocalWebRequest.GetRequest(passwordSetServiceUrl + Meter.PcbId + "&Password=" + newPs + "&keepOldPw=true", 8000);
if (responseJson.ToLower().Contains("store"))
{
return true;
@@ -17,6 +17,7 @@ using System.Configuration;
using System.Net.Http;
using System.Windows.Threading;
using Newtonsoft.Json.Linq;
using Xylem.Common.Logic.SoftwareAccessHelper;
namespace ProductionUiCordonel.ProductionProcesses.Actions
{
@@ -76,20 +77,22 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
//readout adress, freq,
//FrequencyIndicator
var freq = RegisterConverter.ConvertTo<UInt32>(Meter.ReadRegister("SENSUSRADIO_FrequencyIndicator"));
RadioAdress = RegisterConverter.ConvertTo<UInt32>(Meter.ReadRegister("SENSUSRADIO_RadioAddress"));
Comport = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtComport{freq}"]);
//0B012188037ADDBD043CCE7018375AE9
var enc = Meter.ReadRegister("SENSUSRADIO_EncryptionKey", 16);
EncyptionKey = BitConverter.ToString(enc).Replace("-", "");
EncyptionKey = LocalWebRequest.GetRequest($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetEncryptionKey?PcbID={Meter.PcbId}", 80000).ToUpper().Trim('\"');
if (!EncyptionKey.Equals(BitConverter.ToString(enc.ToArray()).Replace("-", "")))
{
System.Windows.Forms.MessageBox.Show("Funkschlüssel überprüfen!");
}
//if (freq == 868)
//{