diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs
index 5afad7c5..5c0b46ae 100644
--- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs
+++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs
@@ -236,7 +236,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
///
public String MeterLength {
- protected set;
+ set;
get;
} = "?";
diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/IGenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/IGenesisMeter.cs
index ef4a2715..f5563c77 100644
--- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/IGenesisMeter.cs
+++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/IGenesisMeter.cs
@@ -97,10 +97,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
///
/// Length of the meter.
///
- String MeterLength
- {
- get;
- }
+ String MeterLength { get; set; }
///
/// Pressure sensor assembled to meter.
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs
index f923459e..3f203e66 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs
@@ -28,7 +28,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
///
/// Maximum of expected processing steps for this process to feed the GUI progress bar.
///
- private const Int32 MaxActualProgressSteps = 22;
+ private const Int32 MaxActualProgressSteps = 23;
///
/// Successfully test on flow test bench will return this const value.
@@ -120,13 +120,13 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
ActualProcessProgress++;
// Get clustered FileId of firmware package for production or on special requirement release candidates
- var isSpecialActive = ProductionRequirements.IsSpecialActive != null &&
+ var isSpecialActive = ProductionRequirements.IsSpecialActive != null &&
(Boolean)ProductionRequirements.IsSpecialActive &&
- ProductionRequirements.IsSpecialApproved != null &&
+ ProductionRequirements.IsSpecialApproved != null &&
(Boolean)ProductionRequirements.IsSpecialApproved;
if (string.IsNullOrEmpty(ProductionRequirements.FwVersion) ||
- !MeterFwUpdate.SearchProdFwInDb(ProductionRequirements.FwVersion, out var parentFileId, out error,
+ !MeterFwUpdate.SearchProdFwInDb(ProductionRequirements.FwVersion, out var parentFileId, out error,
!isSpecialActive) || parentFileId == null)
{
Meter.WriteLog(error);
@@ -167,9 +167,22 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// Exit if meanwhile cancellation is required
if (CancellationToken.IsCancellationRequested)
return CancellationProcedure();
-
+
ActualProcessProgress++;
+ // Get the meter length from VAKO needed for radio parameter message
+ if (!GenericChecks.GetMeterLengthFromDb(Meter))
+ {
+ // Meter size unknown
+ ErrorMsgDispatcher(Resources.StrErrorMsgMeterLengthUnknown);
+ return StatusReturn.Failed;
+ }
+
+ // Exit if meanwhile cancellation is required
+ if (CancellationToken.IsCancellationRequested)
+ return CancellationProcedure();
+
+ ActualProcessProgress++;
// Check if requirement will force skipping of calibration
if (!ProductionRequirements.SkipCalibration)
{
@@ -185,7 +198,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// Exit if meanwhile cancellation is required
if (CancellationToken.IsCancellationRequested)
return CancellationProcedure();
-
+
ActualProcessProgress++;
// Get the pre- and final flow test state.
@@ -201,7 +214,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// Exit if meanwhile cancellation is required
if (CancellationToken.IsCancellationRequested)
return CancellationProcedure();
-
+
ActualProcessProgress++;
// Fill the results to calibration check register restorer which will be used to read the actual
@@ -250,6 +263,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
CalibCheckRegisterRestorer.OnProcessUpdate -= ProcessUpdate_Handler;
}// Not Skip calibration loop
+ ActualProcessProgress++;
+
return StatusReturn.Okay;
}
@@ -545,17 +560,17 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
erroneousSequenceStep = true;
}
#endregion -------------------------------- Check Calibration Values --------------------------------------
-
+
#region ----------------------------------- Summarize Check Results ---------------------------------------
-
+
// One or more checks failed
if (erroneousSequenceStep)
return StatusReturn.Failed;
-
+
// One or more checks generated a warning
if (warningSequenceStep)
return StatusReturn.Skipped;
-
+
// Here everything went fine
SuccessMsgDispatcher(feedbackMsg);
@@ -674,11 +689,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
EolProgress.SpecialRequirementId = ProductionRequirements.SpecialId;
EolProgress.SpecialRequirementVersion = ProductionRequirements.SpecialVersion;
- feedbackMsg = isSpecialActive &&
- ProductionRequirements.SpecialId != null &&
- ProductionRequirements.SpecialVersion != null ?
- Resources.StrWarningMsgSpecialRequirementActive +
- $" Id.Ver: {ProductionRequirements.SpecialId}.{ProductionRequirements.SpecialVersion}" :
+ feedbackMsg = isSpecialActive &&
+ ProductionRequirements.SpecialId != null &&
+ ProductionRequirements.SpecialVersion != null ?
+ Resources.StrWarningMsgSpecialRequirementActive +
+ $" Id.Ver: {ProductionRequirements.SpecialId}.{ProductionRequirements.SpecialVersion}" :
Resources.StrSuccessMsgRequirementActive +
$" Id.Ver {ProductionRequirements.StandardId}.{ProductionRequirements.StandardVersion}";
@@ -915,7 +930,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
///
private String CheckFwAndApps(out String feedbackMsg)
{
- var fwCheckMsg = GenericChecks.CheckFwAndApps(Meter, ProductionRequirements, FwUpdatePackage,
+ var fwCheckMsg = GenericChecks.CheckFwAndApps(Meter, ProductionRequirements, FwUpdatePackage,
out feedbackMsg);
// Fill the EOL progress
@@ -1322,7 +1337,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// Allow overwriting of calibration successfully checked to okay
if (EolProgress.ProductionStatusCalibrationChecked == null)
EolProgress.ProductionStatusCalibrationChecked = EOLStatus.OK;
-
+
// Stop logging
CalibCheckRegisterRestorer.OnProcessUpdate -= ProcessUpdate_Handler;
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/GenericModules/GenericChecks.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/GenericModules/GenericChecks.cs
index 45f4a449..37a1a667 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/GenericModules/GenericChecks.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/GenericModules/GenericChecks.cs
@@ -3,11 +3,15 @@ using Logic.ProductionToProductMapper.Files.Fw;
using System;
using System.Collections.Generic;
using System.Linq;
+using Newtonsoft.Json;
+using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications;
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Const;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile;
+using Xylem.Common.Logic.ProductionOrderCore.Vako;
+using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.Common.Production.ProductionUiCordonel.Properties;
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.GenericModules
@@ -28,7 +32,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
///
/// - Import from CheckProductionState for common use.
///
- public static StatusReturn CheckKitronRadioSignalLevels(IGenesisMeter meter, RegisterRestorer registerRestorer,
+ public static StatusReturn CheckKitronRadioSignalLevels(IGenesisMeter meter, RegisterRestorer registerRestorer,
Boolean skipRadioCheck, out String feedbackMsg)
{
feedbackMsg = "";
@@ -38,26 +42,26 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
{
return StatusReturn.Failed;
}
+
// The NA region has no radio or radio check should be ignored
if (meter.Region.Equals("NA") || skipRadioCheck)
{
return StatusReturn.Skipped;
}
-
+ var pressureSensorAssembled =
+ meter.PressureSensorAssembled ? $", {Resources.StrLblPressureSensorAssembledTxt}" : "";
+ var meterInfo = $"{Resources.StrLblRadioFrequencyTxt}: {meter.RadioFrequencyMhz} MHz," +
+ $"{Resources.StrLblMeterSizeTxt}: {meter.MeterSize}, " +
+ $"{Resources.StrLblMeterLengthTxt}: {meter.MeterLength} mm" +
+ $"{pressureSensorAssembled}";
// On unknown radio signal level parameters from Kitron those are not in the list of the programming parameters
if (!registerRestorer.RecoveryRegisters.Any(x => x.RegisterIdent.Equals("SENSUSRADIO_PowerLevel")))
{
- var pressureSensorAssembled = meter.PressureSensorAssembled ?
- $", {Resources.StrLblPressureSensorAssembledTxt}":
- "";
- feedbackMsg = $"{Resources.StrErrorMsgRadioSignalLevels} " +
- $"{Resources.StrLblRadioFrequencyTxt}: {meter.RadioFrequencyMhz} MHz," +
- $"{Resources.StrLblMeterSizeTxt}: {meter.MeterSize}, " +
- $"{Resources.StrLblMeterLengthTxt}: {meter.MeterLength} mm" +
- $"{pressureSensorAssembled}";
- return StatusReturn.Failed;
+ feedbackMsg = Resources.StrErrorMsgRadioSignalLevels + " " + meterInfo;
+ return StatusReturn.Failed;
}
- feedbackMsg = Resources.StrSuccessMsgRadioSignalLevels;
+
+ feedbackMsg = Resources.StrSuccessMsgRadioSignalLevels + ". " + meterInfo;
return StatusReturn.Okay;
}
@@ -82,7 +86,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
///
/// - Import from CheckProductionState for common use.
///
- public static String CheckFwAndApps(IGenesisMeter meter, CordonelRequirements requirements,
+ public static String CheckFwAndApps(IGenesisMeter meter, CordonelRequirements requirements,
List fwUpdatePackage, out String feedbackMsg)
{
feedbackMsg = "";
@@ -134,7 +138,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
// ABC (application binary container)
fwUpdate.CompareAllMeterAndFileApps();
- if (// Validate package description file with required Apps (fileApps) and build the CORE REVISIONS MIN MAX
+ if ( // Validate package description file with required Apps (fileApps) and build the CORE REVISIONS MIN MAX
!fwUpdate.ValidateFileAppsWithPackageFile() ||
// Check if any meter Apps is outdated or does contain an un-matching CRC
meter.MeterAppListVersion.Any(app => app.Status != MeterAppState.MeterAppUpToDate &&
@@ -158,8 +162,44 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
feedbackMsg += $"{Resources.StrErrorMsgRequirementFw}\n";
return "";
}
+
feedbackMsg = $"{Resources.StrSuccessMsgRequirementFw} - Firmware: {meter.FwVersion}";
return meter.FwVersion;
}
+
+ ///
+ /// Get the meter length form database as single VAKO parameter
+ ///
+ ///
+ ///
+ ///
+ /// - Initial.
+ ///
+ public static Boolean GetMeterLengthFromDb(IGenesisMeter meter)
+ {
+ if (meter == null)
+ return false;
+ try
+ {
+ var a = LocalWebRequest.GetRequest(
+ $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetSingleVakoKey?ProductionOrderNumber=" +
+ $"{meter.OrderNumber}&KeyName=C_GEN_BAULAENGE");
+ var response = JsonConvert.DeserializeObject(a);
+
+ if (response == null || string.IsNullOrEmpty(response.Value))
+ {
+ // Meter size unknown
+ return false;
+ }
+
+ meter.MeterLength = response.Value;
+ return true;
+ }
+ catch (Exception)
+ {
+ // Meter size unknown
+ return false;
+ }
+ }
}
}
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckProductionState.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckProductionState.cs
index 1373ced7..7e4efa18 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckProductionState.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckProductionState.cs
@@ -21,7 +21,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Picki
///
/// Maximum of expected processing steps for this process to feed the GUI progress bar.
///
- private const Int32 MaxActualProgressSteps = 13;
+ private const Int32 MaxActualProgressSteps = 14;
///
/// FW update package containing the ABC and the ADF.
@@ -122,6 +122,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Picki
ActualProcessProgress++;
+ // Get the meter length from VAKO needed for radio parameter message
+ if (!GenericChecks.GetMeterLengthFromDb(Meter))
+ {
+ // Meter size unknown
+ ErrorMsgDispatcher(Resources.StrErrorMsgMeterLengthUnknown);
+ return StatusReturn.Failed;
+ }
+ ActualProcessProgress++;
+
return StatusReturn.Okay;
}
diff --git a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml
index fe88c0f9..ddf06466 100644
--- a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml
+++ b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml
@@ -112,6 +112,7 @@
+
@@ -120,6 +121,7 @@
+
diff --git a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs
index 5cd7cd67..c13c8393 100644
--- a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs
@@ -106,6 +106,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblRadioAddressText, Properties.Resources.StrLblRadioAddressTxt + ":");
UpdateContentControl(lblOrderNumberText, Properties.Resources.StrLblOrderNumberTxt + ":");
UpdateContentControl(lblMeterSizeText, Properties.Resources.StrLblMeterSizeTxt + ":");
+ UpdateContentControl(lblMeterLengthText, Properties.Resources.StrLblMeterLengthTxt + ":");
UpdateContentControl(lblSingleProcessText, Properties.Resources.StrLblSingleProcessText + ":");
UpdateContentControl(lblTotalProcessText, Properties.Resources.StrLblTotalProcessText + ":");
optionsMenu.Header = Properties.Resources.StrMenuOptionsText;
@@ -729,6 +730,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblMeterSizeValue,
!string.IsNullOrEmpty(genesisMeter.MeterSize) ? genesisMeter.MeterSize : "?");
+ UpdateContentControl(lblMeterLengthValue,
+ !string.IsNullOrEmpty(genesisMeter.MeterLength) ? genesisMeter.MeterLength + " mm": "?");
+
UpdateContentControl(lblLutValue,
!string.IsNullOrEmpty(genesisMeter.LutCrc) ? genesisMeter.LutCrc : "?");
@@ -821,6 +825,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblRadioAddressText, "");
UpdateContentControl(lblFwValue, "?");
UpdateContentControl(lblMeterSizeValue, "?");
+ UpdateContentControl(lblMeterLengthValue, "?");
UpdateContentControl(lblLutValue, "?");
UpdateContentControl(lblSerialNumberValue, "?");
UpdateContentControl(lblRegionValue, "?");
diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs
index a7a199bc..bdcdc71b 100644
--- a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs
+++ b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs
@@ -519,6 +519,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to ERROR: Cordonel length is unknown.
+ ///
+ internal static string StrErrorMsgMeterLengthUnknown {
+ get {
+ return ResourceManager.GetString("StrErrorMsgMeterLengthUnknown", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Communication port is in use or not present. The software is going to exit!.
///
diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx
index 7c87569e..df8a4eb6 100644
--- a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx
+++ b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx
@@ -366,6 +366,9 @@
FEHLER: Restlaufzeitberechnung fehlgeschlagen
+
+
+ FEHLER: Cordonel Baulänge ist unbekannt
FEHLER: Versandfertigmachen fehlgeschlagen
diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.resx
index 07bb7245..72d2b95f 100644
--- a/Common/Production/ProductionUiCordonel/Properties/Resources.resx
+++ b/Common/Production/ProductionUiCordonel/Properties/Resources.resx
@@ -364,9 +364,12 @@
ERROR: Remaining lifetime too short
-
+
ERROR: Lifetime calculation failed
+
+ ERROR: Cordonel length is unknown
+
ERROR: Preparation for shipping failed