Merge done
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DN/@EntryIndexedValue">DN</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FW/@EntryIndexedValue">FW</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LUT/@EntryIndexedValue">LUT</s:String>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=accu/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Applic/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Approver/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Battey/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=binfile/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=BUGFIX/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Calib/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -10,7 +15,12 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=CONFIGEXCHANGE/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Consts/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cordonel/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cordonels/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=dispached/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=DNMAX/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Drabesch/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Drahbesch/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=EMEA/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=FFFF/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Flexnet/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=FLEXNETVERSION/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -18,6 +28,7 @@
|
||||
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=GENSISFLOW/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Irda/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=KITRON/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=licence/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Metrology/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=METROLOGYASST/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -26,4 +37,6 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=RFID/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=SENSUSRADIO/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Thermo/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Uart/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Uart/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Vako/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Wiedebusch/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -18,6 +18,8 @@
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PublicFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=StaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=TypesAndNamespaces/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Property/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="Aa_bb" /></s:String>
|
||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||
<Assembly Path="D:\Projekte\SENSUS_tfs_workspaces\WorkBenchV2\Main\Common\Ui\IrdaFunctionalTestApp\bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll" />
|
||||
</AssemblyExplorer></s:String>
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CordonelAssemblyLine.Data
|
||||
Rev = baseData.Rev;
|
||||
TesterName = baseData.TesterName;
|
||||
Testpoints = new ObservableCollection<PressureTestPoints>();
|
||||
baseData.Testpoints.ForEach(o => Testpoints.Add(o));
|
||||
baseData.TestPoints.ForEach(o => Testpoints.Add(o));
|
||||
TestPressure = baseData.TestPressure;
|
||||
}
|
||||
public PressureResultDataNotifyable()
|
||||
@@ -151,7 +151,7 @@ namespace CordonelAssemblyLine.Data
|
||||
baseData.Remark = Remark;
|
||||
baseData.Rev = Rev;
|
||||
baseData.TesterName = TesterName;
|
||||
baseData.Testpoints = Testpoints.ToList();
|
||||
baseData.TestPoints = Testpoints.ToList();
|
||||
baseData.TestPressure = TestPressure;
|
||||
return baseData;
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ namespace CordonelAssemblyLine.Model
|
||||
sm = PickingStateMachine.MappingError;
|
||||
}
|
||||
List<string> MappingText = new List<string>();
|
||||
if (retInt.HasFlag(MarriagePossibleEnum.NotPossibleDueAlredayMatch))
|
||||
if (retInt.HasFlag(MarriagePossibleEnum.NotPossibleDueToAlreadyMarried))
|
||||
{
|
||||
MappingText.Add("Pcb ist schon mit dieser Seriennummer verbunden.Display aktualisiert");
|
||||
using (var Batch = new MeterBatch())
|
||||
@@ -611,7 +611,7 @@ namespace CordonelAssemblyLine.Model
|
||||
}
|
||||
}
|
||||
}
|
||||
if (retInt.HasFlag(MarriagePossibleEnum.NotPossibleDuePcblocked))
|
||||
if (retInt.HasFlag(MarriagePossibleEnum.NotPossibleDuePcbLocked))
|
||||
{
|
||||
MappingText.Add("Pcb ist schon mit einer anderen Seriennummer verbunden.");
|
||||
}
|
||||
|
||||
@@ -692,7 +692,7 @@ namespace CordonelPreadjustmentUi
|
||||
{
|
||||
throw new ApplicationException("Detect failed");
|
||||
}
|
||||
if (settings.MeterSize != MeterSize.NAN)
|
||||
if (settings.MeterSize != MeterSize.NA)
|
||||
{
|
||||
btn_ZeroFlowCal_Start_Click(null, EventArgs.Empty);
|
||||
}
|
||||
@@ -1770,7 +1770,7 @@ namespace CordonelPreadjustmentUi
|
||||
var ts = DateTimeOffset.UtcNow - totalStartOffset.Value;
|
||||
DebugMessage($"offset duration= {ts.TotalSeconds}");
|
||||
|
||||
MeterStateCtls.ForEach(f => f.Meter?.calibrationResult?.AddAditonlaLog($"offset duration=", $"{ts.TotalSeconds}S"));
|
||||
MeterStateCtls.ForEach(f => f.Meter?.calibrationResult?.AddAdditionalLog($"offset duration=", $"{ts.TotalSeconds}S"));
|
||||
|
||||
totalStartOffset = null;
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
if (meanVal == 0)
|
||||
{
|
||||
pp.DebugMessage($"Mean value is zero at {meterctl.Meter.Slot}; PATH{(Path + 1).ToString(pp.Setting.Culture)}; Value = {Math.Round(meanVal, 4).ToString("000.0000", pp.Setting.Culture)}", meterctl.Meter.Slot, "DC", meterctl.Meter.PcbId);
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"" +
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"" +
|
||||
$"PATH {Path + 1}", Math.Round(meanVal, 4).ToString("000.0000", pp.Setting.Culture));
|
||||
|
||||
if (CheckAbort(false, meterctl)) { return false; }
|
||||
@@ -169,7 +169,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
|
||||
pp.DebugMessage($"Mean value at {meterctl.Meter.Slot}; PATH{(Path + 1).ToString(pp.Setting.Culture)}; Value = {Math.Round(meanVal, 4).ToString("000.0000", pp.Setting.Culture)}", meterctl.Meter.Slot, "DC", meterctl.Meter.PcbId);
|
||||
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Amp. Test Mean value PATH {Path + 1}", $"at {FirstHitLevelPercentage}={Math.Round(meanVal, 4).ToString("000.0000", pp.Setting.Culture)}");
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Amp. Test Mean value PATH {Path + 1}", $"at {FirstHitLevelPercentage}={Math.Round(meanVal, 4).ToString("000.0000", pp.Setting.Culture)}");
|
||||
var cTofAvgMeanTotal = TofAvgMeanTotal.Get(Path).ToList();
|
||||
|
||||
cTofAvgMeanTotal.Add(meanVal);
|
||||
@@ -223,12 +223,12 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
|
||||
if (!r)
|
||||
{
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Amp. Test OptimalPoint PATH {Path + 1}", OptimalPoint.Get(Path).ToString(pp.Setting.Culture));
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Amp. Test OptimalPoint PATH {Path + 1}", OptimalPoint.Get(Path).ToString(pp.Setting.Culture));
|
||||
pp.DebugMessage($"Optimal point calculation successful PATH{Path + 1}; Value = {OptimalPoint.Get(Path).ToString(pp.Setting.Culture)}", meterctl.Meter.Slot, "DC", meterctl.Meter.PcbId);
|
||||
}
|
||||
else
|
||||
{
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Amp. Test OptimalPoint PATH {Path + 1}", "NaN");
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Amp. Test OptimalPoint PATH {Path + 1}", "NaN");
|
||||
pp.DebugMessage($"Optimal point calculation failed, PATH{Path + 1}", meterctl.Meter.Slot, "DC", meterctl.Meter.PcbId);
|
||||
if (CheckAbort(!r, meterctl)) { return !r; }
|
||||
}
|
||||
|
||||
@@ -193,8 +193,8 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
|
||||
pp.DebugMessage($"Average positive amplitude, PATH{(Path + 1)}: {Math.Round(amplitudeValuesMeanUp.Get(Path), 2).ToString("000.00")}mV", meterctl.Meter.Slot, "DC", meterctl.Meter.PcbId);
|
||||
pp.DebugMessage($"Average negative amplitude, PATH{(Path + 1)}: {Math.Round(amplitudeValuesMeanDown.Get(Path), 2).ToString("000.00")}mV", meterctl.Meter.Slot, "DC", meterctl.Meter.PcbId);
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Offset Average positive amplitude PATH { (Path + 1)}", $"{ Math.Round(amplitudeValuesMeanUp.Get(Path), 2).ToString("000.00")}mV");
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Offset Average negative amplitude PATH { (Path + 1)}", $"{ Math.Round(amplitudeValuesMeanDown.Get(Path), 2).ToString("000.00")}mV");
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Offset Average positive amplitude PATH { (Path + 1)}", $"{ Math.Round(amplitudeValuesMeanUp.Get(Path), 2).ToString("000.00")}mV");
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Offset Average negative amplitude PATH { (Path + 1)}", $"{ Math.Round(amplitudeValuesMeanDown.Get(Path), 2).ToString("000.00")}mV");
|
||||
|
||||
if ((amplitudeValuesMeanUp.Get(Path) > pp.Setting.OffsetTestUpperVoltageLimitMV) ||
|
||||
(amplitudeValuesMeanUp.Get(Path) < pp.Setting.OffsetTestLowerVoltageLimitMV) ||
|
||||
@@ -206,8 +206,8 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
}
|
||||
|
||||
pp.DebugMessage($"Average delta time of flight valuePATH{(Path + 1)}: Raw{DeltaTimeOfFlightAverage.Get(Path)} -> in picoseconds= { Math.Round((DeltaTimeOfFlightAverage.Get(Path) / (Math.Pow(2, 38) * Math.Pow(10, 12))), 2).ToString("000.00")}", meterctl.Meter.Slot, "APP", meterctl.Meter.PcbId);
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Offset Average delta time of flight value PATH { (Path + 1)} RAW ", $"{DeltaTimeOfFlightAverage.Get(Path)}");
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Offset Average delta time of flight value PATH { (Path + 1)} picoseconds ", $"{Math.Round((DeltaTimeOfFlightAverage.Get(Path) / (Math.Pow(2, 38) * Math.Pow(10, 12))), 2).ToString("000.00")}");
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Offset Average delta time of flight value PATH { (Path + 1)} RAW ", $"{DeltaTimeOfFlightAverage.Get(Path)}");
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Offset Average delta time of flight value PATH { (Path + 1)} picoseconds ", $"{Math.Round((DeltaTimeOfFlightAverage.Get(Path) / (Math.Pow(2, 38) * Math.Pow(10, 12))), 2).ToString("000.00")}");
|
||||
|
||||
if ((DeltaTimeOfFlightAverage.Get(Path) > pp.Setting.OffsetTestOffsetLimitPS) ||
|
||||
(DeltaTimeOfFlightAverage.Get(Path) < -pp.Setting.OffsetTestOffsetLimitPS))
|
||||
|
||||
@@ -93,8 +93,8 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
}
|
||||
|
||||
}
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"OffsetTestNumberOfLines", pp.Setting.OffsetTestNumberOfLines.ToString());
|
||||
meterctl.Meter.calibrationResult.AddAditonlaLog($"Samplerate", pp.Setting.Samplerate.ToString());
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"OffsetTestNumberOfLines", pp.Setting.OffsetTestNumberOfLines.ToString());
|
||||
meterctl.Meter.calibrationResult.AddAdditionalLog($"Samplerate", pp.Setting.Samplerate.ToString());
|
||||
|
||||
|
||||
Ok = WriteRegisterSafe(meterctl.Meter, "Samplerate", Register.Genesisflow.SampleRate, pp.Setting.Samplerate);
|
||||
|
||||
@@ -150,8 +150,8 @@ namespace CordonelPreadjustmentUi.Processes.Actions
|
||||
pp.StatusLabel = PredefinedMessages.WaitUntilRegisterWriteFinished(pp.Setting.Culture);
|
||||
Ok = WriteRegisterSafe(putTempIntoMeter.Meter, "Temperature calibration", Register.Genesisflow.ToFTempCalibrate, TempToRegister, false);
|
||||
if (CheckAbort(Ok, putTempIntoMeter)) { return Ok; }
|
||||
putTempIntoMeter.Meter.calibrationResult.AddAditonlaLog($"Temperature calibration Register", TempToRegister.ToString());
|
||||
putTempIntoMeter.Meter.calibrationResult.AddAditonlaLog($"Temperature calibration Origin", originTemp.ToString());
|
||||
putTempIntoMeter.Meter.calibrationResult.AddAdditionalLog($"Temperature calibration Register", TempToRegister.ToString());
|
||||
putTempIntoMeter.Meter.calibrationResult.AddAdditionalLog($"Temperature calibration Origin", originTemp.ToString());
|
||||
|
||||
#endregion
|
||||
#region Wait for some seconds
|
||||
|
||||
@@ -24,6 +24,11 @@ namespace Xylem.Common.Hardware.Interfaces.Ports.SerialPorts
|
||||
/// <inheritdoc />
|
||||
public virtual event EventHandler<BasePortDataEventArgs> OnRawRecordReceived;
|
||||
|
||||
/// <summary>
|
||||
/// The port is not assigned.
|
||||
/// </summary>
|
||||
public const String PortNotAssigned = "NA";
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual event EventHandler<BasePortDataEventArgs> OnRawRecordSendOut;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig
|
||||
/// <param name="file"></param>
|
||||
public ProcessConfig(String file)
|
||||
{
|
||||
// chack for AppRoaming
|
||||
// check for AppRoaming
|
||||
var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Genesis), file);
|
||||
|
||||
if (!File.Exists(configFile))
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes;
|
||||
@@ -62,208 +61,218 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
try
|
||||
{
|
||||
//extract information of every application
|
||||
foreach (var currentApplication in applicationGroups)
|
||||
{
|
||||
var o = (JObject)currentApplication.Value;
|
||||
var application = new ApplicationDefinition();
|
||||
Byte applicationAddress = 0;
|
||||
|
||||
foreach (var groupProp in o)
|
||||
if (applicationGroups != null)
|
||||
foreach (var currentApplication in applicationGroups)
|
||||
{
|
||||
try
|
||||
var o = (JObject)currentApplication.Value;
|
||||
var application = new ApplicationDefinition();
|
||||
Byte applicationAddress = 0;
|
||||
|
||||
foreach (var groupProp in o)
|
||||
{
|
||||
if (groupProp.Key == "id")
|
||||
try
|
||||
{
|
||||
applicationAddress = groupProp.Value.Value<Byte>();
|
||||
application.AppName = currentApplication.Key;
|
||||
application.AppId = applicationAddress;
|
||||
ConfigApplicationDefinitions.Add(application);
|
||||
}
|
||||
else if (groupProp.Key == "registers")
|
||||
{
|
||||
foreach (var registers in groupProp.Value)
|
||||
if (groupProp.Key == "id")
|
||||
{
|
||||
var register = ((JProperty)registers);
|
||||
|
||||
try
|
||||
applicationAddress = groupProp.Value.Value<Byte>();
|
||||
application.AppName = currentApplication.Key;
|
||||
application.AppId = applicationAddress;
|
||||
ConfigApplicationDefinitions.Add(application);
|
||||
}
|
||||
else if (groupProp.Key == "registers")
|
||||
{
|
||||
foreach (var registers in groupProp.Value)
|
||||
{
|
||||
foreach (var registerJ in register.Value)
|
||||
var register = (JProperty)registers;
|
||||
|
||||
try
|
||||
{
|
||||
JProperty reg = ((JProperty)registerJ);
|
||||
|
||||
Byte? registerAddress = null;
|
||||
if (reg.Name == "id")
|
||||
foreach (var registerJ in register.Value)
|
||||
{
|
||||
registerAddress = (Byte)reg.Value;
|
||||
}
|
||||
var reg = (JProperty)registerJ;
|
||||
|
||||
if (reg.Name == "details")
|
||||
{
|
||||
|
||||
var details = ((JArray)reg.Value);
|
||||
|
||||
foreach (var jdetail in details.Children())
|
||||
Byte? registerAddress = null;
|
||||
if (reg.Name == "id")
|
||||
{
|
||||
var actualRegister = new RegisterDefinition();
|
||||
var idTag = reg.Parent.First(f => ((JProperty)f).Name == "id");
|
||||
var id = (Byte)(JProperty)idTag;//.Value<int>();
|
||||
registerAddress = (Byte)reg.Value;
|
||||
}
|
||||
|
||||
if (registerAddress.HasValue)
|
||||
{
|
||||
throw new Exception("invalid json cast");
|
||||
}
|
||||
actualRegister.RegAddressInApp = id;
|
||||
actualRegister.AppName = currentApplication.Key;
|
||||
actualRegister.AppAddress = applicationAddress;
|
||||
actualRegister.RegisterDetail = new RegisterDetail();
|
||||
actualRegister.RegisterName = register.Name;
|
||||
var detailO = (JObject)jdetail;
|
||||
JProperty detail;
|
||||
detail = detailO.Property("privilege");
|
||||
if (detail.Name == "privilege")
|
||||
{
|
||||
actualRegister.RegisterDetail.Privilege = JsonConvert.DeserializeObject<Privilege>(detail.Value.ToString(), Settings);
|
||||
}
|
||||
detail = detailO.Property("type");
|
||||
if (detail.Name == "type")
|
||||
{
|
||||
if (reg.Name == "details")
|
||||
{
|
||||
var details = ((JArray)reg.Value);
|
||||
|
||||
actualRegister.DataType = typeof(String);// detail.Value.ToString();
|
||||
foreach (var jdetail in details.Children())
|
||||
{
|
||||
var actualRegister = new RegisterDefinition();
|
||||
var idTag = reg.Parent.First(f => ((JProperty)f).Name == "id");
|
||||
var id = (Byte)(JProperty)idTag; //.Value<int>();
|
||||
|
||||
switch (detail.Value.ToString().ToLower())
|
||||
if (registerAddress.HasValue)
|
||||
{
|
||||
case "bool_t":
|
||||
actualRegister.DataType = typeof(Boolean);
|
||||
break;
|
||||
case "rpc":
|
||||
actualRegister.DataType = typeof(Rpc);
|
||||
break;
|
||||
case "string":
|
||||
actualRegister.DataType = typeof(String);
|
||||
break;
|
||||
case "uint32_t":
|
||||
actualRegister.DataType = typeof(UInt32);
|
||||
break;
|
||||
case "time_t":
|
||||
actualRegister.DataType = typeof(TimeT);
|
||||
break;
|
||||
case "status_t":
|
||||
actualRegister.DataType = typeof(StatusT);
|
||||
break;
|
||||
case "uint16_t":
|
||||
actualRegister.DataType = typeof(UInt16);
|
||||
break;
|
||||
case "uint8_t":
|
||||
actualRegister.DataType = typeof(byte);
|
||||
break;
|
||||
case "enum8":
|
||||
actualRegister.DataType = typeof(Enum8);
|
||||
break;
|
||||
case "uint64_t":
|
||||
actualRegister.DataType = typeof(UInt64);
|
||||
break;
|
||||
case "uint96_t":
|
||||
actualRegister.DataType = typeof(UInt96);
|
||||
break;
|
||||
case "int8_t":
|
||||
actualRegister.DataType = typeof(sbyte);
|
||||
break;
|
||||
case "int32_t":
|
||||
actualRegister.DataType = typeof(Int32);
|
||||
break;
|
||||
case "int64_t":
|
||||
actualRegister.DataType = typeof(Int64);
|
||||
break;
|
||||
case "int16_t":
|
||||
actualRegister.DataType = typeof(Int16);
|
||||
break;
|
||||
throw new Exception("invalid json cast");
|
||||
}
|
||||
|
||||
}
|
||||
detail = detailO.Property("description");
|
||||
if (detail.Name == "description")
|
||||
{
|
||||
actualRegister.RegisterDetail.Description = detail.Value.ToString();
|
||||
}
|
||||
detail = detailO.Property("version");
|
||||
if (detail.Name == "version")
|
||||
{
|
||||
actualRegister.RegisterDetail.Version = JsonConvert.DeserializeObject<FwVersion>(detail.Value.ToString());
|
||||
}
|
||||
detail = detailO.Property("values");
|
||||
if (detail != null && detail.Name == "values")
|
||||
{
|
||||
foreach (var dValues in detail.Children().First())
|
||||
actualRegister.RegAddressInApp = id;
|
||||
actualRegister.AppName = currentApplication.Key;
|
||||
actualRegister.AppAddress = applicationAddress;
|
||||
actualRegister.RegisterDetail = new RegisterDetail();
|
||||
actualRegister.RegisterName = register.Name;
|
||||
var detailO = (JObject)jdetail;
|
||||
JProperty detail;
|
||||
detail = detailO.Property("privilege");
|
||||
if (detail.Name == "privilege")
|
||||
{
|
||||
switch (((JProperty)dValues).Name)
|
||||
actualRegister.RegisterDetail.Privilege =
|
||||
JsonConvert.DeserializeObject<Privilege>(
|
||||
detail.Value.ToString(), Settings);
|
||||
}
|
||||
|
||||
detail = detailO.Property("type");
|
||||
if (detail.Name == "type")
|
||||
{
|
||||
actualRegister.DataType =
|
||||
typeof(String); // detail.Value.ToString();
|
||||
|
||||
switch (detail.Value.ToString().ToLower())
|
||||
{
|
||||
case "default":
|
||||
actualRegister.Default = (Int64)((JProperty)dValues).Value;
|
||||
case "bool_t":
|
||||
actualRegister.DataType = typeof(Boolean);
|
||||
break;
|
||||
case "maximum":
|
||||
actualRegister.Maximum = (Int64)((JProperty)dValues).Value;
|
||||
case "rpc":
|
||||
actualRegister.DataType = typeof(Rpc);
|
||||
break;
|
||||
case "minimum":
|
||||
actualRegister.Minimum = (Int64)((JProperty)dValues).Value;
|
||||
case "string":
|
||||
actualRegister.DataType = typeof(String);
|
||||
break;
|
||||
case "uint32_t":
|
||||
actualRegister.DataType = typeof(UInt32);
|
||||
break;
|
||||
case "time_t":
|
||||
actualRegister.DataType = typeof(TimeT);
|
||||
break;
|
||||
case "status_t":
|
||||
actualRegister.DataType = typeof(StatusT);
|
||||
break;
|
||||
case "uint16_t":
|
||||
actualRegister.DataType = typeof(UInt16);
|
||||
break;
|
||||
case "uint8_t":
|
||||
actualRegister.DataType = typeof(byte);
|
||||
break;
|
||||
case "enum8":
|
||||
actualRegister.DataType = typeof(Enum8);
|
||||
break;
|
||||
case "uint64_t":
|
||||
actualRegister.DataType = typeof(UInt64);
|
||||
break;
|
||||
case "uint96_t":
|
||||
actualRegister.DataType = typeof(UInt96);
|
||||
break;
|
||||
case "int8_t":
|
||||
actualRegister.DataType = typeof(sbyte);
|
||||
break;
|
||||
case "int32_t":
|
||||
actualRegister.DataType = typeof(Int32);
|
||||
break;
|
||||
case "int64_t":
|
||||
actualRegister.DataType = typeof(Int64);
|
||||
break;
|
||||
case "int16_t":
|
||||
actualRegister.DataType = typeof(Int16);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
detail = detailO.Property(StaticType.StaticTypeFieldIdentifier);
|
||||
if (detail != null && detail.Name == StaticType.StaticTypeFieldIdentifier)
|
||||
{
|
||||
actualRegister.RestoreCapability = new StaticType(detail.Value.ToString());
|
||||
detail = detailO.Property("description");
|
||||
if (detail.Name == "description")
|
||||
{
|
||||
actualRegister.RegisterDetail.Description =
|
||||
detail.Value.ToString();
|
||||
}
|
||||
|
||||
detail = detailO.Property("version");
|
||||
if (detail.Name == "version")
|
||||
{
|
||||
actualRegister.RegisterDetail.Version =
|
||||
JsonConvert.DeserializeObject<FwVersion>(
|
||||
detail.Value.ToString());
|
||||
}
|
||||
|
||||
detail = detailO.Property("values");
|
||||
if (detail != null && detail.Name == "values")
|
||||
{
|
||||
foreach (var dValues in detail.Children().First())
|
||||
{
|
||||
switch (((JProperty)dValues).Name)
|
||||
{
|
||||
case "default":
|
||||
actualRegister.Default =
|
||||
(Int64)((JProperty)dValues).Value;
|
||||
break;
|
||||
case "maximum":
|
||||
actualRegister.Maximum =
|
||||
(Int64)((JProperty)dValues).Value;
|
||||
break;
|
||||
case "minimum":
|
||||
actualRegister.Minimum =
|
||||
(Int64)((JProperty)dValues).Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
detail = detailO.Property(StaticType.StaticTypeFieldIdentifier);
|
||||
if (detail != null && detail.Name ==
|
||||
StaticType.StaticTypeFieldIdentifier)
|
||||
{
|
||||
actualRegister.RestoreCapability =
|
||||
new StaticType(detail.Value.ToString());
|
||||
}
|
||||
|
||||
ConfigRegistersDefinitions.Add(actualRegister);
|
||||
}
|
||||
ConfigRegistersDefinitions.Add(actualRegister);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//todo log ex
|
||||
catch (Exception )
|
||||
{
|
||||
//todo log ex
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//todo log ex
|
||||
catch (Exception )
|
||||
{
|
||||
//todo log ex
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception )
|
||||
{
|
||||
|
||||
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
|
||||
////tofile
|
||||
var sb = new StringBuilder();
|
||||
var lsitOfRegisters = new List<RegisterDefinition>();
|
||||
var listOfRegisters = new List<RegisterDefinition>();
|
||||
foreach (var item in ConfigRegistersDefinitions)
|
||||
{
|
||||
if (item is RegisterDefinition Reg)
|
||||
if (item is RegisterDefinition reg)
|
||||
{
|
||||
if (lsitOfRegisters.Any(a => a.GetIdent() == Reg.GetIdent()))
|
||||
if (listOfRegisters.Any(a => a.GetIdent() == reg.GetIdent()))
|
||||
{
|
||||
var oldItem = lsitOfRegisters.First(a => a.GetIdent() == Reg.GetIdent());
|
||||
if (oldItem.RegisterDetail.Version.Last < Reg.RegisterDetail.Version.Last)
|
||||
var oldItem = listOfRegisters.First(a => a.GetIdent() == reg.GetIdent());
|
||||
if (oldItem.RegisterDetail.Version.Last < reg.RegisterDetail.Version.Last)
|
||||
{
|
||||
lsitOfRegisters.Remove(oldItem);
|
||||
lsitOfRegisters.Add(Reg);
|
||||
listOfRegisters.Remove(oldItem);
|
||||
listOfRegisters.Add(reg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lsitOfRegisters.Add(Reg);
|
||||
listOfRegisters.Add(reg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//#region create a file for my american friends
|
||||
@@ -439,6 +448,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
public static readonly LvlConverter Singleton = new LvlConverter();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Settings
|
||||
/// </summary>
|
||||
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
||||
{
|
||||
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represent <see cref="Register.Configexchange.PCBSerialNumber" />
|
||||
/// Represent <see cref="Register.Configexchange.PcbSerialNumber" />
|
||||
/// proposed for login
|
||||
/// </summary>
|
||||
public String PcbId
|
||||
@@ -662,7 +662,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
/// </summary>
|
||||
public void ConnectMeter()
|
||||
{
|
||||
if (RequestPort != null)
|
||||
if (RequestPort != null && RequestPort.GetPortName() != BaseSerialPort.PortNotAssigned)
|
||||
{
|
||||
LinkPortToProtocol(RequestPort, RequestProtocol);
|
||||
_logger.Trace($"Slot:{Slot} - RequestPort and RequestProtocol linked");
|
||||
@@ -670,7 +670,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
RequestProtocol.OnRecordIsDecoded += RequestProtocol_ApplyDecodedRecord;
|
||||
RequestProtocol.OnAuthorizationGrant += RequestProtocol_AuthorizationGrant;
|
||||
}
|
||||
if (StreamingPort != null)
|
||||
if (StreamingPort != null && StreamingPort.GetPortName() != BaseSerialPort.PortNotAssigned)
|
||||
{
|
||||
LinkPortToProtocol(StreamingPort, StreamingProtocol);
|
||||
_logger.Trace($"Slot:{Slot} - StreamingPort and StreamingProtocol linked");
|
||||
@@ -1647,7 +1647,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
var maxReads = 4;
|
||||
while (!hasZero)
|
||||
{
|
||||
var chunk = ReadRegister(Register.Configexchange.PCBSerialNumber, 4);
|
||||
var chunk = ReadRegister(Register.Configexchange.PcbSerialNumber, 4);
|
||||
maxReads -= 1;
|
||||
if (chunk == null)
|
||||
{
|
||||
|
||||
@@ -7,26 +7,42 @@ using Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Check the positioning of the streaming LED to validate the quality of the communication line
|
||||
/// </summary>
|
||||
public class GenesisMeterStreamingQuality : GenesisMeter
|
||||
{
|
||||
/// <summary>
|
||||
/// Backup of last quality
|
||||
/// </summary>
|
||||
public QualityResult LastQualityResult;
|
||||
private StreamingDecoder sd;
|
||||
|
||||
private StreamingDecoder _sd;
|
||||
/// <summary>
|
||||
/// Quality check is active
|
||||
/// </summary>
|
||||
public Boolean IsRunning;
|
||||
private DateTimeOffset? _startTime;
|
||||
private DateTimeOffset? _stopTime;
|
||||
private List<String> _collectedRecords;
|
||||
private int? TillDecodedCount = null;
|
||||
public void StartStreamingQualityCheck(int? tillDecodedCount = null)
|
||||
|
||||
private Int32? _tillDecodedCount;
|
||||
/// <summary>
|
||||
/// Kick off the streaming quality check.
|
||||
/// </summary>
|
||||
/// <param name="tillDecodedCount"></param>
|
||||
/// <exception cref="ApplicationException"></exception>
|
||||
public void StartStreamingQualityCheck(Int32? tillDecodedCount = null)
|
||||
{
|
||||
|
||||
if (IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
TillDecodedCount = tillDecodedCount;
|
||||
if (TillDecodedCount.HasValue)
|
||||
_tillDecodedCount = tillDecodedCount;
|
||||
if (_tillDecodedCount.HasValue)
|
||||
{
|
||||
sd = new StreamingDecoder(false);
|
||||
_sd = new StreamingDecoder(false);
|
||||
}
|
||||
if (StreamingPort == null || !(StreamingPort is LedSerialPort))
|
||||
{
|
||||
@@ -36,7 +52,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
_stopTime = null;
|
||||
_collectedRecords = new List<String>();
|
||||
|
||||
SyncStreamingBuffer(SyncMarkRecord.FlushBuffer);
|
||||
SyncStreamingBuffer(SyncMarkRecord.DecodeEveryPackage);
|
||||
((LedSerialPort)StreamingPort).OnRawRecordReceived += GenesisMeterStreamingQuality_OnRawRecordReceived;
|
||||
_startTime = DateTimeOffset.UtcNow;
|
||||
@@ -47,21 +62,27 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
private void GenesisMeterStreamingQuality_OnRawRecordReceived(Object sender, BasePortDataEventArgs e)
|
||||
{
|
||||
_collectedRecords.Add(e.GetData().ToString());
|
||||
if (TillDecodedCount.HasValue)
|
||||
if (_tillDecodedCount.HasValue)
|
||||
{
|
||||
if (sd.DecodeMsg(e.GetData().ToString()))
|
||||
if (_sd.DecodeMsg(e.GetData().ToString()))
|
||||
{
|
||||
TillDecodedCount = TillDecodedCount.Value - 1;
|
||||
if (TillDecodedCount <= 0)
|
||||
_tillDecodedCount = _tillDecodedCount.Value - 1;
|
||||
if (_tillDecodedCount <= 0)
|
||||
{
|
||||
IsRunning = false;
|
||||
LastQualityResult = StopStreamingQualityCheck(10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop the streaming check.
|
||||
/// </summary>
|
||||
/// <param name="sampleRateHz"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ApplicationException"></exception>
|
||||
public QualityResult StopStreamingQualityCheck(Int32 sampleRateHz)
|
||||
{
|
||||
_stopTime = DateTimeOffset.UtcNow;
|
||||
@@ -79,24 +100,56 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
((LedSerialPort)StreamingPort).OnRawRecordReceived -= GenesisMeterStreamingQuality_OnRawRecordReceived;
|
||||
SyncStreamingBuffer(SyncMarkRecord.SkipDecoding);
|
||||
IsRunning = false;
|
||||
return new QualityResult(_collectedRecords, _stopTime.Value - _startTime.Value, sampleRateHz);
|
||||
if (_stopTime != null && _startTime != null)
|
||||
return new QualityResult(_collectedRecords, _stopTime.Value - _startTime.Value, sampleRateHz);
|
||||
return new QualityResult();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class QualityResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of records received (read line for LED message)
|
||||
/// </summary>
|
||||
public readonly Int32 TotalLinesCount;
|
||||
/// <summary>
|
||||
/// Total records decoded
|
||||
/// </summary>
|
||||
public readonly Int32 TotalDecodedCount;
|
||||
/// <summary>
|
||||
/// Total errors
|
||||
/// </summary>
|
||||
public readonly Int32 TotalTransportErrorCount;
|
||||
/// <summary>
|
||||
/// Validated without errors
|
||||
/// </summary>
|
||||
public readonly Int32 TotalValidationWithoutErrorsCount;
|
||||
/// <summary>
|
||||
/// Expected lines
|
||||
/// </summary>
|
||||
public readonly Int32 ExpectedLinesCount;
|
||||
/// <summary>
|
||||
/// Time
|
||||
/// </summary>
|
||||
public readonly TimeSpan TotalTime;
|
||||
/// <summary>
|
||||
/// Error counter
|
||||
/// </summary>
|
||||
public readonly Dictionary<UInt16, Int32> ErrorOccurredCounter;
|
||||
|
||||
/// <summary>
|
||||
/// The real result of quality check
|
||||
/// </summary>
|
||||
/// <param name="collectedRecords"></param>
|
||||
/// <param name="ts"></param>
|
||||
/// <param name="sampleRateHz"></param>
|
||||
public QualityResult(List<String> collectedRecords, TimeSpan ts, Int32 sampleRateHz)
|
||||
{
|
||||
TotalLinesCount = collectedRecords.Count;
|
||||
TotalTime = ts;
|
||||
ExpectedLinesCount = (Int32)(Math.Round( ts.TotalSeconds * sampleRateHz, 0));
|
||||
ExpectedLinesCount = (Int32)(Math.Round(ts.TotalSeconds * sampleRateHz, 0));
|
||||
ErrorOccurredCounter = new Dictionary<UInt16, Int32>();
|
||||
foreach (var rawText in collectedRecords)
|
||||
{
|
||||
@@ -140,6 +193,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The quality result as dummy zero
|
||||
/// </summary>
|
||||
public QualityResult()
|
||||
{
|
||||
TotalLinesCount = 0;
|
||||
|
||||
@@ -23,7 +23,12 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
/// All channels required to process
|
||||
/// </summary>
|
||||
public Boolean AllChannelsRequired = true;
|
||||
private const bool QualityWatchMode = false;
|
||||
|
||||
/// <summary>
|
||||
/// Quality watch mode can be used to decode intermediate records and check
|
||||
/// for actual quality of the measurements.
|
||||
/// </summary>
|
||||
public Boolean QualityWatchMode;
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +74,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
displayStateString = ByteStyler.ToString(displayState);
|
||||
if (displayStateString != "00-00-00-00")
|
||||
{
|
||||
WriteRegister(Register.Genesisflow.TriggerActive, 1, true);
|
||||
WriteRegister(Register.Genesisflow.TriggerActive, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,9 +84,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
}
|
||||
|
||||
|
||||
WriteRegister("GENESISFLOW_DisplayPow10", (new Byte[] { 0x00, 0x00, 0x00, 0xFA }).Reverse().ToArray(), true, false);
|
||||
WriteRegister(Register.Genesisflow.StoreCalibration, 1, true);
|
||||
WriteRegister(Register.Genesisflow.StoreConfiguration, 1, true);
|
||||
WriteRegister("GENESISFLOW_DisplayPow10", (new Byte[] { 0x00, 0x00, 0x00, 0xFA }).Reverse().ToArray());
|
||||
WriteRegister(Register.Genesisflow.StoreCalibration, 1);
|
||||
WriteRegister(Register.Genesisflow.StoreConfiguration, 1);
|
||||
|
||||
|
||||
//}
|
||||
@@ -233,15 +238,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
if (_listOfIMeasurement.All(m => m.MeasurementState == MeasurementStates.IsRunning)
|
||||
|| _listOfIMeasurement.All(m => m.MeasurementState == MeasurementStates.IsCompleted))
|
||||
{
|
||||
if (QualityWatchMode)
|
||||
{
|
||||
SyncStreamingBuffer(SyncMarkRecord.DecodeIntermediateQuality);
|
||||
}
|
||||
else
|
||||
{
|
||||
SyncStreamingBuffer(SyncMarkRecord.SkipDecoding);
|
||||
}
|
||||
|
||||
SyncStreamingBuffer(QualityWatchMode
|
||||
? SyncMarkRecord.DecodeIntermediateQuality
|
||||
: SyncMarkRecord.SkipDecoding);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -263,35 +262,27 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
if (onlyChannelNr.HasValue)
|
||||
{
|
||||
var measurement = _listOfIMeasurement.First(f => f.GetChannel() == onlyChannelNr.Value);
|
||||
if (measurement == null)
|
||||
{
|
||||
return MeasurementStates.NotStarted;
|
||||
}
|
||||
|
||||
return measurement.GetMeasurementState();
|
||||
}
|
||||
return _listOfIMeasurement.Min(m => m.MeasurementState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool RequestIntermediateMeasurementState(Int32? onlyChannelNr = null)
|
||||
public Boolean RequestIntermediateMeasurementState(Int32? onlyChannelNr = null)
|
||||
{
|
||||
_logger.Trace($"Slot:{Slot} - Get measurement state");
|
||||
if (!_listOfIMeasurement.Any())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool? ret = null;
|
||||
Boolean? ret = null;
|
||||
foreach (var item in _listOfIMeasurement)
|
||||
{
|
||||
if (!onlyChannelNr.HasValue || item.GetChannel() == onlyChannelNr.Value)
|
||||
{
|
||||
var measurement = _listOfIMeasurement.First(f => f.GetChannel() == onlyChannelNr.Value);
|
||||
if (measurement != null &&
|
||||
(measurement.MeasurementState == MeasurementStates.IsRunning
|
||||
|| measurement.MeasurementState == MeasurementStates.IsWaitingForIntermediateData))
|
||||
var measurement = _listOfIMeasurement.First(f => onlyChannelNr != null && f.GetChannel() == onlyChannelNr.Value);
|
||||
if ((measurement.MeasurementState == MeasurementStates.IsRunning
|
||||
|| measurement.MeasurementState == MeasurementStates.IsWaitingForIntermediateData))
|
||||
{
|
||||
measurement.RequestIntermediateRecord();
|
||||
if (!ret.HasValue)
|
||||
@@ -307,8 +298,5 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
}
|
||||
return ret.HasValue ? ret.Value : false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.Properties;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.Consts
|
||||
{
|
||||
|
||||
@@ -969,20 +969,18 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
/// <summary>
|
||||
/// Load file from memory
|
||||
/// </summary>
|
||||
/// <param name="Name">origin Name</param>
|
||||
/// /// <param name="StreamData">list of bytes of the file strean</param>
|
||||
/// <param name="name">origin Name</param>
|
||||
/// <param name="streamData">list of bytes of the file strean</param>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2022-Feb-15" author="Thomas Wiedebusch">
|
||||
/// - Initial
|
||||
/// </remarks>
|
||||
public Boolean LoadLutFromStream(String Name, List<Byte> StreamData )
|
||||
public Boolean LoadLutFromStream(String name, List<Byte> streamData )
|
||||
{
|
||||
|
||||
|
||||
LutFile = null;
|
||||
LutFile = new MeterLutFile(Name)
|
||||
LutFile = new MeterLutFile(name)
|
||||
{
|
||||
BinData = StreamData
|
||||
BinData = streamData
|
||||
};
|
||||
|
||||
// validate the file
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
///// <remarks date="2019-Mai-15" author="Thomas Wiedebusch">
|
||||
///// - Initial.
|
||||
///// </remarks>
|
||||
///// <remarks date="2020-Mai-15" author="Roland Drahbesh">
|
||||
///// <remarks date="2020-Mai-15" author="Roland Drabesch">
|
||||
///// - Insert of Level 3 password with skeletonKey,
|
||||
///// - SHA 1 of passwords.
|
||||
///// </remarks>
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
#region Variables
|
||||
|
||||
// Template of FLEXNETVERSION has to be modified for version, version string and CRC
|
||||
private static readonly Byte[] TemplateUpg18File =
|
||||
private static readonly Byte[] TemplateUpgradeFile =
|
||||
{
|
||||
0x41, 0x50, 0x50, 0x3E, 0x83, 0xBA, 0x47, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00,
|
||||
@@ -39,7 +39,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
};
|
||||
|
||||
// upgrade file for FLEXNETVERSION
|
||||
private Byte[] _upg18File;
|
||||
private Byte[] _upgradeFile;
|
||||
|
||||
// FLEXNETVERSION application Id
|
||||
private const Byte FlexnetVersionAppId = 0x18;
|
||||
@@ -54,7 +54,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
public event EventHandler<ProcessExecEventArgs> OnProcessUpdate;
|
||||
|
||||
//disk and name of lookup file
|
||||
private const String StrFlexnetUpgradeFileName = "1\\upg18";
|
||||
private static readonly String StrFlexnetUpgradeFileName = $"1\\upg{FlexnetVersionAppId:X2}";
|
||||
|
||||
//update reties for files
|
||||
private const Int32 FileWriteRetries = 1;
|
||||
@@ -83,9 +83,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
private MeterResetPsuState _meterResetPsuState;
|
||||
private MeterResetPsuState _backupMeterResetPsuState;
|
||||
|
||||
// Look up table file
|
||||
public MeterLutFile LutFile;
|
||||
|
||||
// number of operations for over all access
|
||||
private const Int32 NumberOfOperations = 11;
|
||||
private Int32 _operationCtr;
|
||||
@@ -291,7 +288,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
/// </remarks>
|
||||
public void ResetAll()
|
||||
{
|
||||
LutFile = null;
|
||||
//remove the update stop action
|
||||
StopUpdateProcess = false;
|
||||
|
||||
@@ -509,8 +505,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
}
|
||||
|
||||
// generate the upgrade file based on the template
|
||||
_upg18File = new Byte[TemplateUpg18File.Length];
|
||||
Buffer.BlockCopy(TemplateUpg18File, 0, _upg18File, 0, _upg18File.Length);
|
||||
_upgradeFile = new Byte[TemplateUpgradeFile.Length];
|
||||
Buffer.BlockCopy(TemplateUpgradeFile, 0, _upgradeFile, 0, _upgradeFile.Length);
|
||||
|
||||
// rebuild numerical version out of the string because the FLEXNETVERSION version cannot be used
|
||||
// as it does lose the "B" information on conversion which is represented with the mask 0x80.
|
||||
@@ -537,21 +533,21 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
strVersion = "R";
|
||||
}
|
||||
|
||||
_upg18File[MeterFwUpdate.FileAppVersionIndex] = (Byte)(hexVersion & 0xFF);
|
||||
_upg18File[MeterFwUpdate.FileAppVersionIndex + 1] = (Byte)((hexVersion & 0xFF00) >> 8);
|
||||
_upgradeFile[MeterFwUpdate.FileAppVersionIndex] = (Byte)(hexVersion & 0xFF);
|
||||
_upgradeFile[MeterFwUpdate.FileAppVersionIndex + 1] = (Byte)((hexVersion & 0xFF00) >> 8);
|
||||
|
||||
// build the version string and copy it to the upgrade file
|
||||
strVersion += $"{charVersion[0]}.{charVersion[1]}.{charVersion[2]}{charVersion[3]}";
|
||||
var upg18Idx = FlexVersionStringIndex;
|
||||
foreach (var t in strVersion)
|
||||
{
|
||||
_upg18File[upg18Idx] = Convert.ToByte(t);
|
||||
_upgradeFile[upg18Idx] = Convert.ToByte(t);
|
||||
upg18Idx++;
|
||||
}
|
||||
|
||||
// take the payload starting with version index
|
||||
var payload = new Byte[_upg18File.Length - MeterFwUpdate.FileAppVersionIndex];
|
||||
Buffer.BlockCopy(_upg18File, MeterFwUpdate.FileAppVersionIndex, payload, 0, payload.Length);
|
||||
var payload = new Byte[_upgradeFile.Length - MeterFwUpdate.FileAppVersionIndex];
|
||||
Buffer.BlockCopy(_upgradeFile, MeterFwUpdate.FileAppVersionIndex, payload, 0, payload.Length);
|
||||
var calculatedCrc = Crc16Ccitt.CalculateMsb1021(payload);
|
||||
|
||||
// avoid replacement wit invalid generated FLEXNETVERSION
|
||||
@@ -561,8 +557,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
}
|
||||
|
||||
// replace the CRC
|
||||
_upg18File[MeterFwUpdate.FileAppCrcIndex] = (Byte)(calculatedCrc & 0xFF);
|
||||
_upg18File[MeterFwUpdate.FileAppCrcIndex + 1] = (Byte)((calculatedCrc & 0xFF00) >> 8);
|
||||
_upgradeFile[MeterFwUpdate.FileAppCrcIndex] = (Byte)(calculatedCrc & 0xFF);
|
||||
_upgradeFile[MeterFwUpdate.FileAppCrcIndex + 1] = (Byte)((calculatedCrc & 0xFF00) >> 8);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -577,7 +573,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
private Boolean DownloadUpgradeFile()
|
||||
{
|
||||
//initiate upgrade by writing the upgrade control file
|
||||
if (_upg18File == null || _upg18File.Length != TemplateUpg18File.Length ||
|
||||
if (_upgradeFile == null || _upgradeFile.Length != TemplateUpgradeFile.Length ||
|
||||
!_meterFile.UnlockEraseWriteMeterFile(StrFlexnetUpgradeFileName))
|
||||
{
|
||||
return false;
|
||||
@@ -590,7 +586,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
//write file and retry if not successful
|
||||
do
|
||||
{
|
||||
returnValue = _meterFile.WriteMeterFile(StrFlexnetUpgradeFileName, _upg18File);
|
||||
returnValue = _meterFile.WriteMeterFile(StrFlexnetUpgradeFileName, _upgradeFile);
|
||||
|
||||
if (!returnValue)
|
||||
{
|
||||
@@ -598,7 +594,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
}
|
||||
} while (!returnValue && retryCtr++ < FileWriteRetries && !StopUpdateProcess);
|
||||
|
||||
_upg18File = null;
|
||||
_upgradeFile = null;
|
||||
return !StopUpdateProcess && returnValue;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
// internal struct Enum8
|
||||
public struct Enum8
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
public struct Rpc
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
/// <summary>
|
||||
/// Unknown to define restore capability
|
||||
/// </summary>
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const String UnknownAccess = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -30,11 +31,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
/// <summary>
|
||||
/// Denied restore capability
|
||||
/// </summary>
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const String RestoreDenied = "dynamic";
|
||||
|
||||
/// <summary>
|
||||
/// Unpredictable restore capability
|
||||
/// </summary>
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const String RestoreUnpredictable = "infrequentlyupdated";
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
public struct StatusT
|
||||
{
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
|
||||
public struct TimeT
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
public class UInt96
|
||||
{
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
internal class st_radio_dewa
|
||||
{
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes
|
||||
{
|
||||
internal class st_radio_tfx
|
||||
{
|
||||
|
||||
@@ -128,9 +128,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
}
|
||||
else if(type == typeof(Boolean))
|
||||
{
|
||||
var checkValue = RegisterConverter.ConvertTo<Boolean>(value);
|
||||
|
||||
|
||||
// var checkValue = RegisterConverter.ConvertTo<Boolean>(value);
|
||||
RegisterConverter.ConvertTo<Boolean>(value);
|
||||
|
||||
//if (reg.Minimum.HasValue && checkValue < reg.Minimum.Value)
|
||||
//{
|
||||
// return MinText(true, checkValue.ToString(), reg.Minimum.Value.ToString(), reg.RegisterName);
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
public static Byte[] ConvertFrom<T>(T value)
|
||||
{
|
||||
var converted = new Byte[] {0};
|
||||
if (value == null) return converted;
|
||||
if (value is UInt16)
|
||||
{
|
||||
var tmp = Convert.ToUInt16(value);
|
||||
|
||||
@@ -99,24 +99,24 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Boolean Equals(Object obj)
|
||||
{
|
||||
return obj is RegisterDefinition fooItem && GetHashCode() == fooItem.GetHashCode();
|
||||
}
|
||||
///// <inheritdoc />
|
||||
//public override Boolean Equals(Object obj)
|
||||
//{
|
||||
// return obj is RegisterDefinition fooItem && GetHashCode() == fooItem.GetHashCode();
|
||||
//}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Int32 GetHashCode()
|
||||
{
|
||||
var hashCode = base.GetHashCode();
|
||||
if (RegisterDetail == null) return hashCode;
|
||||
hashCode ^= RegisterDetail.GetHashCode();
|
||||
if (RegisterDetail.Version != null)
|
||||
{
|
||||
hashCode ^= RegisterDetail.Version.GetHashCode();
|
||||
}
|
||||
///// <inheritdoc />
|
||||
//public override Int32 GetHashCode()
|
||||
//{
|
||||
// var hashCode = base.GetHashCode();
|
||||
// if (RegisterDetail == null) return hashCode;
|
||||
// hashCode ^= RegisterDetail.GetHashCode();
|
||||
// if (RegisterDetail.Version != null)
|
||||
// {
|
||||
// hashCode ^= RegisterDetail.Version.GetHashCode();
|
||||
// }
|
||||
|
||||
return hashCode;
|
||||
}
|
||||
// return hashCode;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.RegisterProperties
|
||||
{
|
||||
/// <summary>
|
||||
/// Representing the 8 access levels meter register can have
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
{
|
||||
public static readonly String Privilege = "CONFIGEXCHANGE_Privilege";
|
||||
public static readonly String Password = "CONFIGEXCHANGE_Password";
|
||||
public static readonly String PCBSerialNumber = "CONFIGEXCHANGE_PCBSerialNumber";
|
||||
public static readonly String PcbSerialNumber = "CONFIGEXCHANGE_PCBSerialNumber";
|
||||
public static readonly String FileOpen = "CONFIGEXCHANGE_FOpen";
|
||||
public static readonly String FileClose = "CONFIGEXCHANGE_FClose";
|
||||
public static readonly String FileWrite = "CONFIGEXCHANGE_FWrite";
|
||||
@@ -116,7 +116,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
{
|
||||
Configexchange.Privilege,
|
||||
Configexchange.Password,
|
||||
Configexchange.PCBSerialNumber,
|
||||
Configexchange.PcbSerialNumber,
|
||||
Configexchange.FileOpen,
|
||||
Configexchange.FileClose,
|
||||
Configexchange.FileWrite,
|
||||
|
||||
@@ -1,40 +1,100 @@
|
||||
namespace Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts
|
||||
{
|
||||
/// <summary>
|
||||
/// Display codes to keep the user informed about the production and processing step.
|
||||
/// This is useful as the user doesn't need to connect the device to a PC, he can
|
||||
/// immediately inspect the status of the device.
|
||||
/// </summary>
|
||||
public enum DisplayCodes
|
||||
{
|
||||
//general
|
||||
//general information
|
||||
/// <summary>
|
||||
/// Status not set
|
||||
/// </summary>
|
||||
None = 0x0000,
|
||||
/// <summary>
|
||||
/// Error state
|
||||
/// </summary>
|
||||
Error = 0xFFFF,
|
||||
|
||||
|
||||
//Production proccess
|
||||
//Production process
|
||||
//assembly line
|
||||
//Picking
|
||||
/// <summary>
|
||||
/// Picking in progress
|
||||
/// </summary>
|
||||
PickingStarted = 0x7700,
|
||||
/// <summary>
|
||||
/// Picking succeeded, next step can be initiated
|
||||
/// </summary>
|
||||
PickingTested = 0x7777,
|
||||
/// <summary>
|
||||
/// Picking failed
|
||||
/// </summary>
|
||||
PickingFailed = 0xFF77,
|
||||
|
||||
//Pressure
|
||||
/// <summary>
|
||||
/// Pressure testing succeeded, next step can be initiated
|
||||
/// </summary>
|
||||
PressureTested = 0x1111,
|
||||
/// <summary>
|
||||
/// Pressure test failed
|
||||
/// </summary>
|
||||
PressureTestedFailed = 0xFF11,
|
||||
|
||||
//Marriage
|
||||
/// <summary>
|
||||
/// Connection between PCBID, Serial Number and Order number done
|
||||
/// </summary>
|
||||
Mounted = 0x2222,
|
||||
|
||||
//Testbench
|
||||
//Test bench
|
||||
/// <summary>
|
||||
/// Zero flow test succeeded, next step can be initiated
|
||||
/// </summary>
|
||||
ZeroFlow = 0x3333,
|
||||
/// <summary>
|
||||
/// Zero flow test failed
|
||||
/// </summary>
|
||||
ZeroFlowFailed = 0xFF33,
|
||||
/// <summary>
|
||||
/// Flow calibration succeeded, next step can be initiated
|
||||
/// </summary>
|
||||
FlowCalibrated = 0x4444,
|
||||
/// <summary>
|
||||
/// Flow calibration failed
|
||||
/// </summary>
|
||||
FlowCalibrationOurOfRange = 0xFF44,
|
||||
/// <summary>
|
||||
/// Flow test succeeded, next step can be initiated
|
||||
/// </summary>
|
||||
FlowTested = 0x5555,
|
||||
/// <summary>
|
||||
/// Flow test failed
|
||||
/// </summary>
|
||||
FlowTestFailed = 0xFF55,
|
||||
|
||||
//End of line / final test
|
||||
/// <summary>
|
||||
/// Final test failed, else the display will be switched to operational mode,
|
||||
/// showing the actual accumulated volume
|
||||
/// </summary>
|
||||
FinalTestFailed = 0xFF66,
|
||||
|
||||
//FWUpdate
|
||||
/// <summary>
|
||||
/// FW update is ongoing
|
||||
/// </summary>
|
||||
FwUpdateActive = 0x8888,
|
||||
/// <summary>
|
||||
/// FW update failed
|
||||
/// </summary>
|
||||
FwUpdateFailed = 0xFF88,
|
||||
/// <summary>
|
||||
/// FW update succeeded
|
||||
/// </summary>
|
||||
FwUpToDate = 0x9999,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,13 @@ namespace Xylem.Common.Hardware.WaterMeter.WaterMeterCore
|
||||
/// <returns></returns>
|
||||
MeasurementStates GetMeasurementState(Int32? onlyChannelNr = null );
|
||||
|
||||
/// <summary>
|
||||
/// Request for intermediate measurement state.
|
||||
/// </summary>
|
||||
/// <param name="onlyChannelNr"></param>
|
||||
/// <returns></returns>
|
||||
Boolean RequestIntermediateMeasurementState(Int32? onlyChannelNr = null);
|
||||
|
||||
/// <summary>
|
||||
/// set up calibration parameter (calibration factor to default) and set meter into calibration mode
|
||||
/// </summary>
|
||||
|
||||
@@ -24,14 +24,14 @@ namespace Xylem.Common.Hardware.WaterMeter.WaterMeterCore
|
||||
{
|
||||
private readonly List<MeterTypeRegisters> _meterTypeRegistersCollection = new List<MeterTypeRegisters>();
|
||||
private readonly ILogger _logger;
|
||||
private readonly string _sourceLocation;
|
||||
private readonly String _sourceLocation;
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public MeterBatch(String SourceLocation = "")
|
||||
public MeterBatch(String sourceLocation = "")
|
||||
{
|
||||
SourceLocation = _sourceLocation;
|
||||
_sourceLocation = sourceLocation;
|
||||
_logger = NLogHelper.CreateOrGetLogger("MeterBatch");
|
||||
|
||||
_logger.Info("Meter batch created");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters
|
||||
{
|
||||
@@ -8,10 +7,6 @@ namespace Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters
|
||||
/// </summary>
|
||||
public class MeterTypeRegisters
|
||||
{
|
||||
/// <summary>
|
||||
/// registers list for this meter
|
||||
/// </summary>
|
||||
//public readonly List<IRegister> Registers;
|
||||
/// <summary>
|
||||
/// meter type
|
||||
/// </summary>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3
|
||||
1a3d4919c9c702245832d925951f2b7cb72fc333
|
||||
|
||||
@@ -3,84 +3,167 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for calibration results
|
||||
/// </summary>
|
||||
public class CalibrationResult
|
||||
{
|
||||
private UInt32 calFactor1;
|
||||
private UInt32 calFactor2;
|
||||
private UInt32 calFactor3;
|
||||
private Int32 zeroOffset1;
|
||||
private Int32 zeroOffset2;
|
||||
private Int32 zeroOffset3;
|
||||
private UInt16 firstHitUpdatePeriod;
|
||||
private UInt16 firstHitShift;
|
||||
private UInt16 firstHitPercent1;
|
||||
private UInt16 firstHitPercent2;
|
||||
private UInt16 firstHitPercent3;
|
||||
private Int32 toFTempOffset1;
|
||||
private Int32 toFTempOffset2;
|
||||
private Int32 toFTempOffset3;
|
||||
private UInt16 meterSize;
|
||||
/// <summary>
|
||||
/// The meter size code.
|
||||
/// </summary>
|
||||
public UInt16 MeterSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Calibration factor of path 1.
|
||||
/// </summary>
|
||||
public UInt32 CalFactor1 { get; set; }
|
||||
|
||||
public UInt16 MeterSize { get => meterSize; set => meterSize = value; }
|
||||
public UInt32 CalFactor1 { get => calFactor1; set => calFactor1 = value; }
|
||||
public UInt32 CalFactor2 { get => calFactor2; set => calFactor2 = value; }
|
||||
public UInt32 CalFactor3 { get => calFactor3; set => calFactor3 = value; }
|
||||
public Int32 ZeroOffset1 { get => zeroOffset1; set => zeroOffset1 = value; }
|
||||
public Int32 ZeroOffset2 { get => zeroOffset2; set => zeroOffset2 = value; }
|
||||
public Int32 ZeroOffset3 { get => zeroOffset3; set => zeroOffset3 = value; }
|
||||
/// <summary>
|
||||
/// Calibration factor of path 2.
|
||||
/// </summary>
|
||||
public UInt32 CalFactor2 { get; set; }
|
||||
|
||||
public UInt16 FirstHitUpdatePeriod { get => firstHitUpdatePeriod; set => firstHitUpdatePeriod = value; }
|
||||
/// <summary>
|
||||
/// Calibration factor of path 3.
|
||||
/// </summary>
|
||||
public UInt32 CalFactor3 { get; set; }
|
||||
|
||||
public UInt16 FirstHitShift { get => firstHitShift; set => firstHitShift = value; }
|
||||
public UInt16 FirstHitPercent1 { get => firstHitPercent1; set => firstHitPercent1 = value; }
|
||||
public UInt16 FirstHitPercent2 { get => firstHitPercent2; set => firstHitPercent2 = value; }
|
||||
public UInt16 FirstHitPercent3 { get => firstHitPercent3; set => firstHitPercent3 = value; }
|
||||
public Int32 ToFTempOffset1 { get => toFTempOffset1; set => toFTempOffset1 = value; }
|
||||
public Int32 ToFTempOffset2 { get => toFTempOffset2; set => toFTempOffset2 = value; }
|
||||
public Int32 ToFTempOffset3 { get => toFTempOffset3; set => toFTempOffset3 = value; }
|
||||
/// <summary>
|
||||
/// Zero flow offset value of path 1.
|
||||
/// </summary>
|
||||
public Int32 ZeroOffset1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Zero flow offset value of path 2.
|
||||
/// </summary>
|
||||
public Int32 ZeroOffset2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Zero flow offset value of path 3.
|
||||
/// </summary>
|
||||
public Int32 ZeroOffset3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// First hit level update period.
|
||||
/// </summary>
|
||||
public UInt16 FirstHitUpdatePeriod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// First hit level shift value.
|
||||
/// </summary>
|
||||
public UInt16 FirstHitShift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// First hit level percentage of path 1.
|
||||
/// </summary>
|
||||
public UInt16 FirstHitPercent1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// First hit level percentage of path 2.
|
||||
/// </summary>
|
||||
public UInt16 FirstHitPercent2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// First hit level percentage of path 3.
|
||||
/// </summary>
|
||||
public UInt16 FirstHitPercent3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time of flight temperature offset of path 1.
|
||||
/// </summary>
|
||||
public Int32 ToFTempOffset1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time of flight temperature offset of path 2.
|
||||
/// </summary>
|
||||
public Int32 ToFTempOffset2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time of flight temperature offset of path 3.
|
||||
/// </summary>
|
||||
public Int32 ToFTempOffset3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time and date of this record.
|
||||
/// </summary>
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data base entry.
|
||||
/// </summary>
|
||||
public Int32 DbId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary of additional logging information.
|
||||
/// </summary>
|
||||
public Dictionary<String, String> AdditionalLogInfos;
|
||||
|
||||
/// <summary>
|
||||
/// ctor.
|
||||
/// </summary>
|
||||
public CalibrationResult()
|
||||
{
|
||||
AdditionalLogInfos = new Dictionary<String, String>();
|
||||
}
|
||||
public CalibrationResult(UInt32 roCalFactor1, UInt32 roCalFactor2, UInt32 roCalFactor3, Int32 roZeroOffset1, Int32 roZeroOffset2, Int32 roZeroOffset3, UInt16 roFirstHitUpdatePeriod, UInt16 roFirstHitShift, UInt16 roFirstHitPercent1, UInt16 roFirstHitPercent2, UInt16 roFirstHitPercent3, Int32 roToFTempOffset1, Int32 roToFTempOffset2, Int32 roToFTempOffset3, UInt16 roMeterSize)
|
||||
|
||||
/// <summary>
|
||||
/// Calibration results
|
||||
/// </summary>
|
||||
/// <param name="roCalFactor1"></param>
|
||||
/// <param name="roCalFactor2"></param>
|
||||
/// <param name="roCalFactor3"></param>
|
||||
/// <param name="roZeroOffset1"></param>
|
||||
/// <param name="roZeroOffset2"></param>
|
||||
/// <param name="roZeroOffset3"></param>
|
||||
/// <param name="roFirstHitUpdatePeriod"></param>
|
||||
/// <param name="roFirstHitShift"></param>
|
||||
/// <param name="roFirstHitPercent1"></param>
|
||||
/// <param name="roFirstHitPercent2"></param>
|
||||
/// <param name="roFirstHitPercent3"></param>
|
||||
/// <param name="roToFTempOffset1"></param>
|
||||
/// <param name="roToFTempOffset2"></param>
|
||||
/// <param name="roToFTempOffset3"></param>
|
||||
/// <param name="roMeterSize"></param>
|
||||
public CalibrationResult(UInt32 roCalFactor1, UInt32 roCalFactor2, UInt32 roCalFactor3,
|
||||
Int32 roZeroOffset1, Int32 roZeroOffset2, Int32 roZeroOffset3,
|
||||
UInt16 roFirstHitUpdatePeriod, UInt16 roFirstHitShift,
|
||||
UInt16 roFirstHitPercent1, UInt16 roFirstHitPercent2, UInt16 roFirstHitPercent3,
|
||||
Int32 roToFTempOffset1, Int32 roToFTempOffset2, Int32 roToFTempOffset3,
|
||||
UInt16 roMeterSize)
|
||||
{
|
||||
CalFactor1 = roCalFactor1;
|
||||
CalFactor2 = roCalFactor2;
|
||||
CalFactor3 = roCalFactor3;
|
||||
ZeroOffset1 = roToFTempOffset1;
|
||||
ZeroOffset2 = roToFTempOffset1;
|
||||
ZeroOffset3 = roToFTempOffset1;
|
||||
ZeroOffset1 = roZeroOffset1;
|
||||
ZeroOffset2 = roZeroOffset2;
|
||||
ZeroOffset3 = roZeroOffset3;
|
||||
FirstHitUpdatePeriod = roFirstHitUpdatePeriod;
|
||||
FirstHitShift = roFirstHitShift;
|
||||
FirstHitPercent1 = roFirstHitPercent1;
|
||||
FirstHitPercent2 = roFirstHitPercent2;
|
||||
FirstHitPercent3 = roFirstHitPercent3;
|
||||
ToFTempOffset1 = roToFTempOffset1;
|
||||
ToFTempOffset2 = roToFTempOffset1;
|
||||
ToFTempOffset3 = roToFTempOffset1;
|
||||
ToFTempOffset2 = roToFTempOffset2;
|
||||
ToFTempOffset3 = roToFTempOffset3;
|
||||
MeterSize = roMeterSize;
|
||||
AdditionalLogInfos = new Dictionary<String, String>();
|
||||
}
|
||||
|
||||
public void AddAditonlaLog(String key, String value)
|
||||
/// <summary>
|
||||
/// Additional logging information
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public void AddAdditionalLog(String key, String value)
|
||||
{
|
||||
if (AdditionalLogInfos.ContainsKey(key))
|
||||
{
|
||||
AdditionalLogInfos[key] = $"{ AdditionalLogInfos[key]} {System.Environment.NewLine} {value}";
|
||||
AdditionalLogInfos[key] = $"{ AdditionalLogInfos[key]} {Environment.NewLine} {value}";
|
||||
}
|
||||
else
|
||||
{
|
||||
AdditionalLogInfos.Add(key, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for look-up-table (LUT) information, file assignment and content
|
||||
/// </summary>
|
||||
public class CordonelMetrologyLut
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int FileId { get; set; }
|
||||
public string FileName { get; set; }
|
||||
/// <summary>
|
||||
/// Data base primary key.
|
||||
/// </summary>
|
||||
public Int32 Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File identification number of real LUT.
|
||||
/// </summary>
|
||||
public Int32 FileId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File name of LUT.
|
||||
/// </summary>
|
||||
public String FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Meter size code for LUT.
|
||||
/// </summary>
|
||||
public MeterSize MeterSize { get; set; }
|
||||
public string Region { get; set; }
|
||||
public int FileCrc { get; set; }
|
||||
public bool CurrentVerionForProd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Region for LUT.
|
||||
/// </summary>
|
||||
public String Region { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CRC of LUT.
|
||||
/// </summary>
|
||||
public Int32 FileCrc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Marker of version for production, this is the actual selected version for this
|
||||
/// meter size and region.
|
||||
/// </summary>
|
||||
public Boolean CurrentVersionForProd { get; set; }
|
||||
|
||||
public int DataLength { get; set; }
|
||||
/// <summary>
|
||||
/// Data length of LUT.
|
||||
/// </summary>
|
||||
public Int32 DataLength { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
public byte[] FileContent { get; set; }
|
||||
/// <summary>
|
||||
/// Version of LUT.
|
||||
/// </summary>
|
||||
public String Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Binary file content of LUT.
|
||||
/// </summary>
|
||||
public Byte[] FileContent { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
/// <summary>
|
||||
/// Return the file name as string.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override String ToString()
|
||||
{
|
||||
return FileName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumeration of marriage status.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum MarriagePossibleEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Unmarried.
|
||||
/// </summary>
|
||||
None = 1 << 0,
|
||||
|
||||
/// <summary>
|
||||
/// Marriage is possible.
|
||||
/// </summary>
|
||||
Possible = 1 << 1,
|
||||
NotPossibleDueAlredayMatch = 1 << 2,
|
||||
|
||||
/// <summary>
|
||||
/// Denied as it is already married.
|
||||
/// </summary>
|
||||
NotPossibleDueToAlreadyMarried = 1 << 2,
|
||||
|
||||
/// <summary>
|
||||
/// Denied as serial number is already in use.
|
||||
/// </summary>
|
||||
NotPossibleDueSerialNumberBlocked = 1 << 3,
|
||||
NotPossibleDuePcblocked = 1 << 4,
|
||||
|
||||
/// <summary>
|
||||
/// Denied as PCB is already in use.
|
||||
/// </summary>
|
||||
NotPossibleDuePcbLocked = 1 << 4,
|
||||
|
||||
/// <summary>
|
||||
/// Denied as PCB and order number mismatch.
|
||||
/// </summary>
|
||||
PcbNotMatchingOrder = 1 << 5,
|
||||
|
||||
/// <summary>
|
||||
/// Error during marriage.
|
||||
/// </summary>
|
||||
Error = 1 << 6,
|
||||
NotPossibleDueNoPressureTestFound = 1 << 7,
|
||||
NotPossibleDueNoHeTestFound = 1 << 8,
|
||||
|
||||
@@ -1,34 +1,57 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumeration of meter sizes named as flow tube inner diameter,
|
||||
/// DNx is for the metric system with the unit millimeters mm and
|
||||
/// USx is for the imperial system with the unit inches inc or ".
|
||||
///
|
||||
/// ATTENTION:
|
||||
/// These values are sorted and duplicated in the data base, be
|
||||
/// aware not to change the series!
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public enum MeterSize
|
||||
{
|
||||
DN40 = 0,
|
||||
/// <summary>
|
||||
/// Inner tube is 40 mm metric
|
||||
/// </summary>
|
||||
DN40 = 0,
|
||||
DN50 = 1,
|
||||
DN65 = 2,
|
||||
DN80 = 3,
|
||||
DN100 = 4,
|
||||
DN125 = 5,
|
||||
DN150 = 6,
|
||||
DN200 = 7,
|
||||
DN250 = 8,
|
||||
DN300 = 9,
|
||||
|
||||
/// <summary>
|
||||
/// Inner tube is 1 1/2" imperial
|
||||
/// </summary>
|
||||
US1_5 = 10,
|
||||
|
||||
/// <summary>
|
||||
/// Inner tube is 2" imperial
|
||||
/// </summary>
|
||||
US2 = 11,
|
||||
US3 = 12,
|
||||
US4 = 13,
|
||||
US6 = 14,
|
||||
US8 = 15,
|
||||
US10 = 16,
|
||||
US12 = 17,
|
||||
|
||||
/* The diameters of all other sizes are taken from the meter size below: */
|
||||
DN50, /* e.g. 40mm flowtube */
|
||||
DN65, /* 50mm flowtube etc. */
|
||||
DN80,
|
||||
DN100,
|
||||
DN125,
|
||||
DN150,
|
||||
DN200,
|
||||
DN250,
|
||||
DN300,
|
||||
/// <summary>
|
||||
/// Undefined maximum value
|
||||
/// </summary>
|
||||
DNMAX,
|
||||
|
||||
/* The following are all US meter sizes in inches */
|
||||
US1_5,
|
||||
US2,
|
||||
US3,
|
||||
US4,
|
||||
US6,
|
||||
US8,
|
||||
US10,
|
||||
US12,
|
||||
|
||||
DNMAX, /* Used for range checking */
|
||||
|
||||
NAN
|
||||
/// <summary>
|
||||
/// Not assigned as list delimiter
|
||||
/// </summary>
|
||||
NA
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Picking check and process state.
|
||||
/// </summary>
|
||||
public class PickingCompareItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// </summary>
|
||||
/// <param name="meterSize"></param>
|
||||
/// <param name="frequencyIndicator"></param>
|
||||
/// <param name="pressurePresent"></param>
|
||||
/// <param name="checkAppsIdVersion"></param>
|
||||
public PickingCompareItem(UInt32 meterSize, UInt32 frequencyIndicator, Boolean pressurePresent, Dictionary<UInt32, UInt32> checkAppsIdVersion)
|
||||
{
|
||||
MeterSize = meterSize;
|
||||
@@ -15,33 +24,73 @@ namespace Logic.ProductionToProductMapper.Cordonel
|
||||
CheckAppsIdVersion = checkAppsIdVersion;
|
||||
}
|
||||
|
||||
public UInt32 MeterSize { get; private set; }
|
||||
public UInt32 FrequencyIndicator { get; private set; }
|
||||
public Boolean PressurePresent { get; private set; }
|
||||
/// <summary>
|
||||
/// Meter size number.
|
||||
/// </summary>
|
||||
public UInt32 MeterSize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Frequency
|
||||
/// </summary>
|
||||
public UInt32 FrequencyIndicator { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Pressure sensor attached.
|
||||
/// </summary>
|
||||
public Boolean PressurePresent { get; }
|
||||
|
||||
public Boolean PulseModule { get; private set; }
|
||||
/// <summary>
|
||||
/// Pulse module assembled.
|
||||
/// </summary>
|
||||
public Boolean PulseModule { get; set; }
|
||||
|
||||
public Dictionary<UInt32, UInt32> CheckAppsIdVersion { get; private set; }
|
||||
/// <summary>
|
||||
/// Applications installed.
|
||||
/// </summary>
|
||||
public Dictionary<UInt32, UInt32> CheckAppsIdVersion { get; }
|
||||
|
||||
|
||||
public int StrLutFileId { get; private set; }
|
||||
/// <summary>
|
||||
/// LUT file identification.
|
||||
/// </summary>
|
||||
public Int32 StrLutFileId { get; set; }
|
||||
|
||||
public UInt16 Version { get; private set; }
|
||||
public UInt16 FileCrc { get; private set; }
|
||||
|
||||
//order overview
|
||||
public UInt32 OrderCount { get; private set; }
|
||||
public UInt32 OrderAssignedCount { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUT version.
|
||||
/// </summary>
|
||||
public UInt16 LutVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUT file CRC.
|
||||
/// </summary>
|
||||
public UInt16 LutFileCrc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Order count of Cordonels.
|
||||
/// </summary>
|
||||
public UInt32 OrderCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Assigned Cordonels to order number.
|
||||
/// </summary>
|
||||
public UInt32 OrderAssignedCount { get; set; }
|
||||
}
|
||||
|
||||
public class OrderOverViewCordonelWithPicking
|
||||
{
|
||||
/// <summary>
|
||||
/// Overview of Cordonels on assembly line tests
|
||||
/// /// </summary>
|
||||
public OrderOverViewCordonel OrderOverViewCordonel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public PickingCompareItem PickingCompareItem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// KITRON production data
|
||||
/// </summary>
|
||||
public DateTime KitronProductionDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
public class RegisterHisory
|
||||
{
|
||||
public RegisterHisory(String pcbId, Byte[] address, Byte[] value, DateTimeOffset date)
|
||||
{
|
||||
PcbId = pcbId;
|
||||
Address = address;
|
||||
Value = value;
|
||||
Date = date;
|
||||
}
|
||||
|
||||
public String PcbId { get; set; }
|
||||
public Byte[] Address { get; set; }
|
||||
public Byte[] Value { get; set; }
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Register history monitor.
|
||||
/// </summary>
|
||||
public class RegisterHistory
|
||||
{
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// </summary>
|
||||
/// <param name="pcbId"></param>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="date"></param>
|
||||
public RegisterHistory(String pcbId, Byte[] address, Byte[] value, DateTimeOffset date)
|
||||
{
|
||||
PcbId = pcbId;
|
||||
Address = address;
|
||||
Value = value;
|
||||
Date = date;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PCB identification.
|
||||
/// </summary>
|
||||
public String PcbId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Register address.
|
||||
/// </summary>
|
||||
public Byte[] Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Register value.
|
||||
/// </summary>
|
||||
public Byte[] Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time and date of this register value.
|
||||
/// </summary>
|
||||
public DateTimeOffset Date { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,58 @@
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Cordonel
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for skipping several checks in the production steps being able to
|
||||
/// have special editions, which do not follow the general rules.
|
||||
/// </summary>
|
||||
public class SkipProcess
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int OrderNumber { get; set; }
|
||||
public int PcbId { get; set; }
|
||||
public bool SkipRadioParameters { get; set; }
|
||||
public bool SkipFWCheck { get; set; }
|
||||
public bool SkipBatteyCheck { get; set; }
|
||||
public bool SkipLUT { get; set; }
|
||||
/// <summary>
|
||||
/// Data base primary key
|
||||
/// </summary>
|
||||
public Int32 Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Order number
|
||||
/// </summary>
|
||||
public Int32 OrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unique identification number of PCB
|
||||
/// </summary>
|
||||
public Int32 PcbId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip radio parameter check
|
||||
/// </summary>
|
||||
public Boolean SkipRadioParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip FW check. 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.
|
||||
/// </summary>
|
||||
public Boolean SkipFWCheck { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip the battery check, as the drained load may exceed the defined level. For
|
||||
/// special devices, e.g. customer samples, which do not need the life time of
|
||||
/// 20 years, this can be set.
|
||||
/// </summary>
|
||||
public Boolean SkipBatteyCheck { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip the look-up-table installation as this device may be used for development.
|
||||
/// </summary>
|
||||
public Boolean SkipLUT { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Date of assignment of these skipping-rules.
|
||||
/// </summary>
|
||||
public DateTime Date { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Author of assignment of these skipping-rules.
|
||||
/// </summary>
|
||||
public String Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace Logic.ProductionToProductMapper.Files.Fw
|
||||
{
|
||||
/// <summary>
|
||||
/// Clustered file container
|
||||
/// </summary>
|
||||
public class ClusteredFile
|
||||
{
|
||||
public Boolean IsSelected { get; set; }
|
||||
@@ -12,9 +15,13 @@ namespace Logic.ProductionToProductMapper.Files.Fw
|
||||
public Boolean FileIsForDeveloperOnly { get; set; }
|
||||
public Int32 FileCategoryID { get; set; }
|
||||
public Boolean FileIsDeleted { get; set; }
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public Int32? CordonelFwFile_id { get; set; }
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public Int32? CordonelFwFile_FileClusterStoreId { get; set; }
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public Int32? CordonelFwFile_Dn { get; set; }
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public Int32? CordonelFwFile_Type { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<Compile Include="Cordonel\MarriagePossibleEnum.cs" />
|
||||
<Compile Include="Cordonel\MeterSizeConverter.cs" />
|
||||
<Compile Include="Cordonel\PickingCompareItem.cs" />
|
||||
<Compile Include="Cordonel\RegisterHisory.cs" />
|
||||
<Compile Include="Cordonel\RegisterHistory.cs" />
|
||||
<Compile Include="Cordonel\SkipProcess.cs" />
|
||||
<Compile Include="Files\Fw\ClusteredFile.cs" />
|
||||
<Compile Include="Files\Fw\FilePart.cs" />
|
||||
|
||||
@@ -1,23 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Csd
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for customer specific document - CSD which represents
|
||||
/// the customer requirements for the final setup of the Cordonel.
|
||||
/// </summary>
|
||||
public class CsdParameterResult
|
||||
{
|
||||
public int Lvl { get; set; }
|
||||
public bool IsValid { get; set; }
|
||||
public int SourceCsdId { get; set; }
|
||||
public int SourceProductId { get; set; }
|
||||
public int SourceGroupId { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ValueText { get; set; }
|
||||
public byte[] Value { get; set; }
|
||||
/// <summary>
|
||||
/// Level
|
||||
/// </summary>
|
||||
public Int32 Lvl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Setting is valid
|
||||
/// </summary>
|
||||
public Boolean IsValid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD source identifier
|
||||
/// </summary>
|
||||
public Int32 SourceCsdId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD product identifier
|
||||
/// </summary>
|
||||
public Int32 SourceProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD source group identifier
|
||||
/// </summary>
|
||||
public Int32 SourceGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD entry identifier for a specific setting
|
||||
/// </summary>
|
||||
public Int32 Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD entry name
|
||||
/// </summary>
|
||||
public String Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD value as text
|
||||
/// </summary>
|
||||
public String ValueText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CSD value
|
||||
/// </summary>
|
||||
public Byte[] Value { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.FW
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.FW
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumeration for FW type as combination of region and radio frequency
|
||||
/// </summary>
|
||||
public enum CordonelFWTypeEnum
|
||||
{
|
||||
EMEA_433,
|
||||
|
||||
@@ -1,17 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.File
|
||||
{
|
||||
public class BaseFile
|
||||
/// <summary>
|
||||
/// File base class
|
||||
/// </summary>
|
||||
public class BaseFile
|
||||
{
|
||||
public int? FileId { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public string FileContent { get; set; }
|
||||
/// <summary>
|
||||
/// Optional file identifier
|
||||
/// </summary>
|
||||
public Int32? FileId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File name
|
||||
/// </summary>
|
||||
public String FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File content as string
|
||||
/// </summary>
|
||||
public String FileContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional file creation date
|
||||
/// </summary>
|
||||
public DateTimeOffset? UploadDate { get; set; }
|
||||
public bool? IsLatest { get; set; }
|
||||
public bool? ForDeveloper { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Marker for latest file, is important if several files have an identical name
|
||||
/// and different versions.
|
||||
/// </summary>
|
||||
public Boolean? IsLatest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Special file for development which will not be used for production.
|
||||
/// </summary>
|
||||
public Boolean? ForDeveloper { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore
|
||||
// ReSharper disable once EmptyNamespace
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore
|
||||
{
|
||||
|
||||
//public abstract class BaseOrder
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
{
|
||||
[JsonProperty("$id")]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long Id { get; set; }
|
||||
public Int64 Id { get; set; }
|
||||
|
||||
[JsonProperty("TestStepResults")]
|
||||
public TestStep TestStepResults { get; set; }
|
||||
@@ -28,168 +28,168 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
[JsonProperty("TestID")]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long TestId { get; set; }
|
||||
public Int64 TestId { get; set; }
|
||||
|
||||
[JsonProperty("TestPlace")]
|
||||
public string TestPlace { get; set; }
|
||||
public String TestPlace { get; set; }
|
||||
|
||||
[JsonProperty("TestAdapter")]
|
||||
public string TestAdapter { get; set; }
|
||||
public String TestAdapter { get; set; }
|
||||
|
||||
[JsonProperty("MaterialNumber")]
|
||||
public string MaterialNumber { get; set; }
|
||||
public String MaterialNumber { get; set; }
|
||||
|
||||
[JsonProperty("PanelBarcode")]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long PanelBarcode { get; set; }
|
||||
public Int64 PanelBarcode { get; set; }
|
||||
|
||||
[JsonProperty("TestProgramm")]
|
||||
public string TestProgramm { get; set; }
|
||||
public String TestProgramm { get; set; }
|
||||
|
||||
[JsonProperty("TestProgramVer")]
|
||||
public string TestProgramVer { get; set; }
|
||||
public String TestProgramVer { get; set; }
|
||||
|
||||
[JsonProperty("TestBoardSerialNr")]
|
||||
public string TestBoardSerialNr { get; set; }
|
||||
public String TestBoardSerialNr { get; set; }
|
||||
|
||||
[JsonProperty("TestBoardVersionInfo")]
|
||||
public string TestBoardVersionInfo { get; set; }
|
||||
public String TestBoardVersionInfo { get; set; }
|
||||
|
||||
[JsonProperty("TestOperator")]
|
||||
public string TestOperator { get; set; }
|
||||
public String TestOperator { get; set; }
|
||||
|
||||
[JsonProperty("TestMachineName")]
|
||||
public string TestMachineName { get; set; }
|
||||
public String TestMachineName { get; set; }
|
||||
|
||||
|
||||
|
||||
[JsonProperty("TestNumber")]
|
||||
public string TestNumber { get; set; }
|
||||
public String TestNumber { get; set; }
|
||||
|
||||
[JsonProperty("StartDT")]
|
||||
public string StartDt { get; set; }
|
||||
public String StartDt { get; set; }
|
||||
|
||||
[JsonProperty("TestDuration")]
|
||||
public string TestDuration { get; set; }
|
||||
public String TestDuration { get; set; }
|
||||
|
||||
[JsonProperty("TestResult")]
|
||||
public Result TestResult { get; set; }
|
||||
|
||||
[JsonProperty("AttachmentFile")]
|
||||
public string AttachmentFile { get; set; }
|
||||
public String AttachmentFile { get; set; }
|
||||
}
|
||||
|
||||
public partial class TestStep
|
||||
public class TestStep
|
||||
{
|
||||
[JsonProperty("$id")]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long Id { get; set; }
|
||||
public Int64 Id { get; set; }
|
||||
|
||||
[JsonProperty("$values")]
|
||||
public Value[] Values { get; set; }
|
||||
}
|
||||
|
||||
public partial class Value
|
||||
public class Value
|
||||
{
|
||||
[JsonProperty("$id")]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long Id { get; set; }
|
||||
public Int64 Id { get; set; }
|
||||
|
||||
[JsonProperty("TestDate", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public DateTimeOffset? TestDate { get; set; }
|
||||
|
||||
[JsonProperty("Barcode", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long? Barcode { get; set; }
|
||||
public Int64? Barcode { get; set; }
|
||||
|
||||
[JsonProperty("ResultCalibration", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string ResultCalibration { get; set; }
|
||||
public String ResultCalibration { get; set; }
|
||||
|
||||
[JsonProperty("TestLoop", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long? TestLoop { get; set; }
|
||||
public Int64? TestLoop { get; set; }
|
||||
|
||||
[JsonProperty("LengthCode", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string LengthCode { get; set; }
|
||||
public String LengthCode { get; set; }
|
||||
|
||||
[JsonProperty("RunCalibrate", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string RunCalibrate { get; set; }
|
||||
public String RunCalibrate { get; set; }
|
||||
|
||||
[JsonProperty("RFCalibrationCurrent", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string RfCalibrationCurrent { get; set; }
|
||||
public String RfCalibrationCurrent { get; set; }
|
||||
|
||||
[JsonProperty("RFCalibrationPower", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string RfCalibrationPower { get; set; }
|
||||
public String RfCalibrationPower { get; set; }
|
||||
|
||||
[JsonProperty("iPowerLevelCalculated", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string IPowerLevelCalculated { get; set; }
|
||||
public String IPowerLevelCalculated { get; set; }
|
||||
|
||||
[JsonProperty("iExternalPowerlevel", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(ParseStringConverter))]
|
||||
public long? IExternalPowerlevel { get; set; }
|
||||
public Int64? IExternalPowerlevel { get; set; }
|
||||
|
||||
[JsonProperty("iAntennaMatching", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string IAntennaMatching { get; set; }
|
||||
public String IAntennaMatching { get; set; }
|
||||
|
||||
[JsonProperty("sLookupTablePower", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string SLookupTablePower { get; set; }
|
||||
public String SLookupTablePower { get; set; }
|
||||
|
||||
[JsonProperty("dReferenceCurrent1", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferenceCurrent1 { get; set; }
|
||||
public String DReferenceCurrent1 { get; set; }
|
||||
|
||||
[JsonProperty("dReferenceCurrentLow1", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferenceCurrentLow1 { get; set; }
|
||||
public String DReferenceCurrentLow1 { get; set; }
|
||||
|
||||
[JsonProperty("dReferenceCurrentHigh1", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferenceCurrentHigh1 { get; set; }
|
||||
public String DReferenceCurrentHigh1 { get; set; }
|
||||
|
||||
[JsonProperty("dReferencePower1", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferencePower1 { get; set; }
|
||||
public String DReferencePower1 { get; set; }
|
||||
|
||||
[JsonProperty("dReferencePowerLow1", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferencePowerLow1 { get; set; }
|
||||
public String DReferencePowerLow1 { get; set; }
|
||||
|
||||
[JsonProperty("dReferencePowerHigh1", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public DReferencePowerHigh1? DReferencePowerHigh1 { get; set; }
|
||||
|
||||
[JsonProperty("RunRemeasure", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string RunRemeasure { get; set; }
|
||||
public String RunRemeasure { get; set; }
|
||||
|
||||
[JsonProperty("ResultRemeasure", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string ResultRemeasure { get; set; }
|
||||
public String ResultRemeasure { get; set; }
|
||||
|
||||
[JsonProperty("RFRemeasureCurrent", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string RfRemeasureCurrent { get; set; }
|
||||
public String RfRemeasureCurrent { get; set; }
|
||||
|
||||
[JsonProperty("RFRemeasurePower", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string RfRemeasurePower { get; set; }
|
||||
public String RfRemeasurePower { get; set; }
|
||||
|
||||
[JsonProperty("dReferenceCurrent2", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferenceCurrent2 { get; set; }
|
||||
public String DReferenceCurrent2 { get; set; }
|
||||
|
||||
[JsonProperty("dReferenceCurrentLow2", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferenceCurrentLow2 { get; set; }
|
||||
public String DReferenceCurrentLow2 { get; set; }
|
||||
|
||||
[JsonProperty("dReferenceCurrentHigh2", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferenceCurrentHigh2 { get; set; }
|
||||
public String DReferenceCurrentHigh2 { get; set; }
|
||||
|
||||
[JsonProperty("dReferencePower2", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferencePower2 { get; set; }
|
||||
public String DReferencePower2 { get; set; }
|
||||
|
||||
[JsonProperty("dReferencePowerLow2", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferencePowerLow2 { get; set; }
|
||||
public String DReferencePowerLow2 { get; set; }
|
||||
|
||||
[JsonProperty("dReferencePowerHigh2", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string DReferencePowerHigh2 { get; set; }
|
||||
public String DReferencePowerHigh2 { get; set; }
|
||||
|
||||
[JsonProperty("TestStepName", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string TestStepName { get; set; }
|
||||
public String TestStepName { get; set; }
|
||||
|
||||
[JsonProperty("TestStepType", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string TestStepType { get; set; }
|
||||
public String TestStepType { get; set; }
|
||||
|
||||
[JsonProperty("TestStepDesc", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string TestStepDesc { get; set; }
|
||||
public String TestStepDesc { get; set; }
|
||||
|
||||
[JsonProperty("TestInstrument", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public TestInstrument? TestInstrument { get; set; }
|
||||
@@ -198,22 +198,22 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
public TestTypeMeasured? TestTypeMeasured { get; set; }
|
||||
|
||||
[JsonProperty("StartDT", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string StartDt { get; set; }
|
||||
public String StartDt { get; set; }
|
||||
|
||||
[JsonProperty("TestDuration", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string TestDuration { get; set; }
|
||||
public String TestDuration { get; set; }
|
||||
|
||||
[JsonProperty("Result", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Result? Result { get; set; }
|
||||
|
||||
[JsonProperty("TestValue", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string TestValue { get; set; }
|
||||
public String TestValue { get; set; }
|
||||
|
||||
[JsonProperty("Units", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Units? Units { get; set; }
|
||||
|
||||
[JsonProperty("LowerLimit", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string LowerLimit { get; set; }
|
||||
public String LowerLimit { get; set; }
|
||||
|
||||
[JsonProperty("UpperLimit", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public UpperLimit? UpperLimit { get; set; }
|
||||
@@ -239,25 +239,27 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
public enum Units { Db, Empty, KHz, MA, Volt, ΜA };
|
||||
|
||||
public partial struct UpperLimit
|
||||
public struct UpperLimit
|
||||
{
|
||||
public DReferencePowerHigh1? Enum;
|
||||
public long? Integer;
|
||||
public Int64? Integer;
|
||||
|
||||
public static implicit operator UpperLimit(DReferencePowerHigh1 Enum) => new UpperLimit { Enum = Enum };
|
||||
public static implicit operator UpperLimit(long Integer) => new UpperLimit { Integer = Integer };
|
||||
public static implicit operator UpperLimit(DReferencePowerHigh1 enumeration) => new UpperLimit { Enum = enumeration };
|
||||
public static implicit operator UpperLimit(Int64 integer) => new UpperLimit { Integer = integer };
|
||||
}
|
||||
|
||||
public partial class RadioTest
|
||||
{
|
||||
public static RadioTest FromJson(string json)
|
||||
public static RadioTest FromJson(String json)
|
||||
{
|
||||
if (string.IsNullOrEmpty(json)) return new RadioTest { TestResult = Result.Fail };
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
if (json.Contains("\"JsonObject\":"))
|
||||
{
|
||||
var newFromat = JsonConvert.DeserializeObject<Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Root>(json);
|
||||
var newFromat = JsonConvert.DeserializeObject<Root>(json);
|
||||
//breakt down all and pass all data to the old format
|
||||
|
||||
var alternateReturnObj = new RadioTest();
|
||||
@@ -272,57 +274,57 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
}
|
||||
alternateReturnObj.StartDt = newFromat.JsonObject.StartDT;
|
||||
alternateReturnObj.TestStepLoopCalibrate = new TestStep();
|
||||
alternateReturnObj.TestStepLoopCalibrate.Values = new Value[23];
|
||||
alternateReturnObj.TestStepLoopCalibrate = new TestStep
|
||||
{
|
||||
Values = new Value[23]
|
||||
};
|
||||
|
||||
var TestStepLoopCalibrateToAdd = new List<Value>();
|
||||
var testStepLoopCalibrateToAdd = new List<Value>();
|
||||
|
||||
JObject joResponse = JObject.Parse(json);
|
||||
var joResponse = JObject.Parse(json);
|
||||
|
||||
var loopCount = 0;
|
||||
if (joResponse["JsonObject"] == null) return new RadioTest { TestResult = Result.Fail };
|
||||
|
||||
var Hit = true;
|
||||
|
||||
|
||||
int loopCount = 0;
|
||||
foreach (var item in joResponse["JsonObject"].Children())
|
||||
{
|
||||
|
||||
if (item is JProperty pitem)
|
||||
if (item is JProperty pItem)
|
||||
{
|
||||
if (pitem.Name == $"ResultCalibration Loop_{loopCount +1}")
|
||||
if (pItem.Name == $"ResultCalibration Loop_{loopCount +1}")
|
||||
{
|
||||
if (pitem.Value.ToString() == "ok")
|
||||
if (pItem.Value.ToString() == "ok")
|
||||
{
|
||||
|
||||
TestStepLoopCalibrateToAdd.Add(new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value());
|
||||
TestStepLoopCalibrateToAdd[loopCount].ResultCalibration = pitem.Value.ToString();
|
||||
TestStepLoopCalibrateToAdd[loopCount].SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower();
|
||||
loopCount = loopCount + 1;
|
||||
testStepLoopCalibrateToAdd.Add(new Value());
|
||||
testStepLoopCalibrateToAdd[loopCount].ResultCalibration = pItem.Value.ToString();
|
||||
testStepLoopCalibrateToAdd[loopCount].SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower();
|
||||
loopCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (pitem.Name == $"LengthCode Loop_{loopCount}")
|
||||
if (pItem.Name == $"LengthCode Loop_{loopCount}")
|
||||
{
|
||||
if (TestStepLoopCalibrateToAdd.Count == loopCount)
|
||||
if (testStepLoopCalibrateToAdd.Count == loopCount)
|
||||
{
|
||||
TestStepLoopCalibrateToAdd[loopCount-1].LengthCode = pitem.Value.ToString();
|
||||
testStepLoopCalibrateToAdd[loopCount-1].LengthCode = pItem.Value.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
if (pitem.Name == $"PowerLevelCalculated Loop_{loopCount}")
|
||||
if (pItem.Name == $"PowerLevelCalculated Loop_{loopCount}")
|
||||
{
|
||||
if (TestStepLoopCalibrateToAdd.Count == loopCount)
|
||||
if (testStepLoopCalibrateToAdd.Count == loopCount)
|
||||
{
|
||||
TestStepLoopCalibrateToAdd[loopCount-1].IPowerLevelCalculated = pitem.Value.ToString();
|
||||
testStepLoopCalibrateToAdd[loopCount-1].IPowerLevelCalculated = pItem.Value.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (pitem.Name == $"AntennaMatching Loop_{loopCount}")
|
||||
if (pItem.Name == $"AntennaMatching Loop_{loopCount}")
|
||||
{
|
||||
if (TestStepLoopCalibrateToAdd.Count == loopCount)
|
||||
if (testStepLoopCalibrateToAdd.Count == loopCount)
|
||||
{
|
||||
TestStepLoopCalibrateToAdd[loopCount-1].IAntennaMatching = pitem.Value.ToString();
|
||||
testStepLoopCalibrateToAdd[loopCount-1].IAntennaMatching = pItem.Value.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -335,27 +337,23 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
//}
|
||||
|
||||
}
|
||||
int i = 0;
|
||||
foreach (var item in TestStepLoopCalibrateToAdd)
|
||||
Int32 i = 0;
|
||||
foreach (var item in testStepLoopCalibrateToAdd)
|
||||
{
|
||||
alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(item, i);
|
||||
i = i + 1;
|
||||
i += 1;
|
||||
}
|
||||
|
||||
return alternateReturnObj;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return JsonConvert.DeserializeObject<RadioTest>(json, KitronTestResults.Converter.Settings);
|
||||
return JsonConvert.DeserializeObject<RadioTest>(json, Converter.Settings);
|
||||
|
||||
}
|
||||
catch (global::System.Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return new RadioTest() { TestResult = Result.Fail };
|
||||
return new RadioTest { TestResult = Result.Fail };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +361,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
public static class Serialize
|
||||
{
|
||||
public static string ToJson(this RadioTest self) => JsonConvert.SerializeObject(self, Converter.Settings);
|
||||
public static String ToJson(this RadioTest self) => JsonConvert.SerializeObject(self, Converter.Settings);
|
||||
}
|
||||
|
||||
internal static class Converter
|
||||
@@ -389,38 +387,33 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class ParseStringConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(Int64) || t == typeof(Int64?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
long l;
|
||||
if (Int64.TryParse(value, out l))
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
Int64 l;
|
||||
if (long.TryParse(value, out l))
|
||||
{
|
||||
return l;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
throw new Exception("Cannot unmarshal type long");
|
||||
return -1;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
serializer.Serialize(writer, null);
|
||||
return;
|
||||
}
|
||||
var value = (long)untypedValue;
|
||||
var value = (Int64)untypedValue;
|
||||
serializer.Serialize(writer, value.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
public static readonly ParseStringConverter Singleton = new ParseStringConverter();
|
||||
@@ -428,16 +421,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class ResultConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(Result) || t == typeof(Result?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(Result) || t == typeof(Result?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
case "FAIL":
|
||||
@@ -448,7 +441,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
throw new Exception("Cannot unmarshal type Result");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
@@ -473,16 +466,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class AttachmentFileConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(AttachmentFile) || t == typeof(AttachmentFile?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(AttachmentFile) || t == typeof(AttachmentFile?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
case "":
|
||||
@@ -491,12 +484,10 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
return AttachmentFile.DatenGenesisMfgradiotest433MHzV324Bin;
|
||||
default:
|
||||
return AttachmentFile.Empty;
|
||||
|
||||
}
|
||||
throw new Exception("Cannot unmarshal type AttachmentFile");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
@@ -521,16 +512,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class FailDescConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(FailDesc) || t == typeof(FailDesc?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(FailDesc) || t == typeof(FailDesc?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
|
||||
@@ -541,10 +532,9 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
default:
|
||||
return FailDesc.Empty;
|
||||
}
|
||||
throw new Exception("Cannot unmarshal type FailDesc");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
@@ -572,16 +562,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class TestInstrumentConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(TestInstrument) || t == typeof(TestInstrument?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(TestInstrument) || t == typeof(TestInstrument?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
case "":
|
||||
@@ -599,7 +589,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
// throw new Exception("Cannot unmarshal type TestInstrument");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
@@ -633,16 +623,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class TestTypeMeasuredConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(TestTypeMeasured) || t == typeof(TestTypeMeasured?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(TestTypeMeasured) || t == typeof(TestTypeMeasured?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
case "":
|
||||
@@ -656,10 +646,10 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
case "Read from Measuring Device":
|
||||
return TestTypeMeasured.ReadFromMeasuringDevice;
|
||||
}
|
||||
return TestTypeMeasured.Empty; ; // throw new Exception("Cannot unmarshal type TestTypeMeasured");
|
||||
return TestTypeMeasured.Empty;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
@@ -693,16 +683,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class UnitsConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(Units) || t == typeof(Units?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(Units) || t == typeof(Units?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
case "":
|
||||
@@ -721,7 +711,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
throw new Exception("Cannot unmarshal type Units");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
@@ -758,15 +748,15 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class UpperLimitConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(UpperLimit) || t == typeof(UpperLimit?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(UpperLimit) || t == typeof(UpperLimit?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
switch (reader.TokenType)
|
||||
{
|
||||
case JsonToken.String:
|
||||
case JsonToken.Date:
|
||||
var stringValue = serializer.Deserialize<string>(reader);
|
||||
var stringValue = serializer.Deserialize<String>(reader);
|
||||
switch (stringValue)
|
||||
{
|
||||
case "":
|
||||
@@ -793,17 +783,11 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
return new UpperLimit { Enum = DReferencePowerHigh1.Empty };
|
||||
|
||||
}
|
||||
long l;
|
||||
if (Int64.TryParse(stringValue, out l))
|
||||
{
|
||||
return new UpperLimit { Integer = l };
|
||||
}
|
||||
break;
|
||||
}
|
||||
throw new Exception("Cannot unmarshal type UpperLimit");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
var value = (UpperLimit)untypedValue;
|
||||
if (value.Enum != null)
|
||||
@@ -855,16 +839,16 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
|
||||
internal class DReferencePowerHigh1Converter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type t) => t == typeof(DReferencePowerHigh1) || t == typeof(DReferencePowerHigh1?);
|
||||
public override Boolean CanConvert(Type t) => t == typeof(DReferencePowerHigh1) || t == typeof(DReferencePowerHigh1?);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||
public override Object ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var value = serializer.Deserialize<string>(reader);
|
||||
var value = serializer.Deserialize<String>(reader);
|
||||
switch (value)
|
||||
{
|
||||
case "":
|
||||
@@ -892,7 +876,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults
|
||||
//throw new Exception("Cannot unmarshal type DReferencePowerHigh1");
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, Object untypedValue, JsonSerializer serializer)
|
||||
{
|
||||
if (untypedValue == null)
|
||||
{
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
using System;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
/// <summary>
|
||||
/// Order overview of assembly line tests to collect the states of the tested devices.
|
||||
/// </summary>
|
||||
public class OrderOverViewCordonel
|
||||
{
|
||||
|
||||
|
||||
public int OrderNumber { get; set; }
|
||||
public int Count { get; set; }
|
||||
public int AssignedPicking { get; set; }
|
||||
public int PressureTested { get; set; }
|
||||
public int HeliumTested { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Order number
|
||||
/// </summary>
|
||||
public Int32 OrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of devices assigned to this order number
|
||||
/// </summary>
|
||||
public Int32 Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of assigned devices.
|
||||
/// </summary>
|
||||
public Int32 AssignedPicking { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///Number of pressure tested devices
|
||||
/// </summary>
|
||||
public Int32 PressureTested { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of helium tested devices
|
||||
/// </summary>
|
||||
public Int32 HeliumTested { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,14 +15,13 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
public static class OrderProgrammingParameters
|
||||
{
|
||||
public static List<ProgrammingParameters> GetProgrammingParameters(string PcbID, string connectionString)
|
||||
public static List<ProgrammingParameters> GetProgrammingParameters(String pcbID, String connectionString)
|
||||
{
|
||||
var ret = new List<ProgrammingParameters>();
|
||||
|
||||
var orderNr = 0;
|
||||
Int32 orderNr;
|
||||
|
||||
|
||||
using (var dataacces = new SqlDataAccess(connectionString))
|
||||
using (var dataAccess = new SqlDataAccess(connectionString))
|
||||
{
|
||||
|
||||
var sb = new StringBuilder();
|
||||
@@ -33,18 +32,18 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
sb.AppendLine($" left outer join Auftrag.dbo.AuftragPositionSerienNr mapSrn on map.[MapPcbIdToSerialNumber_SerialNumber] = mapSrn.SerienNr and mapSrn.Pruefgangnr = 0 ");
|
||||
sb.AppendLine($" left outer join Auftrag.dbo.AlleAuftragPositionen auftraginfo on auftraginfo.AuftragNr = mapSrn.AuftragNr and auftraginfo.PositionNr = mapSrn.PositionNr ");
|
||||
|
||||
sb.AppendLine($" where mapOrder.CordonelPressureTest_PcbId = '{PcbID}'");
|
||||
sb.AppendLine($" where mapOrder.CordonelPressureTest_PcbId = '{pcbID}'");
|
||||
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
if (MapData.Rows.Count != 1)
|
||||
var mapData = dataAccess.ExecuteQuery(sb.ToString());
|
||||
if (mapData.Rows.Count != 1)
|
||||
{
|
||||
throw new ApplicationException("No base data found");
|
||||
|
||||
}
|
||||
orderNr = (int)MapData.Rows[0]["CordonelPressureTest_FertigungsAuftragsNr"];
|
||||
orderNr = (Int32)mapData.Rows[0]["CordonelPressureTest_FertigungsAuftragsNr"];
|
||||
|
||||
}
|
||||
var radioParams = OrderRadioParameter.GetRadioPramas(PcbID, connectionString);
|
||||
var radioParams = OrderRadioParameter.GetRadioParams(pcbID, connectionString);
|
||||
|
||||
ret.Add(new ProgrammingParameters("SENSUSRADIO_RadioAddress", BitConverter.GetBytes(radioParams.RadioAddress).Reverse().ToArray()));
|
||||
|
||||
@@ -83,11 +82,11 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(connectionString, rawVako.Type);
|
||||
var vakoData = VakoParser.Parse(rawVako, rawMapping);
|
||||
|
||||
var CsdIdent = vakoData.KeyValues.FirstOrDefault(a => a.Name == "C_GEN_CSD").Value;
|
||||
var csdIdent = vakoData.KeyValues.FirstOrDefault(a => a.Name == "C_GEN_CSD")?.Value;
|
||||
|
||||
|
||||
|
||||
using (var dataacces = new SqlDataAccess(connectionString))
|
||||
using (var dataAccess = new SqlDataAccess(connectionString))
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($" SELECT ");
|
||||
@@ -103,47 +102,47 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
sb.AppendLine($" or (KEYNAME = '{item.Name}' and KeyValue = '{item.Charcode.Replace("\'", "\'\'")}') ");
|
||||
}
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
var mapData = dataAccess.ExecuteQuery(sb.ToString());
|
||||
|
||||
foreach (DataRow row in MapData.Rows)
|
||||
foreach (DataRow row in mapData.Rows)
|
||||
{
|
||||
ret.Add(new ProgrammingParameters(row["RegisterName"].ToString(), (byte[])row["RegisterValue"], ProgrammingSource.Vako));
|
||||
ret.Add(new ProgrammingParameters(row["RegisterName"].ToString(), (Byte[])row["RegisterValue"]));
|
||||
}
|
||||
}
|
||||
|
||||
var MeterSize = BitConverter.ToUInt32(ret.Find(a => a.RegisterName == "GENESISFLOW_MeterSize").RegisterValue.Reverse().ToArray(), 0);
|
||||
var DisplayUnits = BitConverter.ToInt32(ret.Find(a => a.RegisterName == "GENESISFLOW_DisplayUnits").RegisterValue.Reverse().ToArray(), 0);
|
||||
var FlowUnits = BitConverter.ToInt32(ret.Find(a => a.RegisterName == "METROLOGYASST_FlowUnits").RegisterValue.Reverse().ToArray(), 0);
|
||||
var meterSize = BitConverter.ToUInt32(ret.Find(a => a.RegisterName == "GENESISFLOW_MeterSize").RegisterValue.Reverse().ToArray(), 0);
|
||||
var displayUnits = BitConverter.ToInt32(ret.Find(a => a.RegisterName == "GENESISFLOW_DisplayUnits").RegisterValue.Reverse().ToArray(), 0);
|
||||
var flowUnits = BitConverter.ToInt32(ret.Find(a => a.RegisterName == "METROLOGYASST_FlowUnits").RegisterValue.Reverse().ToArray(), 0);
|
||||
|
||||
|
||||
|
||||
|
||||
using (var dataacces = new SqlDataAccess(connectionString))
|
||||
using (var dataAccess = new SqlDataAccess(connectionString))
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($" SELECT ");
|
||||
sb.AppendLine($" CordonelDnDisplayunitDisplaypow10_RegisterIdent as RegisterName, ");
|
||||
sb.AppendLine($" [CordonelDnDisplayunitDisplaypow10_DisplayPow10] as RegisterValue ");
|
||||
sb.AppendLine($" FROM [Auftrag].[dbo].[CordonelDnDisplayunitDisplaypow10] ");
|
||||
sb.AppendLine($" where [CordonelDnDisplayunitDisplaypow10_MeterSize] = {MeterSize} ");
|
||||
sb.AppendLine($" and [CordonelDnDisplayunitDisplaypow10_DisplayUnit] = {DisplayUnits} ");
|
||||
sb.AppendLine($" where [CordonelDnDisplayunitDisplaypow10_MeterSize] = {meterSize} ");
|
||||
sb.AppendLine($" and [CordonelDnDisplayunitDisplaypow10_DisplayUnit] = {displayUnits} ");
|
||||
sb.AppendLine($" union ");
|
||||
sb.AppendLine($" SELECT ");
|
||||
sb.AppendLine($" CordonelDnFlowUnitFlowPoint_RegisterIdent as RegisterName, ");
|
||||
sb.AppendLine($" CAST([CordonelDnFlowUnitFlowPoint_FlowPoint] AS varbinary) as RegisterValue ");
|
||||
sb.AppendLine($" FROM [Auftrag].[dbo].[CordonelDnFlowUnitFlowPoint] ");
|
||||
sb.AppendLine($" where[CordonelDnFlowUnitFlowPoint_FlowUnit] = {FlowUnits} ");
|
||||
sb.AppendLine($" and[CordonelDnFlowUnitFlowPoint_MeterSize] = {MeterSize} ");
|
||||
sb.AppendLine($" where[CordonelDnFlowUnitFlowPoint_FlowUnit] = {flowUnits} ");
|
||||
sb.AppendLine($" and[CordonelDnFlowUnitFlowPoint_MeterSize] = {meterSize} ");
|
||||
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
var mapData = dataAccess.ExecuteQuery(sb.ToString());
|
||||
|
||||
foreach (DataRow row in MapData.Rows)
|
||||
foreach (DataRow row in mapData.Rows)
|
||||
{
|
||||
ret.Add(new ProgrammingParameters(row["RegisterName"].ToString(), RegisterConverter.ConvertFrom(Convert.ToInt32(row["RegisterValue"])), ProgrammingSource.Vako));
|
||||
ret.Add(new ProgrammingParameters(row["RegisterName"].ToString(), RegisterConverter.ConvertFrom(Convert.ToInt32(row["RegisterValue"]))));
|
||||
}
|
||||
}
|
||||
|
||||
var retStr = LocalWebRequest.GetRequest($"http://sla12iis01/csdcore/csdservice/getstampings?CsdIdent={CsdIdent}&GroupId=1&ProductIdent=GNS&ProductDn={rawVako.Dn}&ShowOnlyValidStampings=0", 8000);
|
||||
var retStr = LocalWebRequest.GetRequest($"http://sla12iis01/csdcore/csdservice/getstampings?CsdIdent={csdIdent}&GroupId=1&ProductIdent=GNS&ProductDn={rawVako.Dn}&ShowOnlyValidStampings=0", 8000);
|
||||
var retListRealCsd = JsonConvert.DeserializeObject<List<CsdParameterResult>>(retStr);
|
||||
if (retListRealCsd.Any())
|
||||
{
|
||||
@@ -154,10 +153,6 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
ret.Add(new ProgrammingParameters(csdItemToConvert.Name, ByteStyler.Parse(csdItemToConvert.ValueText, false), ProgrammingSource.Csd));
|
||||
}
|
||||
else
|
||||
{
|
||||
//ret.Add(new ProgrammingParameters(csdItemToConvert.Name,rt.ValueText, ProgrammingSource.Csd));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +162,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
csv.AppendLine($"{item.RegisterName}={ByteStyler.ToString(item.RegisterValue)} (From{item.Source})");
|
||||
}
|
||||
var s = csv.ToString();
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,24 +10,23 @@ using Xylem.Common.Logic.SoftwareAccessHelper;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
/// <summary>
|
||||
/// Radio parameter settings for a specific order.
|
||||
/// </summary>
|
||||
public static class OrderRadioParameter
|
||||
{
|
||||
|
||||
|
||||
|
||||
public static RadioConfigurationParams GetRadioPramas(string PcbId, string connectionString, string pressure = "")
|
||||
public static RadioConfigurationParams GetRadioParams(String pcbId, String connectionString, String pressure = "")
|
||||
{
|
||||
var ret = new RadioConfigurationParams()
|
||||
var ret = new RadioConfigurationParams
|
||||
{
|
||||
PcbId = PcbId
|
||||
PcbId = pcbId
|
||||
};
|
||||
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());
|
||||
|
||||
//ret.EncryptionKey = DefEncryptionKey.ToArray();
|
||||
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());
|
||||
|
||||
using (var dataAccess = new SqlDataAccess(connectionString))
|
||||
{
|
||||
@@ -37,7 +36,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
sb.AppendLine(" declare @DN nvarchar(50) ");
|
||||
sb.AppendLine(" declare @Length nvarchar(50) ");
|
||||
|
||||
sb.AppendLine($" set @PcbId= '{PcbId}' ");
|
||||
sb.AppendLine($" set @PcbId= '{pcbId}' ");
|
||||
|
||||
sb.AppendLine(" SELECT distinct ");
|
||||
sb.AppendLine(" @DN = ident.Nennweite, ");
|
||||
@@ -48,18 +47,19 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
sb.AppendLine(" inner join [Identnr] ident on ap.Identnr = ident.IdentNr ");
|
||||
sb.AppendLine(" where map.MapPcbIdToSerialNumber_PcbId = @PcbId ");
|
||||
|
||||
sb.AppendLine(" SELECT [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON], @DN as [DN] ,@Length as [Length] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBRADIOTEST_PD] ");
|
||||
sb.AppendLine(" SELECT [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON], @DN as [DN] ,@Length as [Length]" +
|
||||
" FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBRADIOTEST_PD] ");
|
||||
sb.AppendLine(" where [ID_PCB] = @PcbId ");
|
||||
sb.AppendLine(" order by ID_TEST desc ");
|
||||
|
||||
var dt = dataAccess.ExecuteQuery(sb.ToString());
|
||||
|
||||
var LengthString = "";
|
||||
var lengthString = "";
|
||||
var dnString = "";
|
||||
foreach (var item in dt.Select())
|
||||
{
|
||||
var jsonString = item["JSON"].ToString();
|
||||
LengthString = item["Length"].ToString();
|
||||
lengthString = item["Length"].ToString();
|
||||
dnString = item["Dn"].ToString();
|
||||
|
||||
var radioTestResult = RadioTest.FromJson(jsonString);
|
||||
@@ -68,50 +68,32 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
try
|
||||
{
|
||||
var offsetParams = radioTestResult.TestStepResults.Values.Where(s => s.Result.HasValue && s.Result.Value == Result.Pass && s.TestStepType == "PCB Send Set Frq Offset").OrderByDescending(o => o.Id);
|
||||
if (offsetParams.Any())
|
||||
var offsetParams = radioTestResult.TestStepResults.Values.Where(s => s.Result.HasValue
|
||||
&& s.Result.Value == Result.Pass
|
||||
&& s.TestStepType == "PCB Send Set Frq Offset").OrderByDescending(o => o.Id);
|
||||
var offsets = offsetParams.ToArray();
|
||||
if (offsets.Any())
|
||||
{
|
||||
ret.FrqOffset = (Int16)new System.ComponentModel.Int16Converter().ConvertFromString(offsetParams.First().TestValue);
|
||||
ret.FrqOffset = Int16.Parse(offsets.First().TestValue);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
if (radioTestResult.TestStepLoopCalibrate.Values.First().SLookupTablePower.Contains("868"))
|
||||
{
|
||||
ret.FrqOffset = (Int16)868;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.FrqOffset = (Int16)434;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
ret.FrqOffset = null;
|
||||
}
|
||||
|
||||
var a = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null
|
||||
&& w.LengthCode != null
|
||||
&& w.ResultCalibration.ToLower() == "ok"
|
||||
&& w.LengthCode.StartsWith($"DN{dnString}")
|
||||
&& w.LengthCode.Contains($"-{lengthString}{pressure}")
|
||||
&& !w.LengthCode.Contains($"-{lengthString}{pressure}o")).ToList();
|
||||
var ao = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null
|
||||
&& w.LengthCode != null
|
||||
&& w.ResultCalibration.ToLower() == "ok"
|
||||
&& w.LengthCode.StartsWith($"DN{dnString}")
|
||||
&& w.LengthCode.Contains($"-{lengthString}{pressure}o")).ToList();
|
||||
|
||||
|
||||
|
||||
var a = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null && ( w.LengthCode != null && w.ResultCalibration.ToLower() == "ok" && w.LengthCode.StartsWith($"DN{dnString}") && w.LengthCode.Contains($"-{LengthString}{pressure}") && !w.LengthCode.Contains($"-{LengthString}{pressure}o"))).ToList();
|
||||
var ao = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null && (w.LengthCode != null && (w.ResultCalibration.ToLower() == "ok" && w.LengthCode.StartsWith($"DN{dnString}") && w.LengthCode.Contains($"-{LengthString}{pressure}o")))).ToList();
|
||||
var snb = new List<string>();
|
||||
|
||||
foreach (var lengthItem in radioTestResult.TestStepLoopCalibrate.Values)
|
||||
{
|
||||
if (lengthItem != null)
|
||||
{
|
||||
snb.Add(lengthItem.LengthCode);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (a.Any() && ao.Any())
|
||||
{
|
||||
if (uint.Parse(a.First().IPowerLevelCalculated) != 0)
|
||||
@@ -119,10 +101,13 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
ret.PowerLevel = uint.Parse(a.First().IPowerLevelCalculated);
|
||||
ret.PowerLevelOption = uint.Parse(ao.First().IPowerLevelCalculated);
|
||||
|
||||
ret.ImpedanceCodeNew = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
|
||||
ret.ImpedanceCodeOption = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(ao.First().IAntennaMatching);
|
||||
var x = new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
if (x != null)
|
||||
ret.ImpedanceCodeNew = (UInt32)x;
|
||||
|
||||
x = new System.ComponentModel.UInt32Converter().ConvertFromString(ao.First().IAntennaMatching);
|
||||
if (x != null)
|
||||
ret.ImpedanceCodeOption = (UInt32)x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,31 +115,27 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
|
||||
ret.PowerLevel = uint.Parse(a.First().IPowerLevelCalculated);
|
||||
ret.PowerLevelOption = uint.Parse(a.First().IPowerLevelCalculated);
|
||||
ret.PowerLevelOption = ret.PowerLevel;
|
||||
|
||||
ret.ImpedanceCodeNew = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(a.First()?.IAntennaMatching);
|
||||
var x = new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
if (x != null)
|
||||
ret.ImpedanceCodeNew = (UInt32)x;
|
||||
|
||||
ret.ImpedanceCodeOption = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(a.First()?.IAntennaMatching);
|
||||
ret.ImpedanceCodeOption = ret.ImpedanceCodeNew;
|
||||
|
||||
}
|
||||
}
|
||||
//return new RadioConfigurationParams();// Encoding.ASCII.GetString(bytes);
|
||||
|
||||
|
||||
//2992 2936
|
||||
|
||||
|
||||
|
||||
}
|
||||
// kein powerlevel gefunden und die baulänge hat die selben einstellwerte wie 200
|
||||
// gilt fuer alte register wo es nur 200 und 311 gab, die parameter für 200 sind gültig 200 - 300
|
||||
if (ret.PowerLevel == 0 && dnString == "50" && LengthString != "200" && LengthString != "311")
|
||||
if (ret.PowerLevel == 0 && dnString == "50" && lengthString != "200" && lengthString != "311")
|
||||
{
|
||||
foreach (var item in dt.Select())
|
||||
{
|
||||
var jsonString = item["JSON"].ToString();
|
||||
LengthString = "200";
|
||||
|
||||
lengthString = "200";
|
||||
|
||||
var radioTestResult = RadioTest.FromJson(jsonString);
|
||||
|
||||
@@ -162,185 +143,140 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
if (radioTestResult.TestStepResults != null && radioTestResult.TestStepResults.Values.Any())
|
||||
{
|
||||
|
||||
|
||||
var offsetParams = radioTestResult.TestStepResults.Values.Where(s => s.Result.HasValue && s.Result.Value == Result.Pass && s.TestStepType == "PCB Send Set Frq Offset").OrderByDescending(o => o.Id);
|
||||
if (offsetParams.Any())
|
||||
var offsetParams = radioTestResult.TestStepResults.Values.Where(s => s.Result.HasValue
|
||||
&& s.Result.Value == Result.Pass
|
||||
&& s.TestStepType == "PCB Send Set Frq Offset").OrderByDescending(o => o.Id);
|
||||
var offsets = offsetParams.ToArray();
|
||||
if (offsets.Any())
|
||||
{
|
||||
ret.FrqOffset = (Int16)new System.ComponentModel.Int16Converter().ConvertFromString(offsetParams.First().TestValue);
|
||||
ret.FrqOffset = Int16.Parse(offsets.First().TestValue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (radioTestResult.TestStepLoopCalibrate.Values.First().SLookupTablePower.Contains("433"))
|
||||
{
|
||||
ret.FrqOffset = 433;
|
||||
}
|
||||
else if (radioTestResult.TestStepLoopCalibrate.Values.First().SLookupTablePower.Contains("868"))
|
||||
{
|
||||
ret.FrqOffset = 868;
|
||||
}
|
||||
|
||||
ret.FrqOffset = null;
|
||||
}
|
||||
|
||||
var a = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null
|
||||
&& w.ResultCalibration.ToLower() == "ok"
|
||||
&& w.LengthCode.StartsWith($"DN{dnString}")
|
||||
&& w.LengthCode.Contains($"-{lengthString}{pressure}")
|
||||
&& !w.LengthCode.Contains($"-{lengthString}{pressure}o")).ToList();
|
||||
var ao = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null
|
||||
&& w.ResultCalibration.ToLower() == "ok"
|
||||
&& w.LengthCode.StartsWith($"DN{dnString}")
|
||||
&& w.LengthCode.Contains($"-{lengthString}{pressure}o")).ToList();
|
||||
|
||||
|
||||
var a = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null && (w.ResultCalibration.ToLower() == "ok" && w.LengthCode.StartsWith($"DN{dnString}") && w.LengthCode.Contains($"-{LengthString}{pressure}") && !w.LengthCode.Contains($"-{LengthString}{pressure}o"))).ToList();
|
||||
var ao = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null && (w.ResultCalibration.ToLower() == "ok" && w.LengthCode.StartsWith($"DN{dnString}") && w.LengthCode.Contains($"-{LengthString}{pressure}o"))).ToList();
|
||||
var snb = new List<string>();
|
||||
|
||||
foreach (var lengthItem in radioTestResult.TestStepLoopCalibrate.Values)
|
||||
{
|
||||
if (lengthItem != null)
|
||||
{
|
||||
snb.Add(lengthItem.LengthCode);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (a.Any() && ao.Any())
|
||||
{
|
||||
ret.PowerLevel = uint.Parse(a.First().IPowerLevelCalculated);
|
||||
ret.PowerLevelOption = uint.Parse(ao.First().IPowerLevelCalculated);
|
||||
|
||||
ret.ImpedanceCodeNew = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
var x = new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
if (x != null)
|
||||
ret.ImpedanceCodeNew = (UInt32)x;
|
||||
|
||||
ret.ImpedanceCodeOption = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(ao.First().IAntennaMatching);
|
||||
x = new System.ComponentModel.UInt32Converter().ConvertFromString(ao.First().IAntennaMatching);
|
||||
if (x != null)
|
||||
ret.ImpedanceCodeOption = (UInt32)x;
|
||||
}
|
||||
|
||||
if (a.Any() && !ao.Any())
|
||||
{
|
||||
|
||||
ret.PowerLevel = uint.Parse(a.First().IPowerLevelCalculated);
|
||||
ret.PowerLevelOption = uint.Parse(a.First().IPowerLevelCalculated);
|
||||
ret.PowerLevelOption = ret.PowerLevel;
|
||||
|
||||
ret.ImpedanceCodeNew = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
var x = new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
if (x != null)
|
||||
ret.ImpedanceCodeNew = (UInt32)x;
|
||||
|
||||
ret.ImpedanceCodeOption = (UInt32)new System.ComponentModel.UInt32Converter().ConvertFromString(a.First().IAntennaMatching);
|
||||
ret.ImpedanceCodeOption = ret.ImpedanceCodeNew;
|
||||
|
||||
}
|
||||
}
|
||||
//return new RadioConfigurationParams();// Encoding.ASCII.GetString(bytes);
|
||||
|
||||
|
||||
//2992 2936
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//return new RadioConfigurationParams();//
|
||||
}
|
||||
|
||||
using (var dataacces = new SqlDataAccess(connectionString))
|
||||
using (var dataAccess = new SqlDataAccess(connectionString))
|
||||
{
|
||||
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine(
|
||||
$" SELECT distinct [MapPcbIdToSerialNumber_SerialNumber],Adresse,FunkschluesselIndex,SENSUSRADIO_PowerLevel, SENSUSRADIO_PowerLevelOption, SENSUSRADIO_ImpedanceCodeNew,SENSUSRADIO_ImpedanceCodeOption ");
|
||||
sb.AppendLine($" SELECT distinct [MapPcbIdToSerialNumber_SerialNumber],Adresse,FunkschluesselIndex,SENSUSRADIO_PowerLevel," +
|
||||
$" SENSUSRADIO_PowerLevelOption, SENSUSRADIO_ImpedanceCodeNew,SENSUSRADIO_ImpedanceCodeOption ");
|
||||
sb.AppendLine($" FROM [Auftrag].[dbo].[MapPcbIdToSerialNumber] pcb ");
|
||||
sb.AppendLine(
|
||||
$" left outer join tmpRadioConfig radio on radio.pcbID = pcb.MapPcbIdToSerialNumber_PcbId");
|
||||
sb.AppendLine(
|
||||
$" inner join Genesis_Meter meter on meter.Seriennummer = pcb.MapPcbIdToSerialNumber_SerialNumber");
|
||||
sb.AppendLine($" where [MapPcbIdToSerialNumber_PcbId] = '{PcbId}'");
|
||||
sb.AppendLine($" left outer join tmpRadioConfig radio on radio.pcbID = pcb.MapPcbIdToSerialNumber_PcbId");
|
||||
sb.AppendLine($" inner join Genesis_Meter meter on meter.Seriennummer = pcb.MapPcbIdToSerialNumber_SerialNumber");
|
||||
sb.AppendLine($" where [MapPcbIdToSerialNumber_PcbId] = '{pcbId}'");
|
||||
|
||||
|
||||
|
||||
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
if (MapData.Rows.Count != 1)
|
||||
var mapData = dataAccess.ExecuteQuery(sb.ToString());
|
||||
if (mapData.Rows.Count != 1)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!(MapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"] is DBNull) || !string.IsNullOrEmpty(MapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"].ToString()))
|
||||
if (!(mapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"] is DBNull) ||
|
||||
!string.IsNullOrEmpty(mapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"].ToString()))
|
||||
{
|
||||
ret.SerialNumber = Convert.ToUInt32(MapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"]);
|
||||
ret.SerialNumber = Convert.ToUInt32(mapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!(MapData.Rows[0]["Adresse"] is DBNull) && MapData.Rows[0]["Adresse"].ToString() != "0")
|
||||
if (!(mapData.Rows[0]["Adresse"] is DBNull) && mapData.Rows[0]["Adresse"].ToString() != "0")
|
||||
{
|
||||
ret.RadioAddress = Convert.ToUInt32((long)MapData.Rows[0]["Adresse"] - 10000000000);
|
||||
ret.RadioAddress = Convert.ToUInt32((Int64)mapData.Rows[0]["Adresse"] - 10000000000);
|
||||
}
|
||||
|
||||
|
||||
//if inde
|
||||
|
||||
|
||||
if (!(MapData.Rows[0]["FunkschluesselIndex"] is DBNull) && MapData.Rows[0]["FunkschluesselIndex"].ToString() != "0")
|
||||
if (!(mapData.Rows[0]["FunkschluesselIndex"] is DBNull) && mapData.Rows[0]["FunkschluesselIndex"].ToString() != "0")
|
||||
{
|
||||
ret.EncryptionKey = null;
|
||||
//20805053|3147665|10402000894
|
||||
var indexParams = MapData.Rows[0]["FunkschluesselIndex"].ToString().Split('|');
|
||||
var indexParams = mapData.Rows[0]["FunkschluesselIndex"].ToString().Split('|');
|
||||
|
||||
var rawKey = getRadioRandomKey("d5b8c0b2-81f6-4421-80d0-44eb2093e616", indexParams[1], indexParams[2]);
|
||||
var rawKey = GetRadioRandomKey("d5b8c0b2-81f6-4421-80d0-44eb2093e616", indexParams[1], indexParams[2]);
|
||||
|
||||
var encryptionKey = new List<Byte>();
|
||||
|
||||
var encryptionKey = new List<byte>();
|
||||
|
||||
for (int i = 0; i < rawKey.Length / 2; i++)
|
||||
for (var i = 0; i < rawKey.Length / 2; i++)
|
||||
{
|
||||
encryptionKey.Add(Byte.Parse(rawKey.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber));
|
||||
|
||||
|
||||
|
||||
encryptionKey.Add(byte.Parse(rawKey.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber));
|
||||
}
|
||||
ret.EncryptionKey = encryptionKey.ToArray();
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.EncryptionKey = DefEncryptionKey.ToArray();
|
||||
ret.EncryptionKey = defEncryptionKey.ToArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static string getRadioRandomKey(string Token, string orderNumber, string radioAdress)
|
||||
private static String GetRadioRandomKey(String token, String orderNumber, String radioAdress)
|
||||
{
|
||||
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) =>
|
||||
{
|
||||
return true;
|
||||
};
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
|
||||
|
||||
//var Url = $"{ServiceUrls.KeyServerCustom()}devices
|
||||
var Url = $"https://nodes.sms-esaap.com/keygenproxy/api/v2/keys/devices?orderNumber={orderNumber}&radioaddress={radioAdress}";
|
||||
var header = new Dictionary<string, string>();
|
||||
var url = $"https://nodes.sms-esaap.com/keygenproxy/api/v2/keys/devices?orderNumber={orderNumber}&radioaddress={radioAdress}";
|
||||
var header = new Dictionary<String, String>();
|
||||
header.Add("Cache-Control", "no-cache");
|
||||
header.Add("X-Node-Token", Token);
|
||||
header.Add("X-Node-Token", token);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
var responseJson = LocalWebRequest.GetRequest(Url: Url, TimeoutMS: 10000, Header: header);
|
||||
var responseJson = LocalWebRequest.GetRequest(url, 10000, header);
|
||||
responseJson = responseJson.Trim('"');
|
||||
|
||||
|
||||
return responseJson;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ApplicationException("Fatal exception while getting keys from server", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,64 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
/// <summary>
|
||||
/// Conversion of scanned number to serial number
|
||||
/// </summary>
|
||||
public static class ScanToSerialNr
|
||||
{
|
||||
public static bool ConvertScanToSerialNr(string Scan ,out int internalSerialNr,out string customerSr)
|
||||
public static Boolean ConvertScanToSerialNr(String scan ,out Int32 internalSerialNr,out String customerSr)
|
||||
{
|
||||
customerSr = "";
|
||||
internalSerialNr = -1;
|
||||
try
|
||||
{
|
||||
int ret = 0;
|
||||
var prefix = "8SEN20";
|
||||
var length = 9;
|
||||
const String prefix = "8SEN20";
|
||||
const Int32 length = 9;
|
||||
|
||||
if (Scan.Contains(","))
|
||||
if (scan.Contains(","))
|
||||
{
|
||||
customerSr = Scan.Substring(0, Scan.IndexOf(","));
|
||||
customerSr = scan.Substring(0, scan.IndexOf(",", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
if (Scan.StartsWith(prefix))
|
||||
if (scan.StartsWith(prefix))
|
||||
{
|
||||
Scan = Scan.Substring(prefix.Length, length);
|
||||
if (!Scan.EndsWith(","))
|
||||
scan = scan.Substring(prefix.Length, length);
|
||||
if (!scan.EndsWith(","))
|
||||
{
|
||||
|
||||
throw new ApplicationException("Could not parse serial number");
|
||||
}
|
||||
else
|
||||
{
|
||||
Scan = Scan.TrimEnd(',');
|
||||
}
|
||||
|
||||
scan = scan.TrimEnd(',');
|
||||
}
|
||||
|
||||
|
||||
if (int.TryParse(Scan, out ret))
|
||||
if (int.TryParse(scan, out var ret))
|
||||
{
|
||||
internalSerialNr = ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Scan.Length == 11 && Scan.StartsWith("10"))
|
||||
if (scan.Length == 11 && scan.StartsWith("10"))
|
||||
{
|
||||
customerSr = Scan.Substring(2, 9);
|
||||
customerSr = scan.Substring(2, 9);
|
||||
return true;
|
||||
}
|
||||
throw new ApplicationException("Could not parse serial number");
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception )
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
namespace Xylem.Common.Logic.RelatePcb.ProductionOrderCore
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumeration of order state
|
||||
/// </summary>
|
||||
public enum OrderState
|
||||
{
|
||||
Created,
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.ProcessState
|
||||
{
|
||||
public class PressureTestResult
|
||||
{
|
||||
public bool Passed { get; set; }
|
||||
public int? StationId { get; set; }
|
||||
public string FreeText { get; set; }
|
||||
/// <summary>
|
||||
/// Test passed successfully
|
||||
/// </summary>
|
||||
public Boolean Passed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Identifier of test station
|
||||
/// </summary>
|
||||
public Int32? StationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Test from operator
|
||||
/// </summary>
|
||||
public String FreeText { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,43 @@
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore
|
||||
using System;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Source for final properties of Cordonel
|
||||
/// </summary>
|
||||
public enum ProgrammingSource
|
||||
{
|
||||
Vako,
|
||||
Csd,
|
||||
Csd
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Values for single registers
|
||||
/// </summary>
|
||||
public class ProgrammingParameters
|
||||
{
|
||||
public ProgrammingParameters(string registerName, byte[] registerValue, ProgrammingSource programmingSource = ProgrammingSource.Vako)
|
||||
/// <summary>
|
||||
/// Single register setup value assignment
|
||||
/// </summary>
|
||||
/// <param name="registerName"></param>
|
||||
/// <param name="registerValue"></param>
|
||||
/// <param name="programmingSource"></param>
|
||||
public ProgrammingParameters(String registerName, Byte[] registerValue, ProgrammingSource programmingSource = ProgrammingSource.Vako)
|
||||
{
|
||||
RegisterName = registerName;
|
||||
RegisterValue = registerValue;
|
||||
Source = programmingSource;
|
||||
}
|
||||
|
||||
public string RegisterName { get; set; }
|
||||
public byte[] RegisterValue { get; set; }
|
||||
/// <summary>
|
||||
/// The register name
|
||||
/// </summary>
|
||||
public String RegisterName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The register value converted to raw bytes by register converter
|
||||
/// </summary>
|
||||
public Byte[] RegisterValue { get; set; }
|
||||
|
||||
public ProgrammingSource Source { get; set; }
|
||||
|
||||
|
||||
@@ -1,85 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.TestResults
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for pressure test results
|
||||
/// </summary>
|
||||
public class PressureResultData
|
||||
{
|
||||
public string PcbId;
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for PCB
|
||||
/// </summary>
|
||||
public String PcbId;
|
||||
|
||||
private int rev = 0;
|
||||
/// <summary>
|
||||
/// Revision
|
||||
/// </summary>
|
||||
public Int32 Rev { get; set; } = 0;
|
||||
|
||||
public int Rev
|
||||
{
|
||||
get { return rev; }
|
||||
set
|
||||
{
|
||||
rev = value;
|
||||
}
|
||||
}
|
||||
private bool? passed = false;
|
||||
public bool? Passed
|
||||
{
|
||||
get { return passed; }
|
||||
set
|
||||
{
|
||||
passed = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Optional passed test
|
||||
/// </summary>
|
||||
public Boolean? Passed { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Operator name
|
||||
/// </summary>
|
||||
public String TesterName { get; set; } = "C. Röhl";
|
||||
|
||||
/// <summary>
|
||||
/// Applied test pressure
|
||||
/// </summary>
|
||||
public String TestPressure { get; set; } = "6";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Leakage rate
|
||||
/// </summary>
|
||||
public String LeakRate { get; set; } = " 1E-5";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Operator comment
|
||||
/// </summary>
|
||||
public String Remark { get; set; } = "";
|
||||
|
||||
private string testerName = "C. Röhl";
|
||||
public String TesterName
|
||||
{
|
||||
get { return testerName; }
|
||||
set
|
||||
{
|
||||
testerName = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string testPressure = "6";
|
||||
public String TestPressure
|
||||
{
|
||||
get { return testPressure; }
|
||||
set
|
||||
{
|
||||
testPressure = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string leakRate = " 1E-5";
|
||||
public String LeakRate
|
||||
{
|
||||
get { return leakRate; }
|
||||
set
|
||||
{
|
||||
leakRate = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string remark = "";
|
||||
public String Remark
|
||||
{
|
||||
get { return remark; }
|
||||
set
|
||||
{
|
||||
remark = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<PressureTestPoints> Testpoints;
|
||||
/// <summary>
|
||||
/// Test points
|
||||
/// </summary>
|
||||
public List<PressureTestPoints> TestPoints;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.TestResults
|
||||
{
|
||||
/// <summary>
|
||||
/// Pressure test point container
|
||||
/// </summary>
|
||||
public class PressureTestPoints
|
||||
{
|
||||
public int Ident { get; set; }
|
||||
public string Input { get; set; }
|
||||
/// <summary>
|
||||
/// Just a number
|
||||
/// </summary>
|
||||
public Int32 Ident { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Text input
|
||||
/// </summary>
|
||||
public String Input { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,59 @@
|
||||
using Service.Core;
|
||||
using System;
|
||||
using Service.Core;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
{
|
||||
/// <summary>
|
||||
/// VAKO extractor from data base
|
||||
/// </summary>
|
||||
public static class VakoDbAdapter
|
||||
{
|
||||
public static RawVako GetRawVako(string DbConnectionString, int FertigungsAuftragsNr)
|
||||
/// <summary>
|
||||
/// Collect the VAKO from data base
|
||||
/// </summary>
|
||||
/// <param name="dbConnectionString"></param>
|
||||
/// <param name="fertigungsAuftragsNr"></param>
|
||||
/// <returns></returns>
|
||||
public static RawVako GetRawVako(String dbConnectionString, Int32 fertigungsAuftragsNr)
|
||||
{
|
||||
using (var dataacces = new SqlDataAccess(DbConnectionString))
|
||||
using (var dataAccess = new SqlDataAccess(dbConnectionString))
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine($" select distinct ident.VakoCode, ident.Identnr,ident.Typ , ident.Nennweite,ident.Baulaenge from Auftrag.dbo.AuftragPosition_Gesamt auftraginfo ");
|
||||
sb.AppendLine($" left outer join Auftrag.dbo.Identnr ident on auftraginfo.IdentNr = ident.IdentNr ");
|
||||
sb.AppendLine($" where FertigungsauftragNr = {FertigungsAuftragsNr} ");
|
||||
sb.AppendLine($" where FertigungsauftragNr = {fertigungsAuftragsNr} ");
|
||||
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
if (MapData.Rows.Count != 1)
|
||||
var mapData = dataAccess.ExecuteQuery(sb.ToString());
|
||||
if (mapData.Rows.Count != 1)
|
||||
{
|
||||
return new RawVako();
|
||||
}
|
||||
|
||||
return new RawVako()
|
||||
return new RawVako
|
||||
{
|
||||
VakoString = MapData.Rows[0]["VakoCode"].ToString(),
|
||||
VakoIdent = (int)MapData.Rows[0]["Identnr"],
|
||||
Type = MapData.Rows[0]["Typ"].ToString(),
|
||||
Dn = (int)MapData.Rows[0]["Nennweite"],
|
||||
Length = (int)MapData.Rows[0]["Baulaenge"],
|
||||
VakoString = mapData.Rows[0]["VakoCode"].ToString(),
|
||||
VakoIdent = (Int32)mapData.Rows[0]["Identnr"],
|
||||
Type = mapData.Rows[0]["Typ"].ToString(),
|
||||
Dn = (Int32)mapData.Rows[0]["Nennweite"],
|
||||
Length = (Int32)mapData.Rows[0]["Baulaenge"],
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static List<VakoMap> GetVakoMapping(string DbConnectionString, string Basis)
|
||||
/// <summary>
|
||||
/// Collect the VAKO properties
|
||||
/// </summary>
|
||||
/// <param name="dbConnectionString"></param>
|
||||
/// <param name="basis"></param>
|
||||
/// <returns></returns>
|
||||
public static List<VakoMap> GetVakoMapping(String dbConnectionString, String basis)
|
||||
{
|
||||
using (var dataacces = new SqlDataAccess(DbConnectionString))
|
||||
using (var dataAccess = new SqlDataAccess(dbConnectionString))
|
||||
{
|
||||
|
||||
var sb = new StringBuilder();
|
||||
@@ -58,46 +74,41 @@ namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
sb.AppendLine($" ,[SAPReihenfolge] ");
|
||||
sb.AppendLine($" ,[AnlageDatum] ");
|
||||
sb.AppendLine($" FROM [Auftrag].[dbo].[VAKO_Merkmale] ");
|
||||
sb.AppendLine($" where [Basis] = '{Basis}' ");
|
||||
sb.AppendLine($" where [Basis] = '{basis}' ");
|
||||
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
var mapData = dataAccess.ExecuteQuery(sb.ToString());
|
||||
var ret = new List<VakoMap>();
|
||||
//if (MapData.Rows.Count != 1)
|
||||
//{
|
||||
// return ret;
|
||||
//}
|
||||
foreach (var rawrow in MapData.Rows)
|
||||
foreach (var rawRow in mapData.Rows)
|
||||
{
|
||||
if (rawrow is DataRow row)
|
||||
if (rawRow is DataRow row)
|
||||
{
|
||||
ret.Add(new VakoMap()
|
||||
{
|
||||
Basis = Basis,
|
||||
Id = (int)row["Id"],
|
||||
Schluessel = row["Schluessel"].ToString(),
|
||||
Basis = basis,
|
||||
Id = (Int32)row["Id"],
|
||||
Schluessel = row["Schluessel"].ToString(),
|
||||
Basislist = row["Basislist"].ToString(),
|
||||
Name = row["Name"].ToString(),
|
||||
Bezeichnung = row["Bezeichnung"].ToString(),
|
||||
Stelle = (int)row["Stelle"],
|
||||
Laenge = (int)row["Laenge"],
|
||||
Stelle = (Int32)row["Stelle"],
|
||||
Laenge = (Int32)row["Laenge"],
|
||||
Charcode = row["Charcode"].ToString(),
|
||||
Wert = row["Wert"].ToString(),
|
||||
Bemerkung = row["Bemerkung"].ToString(),
|
||||
NachSap = (bool)row["NachSap"],
|
||||
NachSap = (Boolean)row["NachSap"],
|
||||
SapText = row["SAPText"].ToString(),
|
||||
SapReihenfolge = row["SAPReihenfolge"].GetType() == typeof(System.DBNull) ? 0 : (int)row["SAPReihenfolge"],
|
||||
AnlageDatum = (System.DateTime)row["AnlageDatum"],
|
||||
SapReihenfolge = row["SAPReihenfolge"] is DBNull ? 0 : (Int32)row["SAPReihenfolge"],
|
||||
AnlageDatum = (DateTime)row["AnlageDatum"],
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
return ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for raw VAKO settings
|
||||
/// </summary>
|
||||
public class RawVako
|
||||
{
|
||||
public string VakoString { get; internal set; }
|
||||
public string Type { get; internal set; }
|
||||
public int VakoIdent { get; internal set; }
|
||||
/// <summary>
|
||||
/// The VAKO string
|
||||
/// </summary>
|
||||
public String VakoString { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// VAKO type
|
||||
/// </summary>
|
||||
public String Type { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// VAKO identifier
|
||||
/// </summary>
|
||||
public Int32 VakoIdent { get; internal set; }
|
||||
|
||||
public int Dn { get; internal set; }
|
||||
public int Length { get; internal set; }
|
||||
/// <summary>
|
||||
/// Meter tube size in mm or inc
|
||||
/// </summary>
|
||||
public Int32 Dn { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of tube
|
||||
/// </summary>
|
||||
public Int32 Length { get; internal set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of values for a specific VAKO key
|
||||
/// </summary>
|
||||
public class VakoData
|
||||
{
|
||||
/// <summary>
|
||||
/// Values of VAKO key
|
||||
/// </summary>
|
||||
public List <VakoKeyValue> KeyValues { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
{
|
||||
/// <summary>
|
||||
/// VAKO key collection
|
||||
/// </summary>
|
||||
public class VakoKeyValue
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Desc { get; set; }
|
||||
public string Charcode { get; set; }
|
||||
public string Value { get; set; }
|
||||
/// <summary>
|
||||
/// Key as string
|
||||
/// </summary>
|
||||
public String Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of key
|
||||
/// </summary>
|
||||
public String Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Comment for this key
|
||||
/// </summary>
|
||||
public String Desc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Character decoding
|
||||
/// </summary>
|
||||
public String Charcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Value of key
|
||||
/// </summary>
|
||||
public String Value { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,25 @@
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
{
|
||||
/// <summary>
|
||||
/// Mapping of VAKO
|
||||
/// </summary>
|
||||
public class VakoMap
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Schluessel { get; set; }
|
||||
public string Basis { get; set; }
|
||||
public string Basislist { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Bezeichnung { get; set; }
|
||||
public int Stelle { get; set; }
|
||||
public int Laenge { get; set; }
|
||||
public string Charcode { get; set; }
|
||||
public string Wert { get; set; }
|
||||
public string Bemerkung { get; set; }
|
||||
public bool NachSap { get; set; }
|
||||
public string SapText { get; set; }
|
||||
public int SapReihenfolge { get; set; }
|
||||
public Int32 Id { get; set; }
|
||||
public String Schluessel { get; set; }
|
||||
public String Basis { get; set; }
|
||||
public String Basislist { get; set; }
|
||||
public String Name { get; set; }
|
||||
public String Bezeichnung { get; set; }
|
||||
public Int32 Stelle { get; set; }
|
||||
public Int32 Laenge { get; set; }
|
||||
public String Charcode { get; set; }
|
||||
public String Wert { get; set; }
|
||||
public String Bemerkung { get; set; }
|
||||
public Boolean NachSap { get; set; }
|
||||
public String SapText { get; set; }
|
||||
public Int32 SapReihenfolge { get; set; }
|
||||
public DateTimeOffset AnlageDatum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
{
|
||||
/// <summary>
|
||||
/// VAKO decoder
|
||||
/// </summary>
|
||||
public static class VakoParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parser of VAKO code
|
||||
/// </summary>
|
||||
/// <param name="rawVako"></param>
|
||||
/// <param name="vakoMaps"></param>
|
||||
/// <returns></returns>
|
||||
public static VakoData Parse(RawVako rawVako, List<VakoMap> vakoMaps)
|
||||
{
|
||||
var ret = new VakoData();
|
||||
ret.KeyValues = new List<VakoKeyValue>();
|
||||
|
||||
var d = vakoMaps.GroupBy(g => new Tuple<int, int>(g.Stelle, g.Laenge));
|
||||
//d = 99
|
||||
foreach (var checkVakoIsMatching in vakoMaps.GroupBy(g => new Tuple<int, int>(g.Stelle, g.Laenge)))
|
||||
var ret = new VakoData
|
||||
{
|
||||
var acctualStart = checkVakoIsMatching.Key.Item1 - 1;
|
||||
var acctualLenght = checkVakoIsMatching.Key.Item2;
|
||||
var acctualChars = rawVako.VakoString.Substring(acctualStart, acctualLenght);
|
||||
KeyValues = new List<VakoKeyValue>()
|
||||
};
|
||||
|
||||
//var d = vakoMaps.GroupBy(g => new Tuple<Int32, Int32>(g.Stelle, g.Laenge));
|
||||
//d = 99
|
||||
foreach (var checkVakoIsMatching in vakoMaps.GroupBy(g => new Tuple<Int32, Int32>(g.Stelle, g.Laenge)))
|
||||
{
|
||||
var actualStart = checkVakoIsMatching.Key.Item1 - 1;
|
||||
var actualLength = checkVakoIsMatching.Key.Item2;
|
||||
var actualChars = rawVako.VakoString.Substring(actualStart, actualLength);
|
||||
|
||||
var Matches = checkVakoIsMatching.Where(c => c.Charcode == acctualChars);
|
||||
if (!Matches.Any())
|
||||
var matches = checkVakoIsMatching.Where(c => c.Charcode == actualChars);
|
||||
// ReSharper disable once PossibleMultipleEnumeration
|
||||
if (!matches.Any())
|
||||
{
|
||||
//no match warning!
|
||||
}
|
||||
if (Matches.Count() == 1)
|
||||
// ReSharper disable once PossibleMultipleEnumeration
|
||||
if (matches.Count() == 1)
|
||||
{
|
||||
var match = Matches.First();
|
||||
// ReSharper disable once PossibleMultipleEnumeration
|
||||
var match = matches.First();
|
||||
ret.KeyValues.Add(new VakoKeyValue
|
||||
{
|
||||
Desc = match.Bemerkung,
|
||||
@@ -37,17 +50,9 @@ namespace Xylem.Common.Logic.ProductionOrderCore.Vako
|
||||
Value = match.Wert,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
//todo warning
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace ProductionUiCordonel.Data
|
||||
Rev = baseData.Rev;
|
||||
TesterName = baseData.TesterName;
|
||||
Testpoints = new ObservableCollection<PressureTestPoints>();
|
||||
baseData.Testpoints.ForEach(o => Testpoints.Add(o));
|
||||
baseData.TestPoints.ForEach(o => Testpoints.Add(o));
|
||||
TestPressure = baseData.TestPressure;
|
||||
}
|
||||
public PressureResultDataNotifyable()
|
||||
@@ -151,7 +151,7 @@ namespace ProductionUiCordonel.Data
|
||||
baseData.Remark = Remark;
|
||||
baseData.Rev = Rev;
|
||||
baseData.TesterName = TesterName;
|
||||
baseData.Testpoints = Testpoints.ToList();
|
||||
baseData.TestPoints = Testpoints.ToList();
|
||||
baseData.TestPressure = TestPressure;
|
||||
return baseData;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
sb.AppendLine($" , '{crc}' ");
|
||||
sb.AppendLine($" , '{Metersize}' ");
|
||||
sb.AppendLine($" , '{Region}' ");
|
||||
sb.AppendLine($" , 0 "); // [CurrentVerionForProd]
|
||||
sb.AppendLine($" , 0 "); // [CurrentVersionForProd]
|
||||
|
||||
sb.AppendLine($" select @@IDENTITY ");
|
||||
var retDT = dataacces.ExecuteQuery(sb.ToString());
|
||||
@@ -269,7 +269,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
sb.AppendLine($" ,[FileCrc] ");
|
||||
sb.AppendLine($" ,[MeterSize] ");
|
||||
sb.AppendLine($" ,[Region] ");
|
||||
sb.AppendLine($" ,[CurrentVerionForProd] ");
|
||||
sb.AppendLine($" ,[CurrentVersionForProd] ");
|
||||
sb.AppendLine($" ,files.[FileName] ");
|
||||
sb.AppendLine($" ,files.FileContent ");
|
||||
sb.AppendLine($" FROM [Auftrag].[dbo].[Cordonel_Lut] lut ");
|
||||
@@ -287,7 +287,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
if (ForProd.HasValue)
|
||||
{
|
||||
sb.AppendLine($" and CurrentVerionForProd ={(ForProd.Value? "1" : "0") } ");
|
||||
sb.AppendLine($" and CurrentVersionForProd ={(ForProd.Value? "1" : "0") } ");
|
||||
}
|
||||
|
||||
var retDT = dataacces.ExecuteQuery(sb.ToString());
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using Logic.ProductionToProductMapper.Cordonel;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Service.Core;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@@ -11,45 +7,42 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using Logic.ProductionToProductMapper.Cordonel;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Service.Core;
|
||||
using Xylem.Common.Logic.ProductionOrderCore;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.KitronTestResults;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.Vako;
|
||||
|
||||
namespace Service.MeterProcessState.Controllers
|
||||
namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
{
|
||||
[RoutePrefix("api/FinalCheck")]
|
||||
public class FinalCheckController : ApiController
|
||||
{
|
||||
|
||||
|
||||
|
||||
public static class GlobalConfig
|
||||
{
|
||||
public static Lazy<string> connectionString = new Lazy<string>(()
|
||||
=>
|
||||
System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString
|
||||
public static Lazy<String> ConnectionString = new Lazy<String>(()
|
||||
=> System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//LocalWebRequest
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Radio Configuration from database matching the PcbID
|
||||
/// </summary>
|
||||
/// <param name="PcbID">PcbID from Meter</param>
|
||||
/// <param name="pcbID">PcbID from Meter</param>
|
||||
/// <returns></returns>
|
||||
[Route("GetProgrammingParameters"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetProgrammingParameters(string PcbID)
|
||||
public async Task<HttpResponseMessage> GetProgrammingParameters(String pcbID)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
var ret = OrderProgrammingParameters.GetProgrammingParameters(PcbID, GlobalConfig.connectionString.Value);
|
||||
var ret = OrderProgrammingParameters.GetProgrammingParameters(pcbID, GlobalConfig.ConnectionString.Value);
|
||||
foreach (var r in ret.Where(r => r.RegisterName == "SENSUSRADIO_EncryptionKey"))
|
||||
{
|
||||
foreach (var t in r.RegisterValue)
|
||||
@@ -77,30 +70,26 @@ namespace Service.MeterProcessState.Controllers
|
||||
/// <param name="PcbID">PcbID from Meter</param>
|
||||
/// <returns></returns>
|
||||
[Route("GetEncryptionKey"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetEncryptionKey(string PcbID)
|
||||
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 ret = OrderProgrammingParameters.GetProgrammingParameters(PcbID, GlobalConfig.ConnectionString.Value);
|
||||
|
||||
var key = ret.FirstOrDefault(r => r.RegisterName == "SENSUSRADIO_EncryptionKey" && r.Source == ProgrammingSource.Csd);
|
||||
var key = ret.FirstOrDefault(r => r.RegisterName == "SENSUSRADIO_EncryptionKey" && r.Source == ProgrammingSource.Csd) ??
|
||||
ret.FirstOrDefault(r => r.RegisterName == "SENSUSRADIO_EncryptionKey" && r.Source == ProgrammingSource.Vako);
|
||||
|
||||
if (key == null)
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (var t in key.RegisterValue)
|
||||
{
|
||||
builder.Append(t.ToString("x2"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return Request.CreateResponse(HttpStatusCode.OK, builder.ToString());
|
||||
|
||||
});
|
||||
@@ -117,14 +106,14 @@ namespace Service.MeterProcessState.Controllers
|
||||
/// <param name="PcbID">PcbID from Meter</param>
|
||||
/// <returns></returns>
|
||||
[Route("GetRadioConfiguration"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetRadioConfiguration(string PcbID, bool withPressure)
|
||||
public async Task<HttpResponseMessage> GetRadioConfiguration(String PcbID, Boolean withPressure)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
|
||||
var radio = OrderRadioParameter.GetRadioPramas(PcbID, GlobalConfig.connectionString.Value, withPressure ? "p" : "");
|
||||
var radio = OrderRadioParameter.GetRadioParams(PcbID, GlobalConfig.ConnectionString.Value, withPressure ? "p" : "");
|
||||
if (radio != null)
|
||||
{
|
||||
|
||||
@@ -158,13 +147,13 @@ namespace Service.MeterProcessState.Controllers
|
||||
/// <param name="PcbID">PcbID from Meter</param>
|
||||
/// <returns></returns>
|
||||
[Route("GetConfiguration"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetConfiguration(string PcbID)
|
||||
public async Task<HttpResponseMessage> GetConfiguration(String PcbID)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
|
||||
|
||||
@@ -181,9 +170,9 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
//MapData.Rows[0]["Adresse"]
|
||||
var ra = (long)MapData.Rows[0]["Adresse"] - 10000000000;
|
||||
var ra = (Int64)MapData.Rows[0]["Adresse"] - 10000000000;
|
||||
|
||||
var resultDic = new Dictionary<string, object>();
|
||||
var resultDic = new Dictionary<String, Object>();
|
||||
|
||||
resultDic.Add("SENSUSRADIO_RadioAddress", ra);
|
||||
|
||||
@@ -220,13 +209,13 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("GetOrderOverview"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetOrderOverview(int ProductionOrderNumber, int? CheckPcbId = null)
|
||||
public async Task<HttpResponseMessage> GetOrderOverview(Int32 ProductionOrderNumber, Int32? CheckPcbId = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await Task.Run(async () =>
|
||||
{
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
|
||||
|
||||
@@ -281,10 +270,10 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
foreach (DataRow row in MapData.Rows)
|
||||
{
|
||||
ret.Count = (int)row["menge"];
|
||||
ret.AssignedPicking = (int)row["AssignedPicking"];
|
||||
ret.PressureTested = (int)row["PressureTested"];
|
||||
ret.HeliumTested = (int)row["HeliumTested"];
|
||||
ret.Count = (Int32)row["menge"];
|
||||
ret.AssignedPicking = (Int32)row["AssignedPicking"];
|
||||
ret.PressureTested = (Int32)row["PressureTested"];
|
||||
ret.HeliumTested = (Int32)row["HeliumTested"];
|
||||
}
|
||||
if (CheckPcbId.HasValue)
|
||||
{
|
||||
@@ -310,12 +299,12 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
}
|
||||
[Route("GetKitronProductionResults"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetKitronProductionResults(int? SerialNumber = null, string PcbID = "")
|
||||
public async Task<HttpResponseMessage> GetKitronProductionResults(Int32? SerialNumber = null, String PcbID = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
var ret = new Dictionary<string, JObject>();
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
var ret = new Dictionary<String, JObject>();
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
|
||||
{
|
||||
@@ -378,12 +367,12 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("GetKitronProductionDate"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetKitronProductionDate(int CheckPcbId)
|
||||
public async Task<HttpResponseMessage> GetKitronProductionDate(Int32 CheckPcbId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ret = new DateTimeOffset();
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
|
||||
{
|
||||
@@ -435,12 +424,12 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("GetPossibleRadioLengths"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetPossibleRadioLengths(int CheckPcbId)
|
||||
public async Task<HttpResponseMessage> GetPossibleRadioLengths(Int32 CheckPcbId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
|
||||
var sb = new StringBuilder();
|
||||
@@ -451,8 +440,8 @@ namespace Service.MeterProcessState.Controllers
|
||||
sb.AppendLine(" where [ID_PCB] = @PcbId ");
|
||||
sb.AppendLine(" order by ID_TEST desc ");
|
||||
var dt = dataacces.ExecuteQuery(sb.ToString());
|
||||
int? frq = null;
|
||||
var listLength = new List<string>();
|
||||
Int32? frq = null;
|
||||
var listLength = new List<String>();
|
||||
foreach (var item in dt.Select())
|
||||
{
|
||||
try
|
||||
@@ -491,7 +480,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
|
||||
var sbRet = new List<string>();
|
||||
var sbRet = new List<String>();
|
||||
|
||||
foreach (var item in listLength)
|
||||
{
|
||||
@@ -529,7 +518,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("GetOrderDetails"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetOrderDetails(int ProductionOrderNumber, int? CheckPcbId = null)
|
||||
public async Task<HttpResponseMessage> GetOrderDetails(Int32 ProductionOrderNumber, Int32? CheckPcbId = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -542,14 +531,14 @@ namespace Service.MeterProcessState.Controllers
|
||||
return Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex);
|
||||
}
|
||||
}
|
||||
private PickingCompareItem GetPickingItem(int ProductionOrderNumber, int? CheckPcbId)
|
||||
private PickingCompareItem GetPickingItem(Int32 ProductionOrderNumber, Int32? CheckPcbId)
|
||||
{
|
||||
var ignorProductionDate = new DateTime();
|
||||
return GetPickingItem(ProductionOrderNumber, CheckPcbId, out ignorProductionDate);
|
||||
}
|
||||
private PickingCompareItem GetPickingItem(int ProductionOrderNumber, int? CheckPcbId, out DateTime dateTime)
|
||||
private PickingCompareItem GetPickingItem(Int32 ProductionOrderNumber, Int32? CheckPcbId, out DateTime dateTime)
|
||||
{
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
var lastProdDate = new DateTime();
|
||||
List<ProgrammingParameters> programming = new List<ProgrammingParameters>();
|
||||
@@ -586,8 +575,8 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
foreach (DataRow row in checkAppsData.Rows)
|
||||
{
|
||||
uint AppID = uint.MaxValue;
|
||||
uint Version = uint.MaxValue;
|
||||
UInt32 AppID = uint.MaxValue;
|
||||
UInt32 Version = uint.MaxValue;
|
||||
if (uint.TryParse(row["CordonelCurrentFw_AppID"].ToString(), out AppID) && uint.TryParse(row["CordonelCurrentFw_Version"].ToString(), out Version))
|
||||
{
|
||||
checkAppsIdVersion.Add(AppID, Version);
|
||||
@@ -624,7 +613,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
if (dt.Rows.Count == 1)
|
||||
{
|
||||
//invert is a skip not a do value
|
||||
SkipRadioCheck = (bool)dt.Rows[0]["SkipRadioParameters"];
|
||||
SkipRadioCheck = (Boolean)dt.Rows[0]["SkipRadioParameters"];
|
||||
}
|
||||
|
||||
|
||||
@@ -778,7 +767,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
private static bool findMatchingTestResult(ref DateTime lastProdDate, string LengthString, string dnString, RadioTest radioTestResult)
|
||||
private static Boolean findMatchingTestResult(ref DateTime lastProdDate, String LengthString, String dnString, RadioTest radioTestResult)
|
||||
{
|
||||
var TestStepLoopCalibratesOk = radioTestResult.TestStepLoopCalibrate.Values.Where(w => w != null && w.ResultCalibration != null && w.LengthCode != null && w.ResultCalibration.ToLower() == "ok" && w.LengthCode.StartsWith($"DN{dnString}")).ToList();
|
||||
|
||||
@@ -917,7 +906,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
//}
|
||||
[Route("SetMetersizeProgrammingData"), HttpPost]
|
||||
public async Task<HttpResponseMessage> SetMetersizeProgrammingData(MeterSize ParameterMeterSize, [FromBody] string listOfDnParamsRaw)
|
||||
public async Task<HttpResponseMessage> SetMetersizeProgrammingData(MeterSize ParameterMeterSize, [FromBody] String listOfDnParamsRaw)
|
||||
{
|
||||
|
||||
try
|
||||
@@ -926,7 +915,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
|
||||
var listOfDnParams = JsonConvert.DeserializeObject<Dictionary<string, UInt32>>(listOfDnParamsRaw);
|
||||
var listOfDnParams = JsonConvert.DeserializeObject<Dictionary<String, UInt32>>(listOfDnParamsRaw);
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($" delete [Auftrag].[dbo].[CordonelMeterSizesParameter] where [Dn_InternalId] = { ParameterMeterSize.GetHashCode()} ");
|
||||
foreach (var item in listOfDnParams)
|
||||
@@ -935,7 +924,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
sb.AppendLine($" select {ParameterMeterSize.GetHashCode()}, '{item.Key}', {item.Value};");
|
||||
}
|
||||
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
|
||||
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return dataacces.ExecuteQuery(sb.ToString()) != null; }));
|
||||
@@ -953,7 +942,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
[Route("GetMetersizeProgrammingData"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetMetersizeProgrammingData(MeterSize MeterSize)
|
||||
{
|
||||
var programming = new Dictionary<string, UInt32>();
|
||||
var programming = new Dictionary<String, UInt32>();
|
||||
var sb = new StringBuilder();
|
||||
try
|
||||
{
|
||||
@@ -964,7 +953,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
sb.AppendLine($" inner join [Auftrag].[dbo].[CordonelMeterSizesParameter] para on size.Dn_InternalId = para.[Dn_InternalId] ");
|
||||
sb.AppendLine($" where size.[Dn_InternalId] = {MeterSize.GetHashCode()} ");
|
||||
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
var MapData = dataacces.ExecuteQuery(sb.ToString());
|
||||
|
||||
@@ -992,12 +981,12 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("GetVakoPogramming"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetVakoPogramming(int ProductionOrderNumber)
|
||||
public async Task<HttpResponseMessage> GetVakoPogramming(Int32 ProductionOrderNumber)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
List<ProgrammingParameters> programming = new List<ProgrammingParameters>();
|
||||
GetVakoProgramming(ProductionOrderNumber, dataacces, programming);
|
||||
@@ -1011,7 +1000,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("GetSingleVakoKey"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetSingleVakoKey(int ProductionOrderNumber, string KeyName)
|
||||
public async Task<HttpResponseMessage> GetSingleVakoKey(Int32 ProductionOrderNumber, String KeyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1019,8 +1008,8 @@ namespace Service.MeterProcessState.Controllers
|
||||
{
|
||||
|
||||
|
||||
var rawVako = VakoDbAdapter.GetRawVako(GlobalConfig.connectionString.Value, ProductionOrderNumber);
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(GlobalConfig.connectionString.Value, rawVako.Type);
|
||||
var rawVako = VakoDbAdapter.GetRawVako(GlobalConfig.ConnectionString.Value, ProductionOrderNumber);
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(GlobalConfig.ConnectionString.Value, rawVako.Type);
|
||||
var vakoData = VakoParser.Parse(rawVako, rawMapping);
|
||||
var hitList = vakoData.KeyValues.FindAll(g => g.Name == KeyName);
|
||||
if (hitList.Count != 1)
|
||||
@@ -1048,17 +1037,17 @@ namespace Service.MeterProcessState.Controllers
|
||||
{
|
||||
var ret = new List<VakoNew>();
|
||||
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(GlobalConfig.connectionString.Value, "GNS");
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(GlobalConfig.ConnectionString.Value, "GNS");
|
||||
var grpd = rawMapping.GroupBy(g => g.Name);
|
||||
foreach (var item in grpd)
|
||||
{
|
||||
var l = item.ToList();
|
||||
var digits = new List<long> { };
|
||||
for (int i = 1; i <= l.First().Laenge; i++)
|
||||
var digits = new List<Int64> { };
|
||||
for (Int32 i = 1; i <= l.First().Laenge; i++)
|
||||
{
|
||||
digits.Add(l.First().Stelle + i);
|
||||
}
|
||||
var d = new Dictionary<string, string>();
|
||||
var d = new Dictionary<String, String>();
|
||||
foreach (var lvalues in l)
|
||||
{
|
||||
try
|
||||
@@ -1087,19 +1076,19 @@ namespace Service.MeterProcessState.Controllers
|
||||
public partial class VakoNew
|
||||
{
|
||||
|
||||
public string Name { get; set; }
|
||||
public String Name { get; set; }
|
||||
|
||||
|
||||
public long[] Digits { get; set; }
|
||||
public Int64[] Digits { get; set; }
|
||||
|
||||
|
||||
public Dictionary<string, string> Values { get; set; }
|
||||
public Dictionary<String, String> Values { get; set; }
|
||||
}
|
||||
|
||||
private static void GetVakoProgramming(int ProductionOrderNumber, SqlDataAccess dataacces, List<ProgrammingParameters> programming)
|
||||
private static void GetVakoProgramming(Int32 ProductionOrderNumber, SqlDataAccess dataacces, List<ProgrammingParameters> programming)
|
||||
{
|
||||
var rawVako = VakoDbAdapter.GetRawVako(GlobalConfig.connectionString.Value, ProductionOrderNumber);
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(GlobalConfig.connectionString.Value, rawVako.Type);
|
||||
var rawVako = VakoDbAdapter.GetRawVako(GlobalConfig.ConnectionString.Value, ProductionOrderNumber);
|
||||
var rawMapping = VakoDbAdapter.GetVakoMapping(GlobalConfig.ConnectionString.Value, rawVako.Type);
|
||||
var vakoData = VakoParser.Parse(rawVako, rawMapping);
|
||||
|
||||
|
||||
@@ -1123,18 +1112,18 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
foreach (DataRow row in MapData.Rows)
|
||||
{
|
||||
programming.Add(new ProgrammingParameters(row["RegisterName"].ToString(), (byte[])row["RegisterValue"]));
|
||||
programming.Add(new ProgrammingParameters(row["RegisterName"].ToString(), (Byte[])row["RegisterValue"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Route("GetLastState")]
|
||||
public async Task<HttpResponseMessage> GetLastState(string PcbId)
|
||||
public async Task<HttpResponseMessage> GetLastState(String PcbId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
|
||||
{
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
|
||||
{
|
||||
var dt = dataacces.ExecuteQuery($"select top 1 [ProcessState_State] from dbo.MeterProcessState where ProcessState_PcbId like '{PcbId}' order by ProcessState_DateUtc desc ");
|
||||
foreach (var item in dt.Select())
|
||||
|
||||
@@ -726,8 +726,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
public async Task<HttpResponseMessage> GetRecoveryFile(int PcbID, int? RadioFrq, string Region, string FlexnetVersion)
|
||||
{
|
||||
|
||||
var file = new RecoverySettings() { PcbID = PcbID, RadioFrequencyMhz = RadioFrq, Region = Region, Release = FlexnetVersion };
|
||||
file.RecoveryRegisters = new List<ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem>();
|
||||
var file = new RecoverySettings() { PcbId = PcbID, RadioFrequencyMhz = RadioFrq, Region = Region, Release = FlexnetVersion };
|
||||
file.RecoveryRegisters = new List<RecoveryRegisterItem>();
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x00 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
var dtCalibrationResultsLogInfo = dataacces.ExecuteQuery(sb.ToString());
|
||||
foreach (var item in dtCalibrationResultsLogInfo.Select())
|
||||
{
|
||||
ret.First(f => f.DbId == (int)item["CalibrationResultsID"])?.AddAditonlaLog((string)item["LogKey"], (string)item["LogText"]);
|
||||
ret.First(f => f.DbId == (int)item["CalibrationResultsID"])?.AddAdditionalLog((string)item["LogKey"], (string)item["LogText"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -531,7 +531,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
if (dr["AlreadyMarried"].ToString() == "1")
|
||||
{
|
||||
ret = ret | MarriagePossibleEnum.NotPossibleDueAlredayMatch;
|
||||
ret = ret | MarriagePossibleEnum.NotPossibleDueToAlreadyMarried;
|
||||
}
|
||||
|
||||
if (dr["SerialNumberBlocked"].ToString() == "1")
|
||||
@@ -540,7 +540,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
if (dr["PcbBlocked"].ToString() == "1")
|
||||
{
|
||||
ret = ret | MarriagePossibleEnum.NotPossibleDuePcblocked;
|
||||
ret = ret | MarriagePossibleEnum.NotPossibleDuePcbLocked;
|
||||
}
|
||||
|
||||
if (dr["PcbBlocked"].ToString() == "1")
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
query.AppendLine(" ,@TestPressure");
|
||||
query.AppendLine(" ,@TesterName)");
|
||||
|
||||
foreach (var item in testResult.Testpoints)
|
||||
foreach (var item in testResult.TestPoints)
|
||||
{
|
||||
query.AppendLine(" INSERT INTO [dbo].[Cordonel_PressureTest_TestPoints]");
|
||||
query.AppendLine(" ([CordonelPressureTest_Id]");
|
||||
@@ -237,12 +237,12 @@ namespace Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
var testID = (int)drMain["CordonelPressureTest_Id"];
|
||||
add.Testpoints = new List<PressureTestPoints>();
|
||||
add.TestPoints = new List<PressureTestPoints>();
|
||||
foreach (var drTestPoints in dtTestPoints.Select($"CordonelPressureTest_Id = {testID}"))
|
||||
{
|
||||
|
||||
|
||||
add.Testpoints.Add(
|
||||
add.TestPoints.Add(
|
||||
new PressureTestPoints()
|
||||
{
|
||||
Ident = (int)drTestPoints["CordonelPressureTest_TestPointNr"],
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
sb.AppendLine(" and (@Adress is null or [Address] = @Adress ) ");
|
||||
sb.AppendLine(" order by [Address] desc, [date] desc ");
|
||||
|
||||
var ret = new List<RegisterHisory>();
|
||||
var ret = new List<RegisterHistory>();
|
||||
|
||||
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
|
||||
{
|
||||
@@ -82,7 +82,7 @@ namespace Service.MeterProcessState.Controllers
|
||||
{
|
||||
value = null;
|
||||
}
|
||||
ret.Add(new RegisterHisory((string)row["PcbId"], adressP, value, (DateTime)row["date"]));
|
||||
ret.Add(new RegisterHistory((string)row["PcbId"], adressP, value, (DateTime)row["date"]));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.RegisterProperties;
|
||||
|
||||
namespace Tools.JsonToXlsHelper
|
||||
{
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0d85a5b3a7561b41163c20e5dc7713bcd0d65555
|
||||
f64d563def603c89cafafa61a3219ba97e1e344c
|
||||
|
||||
+19
-12
@@ -37,6 +37,7 @@
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.cbComSlot = new System.Windows.Forms.ComboBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.btnRebootMeter = new System.Windows.Forms.Button();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.btnUploadConfig = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
@@ -109,7 +110,6 @@
|
||||
this.cbxFilterFWType = new System.Windows.Forms.ComboBox();
|
||||
this.chbFilterIsDeveloper = new System.Windows.Forms.CheckBox();
|
||||
this.saveConfigFile = new System.Windows.Forms.SaveFileDialog();
|
||||
this.btnRebootMeter = new System.Windows.Forms.Button();
|
||||
this.grpSetup.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
@@ -250,6 +250,16 @@
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Applications ";
|
||||
//
|
||||
// btnRebootMeter
|
||||
//
|
||||
this.btnRebootMeter.Location = new System.Drawing.Point(951, 476);
|
||||
this.btnRebootMeter.Name = "btnRebootMeter";
|
||||
this.btnRebootMeter.Size = new System.Drawing.Size(116, 25);
|
||||
this.btnRebootMeter.TabIndex = 23;
|
||||
this.btnRebootMeter.Text = "METER REBOOT";
|
||||
this.btnRebootMeter.UseVisualStyleBackColor = true;
|
||||
this.btnRebootMeter.Click += new System.EventHandler(this.btnRebootMeter_Click);
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.btnUploadConfig);
|
||||
@@ -329,6 +339,7 @@
|
||||
this.gbxManualTimingControl.TabIndex = 17;
|
||||
this.gbxManualTimingControl.TabStop = false;
|
||||
this.gbxManualTimingControl.Text = "Timing Control";
|
||||
this.gbxManualTimingControl.Visible = false;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
@@ -428,6 +439,7 @@
|
||||
this.gbxManualUploadAndVerification.TabIndex = 15;
|
||||
this.gbxManualUploadAndVerification.TabStop = false;
|
||||
this.gbxManualUploadAndVerification.Text = "Manual Verification";
|
||||
this.gbxManualUploadAndVerification.Visible = false;
|
||||
//
|
||||
// btnVerifyFiles
|
||||
//
|
||||
@@ -478,7 +490,7 @@
|
||||
this.groupBox3.Size = new System.Drawing.Size(126, 49);
|
||||
this.groupBox3.TabIndex = 12;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Automatic";
|
||||
this.groupBox3.Text = "Execute";
|
||||
//
|
||||
// btnUpdateFw
|
||||
//
|
||||
@@ -578,6 +590,7 @@
|
||||
this.cbxConsecutiveFilePartsRetryEnable.TabIndex = 23;
|
||||
this.cbxConsecutiveFilePartsRetryEnable.Text = "Retry Consecutive File Parts";
|
||||
this.cbxConsecutiveFilePartsRetryEnable.UseVisualStyleBackColor = true;
|
||||
this.cbxConsecutiveFilePartsRetryEnable.Visible = false;
|
||||
this.cbxConsecutiveFilePartsRetryEnable.CheckedChanged += new System.EventHandler(this.cbxConsecutiveFilePartsRetryEnable_CheckedChanged);
|
||||
//
|
||||
// label6
|
||||
@@ -588,6 +601,7 @@
|
||||
this.label6.Size = new System.Drawing.Size(26, 13);
|
||||
this.label6.TabIndex = 22;
|
||||
this.label6.Text = "[kB]";
|
||||
this.label6.Visible = false;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
@@ -597,6 +611,7 @@
|
||||
this.label5.Size = new System.Drawing.Size(73, 13);
|
||||
this.label5.TabIndex = 21;
|
||||
this.label5.Text = "File Part Sizes";
|
||||
this.label5.Visible = false;
|
||||
//
|
||||
// cbFilePartSize
|
||||
//
|
||||
@@ -614,6 +629,7 @@
|
||||
this.cbFilePartSize.Size = new System.Drawing.Size(44, 21);
|
||||
this.cbFilePartSize.TabIndex = 20;
|
||||
this.cbFilePartSize.Text = "2";
|
||||
this.cbFilePartSize.Visible = false;
|
||||
//
|
||||
// cbxSingleFilePartsRetryEnable
|
||||
//
|
||||
@@ -626,6 +642,7 @@
|
||||
this.cbxSingleFilePartsRetryEnable.TabIndex = 19;
|
||||
this.cbxSingleFilePartsRetryEnable.Text = "Retry Single File Parts";
|
||||
this.cbxSingleFilePartsRetryEnable.UseVisualStyleBackColor = true;
|
||||
this.cbxSingleFilePartsRetryEnable.Visible = false;
|
||||
this.cbxSingleFilePartsRetryEnable.CheckedChanged += new System.EventHandler(this.cbxSingleFilePartsRetryEnable_CheckedChanged);
|
||||
//
|
||||
// cbxManualControl
|
||||
@@ -981,16 +998,6 @@
|
||||
//
|
||||
this.saveConfigFile.Filter = "configuration file (*.hex)|*.hex";
|
||||
//
|
||||
// btnRebootMeter
|
||||
//
|
||||
this.btnRebootMeter.Location = new System.Drawing.Point(951, 476);
|
||||
this.btnRebootMeter.Name = "btnRebootMeter";
|
||||
this.btnRebootMeter.Size = new System.Drawing.Size(116, 25);
|
||||
this.btnRebootMeter.TabIndex = 23;
|
||||
this.btnRebootMeter.Text = "METER REBOOT";
|
||||
this.btnRebootMeter.UseVisualStyleBackColor = true;
|
||||
this.btnRebootMeter.Click += new System.EventHandler(this.btnRebootMeter_Click);
|
||||
//
|
||||
// FrmFwUpdate
|
||||
//
|
||||
this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound;
|
||||
|
||||
@@ -665,7 +665,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
SetTimeDisplay();
|
||||
|
||||
text = RegisterConverter.ConvertTo<String>(
|
||||
_currentGenesis.ReadRegister(Register.Configexchange.PCBSerialNumber, 12));
|
||||
_currentGenesis.ReadRegister(Register.Configexchange.PcbSerialNumber, 12));
|
||||
barOverallProgressUpdate.Value = barOverallProgressUpdate.Value + 4 > 100 ? 0 :
|
||||
barOverallProgressUpdate.Value + 4;
|
||||
var bootProcess = (Int32)(bootDelayMs * 100.0 / maxBootDelayMs);
|
||||
|
||||
@@ -132,12 +132,6 @@
|
||||
<metadata name="tabDb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="tabProduction.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="tabDb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="saveConfigFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>465, 17</value>
|
||||
</metadata>
|
||||
|
||||
+2
-2
@@ -303,8 +303,8 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
//
|
||||
// currentVerionForProdDataGridViewCheckBoxColumn
|
||||
//
|
||||
this.currentVerionForProdDataGridViewCheckBoxColumn.DataPropertyName = "CurrentVerionForProd";
|
||||
this.currentVerionForProdDataGridViewCheckBoxColumn.HeaderText = "CurrentVerionForProd";
|
||||
this.currentVerionForProdDataGridViewCheckBoxColumn.DataPropertyName = "CurrentVersionForProd";
|
||||
this.currentVerionForProdDataGridViewCheckBoxColumn.HeaderText = "CurrentVersionForProd";
|
||||
this.currentVerionForProdDataGridViewCheckBoxColumn.Name = "currentVerionForProdDataGridViewCheckBoxColumn";
|
||||
this.currentVerionForProdDataGridViewCheckBoxColumn.ReadOnly = true;
|
||||
//
|
||||
|
||||
@@ -729,7 +729,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
|
||||
foreach (var item in a)
|
||||
{
|
||||
if (!Prod || item.CurrentVerionForProd)
|
||||
if (!Prod || item.CurrentVersionForProd)
|
||||
{
|
||||
cbxDbLuts.Items.Add(item);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
Rev = 0,
|
||||
TesterName = "pc",
|
||||
TestPressure = "0",
|
||||
Testpoints = new System.Collections.Generic.List<PressureTestPoints>() { new PressureTestPoints() { Ident = 1, Input = "0" } }
|
||||
TestPoints = new System.Collections.Generic.List<PressureTestPoints>() { new PressureTestPoints() { Ident = 1, Input = "0" } }
|
||||
};
|
||||
ret = LocalWebRequest.PostRequestAsync(url, json: mutedResult);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
//
|
||||
// registerHisoryBindingSource
|
||||
//
|
||||
this.registerHisoryBindingSource.DataSource = typeof(RegisterHisory);
|
||||
this.registerHisoryBindingSource.DataSource = typeof(RegisterHistory);
|
||||
|
||||
var configFilePath = "configuration.json";
|
||||
if (!new FileInfo(configFilePath).Exists)
|
||||
@@ -78,7 +78,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
//
|
||||
// registerHisoryBindingSource
|
||||
//
|
||||
this.registerHisoryBindingSource.DataSource = typeof(RegisterHisory);
|
||||
this.registerHisoryBindingSource.DataSource = typeof(RegisterHistory);
|
||||
pcbID = _pcbID;
|
||||
registerSelection = new Dictionary<String, Byte[]>();
|
||||
registerSelection.Add(_registerDefinition.GetIdent(), _registerDefinition.RegisterAddress);
|
||||
@@ -102,7 +102,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
}
|
||||
var url = ServiceUrls.RegisterWatchServiceUrl() + $"GetRegisterHistory?PcbID={txtPcbId.Text}&Address={BitConverter.ToString(adress)}";
|
||||
|
||||
var dt = JsonConvert.DeserializeObject<List<RegisterHisory>>(LocalWebRequest.GetRequest(url));
|
||||
var dt = JsonConvert.DeserializeObject<List<RegisterHistory>>(LocalWebRequest.GetRequest(url));
|
||||
|
||||
dgvHist.DataSource = dt;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
public partial class FrmStreamingQuality : Form
|
||||
{
|
||||
private GenesisMeterStreamingQuality _currentGenesis;
|
||||
private MeterBatch _meterBatch = new MeterBatch("C:\\Users\\drabesch_ro\\Downloads\\ReleaseV1.1.2.6\\");
|
||||
private MeterBatch _meterBatch = new MeterBatch();
|
||||
private readonly ILogger _logger;
|
||||
private const Int32 SampleRateHz = 16;
|
||||
private Int32 _channels;
|
||||
|
||||
@@ -2090,13 +2090,13 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
|
||||
var url = ServiceUrls.RegisterWatchServiceUrl() + $"GetRegisterHistory?PcbID={_currentGenesis.PcbId}&Address=01-09";
|
||||
|
||||
var dt = JsonConvert.DeserializeObject<List<RegisterHisory>>(LocalWebRequest.GetRequest(url));
|
||||
var dt = JsonConvert.DeserializeObject<List<RegisterHistory>>(LocalWebRequest.GetRequest(url));
|
||||
|
||||
var lastCharge = dt.OrderByDescending(d => d.Date).First().Value;
|
||||
|
||||
url = ServiceUrls.RegisterWatchServiceUrl() + $"GetRegisterHistory?PcbID={_currentGenesis.PcbId}&Address=01-0A";
|
||||
|
||||
dt = JsonConvert.DeserializeObject<List<RegisterHisory>>(LocalWebRequest.GetRequest(url));
|
||||
dt = JsonConvert.DeserializeObject<List<RegisterHistory>>(LocalWebRequest.GetRequest(url));
|
||||
|
||||
var lastSeconds = dt.OrderByDescending(d => d.Date).First().Value;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
@@ -281,11 +280,11 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
{
|
||||
if (portList.All(pl => pl != (String)row[StreamingPortString]))
|
||||
{
|
||||
ret.Rows.Add(row[StreamingPortString].ToString(), "NA");
|
||||
ret.Rows.Add(row[StreamingPortString].ToString(), BaseSerialPort.PortNotAssigned);
|
||||
}
|
||||
if (portList.All(pl => pl != (String)row[RequestPortString]))
|
||||
{
|
||||
ret.Rows.Add(row[RequestPortString].ToString(), "NA");
|
||||
ret.Rows.Add(row[RequestPortString].ToString(), BaseSerialPort.PortNotAssigned);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -446,7 +446,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
{
|
||||
if (item.Value.Enabled)
|
||||
{
|
||||
if (item.Value.Metersize != MeterSize.NAN && biggestMeterSize < item.Value.Metersize)
|
||||
if (item.Value.Metersize != MeterSize.NA && biggestMeterSize < item.Value.Metersize)
|
||||
{
|
||||
biggestMeterSize = item.Value.Metersize;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
public string CalibrationRun { get; set; }
|
||||
public int LastTestBechState { get; set; }
|
||||
|
||||
public MeterSize Metersize { get; set; } = MeterSize.NAN;
|
||||
public MeterSize Metersize { get; set; } = MeterSize.NA;
|
||||
public ctlMeterReady()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -182,7 +182,8 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateDb
|
||||
$"&Build={swLicense.Build}&ValidTo={swLicense.ValidTo:yyyy-MM-ddTHH:mm:ss}" +
|
||||
$"&Description={swLicense.Description ?? "null"}&ProgramNameIsUnique={swLicense.ProgramNameIsUnique}";
|
||||
var requestResponse = LocalWebRequest.PostRequestAsyncAndGetContent(url, 1200);
|
||||
if (string.IsNullOrEmpty(requestResponse) && !JsonConvert.DeserializeObject<Boolean>(requestResponse))
|
||||
if (requestResponse != null && string.IsNullOrEmpty(requestResponse) &&
|
||||
!JsonConvert.DeserializeObject<Boolean>(requestResponse))
|
||||
{
|
||||
DbIsConnected = false;
|
||||
return false;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe
|
||||
{
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery;
|
||||
|
||||
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe
|
||||
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
|
||||
{
|
||||
/// <summary>
|
||||
/// Recovery of registers in the field
|
||||
/// </summary>
|
||||
public class RecoveryRegisterItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Registername, use the latest configuration.json to make sure that the adress will be correct
|
||||
/// Register name, use the latest configuration.json to make sure that the adress will be correct
|
||||
/// </summary>
|
||||
public string RegisterIdent { get; set; }
|
||||
public String RegisterIdent { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Content to write
|
||||
/// </summary>
|
||||
public byte[] WriteValue { get; set; }
|
||||
public Byte[] WriteValue { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// check if the wirtten value is sett like this
|
||||
/// Null or not set if a read back is not needed
|
||||
/// </summary>
|
||||
public byte[] ReadbackValue { get; set; }
|
||||
public Byte[] ReadbackValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Mark Update as failed if write was not successful
|
||||
/// </summary>
|
||||
public bool IsCiritcal { get; set; }
|
||||
public Boolean IsCiritcal { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class RecoverySettings
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Null if check in not necessary if is an number check it agianst the pcbid from meter
|
||||
/// </summary>
|
||||
public int? PcbID { get; set; }
|
||||
public Int32? PcbId { get; set; }
|
||||
/// <summary>
|
||||
/// Null if check in not necessary if is an number check it agianst the radio FRQ
|
||||
/// </summary>
|
||||
public int? RadioFrequencyMhz { get; set; }
|
||||
public Int32? RadioFrequencyMhz { get; set; }
|
||||
/// <summary>
|
||||
/// Null till meter handels regions
|
||||
/// Null till meter handles regions
|
||||
/// </summary>
|
||||
public string Region { get; set; } = null;
|
||||
public String Region { get; set; } = null;
|
||||
/// <summary>
|
||||
/// Null till meter handels regions
|
||||
/// Null till meter handles regions
|
||||
/// </summary>
|
||||
public string Release { get; set; }
|
||||
public String Release { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User name
|
||||
/// </summary>
|
||||
public string ApproverName { get; set; }
|
||||
public String ApproverName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -42,9 +42,13 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
|
||||
/// </summary>
|
||||
public List<RecoveryRegisterItem> RecoveryRegisters { get; set; }
|
||||
|
||||
public string GenerateFileName()
|
||||
/// <summary>
|
||||
/// File name for this recovery register set
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public String GenerateFileName()
|
||||
{
|
||||
return $"{PcbID}_{RadioFrequencyMhz}_{Region}_{Release}.config";
|
||||
return $"{PcbId}_{RadioFrequencyMhz}_{Region}_{Release}.config";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
|
||||
{
|
||||
/// <summary>
|
||||
/// Recovery rules
|
||||
/// </summary>
|
||||
public enum RegisterRecoveryAccess
|
||||
{
|
||||
/// <summary>
|
||||
/// Set this register always
|
||||
/// </summary>
|
||||
SetAlways,
|
||||
/// <summary>
|
||||
/// Set register if it has the default value
|
||||
/// </summary>
|
||||
SetIfDefault,
|
||||
/// <summary>
|
||||
/// Set the register if it is zero
|
||||
/// </summary>
|
||||
SetIfZero
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe
|
||||
{
|
||||
|
||||
@@ -1802,7 +1802,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
}
|
||||
#endregion --------------------------------------- Tools ------------------------------------------------------
|
||||
|
||||
#region ------------------------------------------ Common Prozess Routines ------------------------------------
|
||||
#region ------------------------------------------ Common Process Routines ------------------------------------
|
||||
/// <summary>
|
||||
/// Common routine to convert objects to process states.
|
||||
/// Objects are sorted:
|
||||
@@ -2082,7 +2082,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
var progress = (Int32)e.ActualProcessPercent;
|
||||
UiInvoker.ProgressBarInvoker(barActualProgressUpdate, progress > 100 ? 100 : progress);
|
||||
}
|
||||
#endregion --------------------------------------- Common Prozess Routines ------------------------------------
|
||||
#endregion --------------------------------------- Common Process Routines ------------------------------------
|
||||
|
||||
#region ------------------------------------------ Reboot -----------------------------------------------------
|
||||
|
||||
@@ -2157,7 +2157,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
if (_bootDelayCtrMs % internalCommunicationDelayMs == 0)
|
||||
{
|
||||
text = RegisterConverter.ConvertTo<String>(
|
||||
_currentGenesis.ReadRegister(Register.Configexchange.PCBSerialNumber, 12));
|
||||
_currentGenesis.ReadRegister(Register.Configexchange.PcbSerialNumber, 12));
|
||||
}
|
||||
|
||||
ProcessUpdate_Event(this, new ProcessExecEventArgs(Resources.StrUpdateAppAndRestartMeter,
|
||||
|
||||
Reference in New Issue
Block a user