This commit is contained in:
Roland Drabesch
2025-07-14 16:29:38 +02:00
13 changed files with 118 additions and 63 deletions
+1 -1
View File
@@ -14,4 +14,4 @@ using System.Reflection;
//[assembly: AssemblyVersion("1.2.*.0")] //[assembly: AssemblyVersion("1.2.*.0")]
[assembly: AssemblyVersion("2.7.1.*")] [assembly: AssemblyVersion("2.7.2.*")]
@@ -716,47 +716,52 @@
}, },
"statictype": "dynamic" "statictype": "dynamic"
}, },
{ {
"type": "uint32_t", "type": "uint32_t",
"privilege": { "privilege": {
"lvl1": "RO", "lvl1": "RO",
"lvl2": "RO", "lvl2": "RO",
"lvl3": "RW", "lvl3": "RW",
"lvl4": "RO", "lvl4": "RO",
"lvl5": "RW", "lvl5": "RW",
"lvl6": "RW", "lvl6": "RW",
"lvl7": "RW", "lvl7": "RW",
"lvl8": "RW" "lvl8": "RW"
},
"description": "Any set bits manually clear the corresponding alarm.",
"version": {
"first": 111,
"last": 164
},
"values": {
"default": 4294967295,
"minimum": 0,
"maximum": 4294967295
},
"statictype": "dynamic",
"production": {
"required": true,
"kitron": false,
"csd": null,
"vako": false,
"operation_calibration": true,
"runtime_ignore": false,
"responsible": [],
"remarks": "Cancel all alarms at the end of production.",
"region": {
"emea": {
"values": {
"default": 4294967295
}
}, },
"description": "Any set bits manually clear the corresponding alarm.", "na": {
"version": { "values": {
"first": 111, "default": 4294967295
"last": 164 }
},
"statictype": "dynamic",
"production": {
"required": true,
"kitron": false,
"csd": null,
"vako": false,
"operation_calibration": true,
"runtime_ignore": false,
"responsible": [],
"remarks": "Cancel all alarms at the end of production.",
"region": {
"emea": {
"values": {
"default": 4294967295
}
},
"na": {
"values": {
"default": 4294967295
}
}
}
} }
}
} }
}
] ]
}, },
"AlarmStatus2": { "AlarmStatus2": {
@@ -75,6 +75,22 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.MockGenesis
new RecoveryRegisterItem("_StoreConfiguration", new Byte[]{0x01}, new Byte[]{0x00}) new RecoveryRegisterItem("_StoreConfiguration", new Byte[]{0x01}, new Byte[]{0x00})
}; };
/// <summary>
/// A list of all known registers to trigger a rest of the input bit.
/// EXAMPLES:
/// - CUSTOMER_TriggerAlarmCancel register value
/// before input 0000 0001 0001 1111
/// new reset input 0000 1111 1111 0000
/// output 0000 0000 0000 1111
///
/// </summary>
private static readonly List<RecoveryRegisterItem> SpecialRegisterResetBits = new List<RecoveryRegisterItem>
{
// (partial) name placeholder for input and output
new RecoveryRegisterItem("CUSTOMER_TriggerAlarmCancel", new Byte[4]),
};
/// <summary> /// <summary>
/// The root path for all mock FwPackaged. /// The root path for all mock FwPackaged.
/// </summary> /// </summary>
@@ -857,9 +873,39 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.MockGenesis
/// <remarks date="2024-Dec-10" author="Thomas Wiedebusch"> /// <remarks date="2024-Dec-10" author="Thomas Wiedebusch">
/// - Initial MockGenesis simulation. /// - Initial MockGenesis simulation.
/// </remarks> /// </remarks>
private static void CheckAndModifySpecialReplies(String regName, Byte[] data) /// <remarks date="2025-Jul-11" author="Thomas Wiedebusch">
/// - Simulation of reset bits.
/// </remarks>
private void CheckAndModifySpecialReplies(String regName, Byte[] data)
{ {
// Reset a bit mask
if (SpecialRegisterResetBits.Any(n => regName.Contains(n.RegisterIdent)))
{
var readValue = ReadRegister(regName);
if (readValue != null)
{
for (var c = 0; c < data.Length; c++)
{
if (c < readValue.Length)
{
data[c] = (Byte)(readValue[c] & (Byte)~data[c]);
}
else
{
data[c] = 0;
}
}
}
else
{
for (var c = 0; c < data.Length; c++)
{
data[c] = 0x00;
}
}
}
// Input value forces a constant reply if the input matches
if (SpecialRegisterReplies.Any(n => regName.Contains(n.RegisterIdent))) if (SpecialRegisterReplies.Any(n => regName.Contains(n.RegisterIdent)))
{ {
foreach (var special in SpecialRegisterReplies.Where(special => foreach (var special in SpecialRegisterReplies.Where(special =>
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.ProductionOrderCore.Csd; using Xylem.Common.Logic.ProductionOrderCore.Csd;
using Xylem.Common.Logic.ProductionOrderCore.Vako; using Xylem.Common.Logic.ProductionOrderCore.Vako;
@@ -158,6 +159,21 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
ident += vakoData.KeyValues.First(k => k.Key == "Nennweite").Charcode; ident += vakoData.KeyValues.First(k => k.Key == "Nennweite").Charcode;
} }
if (!string.IsNullOrWhiteSpace(csdIdent))
{
var csdTokens = csdIdent.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (csdTokens.Length >= 2)
{
var csdNr = csdTokens[1];
if (!string.IsNullOrWhiteSpace(csdNr))
{
csdIdent = csdNr;
}
}
}
var retStr = LocalWebRequest.GetRequest($"http://sla12iis01/csdcore/csdservice/getstampings?CsdIdent={csdIdent}&GroupId=1&ProductIdent={ident}&ProductDn={rawVako.Dn}&ShowOnlyValidStampings=0", 8000); var retStr = LocalWebRequest.GetRequest($"http://sla12iis01/csdcore/csdservice/getstampings?CsdIdent={csdIdent}&GroupId=1&ProductIdent={ident}&ProductDn={rawVako.Dn}&ShowOnlyValidStampings=0", 8000);
var retListRealCsd = JsonConvert.DeserializeObject<List<CsdParameterResult>>(retStr); var retListRealCsd = JsonConvert.DeserializeObject<List<CsdParameterResult>>(retStr);
if (retListRealCsd != null && retListRealCsd.Any()) if (retListRealCsd != null && retListRealCsd.Any())
@@ -30,7 +30,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
{ {
#region ------------------------------------------ Variables -------------------------------------------------- #region ------------------------------------------ Variables --------------------------------------------------
// remind manually changed culture setting // remind manually changed culture setting
private static readonly CultureInfo _cultureInfo = Thread.CurrentThread.CurrentCulture; private static readonly CultureInfo _cultureInfo = CultureInfo.CurrentUICulture;
// user defined control for main screen // user defined control for main screen
protected UserControl UserControl protected UserControl UserControl
@@ -99,6 +99,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
return StatusReturn.Failed; return StatusReturn.Failed;
} }
} }
ActualProcessProgress++;
// Get the time in UTC to program the time for the Cordonel in seconds since 01. Jan 2000 // Get the time in UTC to program the time for the Cordonel in seconds since 01. Jan 2000
// to set the new UTC after reboot // to set the new UTC after reboot
@@ -112,6 +113,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// This is the manufacturing date of the Cordonel // This is the manufacturing date of the Cordonel
retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("IRDA_MfgDate", rawSeconds, retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("IRDA_MfgDate", rawSeconds,
ProgrammingSource.ProgramInternal)); ProgrammingSource.ProgramInternal));
ActualProcessProgress++;
// Reset reboot counter // Reset reboot counter
retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("CUSTOMER_RebootCount", new Byte[] { 0x00 }, retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("CUSTOMER_RebootCount", new Byte[] { 0x00 },
ProgrammingSource.ProgramInternal)); ProgrammingSource.ProgramInternal));
@@ -136,22 +138,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
// Reset periodic log reset counter // Reset periodic log reset counter
retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("PERIODICLOG_ResetCounter", retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("PERIODICLOG_ResetCounter",
new Byte[] { 0x00 }, ProgrammingSource.ProgramInternal)); new Byte[] { 0x00 }, ProgrammingSource.ProgramInternal));
// System state sensus radio to 0xFF for re-initialize
// Reset main and extended alarm mask
retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_MainAlarmMask",
new Byte[] { 0 }, ProgrammingSource.ProgramInternal));
retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_ExtendedAlarmMask",
new Byte[] { 0 }, ProgrammingSource.ProgramInternal));
// System state sensus radio to 0xFF for re-initialize
retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_SystemState", retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_SystemState",
new Byte[] { 0xFF }, ProgrammingSource.ProgramInternal)); new Byte[] { 0xFF }, ProgrammingSource.ProgramInternal));
// Read back alarm masks ActualProcessProgress++;
var mainAlarmMask =
RegisterConverter.ByteArrayToValue<Byte>(Meter.ReadRegister("SENSUSRADIO_MainAlarmMask"));
var extendedAlarmMask =
RegisterConverter.ByteArrayToValue<Byte>(Meter.ReadRegister("SENSUSRADIO_ExtendedAlarmMask"));
var finalRadioSystemState = var finalRadioSystemState =
RegisterConverter.ByteArrayToValue<Byte>(Meter.ReadRegister("SENSUSRADIO_SystemState")); RegisterConverter.ByteArrayToValue<Byte>(Meter.ReadRegister("SENSUSRADIO_SystemState"));
@@ -160,13 +151,12 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
ProgrammingSource.ProgramInternal); ProgrammingSource.ProgramInternal);
retValBol &= WriteRegisterLogAndProcessCtr(sensusRadioResetCtr); retValBol &= WriteRegisterLogAndProcessCtr(sensusRadioResetCtr);
if (!retValBol || mainAlarmMask != 0 || extendedAlarmMask !=0 || finalRadioSystemState != 0x02) if (!retValBol || finalRadioSystemState != 0x02)
{ {
ErrorMsgDispatcher(Resources.StrErrorMsgAlarmReset); ErrorMsgDispatcher(Resources.StrErrorMsgAlarmReset);
EolProgress.RebootDoneChecked = EOLStatus.FAIL; EolProgress.RebootDoneChecked = EOLStatus.FAIL;
return StatusReturn.Failed; return StatusReturn.Failed;
} }
} }
SuccessMsgDispatcher(Resources.StrSuccessMsgAlarmReset); SuccessMsgDispatcher(Resources.StrSuccessMsgAlarmReset);
@@ -56,8 +56,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
// Decide which station Assembly-Line or Shipping-Line (EOL) // Decide which station Assembly-Line or Shipping-Line (EOL)
var strStation = assemblyLine var strStation = assemblyLine
? $"{productionRequirements.RequiredLifeTimeYearsAssembly:F2} %" ? $"{productionRequirements.RequiredLifeTimeYearsAssembly:F2} "
: $"{productionRequirements.RequiredLifeTimeYearsShipping:F2} %"; : $"{productionRequirements.RequiredLifeTimeYearsShipping:F2} ";
// Build message for required versus calculated lifetime // Build message for required versus calculated lifetime
var lifeTime = $"{Resources.StrMsgRemainingLifeTime}: " + var lifeTime = $"{Resources.StrMsgRemainingLifeTime}: " +
// Actual calculated lifetime based on readings from meter // Actual calculated lifetime based on readings from meter
@@ -39,7 +39,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel
#region variables and properties #region variables and properties
private readonly ILogger _logger; private readonly ILogger _logger;
// remind manually changed culture setting // remind manually changed culture setting
private static readonly CultureInfo _cultureInfo = Thread.CurrentThread.CurrentCulture;
private static readonly AssemblyName _assemblyName = Assembly.GetExecutingAssembly().GetName(); private static readonly AssemblyName _assemblyName = Assembly.GetExecutingAssembly().GetName();
private static readonly String _assemblyExecRootPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); private static readonly String _assemblyExecRootPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
private static readonly Version _version = _assemblyName.Version; private static readonly Version _version = _assemblyName.Version;
@@ -726,8 +726,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
dt = dataacces.ExecuteQuery(sb.ToString()); dt = dataacces.ExecuteQuery(sb.ToString());
@@ -1435,7 +1434,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
, MAX(c1.ID) AS CalId1 , MAX(c1.ID) AS CalId1
, MAX(c2.ID) AS CalId2 , MAX(c2.ID) AS CalId2
, MAX(c3.ID) AS CalId3 , MAX(c3.ID) AS CalId3
FROM MapPcbIdToSerialNumber AS _map FROM MapPcbIdToSerialNumber AS _map
LEFT JOIN GenesisMeterRegisterHistory AS c1 LEFT JOIN GenesisMeterRegisterHistory AS c1
ON c1.Address = '0F-0D' ON c1.Address = '0F-0D'
AND c1.Value IS NOT NULL AND c1.Value IS NOT NULL
@@ -2,7 +2,7 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>C:\Users\drabesch_ro\Repo\lab\la_operations\laa_production\Common\Service\MeterProcessState\Properties\PublishProfiles\a.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>a</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />