Picking Model with inventory check

This commit is contained in:
Roland Drabesch 2026-01-27 12:21:20 +01:00
parent acf631ac5d
commit 7f3dd958eb
7 changed files with 100 additions and 56 deletions

View File

@ -198,6 +198,11 @@ namespace Xylem.Common.CommonCore.Configuration
public static readonly String PressureSensorTestURL_PostTestResults
= $"{ServerDns}/MeterProcessState/api/CordonelPressureSensorTest/PostTestResults";
public static readonly String PickingURL_GetPcbInfoPicking
= $"{ServerDns}/MeterProcessState/api/LuController/GetPcbInfoPicking?PcbId=";
/// <summary>
/// usage: string.Format(CordonelPressureSensorTestURL_GetTestResults, pcbId);
/// </summary>

View File

@ -554,6 +554,16 @@ namespace CordonelAssemblyLine.Model
}
public class PickingInfo
{
public string Error { get; set; }
public string Warning { get; set; }
public string Info { get; set; }
}
public Boolean Compare(Dictionary<UInt32, UInt32> checkAppsIdVersion, UInt32 frequency, UInt32 meterSize, Boolean pressurePresent)
{
using (var batch = new MeterBatch())
@ -566,6 +576,8 @@ namespace CordonelAssemblyLine.Model
if (meter.Login())
{
meter.SetProcessState(DisplayCodes.PickingStarted);
var ret = RunCheck(checkAppsIdVersion, frequency, meterSize, pressurePresent, meter);
lblS08Color = _progressWaiting;
@ -1134,6 +1146,8 @@ namespace CordonelAssemblyLine.Model
// _pcbId = "221520009";
_pcbId = tryMeter.GetPcbId();
var hasDetect = !string.IsNullOrEmpty(_pcbId);
if (hasDetect)
@ -1141,6 +1155,24 @@ namespace CordonelAssemblyLine.Model
SetState($"Pcb gefunden {_pcbId}");
Log($"New PcbID detected {_pcbId}");
var retWanring = LocalWebRequest.GetRequest(ServiceUrls.PickingURL_GetPcbInfoPicking + _pcbId, 4000);
var PickingINfo = JsonConvert.DeserializeObject<PickingInfo>(retWanring);
if (!String.IsNullOrEmpty(PickingINfo.Error))
{
lblS08Text = PickingINfo.Error;
lblS08Color = _progressError;
MessageBox.Show(PickingINfo.Error);
_state = PickingStateMachine.MeterError;
}
if (!String.IsNullOrEmpty(PickingINfo.Warning))
{
SetState(PickingINfo.Warning);
}
try
{
for (var i = 0; i < 3; i++)

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
<OutputType>Library</OutputType>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
@ -149,6 +149,9 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>

View File

@ -32,11 +32,12 @@ namespace Xylem.Common.Ui.CordonelPreadjustmentUi.Parameters
DurationS = 120;
break;
case MeterSize.DN100:
case MeterSize.DN125:
case MeterSize.US4:
FlowrateQmH = 140;
DurationS = 120;
break;
case MeterSize.DN125:
case MeterSize.US6:
FlowrateQmH = 400;
DurationS = 60;

@ -1 +1 @@
Subproject commit a9ef9051cabb74806a4ce0293794cf95756883e6
Subproject commit df99a43005ea24a5ebc95ee451cf3f67cc8ad94d

View File

@ -190,65 +190,68 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
if (radioParams.RadioAddress != 0)
if (orderNr != 3249279)
{
if (vakoData.KeyValues.Any(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL")))
if (radioParams.RadioAddress != 0)
{
var KeyInfo = vakoData.KeyValues.FirstOrDefault(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL"));
var keyList = ret.FindAll(f => f.RegisterName == "SENSUSRADIO_EncryptionKey");
var heightstKey = keyList.OrderByDescending(o => o.Source).First(); //desc
var defEncryptionKey = new List<Byte>();
defEncryptionKey.AddRange(new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }.ToArray());
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());
switch (KeyInfo.Charcode)
if (vakoData.KeyValues.Any(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL")))
{
//1 Standard
case "1":
if (ByteStyler.ToString(heightstKey.RegisterValue) != ByteStyler.ToString(defEncryptionKey.ToArray()))
{
throw new ApplicationException("Order placed with default encryption, but the datasource has a diffrent key");
}
var KeyInfo = vakoData.KeyValues.FirstOrDefault(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL"));
var keyList = ret.FindAll(f => f.RegisterName == "SENSUSRADIO_EncryptionKey");
var heightstKey = keyList.OrderByDescending(o => o.Source).First(); //desc
break;
//2 Zufallszahl
case "2":
//notdef
if (ByteStyler.ToString(heightstKey.RegisterValue) == ByteStyler.ToString(defEncryptionKey.ToArray()))
{
throw new ApplicationException("Order placed with radom encryption, but the datasource has a default key");
}
//not csd
else if (heightstKey.Source == ProgrammingSource.Csd)
{
throw new ApplicationException("Order placed with radom encryption, but the datasource has a customer key");
}
break;
//3 nach CSD
case "3":
if (heightstKey.Source != ProgrammingSource.Csd)
{
throw new ApplicationException("Order placed with Customer encryption but the datasource has no Customer key");
}
break;
default:
throw new ApplicationException("No Vako Key for Radiokey found, unkown parameter");
var defEncryptionKey = new List<Byte>();
defEncryptionKey.AddRange(new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }.ToArray());
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());
switch (KeyInfo.Charcode)
{
//1 Standard
case "1":
if (ByteStyler.ToString(heightstKey.RegisterValue) != ByteStyler.ToString(defEncryptionKey.ToArray()))
{
throw new ApplicationException("Order placed with default encryption, but the datasource has a diffrent key");
}
break;
//2 Zufallszahl
case "2":
//notdef
if (ByteStyler.ToString(heightstKey.RegisterValue) == ByteStyler.ToString(defEncryptionKey.ToArray()))
{
throw new ApplicationException("Order placed with radom encryption, but the datasource has a default key");
}
//not csd
else if (heightstKey.Source == ProgrammingSource.Csd)
{
throw new ApplicationException("Order placed with radom encryption, but the datasource has a customer key");
}
break;
//3 nach CSD
case "3":
if (heightstKey.Source != ProgrammingSource.Csd)
{
throw new ApplicationException("Order placed with Customer encryption but the datasource has no Customer key");
}
break;
default:
throw new ApplicationException("No Vako Key for Radiokey found, unkown parameter");
}
}
else
{
throw new ApplicationException("No Vako Key for Radiokey found");
}
}
else
{
throw new ApplicationException("No Vako Key for Radiokey found");
}
}
StringBuilder csv = new StringBuilder();
foreach (var item in ret)

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState\Properties\PublishProfiles\IISProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState\Properties\PublishProfiles\a.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />