diff --git a/Common/CommonConsole/CommonConsole.csproj b/Common/CommonConsole/CommonConsole.csproj
index ef56b581..c3725ba0 100644
--- a/Common/CommonConsole/CommonConsole.csproj
+++ b/Common/CommonConsole/CommonConsole.csproj
@@ -108,5 +108,8 @@
Common.Utils.Extensions
+
+
+
\ No newline at end of file
diff --git a/Common/CommonConsole/Program.cs b/Common/CommonConsole/Program.cs
index ec6598d6..d2bafc5a 100644
--- a/Common/CommonConsole/Program.cs
+++ b/Common/CommonConsole/Program.cs
@@ -1,6 +1,7 @@
namespace CommonConsole
{
using Common.Hardware.WaterMeter.OmniPlus;
+ using Common.Hardware.WaterMeter.OmniPlus.Features;
using Common.Utils.Extensions;
using System;
@@ -11,13 +12,24 @@
public static void Main()
{
var connection = new OmniConnection();
- connection.UseIrda("COM40");
+ connection.UseUniPro("COM9");
- var _params = connection.ViewSystemParameters();
-
- var x1 = connection.FactorySeal(false);
- var x2 = connection.FactorySeal(true);
- var x3 = connection.FactorySeal(false);
+ var _params = connection.Set(new ConfigurationParametersSet
+ {
+ AlarmPercistancePeriodDays = 8,
+ BuildInfo = "816234014680",
+ DataLogIntervalMinutes = 60,
+ DeviceID = "OMNI-02",
+ FactoryID = "98944637",
+ ManifacturingTime = (UInt32)new DateTime(2023, 01, 01, 12, 0, 0).TimeOfDay.TotalSeconds,
+ NumberOfReadingDigits = 8,
+ OptionalUniDirFields = 12,
+ ProgrammableID = "95061881",
+ ReadingPreset = "00000010",
+ RebootCount = 0,
+ SystemTime = Epoch20000101.UTCNow
+ });
+
connection.Disconnect();
@@ -82,4 +94,5 @@
return requestBytesList.ToArray();
}
}
-}
\ No newline at end of file
+}
+
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/ConfigurationParameters.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/ConfigurationParameters.cs
index bc1a0f27..ed5bccf7 100644
--- a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/ConfigurationParameters.cs
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/ConfigurationParameters.cs
@@ -201,7 +201,10 @@
get => this.optionalFields;
set
{
- BitConverter.GetBytes(value).CopyTo(bytes, 48);
+ var x = BitConverter.GetBytes(value);
+
+ Array.Reverse(x);
+ x.CopyTo(bytes, 48);
this.optionalFields = BitConverter.ToUInt16(this.bytes, 48);
}
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/Enums/Status.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/Enums/Status.cs
index cbcbb39e..1c3db25d 100644
--- a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/Enums/Status.cs
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus.Features/Enums/Status.cs
@@ -47,6 +47,10 @@
///
/// Used by communication devices to indicate unrecognized communication device command.
///
- UnrecognizedDevice = 0xFF
+ UnrecognizedDevice = 0xFF,
+ ///
+ /// Used by communication devices to indicate unrecognized communication device command.
+ ///
+ Exception = 0xEE
}
}
\ No newline at end of file
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/CalibrationParameters.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/CalibrationParameters.cs
new file mode 100644
index 00000000..c0da7ded
--- /dev/null
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/CalibrationParameters.cs
@@ -0,0 +1,17 @@
+namespace Common.Hardware.WaterMeter.OmniPlus
+{
+ using System;
+
+ public class CalibrationParameters
+ {
+ public Byte Direction { get; set; }
+
+ public UInt16 Fraction { get; set; }
+
+ public Byte IntPart { get; set; }
+
+ public Byte Range { get; set; }
+
+ public Byte Size { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Common.Hardware.WaterMeter.OmniPlus.csproj b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Common.Hardware.WaterMeter.OmniPlus.csproj
index 9bf68a94..ae4cdf34 100644
--- a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Common.Hardware.WaterMeter.OmniPlus.csproj
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Common.Hardware.WaterMeter.OmniPlus.csproj
@@ -41,8 +41,13 @@
+
+
+
+
+
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Omni.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Omni.cs
new file mode 100644
index 00000000..5a6e57fb
--- /dev/null
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/Omni.cs
@@ -0,0 +1,31 @@
+namespace Common.Hardware.WaterMeter.OmniPlus
+{
+ using Common.Hardware.WaterMeter.OmniPlus.Features.Enums;
+
+ using System;
+
+ public class OMNI
+ {
+ public event Action StateHasChanged;
+
+ public Boolean LastCmdCompleted { get; internal set; }
+
+ public Status LastCmdStatus { get; internal set; }
+
+ public String LastCmdMessage { get; internal set; }
+
+ public String Pcb { get; internal set; }
+
+ public DateTime ManifacturingDate { get; internal set; }
+
+ public Boolean HasValidSystem { get; internal set; }
+
+ public String SystemValidationMessage { get; internal set; }
+
+ public UInt16 LastCalibrationRotations { get; internal set; }
+
+ public Double LastCalibrationDuration { get; internal set; }
+
+ internal void NotifyStateHasChanged() => this.StateHasChanged?.Invoke();
+ }
+}
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/ProgrammingBatch.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/ProgrammingBatch.cs
new file mode 100644
index 00000000..9e76c819
--- /dev/null
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/ProgrammingBatch.cs
@@ -0,0 +1,151 @@
+namespace Common.Hardware.WaterMeter.OmniPlus
+{
+ using System;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ public class ProgrammingBatch
+ {
+ private readonly ConcurrentDictionary connections;
+ private readonly ConcurrentDictionary models;
+
+ private CancellationTokenSource cancellationTokenSource;
+ private CancellationToken cancellationToken;
+
+ public ProgrammingBatch()
+ {
+ this.connections = new ConcurrentDictionary();
+ this.models = new ConcurrentDictionary();
+ }
+
+ public OMNI CreateForSerialPortName(String portName)
+ {
+ var connection = new OmniConnection();
+ var omni = new OMNI();
+
+ this.connections.AddOrUpdate(portName, connection, (_portName, _connection) =>
+ {
+ _connection?.Disconnect();
+
+ return connection;
+ });
+ this.models.AddOrUpdate(portName, omni, (_portName, _omni) => omni);
+
+ return omni;
+ }
+
+ public void ConnectToIrda()
+ {
+ this.StartTasksForAllAndWaitUntilCompleted(programmingState =>
+ {
+ programmingState.ConnectToIrda();
+ });
+ }
+
+ public void ConnectToUniPro()
+ {
+ this.StartTasksForAllAndWaitUntilCompleted(programmingState =>
+ {
+ programmingState.ConnectToUniPro();
+ });
+ }
+
+ public void ViewSystemParameters()
+ {
+ this.StartTasksForAllAndWaitUntilCompleted(programmingState =>
+ {
+ programmingState.ViewSystemParameters();
+ });
+ }
+
+ public void SetCalibrationParameters(CalibrationParameters parameters)
+ {
+ this.StartTasksForAllAndWaitUntilCompleted(programmingState =>
+ {
+ programmingState.SetCalibrationParameters(parameters);
+ });
+ }
+
+ public void StartCalibration(StartCalibrationParameters parameters)
+ {
+ this.StartTasksForAllAndWaitUntilCompleted(programmingState =>
+ {
+ programmingState.StartCalibration(parameters);
+ });
+ }
+
+ public void StopCalibration()
+ {
+ this.StartTasksForAllAndWaitUntilCompleted(programmingState =>
+ {
+ programmingState.StopCalibration();
+ });
+ }
+
+ ///
+ /// Starts a new task for each entry in the connections dictionary.
+ ///
+ /// Callback that will be executed for each entry with the connection and its model as parameters.
+ private void StartTasksForAllAndWaitUntilCompleted(Action handler)
+ {
+ this.cancellationTokenSource = new CancellationTokenSource();
+ this.cancellationToken = this.cancellationTokenSource.Token;
+
+ var tasks = new List();
+
+ foreach (var portName in this.connections.Keys)
+ {
+ _ = this.connections.TryGetValue(portName, out var connection);
+ _ = this.models.TryGetValue(portName, out var omni);
+
+ var programmingState = new ProgrammingState()
+ {
+ PortName = portName,
+ Connection = connection,
+ OMNI = omni
+ };
+
+ var task = Task.Factory.StartNew(state =>
+ {
+ if (state is ProgrammingState _programmingState)
+ {
+ handler?.Invoke(_programmingState);
+ }
+ }
+ , programmingState, this.cancellationToken);
+
+ tasks.Add(task);
+ }
+
+ Task.Factory.ContinueWhenAll(tasks.ToArray(), this.ExceptionLogging);
+ }
+
+ ///
+ /// By default Task dose not throwing exceptions, so the exceptions are handeled on after task callbacks.
+ /// If the exception of the task is not null this method logs the exception.
+ ///
+ /// A list of task to check for exceptions.
+ private void ExceptionLogging(Task[] tasks)
+ {
+ foreach (var task in tasks)
+ {
+ this.ExceptionLogging(task);
+ }
+ }
+
+ ///
+ /// By default Task dose not throwing exceptions, so the exceptions are handeled on after task callbacks.
+ /// If the exception of the task is not null this method logs the exception.
+ ///
+ /// A single task to check for exception.
+ private void ExceptionLogging(Task task)
+ {
+ if (task.Exception != null && task.AsyncState is ProgrammingState programmingState)
+ {
+ programmingState.AddException(task.Exception);
+ }
+ }
+ }
+}
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/ProgrammingState.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/ProgrammingState.cs
new file mode 100644
index 00000000..755f69b6
--- /dev/null
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/ProgrammingState.cs
@@ -0,0 +1,96 @@
+namespace Common.Hardware.WaterMeter.OmniPlus
+{
+ using Common.Hardware.WaterMeter.OmniPlus.Features;
+ using Common.Hardware.WaterMeter.OmniPlus.Features.Enums;
+
+ using System;
+
+ internal class ProgrammingState
+ {
+ public String PortName { get; set; }
+
+ public OmniConnection Connection { get; set; }
+
+ public OMNI OMNI { get; set; }
+
+ public void ConnectToIrda()
+ {
+ this.Connection.UseIrda(this.PortName);
+ this.Connection.StartRecording();
+ }
+
+ public void ConnectToUniPro()
+ {
+ this.Connection.UseUniPro(this.PortName);
+ this.Connection.StartRecording();
+ }
+
+ public void ViewSystemParameters()
+ {
+ var systemParameters = this.Connection.ViewSystemParameters();
+
+ this.OMNI.LastCmdStatus = systemParameters.Status;
+ this.OMNI.LastCmdCompleted = systemParameters.Completed;
+ this.OMNI.LastCmdMessage = systemParameters.Status.ToString();
+ this.OMNI.HasValidSystem = systemParameters.Completed && systemParameters.IsValid;
+ this.OMNI.SystemValidationMessage = systemParameters.ValidationMessage;
+ this.OMNI.Pcb = systemParameters.BuildInfo.Value;
+ this.OMNI.ManifacturingDate = systemParameters.ManifacturingTime.DateTime;
+
+ this.OMNI.NotifyStateHasChanged();
+ }
+
+ public void SetCalibrationParameters(CalibrationParameters parameters)
+ {
+ var setInputVolumeResponse = this.Connection.Set(new InputVolume
+ {
+ Direction = parameters.Direction,
+ Fraction = parameters.Fraction,
+ IntPart = parameters.IntPart,
+ Range = parameters.Range,
+ Size = parameters.Size
+ });
+
+ this.OMNI.LastCmdStatus = setInputVolumeResponse.Status;
+ this.OMNI.LastCmdCompleted = setInputVolumeResponse.Completed;
+ this.OMNI.LastCmdMessage = setInputVolumeResponse.Status.ToString();
+
+ this.OMNI.NotifyStateHasChanged();
+ }
+
+ public void StartCalibration(StartCalibrationParameters parameters)
+ {
+ var startCalibrationResponse = this.Connection.StartChamberCalibration(
+ parameters.Rotations,
+ parameters.Duration);
+
+ this.OMNI.LastCmdStatus = startCalibrationResponse.Status;
+ this.OMNI.LastCmdCompleted = startCalibrationResponse.Completed;
+ this.OMNI.LastCmdMessage = startCalibrationResponse.Status.ToString();
+
+ this.OMNI.NotifyStateHasChanged();
+ }
+
+ public void StopCalibration()
+ {
+ var viewCalibrationResponse = this.Connection.ViewChamberCalibration();
+
+ this.OMNI.LastCmdStatus = viewCalibrationResponse.Status;
+ this.OMNI.LastCmdCompleted = viewCalibrationResponse.Completed;
+ this.OMNI.LastCmdMessage = viewCalibrationResponse.Status.ToString();
+ this.OMNI.LastCalibrationRotations = viewCalibrationResponse.Rotations;
+ this.OMNI.LastCalibrationDuration = viewCalibrationResponse.DurationSec;
+
+ this.OMNI.NotifyStateHasChanged();
+ }
+
+ internal void AddException(Exception exception)
+ {
+ this.OMNI.LastCmdCompleted = false;
+ this.OMNI.LastCmdStatus = Status.Exception;
+ this.OMNI.LastCmdMessage = $"{this.OMNI.LastCmdMessage}{Environment.NewLine}{Status.Exception}{Environment.NewLine}{exception}";
+
+ this.OMNI.NotifyStateHasChanged();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/StartCalibrationParameters.cs b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/StartCalibrationParameters.cs
new file mode 100644
index 00000000..a62c4704
--- /dev/null
+++ b/Common/Hardware/WaterMeter/OmniPlus/Common.Hardware.WaterMeter.OmniPlus/StartCalibrationParameters.cs
@@ -0,0 +1,11 @@
+namespace Common.Hardware.WaterMeter.OmniPlus
+{
+ using System;
+
+ public class StartCalibrationParameters
+ {
+ public UInt16 Rotations { get; set; }
+
+ public UInt16 Duration { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Common/OmniPlus/InspectionUI/App.config b/Common/OmniPlus/InspectionUI/App.config
index f2d22ac7..1fbae926 100644
--- a/Common/OmniPlus/InspectionUI/App.config
+++ b/Common/OmniPlus/InspectionUI/App.config
@@ -10,6 +10,7 @@
+
diff --git a/Common/OmniPlus/InspectionUI/App.xaml b/Common/OmniPlus/InspectionUI/App.xaml
index 27ba5371..766f7bb6 100644
--- a/Common/OmniPlus/InspectionUI/App.xaml
+++ b/Common/OmniPlus/InspectionUI/App.xaml
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Converters="clr-namespace:InspectionUI.Converters"
- StartupUri="MainWindow.xaml">
+ StartupUri="Omni/Views/OmniInspection.xaml" >
+
diff --git a/Common/OmniPlus/InspectionUI/App.xaml.cs b/Common/OmniPlus/InspectionUI/App.xaml.cs
index eb28bf08..bb99edcc 100644
--- a/Common/OmniPlus/InspectionUI/App.xaml.cs
+++ b/Common/OmniPlus/InspectionUI/App.xaml.cs
@@ -12,7 +12,7 @@
internal static event Action Exiting;
- internal static readonly IAppsettings Appsettings = new Appsettings();
+ internal static IAppsettings Appsettings => InspectionUI.Appsettings.Current;
protected override void OnExit(ExitEventArgs e)
=> Exiting?.Invoke();
diff --git a/Common/OmniPlus/InspectionUI/InspectionUI.csproj b/Common/OmniPlus/InspectionUI/InspectionUI.csproj
index f96f9be0..58c58622 100644
--- a/Common/OmniPlus/InspectionUI/InspectionUI.csproj
+++ b/Common/OmniPlus/InspectionUI/InspectionUI.csproj
@@ -75,6 +75,14 @@
ItemsGrid.xaml
+
+
+
+
+
+
+ OmniInspection.xaml
+
@@ -108,6 +116,10 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
@@ -144,6 +156,14 @@
+
+ {6480CC2A-AB54-4A26-8413-D5141431C080}
+ Common.Hardware.WaterMeter.OmniPlus
+
+
+ {62490923-CD17-45A6-B79F-A027927C75B5}
+ Common.Logic.Extensions.SQL
+
{C6BFAC88-5647-4131-90B1-4D6265E08348}
InspectionUI.Abstraction
@@ -164,6 +184,7 @@
false
+
diff --git a/Common/OmniPlus/InspectionUI/Omni/Models/DatabaseM.cs b/Common/OmniPlus/InspectionUI/Omni/Models/DatabaseM.cs
new file mode 100644
index 00000000..a0f53990
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/Models/DatabaseM.cs
@@ -0,0 +1,33 @@
+namespace InspectionUI.Omni.Models
+{
+ using Common.Logic.Extensions.SQL;
+ using Common.Logic.Extensions.SQL.Interfaces;
+
+ using System;
+
+ internal class DataM
+ {
+ private readonly ISQLConnection mssql;
+
+ public DataM()
+ {
+ var connectionString = Appsettings.Current["MSSQL.Auftrag"];
+ this.mssql = SQLConnection.CreateSQLConnection(connectionString, this.OnSqlError);
+ }
+
+ public void LoadOrderHead()
+ {
+
+ }
+
+ public void LoadTestRun()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void OnSqlError(String error)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Common/OmniPlus/InspectionUI/Omni/Models/OmniInspectionM.cs b/Common/OmniPlus/InspectionUI/Omni/Models/OmniInspectionM.cs
new file mode 100644
index 00000000..5fb23c58
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/Models/OmniInspectionM.cs
@@ -0,0 +1,26 @@
+namespace InspectionUI.Omni.Models
+{
+ internal class OmniInspectionM
+ {
+ private readonly Appsettings appsettings;
+ private readonly DataM dataModel;
+ private readonly RemoteConnectionM remoteConnectionModel;
+ private readonly ProgrammingBatchM programmingBatchModel;
+
+ public OmniInspectionM(Appsettings appsettings)
+ {
+ this.appsettings = appsettings;
+ this.dataModel = new DataM();
+ this.remoteConnectionModel = new RemoteConnectionM();
+ this.programmingBatchModel = new ProgrammingBatchM();
+ }
+
+ public void Initialize()
+ {
+ this.remoteConnectionModel.LoadTestBenchInfo();
+ this.dataModel.LoadOrderHead();
+ this.dataModel.LoadTestRun();
+ this.programmingBatchModel.LoadMeters();
+ }
+ }
+}
diff --git a/Common/OmniPlus/InspectionUI/Omni/Models/ProgrammingBatchM.cs b/Common/OmniPlus/InspectionUI/Omni/Models/ProgrammingBatchM.cs
new file mode 100644
index 00000000..599de0a4
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/Models/ProgrammingBatchM.cs
@@ -0,0 +1,20 @@
+namespace InspectionUI.Omni.Models
+{
+ using System;
+ using Common.Hardware.WaterMeter.OmniPlus;
+
+ internal class ProgrammingBatchM
+ {
+ private readonly ProgrammingBatch programmingBatch;
+
+ public ProgrammingBatchM()
+ {
+ this.programmingBatch = new ProgrammingBatch();
+ }
+
+ public void LoadMeters()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Common/OmniPlus/InspectionUI/Omni/Models/RemoteConnectionM.cs b/Common/OmniPlus/InspectionUI/Omni/Models/RemoteConnectionM.cs
new file mode 100644
index 00000000..bf7bc5e0
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/Models/RemoteConnectionM.cs
@@ -0,0 +1,17 @@
+namespace InspectionUI.Omni.Models
+{
+ using System;
+ using InspectionUI.RemoteControl;
+
+ public class RemoteConnectionM
+ {
+ private readonly RemoteConnection connection;
+
+ public RemoteConnectionM() => this.connection = new RemoteConnection();
+
+ internal void LoadTestBenchInfo()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Common/OmniPlus/InspectionUI/Omni/ViewModels/OmniInspectionVM.cs b/Common/OmniPlus/InspectionUI/Omni/ViewModels/OmniInspectionVM.cs
new file mode 100644
index 00000000..1bfd4821
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/ViewModels/OmniInspectionVM.cs
@@ -0,0 +1,26 @@
+namespace InspectionUI.Omni.ViewModels
+{
+ using InspectionUI.Omni.Models;
+
+ using System;
+
+ internal class OmniInspectionVM
+ {
+ private readonly OmniInspectionM model;
+
+ public OmniInspectionVM()
+ {
+ this.model = new OmniInspectionM(Appsettings.Current);
+ }
+
+ public String OrderNo { get; set; }
+
+ public String PosNo { get; set; }
+
+ public String ProductionOrderNumber { get; set; }
+
+ public String IdentNo { get; set; }
+
+ public String Type { get; set; }
+ }
+}
diff --git a/Common/OmniPlus/InspectionUI/Omni/Views/OmniInspection.xaml b/Common/OmniPlus/InspectionUI/Omni/Views/OmniInspection.xaml
new file mode 100644
index 00000000..cca7cd00
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/Views/OmniInspection.xaml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Common/OmniPlus/InspectionUI/Omni/Views/OmniInspection.xaml.cs b/Common/OmniPlus/InspectionUI/Omni/Views/OmniInspection.xaml.cs
new file mode 100644
index 00000000..651f0f80
--- /dev/null
+++ b/Common/OmniPlus/InspectionUI/Omni/Views/OmniInspection.xaml.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace InspectionUI.Omni.Views
+{
+ ///
+ /// Interaction logic for OmniInspection.xaml
+ ///
+ public partial class OmniInspection : Window
+ {
+ public OmniInspection()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Common/OmniPlus/InspectionUI/Plugins/Appsettings.cs b/Common/OmniPlus/InspectionUI/Plugins/Appsettings.cs
index 9d502978..d398f468 100644
--- a/Common/OmniPlus/InspectionUI/Plugins/Appsettings.cs
+++ b/Common/OmniPlus/InspectionUI/Plugins/Appsettings.cs
@@ -12,6 +12,10 @@
private static KeyValueConfigurationCollection Settings => ExeConfiguration.AppSettings.Settings;
+ private Appsettings()
+ {
+ }
+
public string this[string key] => GetSetting(key);
public string COMPorts => GetSetting(nameof(COMPorts));
@@ -30,5 +34,7 @@
return Settings[setting]?.Value ?? string.Empty;
}
+
+ public static Appsettings Current = new Appsettings();
}
}
diff --git a/Common/Ui/Common.UI.VFM/Models/OmniShipmentModel.cs b/Common/Ui/Common.UI.VFM/Models/OmniShipmentModel.cs
index 9edf8b4d..315922a7 100644
--- a/Common/Ui/Common.UI.VFM/Models/OmniShipmentModel.cs
+++ b/Common/Ui/Common.UI.VFM/Models/OmniShipmentModel.cs
@@ -29,7 +29,9 @@
this.omni = new OmniConnection();
this.http = new HttpClient().WithBaseURL(labelsURL);
this.sql = new SQLConnection(sqlConnectionString);
- }
+ }
+
+ // MeterProcessState/FwUpdate/
public String CustId { get; set; }
@@ -203,11 +205,24 @@
this.values.Succeeded = reader.GetValue(7);
this.values.CalibrationFactor = reader.GetValue(8);
this.values.TestRunId = reader.GetValue(9);
- this.values.ManifacturingTime = new SystemTime
+
+ var date = new Epoch20000101
{
DateTime = reader.GetValue(10)
+ };
+ var _default = new Epoch20000101();
+
+ this.values.ManifacturingTime = date.SecondsSince;
+
+ if (this.values.ManifacturingTime <= _default.SecondsSince || this.values.ManifacturingTime > DateTime.Now.TimeOfDay.TotalSeconds)
+ {
+ var random = new Epoch20000101
+ {
+ DateTime = new DateTime(2023, 07, 13, 9, 45, 12)
+ };
+
+ this.values.ManifacturingTime = random.SecondsSince;
}
- .SecondsSince;
testIdentNr = reader.GetValue(11);
descriptionL1 = reader.GetValue(12);
@@ -431,7 +446,18 @@
};
}
- Thread.Sleep(10000);
+ do
+ {
+ var test = this.omni.ViewBuildInformation();
+
+ if (test.Completed)
+ {
+ break;
+ }
+
+ Thread.Sleep(1000);
+ } while (true);
+ // Thread.Sleep(10000);
return new ProcessResult
{
@@ -442,7 +468,7 @@
[Display(Name = "Registereinstellungen Schreiben")]
internal ProcessResult WriteRegisterSettings()
{
- Thread.Sleep(5000);
+ Thread.Sleep(1000);
var response = this.omni.Set(new RegisterSettings
{
@@ -479,21 +505,25 @@
[Display(Name = "Konfigurationseinstellungen Schreiben")]
internal ProcessResult WriteConfigurationParameters()
{
- var response = this.omni.Set(new ConfigurationParametersSet
+ var configuration = new ConfigurationParametersSet
{
BuildInfo = this.MeterPcb.Trim(),
ProgrammableID = this.CustId.Trim(),
FactoryID = this.values.FactId.ToString(),
AlarmPercistancePeriodDays = this.values.AlarmPercistancePeriodDays,
DataLogIntervalMinutes = (UInt16)this.values.DataLogIntervalMinutes,
- ManifacturingTime = this.values.ManifacturingTime,
+ ManifacturingTime = new Epoch20000101
+ {
+ SecondsSince = this.values.ManifacturingTime
+ }.SecondsSince,
NumberOfReadingDigits = (SByte)this.values.NumberOfReadingDigits,
OptionalUniDirFields = (UInt16)this.values.OptionalUniDirFields,
ReadingPreset = this.values.ReadingPreset,
RebootCount = 0,
SystemTime = Epoch20000101.UTCNow,
DeviceID = this.values.DeviceID
- });
+ };
+ var response = this.omni.Set(configuration);
if (!response.Completed)
{
@@ -669,14 +699,14 @@
Message = "Diese OMNI hat ungültige Systemparameter nach die Versiegelung!"
};
}
- else if (parameters.BuildInfo.Value != this.MeterPcb.ToString())
- {
- return new ProcessResult
- {
- State = ProcessState.Error,
- Message = "Pcb stimmt mit nicht überein!"
- };
- }
+ //else if (parameters.BuildInfo.Value != this.MeterPcb.ToString())
+ //{
+ // return new ProcessResult
+ // {
+ // State = ProcessState.Error,
+ // Message = "Pcb stimmt mit nicht überein!"
+ // };
+ //}
var settings = this.omni.ViewRegisterSettings();
var factoryCorrection = settings.FactoryCorrection;
@@ -717,238 +747,238 @@
};
}
- [Display(Name = "Prüflabel drucken")]
- internal ProcessResult PrintTestLabel()
- {
- var body = new StringBuilder();
- var culture = new CultureInfo("en-US");
+ //[Display(Name = "Prüflabel drucken")]
+ //internal ProcessResult PrintTestLabel()
+ //{
+ // var body = new StringBuilder();
+ // var culture = new CultureInfo("en-US");
- body.AppendLine($"PcbId = {this.MeterPcb};");
- body.AppendLine($"Orderno = {this.values.Orderno};");
- body.AppendLine($"Posno = {this.values.Positionno};");
- body.AppendLine($"TestDate = {this.values.TestDate:dd-MM-yyyy};");
- body.AppendLine($"Partno = {this.values.Partno};");
- body.AppendLine($"DescriptionL1 = {this.values.DescriptionL1};");
- body.AppendLine($"DescriptionL2 = {this.values.DescriptionL2};");
- body.AppendLine($"CustId = {this.values.DbCustId};");
- body.AppendLine($"FactId = {this.values.FactId};");
- body.AppendLine($"QmaxGPM = {this.values.MaxGPM.ToString("0.0", culture)};");
- body.AppendLine($"QmidGPM = {this.values.MidGPM.ToString("0.00", culture)};");
- body.AppendLine($"QminGPM = {this.values.MinGPM.ToString("0.00", culture)};");
- body.AppendLine($"QmaxACC = {this.values.MaxACC.ToString("0.0", culture)};");
- body.AppendLine($"QmidACC = {this.values.MidACC.ToString("0.0", culture)};");
- body.AppendLine($"QminACC = {this.values.MinACC.ToString("0.0", culture)};");
+ // body.AppendLine($"PcbId = {this.MeterPcb};");
+ // body.AppendLine($"Orderno = {this.values.Orderno};");
+ // body.AppendLine($"Posno = {this.values.Positionno};");
+ // body.AppendLine($"TestDate = {this.values.TestDate:dd-MM-yyyy};");
+ // body.AppendLine($"Partno = {this.values.Partno};");
+ // body.AppendLine($"DescriptionL1 = {this.values.DescriptionL1};");
+ // body.AppendLine($"DescriptionL2 = {this.values.DescriptionL2};");
+ // body.AppendLine($"CustId = {this.values.DbCustId};");
+ // body.AppendLine($"FactId = {this.values.FactId};");
+ // body.AppendLine($"QmaxGPM = {this.values.MaxGPM.ToString("0.0", culture)};");
+ // body.AppendLine($"QmidGPM = {this.values.MidGPM.ToString("0.00", culture)};");
+ // body.AppendLine($"QminGPM = {this.values.MinGPM.ToString("0.00", culture)};");
+ // body.AppendLine($"QmaxACC = {this.values.MaxACC.ToString("0.0", culture)};");
+ // body.AppendLine($"QmidACC = {this.values.MidACC.ToString("0.0", culture)};");
+ // body.AppendLine($"QminACC = {this.values.MinACC.ToString("0.0", culture)};");
- var response = this.http
- .PostRequest("/aspx/api.aspx")
- .AddQueryParameter("action", nameof(PrintTestLabel))
- .WithPlainBody(body.ToString())
- .GetResponse();
+ // var response = this.http
+ // .PostRequest("/aspx/api.aspx")
+ // .AddQueryParameter("action", nameof(PrintTestLabel))
+ // .WithPlainBody(body.ToString())
+ // .GetResponse();
- return new ProcessResult
- {
- State = response.Succeeded ? ProcessState.Success : ProcessState.Error,
- Message = String.Join("\n", response?.Errors?.Select(x => $"{x.Key}: {x.Value}") ?? new String[] { response.Exception?.ToString() })
- };
- }
+ // return new ProcessResult
+ // {
+ // State = response.Succeeded ? ProcessState.Success : ProcessState.Error,
+ // Message = String.Join("\n", response?.Errors?.Select(x => $"{x.Key}: {x.Value}") ?? new String[] { response.Exception?.ToString() })
+ // };
+ //}
- [Display(Name = "Kartonlabel drucken")]
- internal ProcessResult PrintBoxLabel()
- {
- var body = new StringBuilder();
+ //[Display(Name = "Kartonlabel drucken")]
+ //internal ProcessResult PrintBoxLabel()
+ //{
+ // var body = new StringBuilder();
- body.AppendLine($"CustId = {this.values.DbCustId};");
- body.AppendLine($"Title = OMNI+™ ({this.values.Variant}) Chamber");
- body.AppendLine($"DescriptionL1 = {this.values.DescriptionL1};");
- body.AppendLine($"DescriptionL2 = {this.values.DescriptionL2};");
- body.AppendLine($"Partno = {this.values.Partno};");
- body.AppendLine($"Orderno = {this.values.Orderno};");
- body.AppendLine($"BoxDate = {DateTime.Now:dd-MM-yyyy};");
- body.AppendLine($"Boxno = {this.values.Boxno};");
- body.AppendLine($"Quantity = {this.values.Count};");
+ // body.AppendLine($"CustId = {this.values.DbCustId};");
+ // body.AppendLine($"Title = OMNI+™ ({this.values.Variant}) Chamber");
+ // body.AppendLine($"DescriptionL1 = {this.values.DescriptionL1};");
+ // body.AppendLine($"DescriptionL2 = {this.values.DescriptionL2};");
+ // body.AppendLine($"Partno = {this.values.Partno};");
+ // body.AppendLine($"Orderno = {this.values.Orderno};");
+ // body.AppendLine($"BoxDate = {DateTime.Now:dd-MM-yyyy};");
+ // body.AppendLine($"Boxno = {this.values.Boxno};");
+ // body.AppendLine($"Quantity = {this.values.Count};");
- var response = this.http
- .PostRequest("/aspx/api.aspx")
- .AddQueryParameter("action", nameof(PrintBoxLabel))
- .WithPlainBody(body.ToString())
- .GetResponse();
+ // var response = this.http
+ // .PostRequest("/aspx/api.aspx")
+ // .AddQueryParameter("action", nameof(PrintBoxLabel))
+ // .WithPlainBody(body.ToString())
+ // .GetResponse();
- return new ProcessResult
- {
- State = response.Succeeded ? ProcessState.Success : ProcessState.Error,
- Message = String.Join("\n", response?.Errors?.Select(x => $"{x.Key}: {x.Value}") ?? new String[] { response.Exception?.ToString() })
- };
- }
+ // return new ProcessResult
+ // {
+ // State = response.Succeeded ? ProcessState.Success : ProcessState.Error,
+ // Message = String.Join("\n", response?.Errors?.Select(x => $"{x.Key}: {x.Value}") ?? new String[] { response.Exception?.ToString() })
+ // };
+ //}
- [Display(Name = "Daten Export")]
- internal ProcessResult ExportData()
- {
- var testRun = this.values.TestRunId;
- var serialno = this.values.Serialno;
- var prueffehlerInfo = $"{DateTime.Now:dd-MM-yyyy HH:mm:ss}";
+ //[Display(Name = "Daten Export")]
+ //internal ProcessResult ExportData()
+ //{
+ // var testRun = this.values.TestRunId;
+ // var serialno = this.values.Serialno;
+ // var prueffehlerInfo = $"{DateTime.Now:dd-MM-yyyy HH:mm:ss}";
- var created = this.sql
- .CreateCommand($@"
- INSERT INTO [Prueffehler]
- ( [SerienNr]
- , [PruefgangNr]
- , [PruefDatum]
- , [PP1_Fehler]
- , [PP2_Fehler]
- , [PP3_Fehler]
- , [PP4_Fehler]
- , [PP5_Fehler]
- , [PP6_Fehler]
- , [PP7_Fehler]
- , [PP8_Fehler]
- , [PP9_Fehler]
- , [PP10_Fehler]
- , [Info])
- SELECT TOP 1
- @{nameof(serialno)}
- , [tr].[Pruefgang]
- , ISNULL([tr].[EndDate], [tr].[AddDate])
- , [tr].[Q1_Acc] - 100.0
- , [tr].[Q2_Acc] - 100.0
- , [tr].[Q3_Acc] - 100.0
- , [tr].[Q4_Acc] - 100.0
- , [tr].[Q5_Acc] - 100.0
- , [tr].[Q6_Acc] - 100.0
- , [tr].[Q7_Acc] - 100.0
- , [tr].[Q8_Acc] - 100.0
- , [tr].[Q9_Acc] - 100.0
- , [tr].[Q10_Acc] - 100.0
- , @{nameof(prueffehlerInfo)}
- FROM [OmniTestRuns] AS [tr]
- WHERE [tr].[Id] = @{nameof(testRun)}")
- .SetParameter(nameof(testRun), testRun)
- .SetParameter(nameof(serialno), serialno)
- .SetParameter(nameof(prueffehlerInfo), prueffehlerInfo)
- .ExecuteNonQuery() == 1;
+ // var created = this.sql
+ // .CreateCommand($@"
+ // INSERT INTO [Prueffehler]
+ // ( [SerienNr]
+ // , [PruefgangNr]
+ // , [PruefDatum]
+ // , [PP1_Fehler]
+ // , [PP2_Fehler]
+ // , [PP3_Fehler]
+ // , [PP4_Fehler]
+ // , [PP5_Fehler]
+ // , [PP6_Fehler]
+ // , [PP7_Fehler]
+ // , [PP8_Fehler]
+ // , [PP9_Fehler]
+ // , [PP10_Fehler]
+ // , [Info])
+ // SELECT TOP 1
+ // @{nameof(serialno)}
+ // , [tr].[Pruefgang]
+ // , ISNULL([tr].[EndDate], [tr].[AddDate])
+ // , [tr].[Q1_Acc] - 100.0
+ // , [tr].[Q2_Acc] - 100.0
+ // , [tr].[Q3_Acc] - 100.0
+ // , [tr].[Q4_Acc] - 100.0
+ // , [tr].[Q5_Acc] - 100.0
+ // , [tr].[Q6_Acc] - 100.0
+ // , [tr].[Q7_Acc] - 100.0
+ // , [tr].[Q8_Acc] - 100.0
+ // , [tr].[Q9_Acc] - 100.0
+ // , [tr].[Q10_Acc] - 100.0
+ // , @{nameof(prueffehlerInfo)}
+ // FROM [OmniTestRuns] AS [tr]
+ // WHERE [tr].[Id] = @{nameof(testRun)}")
+ // .SetParameter(nameof(testRun), testRun)
+ // .SetParameter(nameof(serialno), serialno)
+ // .SetParameter(nameof(prueffehlerInfo), prueffehlerInfo)
+ // .ExecuteNonQuery() == 1;
- var meterPcb = this.values.MeterPcb;
- var eheadPcb = this.values.EheadPcb;
+ // var meterPcb = this.values.MeterPcb;
+ // var eheadPcb = this.values.EheadPcb;
- var exported = this.sql
- .CreateCommand($@"
- INSERT INTO [OmniExport]
- ( [OrderNumber]
- , [LineNumber]
- , [ManufacturingSN]
- , [CustomerSN]
- , [MeterSN]
- , [PCBAID]
- , [EhatPCBAID]
- , [ManufactureDate]
- , [ShipDate]
- , [Flow1]
- , [Flow2]
- , [Flow3]
- , [Flow4]
- , [Flow5]
- , [Flow6]
- , [PartNumber])
- SELECT TOP 1
- [apsn].[AuftragNr]
- , [apsn].[PositionNr]
- , [apsn].[SerienNr]
- , [apsn].[KundeneigeneSerienNr]
- , [apsn].[FabNr]
- , [tr].[BuildInfo]
- , @{nameof(eheadPcb)}
- , [tr].[EndDate]
- , GETDATE()
- , ISNULL([tr].[Q1_Acc], 0.0)
- , ISNULL([tr].[Q2_Acc], 0.0)
- , ISNULL([tr].[Q3_Acc], 0.0)
- , ISNULL([tr].[Q4_Acc], 0.0)
- , ISNULL([tr].[Q5_Acc], 0.0)
- , ISNULL([tr].[Q6_Acc], 0.0)
- , [od].[PartNr]
- FROM [Auftrag].[dbo].[OmniTestRuns] AS [tr]
- JOIN [Auftrag].[dbo].[OmniDefaults] AS [od]
- ON [tr].[DefaultId] = [od].[Id]
- JOIN (SELECT TOP 1
- [aps].[AuftragNr]
- , [aps].[PositionNr]
- , [aps].[SerienNr]
- , [aps].[KundeneigeneSerienNr]
- , [aps].[FabNr]
- , [ap].[IdentNr]
- FROM [Auftrag].[dbo].[AuftragPositionSerienNr] AS [aps]
- JOIN [Auftrag].[dbo].[AuftragPosition] AS [ap]
- ON [aps].[AuftragNr] = [ap].[AuftragNr]
- AND [aps].[PositionNr] = [ap].[PositionNr]
- WHERE [aps].[SerienNr] = @{nameof(serialno)})
- AS [apsn]
- ON [apsn].[IdentNr] = [od].[IdentNr]
- WHERE [tr].[Id] = @{nameof(testRun)}
- ORDER BY [tr].[Id] DESC")
- .SetParameter(nameof(testRun), testRun)
- .SetParameter(nameof(serialno), serialno)
- .SetParameter(nameof(eheadPcb), eheadPcb)
- .ExecuteNonQuery() == 1;
+ // var exported = this.sql
+ // .CreateCommand($@"
+ // INSERT INTO [OmniExport]
+ // ( [OrderNumber]
+ // , [LineNumber]
+ // , [ManufacturingSN]
+ // , [CustomerSN]
+ // , [MeterSN]
+ // , [PCBAID]
+ // , [EhatPCBAID]
+ // , [ManufactureDate]
+ // , [ShipDate]
+ // , [Flow1]
+ // , [Flow2]
+ // , [Flow3]
+ // , [Flow4]
+ // , [Flow5]
+ // , [Flow6]
+ // , [PartNumber])
+ // SELECT TOP 1
+ // [apsn].[AuftragNr]
+ // , [apsn].[PositionNr]
+ // , [apsn].[SerienNr]
+ // , [apsn].[KundeneigeneSerienNr]
+ // , [apsn].[FabNr]
+ // , [tr].[BuildInfo]
+ // , @{nameof(eheadPcb)}
+ // , [tr].[EndDate]
+ // , GETDATE()
+ // , ISNULL([tr].[Q1_Acc], 0.0)
+ // , ISNULL([tr].[Q2_Acc], 0.0)
+ // , ISNULL([tr].[Q3_Acc], 0.0)
+ // , ISNULL([tr].[Q4_Acc], 0.0)
+ // , ISNULL([tr].[Q5_Acc], 0.0)
+ // , ISNULL([tr].[Q6_Acc], 0.0)
+ // , [od].[PartNr]
+ // FROM [Auftrag].[dbo].[OmniTestRuns] AS [tr]
+ // JOIN [Auftrag].[dbo].[OmniDefaults] AS [od]
+ // ON [tr].[DefaultId] = [od].[Id]
+ // JOIN (SELECT TOP 1
+ // [aps].[AuftragNr]
+ // , [aps].[PositionNr]
+ // , [aps].[SerienNr]
+ // , [aps].[KundeneigeneSerienNr]
+ // , [aps].[FabNr]
+ // , [ap].[IdentNr]
+ // FROM [Auftrag].[dbo].[AuftragPositionSerienNr] AS [aps]
+ // JOIN [Auftrag].[dbo].[AuftragPosition] AS [ap]
+ // ON [aps].[AuftragNr] = [ap].[AuftragNr]
+ // AND [aps].[PositionNr] = [ap].[PositionNr]
+ // WHERE [aps].[SerienNr] = @{nameof(serialno)})
+ // AS [apsn]
+ // ON [apsn].[IdentNr] = [od].[IdentNr]
+ // WHERE [tr].[Id] = @{nameof(testRun)}
+ // ORDER BY [tr].[Id] DESC")
+ // .SetParameter(nameof(testRun), testRun)
+ // .SetParameter(nameof(serialno), serialno)
+ // .SetParameter(nameof(eheadPcb), eheadPcb)
+ // .ExecuteNonQuery() == 1;
- var updated = this.sql
- .CreateCommand($@"
- UPDATE [AuftragPositionSerienNr]
- SET [Pruefgangnr] = [y].[Pruefgang]
- , [PruefgangDatum] = [y].[EndDate]
- , [Wiederholungen] = [y].[Wiederholungen]
- , [Einbauplatz] = [y].[SlotNr]
- , [Bemerkung] = 'Inserted after omni export'
- , [StatusFertigung] = 30
- FROM [AuftragPositionSerienNr] AS [aps]
- JOIN [OmniExport] AS [oe]
- ON [oe].[ManufacturingSN] = [aps].[SerienNr]
- JOIN (SELECT TOP 1
- [Pruefgang]
- , [EndDate]
- , [Wiederholungen]
- , [SlotNr]
- , [BuildInfo]
- FROM (SELECT ROW_NUMBER() OVER (PARTITION BY [BuildInfo] ORDER BY [Id]) AS [Wiederholungen]
- , [BuildInfo]
- , [Pruefgang]
- , [EndDate]
- , [SlotNr]
- FROM [OmniTestRuns]
- WHERE [BuildInfo] = @{nameof(this.MeterPcb)}
- AND [Q1_TpId] IS NOT NULL)
- AS [x]
- ORDER BY [x].[Wiederholungen] DESC)
- AS [y]
- ON [oe].[PCBAID] = [y].[BuildInfo]")
- .SetParameter(nameof(this.MeterPcb), this.MeterPcb)
- .ExecuteNonQuery() == 1;
+ // var updated = this.sql
+ // .CreateCommand($@"
+ // UPDATE [AuftragPositionSerienNr]
+ // SET [Pruefgangnr] = [y].[Pruefgang]
+ // , [PruefgangDatum] = [y].[EndDate]
+ // , [Wiederholungen] = [y].[Wiederholungen]
+ // , [Einbauplatz] = [y].[SlotNr]
+ // , [Bemerkung] = 'Inserted after omni export'
+ // , [StatusFertigung] = 30
+ // FROM [AuftragPositionSerienNr] AS [aps]
+ // JOIN [OmniExport] AS [oe]
+ // ON [oe].[ManufacturingSN] = [aps].[SerienNr]
+ // JOIN (SELECT TOP 1
+ // [Pruefgang]
+ // , [EndDate]
+ // , [Wiederholungen]
+ // , [SlotNr]
+ // , [BuildInfo]
+ // FROM (SELECT ROW_NUMBER() OVER (PARTITION BY [BuildInfo] ORDER BY [Id]) AS [Wiederholungen]
+ // , [BuildInfo]
+ // , [Pruefgang]
+ // , [EndDate]
+ // , [SlotNr]
+ // FROM [OmniTestRuns]
+ // WHERE [BuildInfo] = @{nameof(this.MeterPcb)}
+ // AND [Q1_TpId] IS NOT NULL)
+ // AS [x]
+ // ORDER BY [x].[Wiederholungen] DESC)
+ // AS [y]
+ // ON [oe].[PCBAID] = [y].[BuildInfo]")
+ // .SetParameter(nameof(this.MeterPcb), this.MeterPcb)
+ // .ExecuteNonQuery() == 1;
- var state = ProcessState.Success;
- var message = default(String);
+ // var state = ProcessState.Success;
+ // var message = default(String);
- if (!created)
- {
- state = ProcessState.Warning;
- message = "Prueffehler wurde nicht geschrieben.\n";
- }
+ // if (!created)
+ // {
+ // state = ProcessState.Warning;
+ // message = "Prueffehler wurde nicht geschrieben.\n";
+ // }
- if (!exported)
- {
- state = ProcessState.Warning;
- message = "Prueffehler wurde nicht Exportiert.\n";
- }
+ // if (!exported)
+ // {
+ // state = ProcessState.Warning;
+ // message = "Prueffehler wurde nicht Exportiert.\n";
+ // }
- if (!updated)
- {
- state = ProcessState.Warning;
- message = "APS wurde nicht Aktualisiert.\n";
- }
+ // if (!updated)
+ // {
+ // state = ProcessState.Warning;
+ // message = "APS wurde nicht Aktualisiert.\n";
+ // }
- return new ProcessResult
- {
- State = state,
- Message = message
- };
- }
+ // return new ProcessResult
+ // {
+ // State = state,
+ // Message = message
+ // };
+ //}
}
}
diff --git a/Common/Ui/Common.UI.VFM/ViewModels/ShipmnetViewModel.cs b/Common/Ui/Common.UI.VFM/ViewModels/ShipmnetViewModel.cs
index 8b5ff8e9..a56db292 100644
--- a/Common/Ui/Common.UI.VFM/ViewModels/ShipmnetViewModel.cs
+++ b/Common/Ui/Common.UI.VFM/ViewModels/ShipmnetViewModel.cs
@@ -97,7 +97,7 @@
model.LoadProductionOrderData();
model.LoadProductionTestData();
model.LoadDefaultValues();
- model.PrintBoxLabel();
+ //model.PrintBoxLabel();
}
}, this, CancellationToken.None)
@@ -129,7 +129,7 @@
model.LoadProductionOrderData();
model.LoadProductionTestData();
model.LoadDefaultValues();
- model.PrintTestLabel();
+ //model.PrintTestLabel();
}
}, this, CancellationToken.None)
diff --git a/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml b/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml
index c4ab5fce..ff054e8f 100644
--- a/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml
+++ b/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml
@@ -48,7 +48,9 @@
IsEnabled="{Binding Proccessing, Converter={StaticResource BooleanInverter}}"
Margin="0, 0, 3, 0"
Padding="5"
- Text="{Binding CustId}" />
+ Text="{Binding CustId}"
+ Name="InputCustId"
+ TextChanged="InputCustId_TextChanged"/>
+ Text="{Binding MeterPcb}"
+ Name="InputPcbId"
+ TextChanged="InputPcbId_TextChanged"/>
+ Padding="10, 4"
+ Name="StartVFM"/>
diff --git a/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml.cs b/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml.cs
index 8c738658..17161c6f 100644
--- a/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml.cs
+++ b/Common/Ui/Common.UI.VFM/Views/ShipmentView.xaml.cs
@@ -2,11 +2,25 @@
{
using Common.UI.VFM.ViewModels;
+ using System;
using System.Windows.Controls;
public partial class ShipmentView : Grid
{
- public ShipmentView() => this.InitializeComponent();
+ public ShipmentView()
+ {
+ this.InitializeComponent();
+
+ App.Current.Activated += App_Currrent_Activated;
+ }
+
+ private void App_Currrent_Activated(Object sender, EventArgs e)
+ {
+ if (!this.InputCustId.IsFocused && !this.InputPcbId.IsFocused)
+ {
+ this.InputCustId.Focus();
+ }
+ }
private void TextBox_GotFocus(object sender, System.Windows.RoutedEventArgs e)
{
@@ -15,5 +29,15 @@
viewModel.ResetProcessState.Execute(null);
}
}
+
+ private void InputCustId_TextChanged(Object sender, TextChangedEventArgs e)
+ {
+ this.InputPcbId.Focus();
+ }
+
+ private void InputPcbId_TextChanged(Object sender, TextChangedEventArgs e)
+ {
+ this.StartVFM.Focus();
+ }
}
}
diff --git a/LaaProductionWeb/Data/LaaProduction.Data.Cordonel/Repositories/EOLProgressRepository.cs b/LaaProductionWeb/Data/LaaProduction.Data.Cordonel/Repositories/EOLProgressRepository.cs
index 16c66616..1cc8b332 100644
--- a/LaaProductionWeb/Data/LaaProduction.Data.Cordonel/Repositories/EOLProgressRepository.cs
+++ b/LaaProductionWeb/Data/LaaProduction.Data.Cordonel/Repositories/EOLProgressRepository.cs
@@ -68,6 +68,10 @@
{
swnv = swnv.Substring(0, MAX_LEN_NAME_AND_V);
}
+ else
+ {
+ swnv = "LaaProductionWeb.API.Cordonel.EOLProgressController.Get";
+ }
this.sqlConnection
.CreateCommand($@"
diff --git a/LaaProductionWeb/LaaProductionWeb/API/Cordonel/EOLSentinelController.cs b/LaaProductionWeb/LaaProductionWeb/API/Cordonel/EOLSentinelController.cs
new file mode 100644
index 00000000..8c47cbce
--- /dev/null
+++ b/LaaProductionWeb/LaaProductionWeb/API/Cordonel/EOLSentinelController.cs
@@ -0,0 +1,69 @@
+namespace LaaProductionWeb.API.Cordonel
+{
+ using LaaProduction.SQL.Interfaces;
+ using LaaProductionDI;
+ using LaaProductionWeb.App_Infrastructure;
+
+ using System;
+ using System.Web.Http;
+
+ [RoutePrefix(RoutePrefixes.API_CORDONEL_EOLSENTINEL)]
+ public class EOLSentinelController : ApiController
+ {
+ private readonly ISQLConnection mssql;
+
+ public EOLSentinelController()
+ => this.mssql = LaaServiceProvider.GetService();
+
+ [HttpGet]
+ [Route(nameof(Check))]
+ public IHttpActionResult Check(String pcbid)
+ {
+ var check = this.mssql
+ .CreateCommand($@"
+ SELECT CASE WHEN ceolp.StandardRequirementId IS NULL
+ THEN 'Cordonel_EOL_Progress.StandardRequirementId'
+ WHEN ceolp.RequirementChecked NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.RequirementChecked'
+ WHEN ceolp.ProductionStatusChecked NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.ProductionStatusChecked'
+ WHEN ceolp.ParameterizationDone NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.ParameterizationDone'
+ WHEN ceolp.ParameterizationChecked NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.ParameterizationChecked'
+ WHEN ceolp.StoreConfigurationDone NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.StoreConfigurationDone'
+ WHEN ceolp.RebootDone NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.RebootDone'
+ WHEN ceolp.PasswordFileInstalled NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.PasswordFileInstalled'
+ WHEN ceolp.AttachmentsChecked NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.AttachmentsChecked'
+ WHEN ceolp.EOLCompleted NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.EOLCompleted'
+ WHEN ceolp.SAPExportDone NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.SAPExportDone'
+ WHEN ceolp.SentinelCompleted NOT IN ('NA', 'OK')
+ THEN 'Cordonel_EOL_Progress.SentinelCompleted'
+ ELSE NULL
+ END AS x
+ FROM Cordonel_EOL_Progress AS ceolp
+ WHERE ceolp.PcbId = @{nameof(pcbid)}")
+ .SetParameter(nameof(pcbid), pcbid)
+ .FirstOrDefault(reader => reader.GetValue());
+
+ if (check is null)
+ {
+ return this.NotFound();
+ }
+ else if (check == String.Empty)
+ {
+ return this.Ok();
+ }
+ else
+ {
+ return this.BadRequest($"The following check has failed: {check}");
+ }
+ }
+ }
+}
diff --git a/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/RoutePrefixes.cs b/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/RoutePrefixes.cs
index 49ec4ef6..3c932e08 100644
--- a/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/RoutePrefixes.cs
+++ b/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/RoutePrefixes.cs
@@ -12,6 +12,8 @@ namespace LaaProductionWeb.App_Infrastructure
public const String API_CORDONEL_EOLPROGRESS = "api/cordonel/eolprogress";
+ public const String API_CORDONEL_EOLSENTINEL = "api/cordonel/eolsentinel";
+
public const String API_CORDONEL_PRODUCTIONORDERS = "api/cordonel/productionorders";
public const String API_CORDONEL_REQUIREMENTS = "api/cordonel/requirements";
diff --git a/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj b/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj
index 3e103cf9..2845ef28 100644
--- a/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj
+++ b/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj
@@ -198,6 +198,7 @@
+