Logic/ProductionOrderCore: -ReSharper
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
<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>
|
||||
@@ -37,4 +38,5 @@
|
||||
<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>
|
||||
<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>
|
||||
@@ -19,6 +19,7 @@
|
||||
<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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user