This commit is contained in:
Thomas Wiedebusch 2022-07-15 09:10:03 +02:00
commit 2f87d186a0
10 changed files with 16938 additions and 16897 deletions

View File

@ -155,7 +155,7 @@
</site>
<site name="MeterProcessState" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\laa_production\Common\Service\MeterProcessState" />
<virtualDirectory path="/" physicalPath="C:\ProgrammeSensus\Repo\Lab\La_Operations\laa_production\Common\Service\MeterProcessState" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:56011:localhost" />

View File

@ -1 +1 @@
1a3d4919c9c702245832d925951f2b7cb72fc333
46bd00889699f5a20a4981a22f62b66368323855

View File

@ -26,9 +26,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
DefEncryptionKey.AddRange((new Byte[] { 0xA0, 0xE1, 0xEF, 0x1C }).ToArray());
DefEncryptionKey.AddRange((new Byte[] { 0x3B, 0x27, 0xA4, 0x9B }).ToArray());
DefEncryptionKey.AddRange((new Byte[] { 0xAC, 0x21, 0x65, 0x35 }).ToArray());
//ret.EncryptionKey = DefEncryptionKey.ToArray();
using (var dataAccess = new SqlDataAccess(connectionString))

View File

@ -47,7 +47,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
UserControl = new UcBarcodeInput();
}
public override UserControl GetControl()
{
if (UserControl == null)

View File

@ -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;

View File

@ -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)
//{

View File

@ -70,6 +70,47 @@ namespace Service.MeterProcessState.Controllers
}
}
/// <summary>
/// Get Radio Configuration from database matching the PcbID
/// </summary>
/// <param name="PcbID">PcbID from Meter</param>
/// <returns></returns>
[Route("GetEncryptionKey"), HttpGet]
public async Task<HttpResponseMessage> GetEncryptionKey(string PcbID)
{
try
{
return await Task.Run(() =>
{
var builder = new StringBuilder();
var ret = OrderProgrammingParameters.GetProgrammingParameters(PcbID, GlobalConfig.connectionString.Value);
var key = ret.FirstOrDefault(r => r.RegisterName == "SENSUSRADIO_EncryptionKey" && r.Source == ProgrammingSource.Csd);
if (key == null)
{
key = ret.FirstOrDefault(r => r.RegisterName == "SENSUSRADIO_EncryptionKey" && r.Source == ProgrammingSource.Vako);
}
foreach (var t in key.RegisterValue)
{
builder.Append(t.ToString("x2"));
}
return Request.CreateResponse(HttpStatusCode.OK, builder.ToString());
});
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
}
/// <summary>
/// Get Radio Configuration from database matching the PcbID
/// </summary>
@ -631,7 +672,7 @@ namespace Service.MeterProcessState.Controllers
else
{
//keien radioparameter für 270 aber 270 ist identisch mit 200 werten
if (dnString == "50" && LengthString == "270")
if (dnString == "50" && (LengthString == "270" || LengthString == "300"))
{
hitAmbi = findMatchingTestResult(ref lastProdDate, "200", dnString, radioTestResult);
}

View File

@ -388,7 +388,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
sbQuery.AppendLine($" ,[Vergabe_am] ");
sbQuery.AppendLine($" ,passwordtbl.KeySetId ");
sbQuery.AppendLine($" ,passwordtbl.orderNumber ");
sbQuery.AppendLine($" ,passwordtbl.Password as Skeleton ");
sbQuery.AppendLine($" ,passwordtbl.KitronSkeletonKey as Skeleton ");
sbQuery.AppendLine($" ,passwordtbl.ProcessorID as ProcessorUid ");
sbQuery.AppendLine($" FROM [Auftrag].[dbo].[Genesis_Meter] meter ");
sbQuery.AppendLine($" inner join MapPcbIdToSerialNumber mps" +

View File

@ -1 +1 @@
f64d563def603c89cafafa61a3219ba97e1e344c
a50e8e35fe346dde3daa1dd9af1217ba2785aa48