diff --git a/Common/.vs/config/applicationhost.config b/Common/.vs/config/applicationhost.config index 1b9332b4..40cde372 100644 --- a/Common/.vs/config/applicationhost.config +++ b/Common/.vs/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/Common/CordonelAssemblyLine/App.config b/Common/CordonelAssemblyLine/App.config index 26651e30..aefc23c0 100644 --- a/Common/CordonelAssemblyLine/App.config +++ b/Common/CordonelAssemblyLine/App.config @@ -6,13 +6,13 @@ - + - + diff --git a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/BaseTransmitProtocol.cs b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/BaseTransmitProtocol.cs index 8f738811..215edf0b 100644 --- a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/BaseTransmitProtocol.cs +++ b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/BaseTransmitProtocol.cs @@ -24,6 +24,8 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol public abstract List DecodeDataForLogicLayer(List rawData); + public abstract List DecodeDataForPhysicalLayerUI1236(byte[] payload); + } } diff --git a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/ITransmitProtocol.cs b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/ITransmitProtocol.cs index cea8b9a5..e9ed89e9 100644 --- a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/ITransmitProtocol.cs +++ b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/ITransmitProtocol.cs @@ -22,6 +22,8 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol /// void SetDefaultResponseTimeout(); + List DecodeDataForPhysicalLayerUI1236(byte[] payload); + /// /// Send out data (including transport protocol specific data like CRC) to physical port (like UART or IrDA) /// diff --git a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/IrdaTransmitProtocol.cs b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/IrdaTransmitProtocol.cs index a328f353..80b45342 100644 --- a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/IrdaTransmitProtocol.cs +++ b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/IrdaTransmitProtocol.cs @@ -169,5 +169,25 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol return irdaRecord; } + + public override List DecodeDataForPhysicalLayerUI1236(byte[] requestProtocolPayload) + { + List collection = new List() + { + (byte) 35, + (byte) (requestProtocolPayload.Length / 2) + }; + collection.AddRange((IEnumerable)requestProtocolPayload); + ushort reversedLsb8408 = Xylem.Common.Utils.Crc16Ccitt.Crc16Ccitt.CalculateReversedLsb8408(collection.ToArray()); + List byteList = new List() + { + (byte) 155 + }; + byteList.AddRange((IEnumerable)collection); + byteList.Add((byte)((uint)reversedLsb8408 & (uint)byte.MaxValue)); + byteList.Add((byte)((uint)reversedLsb8408 >> 8)); + this.Logger.Info("DecodeDataForPhysicalLayerUI1236 PC->Cordonel(" + BitConverter.ToString(byteList.ToArray()) + ")"); + return byteList; + } } } diff --git a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/LedTransmitProtocol.cs b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/LedTransmitProtocol.cs index 3c94127d..6bd149ed 100644 --- a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/LedTransmitProtocol.cs +++ b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/LedTransmitProtocol.cs @@ -47,5 +47,7 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol { return rawData; } + + public override List DecodeDataForPhysicalLayerUI1236(byte[] payload) => throw new ApplicationException("Streaming port cannot send data"); } } diff --git a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/UartTransmitProtocol.cs b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/UartTransmitProtocol.cs index a924a9b1..93d6df33 100644 --- a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/UartTransmitProtocol.cs +++ b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/UartTransmitProtocol.cs @@ -144,7 +144,22 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol return uartRecord; } - + public override List DecodeDataForPhysicalLayerUI1236(byte[] requestProtocolPayload) + { + List byteList1 = new List(); + List list = ((IEnumerable)requestProtocolPayload).ToList(); + List byteList2 = new List(); + byteList1.Add((byte)(requestProtocolPayload.Length + 4 + 2)); + byteList1.Add((byte)0); + byteList1.Add((byte)0); + ushort num = this.CrcCalc(byteList1, list); + byteList2.Add((byte)91); + byteList2.AddRange((IEnumerable)byteList1); + byteList2.Add((byte)((uint)num & (uint)byte.MaxValue)); + byteList2.Add((byte)((uint)num >> 8)); + byteList2.AddRange((IEnumerable)list); + return byteList2; + } } } diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index 66c1c034..3bf7dcfc 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -1878,6 +1878,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } } + + public byte[] SendUI1236Command(byte[] UI1236Frame,bool waitForResult = true,bool checkRegister = false,ushort skipRetryErrorCode = 4) + { + this._logger.Info(string.Format("Slot:{0} - Sending Ui-1236 frame: {1} ", (object)this.Slot, (object)UI1236Frame)); + RequestRecord sendFifoUi1236 = this.RequestProtocol.AddRecordToSendFifoUI1236(UI1236Frame); + this.RequestProtocolProcess(); + return sendFifoUi1236.ResponsePayload.ToArray(); + } + + #endregion #region Class handling diff --git a/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.cs b/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.cs index a18d45e2..68176943 100644 --- a/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.cs +++ b/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.cs @@ -11,6 +11,8 @@ using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig; using Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.ProtocolCore; using Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.Consts; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; +using Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol; +using Xylem.Common.Hardware.Interfaces.Ports.PortCore; namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol { @@ -305,6 +307,27 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol return recordForSendFifo; } + + public RequestRecord AddRecordToSendFifoUI1236( + byte[] payload, + RegisterDefinition register = null, + bool hideDataInLog = false, + ushort skipRetryErrorCode = 4) + { + byte maxValue = byte.MaxValue; + List requestProtocolData = new List() + { + maxValue + }; + requestProtocolData.AddRange((IEnumerable)payload); + ITransmitProtocol transmitProtocol = this.GetTransmitProtocol(); + List encodedRequestData = transmitProtocol.DecodeDataForPhysicalLayerUI1236(payload); + TransmitPortSettings transmitPortSettings = transmitProtocol.GetTransmitPortSettings(); + RequestRecord sendFifoUi1236 = new RequestRecord(maxValue, requestProtocolData, encodedRequestData, transmitPortSettings.ResponseTimeoutMs, register, hideDataInLog, skipRetryErrorCode); + this._recordsSendFifo.Enqueue(sendFifoUi1236); + return sendFifoUi1236; + } + /// /// Called after successful response. /// Decode and check record, handle Errors and dispatch result. diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache index f22623aa..b81d5f66 100644 --- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache +++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3 +46bd00889699f5a20a4981a22f62b66368323855 diff --git a/Common/Logic/ProductionOrderCore/KitronTestResults/RadioTest.cs b/Common/Logic/ProductionOrderCore/KitronTestResults/RadioTest.cs index a4afc047..77d98866 100644 --- a/Common/Logic/ProductionOrderCore/KitronTestResults/RadioTest.cs +++ b/Common/Logic/ProductionOrderCore/KitronTestResults/RadioTest.cs @@ -3,7 +3,9 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using Newtonsoft.Json.Linq; using System; + using System.Collections.Generic; using System.Globalization; public partial class RadioTest @@ -271,305 +273,75 @@ namespace Xylem.Common.Logic.ProductionOrderCore.KitronTestResults } alternateReturnObj.StartDt = newFromat.JsonObject.StartDT; alternateReturnObj.TestStepLoopCalibrate = new TestStep(); - alternateReturnObj.TestStepLoopCalibrate.Values = new Value[12]; + alternateReturnObj.TestStepLoopCalibrate.Values = new Value[23]; - var add = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop1; - add.LengthCode = newFromat.JsonObject.LengthCodeLoop1; - add.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); + var TestStepLoopCalibrateToAdd = new List(); + + JObject joResponse = JObject.Parse(json); - add.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop1; - add.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop1; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add, 0); + var Hit = true; - var add2 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add2.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop2; - add2.LengthCode = newFromat.JsonObject.LengthCodeLoop2; - add2.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add2.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop2; - add2.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop2; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add2, 1); - - - var add3 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add3.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop3; - add3.LengthCode = newFromat.JsonObject.LengthCodeLoop3; - add3.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add3.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop3; - add3.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop3; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add3, 2); - - - var add4 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add4.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop4; - add4.LengthCode = newFromat.JsonObject.LengthCodeLoop4; - add4.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add4.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop4; - add4.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop4; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add4, 3); - - - var add5 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add5.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop5; - add5.LengthCode = newFromat.JsonObject.LengthCodeLoop5; - add5.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add5.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop5; - add5.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop5; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add5, 4); - - - var add6 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add6.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop6; - add6.LengthCode = newFromat.JsonObject.LengthCodeLoop6; - add6.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add6.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop6; - add6.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop6; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add6, 5); - - var add7 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add7.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop7; - add7.LengthCode = newFromat.JsonObject.LengthCodeLoop7; - add7.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add7.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop7; - add7.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop7; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add7, 6); - - - var add8 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add8.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop8; - add8.LengthCode = newFromat.JsonObject.LengthCodeLoop8; - add8.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add8.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop8; - add8.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop8; - - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add8, 7); - - - - - var add9 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add9.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop9; - add9.LengthCode = newFromat.JsonObject.LengthCodeLoop9; - add9.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add9.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop9; - add9.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop9; - if (add9.ResultCalibration == null) + int loopCount = 0; + foreach (var item in joResponse["JsonObject"].Children()) { - return alternateReturnObj; + + if (item is JProperty pitem) + { + if (pitem.Name == $"ResultCalibration Loop_{loopCount +1}") + { + 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; + } + } + + if (pitem.Name == $"LengthCode Loop_{loopCount}") + { + if (TestStepLoopCalibrateToAdd.Count == loopCount) + { + TestStepLoopCalibrateToAdd[loopCount-1].LengthCode = pitem.Value.ToString(); + } + + } + if (pitem.Name == $"PowerLevelCalculated Loop_{loopCount}") + { + if (TestStepLoopCalibrateToAdd.Count == loopCount) + { + TestStepLoopCalibrateToAdd[loopCount-1].IPowerLevelCalculated = pitem.Value.ToString(); + } + + } + + if (pitem.Name == $"AntennaMatching Loop_{loopCount}") + { + if (TestStepLoopCalibrateToAdd.Count == loopCount) + { + TestStepLoopCalibrateToAdd[loopCount-1].IAntennaMatching = pitem.Value.ToString(); + } + + } + + + } + //if (item.Name + //{ + + //} + } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add9, 8); - - - var add10 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add10.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop10; - add10.LengthCode = newFromat.JsonObject.LengthCodeLoop10; - add10.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add10.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop10; - add10.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop10; - if (add10.ResultCalibration == null) + int i = 0; + foreach (var item in TestStepLoopCalibrateToAdd) { - return alternateReturnObj; + alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(item, i); + i = i + 1; } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add10, 9); - - - var add11 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add11.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop11; - add11.LengthCode = newFromat.JsonObject.LengthCodeLoop11; - add11.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add11.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop11; - add11.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop11; - if (add11.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add11, 10); - - var add12 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add12.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop12; - add12.LengthCode = newFromat.JsonObject.LengthCodeLoop12; - add12.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add12.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop12; - add12.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop12; - if (add12.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add12, 11); - - var add13 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add13.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop13; - add13.LengthCode = newFromat.JsonObject.LengthCodeLoop13; - add13.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add13.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop13; - add13.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop13; - if (add13.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add13, 12); - - - var add14 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add14.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop14; - add14.LengthCode = newFromat.JsonObject.LengthCodeLoop14; - add14.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add14.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop14; - add14.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop14; - if (add14.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add14, 13); - - - var add15 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add15.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop15; - add15.LengthCode = newFromat.JsonObject.LengthCodeLoop15; - add15.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add15.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop15; - add15.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop15; - if (add15.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add15, 14); - - - var add16 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add16.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop16; - add16.LengthCode = newFromat.JsonObject.LengthCodeLoop16; - add16.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add16.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop16; - add16.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop16; - if (add16.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add16, 15); - - - var add17 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add17.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop17; - add17.LengthCode = newFromat.JsonObject.LengthCodeLoop17; - add17.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add17.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop17; - add17.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop17; - if (add17.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add17, 16); - - - var add18 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add18.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop18; - add18.LengthCode = newFromat.JsonObject.LengthCodeLoop18; - add18.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add18.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop18; - add18.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop18; - if (add18.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add18, 17); - - - var add19 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add19.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop19; - add19.LengthCode = newFromat.JsonObject.LengthCodeLoop19; - add19.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add19.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop19; - add19.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop19; - if (add19.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add19, 18); - - - var add20 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add20.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop20; - add20.LengthCode = newFromat.JsonObject.LengthCodeLoop20; - add20.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add20.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop20; - add20.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop20; - if (add20.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add20, 19); - - - var add21 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add21.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop21; - add21.LengthCode = newFromat.JsonObject.LengthCodeLoop21; - add21.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add21.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop21; - add21.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop21; - if (add21.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add21, 20); - - - var add22 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add22.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop22; - add22.LengthCode = newFromat.JsonObject.LengthCodeLoop22; - add22.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add22.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop22; - add22.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop22; - if (add22.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add22, 21); - - - var add23 = new Xylem.Common.Logic.ProductionOrderCore.KitronTestResults.Value(); - add23.ResultCalibration = newFromat.JsonObject.ResultCalibrationLoop23; - add23.LengthCode = newFromat.JsonObject.LengthCodeLoop23; - add23.SLookupTablePower = newFromat.JsonObject.AttachmentFile.ToLower(); - - add23.IPowerLevelCalculated = newFromat.JsonObject.PowerLevelCalculatedLoop23; - add23.IAntennaMatching = newFromat.JsonObject.AntennaMatchingLoop23; - if (add23.ResultCalibration == null) - { - return alternateReturnObj; - } - alternateReturnObj.TestStepLoopCalibrate.Values.SetValue(add23, 22); - + return alternateReturnObj; } diff --git a/Common/ProductionUiCordonel/FinalTest.xaml b/Common/ProductionUiCordonel/FinalTest.xaml index b3ca4e68..9c644d0e 100644 --- a/Common/ProductionUiCordonel/FinalTest.xaml +++ b/Common/ProductionUiCordonel/FinalTest.xaml @@ -6,8 +6,8 @@ xmlns:local="clr-namespace:ProductionUiCordonel" xmlns:uc="clr-namespace:ProductionUiCordonel" mc:Ignorable="d" - Title="FinalTest" MinHeight="500" MinWidth="400" Height="603" Width="646" Initialized="Window_Initialized" Closing="Window_Closing"> - + Title="FinalTest" MinHeight="500" MinWidth="600" Height="638" Width="800" Initialized="Window_Initialized" Closing="Window_Closing" PreviewKeyDown="Window_PreviewKeyDown"> + @@ -75,18 +75,19 @@ - - - + + + - + + - public partial class UcBarcodeInput : UserControl { - - public event EventHandler BarcodeInput; - + + public event EventHandler BarcodeInput; + public UcBarcodeInput() { InitializeComponent(); @@ -85,18 +74,28 @@ namespace ProductionUiCordonel.UserControls.FinalTest )); } + public void inputKey(string input) + { + this.Dispatcher.Invoke(DispatcherPriority.Send, + new Action(() => + { + BarcodeInput?.Invoke(this,input); + } + )); + } + private void txtHiddenInput_KeyDown(object sender, KeyEventArgs e) { - if (e.Key == Key.Enter) - { - - BarcodeInput?.Invoke(sender, e); - } - else - { - lblInput.Content = txtHiddenInput.Text; - } - + //if (e.Key == Key.Enter) + //{ + + // BarcodeInput?.Invoke(sender, e); + //} + //else + //{ + // lblInput.Content = txtHiddenInput.Text; + //} + } @@ -105,7 +104,7 @@ namespace ProductionUiCordonel.UserControls.FinalTest this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(() => { - txtHiddenInput.Focus(); + //txtHiddenInput.Focus(); } )); } @@ -115,7 +114,7 @@ namespace ProductionUiCordonel.UserControls.FinalTest this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(() => { - txtHiddenInput.Focus(); + //txtHiddenInput.Focus(); } )); } diff --git a/Common/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml b/Common/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml index 7324a689..42c90743 100644 --- a/Common/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml +++ b/Common/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml @@ -43,7 +43,7 @@