Change implementage of skip checks

This commit is contained in:
Roland Drabesch
2023-04-14 13:37:18 +02:00
parent 3942932f22
commit 8c634357a0
16 changed files with 205 additions and 106 deletions
@@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid> <ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace> <RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName> <AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
@@ -102,9 +102,7 @@
<PropertyGroup /> <PropertyGroup />
<PropertyGroup /> <PropertyGroup />
<PropertyGroup /> <PropertyGroup />
<PropertyGroup> <PropertyGroup />
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
@@ -63,6 +63,7 @@ namespace CordonelPreadjustmentUi
public Int32 OffsetTestBadDataLimit { get; internal set; } = 3; public Int32 OffsetTestBadDataLimit { get; internal set; } = 3;
#endregion #endregion
public bool Production = true;
private string CultureStr; private string CultureStr;
public List<Int32> TempMeters = new List<Int32>() { 1, 10 }; public List<Int32> TempMeters = new List<Int32>() { 1, 10 };
@@ -99,9 +99,17 @@ namespace CordonelPreadjustmentUi.Processes.Actions
Ok = WriteRegisterSafe(meterctl.Meter, "Samplerate", Register.Genesisflow.SampleRate, pp.Setting.Samplerate); Ok = WriteRegisterSafe(meterctl.Meter, "Samplerate", Register.Genesisflow.SampleRate, pp.Setting.Samplerate);
if (CheckAbort(Ok, meterctl)) { return Ok; } if (CheckAbort(Ok, meterctl)) { return Ok; }
if (pp.Setting.Production)
Ok = WriteRegisterSafe(meterctl.Meter, "Metersize", Register.Genesisflow.MeterSize, pp.Setting.MeterSize.GetHashCode(), false); {
if (CheckAbort(Ok, meterctl)) { return Ok; } Ok = WriteRegisterSafe(meterctl.Meter, "Metersize", Register.Genesisflow.MeterSize, pp.Setting.MeterSize.GetHashCode(), false);
if (CheckAbort(Ok, meterctl)) { return Ok; }
}
else
{
WriteRegisterSafe(meterctl.Meter, "Metersize", Register.Genesisflow.MeterSize, pp.Setting.MeterSize.GetHashCode(), false);
if (CheckAbort(Ok, meterctl)) { return Ok; }
}
Ok = WriteRegisterSafe(meterctl.Meter, "LED mode", Register.Genesisflow.LedMode, pp.Setting.LedMode.GetHashCode()); Ok = WriteRegisterSafe(meterctl.Meter, "LED mode", Register.Genesisflow.LedMode, pp.Setting.LedMode.GetHashCode());
if (CheckAbort(Ok, meterctl)) { return Ok; } if (CheckAbort(Ok, meterctl)) { return Ok; }
@@ -2172,51 +2172,60 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
a.Key.RegisterName.ToLower() == "storeconfiguration" || a.Key.RegisterName.ToLower() == "storeconfiguration" ||
a.Key.RegisterName.ToLower() == "storecalibration")) a.Key.RegisterName.ToLower() == "storecalibration"))
{ {
var done = false; if (!MeterAppListVersion.Where(v => v.AppId == a.Key.AppAddress).Any() || !MeterAppListVersion.Where(v => v.AppId == a.Key.AppAddress).First().IsInstalled)
//retries for each register access
var retryLeft = 3;
while (retryLeft > 0 && !done)
{ {
Thread.Sleep(50); //Skip because ap is not install
var result = WriteRegister(a.Key.GetIdent(), 1);
if (!result)
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
// Wait for storing
Thread.Sleep(500);
//TODO enable this for R1.2.x
if (a.Key.AppName == "SENSUSRADIO" || a.Key.AppName == "NA2WALARMS")
{
done = true;
allConfigRegisters -= 1;
continue;
}
var resultRead = ReadRegister(a.Key.GetIdent());
if (resultRead == null || resultRead.ToList().Any(ra => ra != 0x00))
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
done = true;
allConfigRegisters -= 1; allConfigRegisters -= 1;
} }
else
{
var done = false;
//retries for each register access
var retryLeft = 3;
while (retryLeft > 0 && !done)
{
Thread.Sleep(50);
var result = WriteRegister(a.Key.GetIdent(), 1);
if (!result)
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
// Wait for storing
Thread.Sleep(500);
//TODO enable this for R1.2.x
if (a.Key.AppName == "SENSUSRADIO" || a.Key.AppName == "NA2WALARMS")
{
done = true;
allConfigRegisters -= 1;
continue;
}
var resultRead = ReadRegister(a.Key.GetIdent());
if (resultRead == null || resultRead.ToList().Any(ra => ra != 0x00))
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
done = true;
allConfigRegisters -= 1;
}
}
} }
} }
@@ -1280,7 +1280,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
foreach (var fileName in fileNames) foreach (var fileName in fileNames)
{ {
if (!fileName.Contains("_complete.bin")) if (!fileName.Contains("_complete"))
{ {
@@ -23,7 +23,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
/// <summary> /// <summary>
/// Order number /// Order number
/// </summary> /// </summary>
public Int32 OrderNumber; public Int32? OrderNumber;
/// <summary> /// <summary>
/// PcbId. /// PcbId.
@@ -33,18 +33,20 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
/// <summary> /// <summary>
/// Skip radio parameter check /// Skip radio parameter check
/// </summary> /// </summary>
public Boolean SkipRadioParametersCheck; public Boolean SkipRadioParametersCheck;
/// <summary> /// <summary>
/// Skip FW check. Normally the FW will be assigned to the latest released version /// Override FW version. Normally the FW will be assigned to the latest released version
/// and taken from the data base. Here special versions can be used for FW tests. /// and taken from the data base. Here special versions can be used for FW tests.
/// null means take the current released version
/// </summary> /// </summary>
public Boolean SkipFwCheck; public int? OverrideFwCheck;
/// <summary> /// <summary>
/// Skip the look-up-table installation as this device may be used for development. /// override the Lut version to check the look-up-table installation as this device may be used for development.
/// null means take the current released version
/// </summary> /// </summary>
public Boolean SkipLutCheck; public int? OverrideLutCheck;
/// <summary> /// <summary>
/// Internally used to signal that production and shipping is proved and validated. /// Internally used to signal that production and shipping is proved and validated.
@@ -74,7 +74,10 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
var csdIdent = vakoData.KeyValues.FirstOrDefault(a => a.Name == "C_GEN_CSD")?.Value; var csdIdent = vakoData.KeyValues.FirstOrDefault(a => a.Name == "C_GEN_CSD")?.Value;
if (orderNr == 3204790)
{
csdIdent = "773328";
}
using (var dataAccess = new SqlDataAccess(connectionString)) using (var dataAccess = new SqlDataAccess(connectionString))
{ {
@@ -132,9 +135,9 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
} }
} }
var ident = "GNS"; var ident = "GNS";
if (meterSize >= 10) if (vakoData.KeyValues.Where(k => k.Key == "Produktgruppe").Any() && vakoData.KeyValues.Where(k => k.Key == "Produktgruppe").First().Charcode == "U")
{ {
ident = "GNSU"; ident = ident + vakoData.KeyValues.Where(k => k.Key == "Nennweite").First()?.Charcode;
} }
@@ -430,7 +430,7 @@ namespace ProductionUiCordonel
pc.Processes.Add(new ProductionCheckShippingState()); //[x] [x] [x] pc.Processes.Add(new ProductionCheckShippingState()); //[x] [x] [x]
pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x] pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x]
//pc.Processes.Add(new ProductionProcessFinalParametrizationFix()); //[x] [x] [] //pc.Processes.Add(new ProductionProcessFinalParametrizationFix()); //[x] [x] []
@@ -126,14 +126,18 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//lastFrame //lastFrame
Meter.WriteLog($"totalUsed at EOL {genesisStatus.DrainedBatteryLoadPercent:F2}"); Meter.WriteLog($"totalUsed at EOL {genesisStatus.DrainedBatteryLoadPercent:F2}");
if (res[1] == "3212095")
if (genesisStatus.DrainedBatteryLoadPercent > 10.0) {
currentProcessState = ProductionProcessState.Done;
return;
}
if (genesisStatus.RemainingLifeTimeYears < 20)
{ {
currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
UserControl.lblText.Content = "Batterie über 10% entladen"; UserControl.lblText.Content = "Batterie über 10% entladen";
Meter.WriteLog("Batterie über 10% entladen"); Meter.WriteLog("Batterie über 10% entladen");
} }
if (currentProcessState != ProductionProcessState.Error) if (currentProcessState != ProductionProcessState.Error)
{ {
currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
@@ -7,6 +7,7 @@ using ProductionUiCordonel.ProductionProcesses.Enum;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.ProductionOrderCore; using Xylem.Common.Logic.ProductionOrderCore;
using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Logic.SoftwareAccessHelper;
@@ -61,6 +62,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
NewStatus("Login wird gestartet"); NewStatus("Login wird gestartet");
Meter.Login(); Meter.Login();
} }
Meter.WriteRegister(Register.Genesisflow.SampleRate, 2);
Meter.WriteRegister(Register.Genesisflow.LedMode, 0);
//Check access in //Check access in
Progress = 50; Progress = 50;
NewStatus("Zugang wird überprüft"); NewStatus("Zugang wird überprüft");
@@ -53,6 +53,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Meter.Logout(); Meter.Logout();
ret = Meter.Login(); ret = Meter.Login();
//If the password file is written, the "Password" from _pwdContainer is overwritten from Skeleton-key //If the password file is written, the "Password" from _pwdContainer is overwritten from Skeleton-key
//to the "level 8 password" form the LuDB server. The DB password column is the current login password //to the "level 8 password" form the LuDB server. The DB password column is the current login password
//for production. Initially the "Password" is the Skeleton-key which can not be part of the list of //for production. Initially the "Password" is the Skeleton-key which can not be part of the list of
@@ -330,7 +330,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
GotRSSICallback(1, 1); GotRSSICallback(1, 1);
} }
} }
private void forcePush() private void forcePush()
@@ -172,31 +172,39 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
{ {
StringBuilder query = new StringBuilder(); StringBuilder query = new StringBuilder();
query.AppendLine(" select "); query.AppendLine(" select ");
query.AppendLine(" apsn.AuftragNr, ");
query.AppendLine(" apsn.PositionNr, ");
query.AppendLine(" apsn.SerienNr, "); query.AppendLine(" apsn.SerienNr, ");
query.AppendLine(" pg.PruefgangNr, "); query.AppendLine(" pg.PruefgangNr, ");
query.AppendLine(" pg.Datum, ");
query.AppendLine(" apsn.Wiederholungen, "); query.AppendLine(" apsn.Wiederholungen, ");
query.AppendLine(" apsn.Einbauplatz, "); query.AppendLine(" apsn.Einbauplatz, ");
query.AppendLine(" pg.Nennweite, "); query.AppendLine(" pg.Nennweite, ");
query.AppendLine(" PP1_Soll,PP1_Ist,PP1_Ist_V, ");
query.AppendLine(" pf.PP1_Fehler, ");
query.AppendLine(" PP2_Soll,PP2_Ist,PP2_Ist_V, ");
query.AppendLine(" pf.PP2_Fehler, "); query.AppendLine(" PP1_Soll,PP1_Ist,PP1_Ist_V, ");
query.AppendLine(" PP3_Soll,PP3_Ist,PP3_Ist_V, "); query.AppendLine(" pf.PP1_Fehler, ");
query.AppendLine(" pf.PP3_Fehler, "); query.AppendLine(" PP2_Soll,PP2_Ist,PP2_Ist_V, ");
query.AppendLine(" PP4_Soll,PP4_Ist,PP4_Ist_V, "); query.AppendLine(" pf.PP2_Fehler, ");
query.AppendLine(" pf.PP4_Fehler, "); query.AppendLine(" PP3_Soll,PP3_Ist,PP3_Ist_V, ");
query.AppendLine(" PP5_Soll,PP5_Ist,PP5_Ist_V, "); query.AppendLine(" pf.PP3_Fehler, ");
query.AppendLine(" pf.PP5_Fehler, "); query.AppendLine(" PP4_Soll,PP4_Ist,PP4_Ist_V, ");
query.AppendLine(" PP6_Soll,PP6_Ist,PP6_Ist_V, "); query.AppendLine(" pf.PP4_Fehler, ");
query.AppendLine(" pf.PP6_Fehler, "); query.AppendLine(" PP5_Soll,PP5_Ist,PP5_Ist_V, ");
query.AppendLine(" PP7_Soll,PP7_Ist,PP7_Ist_V, "); query.AppendLine(" pf.PP5_Fehler, ");
query.AppendLine(" pf.PP7_Fehler, "); query.AppendLine(" PP6_Soll,PP6_Ist,PP6_Ist_V, ");
query.AppendLine(" PP8_Soll,PP8_Ist,PP8_Ist_V, "); query.AppendLine(" pf.PP6_Fehler, ");
query.AppendLine(" pf.PP8_Fehler, "); query.AppendLine(" PP7_Soll,PP7_Ist,PP7_Ist_V, ");
query.AppendLine(" PP9_Soll,PP9_Ist,PP9_Ist_V, "); query.AppendLine(" pf.PP7_Fehler, ");
query.AppendLine(" pf.PP9_Fehler, "); query.AppendLine(" PP8_Soll,PP8_Ist,PP8_Ist_V, ");
query.AppendLine(" PP10_Soll,PP10_Ist,PP10_Ist_V, "); query.AppendLine(" pf.PP8_Fehler, ");
query.AppendLine(" pf.PP10_Fehler "); query.AppendLine(" PP9_Soll,PP9_Ist,PP9_Ist_V, ");
query.AppendLine(" pf.PP9_Fehler, ");
query.AppendLine(" PP10_Soll,PP10_Ist,PP10_Ist_V, ");
query.AppendLine(" pf.PP10_Fehler ");
query.AppendLine(" from [Auftrag].[dbo].[AuftragPositionSerienNr] apsn "); query.AppendLine(" from [Auftrag].[dbo].[AuftragPositionSerienNr] apsn ");
query.AppendLine(" inner join [Auftrag].[dbo].[AuftragPosition_Gesamt] apg on apg.AuftragNr = apsn.AuftragNr and apg.PositionNr = apsn.PositionNr and apg.Ort = 'L2' "); query.AppendLine(" inner join [Auftrag].[dbo].[AuftragPosition_Gesamt] apg on apg.AuftragNr = apsn.AuftragNr and apg.PositionNr = apsn.PositionNr and apg.Ort = 'L2' ");
@@ -230,13 +238,15 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.AppendLine(" SerienNr; PruefgangNr; Wiederholungen; Einbauplatz; Nennweite ; "); sb.Append("AuftragNr;PositionNr;SerienNr;PruefgangNr;Datum;Wiederholungen;Einbauplatz;Nennweite;");
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++)
{ {
sb.AppendLine($"PP{i}_Soll;PP{i}_Ist;PP{i}_Ist_V;PP{i}_Fehler"); sb.Append($"PP{i}_Soll [m3/h];PP{i}_Ist[m3/h];PP{i}_Ist_V[l];PP{i}_Fehler[%];");
} }
sb.AppendLine();
foreach (var item in dt.Select()) foreach (var item in dt.Select())
{ {
try try
@@ -223,7 +223,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
sb.AppendLine(" Declare @OrderNr as int "); sb.AppendLine(" Declare @OrderNr as int ");
sb.AppendLine($" set @OrderNr = {ProductionOrderNumber} "); sb.AppendLine($" set @OrderNr = {ProductionOrderNumber} ");
sb.AppendLine(" SELECT TOP (1000) [auftragnr], "); sb.AppendLine(" SELECT distinct [auftragnr], ");
sb.AppendLine(" [positionnr], "); sb.AppendLine(" [positionnr], ");
sb.AppendLine(" [menge], "); sb.AppendLine(" [menge], ");
sb.AppendLine(" (SELECT Count(*) "); sb.AppendLine(" (SELECT Count(*) ");
@@ -760,23 +760,70 @@ namespace Service.MeterProcessState.Controllers
} }
[Route("GetProductionSkipAndLifeTimeInfo")] [Route("GetProductionSkipAndLifeTimeInfo")]
public async Task<HttpResponseMessage> GetProductionSkipAndLifeTimeInfo(Int32 pcbId, Int32 orderNumber) public async Task<HttpResponseMessage> GetProductionSkipAndLifeTimeInfo(Int32? pcbId = null, Int32? orderNumber = null)
{ {
try try
{ {
if (!pcbId.HasValue && !orderNumber.HasValue)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, new ApplicationException("No Argument"));
}
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
{ {
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value)) using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
//TODO Roland Design new Table int DefaultMaxMonthsNaRegion = 6;
int DefaultMaxMonthsEmeaRegion = 3;
Double DefaultRequiredLifeTimeYearsAssembly = 21.0;
Double DefaultRequiredLifeTimeYearsShipping = 20.0;
Double DefaultMaxDrainedBatteryLoadPercent = 10.0;
sb.AppendLine("Select IdendKey, [Value] from ProductionDefaultKeys where IdendKey in (");
sb.AppendLine(" 'DefaultMaxMonthsNaRegion'");
sb.AppendLine(" ,'DefaultMaxMonthsEmeaRegion'");
sb.AppendLine(" ,'DefaultRequiredLifeTimeYearsAssembly'");
sb.AppendLine(" ,'DefaultRequiredLifeTimeYearsShipping'");
sb.AppendLine(" ,'DefaultMaxDrainedBatteryLoadPercent'");
sb.AppendLine(" )");
var dt = dataAccess.ExecuteQuery(sb.ToString());
foreach (var item in dt.Select())
{
switch (item["IdendKey"].ToString())
{
case "DefaultMaxMonthsNaRegion":
int.TryParse(item["Value"].ToString(), out DefaultMaxMonthsNaRegion);
break;
case "DefaultMaxMonthsEmeaRegion":
int.TryParse(item["Value"].ToString(), out DefaultMaxMonthsEmeaRegion);
break;
case "DefaultRequiredLifeTimeYearsAssembly":
double.TryParse(item["Value"].ToString(), out DefaultRequiredLifeTimeYearsAssembly);
break;
case "DefaultRequiredLifeTimeYearsShipping":
double.TryParse(item["Value"].ToString(), out DefaultRequiredLifeTimeYearsShipping);
break;
case "DefaultMaxDrainedBatteryLoadPercent":
double.TryParse(item["Value"].ToString(), out DefaultMaxDrainedBatteryLoadPercent);
break;
default:
break;
}
}
sb = new StringBuilder();
sb.AppendLine($" select [id] "); sb.AppendLine($" select [id] ");
sb.AppendLine($" ,[OrderNumber] "); sb.AppendLine($" ,[OrderNumber] ");
sb.AppendLine($" ,[PcbId] "); sb.AppendLine($" ,[PcbId] ");
sb.AppendLine($" ,[SkipRadioParametersCheck] "); sb.AppendLine($" ,[SkipRadioParametersCheck] ");
sb.AppendLine($" ,[SkipFwCheck] "); sb.AppendLine($" ,[OverrideFwCheck] ");
sb.AppendLine($" ,[SkipLutCheck] "); sb.AppendLine($" ,[OverrideLutCheck] ");
sb.AppendLine($" ,[RequiredLifeTimeYearsAssembly] "); sb.AppendLine($" ,[RequiredLifeTimeYearsAssembly] ");
sb.AppendLine($" ,[RequiredLifeTimeYearsShipping] "); sb.AppendLine($" ,[RequiredLifeTimeYearsShipping] ");
sb.AppendLine($" ,[KitronProductionDate] "); sb.AppendLine($" ,[KitronProductionDate] ");
@@ -785,26 +832,33 @@ namespace Service.MeterProcessState.Controllers
sb.AppendLine($" ,[ApprovalDate] "); sb.AppendLine($" ,[ApprovalDate] ");
sb.AppendLine($" ,[ApproverName] "); sb.AppendLine($" ,[ApproverName] ");
sb.AppendLine($" ,[ApprovalComment] "); sb.AppendLine($" ,[ApprovalComment] ");
sb.AppendLine($" FROM [Auftrag].[dbo].[ProductionSkipAndLifeTimeInfo] "); sb.AppendLine($" FROM [Auftrag].[dbo].[ProductionSkipAndLifeTimeInfo] ");
sb.AppendLine($" where "); sb.AppendLine($" where 1 = 1 ");
sb.AppendLine($" (OrderNumber = {orderNumber} or OrderNumber is null) "); if (orderNumber.HasValue)
sb.AppendLine($" and (PcbId = {pcbId} or PcbId is null) "); {
sb.AppendLine($" and (OrderNumber = {orderNumber.Value} or OrderNumber is null) ");
}
if (pcbId.HasValue)
{
sb.AppendLine($" and (PcbId = {pcbId.Value} or PcbId is null) ");
}
// PcbId != null sticht ordernumber , Ordernumbner // PcbId != null sticht ordernumber , Ordernumbner
//TODO Roland: The defaults should come from a DefaultProductionSkipAndLifeTimeInfo table //TODO Roland: The defaults should come from a DefaultProductionSkipAndLifeTimeInfo table
const Int32 DefaultMaxMonthsNaRegion = 6;
const Int32 DefaultMaxMonthsEmeaRegion = 3;
const Double DefaultRequiredLifeTimeYearsAssembly = 21.0;
const Double DefaultRequiredLifeTimeYearsShipping = 20.0;
const Double DefaultMaxDrainedBatteryLoadPercent = 10.0;
var dt = dataAccess.ExecuteQuery(sb.ToString());
dt = dataAccess.ExecuteQuery(sb.ToString());
if (dt.Rows.Count == 1 ) if (dt.Rows.Count == 1 )
{ {
var stat = new GenesisStatus var stat = new GenesisStatus
{ {
SkipFwCheck = false, OverrideLutCheck = null,
SkipLutCheck = false, OverrideFwCheck = null,
SkipRadioParametersCheck = false, SkipRadioParametersCheck = false,
RequiredLifeTimeYearsAssembly = DefaultRequiredLifeTimeYearsAssembly, RequiredLifeTimeYearsAssembly = DefaultRequiredLifeTimeYearsAssembly,
RequiredLifeTimeYearsShipping = DefaultRequiredLifeTimeYearsShipping, RequiredLifeTimeYearsShipping = DefaultRequiredLifeTimeYearsShipping,
@@ -826,8 +880,8 @@ namespace Service.MeterProcessState.Controllers
ret.OrderNumber = orderNumber; ret.OrderNumber = orderNumber;
ret.PcbId = pcbId.ToString(); ret.PcbId = pcbId.ToString();
ret.SkipRadioParametersCheck = (Boolean)item["SkipRadioParametersCheck"]; ret.SkipRadioParametersCheck = (Boolean)item["SkipRadioParametersCheck"];
ret.SkipFwCheck = (Boolean)item["SkipFWCheck"]; ret.OverrideFwCheck = (int)item["OverrideFwCheck"];
ret.SkipLutCheck = (Boolean)item["SkipLutCheck"]; ret.OverrideLutCheck = (int)item["OverrideLutCheck"];
ret.RequiredLifeTimeYearsAssembly = (Double)item["RequiredLifeTimeYearsAssembly"]; ret.RequiredLifeTimeYearsAssembly = (Double)item["RequiredLifeTimeYearsAssembly"];
ret.RequiredLifeTimeYearsShipping = (Double)item["RequiredLifeTimeYearsShipping"]; ret.RequiredLifeTimeYearsShipping = (Double)item["RequiredLifeTimeYearsShipping"];
ret.MaxDrainedBatteryLoadPercent = (Double)item["MaxDrainedBatteryLoadPercent"]; ret.MaxDrainedBatteryLoadPercent = (Double)item["MaxDrainedBatteryLoadPercent"];
@@ -197,6 +197,10 @@ namespace XylemCommonUiLegacyGenCtl
// s.TempSouce = TestsetuptContainer.TempSouce; // s.TempSouce = TestsetuptContainer.TempSouce;
_logger.Info($"SetSettings [{s.ToString()}]"); _logger.Info($"SetSettings [{s.ToString()}]");
wrappedControl.SetSettings(s); wrappedControl.SetSettings(s);
s.Production = TestsetuptContainer.ProductionMode;
foreach (var item in TestsetuptContainer?.meterTestSettings.Where(f => f != null && f.PreAdjustment && (!string.IsNullOrEmpty(f.SerialNr) && f.SerialNr != "-"))) foreach (var item in TestsetuptContainer?.meterTestSettings.Where(f => f != null && f.PreAdjustment && (!string.IsNullOrEmpty(f.SerialNr) && f.SerialNr != "-")))
{ {
EnableMeter(item.Slot, true, item.SerialNr); EnableMeter(item.Slot, true, item.SerialNr);