diff --git a/Common/.shared/SharedAssemblyInfo.cs b/Common/.shared/SharedAssemblyInfo.cs
index 008c0055..352ecb93 100644
--- a/Common/.shared/SharedAssemblyInfo.cs
+++ b/Common/.shared/SharedAssemblyInfo.cs
@@ -13,4 +13,4 @@ using System.Reflection;
//
//[assembly: AssemblyVersion("1.2.*.0")]
-[assembly: AssemblyVersion("2.8.3.*")]
+[assembly: AssemblyVersion("2.8.4.*")]
diff --git a/Common/CordonelAssemblyLine/Model/PickingModel.cs b/Common/CordonelAssemblyLine/Model/PickingModel.cs
index fb8e1909..0bd3a717 100644
--- a/Common/CordonelAssemblyLine/Model/PickingModel.cs
+++ b/Common/CordonelAssemblyLine/Model/PickingModel.cs
@@ -821,7 +821,7 @@ namespace CordonelAssemblyLine.Model
meter.ReLogin();
}
meter.SetProcessState(DisplayCodes.PickingTested);
- var url = $"{ServiceUrls.MeterProcessStateUrl()}SetPickingState?PcbID={meter.PcbId}&FertigungsauftragsNr={_order}";
+ var url = $"{ServiceUrls.MeterProcessStateUrl()}SetPickingState?PcbID={meter.PcbId}&FertigungsauftragsNr={_order}&successful=1";
var retString = LocalWebRequest.PostRequestAsyncAndGetContent(url);
if (bool.TryParse(retString, out var result))
diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs
index b1a62e98..2094035f 100644
--- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs
+++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs
@@ -2115,7 +2115,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
{
WriteRegister("SENSUSRADIO_PersistenceGroup5", new Byte[] { 0x00, 0xff, 0x00, 0xff });
}
-
+ if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup6"))
+ {
+ WriteRegister("SENSUSRADIO_PersistenceGroup6", new Byte[] { 0x00, 0xff, 0x00, 0xff });
+ }
WriteRegister("CUSTOMER_AlarmEnableMask", beforeCancelAlarmEnableMask);
WriteRegister("CUSTOMER_AlarmBroadcastMask", beforeCancelAlarmBroadcastMask);
}
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 4163759b..39b3fdf8 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 @@
-8cb55c312de586b683d72cf58c13e2801d10e14b767777d98338d3e1473a1213
+b03dfbada453427a2bb1275645a5f1b525f29900
diff --git a/Common/LaaPackages b/Common/LaaPackages
index ffa0abaa..41c1163d 160000
--- a/Common/LaaPackages
+++ b/Common/LaaPackages
@@ -1 +1 @@
-Subproject commit ffa0abaa0448ba22350982cd3d3560ce1eaab42a
+Subproject commit 41c1163d102dbb63572e60c6ffd501e1765d848c
diff --git a/Common/Production/ProductionUiCordonel/ApplicationSettings.cs b/Common/Production/ProductionUiCordonel/ApplicationSettings.cs
deleted file mode 100644
index be2860eb..00000000
--- a/Common/Production/ProductionUiCordonel/ApplicationSettings.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//using System;
-//using System.Collections.Generic;
-//using System.IO;
-//using Newtonsoft.Json;
-
-//namespace Xylem.Common.Production.ProductionUiCordonel
-//{
-
-// ///
-// /// Configuration of ProductionUi
-// ///
-// public class ApplicationSettings
-// {
-
-// public class Pos
-// {
-// public Double Left { get; set; }
-// public Double Top { get; set; }
-// public Double Height { get; set; }
-// public Double Width { get; set; }
-// }
-// public class MultiFormChilds
-// {
-// public Type ViewModelType { get; set; }
-// public Boolean Visisble { get; set; }
-// public String Name { get; set; }
-// public Int32 Slot { get; set; }
-// public String TextPort { get; set; }
-// public Pos StartPos { get; set; }
-
-// }
-// public Int32 Slot { get; set; }
-
-// public Int32? PressureStationId { get; set; }
-// public Boolean AutoDetect { get; set; }
-
-// public Boolean AccessToPresuretestTab { get; set; }
-// public Boolean AccessToMarrieTab { get; set; }
-// public Boolean AccessToFinalcheckTab { get; set; }
-
-// public Boolean AccessToSettingTab { get; set; }
-// public Boolean AccessToStatusTab { get; set; }
-// public Boolean AccessToPickingTab { get; set; }
-
-
-// public Int32? SirtComport433 { get; set; }
-// public Int32? SirtComport866 { get; set; }
-// public Int32? SirtBoxNr { get; set; }
-
-// public Int32? StationId { get; set; }
-
-// public List ChildForms { get; set; }
-
-// ///
-// /// ctor
-// ///
-// public ApplicationSettings()
-// {
-// Slot = 0;
-// AutoDetect = false;
-// AccessToPresuretestTab = false;
-// AccessToMarrieTab = false;
-// AccessToFinalcheckTab = false;
-// AccessToSettingTab = false;
-// AccessToPickingTab = false;
-// AccessToStatusTab = false;
-// PressureStationId = null;
-// SirtComport433 = null;
-// SirtComport866 = null;
-// SirtBoxNr = null;
-// ChildForms = new List();
-// StationId = null;
-// }
-// ///
-// public ApplicationSettings(String file)
-// {
-// //var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
-// //nameof(Xylem.Common.Hardware.WaterMeter.Genesis), file);
-
-// //if (!File.Exists(configFile))
-// //{
-// var configFile = Path.Combine(file);
-// if (!File.Exists(configFile))
-// {
-// Slot = 0;
-// AutoDetect = false;
-// AccessToPresuretestTab = false;
-// AccessToMarrieTab = false;
-// AccessToFinalcheckTab = false;
-// AccessToSettingTab = false;
-// AccessToPickingTab = false;
-// AccessToStatusTab = false;
-// PressureStationId = null;
-// ChildForms = new List();
-// StationId = null;
-// return;
-// }
-// //}
-
-// using (var tr = new StreamReader(configFile))
-// {
-// var meterConfig = JsonConvert.DeserializeObject(tr.ReadToEnd());
-// if (meterConfig != null)
-// {
-// Slot = meterConfig.Slot;
-// AutoDetect = meterConfig.AutoDetect;
-// AccessToPresuretestTab = meterConfig.AccessToPresuretestTab;
-// AccessToMarrieTab = meterConfig.AccessToMarrieTab;
-// AccessToFinalcheckTab = meterConfig.AccessToFinalcheckTab;
-// AccessToSettingTab = meterConfig.AccessToSettingTab;
-// AccessToPickingTab = meterConfig.AccessToPickingTab;
-// AccessToStatusTab = meterConfig.AccessToStatusTab;
-// PressureStationId = meterConfig.PressureStationId;
-
-// ChildForms = meterConfig.ChildForms;
-// StationId = meterConfig.StationId;
-// }
-// }
-
-// }
-
-// public void Update(String file)
-// {
-// var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
-// nameof(Hardware.WaterMeter.Genesis), file);
-
-// if (!File.Exists(configFile))
-// {
-// configFile = Path.Combine(file);
-// }
-
-// File.WriteAllText(file, JsonConvert.SerializeObject(this));
-// }
-
-
-// }
-//}
diff --git a/Common/Production/ProductionUiCordonel/BarcodeInput/Listener.cs b/Common/Production/ProductionUiCordonel/BarcodeInput/Listener.cs
deleted file mode 100644
index a5e49ac4..00000000
--- a/Common/Production/ProductionUiCordonel/BarcodeInput/Listener.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-//using System;
-//using System.Collections.Generic;
-//using System.Linq;
-//using System.Text;
-//using System.Threading.Tasks;
-//using System.Windows.Forms;
-
-//namespace ProductionUiCordonel.BarcodeInput
-//{
-// public class Listener : NativeWindow
-// {
-// ///
-// /// Initializes a new instance of the BarcodeScannerListener
-// /// class. The raw input devices that this class will listen to are
-// /// registered with the given window handle.
-// ///
-// /// the form that should listen for
-// /// barcode scans
-// /// if the form is null
-// /// if we are unable to register
-// /// for raw input devices
-// /// if an error occurs
-// /// during configuration
-// public Listener(Form form)
-// {
-// IntPtr hwnd;
-
-// if (form == null)
-// {
-// throw new ArgumentNullException("form");
-// }
-
-// hwnd = form.Handle;
-
-// HookRawInput(hwnd); // We'll take a look at this in a minute
-// this.HookHandleEvents(form);
-
-// this.AssignHandle(hwnd);
-// }
-// ///
-// /// Registers ourselves to listen to raw input from keyboard-like devices.
-// ///
-// /// the handle of the form that will receive the raw
-// /// input messages
-// /// if the call to register with the
-// /// raw input API fails for some reason
-// private static void HookRawInput(IntPtr hwnd)
-// {
-// NativeMethods.RAWINPUTDEVICE[] rid;
-
-// rid = new NativeMethods.RAWINPUTDEVICE[1];
-
-// rid[0].usUsagePage = 0x01; // USB HID Generic Desktop Page
-// rid[0].usUsage = 0x06; // Keyboard Usage ID
-// rid[0].dwFlags = NativeMethods.RawInputDeviceFlags.RIDEV_INPUTSINK;
-// rid[0].hwndTarget = hwnd;
-
-// if (!NativeMethods.RegisterRawInputDevices(rid, (uint)rid.Length, (uint)Marshal.SizeOf(rid[0])))
-// {
-// InvalidOperationException e;
-
-// e = new InvalidOperationException(
-// "The barcode scanner listener could not register for raw input devices.",
-// new Win32Exception());
-// throw e;
-// }
-// }
-
-// ///
-// /// Hooks into the form's HandleCreated and HandleDestoryed events
-// /// to ensure that we start and stop listening at appropriate times.
-// ///
-// /// the form to listen to
-// private void HookHandleEvents(Form form)
-// {
-// form.HandleCreated += this.OnHandleCreated;
-// form.HandleDestroyed += this.OnHandleDestroyed;
-// }
-
-// ///
-// /// When the form's handle is created, let's hook into it so we can see
-// /// the WM_INPUT event.
-// ///
-// /// the form whose handle was created
-// /// the event arguments
-// private void OnHandleCreated(object sender, EventArgs e)
-// {
-// this.AssignHandle(((Form)sender).Handle);
-// }
-
-// ///
-// /// When the form's handle is destroyed, let's unhook from it so we stop
-// /// listening and allow the OS to free up its resources.
-// ///
-// /// the form whose handle was destroyed
-// /// the event arguments
-// private void OnHandleDestroyed(object sender, EventArgs e)
-// {
-// this.ReleaseHandle();
-// }
-// }
-//}
diff --git a/Common/Production/ProductionUiCordonel/Data/FinalTestState.cs b/Common/Production/ProductionUiCordonel/Data/FinalTestState.cs
deleted file mode 100644
index 1981f6d7..00000000
--- a/Common/Production/ProductionUiCordonel/Data/FinalTestState.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-namespace ProductionUiCordonel.Data
-{
- ///
- /// Genesis meter final test states
- ///
- public enum FinalTestState
- {
- ///
- /// Idle (nothing to do)
- ///
- Idle,
- ///
- /// Start the initial execution
- ///
- StartInitial,
- ///
- /// Error handling
- ///
- Error,
- ///
- /// Single processing step failed
- ///
- StepFailed,
- ///
- /// Repeat last step
- ///
- RepeatStep,
- ///
- /// Repeat the entire final test
- ///
- RepeatFinalTest,
- ///
- /// Final test failed
- ///
- FinalTestFailed,
- ///
- /// Check the actual shipping state
- ///
- CheckShippingState,
- ///
- /// Check the attachments
- ///
- CheckAttachments,
- ///
- /// Check the order number
- ///
- CheckOrderNumber,
- ///
- /// Check the serial number
- ///
- CheckSerialNumber,
- ///
- /// Connect to Cordonel
- ///
- ConnectCordonel,
- ///
- /// Store all configurations to FLASH memory
- ///
- StoreAllConfigurations,
- ///
- /// Reboot the Cordonel to check all parameters being stored to FLASH memory
- ///
- RebootCordonel,
- ///
- /// Finalize process
- ///
- FinalizeProcess,
- ///
- /// Final parametrization fixed values
- ///
- FinalParametrizationFix,
- ///
- /// Final parametrization with VAKO and CSD
- ///
- FinalParametrizationVakoCsd,
- ///
- /// Read out all parametrization values
- ///
- FullReadOutParametrization,
- ///
- /// Check all settings for against required values
- ///
- ConfigurationCheck,
- ///
- /// Acquire, process set the password file
- ///
- ProcessPasswordFile,
- ///
- /// Process special configuration
- ///
- ProcessSpecialConfig,
- ///
- /// Prepare shipping mode
- ///
- PrepareShippingMode,
- ///
- /// Delimiter for list
- ///
- StateListDelimiter
- }
-}
\ No newline at end of file
diff --git a/Common/Production/ProductionUiCordonel/Data/FinalTestStateInfo.cs b/Common/Production/ProductionUiCordonel/Data/FinalTestStateInfo.cs
deleted file mode 100644
index bfcbca55..00000000
--- a/Common/Production/ProductionUiCordonel/Data/FinalTestStateInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-using System.Linq;
-using ProductionUiCordonel.Properties;
-
-namespace ProductionUiCordonel.Data
-{
- ///
- /// Concatenation of state and string
- ///
- public static class FinalTestStateInfo
- {
- ///
- /// Build state information
- ///
- private static readonly FinalTestStateText[] StateInfos;
-
- ///
- /// Ctor
- ///
- static FinalTestStateInfo()
- {
- StateInfos = new FinalTestStateText[(Int32)FinalTestState.StateListDelimiter];
- StateInfos[(Int32)FinalTestState.Idle].State = FinalTestState.Idle;
- StateInfos[(Int32)FinalTestState.Idle].Message = Resources.StrStateIdle;
-
- StateInfos[(Int32)FinalTestState.StartInitial].State = FinalTestState.StartInitial;
- StateInfos[(Int32)FinalTestState.StartInitial].Message = Resources.StrStateStartInitial;
-
- }
-
- ///
- /// Get the current information
- ///
- /// state to search for information text
- public static String GetTextFromState(FinalTestState state)
- {
- return (from stateInfo in StateInfos
- where stateInfo.State == state
- select stateInfo.Message).FirstOrDefault();
- }
- ///
- /// Get the state of the text
- ///
- /// information text to search if state is assigned
- public static FinalTestState GetStateFromText(String text)
- {
- return (from stateInfo in StateInfos
- where stateInfo.Message == text
- select stateInfo.State).FirstOrDefault();
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Data/FinalTestStateText.cs b/Common/Production/ProductionUiCordonel/Data/FinalTestStateText.cs
deleted file mode 100644
index 4bfd80cf..00000000
--- a/Common/Production/ProductionUiCordonel/Data/FinalTestStateText.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-namespace ProductionUiCordonel.Data
-{
- ///
- /// Concatenation between final test state and text
- ///
- public struct FinalTestStateText
- {
- ///
- /// The state of the final test
- ///
- public FinalTestState State;
- ///
- /// The message text of the final test state
- ///
- public String Message;
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Data/PickingResultData.cs b/Common/Production/ProductionUiCordonel/Data/PickingResultData.cs
deleted file mode 100644
index da089f8e..00000000
--- a/Common/Production/ProductionUiCordonel/Data/PickingResultData.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Windows.Media;
-using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
-using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Data
-{
- public class PickingItemCheckReturn
- {
- public Boolean? Result;
- public String Msg;
- }
-
-public abstract class PickingResultBaseData : IPickingResultData
- {
- public String Ident { get; set; }
-
- public Int32 Index { get; set; }
-
- public String CheckText { get; set; }
-
- public String CurrentValueText { get; set; }
-
- public Boolean? Result { get; set; }
-
- public Boolean HasError { get; set; }
-
- public Brush ResultColor => getColorFromResult();
- public abstract Func Action { get; }
-
- private Brush getColorFromResult()
- {
- var converter = new BrushConverter();
- var brush = (Brush)converter.ConvertFromString("#000000");
-
- if (Result.HasValue) // && a.Result.Value ))
- {
- if (!Result.Value)
- {
- brush = (Brush)converter.ConvertFromString("#FF8000");
- }
- else
- {
- brush = (Brush)converter.ConvertFromString("#419C14");
- }
-
- }
- return brush;
- }
-
- }
- public interface IPickingResultData
- {
- String Ident { get; set; }
-
- Int32 Index { get; set; }
- String CheckText { get; set; }
-
- String CurrentValueText { get; set; }
-
- Boolean? Result { get; set; }
-
- Boolean HasError { get; set; }
-
- Brush ResultColor { get; }
-
- Func Action { get; }
- }
- public class PickingResultRegisterData : PickingResultBaseData
- {
- public String RegisterIdent { get; set; }
-
- public GenesisMeter ReadMeter { get; set; }
-
- public Object CompareObject { get; set; }
-
- public override Func Action => staticReadAndCompareAction();
-
- public Func staticReadAndCompareAction()
- {
- return delegate
- {
- var retComp = new PickingItemCheckReturn();
- retComp.Result = null;
- retComp.Msg = "-";
- if (ReadMeter != null && ReadMeter.IsLoggedOn)
- {
- var r = ReadMeter.ReadRegister(RegisterIdent);
-
- if (CompareObject is UInt32 intNumber)
- {
- retComp.Result = intNumber.Equals(RegisterConverter.ByteArrayToValue(r));
- retComp.Msg = intNumber.ToString();
- }
- else if (CompareObject is Boolean boolCompare)
- {
- retComp.Result = boolCompare.Equals(RegisterConverter.ByteArrayToValue(r));
- retComp.Msg = boolCompare.ToString();
- }
-
- }
-
- return retComp;
- };
- }
- }
-
- public class PickingResultCustomCheckData : PickingResultBaseData
- {
-
- public PickingResultCustomCheckData(Func action)
- {
- _action = action;
- }
-
- public readonly Func _action;
- public override Func Action => _action;
- }
-
-}
diff --git a/Common/Production/ProductionUiCordonel/Data/PressureResultDataNotifyable.cs b/Common/Production/ProductionUiCordonel/Data/PressureResultDataNotifyable.cs
deleted file mode 100644
index d5468de5..00000000
--- a/Common/Production/ProductionUiCordonel/Data/PressureResultDataNotifyable.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using Xylem.Common.Logic.ProductionOrderCore.TestResults;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Data
-{
- public class PressureResultDataNotifyable : INotifyPropertyChanged
- {
- public event PropertyChangedEventHandler PropertyChanged;
-
-
- protected virtual void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
- public PressureResultDataNotifyable(PressureResultData baseData)
- {
- LeakRate = baseData.LeakRate;
- Passed = baseData.Passed;
- PcbId = baseData.PcbId;
- Remark = baseData.Remark;
- Rev = baseData.Rev;
- TesterName = baseData.TesterName;
- Testpoints = new ObservableCollection();
- baseData.TestPoints.ForEach(o => Testpoints.Add(o));
- TestPressure = baseData.TestPressure;
- }
- public PressureResultDataNotifyable()
- {
-
- }
- public void InternalPropertyChanged(String propertyName = "")
- {
- NotifyPropertyChanged(propertyName);
- }
-
-
- public String PcbId;
-
-
- private Int32 rev;
-
- public Int32 Rev
- {
- get => rev;
- set
- {
- rev = value;
- InternalPropertyChanged(nameof(Rev));
- }
- }
- private Boolean? passed = false;
- public Boolean? Passed
- {
- get => passed;
- set
- {
- passed = value;
- InternalPropertyChanged(nameof(Passed));
- }
- }
-
-
-
- private String testerName = "C. Röhl";
- public String TesterName
- {
- get => testerName;
- set
- {
- testerName = value;
- InternalPropertyChanged(nameof(TesterName));
- }
- }
-
- private String testPressure = "6";
- public String TestPressure
- {
- get => testPressure;
- set
- {
- testPressure = value;
- InternalPropertyChanged(nameof(TestPressure));
- }
- }
-
-
- private String leakRate = " 0,00001";
- public String LeakRate
- {
- get => leakRate;
- set
- {
- leakRate = value;
- InternalPropertyChanged(nameof(LeakRate));
- }
- }
-
- private String remark = "";
- public String Remark
- {
- get => remark;
- set
- {
- remark = value;
- InternalPropertyChanged(nameof(Remark));
- }
- }
-
-
- private ObservableCollection testpoints = new ObservableCollection
- {
- new PressureTestPoints { Ident = 1, Input = "2E-07" },
- new PressureTestPoints { Ident = 2, Input = "2E-07" },
- new PressureTestPoints { Ident = 3, Input = "2E-07" },
- new PressureTestPoints { Ident = 4, Input = "2E-07" },
- new PressureTestPoints { Ident = 5, Input = "2E-07" },
- new PressureTestPoints { Ident = 6, Input = "2E-07" },
- new PressureTestPoints { Ident = 7, Input = "2E-07" },
- new PressureTestPoints { Ident = 8, Input = "2E-07" },
- new PressureTestPoints { Ident = 9, Input = "2E-07" },
- new PressureTestPoints { Ident = 10, Input = "2E-07" }
- };
- public ObservableCollection Testpoints
- {
- get => testpoints;
- set
- {
- testpoints = value;
- InternalPropertyChanged(nameof(Testpoints));
- }
- }
-
- internal void SetAllTestPoints(String input)
- {
- foreach (var item in Testpoints)
- {
- item.Input = input;
- }
- InternalPropertyChanged(nameof(Testpoints));
- }
- public PressureResultData ToBase()
- {
- var baseData = new PressureResultData();
- baseData.LeakRate = LeakRate;
- baseData.Passed = Passed;
- baseData.PcbId = PcbId;
- baseData.Remark = Remark;
- baseData.Rev = Rev;
- baseData.TesterName = TesterName;
- baseData.TestPoints = Testpoints.ToList();
- baseData.TestPressure = TestPressure;
- return baseData;
- }
-
- }
-}
-
diff --git a/Common/Production/ProductionUiCordonel/Docu/ProductionUiCordonel.qea b/Common/Production/ProductionUiCordonel/Docu/ProductionUiCordonel.qea
index 80842e3d..bbb7f9eb 100644
Binary files a/Common/Production/ProductionUiCordonel/Docu/ProductionUiCordonel.qea and b/Common/Production/ProductionUiCordonel/Docu/ProductionUiCordonel.qea differ
diff --git a/Common/Production/ProductionUiCordonel/Model/IMultiModeChildViewModel.cs b/Common/Production/ProductionUiCordonel/Model/IMultiModeChildViewModel.cs
deleted file mode 100644
index dbd07012..00000000
--- a/Common/Production/ProductionUiCordonel/Model/IMultiModeChildViewModel.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.ComponentModel;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- public interface IMultiModeChildViewModel : INotifyPropertyChanged, IDisposable
- {
- String GetChildIdent();
-
- void InputText(String text);
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Model/MarriageMultiModeViewModel.cs b/Common/Production/ProductionUiCordonel/Model/MarriageMultiModeViewModel.cs
deleted file mode 100644
index 2048f0d5..00000000
--- a/Common/Production/ProductionUiCordonel/Model/MarriageMultiModeViewModel.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Net;
-using System.Threading.Tasks;
-using System.Windows;
-using Xylem.Common.CommonCore.Configuration;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
-using Xylem.Common.Logic.SoftwareAccessHelper;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- public class MarriageMultiModeViewModel : BaseMultiModeChildViewModel
- {
- private Boolean canMarry;
- public Boolean CanMarry
- {
- get => canMarry;
- set
- {
- canMarry = value;
- NotifyPropertyChanged();
- }
- }
-
-
- private Int32 serialNr;
- public Int32 SerialNr
- {
- get => serialNr;
- set
- {
- serialNr = value;
- NotifyPropertyChanged();
- }
- }
-
-
- private Boolean locked = false;
- public MarriageMultiModeViewModel(String ctrName, Int32 slotNR, List barcodeTrigger, Int32? stationID = null) :
- base(ctrName, slotNR, barcodeTrigger, stationID)
- {
- VisibilityMarriage = Visibility.Visible;
- MeterDetectedHandler += PickingMultiModeViewModel_MeterDetectedHandler;
- }
-
- internal async Task Store()
- {
- var url = $"{ServiceUrls.MarriageServiceUrl()}SetPcbToSerial?PcbId={CurrentPcbID}&SerialNumber={SerialNr}&returnMetroData=0";
-
- return await Task.Run(() =>
- {
- try
- {
-
- //url = "http://10.49.40.25/MeterProcessState/api/Marriage/SetPcbToSerial?PcbId=201420242&SerialNumber=20728820&returnMetroData=1";
- var resp = LocalWebRequest.GetRequest(url);
-
- if (!string.IsNullOrEmpty(resp))
- {
- if (CurrentMeter != null)
- {
- CurrentMeter.Login();
- //if (resp.Trim() != "store")
- //{
-
-
- // var myJsonResponse = JsonConvert.DeserializeObject>(resp);
- // foreach (var item in myJsonResponse)
- // {
- // CurrentMeter.WriteRegister(item.RegisterName, item.RegisterValue);
- // }
- //}
- CurrentMeter.SetProcessState(DisplayCodes.Mounted);
- CurrentMeter.GetLastProcessState();
- }
-
- return true;
- }
-
- Log($"No result for {url} on Store");
- return false;
-
-
- }
- catch (Exception ex)
- {
- if (ex is WebException)
- {
- Log($"Error on Store {url}: {Environment.NewLine} {((WebException)ex).Message}");
- }
- else
- {
- Log(ex.Message);
- }
-
-
- }
- return false;
-
- });
- }
-
- private void PickingMultiModeViewModel_MeterDetectedHandler(Object sender, EventArgs e)
- {
- CheckBtnEnable();
- }
-
- private void CheckBtnEnable()
- {
- if (SerialNr > 0 && !string.IsNullOrEmpty(CurrentPcbID))
- {
- CanMarry = true;
- }
- else
- {
- CanMarry = false;
- }
-
- }
-
-
-
- public override void InputText(String text)
- {
- try
- {
- SerialNr = 0;
- text = text.Replace(" ", "");
- var preFix = "8SEN20";
- if (text.Contains(preFix) && text.Contains(","))
- {
- var tmpSerialNr = 0;
- var srText = text.Substring(text.IndexOf(preFix) + preFix.Length, text.IndexOf(",") - preFix.Length);
- if (int.TryParse(srText, out tmpSerialNr))
- {
- SerialNr = tmpSerialNr;
- }
- }
- CheckBtnEnable();
- }
- catch (Exception ex)
- {
- Log(ex.Message);
- }
- finally
- {
- CheckBtnEnable();
- }
-
-
- }
-
- public override Boolean SlotIsLocked()
- {
- return locked;
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Model/MultiModeChildViewModel.cs b/Common/Production/ProductionUiCordonel/Model/MultiModeChildViewModel.cs
deleted file mode 100644
index a401b1d7..00000000
--- a/Common/Production/ProductionUiCordonel/Model/MultiModeChildViewModel.cs
+++ /dev/null
@@ -1,332 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Timers;
-using System.Windows;
-using NLog;
-using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
-using Xylem.Common.Utils.Logging;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- public abstract class BaseMultiModeChildViewModel : IMultiModeChildViewModel
- {
-
- private readonly ILogger _logger;
-
- private Timer tmrAutoDetect;
-
- public EventHandler OnPcbIdDetect;
- public List BarcodeTrigger = new List();
-
- private Int32 intervalWithoutDetect = 1000;
- private Int32 intervalWithDetect = 10000;
- private String _currentPcbID;
- private MeterBatch Batch = new MeterBatch();
- private Visibility visibilityMarriage = Visibility.Collapsed;
- public Visibility VisibilityMarriage
- {
- get => visibilityMarriage;
- set
- {
- visibilityMarriage = value;
-
- NotifyPropertyChanged();
- }
- }
-
- private Visibility visibilityPicking = Visibility.Collapsed;
- public Visibility VisibilityPicking
- {
- get => visibilityPicking;
- set
- {
- visibilityPicking = value;
-
- NotifyPropertyChanged();
- }
- }
-
- private Visibility visibilityPressure = Visibility.Collapsed;
- public Visibility VisibilityPressure
- {
- get => visibilityPressure;
- set
- {
- visibilityPressure = value;
-
- NotifyPropertyChanged();
- }
- }
-
-
- public String currentSlotStateText = "none";
- public String CurrentSlotStateText
- {
- get => currentSlotStateText;
- set
- {
- currentSlotStateText = value;
-
- NotifyPropertyChanged();
- }
- }
-
-
-
-
- private SlotState currentSlotState = SlotState.None;
- public SlotState CurrentSlotState
- {
- get => currentSlotState;
- set
- {
- currentSlotState = value;
- switch (currentSlotState)
- {
- case SlotState.None:
- CurrentSlotStateText = "Keiner";
- break;
- case SlotState.IsDetecting:
- CurrentSlotStateText = "Warte auf Zähler Kontakt";
- break;
- case SlotState.Detected:
- CurrentSlotStateText = "Zähler detektiert";
- break;
- case SlotState.InProgress:
- CurrentSlotStateText = "Zähler wird bearbeitet";
- break;
- case SlotState.Done:
- CurrentSlotStateText = "Zähler wurde bearbeitet";
- break;
- case SlotState.ConnectionLost:
- CurrentSlotStateText = "Verbindung getrennt";
- break;
- case SlotState.Error:
- CurrentSlotStateText = "Fehler beim bearbeitet";
- break;
- case SlotState.Fatal:
- CurrentSlotStateText = "Schwerwiegender Fehler";
- break;
- }
- NotifyPropertyChanged();
- }
- }
-
-
- private String slotInfo = "-";
- public String SlotInfo
- {
- get => slotInfo;
- set
- {
- slotInfo = value;
- NotifyPropertyChanged();
- }
- }
-
-
- public enum SlotState
- {
- None,
- IsDetecting,
- Detected,
- InProgress,
- Done,
- ConnectionLost,
- Error,
- Fatal
- }
- private String childName = "asd";
- public String ChildName
- {
- get => childName;
- set
- {
- childName = value;
- NotifyPropertyChanged();
- }
- }
-
- private String order;
- public String Order
- {
- get => order;
- set
- {
- order = value;
- NotifyPropertyChanged();
- }
- }
-
-
- public String CurrentPcbID
- {
- get => _currentPcbID;
- set
- {
- _currentPcbID = value;
-
- NotifyPropertyChanged();
- }
- }
-
-
- public GenesisMeter CurrentMeter { get; private set; }
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
- public String GetChildIdent()
- {
- return ChildName;
- }
-
-
- public Int32 SlotNr;
- public BaseMultiModeChildViewModel(String ctrName, Int32 slotNR,List barcodeTrigger, Int32? StationId = null, Boolean useTimer = true)
- {
- _logger = NLogHelper.CreateOrGetLogger("ProductionUI");
- ChildName = ctrName;
- SlotNr = slotNR;
- SlotInfo = SlotNr.ToString();
- if (useTimer)
- {
- tmrAutoDetect = new Timer(intervalWithoutDetect);
- tmrAutoDetect.Elapsed += TmrAutoDetect_Elapsed;
- tmrAutoDetect.Enabled = true;
- }
-
- BarcodeTrigger = barcodeTrigger;
-
- }
- public void TmrAutoDetect_Elapsed(Object sender, EventArgs e)
- {
- CurrentSlotState = SlotState.IsDetecting;
- tmrAutoDetect.Enabled = false;
- var hasDetect = Detect(SlotNr);
- if (hasDetect)
- {
- CurrentSlotState = SlotState.Detected;
- tmrAutoDetect.Interval = intervalWithDetect;
-
- }
- else
- {
- tmrAutoDetect.Interval = intervalWithoutDetect;
- }
- tmrAutoDetect.Enabled = true;
- }
-
- public void TextForceUpdate()
- {
- var hasDetect = Detect(SlotNr);
- if (hasDetect)
- {
- CurrentSlotState = SlotState.Detected;
-
- }
- }
-
- public virtual void InputText(String text)
- {
- Order = text;
- }
-
- public void Log(String txt)
- {
- _logger?.Info(txt);
- }
- public abstract Boolean SlotIsLocked();
-
- public event EventHandler MeterDetectedHandler;
- private Boolean Detect(Int32 slot)
- {
- if (!SlotIsLocked())
- {
- Log("Start Detect");
- Boolean hasDetect = false;
- if (string.IsNullOrEmpty(CurrentPcbID) || CurrentMeter == null)
- {
- Batch = new MeterBatch();
- var tryMeter = new GenesisMeter();
- try
- {
- tryMeter.SetupFromConfigFile(slot);
- Batch.AddMeter(tryMeter);
- tryMeter.Logout();
- Log("Try to get PcbID");
- CurrentPcbID = tryMeter.GetPcbId();
-
- hasDetect = !string.IsNullOrEmpty(CurrentPcbID);
- CurrentMeter = tryMeter;
- if (hasDetect)
- {
- Log($"New PcbID detected {CurrentPcbID}");
- MeterDetectedHandler?.Invoke(CurrentMeter, EventArgs.Empty);
- }
- else
- {
- Log("No Meter found");
- DisposeAllConnections();
- }
-
- }
- catch (Exception e)
- {
- Log($"Error occur.{ Environment.NewLine} {e.Message}");
- }
-
- }
- else
- {
- Log("Check if Meter is still connected");
- var ret = CurrentMeter.GetPcbId();
- if (string.IsNullOrEmpty(ret) || ret != CurrentPcbID)
- {
- Log("Meter connection lost");
- hasDetect = false;
- DisposeAllConnections();
-
- CurrentPcbID = "";
- }
- else
- {
- Log("Meter is still connected");
- hasDetect = true;
- }
- }
- return hasDetect;
- }
-
- Log("Meter is still connected (locked)");
- return true;
- }
-
- private void DisposeAllConnections()
- {
- MeterDetectedHandler?.Invoke(null, EventArgs.Empty);
- if (Batch != null)
- {
- Batch.RemoveAllMeters();
- if (CurrentMeter != null)
- {
- CurrentMeter.Dispose();
- }
- Batch.Dispose();
- }
-
- }
-
- public void Dispose()
- {
- DisposeAllConnections();
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Model/MultiModeMasterViewModel.cs b/Common/Production/ProductionUiCordonel/Model/MultiModeMasterViewModel.cs
deleted file mode 100644
index 928fa233..00000000
--- a/Common/Production/ProductionUiCordonel/Model/MultiModeMasterViewModel.cs
+++ /dev/null
@@ -1,516 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.IO.Ports;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Media;
-using Logic.ProductionToProductMapper.Cordonel;
-using Newtonsoft.Json;
-using Xylem.Common.CommonCore.Configuration;
-using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
-using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
-using Xylem.Common.Logic.SoftwareAccessHelper;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- internal class MultiModeMasterViewModel : INotifyPropertyChanged
- {
- private String pickingState = "Warte auf Scanner";
- private String pickingScanner = "keine Verbindung";
- private String pickingSlot = "-";
- private String pickingResult = "-";
-
- private Brush pickingResultColor;
- public Brush PickingResultColor
- {
- get => pickingResultColor;
- set
- {
- pickingResultColor = value;
- NotifyPropertyChanged();
- }
- }
- public String PickingState
- {
- get => pickingState;
- set
- {
- pickingState = value;
- NotifyPropertyChanged();
- }
- }
- public String PickingScanner
- {
- get => pickingScanner;
- set
- {
- pickingScanner = value;
- NotifyPropertyChanged();
- }
- }
- public String PickingSlot
- {
- get => pickingSlot;
- set
- {
- pickingSlot = value;
- NotifyPropertyChanged();
- }
- }
- public String PickingResult
- {
- get => pickingResult;
- set
- {
- pickingResult = value;
- NotifyPropertyChanged();
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected virtual void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
- {
-
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
-
-
- public void StartPicking(CancellationTokenSource cancle)
- {
- var s = new Task(() => { PickingLoop(cancle.Token); }, cancle.Token);
- s.Start();
- }
- public enum PickingStateMachine
- {
- Init,
- WaitForScanning,
- ScanningDone,
- WaitForDetect,
- GetOrderDetails,
- Compare,
- MeterDone,
- MeterError,
- StartCom,
- WaitForBuildingMeterReady,
- WaitForBuildingPressureReady,
- }
- private PickingStateMachine sm = PickingStateMachine.Init;
-
- private class BarScanner : IDisposable
- {
- private Boolean isRuning;
- public String Input = "";
- private String Port;
- private CancellationToken Cancellation;
- private Task WaitForScannerTask;
- public BarScanner(String port, CancellationToken cancellation)
- {
- Port = port;
- Cancellation = cancellation;
- }
- public void Start()
- {
- if (!isRuning)
- {
- if (Port == null)
- {
- return;
- }
- WaitForScannerTask = new Task(() =>
- {
- using (var a = new SerialPort(Port))
- {
- a.Open();
- a.NewLine = "\r";
- while (true)
- {
- if (Cancellation.IsCancellationRequested)
- {
- isRuning = false;
- break;
- }
-
- Input = a.ReadLine();
- a.Close();
- isRuning = false;
- break;
- }
- }
-
-
- }, Cancellation);
- WaitForScannerTask.Start();
- }
- }
-
- public void Dispose()
- {
- if (WaitForScannerTask.Status != TaskStatus.Faulted && WaitForScannerTask.Status != TaskStatus.RanToCompletion && WaitForScannerTask.Status != TaskStatus.Canceled)
- {
- WaitForScannerTask.Dispose();
- }
-
- }
- }
-
-
- public Boolean Compare(Dictionary checkAppsIdVersion, UInt32 Frequency, UInt32 MeterSize, Boolean PressurePresent)
- {
- using (var Batch = new MeterBatch())
- {
-
- using (var meter = new GenesisMeter())
- {
-
- meter.SetupFromConfigFile(PickingSlotNr);
- Batch.AddMeter(meter);
- PickingState = "Am Zähler anmelden";
- if (meter.Login())
- {
- meter.SetProcessState(DisplayCodes.PickingStarted);
- var ret = RunCheck(checkAppsIdVersion, Frequency, MeterSize, PressurePresent, meter);
-
- if (ret)
- {
- meter.SetProcessState(DisplayCodes.PickingTested);
- var url = $"{ServiceUrls.MeterProcessStateUrl()}SetPickingState?PcbID={meter.PcbId}&FertigungsauftragsNr={PickingOrder}";
- var RetString = LocalWebRequest.PostRequestAsyncAndGetContent(url);
-
- var result = false;
- if (bool.TryParse(RetString, out result))
- {
- return result;
-
- }
- }
- else
- {
- meter.SetProcessState(DisplayCodes.PickingFailed);
- }
- }
- }
- }
- return false;
- }
-
- private Boolean RunCheck(Dictionary checkAppsIdVersion, UInt32 Frequency, UInt32 MeterSize, Boolean PressurePresent, GenesisMeter meter)
- {
- PickingState = "Üperprüfe Parameter";
- var FrequencyReadOut = RegisterConverter.ByteArrayToValue(meter.ReadRegister("SENSUSRADIO_FrequencyIndicator"));
- if (FrequencyReadOut != Frequency)
- {
- PickingState = $"Falsche Frequenz! soll {Frequency}MHz ist {FrequencyReadOut}MHz";
- return false;
- }
-
- var MeterSizeReadOut = RegisterConverter.ByteArrayToValue(meter.ReadRegister("GENESISFLOW_MeterSize"));
- if (MeterSizeReadOut != MeterSize)
- {
- PickingState = $"Meter Dn falsch! soll {MeterSize}DN ist {MeterSizeReadOut}DN";
- return false;
- }
-
-
- var PressureReadOut = RegisterConverter.ByteArrayToValue(meter.ReadRegister("METROLOGYASST_PressurePresent"));
- if (PressureReadOut != PressurePresent)
- {
- if (PressurePresent)
- {
- PickingState = "Pcb mit Drucksensor. Laut Auftrag keine verbaut";
- }
- else
- {
- PickingState = "Pcb ohne Drucksensor. Laut Auftrag soll eine verbaut werden";
- }
- //todo raus
- return false;
- }
-
- foreach (var item in checkAppsIdVersion)
- {
-
- try
- {
- var MeterFWApp = meter.MeterAppListVersion.First(a => item.Key == a.AppId);
- if (MeterFWApp == null || MeterFWApp.Version != item.Value)
- {
- PickingState = "Falsche FW, bitte Updaten";
- return false;
- }
-
- }
- catch (Exception)
- {
- PickingState = "Fehler beim auslesen der FW";
- return false;
- }
-
-
- }
-
-
- try
- {
- meter.WriteRegister("METROLOGYASST_StoreConfiguration", 1);
- Thread.Sleep(100);
- var storeRet = meter.ReadRegister("METROLOGYASST_StoreConfiguration");
- if (!storeRet.All(a => a.Equals(0)))
- {
- PickingState = "Filesystem corrupt";
- return false;
- }
-
- }
- catch (Exception)
- {
- PickingState = "Fehler beim überprüfen des Filesystems";
- return false;
- }
-
- return true;
- }
-
- private PickingCompareItem PickingOrderDetails;
- private BarScanner PickingBarScanner;
- private String PickingOrder;
- private String PickingPcbId;
-
-
- private String PickingScannerPort = "COM6";
- private Int32 PickingSlotNr = 1;
- //PickingState,PickingScanner,PickingSlot,PickingResult
- private void PickingLoop(CancellationToken token)
- {
- while (!token.IsCancellationRequested)
- {
- switch (sm)
- {
- case PickingStateMachine.Init:
- PickingState = "Initialisierung";
- PickingSlot = $"Inaktiv EP {PickingSlotNr}";
- PickingScanner = $"Geschlossen {PickingScannerPort}";
- //CheckAllPorts?
-
- sm = PickingStateMachine.StartCom;
-
- break;
- case PickingStateMachine.StartCom:
- PickingOrderDetails = null;
- PickingScanner = $"Öfffne {PickingScannerPort}";
- //CheckAllPorts?
- PickingBarScanner = new BarScanner(PickingScannerPort, token);
- PickingBarScanner.Start();
-
- sm = PickingStateMachine.WaitForScanning;
-
- break;
- case PickingStateMachine.WaitForScanning:
- PickingScanner = $"Offen {PickingScannerPort}";
- PickingState = $"Warte auf Scannereingabe({PickingScannerPort})";
- if (PickingBarScanner != null && !string.IsNullOrEmpty(PickingBarScanner.Input))
- {
- PickingOrder = PickingBarScanner.Input;
- PickingScanner = $"Geschlossen {PickingScannerPort}";
- PickingBarScanner = null;
-
-
- sm = PickingStateMachine.WaitForDetect;
-
- }
-
- break;
- case PickingStateMachine.WaitForDetect:
- using (var Batch = new MeterBatch())
- {
-
- using (var tryMeter = new GenesisMeter())
- {
- try
- {
- PickingState = "Warte auf Pcb";
- PickingSlot = $"Öffne EP {PickingSlotNr}";
- tryMeter.SetupFromConfigFile(PickingSlotNr);
- Batch.AddMeter(tryMeter);
- tryMeter.Logout();
- Log("Try to get PcbID");
- PickingPcbId = tryMeter.GetPcbId();
-
- var hasDetect = !string.IsNullOrEmpty(PickingPcbId);
-
- if (hasDetect)
- {
-
- PickingState = $"Pcb gefunden {PickingPcbId}";
- Log($"New PcbID detected {PickingPcbId}");
- sm = PickingStateMachine.GetOrderDetails;
- }
- else
- {
- PickingSlot = $"Keine Konnektivität EP {PickingSlotNr}";
- Log("No Meter found");
-
- }
-
- }
- catch (Exception e)
- {
- Log($"Error occur.{ Environment.NewLine} {e.Message}");
- }
- }
- }
-
- break;
- case PickingStateMachine.GetOrderDetails:
-
- PickingState = $"Lade Auftragsdaten {PickingOrder}";
- var retCode = 0;
- var str = LocalWebRequest.GetRequestWithError($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetOrderOverview?ProductionOrderNumber={PickingOrder}&CheckPcbId={PickingPcbId}", out retCode, 15000);
- if (retCode == 417)
- {
- sm = PickingStateMachine.MeterError;
- PickingResult = "Keine Radio Parameter";
- }
- else
- {
- var retStr = JsonConvert.DeserializeObject(str);
- PickingOrderDetails = retStr.PickingCompareItem;
-
- if (retStr.OrderOverViewCordonel.Count == retStr.OrderOverViewCordonel.AssignedPicking)
- {
- PickingResult = "Auftrag schon komplett";
- sm = PickingStateMachine.MeterError;
- }
- else
- {
- PickingState = $"Auftragsdaten geladen {PickingOrder}";
- sm = PickingStateMachine.Compare;
- }
- }
-
- break;
- case PickingStateMachine.Compare:
- //Compare
- PickingState = $"Vergleiche Auftragsdaten {PickingOrder} mit Pcb Eigenschaften";
-
-
- var converter = new BrushConverter();
- if (Compare(PickingOrderDetails.CheckAppsIdVersion, PickingOrderDetails.FrequencyIndicator, PickingOrderDetails.MeterSize, PickingOrderDetails.PressurePresent))
- {
- //erfolg anzeigen und weiter
- var b = (Brush)converter.ConvertFromString("#419C14");
- b.Freeze();
- PickingResultColor = b;
- sm = PickingStateMachine.MeterDone;
- }
- else
- {
- sm = PickingStateMachine.MeterError;
-
- var b = (Brush)converter.ConvertFromString("#FF8000");
- b.Freeze();
- PickingResultColor = b;
- }
- break;
- case PickingStateMachine.MeterError:
- PickingOrderDetails = null;
- PickingState = "Vergleich abgeschlossen";
- PickingResult = "Vergleich fertig fehlgeschlagen";
- Thread.Sleep(10000);
- sm = PickingStateMachine.StartCom;
-
- break;
- case PickingStateMachine.MeterDone:
-
-
- PickingState = "Vergleich abgeschlossen warten auf Montage Rückmeldung";
- PickingResult = $"Pcb {PickingPcbId} wurde dem Auftrag {PickingOrder} hinzugefügt";
- Thread.Sleep(10000);
- PickingScanner = $"Öfffne {PickingScannerPort}";
- PickingBarScanner = new BarScanner(PickingScannerPort, token);
-
- PickingBarScanner.Start();
- sm = PickingStateMachine.WaitForBuildingMeterReady;
-
- //CheckAllPorts?
-
-
-
- break;
- case PickingStateMachine.WaitForBuildingMeterReady:
-
- if (PickingBarScanner != null && !string.IsNullOrEmpty(PickingBarScanner.Input))
- {
-
- if (PickingBarScanner.Input == "%Cordonel_SAP_100%")
- {
-
- var url = ServiceUrls.MeterProcessStateUrl();
- url = url + $"setSapState?PcbID={PickingPcbId}&code=100&version=1";
- try
- {
- LocalWebRequest.PostRequestAsync(url);
- }
- catch (Exception ex)
- {
- }
-
- if (PickingOrderDetails.PressurePresent)
- {
- PickingBarScanner = new BarScanner(PickingScannerPort, token);
-
- PickingBarScanner.Start();
- PickingState = "Montage Rückmeldung erhalten, Montage des Drucksensors bestätigen";
- sm = PickingStateMachine.WaitForBuildingPressureReady;
- }
- else
- {
- PickingState = "Montage Rückmeldung erhalten, auftrag Scannen";
- sm = PickingStateMachine.StartCom;
- }
- }
- }
- break;
- case PickingStateMachine.WaitForBuildingPressureReady:
-
- if (PickingBarScanner != null && !string.IsNullOrEmpty(PickingBarScanner.Input))
- {
-
- if (PickingBarScanner.Input == "%Cordonel_SAP_101%")
- {
- var url = ServiceUrls.MeterProcessStateUrl();
- url = url + $"setSapState?PcbID={PickingPcbId}&code=101&version=1";
- try
- {
- LocalWebRequest.PostRequestAsync(url);
- }
- catch (Exception ex)
- {
- }
-
- PickingState = "Montage Rückmeldung erhalten, auftrag Scannen";
- sm = PickingStateMachine.StartCom;
- }
- }
- break;
- }
- Thread.Sleep(1000);
-
- }
-
- }
-
- private void Log(String v)
- {
- //throw new NotImplementedException();
- }
- }
-
-
-
-}
-
diff --git a/Common/Production/ProductionUiCordonel/Model/PickingMultiModeViewModel.cs b/Common/Production/ProductionUiCordonel/Model/PickingMultiModeViewModel.cs
deleted file mode 100644
index 6e6a42c4..00000000
--- a/Common/Production/ProductionUiCordonel/Model/PickingMultiModeViewModel.cs
+++ /dev/null
@@ -1,440 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Media;
-using Logic.ProductionToProductMapper.Cordonel;
-using Newtonsoft.Json;
-using Xylem.Common.CommonCore.Configuration;
-using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
-using Xylem.Common.Logic.ProductionOrderCore.OrderData;
-using Xylem.Common.Logic.SoftwareAccessHelper;
-using Xylem.Common.Production.ProductionUiCordonel.Data;
-using MessageBox = System.Windows.Forms.MessageBox;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- public class PickingMultiModeViewModel : BaseMultiModeChildViewModel
- {
-
- private Boolean inputIsEnabled;
- public Boolean InputIsEnabled
- {
- get => inputIsEnabled;
- set
- {
- inputIsEnabled = value;
- NotifyPropertyChanged();
- }
- }
-
-
- private Boolean locked;
- public PickingMultiModeViewModel(String ctrName, Int32 slotNR, List barcodeTrigger, Int32? stationID = null) : base(ctrName, slotNR, barcodeTrigger, stationID, false)
- {
- VisibilityPicking = Visibility.Visible;
- MeterDetectedHandler += PickingMultiModeViewModel_MeterDetectedHandler;
- }
-
- private void PickingMultiModeViewModel_MeterDetectedHandler(Object sender, EventArgs e)
- {
-
- }
-
-
-
- public override Boolean SlotIsLocked()
- {
- return locked;
- }
- public override void InputText(String text)
- {
- Order = text;
- ReloadData();
- TextForceUpdate();
- }
- internal void ReloadData()
- {
-
- Task.Run((Action)(() =>
- {
- try
- {
- if (!locked && !string.IsNullOrEmpty(Order) && Order.Length > 6 && int.TryParse(Order, out var orderNR))
- {
-
- var str = LocalWebRequest.GetRequest($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetOrderOverview?ProductionOrderNumber={orderNR}");
- var OrderOverView = JsonConvert.DeserializeObject(str);
- var doneCount = OrderOverView.AssignedPicking;
- if (OrderOverView.Count == OrderOverView.AssignedPicking)
- {
-
- UpdatePickingUi("Order is already completed", StatusColor, "Input a new order number", 0, 0);
- locked = false;
- return;
- }
-
- str = LocalWebRequest.GetRequestWithError($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetOrderDetails?ProductionOrderNumber={orderNR}&CheckPcbId={CurrentMeter.PcbId}", out var retCode, 15000);
-
- if (retCode == 417)
- {
- MessageBox.Show(@"NO radio parameter found");
- }
-
- if (OrderOverView.Count == OrderOverView.AssignedPicking)
- {
-
- UpdatePickingUi("Order is already completed", StatusColor, "Input a new order number", 0, 0);
- locked = false;
- return;
- }
-
- var OrderDteails = JsonConvert.DeserializeObject(str);
-
-
- if (CurrentMeter != null)
- {
- try
- {
-
-
- locked = true;
- //Init(CurrentMeter, new Dictionary(), OrderDteails.FrequencyIndicator, OrderDteails.MeterSize, OrderDteails.PressurePresent);
-
-
- var a = new Dictionary();
- a.Add(0, 486);
- a.Add(15, 287);
- if (OrderDteails.FrequencyIndicator == 868)
- {
- a.Add(24, 1067);
- }
- else
- {
- a.Add(24, 1066);
- }
-
- Init(CurrentMeter, a, OrderDteails.FrequencyIndicator, OrderDteails.MeterSize, OrderDteails.PressurePresent);
-
-
- var r = Run(CurrentMeter.PcbId, orderNR.ToString());
-
- if (r)
- {
- doneCount = doneCount + 1;
- }
- locked = false;
- UpdatePickingUi("Start checking meter", StatusColor, orderNR.ToString(), OrderOverView.Count, doneCount);
- }
- catch (Exception ex)
- {
- Log(ex.Message);
- }
- finally
- {
- locked = false;
- }
- }
- }
- else
- {
- UpdatePickingUi("Please input a valid order number", StatusColor, "no valid order!", 0, 0);
-
- }
- }
- catch (Exception ex)
- {
- Log(ex.Message);
- }
- }));
- }
-
- private void UpdatePickingUi(String state, Brush StateColor, String order, Int32 toDo, Int32 done)
- {
- Message = state;
- Order = order;
- ToDo = toDo;
- Done = done;
- OnUpdateUi?.Invoke(null, EventArgs.Empty);
- //if (true)
- //{
-
- //}
- // lblStatus.Content = state;
- // lblStatus.Background = StateColor;
- // lblPickingOrder.Content = $"{Order}({Done}/{toDo}";
- // txtHiddenInput.Focus();
- // if (Done > 0 && Done >= toDo)
- // {
- // MessageBox.Show("Order is Finish");
- // txtOrderNr.Text = "";
- // lblStatus.Content = "Please input a new order number";
- // }
-
- //}));
-
- }
- //private void RefreshPicking()
- //{
-
- // tbarOrder.Visibility = Visibility.Visible;
- // if (!string.IsNullOrEmpty(txtOrderNr.Text))
- // {
- // lblPickingOrder.Content = orderString;
-
-
- // }
- // else
- // {
- // UpdatePickingUi("Please input a valid order number", PickingData.StatusColor, "no valid order!", 0, 0);
- // }
- //}
-
- public event EventHandler OnDataChanged;
- public event EventHandler OnUpdateUi;
- public new event PropertyChangedEventHandler PropertyChanged;
-
- private GenesisMeter currentMeter;
-
- public ObservableCollection Data
- {
- get; set;
- }
-
- private OverallStatus status = OverallStatus.NoDetect;
- private OverallStatus Status
- {
- get => status;
- set
- {
- status = value;
- OnDataChanged?.Invoke(value.GetHashCode(), EventArgs.Empty);
-
- }
- }
- public String Message
- {
- get; set;
- }
- private enum OverallStatus
- {
- NoDetect,
- CheckingIsRunning,
- CheckingIsDone,
- CheckingIsNoMatch,
- CheckingIsHasError,
- }
- public String StatusText
- {
- get
- {
- switch (Status)
- {
- case OverallStatus.NoDetect:
- return "Wait for meter";
- case OverallStatus.CheckingIsRunning:
- return "Is checking, please wait";
- case OverallStatus.CheckingIsDone:
- return "Succsesfull check next Pcb";
- case OverallStatus.CheckingIsNoMatch:
- return "Check has mismatch, this PCB cannot be used!";
- default:
- return "Check has errors, this PCB cannot be used!";
- }
-
- }
- }
-
- public Brush StatusColor
- {
- get
- {
- switch (Status)
- {
- case OverallStatus.NoDetect:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("White");
- case OverallStatus.CheckingIsRunning:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("Yellow");
- case OverallStatus.CheckingIsDone:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("Green");
- case OverallStatus.CheckingIsNoMatch:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("Red");
- default:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("DarkRed");
- }
- }
- }
-
- public Int32 ToDo
- {
- get; private set;
- }
- public Int32 Done
- {
- get; private set;
- }
-
- public void Init(GenesisMeter meter, Dictionary checkAppsIdVersion, UInt32 Frequency, UInt32 MeterSize, Boolean PressurePresent)
- {
-
-
- currentMeter = meter;
- var data = new List();
-
- data.Add(new PickingResultCustomCheckData(delegate
- {
-
- meter.Login();
- meter.SetProcessState(DisplayCodes.PickingStarted);
- return new PickingItemCheckReturn { Result = true, Msg = "done" };
-
- })
- {
- Index = data.Count, Ident = "Login", CheckText = "Try to access Meter", HasError = false, Result = null,
- CurrentValueText = "-"
- });
-
- data.Add(new PickingResultRegisterData
- {
- ReadMeter = meter, Index = data.Count, Ident = "Check Radio", CheckText = $"{Frequency}MHz",
- CompareObject = Frequency, CurrentValueText = "none", HasError = false, Result = null,
- RegisterIdent = "SENSUSRADIO_FrequencyIndicator"
- });
-
-
- data.Add(new PickingResultRegisterData
- {
- ReadMeter = meter, Index = data.Count, Ident = "MeterSize",
- CheckText = "DN40-50", CompareObject = MeterSize, CurrentValueText = "none", HasError = false,
- Result = null, RegisterIdent = "GENESISFLOW_MeterSize"
- });
-
- data.Add(new PickingResultRegisterData
- {
- ReadMeter = meter, Index = data.Count, Ident = "Pressure",
- CheckText = "Pressure Sensor", CompareObject = PressurePresent, CurrentValueText = "-", HasError = false,
- Result = null, RegisterIdent = "METROLOGYASST_PressurePresent"
- });
-
-
- foreach (var item in checkAppsIdVersion)
- {
- data.Add(new PickingResultCustomCheckData(delegate
- {
- try
- {
- var MeterFWApp = meter.MeterAppListVersion.First(a => item.Key == a.AppId);
- if (MeterFWApp.Version != item.Value)
- {
- return new PickingItemCheckReturn { Result = false, Msg = MeterFWApp.StrVersion };
- }
- return new PickingItemCheckReturn { Result = true, Msg = MeterFWApp.StrVersion };
- }
- catch (Exception)
- {
- return new PickingItemCheckReturn { Result = false, Msg = "error" };
- }
-
- })
- {
- Index = data.Count, Ident = $"Check AppId {item.Key}", CheckText = $"Version {item.Value}",
- HasError = false, Result = null, CurrentValueText = "-"
- });
-
- }
-
- data.Add(new PickingResultCustomCheckData(delegate
- {
- try
- {
- meter.WriteRegister("METROLOGYASST_StoreConfiguration", 1);
- Thread.Sleep(100);
- var storeRet = meter.ReadRegister("METROLOGYASST_StoreConfiguration");
- if (storeRet.All(a => a.Equals(0)))
- {
- return new PickingItemCheckReturn { Result = true, Msg = "Filesystem OK" };
- }
-
- return new PickingItemCheckReturn { Result = false, Msg = "Filesystem corrupt" };
-
- }
- catch (Exception)
- {
- return new PickingItemCheckReturn { Result = false, Msg = "error" };
- }
-
- })
- {
- Index = data.Count, Ident = "Check Filesystem", CheckText = "Check Filesystem", HasError = false,
- Result = null, CurrentValueText = "checking"
- });
-
- Status = OverallStatus.CheckingIsRunning;
- ChangeDataData(data);
- }
- private void ChangeDataData(List data)
- {
- Data = new ObservableCollection(data);
- OnDataChanged?.Invoke(Data, EventArgs.Empty);
- }
-
- public Boolean Run(String pcbID, String OrderNr)
- {
- var tmpData = Data.ToList();
- foreach (var item in tmpData.Where(a => !a.Result.HasValue).OrderBy(a => a.Index))
- {
- var result = item.Action.Invoke();
- item.Result = result.Result;
- item.CurrentValueText = result.Msg;
- ChangeDataData(tmpData);
- }
-
- if (tmpData.All(a => !a.HasError && a.Result.HasValue && a.Result.Value))
- {
- currentMeter.SetProcessState(DisplayCodes.PickingTested);
- var url = $"{ServiceUrls.MeterProcessStateUrl()}SetPickingState?PcbID={pcbID}&FertigungsauftragsNr={OrderNr}";
- var RetString = LocalWebRequest.PostRequestAsyncAndGetContent(url);
-
- if (bool.TryParse(RetString, out var result))
- {
- Status = OverallStatus.CheckingIsDone;
- return result;
-
- }
-
- Status = OverallStatus.CheckingIsHasError;
-
- return false;
-
- }
-
- currentMeter.SetProcessState(DisplayCodes.PickingFailed);
- if (tmpData.All(a => a.HasError))
- {
- Status = OverallStatus.CheckingIsHasError;
- }
- else
- {
- Status = OverallStatus.CheckingIsNoMatch;
- }
-
- return false;
- }
-
- internal void Empty()
- {
- Status = OverallStatus.NoDetect;
- ChangeDataData(new List());
- }
-
- protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
- {
- PropertyChanged?.Invoke(this, e);
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Model/PickingViewModel.cs b/Common/Production/ProductionUiCordonel/Model/PickingViewModel.cs
deleted file mode 100644
index 66eb4822..00000000
--- a/Common/Production/ProductionUiCordonel/Model/PickingViewModel.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Linq;
-using System.Threading;
-using System.Windows.Media;
-using Logic.ProductionToProductMapper.Cordonel;
-using Xylem.Common.CommonCore.Configuration;
-using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
-using Xylem.Common.Logic.SoftwareAccessHelper;
-using Xylem.Common.Production.ProductionUiCordonel.Data;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- public class PickingViewModel : INotifyPropertyChanged
- {
- public event EventHandler OnDataChanged;
- public event PropertyChangedEventHandler PropertyChanged;
-
- private GenesisMeter currentMeter;
- private PickingCompareItem baseFile;
-
- public ObservableCollection Data { get; set; }
-
- private OverallStatus status = OverallStatus.NoDetect;
- private OverallStatus Status
- {
- get => status;
- set
- {
- status = value;
- OnDataChanged?.Invoke(value.GetHashCode(), EventArgs.Empty);
-
- }
- }
-
- private enum OverallStatus
- {
- NoDetect,
- CheckingIsRunning,
- CheckingIsDone,
- CheckingIsNoMatch,
- CheckingIsHasError,
- }
- public String StatusText
- {
- get
- {
- switch (Status)
- {
- case OverallStatus.NoDetect:
- return "Wait for meter";
- case OverallStatus.CheckingIsRunning:
- return "Is checking, please wait";
- case OverallStatus.CheckingIsDone:
- return "Succsesfull check next Pcb";
- case OverallStatus.CheckingIsNoMatch:
- return "Check has mismatch, this PCB cannot be used!";
- default:
- return "Check has errors, this PCB cannot be used!";
- }
-
- }
- }
-
- public Brush StatusColor
- {
- get
- {
- switch (Status)
- {
- case OverallStatus.NoDetect:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("White");
- case OverallStatus.CheckingIsRunning:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("Yellow");
- case OverallStatus.CheckingIsDone:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("Green");
- case OverallStatus.CheckingIsNoMatch:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("Red");
- default:
- return (SolidColorBrush)new BrushConverter().ConvertFromString("DarkRed");
- }
- }
- }
-
-
- public void Init(GenesisMeter meter, Dictionary checkAppsIdVersion, UInt32 Frequency, UInt32 MeterSize, Boolean PressurePresent)
- {
-
-
- currentMeter = meter;
- var data = new List();
-
- data.Add(new PickingResultCustomCheckData(delegate
- {
-
- var r = meter.Login();
- meter.SetProcessState(DisplayCodes.PickingStarted);
- return new PickingItemCheckReturn { Result = true, Msg = "done" };
-
- })
- { Index = data.Count, Ident = "Login", CheckText = "Try to access Meter", HasError = false, Result = null, CurrentValueText = "-" });
- if (Frequency != 0)
- {
- data.Add(new PickingResultRegisterData { ReadMeter = meter, Index = data.Count, Ident = "Check Radio", CheckText = "433", CompareObject = Frequency, CurrentValueText = "none", HasError = false, Result = null, RegisterIdent = "SENSUSRADIO_FrequencyIndicator" }); ;
-
-
- data.Add(new PickingResultRegisterData { ReadMeter = meter, Index = data.Count, Ident = "MeterSize", CheckText = "DN40-50", CompareObject = MeterSize, CurrentValueText = "none", HasError = false, Result = null, RegisterIdent = "GENESISFLOW_MeterSize" });
- }
-
- foreach (var item in checkAppsIdVersion)
- {
- data.Add(new PickingResultCustomCheckData(delegate
- {
- try
- {
- var MeterFWApp = meter.MeterAppListVersion.First(a => item.Key == a.AppId);
- if (MeterFWApp == null || MeterFWApp.Version != item.Value)
- {
- return new PickingItemCheckReturn { Result = false, Msg = MeterFWApp.StrVersion };
- }
- return new PickingItemCheckReturn { Result = true, Msg = MeterFWApp.StrVersion };
- }
- catch (Exception)
- {
- return new PickingItemCheckReturn { Result = false, Msg = "error" };
- }
-
- })
- { Index = data.Count, Ident = $"Check AppId {item.Key}", CheckText = $"Version {item.Value}", HasError = false, Result = null, CurrentValueText = "-" }); ;
-
- }
-
- data.Add(new PickingResultCustomCheckData(delegate
- {
- try
- {
- meter.WriteRegister("METROLOGYASST_StoreConfiguration", 1);
- Thread.Sleep(100);
- var storeRet = meter.ReadRegister("METROLOGYASST_StoreConfiguration");
- if (storeRet.All(a => a.Equals(0)))
- {
- return new PickingItemCheckReturn { Result = true, Msg = "Filesystem OK" };
- }
-
- return new PickingItemCheckReturn { Result = false, Msg = "Filesystem corrupt" };
-
- }
- catch (Exception)
- {
- return new PickingItemCheckReturn { Result = false, Msg = "error" };
- }
-
- })
- { Index = data.Count, Ident = "Check Filesystem", CheckText = "Check Filesystem", HasError = false, Result = null, CurrentValueText = "checking" }); ;
-
- Status = OverallStatus.CheckingIsRunning;
- ChangeDataData(data);
- }
- private void ChangeDataData(List data)
- {
- Data = new ObservableCollection(data);
- OnDataChanged?.Invoke(Data, EventArgs.Empty);
- }
-
- public Boolean Run(String pcbID, String OrderNr)
- {
- var tmpData = Data.ToList();
- foreach (var item in tmpData.Where(a => !a.Result.HasValue).OrderBy(a => a.Index))
- {
- var result = item.Action.Invoke();
- item.Result = result.Result;
- item.CurrentValueText = result.Msg;
- ChangeDataData(tmpData);
- }
-
- if (tmpData.All(a => !a.HasError && a.Result.HasValue && a.Result.Value))
- {
- currentMeter.SetProcessState(DisplayCodes.PickingTested);
- var url = $"{ServiceUrls.MeterProcessStateUrl()}SetPickingState?PcbID={pcbID}&FertigungsauftragsNr={OrderNr}";
- var RetString = LocalWebRequest.PostRequestAsyncAndGetContent(url);
-
- var result = false;
- if (bool.TryParse(RetString, out result))
- {
- Status = OverallStatus.CheckingIsDone;
- return result;
-
- }
-
- Status = OverallStatus.CheckingIsHasError;
-
- return false;
-
- }
-
- currentMeter.SetProcessState(DisplayCodes.PickingFailed);
- if (tmpData.All(a => a.HasError))
- {
- Status = OverallStatus.CheckingIsHasError;
- }
- else
- {
- Status = OverallStatus.CheckingIsNoMatch;
- }
-
- return false;
-
-
-
- }
-
- internal void Empty()
- {
- Status = OverallStatus.NoDetect;
- ChangeDataData(new List());
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/Model/PressureMultiModeViewModel.cs b/Common/Production/ProductionUiCordonel/Model/PressureMultiModeViewModel.cs
deleted file mode 100644
index 6fdd352b..00000000
--- a/Common/Production/ProductionUiCordonel/Model/PressureMultiModeViewModel.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-using Newtonsoft.Json;
-using Xylem.Common.CommonCore.Configuration;
-using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
-using Xylem.Common.Logic.ProductionOrderCore.ProcessState;
-using Xylem.Common.Logic.ProductionOrderCore.TestResults;
-using Xylem.Common.Logic.SoftwareAccessHelper;
-using Xylem.Common.Production.ProductionUiCordonel.Data;
-using Xylem.Common.Production.ProductionUiCordonel.Event;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Model
-{
- public class PressureMultiModeViewModel : BaseMultiModeChildViewModel
- {
-
-
- public event EventHandler OnStoreDone;
- private PressureResultDataNotifyable result = new PressureResultDataNotifyable();
- public PressureResultDataNotifyable Result
- {
- get => result;
- set
- {
- result = value;
- NotifyPropertyChanged();
- }
- }
-
-
- private Boolean inputIsEnabled;
- public Boolean InputIsEnabled
- {
- get => inputIsEnabled;
- set
- {
- inputIsEnabled = value;
- NotifyPropertyChanged();
- }
- }
-
-
- public Boolean Locked { get; set; } = false;
- public Int32? StationID { get; set; }
-
- public PressureMultiModeViewModel(String ctrName, Int32 slotNR, List barcodeTrigger, Int32? stationID = null) : base(ctrName, slotNR, barcodeTrigger, stationID)
- {
- VisibilityPressure = Visibility.Visible;
- StationID = stationID;
- }
-
- public Boolean isHydraulicStaion()
- {
-
- if (!StationID.HasValue || StationID.Value == 1)
- {
- return false;
- }
- return true;
- }
- public override Boolean SlotIsLocked()
- {
- return false;
- }
-
- internal void ReloadData(Boolean reset)
- {
-
- if (Result != null && Result.PcbId != CurrentPcbID)
- {
- InputIsEnabled = false;
- if (true)
- {
-
- }
- Result = new PressureResultDataNotifyable { Remark = "loading", Testpoints = new ObservableCollection(), PcbId = "" };
- Task.Run((Func)(() =>
- {
- try
- {
- var url = ServiceUrls.MeterProcessStateUrl();
- url = url + $"GetPressureStateDetailed?PcbId={CurrentPcbID}&TopCount=1";
-
- var retStr = LocalWebRequest.GetRequest(url);
-
- var pressureResultData = JsonConvert.DeserializeObject>(retStr);
- if (!pressureResultData.Any())
- {
- return new PressureResultDataNotifyable();
- }
- return new PressureResultDataNotifyable(pressureResultData.First());
- }
- catch (Exception ex)
- {
- Log(ex.Message);
- return new PressureResultDataNotifyable();
- }
-
- })).ContinueWith(a =>
- {
- var res = a.Result;
- res.PcbId = CurrentPcbID;
-
- Result = res;
- InputIsEnabled = true;
- }
-
- );
-
- }
- }
-
- internal void StoreData(Boolean successfull)
- {
-
- if (Result != null && Result.PcbId == CurrentPcbID)
- {
- InputIsEnabled = false;
- var isStored = false;
- var status = DisplayCodes.PressureTestedFailed;
-
- Task.Run((Action)(() =>
- {
- var url = ServiceUrls.MeterProcessStateUrl();
-
- if (successfull)
- {
- status = DisplayCodes.PressureTested;
- }
- try
- {
- if (StationID == 1)
- {
- var addResult = new PressureTestResult
- {
- FreeText = Result.Remark,
- Passed = successfull,
- StationId = StationID
- };
-
- url = url + $"SetPressureState?PcbId={CurrentPcbID}&FertigungsauftragsNr=0";
-
-
- if (!LocalWebRequest.PostRequestAsync(url, json: addResult))
- {
- throw new ApplicationException("PressureState: NOT successful");
- }
-
- }
- else
- {
- url = url + "SetPressureStateDetailed";
- var mutedResult = Result.ToBase();
- isStored = LocalWebRequest.PostRequestAsync(url, json: mutedResult);
- if (!isStored)
- {
- OnStoreDone?.Invoke(null, new StringArgs("Can not store Result"));
- status = DisplayCodes.PressureTestedFailed;
- }
- }
-
-
- CurrentMeter.Login();
- CurrentMeter.SetProcessState(status);
- }
- catch (Exception ex)
- {
- Log(ex.Message);
- status = DisplayCodes.PressureTestedFailed;
- OnStoreDone?.Invoke(null, new StringArgs("Can not store Result"));
- }
-
-
- if (status == DisplayCodes.PressureTested)
- {
- OnStoreDone?.Invoke(null, new StringArgs("Pressure test stored successfully. Meter can passed"));
- return;
- }
- OnStoreDone?.Invoke(null, new StringArgs("Pressure test stored successfully. But Meter is marked with a leakage. Please inform QS"));
-
- }));
-
- }
- }
-
- }
-
-}
diff --git a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
index bcb12697..3ad7c80c 100644
--- a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
+++ b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
@@ -140,17 +140,6 @@
Properties\SharedAssemblyInfo.cs
-
-
-
- ctlMultiModeMarriage.xaml
-
-
- ctlMultiModePicking.xaml
-
-
- ctlMultiModePressure.xaml
-
@@ -173,16 +162,7 @@
-
-
-
-
-
-
-
-
-
@@ -242,18 +222,6 @@
UcPasswordFile.xaml
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
Designer
MSBuild:Compile
diff --git a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModeMarriage.xaml b/Common/Production/ProductionUiCordonel/ctls/ctlMultiModeMarriage.xaml
deleted file mode 100644
index 4edc8917..00000000
--- a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModeMarriage.xaml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModeMarriage.xaml.cs b/Common/Production/ProductionUiCordonel/ctls/ctlMultiModeMarriage.xaml.cs
deleted file mode 100644
index 6f10e4e9..00000000
--- a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModeMarriage.xaml.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using Xylem.Common.Production.ProductionUiCordonel.Model;
-using MessageBox = System.Windows.Forms.MessageBox;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.ctls
-{
- ///
- /// Interaction logic for ctlMultiModeMarriage.xaml
- ///
- public partial class ctlMultiModeMarriage : UserControl
- {
- private MarriageMultiModeViewModel ViewModel;
- public ctlMultiModeMarriage()
- {
- InitializeComponent();
- }
-
- public void setViewModel(MarriageMultiModeViewModel viewModel)
- {
- ViewModel = viewModel;
- //ViewModel.Store();
- }
-
- private void btnMarry_Click(Object sender, RoutedEventArgs e)
- {
- Task.Run(() =>
- {
- return ViewModel.Store();
- }).ContinueWith(a =>
- {
- if (a.Result)
- {
- MessageBox.Show("Meter has passed");
- }
- else
- {
- MessageBox.Show("Meter not has passed");
- }
-
- });
-
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePicking.xaml b/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePicking.xaml
deleted file mode 100644
index 6300a770..00000000
--- a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePicking.xaml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePicking.xaml.cs b/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePicking.xaml.cs
deleted file mode 100644
index 81f332c3..00000000
--- a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePicking.xaml.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using System;
-using System.Collections.ObjectModel;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Threading;
-using Xylem.Common.Production.ProductionUiCordonel.Data;
-using Xylem.Common.Production.ProductionUiCordonel.Model;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.ctls
-{
- ///
- /// Interaction logic for ctlMultiModePicking.xaml
- ///
- public partial class ctlMultiModePicking : UserControl
- {
- private PickingMultiModeViewModel ViewModel;
- public ctlMultiModePicking()
- {
- InitializeComponent();
- }
-
-
- public void setViewModel(PickingMultiModeViewModel viewModel)
- {
- ViewModel = viewModel;
- ViewModel.MeterDetectedHandler += ViewModel_MeterDetectedHandler;
- viewModel.OnDataChanged += PickingData_OnDataChanged;
- ViewModel.OnUpdateUi += UpdatePickingUi;
- }
-
- private void ViewModel_MeterDetectedHandler(Object sender, EventArgs e)
- {
- Dispatcher.Invoke(DispatcherPriority.Normal,
- new Action(() =>
- {
- Boolean update = false;
- if (sender is null)
- {
- ViewModel.InputIsEnabled = false;
- }
- else
- {
-
-
- var ts = DateTimeOffset.UtcNow - new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(0));
- ViewModel.CurrentMeter.Login();
- ViewModel.CurrentMeter.WriteRegister("GENESISFLOW_SealDisplay", 0);
- ViewModel.CurrentMeter.WriteRegister("POWERMON_WarnFromClamp", (UInt32)473040000);
- ViewModel.CurrentMeter.WriteRegister("SYSTEM_CalendarSeconds", Convert.ToInt32(ts.TotalSeconds));
- ViewModel.CurrentMeter.SetLcdText(false, new Byte[] { 0x12, 0x34 });
-
-
- //ViewModel.ReloadData(false);
- }
- }
- ));
- }
-
- private void UpdatePickingUi(Object sender, EventArgs e)
- {
- icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
- {
- lblStatus.Content = ViewModel.StatusText;
- lblStatus.Background = ViewModel.StatusColor;
- lblPickingOrder.Content = $"{ViewModel.Order}({ViewModel.Done}/{ViewModel.ToDo}";
- if (ViewModel.Done > 0 && ViewModel.Done >= ViewModel.ToDo)
- {
- MessageBox.Show("Order is Finish");
- lblStatus.Content = "Please input a new order number";
- }
-
- }));
-
- }
-
- private void PickingData_OnDataChanged(Object sender, EventArgs e)
- {
- if (sender is ObservableCollection newData)
- {
- icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { icPicking.ItemsSource = newData; }));
- }
-
- icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { lblStatus.Content = ViewModel.StatusText; lblStatus.Background = ViewModel.StatusColor; }));
-
-
-
-
- }
-
-
- //private void UpdatePickingUi(string state, System.Windows.Media.Brush StateColor, string Order, int toDo, int Done)
- //{
- // icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
- // {
- // lblStatus.Content = state;
- // lblStatus.Background = StateColor;
- // lblPickingOrder.Content = $"{Order}({Done}/{toDo}";
- // txtHiddenInput.Focus();
- // if (Done > 0 && Done >= toDo)
- // {
- // MessageBox.Show("Order is Finish");
- // txtOrderNr.Text = "";
- // lblStatus.Content = "Please input a new order number";
- // }
-
- // }));
-
- //}
-
- //private void PickingData_OnDataChanged(object sender, EventArgs e)
- //{
- // if (sender is ObservableCollection newData)
- // {
- // icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { icPicking.ItemsSource = newData; }));
- // }
-
- // icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { lblStatus.Content = PickingData.StatusText; lblStatus.Background = PickingData.StatusColor; }));
-
-
-
-
- //}
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePressure.xaml b/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePressure.xaml
deleted file mode 100644
index be1f6b21..00000000
--- a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePressure.xaml
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePressure.xaml.cs b/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePressure.xaml.cs
deleted file mode 100644
index 62b2842c..00000000
--- a/Common/Production/ProductionUiCordonel/ctls/ctlMultiModePressure.xaml.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-using System;
-using System.Linq;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Threading;
-using Xylem.Common.Logic.ProductionOrderCore.TestResults;
-using Xylem.Common.Production.ProductionUiCordonel.Event;
-using Xylem.Common.Production.ProductionUiCordonel.Model;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.ctls
-{
- ///
- /// Interaction logic for ctlMultiModePressure.xaml
- ///
- public partial class ctlMultiModePressure : UserControl
- {
- public event EventHandler OnBarcodeInput;
-
- private PressureMultiModeViewModel ViewModel;
- public ctlMultiModePressure()
- {
- InitializeComponent();
- }
-
- public void setViewModel(PressureMultiModeViewModel viewModel)
- {
- ViewModel = viewModel;
- viewModel.MeterDetectedHandler += ViewModel_MeterDetectedHandler;
- ViewModel.OnStoreDone += ViewModel_OnStoreDone;
- //OnBarcodeInput = "PressureControl_OnBarcodeInput"
- //
- if (viewModel.ChildName == "PressureHY")
- {
- ViewModel.StationID = 1;
- lblHeadline.Content = "hydraulisch Dichtheitsprüfung";
- txtLeakrate.Visibility = Visibility.Hidden;
- lblLeakrate.Visibility = Visibility.Hidden;
- listViewTestPotins.Visibility = Visibility.Hidden;
- }
- else
- {
- ViewModel.StationID = 2;
- lblHeadline.Content = "Helium Dichtheitsprüfung";
- }
-
- }
-
-
-
- private void ViewModel_MeterDetectedHandler(Object sender, EventArgs e)
- {
- Dispatcher.Invoke(DispatcherPriority.Normal,
- new Action(() =>
- {
- Boolean update = false;
- if (sender is null)
- {
- ViewModel.InputIsEnabled = false;
- }
- else
- {
- ViewModel.ReloadData(false);
- }
- }
- ));
- }
-
- private void BtnPresueOk_Click(Object sender, RoutedEventArgs e)
- {
- ViewModel.StoreData(true);
- }
-
- private void BtnPresueFailed_Click(Object sender, RoutedEventArgs e)
- {
- ViewModel.StoreData(false);
- }
- private void ViewModel_OnStoreDone(Object sender, StringArgs e)
- {
- MessageBox.Show(e.Content);
- }
- private Int32? BarcodeInputActiveOffset;
- private String BarcodeInput = "";
-
- private void TextBox_TextChanged(Object sender, TextChangedEventArgs e)
- {
- if (sender is TextBox txtSender)
- {
- var c = e.Changes.First();
- if (c.RemovedLength == 0)
- {
- var input = txtSender.Text.Substring(c.Offset, c.AddedLength);
- if (BarcodeInputActiveOffset.HasValue)
- {
- BarcodeInput = $"{BarcodeInput}{input}";
-
- if (input == Environment.NewLine)
- {
- var tmpOffset = BarcodeInputActiveOffset.Value;
- BarcodeInputActiveOffset = null;
- //OnBarcodeInput?.Invoke(null, new StringArgs(BarcodeInput));
- txtSender.Text = txtSender.Text.Replace(BarcodeInput, "");
- BarcodeInput = "";
- txtSender.Focus();
- txtSender.CaretIndex = tmpOffset;
- }
- }
- else
- {
- if (ViewModel != null && ViewModel.BarcodeTrigger.Any(t => t == input))
- {
-
- BarcodeInput = txtSender.Text.Substring(c.Offset, c.AddedLength);
- BarcodeInputActiveOffset = c.Offset;
- }
- }
- }
-
- }
-
- }
-
- private void Button_Click(Object sender, RoutedEventArgs e)
- {
- String input = "";
- var obj = ((FrameworkElement)sender).DataContext;
- if (obj is PressureTestPoints ptp)
- {
- ViewModel.Result.SetAllTestPoints(ptp.Input);
-
-
- }
- var d = listViewTestPotins.DataContext;
- listViewTestPotins.DataContext = null;
- listViewTestPotins.DataContext = d;
- // var c = e.Changes.First();
- // if (c.RemovedLength == 0)
- // {
- // var input = txtSender.Text.Substring(c.Offset, c.AddedLength);
- // if (BarcodeInputActiveOffset.HasValue)
- // {
- // BarcodeInput = $"{BarcodeInput}{input}";
-
- // if (input == System.Environment.NewLine)
- // {
- // var tmpOffset = BarcodeInputActiveOffset.Value;
- // BarcodeInputActiveOffset = null;
- // OnBarcodeInput?.Invoke(null, new StringArgs(BarcodeInput));
- // txtSender.Text = txtSender.Text.Replace(BarcodeInput, "");
- // BarcodeInput = "";
- // txtSender.Focus();
- // txtSender.CaretIndex = tmpOffset;
- // }
- // }
- // else
- // {
- // if (ViewModel != null && ViewModel.BarcodeTrigger.Any(t => t == input))
- // {
-
- // BarcodeInput = txtSender.Text.Substring(c.Offset, c.AddedLength);
- // BarcodeInputActiveOffset = c.Offset;
- // }
- // }
- // }
-
- //}
- }
- }
-}
diff --git a/Common/Service/MeterProcessState/Controllers/FinalCheckController.cs b/Common/Service/MeterProcessState/Controllers/FinalCheckController.cs
index 79c4791a..b3529bc3 100644
--- a/Common/Service/MeterProcessState/Controllers/FinalCheckController.cs
+++ b/Common/Service/MeterProcessState/Controllers/FinalCheckController.cs
@@ -833,7 +833,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
var startInex = St.IndexOf("\"StartDT\":\"") + "\"StartDT\":\"".Length;
var datestring = St.Substring(startInex, "29.07.2022 06:47:27".Length);
- lastProdDate = DateTime.ParseExact(datestring, "dd.MM.yyyy hh:mm:ss", CultureInfo.CreateSpecificCulture("de-DE"));
+ lastProdDate = DateTime.ParseExact(datestring, "dd.MM.yyyy HH:mm:ss", CultureInfo.CreateSpecificCulture("de-DE"));
}
diff --git a/Common/Service/MeterProcessState/Controllers/LUControler.cs b/Common/Service/MeterProcessState/Controllers/LUControler.cs
index da05d3af..5baaa6b9 100644
--- a/Common/Service/MeterProcessState/Controllers/LUControler.cs
+++ b/Common/Service/MeterProcessState/Controllers/LUControler.cs
@@ -1,12 +1,20 @@
-using Oracle.ManagedDataAccess.Client;
+using LaaPackages.Features.Cordonel.Models;
+using Newtonsoft.Json.Linq;
+using Oracle.ManagedDataAccess.Client;
+using Service.MeterProcessState;
+using Service.MeterProcessState.Data;
using System;
using System.Collections.Generic;
+using System.Data;
+using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
using System.Globalization;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
+using System.Web.Helpers;
using System.Web.Http;
+using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.Json;
using Xylem.Common.Logic.ServiceCore;
@@ -121,7 +129,105 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.ToString() + "
" + ex.InnerException.ToString());
}
}
+ [Route("SyncKitronData")]
+ public async Task SyncKitronData()
+ {
+ StringBuilder query = new StringBuilder();
+ query.AppendLine("SELECT TOP (1) ID, Jobname, ActionDate, DoneDate, LastID, DataCount FROM KitronSync where DoneDate is null order by ID ");
+ using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
+ {
+ var dt = dataAccess.ExecuteQuery(query.ToString());
+ foreach (DataRow item in dt.Rows)
+ {
+ var LastID = (int)item["LastID"];
+
+ var DataCount = (int)item["DataCount"];
+ var UpdateTillLasID = LastID + DataCount;
+ var kitronFinals = dataAccess.ExecuteQuery($" sELECT * FROM OPENQUERY (MyOraDB, ' SELECT DS_ID,ID_PCB,ID_TEST,JSON FROM DELTACHEF.GENESIS_PCBFUNCTIONALTEST_PD WHERE DS_ID >= {LastID + 1} and DS_ID <= {LastID+ 1 + DataCount} order by DS_ID asc ');");
+ foreach (DataRow kitronItem in kitronFinals.Rows)
+ {
+ try
+ {
+ var DS_ID = (double)kitronItem["DS_ID"];
+ var ID_PCB = kitronItem["ID_PCB"].ToString();
+ var ID_TEST = (double)kitronItem["ID_TEST"];
+ var JSON = kitronItem["JSON"].ToString();
+ var oo = JObject.Parse(JSON);
+ UpdateTillLasID = (int)DS_ID;
+ var TestResultPass = false;
+ var IrDALogonSkeleton = "";
+ var FWVersion = "";
+ var MaterialNumber = "";
+ var StartDT = DateTime.MinValue;
+ foreach (var oItem in oo.Children().Values())
+ {
+ foreach (JProperty ChildValues in oItem.Children())
+ {
+ switch (ChildValues.Name)
+ {
+ case "TestResult":
+ TestResultPass = (ChildValues.Value.ToString().ToUpper() == "PASS");
+ break;
+ case "IrDA Logon Skeleton":
+ IrDALogonSkeleton = ChildValues.Value.ToString();
+ break;
+ case "FW Version":
+ FWVersion = ChildValues.Value.ToString();
+ break;
+ case "MaterialNumber":
+ MaterialNumber = ChildValues.Value.ToString();
+ break;
+ case "StartDT":
+ DateTime.TryParseExact(ChildValues.Value.ToString(), "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out StartDT);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ if (TestResultPass)
+ {
+ int matr = -1;
+ string remark = "";
+ if (!int.TryParse(MaterialNumber, out matr))
+ {
+ matr = -1;
+ remark = MaterialNumber;
+ }
+
+
+
+
+ dataAccess.ExecuteQuery($"" +
+ $" IF not EXISTS (SELECT 1 FROM dbo.[Cordonel_KitronData] WHERE KitronDSId = {DS_ID}) " +
+ $" Begin" +
+ $" INSERT INTO [dbo].[Cordonel_KitronData] ([PcbId] ,[KitronDSId] ,[Skeleton] ,[FW] ,[MaterialNumber] ,[ProdDate], [Remark]) " +
+ $" VALUES ( {ID_PCB},{DS_ID}, '{IrDALogonSkeleton}','{FWVersion}', {matr} , '{StartDT.ToString("yyyyMMdd HH:mm:ss")}', '{remark}')" +
+ $" end");
+
+
+
+ }
+
+
+ }
+ catch (Exception ex)
+ {
+
+ throw;
+ }
+ }
+ dataAccess.ExecuteQuery($"Update [dbo].KitronSync set LastID = {UpdateTillLasID} ");
+ }
+
+ }
+
+
+
+
+ return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return true; }));
+ }
[Route("GetProddate")]
public async Task GetProddate(string Seriennumer = "")
{
@@ -145,7 +251,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
-
+
// create connection
@@ -173,7 +279,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
var St = ((string)reader["JSON"]);
var startInex = St.IndexOf("\"StartDT\":\"") + "\"StartDT\":\"".Length;
var datestring = St.Substring(startInex, "29.07.2022 06:47:27".Length);
- DateTime.ParseExact(datestring, "dd.MM.yyyy hh:mm:ss", CultureInfo.InvariantCulture);
+ DateTime.ParseExact(datestring, "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture);
diff --git a/Common/Service/MeterProcessState/Controllers/PushControler.cs b/Common/Service/MeterProcessState/Controllers/PushControler.cs
index 02007f2c..43c6ba30 100644
--- a/Common/Service/MeterProcessState/Controllers/PushControler.cs
+++ b/Common/Service/MeterProcessState/Controllers/PushControler.cs
@@ -115,7 +115,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
}
else
{
- retC.kitronDate = DateTime.ParseExact(datestring, "dd.MM.yyyy hh:mm:ss", CultureInfo.InvariantCulture);
+ retC.kitronDate = DateTime.ParseExact(datestring, "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture);
}
diff --git a/Common/Service/MeterProcessState/MeterProcessState.csproj.user b/Common/Service/MeterProcessState/MeterProcessState.csproj.user
index d31c59d6..9b1bfe9a 100644
--- a/Common/Service/MeterProcessState/MeterProcessState.csproj.user
+++ b/Common/Service/MeterProcessState/MeterProcessState.csproj.user
@@ -2,7 +2,7 @@
Debug|Any CPU
- E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState\Properties\PublishProfiles\IISProfile.pubxml
+ E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState\Properties\PublishProfiles\a.pubxml
true
diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs
index 62aaf728..39c51a51 100644
--- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs
+++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs
@@ -303,7 +303,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
MeterPwdDb _pwdContainer = new MeterPwdDb();
var ret = MeterPwdHandlerDb.RequestPwdFileFromDb(_currentGenesis.GetPcbId(), out _pwdContainer);
-
+ //
if (_currentGenesis.Login(_pwdContainer.Skeleton))
{
diff --git a/LaaProductionWeb/LaaPackages b/LaaProductionWeb/LaaPackages
index ffa0abaa..3a9b1c5d 160000
--- a/LaaProductionWeb/LaaPackages
+++ b/LaaProductionWeb/LaaPackages
@@ -1 +1 @@
-Subproject commit ffa0abaa0448ba22350982cd3d3560ce1eaab42a
+Subproject commit 3a9b1c5d5ef1f05b68ff2c0f849f79b56bd44945