diff --git a/uniper_hmi/Infineon.sln.DotSettings b/uniper_hmi/Infineon.sln.DotSettings
new file mode 100644
index 0000000..dd67cff
--- /dev/null
+++ b/uniper_hmi/Infineon.sln.DotSettings
@@ -0,0 +1,2 @@
+
+ True
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/L4ItXmlSerializer.cs b/uniper_hmi/UniperHMI/Common/L4ItXmlSerializer.cs
index 3ee37b3..4c6dc75 100644
--- a/uniper_hmi/UniperHMI/Common/L4ItXmlSerializer.cs
+++ b/uniper_hmi/UniperHMI/Common/L4ItXmlSerializer.cs
@@ -1,127 +1,176 @@
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Security.Cryptography;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
-namespace InfineonHMI.Common
+namespace InfineonHMI.Common;
+
+public static class L4ItXmlSerializer
{
- public static class L4ItXmlSerializer
+ ///
+ /// Serializes an object.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+
+ public static void SerializeObject(T serializableObject, string fileName, bool encrypt = false, string rootElementName = null)
{
- ///
- /// Serializes an object.
- ///
- ///
- ///
- ///
- ///
- ///
+ if (string.IsNullOrEmpty(fileName))
+ return;
- public static void SerializeObject(T serializableObject, string fileName, bool encrypt = false, string rootElementName = null)
+ if (serializableObject == null)
+ return;
+
+ XmlSerializer serializer;
+ if (rootElementName != null)
{
- if (string.IsNullOrEmpty(fileName))
- return;
+ var xmlRoot = new XmlRootAttribute(rootElementName);
+ serializer = new XmlSerializer(serializableObject.GetType(), xmlRoot);
+ }
+ else
+ {
+ serializer = new XmlSerializer(serializableObject.GetType());
+ }
- if (serializableObject == null)
+ try
+ {
+ var dir = new FileInfo(fileName).DirectoryName;
+ if (dir != null && !Directory.Exists(dir)) // Überprüfen Sie, ob dir nicht null ist, bevor Sie es verwenden
+ Directory.CreateDirectory(dir);
+
+ var xmlDocument = new XmlDocument();
+ using var stream = new MemoryStream();
+ serializer.Serialize(stream, serializableObject);
+ stream.Position = 0;
+ xmlDocument.Load(stream);
+ if (encrypt && false)
+ {
+ //FileEncryption.SaveEncryptedToFile(fileName, xmlDocument.OuterXml);
return;
+ }
+ xmlDocument.Save(fileName);
+ }
+ catch (Exception ex)
+ {
+ Console.Write(ex);
+ }
+ }
+
+
+ ///
+ /// Deserializes an xml file into an object list
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static T DeSerializeObject(string fileName, bool decrypt = false, string rootElementName = null)
+ {
+ if (string.IsNullOrEmpty(fileName) || !File.Exists(fileName)) return default!;
+
+ T objectOut;
+
+ try
+ {
+ string xmlString;
+ if (decrypt && false)
+ {
+ //xmlString = FileEncryption.ReadDecryptedFromFile(fileName)!;
+ }
+ else
+ {
+ var xmlDocument = new XmlDocument();
+ xmlDocument.Load(fileName);
+ xmlString = xmlDocument.OuterXml;
+ }
+
+ if (string.IsNullOrEmpty(xmlString))
+ {
+ // Handle empty xmlString if necessary
+ return default!;
+ }
+
+ using var read = new StringReader(xmlString);
+ var outType = typeof(T);
XmlSerializer serializer;
if (rootElementName != null)
{
- var xmlRoot = new XmlRootAttribute(rootElementName);
- serializer = new XmlSerializer(serializableObject.GetType(), xmlRoot);
+ var root = new XmlRootAttribute(rootElementName);
+ serializer = new XmlSerializer(outType, root);
}
else
{
- serializer = new XmlSerializer(serializableObject.GetType());
+ serializer = new XmlSerializer(outType);
}
- try
- {
- var dir = new FileInfo(fileName).DirectoryName;
- if (dir != null && !Directory.Exists(dir)) // Überprüfen Sie, ob dir nicht null ist, bevor Sie es verwenden
- Directory.CreateDirectory(dir);
-
- var xmlDocument = new XmlDocument();
- using var stream = new MemoryStream();
- serializer.Serialize(stream, serializableObject);
- stream.Position = 0;
- xmlDocument.Load(stream);
- if (encrypt && false)
- {
- //FileEncryption.SaveEncryptedToFile(fileName, xmlDocument.OuterXml);
- return;
- }
- xmlDocument.Save(fileName);
- }
- catch (Exception ex)
- {
- Console.Write(ex);
- }
+ using XmlReader reader = new XmlTextReader(read);
+ objectOut = (T)serializer.Deserialize(reader)!;
}
-
-
- ///
- /// Deserializes an xml file into an object list
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public static T DeSerializeObject(string fileName, bool decrypt = false, string rootElementName = null)
+ catch (Exception ex)
{
- if (string.IsNullOrEmpty(fileName) || !File.Exists(fileName)) return default!;
-
- T objectOut;
-
- try
- {
- string xmlString;
- if (decrypt && false)
- {
- //xmlString = FileEncryption.ReadDecryptedFromFile(fileName)!;
- }
- else
- {
- var xmlDocument = new XmlDocument();
- xmlDocument.Load(fileName);
- xmlString = xmlDocument.OuterXml;
- }
-
- if (string.IsNullOrEmpty(xmlString))
- {
- // Handle empty xmlString if necessary
- return default!;
- }
-
- using var read = new StringReader(xmlString);
- var outType = typeof(T);
-
- XmlSerializer serializer;
- if (rootElementName != null)
- {
- var root = new XmlRootAttribute(rootElementName);
- serializer = new XmlSerializer(outType, root);
- }
- else
- {
- serializer = new XmlSerializer(outType);
- }
-
- using XmlReader reader = new XmlTextReader(read);
- objectOut = (T)serializer.Deserialize(reader)!;
- }
- catch (Exception ex)
- {
- Console.Write(ex);
- return default!;
- }
-
- return objectOut;
+ Console.Write(ex);
+ return default!;
}
+
+ return objectOut;
}
-}
+
+ public static string Encrypt(string encryptString)
+ {
+ string EncryptionKey = "0ram@1234xxxxxxxxxxtttttuuuuuiiiiio"; //we can change the code converstion key as per our requirement
+ byte[] clearBytes = Encoding.Unicode.GetBytes(encryptString);
+ using (Aes encryptor = Aes.Create())
+ {
+ Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] {
+ 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76
+ });
+ encryptor.Key = pdb.GetBytes(32);
+ encryptor.IV = pdb.GetBytes(16);
+ using (MemoryStream ms = new MemoryStream())
+ {
+ using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
+ {
+ cs.Write(clearBytes, 0, clearBytes.Length);
+ cs.Close();
+ }
+ encryptString = Convert.ToBase64String(ms.ToArray());
+ }
+ }
+ return encryptString;
+ }
+
+ public static string Decrypt(string cipherText)
+ {
+ string EncryptionKey = "0ram@1234xxxxxxxxxxtttttuuuuuiiiiio"; //we can change the code converstion key as per our requirement, but the decryption key should be same as encryption key
+ cipherText = cipherText.Replace(" ", "+");
+ byte[] cipherBytes = Convert.FromBase64String(cipherText);
+ using (Aes encryptor = Aes.Create())
+ {
+ Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] {
+ 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76
+ });
+ encryptor.Key = pdb.GetBytes(32);
+ encryptor.IV = pdb.GetBytes(16);
+ using (MemoryStream ms = new MemoryStream())
+ {
+ using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
+ {
+ cs.Write(cipherBytes, 0, cipherBytes.Length);
+ cs.Close();
+ }
+ cipherText = Encoding.Unicode.GetString(ms.ToArray());
+ }
+ }
+ return cipherText;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/MediaContainer.xaml b/uniper_hmi/UniperHMI/Common/MediaContainer.xaml
index 6594243..cda2874 100644
--- a/uniper_hmi/UniperHMI/Common/MediaContainer.xaml
+++ b/uniper_hmi/UniperHMI/Common/MediaContainer.xaml
@@ -6,11 +6,9 @@
xmlns:common="clr-namespace:Common"
xmlns:HMIToolkit="clr-namespace:HMIToolkit"
d:DataContext="{d:DesignInstance Type=common:MediaContainerVm, IsDesignTimeCreatable=True}"
- mc:Ignorable="d"
- Width="Auto"
- Height="Auto"
- MinWidth="200">
-
+ mc:Ignorable="d">
+
+
@@ -19,65 +17,85 @@
-
+
-
-
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Common/MediaContainer.xaml.cs b/uniper_hmi/UniperHMI/Common/MediaContainer.xaml.cs
index 4253985..1199d3b 100644
--- a/uniper_hmi/UniperHMI/Common/MediaContainer.xaml.cs
+++ b/uniper_hmi/UniperHMI/Common/MediaContainer.xaml.cs
@@ -2,31 +2,30 @@
using System.Windows.Controls;
using System.Windows.Input;
-namespace Common
+namespace Common;
+
+///
+/// Interaktionslogik für AnalogValue.xaml
+///
+public partial class MediaContainer : UserControl
{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class MediaContainer : UserControl
- {
- public bool IsReadonly { get; set; }
+ public bool IsReadonly { get; set; }
- public MediaContainer()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+ public MediaContainer()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
+ private void NumberValidation(object sender, TextCompositionEventArgs e)
+ {
+ Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
+ e.Handled = regex.IsMatch(e.Text);
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/PackMLControl.xaml b/uniper_hmi/UniperHMI/Common/PackMLControl.xaml
new file mode 100644
index 0000000..c3c93ea
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/PackMLControl.xaml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ModuleOverviewPage.xaml.cs b/uniper_hmi/UniperHMI/Common/PackMLControl.xaml.cs
similarity index 59%
rename from uniper_hmi_old/UniperHMI/Pages/Views/ModuleOverviewPage.xaml.cs
rename to uniper_hmi/UniperHMI/Common/PackMLControl.xaml.cs
index 50f67df..257e407 100644
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ModuleOverviewPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Common/PackMLControl.xaml.cs
@@ -13,16 +13,15 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
-namespace UniperHMI
+namespace Common;
+
+///
+/// Interaktionslogik für WorkingModeSelectionControl.xaml
+///
+public partial class PackMLControl : UserControl
{
- ///
- /// Interaktionslogik für ModuleOverviewPage.xaml
- ///
- public partial class ModuleOverviewPage : Page
- {
- public ModuleOverviewPage()
- {
- InitializeComponent();
- }
- }
-}
+ public PackMLControl()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/PackMLControlVm.cs b/uniper_hmi/UniperHMI/Common/PackMLControlVm.cs
new file mode 100644
index 0000000..396c0cb
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/PackMLControlVm.cs
@@ -0,0 +1,201 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using CommunityToolkit.Mvvm.Input;
+using TwinCAT.TypeSystem;
+using Heisig.HMI.AdsManager;
+using HMIToolkit;
+using InfineonHMI.Common;
+
+namespace Common;
+
+public sealed partial class PackMLControlVM : ObservableValidator, IDisposable
+{
+
+ private IAdsManager _adsManager;
+ private readonly string _variableName;
+
+ [ObservableProperty] private string? sTitle;
+
+ [ObservableProperty] private string? sCurrentMode;
+
+ [ObservableProperty] private string? sCurrentState;
+
+ [ObservableProperty] private HMIControlButtonVM? prodModeButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? manualModeButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? clearButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? resetButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? startButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? abortButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? holdButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? stopButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? suspendButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? unholdButtonVm;
+ [ObservableProperty] private HMIControlButtonVM? unsuspendButtonVm;
+
+ [ObservableProperty] private bool canUserInteract;
+
+ public PackMLControlVM()
+ {
+ SCurrentMode = "Modus: ";
+ SCurrentState = "Aktueller Zustand: ";
+ STitle = "Betriebsart";
+ ProdModeButtonVm = new();
+ ManualModeButtonVm = new();
+ ClearButtonVm= new();
+ ResetButtonVm= new();
+ StartButtonVm = new();
+ AbortButtonVm = new();
+ HoldButtonVm = new();
+ StopButtonVm = new();
+ SuspendButtonVm = new();
+ UnholdButtonVm = new();
+ UnsuspendButtonVm = new();
+
+ var currentUser = Users.getCurrentUser();
+ canUserInteract = currentUser.UserLevel > 50;
+ }
+
+ public PackMLControlVM(IAdsManager adsManager, string variableName)
+ {
+
+ _adsManager = adsManager;
+ _variableName = variableName;
+ STitle = "Betriebsart";
+
+ SCurrentMode = "Modus: ";
+ SCurrentState = "Aktueller Zustand: ";
+
+ ProdModeButtonVm = new(_adsManager, _variableName + ".stBtnProdMode");
+ ManualModeButtonVm = new(_adsManager, _variableName + ".stBtnManualMode");
+ ClearButtonVm = new(_adsManager, _variableName + ".stBtnClear");
+ ResetButtonVm = new(_adsManager, _variableName + ".stBtnReset");
+ StartButtonVm = new(_adsManager, _variableName + ".stBtnStart");
+ AbortButtonVm = new(_adsManager, _variableName + ".stBtnAbort");
+ HoldButtonVm = new(_adsManager, _variableName + ".stBtnHold");
+ StopButtonVm = new(_adsManager, _variableName + ".stBtnStop");
+ SuspendButtonVm = new(_adsManager, _variableName + ".stBtnSuspend");
+ UnholdButtonVm = new(_adsManager, _variableName + ".stBtnUnhold");
+ UnsuspendButtonVm = new(_adsManager, _variableName + ".stBtnUnsuspend");
+
+ _adsManager.Register(_variableName + ".eCurrentState", StateChanged);
+ _adsManager.Register(_variableName + ".eCurrentMode", ModeChanged);
+
+ var currentUser = Users.getCurrentUser();
+ canUserInteract = currentUser.UserLevel > 50;
+ }
+
+ private void StateChanged(object? sender, ValueChangedEventArgs e)
+ {
+ var state = (int)e.Value;
+ var curState = "Aktueller Status: ";
+ switch (state)
+ {
+ case 0:
+ curState += "Undefined";
+ break;
+ case 1:
+ curState += "Clearing";
+ break;
+ case 2:
+ curState += "Stopped";
+ break;
+ case 3:
+ curState += "Starting";
+ break;
+ case 4:
+ curState += "Idle";
+ break;
+ case 5:
+ curState += "Suspended";
+ break;
+ case 6:
+ curState += "Execute";
+ break;
+ case 7:
+ curState += "Stopping";
+ break;
+ case 8:
+ curState += "Aborting";
+ break;
+ case 9:
+ curState += "Aborted";
+ break;
+ case 10:
+ curState += "Holding";
+ break;
+ case 11:
+ curState += "Held";
+ break;
+ case 12:
+ curState += "Unholding";
+ break;
+ case 13:
+ curState += "Suspending";
+ break;
+ case 14:
+ curState += "Unsuspending";
+ break;
+ case 15:
+ curState += "Resetting";
+ break;
+ case 16:
+ curState += "Completing";
+ break;
+ case 17:
+ curState += "Completed";
+ break;
+ default:
+ curState += "Undefined";
+ break;
+ }
+ SCurrentState = curState;
+ }
+
+ private void ModeChanged(object? sender, ValueChangedEventArgs e)
+ {
+ var curMode = "Aktueller Modus: ";
+ var mode = (int)e.Value;
+
+ switch (mode)
+ {
+ case 0:
+ curMode += "Invalid";
+ break;
+ case 1:
+ curMode += "Production";
+ break;
+ case 2:
+ curMode += "Maintenance";
+ break;
+ case 3:
+ curMode += "Manual";
+ break;
+ case 4:
+ curMode += "change_over";
+ break;
+ case 5:
+ curMode += "clean";
+ break;
+ case 6:
+ curMode += "set up";
+ break;
+ case 7:
+ curMode += "empty out";
+ break;
+ default:
+ curMode += "Invalid";
+ break;
+
+ }
+
+ SCurrentMode = curMode;
+
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+
+}
diff --git a/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml b/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml
index 398ce7f..c83aabb 100644
--- a/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml
+++ b/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml
@@ -6,27 +6,20 @@
xmlns:local="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=local:ParamControlFloatVm, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
+ d:DesignWidth="600"
+ d:DesignHeight="120"
Width="Auto"
Height="Auto">
-
-
-
-
-
-
+
-
-
+
+
-
-
+
+
diff --git a/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml.cs b/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml.cs
index 8d404ec..6730e15 100644
--- a/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml.cs
+++ b/uniper_hmi/UniperHMI/Common/ParamControlFloat.xaml.cs
@@ -2,31 +2,30 @@
using System.Windows.Controls;
using System.Windows.Input;
-namespace Common
+namespace Common;
+
+///
+/// Interaktionslogik für AnalogValue.xaml
+///
+public partial class ParamControlFloat : UserControl
{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class ParamControlFloat : UserControl
- {
- public bool IsReadonly { get; set; }
+ public bool IsReadonly { get; set; }
- public ParamControlFloat()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+ public ParamControlFloat()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
+ private void NumberValidation(object sender, TextCompositionEventArgs e)
+ {
+ Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
+ e.Handled = regex.IsMatch(e.Text);
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml b/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml
index 13250fa..b6bc900 100644
--- a/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml
+++ b/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml
@@ -6,28 +6,21 @@
xmlns:common="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=common:ParamControlIntVm, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
+ d:DesignWidth="600"
+ d:DesignHeight="120"
Width="Auto"
Height="Auto">
-
-
-
-
-
-
+
-
-
+
+
-
-
-
+
+
-
+
+
diff --git a/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml.cs b/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml.cs
index 082170e..7bc4d4e 100644
--- a/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml.cs
+++ b/uniper_hmi/UniperHMI/Common/ParamControlInt.xaml.cs
@@ -2,31 +2,30 @@
using System.Windows.Controls;
using System.Windows.Input;
-namespace Common
+namespace Common;
+
+///
+/// Interaktionslogik für AnalogValue.xaml
+///
+public partial class ParamControlInt : UserControl
{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class ParamControlInt : UserControl
- {
- public bool IsReadonly { get; set; }
+ public bool IsReadonly { get; set; }
- public ParamControlInt()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+ public ParamControlInt()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
+ private void NumberValidation(object sender, TextCompositionEventArgs e)
+ {
+ Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
+ e.Handled = regex.IsMatch(e.Text);
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/User.cs b/uniper_hmi/UniperHMI/Common/User.cs
new file mode 100644
index 0000000..e5adb0a
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/User.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace InfineonHMI.Common;
+
+public static class Users
+{
+
+ private static User CurrentUser { get; set; }
+ public static ObservableCollection UsersCollection { get; set; }
+
+ public static void setCurrentUser(User u)
+ {
+ CurrentUser = new User(u);
+ }
+
+ public static User getCurrentUser()
+ {
+ if (CurrentUser == null)
+ CurrentUser = new User("undefined", "undef", 0);
+
+ return CurrentUser;
+ }
+}
+public class User
+{
+ public string? UserName { get; set; }
+
+ public string PasswordHash { get; set; }
+
+ public int UserLevel { get; set; }
+
+
+ public User()
+ {
+ }
+
+ public User(User u)
+ {
+ UserName = u.UserName;
+ PasswordHash = u.PasswordHash;
+ UserLevel = u.UserLevel;
+ }
+
+ public User(string name, string hash, int level)
+ {
+ UserName = name;
+ PasswordHash = hash;
+ UserLevel = level;
+ }
+
+
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/UserManagementWindow.xaml b/uniper_hmi/UniperHMI/Common/UserManagementWindow.xaml
new file mode 100644
index 0000000..590fbad
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/UserManagementWindow.xaml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Common/UserManagementWindow.xaml.cs b/uniper_hmi/UniperHMI/Common/UserManagementWindow.xaml.cs
new file mode 100644
index 0000000..c67ab89
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/UserManagementWindow.xaml.cs
@@ -0,0 +1,17 @@
+using System.Windows;
+
+namespace InfineonHMI.Common;
+
+///
+/// Login or change user dialog.
+///
+public partial class UserManagementWindow
+{
+ public UserManagementWindow()
+ {
+ InitializeComponent();
+ // Center dialog to MainWindow
+ Owner = Application.Current.MainWindow;
+ WindowStartupLocation = WindowStartupLocation.CenterOwner;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Common/UserManagementWindowVm.cs b/uniper_hmi/UniperHMI/Common/UserManagementWindowVm.cs
new file mode 100644
index 0000000..73f93f6
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/UserManagementWindowVm.cs
@@ -0,0 +1,213 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using Heisig.HMI.AdsManager;
+using HMIToolkit;
+using InfineonHMI.Common;
+using MahApps.Metro.Controls;
+using Microsoft.Win32;
+using System.Collections.ObjectModel;
+using System.ComponentModel.DataAnnotations;
+using System.Drawing.Text;
+using System.Security;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using TwinCAT.TypeSystem;
+
+namespace Common;
+
+public sealed partial class UserManagementWindowVm : ObservableValidator
+{
+
+ private IAdsManager _adsManager;
+ private readonly string _variableName;
+
+ [ObservableProperty] private string? selectedUsername;
+
+ [ObservableProperty] private string newUser;
+
+ [ObservableProperty] private ObservableCollection? savedUsers;
+
+ private ObservableCollection users;
+
+ private UserManagementWindow dlg = new UserManagementWindow();
+
+ private string selectedUserPassword;
+
+ private string filePath = "C:\\ProgramData\\InfineonHMI_UserData\\Userdata.xml";
+
+ private string selectedUserPasswordWdh;
+ public User CurrentUser { get; set; }
+ public string SelectedUserPassword
+ {
+ get { return selectedUserPassword; }
+ set
+ {
+ SetProperty(ref selectedUserPassword, value);
+ IsCreateCommandEnabled = SelectedUserPasswordWdh.Equals(value) && !string.IsNullOrEmpty(value)&& CurrentUser.UserLevel>0;
+ }
+ }
+
+ public string? SelectedUserPasswordWdh
+ {
+ get { return selectedUserPasswordWdh; }
+ set
+ {
+ SetProperty(ref selectedUserPasswordWdh, value);
+ IsCreateCommandEnabled = SelectedUserPassword.Equals(value) && !string.IsNullOrEmpty(value) && CurrentUser.UserLevel > 0;
+ }
+ }
+
+ [ObservableProperty] private bool isCreateCommandEnabled;
+
+
+ public UserManagementWindowVm()
+ {
+ IsCreateCommandEnabled = false;
+ CurrentUser = new("default", "default", 0);
+ users = L4ItXmlSerializer.DeSerializeObject>(filePath);
+ savedUsers = new ObservableCollection();
+ foreach (var user in users)
+ {
+ if (user.UserName != null)
+ savedUsers.Add(user.UserName);
+ }
+
+ selectedUserPassword = "";
+ selectedUserPasswordWdh = "";
+ selectedUsername = "";
+ SelectedUserPasswordWdh = "";
+ SelectedUserPassword = "";
+ SelectedUsername = "";
+ }
+
+ public UserManagementWindowVm(User curUser)
+ {
+ IsCreateCommandEnabled = true;
+ if (curUser != null)
+ {
+ CurrentUser = curUser;
+ }
+ else
+ {
+ CurrentUser = new User("unknown", "default", 100);
+ }
+ users = L4ItXmlSerializer.DeSerializeObject>(filePath);
+ savedUsers = new ObservableCollection();
+ if (users == null)
+ {
+ users = new ObservableCollection();
+ users.Add(new User("default", "ssW+1nwLrdWTKi1tkE/pfQ==", 100));
+ }
+
+
+ foreach (var user in users)
+ {
+ if(user.UserName != null)
+ savedUsers.Add(user.UserName);
+ }
+
+ selectedUserPassword = "";
+ selectedUserPasswordWdh = "";
+ selectedUsername = "";
+ SelectedUserPasswordWdh = "";
+ SelectedUserPassword = "";
+ SelectedUsername = "";
+
+ }
+
+ public User GetCurrentUserLevel()
+ {
+ dlg.DataContext = this;
+
+ dlg.ShowDialog();
+
+ return CurrentUser;
+ }
+
+ [RelayCommand]
+ private void Login()
+ {
+
+ User userInFile = new User("default", "default", 0);
+ bool userFound = false;
+ foreach (var user in users)
+ {
+ if (user.UserName.Equals(SelectedUsername))
+ {
+ userInFile = user;
+ userFound = true;
+ break;
+ }
+ }
+
+ if (userFound && CheckPassword(userInFile))
+ {
+ CurrentUser = userInFile;
+ }
+
+ dlg.Close();
+
+ }
+
+ [RelayCommand]
+ private void Logoff()
+ {
+ CurrentUser = new User("default", "default", 0);
+ dlg.Close();
+ }
+
+ [RelayCommand]
+ private void CreateUser()
+ {
+ if(!SelectedUserPassword.Equals(SelectedUserPasswordWdh))
+ return;
+
+ if (users == null)
+ users = new ();
+ var u = new User
+ {
+ UserName = NewUser,
+ PasswordHash = L4ItXmlSerializer.Encrypt(SelectedUserPassword),
+ UserLevel = 100,
+ };
+
+ users.Add(new User(u));
+ SavedUsers.Add(NewUser);
+
+ SelectedUserPassword = "";
+ SelectedUserPasswordWdh = "";
+
+ L4ItXmlSerializer.SerializeObject(users, filePath);
+
+ }
+
+ [RelayCommand]
+ private void DeleteUser()
+ {
+ if (SelectedUsername.Equals("default"))
+ return;
+
+ users.Remove(users.First(user => user.UserName.Equals(SelectedUsername)));
+
+ SavedUsers = new ObservableCollection();
+ foreach (var user in users)
+ {
+ SavedUsers.Add(user.UserName);
+ }
+
+ L4ItXmlSerializer.SerializeObject(users, filePath);
+
+ }
+
+ private bool CheckPassword(User user)
+ {
+ var hashcode = L4ItXmlSerializer.Decrypt(user.PasswordHash);
+ if (hashcode.Equals(SelectedUserPassword))
+ return true;
+
+ return false;
+ }
+
+
+}
diff --git a/uniper_hmi/UniperHMI/Common/WorkingmodeToColorConverter.cs b/uniper_hmi/UniperHMI/Common/WorkingmodeToColorConverter.cs
new file mode 100644
index 0000000..6681209
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Common/WorkingmodeToColorConverter.cs
@@ -0,0 +1,34 @@
+using System.Diagnostics.Eventing.Reader;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Common;
+
+class WorkingmodeToColorConverter : IValueConverter
+{
+ public Object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+
+ if (targetType != typeof(System.Windows.Media.Brush))
+ throw new InvalidOperationException("The target must be a brush");
+
+
+ #pragma warning disable CS8604 // Mögliches Nullverweisargument.
+ var selected = (bool)value;
+ #pragma warning restore CS8604 // Mögliches Nullverweisargument.
+
+ if (selected)
+ {
+ return System.Windows.Media.Brushes.LightSeaGreen;
+ }
+ else
+ { return DependencyProperty.UnsetValue;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return DependencyProperty.UnsetValue;
+ }
+}
diff --git a/uniper_hmi/UniperHMI/DateTimeToEventTimeConverter.cs b/uniper_hmi/UniperHMI/DateTimeToEventTimeConverter.cs
index e61a166..fca1741 100644
--- a/uniper_hmi/UniperHMI/DateTimeToEventTimeConverter.cs
+++ b/uniper_hmi/UniperHMI/DateTimeToEventTimeConverter.cs
@@ -2,32 +2,31 @@
using System.Windows;
using System.Windows.Data;
-namespace InfineonHMI
-{
- public class DateTimeToEventTimeConverter : IValueConverter
- {
- // 599264352000000000 ticks is a date used by beckhoff for events that didnt happen up to this point
- public const long NoTime = 599264352000000000;
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is DateTime dt)
- {
-
- if (dt.Ticks == NoTime)
- return "";
- else
- {
- CultureInfo cultureInfo = CultureInfo.CurrentCulture;
- return dt.ToString("G", cultureInfo);
- }
- }
- else
- throw new InvalidOperationException("Target must be of type DateTime");
- }
+namespace InfineonHMI;
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return DependencyProperty.UnsetValue;
- }
- }
-}
+public class DateTimeToEventTimeConverter : IValueConverter
+{
+ // 599264352000000000 ticks is a date used by beckhoff for events that didnt happen up to this point
+ public const long NoTime = 599264352000000000;
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is DateTime dt)
+ {
+
+ if (dt.Ticks == NoTime)
+ return "";
+ else
+ {
+ CultureInfo cultureInfo = CultureInfo.CurrentCulture;
+ return dt.ToString("G", cultureInfo);
+ }
+ }
+ else
+ throw new InvalidOperationException("Target must be of type DateTime");
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return DependencyProperty.UnsetValue;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs
index a91ea3e..84e92e2 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs
@@ -1,15 +1,14 @@
using System.Windows;
-namespace InfineonHMI
+namespace InfineonHMI;
+
+///
+/// Interaktionslogik für BinaryValveWindow.xaml
+///
+public partial class BinaryValveWindow : Window
{
- ///
- /// Interaktionslogik für BinaryValveWindow.xaml
- ///
- public partial class BinaryValveWindow : Window
- {
- public BinaryValveWindow()
- {
- InitializeComponent();
- }
- }
-}
+ public BinaryValveWindow()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs
index d05d95d..4565824 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs
@@ -1,23 +1,22 @@
using System.Windows.Controls;
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für AnalogMotorControl.xaml
- ///
- public partial class AnalogMotorControl : UserControl
- {
- public AnalogMotorControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace HMIToolkit;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AnalogMotorControl.xaml
+///
+public partial class AnalogMotorControl : UserControl
+{
+ public AnalogMotorControl()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs
index 34ee644..2dff844 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs
@@ -2,82 +2,81 @@
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public sealed partial class AnalogMotorControlVM : ObservableObject
{
- public sealed partial class AnalogMotorControlVM : ObservableObject
- {
- [ObservableProperty]
- private string sName = "No Name";
+ [ObservableProperty]
+ private string sName = "No Name";
- public HMIControlButtonVM? AutomaticButton { get; private set; }
- public HMIControlButtonVM? ManualButton { get; private set; }
- public HMIControlButtonVM StartButton { get; private set; }
- public HMIControlButtonVM StopButton { get; private set; }
- public IntlkControlVM? Interlocks { get; private set; }
- public AnalogValueVM? Setpoint { get; private set; }
- public AnalogValueVM? ProcessValue { get; private set; }
+ public HMIControlButtonVM? AutomaticButton { get; private set; }
+ public HMIControlButtonVM? ManualButton { get; private set; }
+ public HMIControlButtonVM StartButton { get; private set; }
+ public HMIControlButtonVM StopButton { get; private set; }
+ public IntlkControlVM? Interlocks { get; private set; }
+ public AnalogValueVM? Setpoint { get; private set; }
+ public AnalogValueVM? ProcessValue { get; private set; }
- private readonly string? _variableName;
+ private readonly string? _variableName;
- private IAdsManager? _adsManager;
+ private IAdsManager? _adsManager;
- public AnalogMotorControlVM()
- {
- AutomaticButton = new HMIControlButtonVM();
- ManualButton = new HMIControlButtonVM();
- StartButton = new HMIControlButtonVM();
- StopButton = new HMIControlButtonVM();
- Interlocks = new IntlkControlVM();
- Setpoint = new AnalogValueVM();
- ProcessValue = new AnalogValueVM();
- }
+ public AnalogMotorControlVM()
+ {
+ AutomaticButton = new HMIControlButtonVM();
+ ManualButton = new HMIControlButtonVM();
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ Interlocks = new IntlkControlVM();
+ Setpoint = new AnalogValueVM();
+ ProcessValue = new AnalogValueVM();
+ }
- public AnalogMotorControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
- AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
- ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
- StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartButton");
- StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopButton");
- Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
- Setpoint = new AnalogValueVM(_adsManager, _variableName + ".stSetpoint", false);
- ProcessValue = new AnalogValueVM(_adsManager, _variableName + ".stProcessValue", true);
+ public AnalogMotorControlVM(IAdsManager adsManager, string variableName)
+ {
+ _adsManager = adsManager;
+ _variableName = variableName;
+ AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
+ ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
+ StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartButton");
+ StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopButton");
+ Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
+ Setpoint = new AnalogValueVM(_adsManager, _variableName + ".stSetpoint", false);
+ ProcessValue = new AnalogValueVM(_adsManager, _variableName + ".stProcessValue", true);
- _adsManager.Register(_variableName + ".sName", NameChanged);
- }
+ _adsManager.Register(_variableName + ".sName", NameChanged);
+ }
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager = null;
+ public void Dispose()
+ {
+ _adsManager?.Deregister(_variableName + ".sName", NameChanged);
+ _adsManager = null;
- AutomaticButton?.Dispose();
- AutomaticButton = null;
+ AutomaticButton?.Dispose();
+ AutomaticButton = null;
- ManualButton?.Dispose();
- ManualButton = null;
+ ManualButton?.Dispose();
+ ManualButton = null;
- StartButton?.Dispose();
- StartButton = null;
+ StartButton?.Dispose();
+ StartButton = null;
- StopButton?.Dispose();
- StopButton = null;
+ StopButton?.Dispose();
+ StopButton = null;
- Interlocks?.Dispose();
- Interlocks = null;
+ Interlocks?.Dispose();
+ Interlocks = null;
- Setpoint?.Dispose();
- Setpoint = null;
+ Setpoint?.Dispose();
+ Setpoint = null;
- ProcessValue?.Dispose();
- ProcessValue = null;
- }
+ ProcessValue?.Dispose();
+ ProcessValue = null;
+ }
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- SName = (string)e.Value;
- }
- }
-}
+ private void NameChanged(object? sender, ValueChangedEventArgs e)
+ {
+ SName = (string)e.Value;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs
index ec67e9b..d14af15 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs
@@ -2,32 +2,31 @@
using System.Globalization;
using System.Windows.Controls;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public sealed partial class AnalogRangeValidator : ValidationRule
{
- public sealed partial class AnalogRangeValidator : ValidationRule
- {
- public float Min { get; set; }
+ public float Min { get; set; }
- public float Max { get; set; }
+ public float Max { get; set; }
- public override ValidationResult Validate(object value, CultureInfo cultureInfo)
- {
- float analogValue = 0;
+ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
+ {
+ float analogValue = 0;
- try
- {
- if (((string)value).Length > 0)
- analogValue = float.Parse((string)value);
- }
- catch (Exception e)
- {
- return new ValidationResult(false, $"Illegal characters or {e.Message}");
- }
+ try
+ {
+ if (((string)value).Length > 0)
+ analogValue = float.Parse((string)value);
+ }
+ catch (Exception e)
+ {
+ return new ValidationResult(false, $"Illegal characters or {e.Message}");
+ }
- if ((analogValue < Min) || (analogValue > Max))
- return new ValidationResult(false, $"Please enter a value in the range: {Min}-{Max}.");
+ if ((analogValue < Min) || (analogValue > Max))
+ return new ValidationResult(false, $"Please enter a value in the range: {Min}-{Max}.");
- return ValidationResult.ValidResult;
- }
- }
-}
+ return ValidationResult.ValidResult;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs
index 6170468..4588b97 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs
@@ -2,31 +2,30 @@
using System.Windows.Controls;
using System.Windows.Input;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+///
+/// Interaktionslogik für AnalogValue.xaml
+///
+public partial class AnalogValue : UserControl
{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class AnalogValue : UserControl
- {
- public bool IsReadonly { get; set; }
+ public bool IsReadonly { get; set; }
- public AnalogValue()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+ public AnalogValue()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
+ private void NumberValidation(object sender, TextCompositionEventArgs e)
+ {
+ Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
+ e.Handled = regex.IsMatch(e.Text);
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs
index 5d7d552..a7adcea 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs
@@ -13,23 +13,22 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für AnalogValveControl.xaml
- ///
- public partial class AnalogValveControl : UserControl
- {
- public AnalogValveControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace HMIToolkit;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AnalogValveControl.xaml
+///
+public partial class AnalogValveControl : UserControl
+{
+ public AnalogValveControl()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs
index bdb66c2..e384783 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs
@@ -2,82 +2,81 @@
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public sealed partial class AnalogValveControlVM : ObservableObject
{
- public sealed partial class AnalogValveControlVM : ObservableObject
- {
- [ObservableProperty]
- private string sName = "No Name";
+ [ObservableProperty]
+ private string sName = "No Name";
- public HMIControlButtonVM? AutomaticButton { get; private set; }
- public HMIControlButtonVM? ManualButton { get; private set; }
- public HMIControlButtonVM? OpenButton { get; private set; }
- public HMIControlButtonVM? CloseButton { get; private set; }
- public IntlkControlVM? Interlocks { get; private set; }
- public AnalogValueVM? Setpoint { get; private set; }
- public AnalogValueVM? ProcessValue { get; private set; }
+ public HMIControlButtonVM? AutomaticButton { get; private set; }
+ public HMIControlButtonVM? ManualButton { get; private set; }
+ public HMIControlButtonVM? OpenButton { get; private set; }
+ public HMIControlButtonVM? CloseButton { get; private set; }
+ public IntlkControlVM? Interlocks { get; private set; }
+ public AnalogValueVM? Setpoint { get; private set; }
+ public AnalogValueVM? ProcessValue { get; private set; }
- private readonly string? _variableName;
+ private readonly string? _variableName;
- private IAdsManager? _adsManager;
+ private IAdsManager? _adsManager;
- public AnalogValveControlVM()
- {
- AutomaticButton = new HMIControlButtonVM();
- ManualButton = new HMIControlButtonVM();
- OpenButton = new HMIControlButtonVM();
- CloseButton = new HMIControlButtonVM();
- Interlocks = new IntlkControlVM();
- Setpoint = new AnalogValueVM();
- ProcessValue = new AnalogValueVM();
- }
+ public AnalogValveControlVM()
+ {
+ AutomaticButton = new HMIControlButtonVM();
+ ManualButton = new HMIControlButtonVM();
+ OpenButton = new HMIControlButtonVM();
+ CloseButton = new HMIControlButtonVM();
+ Interlocks = new IntlkControlVM();
+ Setpoint = new AnalogValueVM();
+ ProcessValue = new AnalogValueVM();
+ }
- public AnalogValveControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
- AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
- ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
- OpenButton = new HMIControlButtonVM(_adsManager, _variableName + ".stOpenButton");
- CloseButton = new HMIControlButtonVM(_adsManager, _variableName + ".stCloseButton");
- Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
- Setpoint = new AnalogValueVM(_adsManager, _variableName + ".stSetpoint", false);
- ProcessValue = new AnalogValueVM(_adsManager, _variableName + ".stProcessValue", true);
+ public AnalogValveControlVM(IAdsManager adsManager, string variableName)
+ {
+ _adsManager = adsManager;
+ _variableName = variableName;
+ AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
+ ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
+ OpenButton = new HMIControlButtonVM(_adsManager, _variableName + ".stOpenButton");
+ CloseButton = new HMIControlButtonVM(_adsManager, _variableName + ".stCloseButton");
+ Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
+ Setpoint = new AnalogValueVM(_adsManager, _variableName + ".stSetpoint", false);
+ ProcessValue = new AnalogValueVM(_adsManager, _variableName + ".stProcessValue", true);
- _adsManager.Register(_variableName + ".sName", NameChanged);
- }
+ _adsManager.Register(_variableName + ".sName", NameChanged);
+ }
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager = null;
+ public void Dispose()
+ {
+ _adsManager?.Deregister(_variableName + ".sName", NameChanged);
+ _adsManager = null;
- AutomaticButton?.Dispose();
- AutomaticButton = null;
+ AutomaticButton?.Dispose();
+ AutomaticButton = null;
- ManualButton?.Dispose();
- ManualButton = null;
+ ManualButton?.Dispose();
+ ManualButton = null;
- OpenButton?.Dispose();
- OpenButton = null;
+ OpenButton?.Dispose();
+ OpenButton = null;
- CloseButton?.Dispose();
- CloseButton = null;
+ CloseButton?.Dispose();
+ CloseButton = null;
- Interlocks?.Dispose();
- Interlocks = null;
+ Interlocks?.Dispose();
+ Interlocks = null;
- Setpoint?.Dispose();
- Setpoint = null;
+ Setpoint?.Dispose();
+ Setpoint = null;
- ProcessValue?.Dispose();
- ProcessValue = null;
- }
+ ProcessValue?.Dispose();
+ ProcessValue = null;
+ }
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- SName = (string)e.Value;
- }
- }
-}
+ private void NameChanged(object? sender, ValueChangedEventArgs e)
+ {
+ SName = (string)e.Value;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml
index 9e9a561..c4c5a02 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml
@@ -20,9 +20,9 @@
-
+
-
+
@@ -72,5 +72,6 @@
-
+
+
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs
index 8337f84..6101e49 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs
@@ -13,23 +13,22 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für BinaryValveControl.xaml
- ///
- public partial class BinaryValveControl : UserControl
- {
- public BinaryValveControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace HMIToolkit;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für BinaryValveControl.xaml
+///
+public partial class BinaryValveControl : UserControl
+{
+ public BinaryValveControl()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs
index b99ac5a..afdd4f9 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs
@@ -4,67 +4,66 @@ using Heisig.HMI.AdsManager;
// {Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.OpenButton}
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public sealed partial class BinaryValveControlVM : ObservableObject, IDisposable
{
- public sealed partial class BinaryValveControlVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private string sName = "No Name";
+ [ObservableProperty]
+ private string sName = "No Name";
- public HMIControlButtonVM? AutomaticButton { get; private set; }
- public HMIControlButtonVM? ManualButton { get; private set; }
- public HMIControlButtonVM OpenButton { get; private set; }
- public HMIControlButtonVM CloseButton { get; private set; }
- public IntlkControlVM? Interlocks { get; private set; }
+ public HMIControlButtonVM? AutomaticButton { get; private set; }
+ public HMIControlButtonVM? ManualButton { get; private set; }
+ public HMIControlButtonVM OpenButton { get; private set; }
+ public HMIControlButtonVM CloseButton { get; private set; }
+ public IntlkControlVM? Interlocks { get; private set; }
- private readonly string? _variableName;
+ private readonly string? _variableName;
- private IAdsManager? _adsManager;
+ private IAdsManager? _adsManager;
- public BinaryValveControlVM()
- {
- AutomaticButton = new HMIControlButtonVM();
- ManualButton = new HMIControlButtonVM();
- OpenButton = new HMIControlButtonVM();
- CloseButton = new HMIControlButtonVM();
- Interlocks = new IntlkControlVM();
- }
+ public BinaryValveControlVM()
+ {
+ AutomaticButton = new HMIControlButtonVM();
+ ManualButton = new HMIControlButtonVM();
+ OpenButton = new HMIControlButtonVM();
+ CloseButton = new HMIControlButtonVM();
+ Interlocks = new IntlkControlVM();
+ }
- public BinaryValveControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
- AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
- ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
- OpenButton = new HMIControlButtonVM(_adsManager, _variableName + ".stOpenButton");
- CloseButton = new HMIControlButtonVM(_adsManager, _variableName + ".stCloseButton");
- Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
+ public BinaryValveControlVM(IAdsManager adsManager, string variableName)
+ {
+ _adsManager = adsManager;
+ _variableName = variableName;
+ AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
+ ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
+ OpenButton = new HMIControlButtonVM(_adsManager, _variableName + ".stOpenButton");
+ CloseButton = new HMIControlButtonVM(_adsManager, _variableName + ".stCloseButton");
+ Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
- _adsManager.Register(_variableName + ".sName", NameChanged);
- }
+ _adsManager.Register(_variableName + ".sName", NameChanged);
+ }
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager = null;
+ public void Dispose()
+ {
+ _adsManager?.Deregister(_variableName + ".sName", NameChanged);
+ _adsManager = null;
- AutomaticButton?.Dispose();
- AutomaticButton = null;
+ AutomaticButton?.Dispose();
+ AutomaticButton = null;
- ManualButton?.Dispose();
- ManualButton = null;
+ ManualButton?.Dispose();
+ ManualButton = null;
- OpenButton?.Dispose();
+ OpenButton?.Dispose();
- CloseButton?.Dispose();
+ CloseButton?.Dispose();
- Interlocks?.Dispose();
- Interlocks = null;
- }
+ Interlocks?.Dispose();
+ Interlocks = null;
+ }
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- SName = (string)e.Value;
- }
- }
-}
+ private void NameChanged(object? sender, ValueChangedEventArgs e)
+ {
+ SName = (string)e.Value;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs
index e99be2c..1400e70 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs
@@ -3,23 +3,22 @@ using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public class BoolToBrushConverter : IValueConverter
{
- public class BoolToBrushConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (targetType != typeof(Brush))
- throw new InvalidOperationException("The target must be a brush");
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (targetType != typeof(Brush))
+ throw new InvalidOperationException("The target must be a brush");
- bool temp = bool.Parse(value.ToString()!);
+ bool temp = bool.Parse(value.ToString()!);
- return (temp ? Brushes.DarkGreen : Brushes.DarkRed);
- }
+ return (temp ? Brushes.DarkGreen : Brushes.DarkRed);
+ }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return DependencyProperty.UnsetValue;
- }
- }
-}
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return DependencyProperty.UnsetValue;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs
index a06fb4a..cbaa527 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs
@@ -3,72 +3,71 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public sealed partial class HMIControlButtonVM : ObservableObject, IDisposable
{
- public sealed partial class HMIControlButtonVM : ObservableObject, IDisposable
- {
- private IAdsManager? _adsManager;
- private readonly string _variableName;
+ private IAdsManager? _adsManager;
+ private readonly string _variableName;
- // Action triggered when the button is about to be clicked
- public event EventHandler? ButtonClickedStarted;
+ // Action triggered when the button is about to be clicked
+ public event EventHandler? ButtonClickedStarted;
- // Action triggered when the button is done being clicked
- public event EventHandler? ButtonClickedEnded;
+ // Action triggered when the button is done being clicked
+ public event EventHandler? ButtonClickedEnded;
- // Event when button feedback changed
- public event EventHandler? FeedbackChanged;
+ // Event when button feedback changed
+ public event EventHandler? FeedbackChanged;
- // Event when release changed
- public event EventHandler? ReleaseChanged;
+ // Event when release changed
+ public event EventHandler? ReleaseChanged;
- [ObservableProperty]
- private bool xRelease;
+ [ObservableProperty]
+ private bool xRelease;
- // 0 = none, 1 = active, 2 = pending, 3 = waring, 4 = error
- [ObservableProperty]
- private short iFeedback;
+ // 0 = none, 1 = active, 2 = pending, 3 = waring, 4 = error
+ [ObservableProperty]
+ private short iFeedback;
- public HMIControlButtonVM()
- {
- _variableName = string.Empty;
- XRelease = false;
- IFeedback = 4;
- }
+ public HMIControlButtonVM()
+ {
+ _variableName = string.Empty;
+ XRelease = false;
+ IFeedback = 4;
+ }
- public HMIControlButtonVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
+ public HMIControlButtonVM(IAdsManager adsManager, string variableName)
+ {
+ _adsManager = adsManager;
+ _variableName = variableName;
- _adsManager.Register(_variableName + ".xRelease", XReleaseCahnged);
- _adsManager.Register(_variableName + ".iFeedback", IFeedbackChanged);
- }
+ _adsManager.Register(_variableName + ".xRelease", XReleaseCahnged);
+ _adsManager.Register(_variableName + ".iFeedback", IFeedbackChanged);
+ }
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".xRelease", XReleaseCahnged);
- _adsManager?.Deregister(_variableName + ".iFeedback", IFeedbackChanged);
- }
+ public void Dispose()
+ {
+ _adsManager?.Deregister(_variableName + ".xRelease", XReleaseCahnged);
+ _adsManager?.Deregister(_variableName + ".iFeedback", IFeedbackChanged);
+ }
- [RelayCommand]
- private void ButtonClicked()
- {
- ButtonClickedStarted?.Invoke(this, EventArgs.Empty);
- _adsManager?.WriteValue(_variableName + ".xRequest", true);
- ButtonClickedEnded?.Invoke(this, EventArgs.Empty);
- }
+ [RelayCommand]
+ private void ButtonClicked()
+ {
+ ButtonClickedStarted?.Invoke(this, EventArgs.Empty);
+ _adsManager?.WriteValue(_variableName + ".xRequest", true);
+ ButtonClickedEnded?.Invoke(this, EventArgs.Empty);
+ }
- private void XReleaseCahnged(object? sender, ValueChangedEventArgs e)
- {
- XRelease = (bool)e.Value;
- ReleaseChanged?.Invoke(this, EventArgs.Empty);
- }
+ private void XReleaseCahnged(object? sender, ValueChangedEventArgs e)
+ {
+ XRelease = (bool)e.Value;
+ ReleaseChanged?.Invoke(this, EventArgs.Empty);
+ }
- private void IFeedbackChanged(object? sender, ValueChangedEventArgs e)
- {
- IFeedback = (short)e.Value;
- FeedbackChanged?.Invoke(this, EventArgs.Empty);
- }
- }
-}
+ private void IFeedbackChanged(object? sender, ValueChangedEventArgs e)
+ {
+ IFeedback = (short)e.Value;
+ FeedbackChanged?.Invoke(this, EventArgs.Empty);
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs
index 6f4ae19..ab824f8 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs
@@ -13,23 +13,22 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für ProcessIntlkButtonControl.xaml
- ///
- public partial class IntlkButtonControl : UserControl
- {
- public IntlkButtonControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace HMIToolkit;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für ProcessIntlkButtonControl.xaml
+///
+public partial class IntlkButtonControl : UserControl
+{
+ public IntlkButtonControl()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs
index b331460..70c0818 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs
@@ -13,23 +13,22 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für IntlkDetails.xaml
- ///
- public partial class IntlkDetails : UserControl
- {
- public IntlkDetails()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace HMIToolkit;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für IntlkDetails.xaml
+///
+public partial class IntlkDetails : UserControl
+{
+ public IntlkDetails()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs
index 7f6b3aa..22b729f 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs
@@ -5,147 +5,146 @@ using System.Windows.Controls;
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+public sealed partial class IntlkDetailsVM : ObservableObject, IDisposable
{
- public sealed partial class IntlkDetailsVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private string interlockName;
+ [ObservableProperty]
+ private string interlockName;
- [ObservableProperty]
- private BitArray interlockStatus;
+ [ObservableProperty]
+ private BitArray interlockStatus;
- [ObservableProperty]
- private string[] interlockNames;
+ [ObservableProperty]
+ private string[] interlockNames;
- [ObservableProperty]
- private ListBoxItem[] listBoxItemsLeft;
+ [ObservableProperty]
+ private ListBoxItem[] listBoxItemsLeft;
- [ObservableProperty]
- private ListBoxItem[] listBoxItemsRight;
+ [ObservableProperty]
+ private ListBoxItem[] listBoxItemsRight;
- [ObservableProperty]
- private Visibility isVisible;
+ [ObservableProperty]
+ private Visibility isVisible;
- private readonly BoolToBrushConverter boolToBrushConverter = new();
+ private readonly BoolToBrushConverter boolToBrushConverter = new();
- private readonly int numIntlksLeftSide;
- private readonly int numIntlksRightSide;
+ private readonly int numIntlksLeftSide;
+ private readonly int numIntlksRightSide;
- private readonly string _variableNameStatus;
- private readonly string _variableNameNames;
+ private readonly string _variableNameStatus;
+ private readonly string _variableNameNames;
- private IAdsManager? _adsManager;
+ private IAdsManager? _adsManager;
- public IntlkDetailsVM()
- {
- interlockName = "Interlocks";
- interlockStatus = new BitArray(HMIConstants.NumInterlocks);
- interlockNames = new string[HMIConstants.NumInterlocks];
- Array.Fill(interlockNames, "Not used");
+ public IntlkDetailsVM()
+ {
+ interlockName = "Interlocks";
+ interlockStatus = new BitArray(HMIConstants.NumInterlocks);
+ interlockNames = new string[HMIConstants.NumInterlocks];
+ Array.Fill(interlockNames, "Not used");
- // Split all interlocks into two parts
- numIntlksLeftSide = (int)Math.Ceiling(HMIConstants.NumInterlocks * 0.5);
- numIntlksRightSide = HMIConstants.NumInterlocks - numIntlksLeftSide;
+ // Split all interlocks into two parts
+ numIntlksLeftSide = (int)Math.Ceiling(HMIConstants.NumInterlocks * 0.5);
+ numIntlksRightSide = HMIConstants.NumInterlocks - numIntlksLeftSide;
- listBoxItemsLeft = new ListBoxItem[numIntlksLeftSide];
- listBoxItemsRight = new ListBoxItem[numIntlksRightSide];
+ listBoxItemsLeft = new ListBoxItem[numIntlksLeftSide];
+ listBoxItemsRight = new ListBoxItem[numIntlksRightSide];
- _variableNameStatus = System.String.Empty;
- _variableNameNames = System.String.Empty;
+ _variableNameStatus = System.String.Empty;
+ _variableNameNames = System.String.Empty;
- // CreateContent();
- }
+ // CreateContent();
+ }
- public IntlkDetailsVM(IAdsManager adsManager, string variableNameStatus, string variableNameNames, string intlkName) : this()
- {
- interlockName = intlkName;
- _variableNameStatus = variableNameStatus;
- _variableNameNames = variableNameNames;
- _adsManager = adsManager;
+ public IntlkDetailsVM(IAdsManager adsManager, string variableNameStatus, string variableNameNames, string intlkName) : this()
+ {
+ interlockName = intlkName;
+ _variableNameStatus = variableNameStatus;
+ _variableNameNames = variableNameNames;
+ _adsManager = adsManager;
- interlockStatus = new BitArray(HMIConstants.NumInterlocks);
- interlockNames = new string[HMIConstants.NumInterlocks];
+ interlockStatus = new BitArray(HMIConstants.NumInterlocks);
+ interlockNames = new string[HMIConstants.NumInterlocks];
- _adsManager.Register(_variableNameStatus, InterlockStatusChanged);
- _adsManager.Register(_variableNameNames, InterlockNamesChanged);
- }
+ _adsManager.Register(_variableNameStatus, InterlockStatusChanged);
+ _adsManager.Register(_variableNameNames, InterlockNamesChanged);
+ }
- public void Dispose()
- {
- _adsManager?.Deregister(_variableNameStatus, InterlockStatusChanged);
- _adsManager?.Deregister(_variableNameNames, InterlockNamesChanged);
+ public void Dispose()
+ {
+ _adsManager?.Deregister(_variableNameStatus, InterlockStatusChanged);
+ _adsManager?.Deregister(_variableNameNames, InterlockNamesChanged);
- _adsManager = null;
- }
+ _adsManager = null;
+ }
- /*private void CreateContent()
- {
- // Create left side
- for (int i = 0; i < HMIConstants.NumInterlocks; i++)
- {
- // Create the stack panel
- StackPanel stackPanel = new StackPanel
- {
- Orientation = Orientation.Horizontal
- };
+ /*private void CreateContent()
+ {
+ // Create left side
+ for (int i = 0; i < HMIConstants.NumInterlocks; i++)
+ {
+ // Create the stack panel
+ StackPanel stackPanel = new StackPanel
+ {
+ Orientation = Orientation.Horizontal
+ };
- // Create the box
- //
- Rectangle rectangle = new Rectangle
- {
- Width = 10,
- Height = 10,
- RadiusX = 2,
- RadiusY = 2
- };
+ // Create the box
+ //
+ Rectangle rectangle = new Rectangle
+ {
+ Width = 10,
+ Height = 10,
+ RadiusX = 2,
+ RadiusY = 2
+ };
- // Create binding
- Binding binding = new()
- {
- Source = this,
- Path = new PropertyPath("InterlockStatus[" + i + "]"),
- Converter = boolToBrushConverter,
- };
+ // Create binding
+ Binding binding = new()
+ {
+ Source = this,
+ Path = new PropertyPath("InterlockStatus[" + i + "]"),
+ Converter = boolToBrushConverter,
+ };
- // Set binding
- rectangle.SetBinding(Rectangle.FillProperty, binding);
+ // Set binding
+ rectangle.SetBinding(Rectangle.FillProperty, binding);
- // Create label
- Label label = new();
- binding = new()
- {
- Source = this,
- Path = new PropertyPath("InterlockNames[" + i + "]")
- };
- label.SetBinding(Label.ContentProperty, binding);
+ // Create label
+ Label label = new();
+ binding = new()
+ {
+ Source = this,
+ Path = new PropertyPath("InterlockNames[" + i + "]")
+ };
+ label.SetBinding(Label.ContentProperty, binding);
- // Add items to stack panel
- stackPanel.Children.Add(rectangle);
- stackPanel.Children.Add(label);
+ // Add items to stack panel
+ stackPanel.Children.Add(rectangle);
+ stackPanel.Children.Add(label);
- // Add stack panel to listbox items
- ListBoxItem tempListBoxItem = new()
- {
- Content = stackPanel
- };
- if (i < numIntlksLeftSide)
- ListBoxItemsLeft[i] = tempListBoxItem;
- else
- ListBoxItemsRight[i - numIntlksLeftSide] = tempListBoxItem;
- }
+ // Add stack panel to listbox items
+ ListBoxItem tempListBoxItem = new()
+ {
+ Content = stackPanel
+ };
+ if (i < numIntlksLeftSide)
+ ListBoxItemsLeft[i] = tempListBoxItem;
+ else
+ ListBoxItemsRight[i - numIntlksLeftSide] = tempListBoxItem;
+ }
- }*/
+ }*/
- private void InterlockStatusChanged(object? sender, ValueChangedEventArgs e)
- {
- ushort temp = (ushort)e.Value;
- InterlockStatus = new BitArray(BitConverter.GetBytes(temp));
- }
+ private void InterlockStatusChanged(object? sender, ValueChangedEventArgs e)
+ {
+ ushort temp = (ushort)e.Value;
+ InterlockStatus = new BitArray(BitConverter.GetBytes(temp));
+ }
- private void InterlockNamesChanged(object? sender, ValueChangedEventArgs e)
- {
- InterlockNames = (string[])e.Value;
- }
- }
-}
+ private void InterlockNamesChanged(object? sender, ValueChangedEventArgs e)
+ {
+ InterlockNames = (string[])e.Value;
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs
index f1bb72d..71fd73c 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs
@@ -12,16 +12,15 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
-namespace HMIToolkit
+namespace HMIToolkit;
+
+///
+/// Interaktionslogik für IntlkDetailsWindow.xaml
+///
+public partial class IntlkDetailsWindow : Window
{
- ///
- /// Interaktionslogik für IntlkDetailsWindow.xaml
- ///
- public partial class IntlkDetailsWindow : Window
- {
- public IntlkDetailsWindow()
- {
- InitializeComponent();
- }
- }
-}
+ public IntlkDetailsWindow()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs
index 332eb81..5f0c395 100644
--- a/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs
+++ b/uniper_hmi/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs
@@ -1,218 +1,216 @@
using System.Runtime.InteropServices;
using System.Text;
-namespace HMIToolkit
-{
- // PLC - C#
- // --------
- // int - short
- // word - ushort
+namespace HMIToolkit;
+// PLC - C#
+// --------
+// int - short
+// word - ushort
- // Constants for interaction with data
- public static class HMIConstants
- {
- public const int StringLength = 81;
- public const int NumInterlocks = 16;
- }
+// Constants for interaction with data
+public static class HMIConstants
+{
+ public const int StringLength = 81;
+ public const int NumInterlocks = 16;
+}
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIAnalogValue
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIAnalogValue
+{
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
+ public string sName;
- // 1 = Ok, 2 = Error
- public short iStatus;
+ // 1 = Ok, 2 = Error
+ public short iStatus;
- public float rValue;
+ public float rValue;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sUnit;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
+ public string sUnit;
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xUsed;
+}
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIControlButton
- {
- [MarshalAs(UnmanagedType.I1)]
- public bool xRequest;
+// TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIControlButton
+{
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xRequest;
- [MarshalAs(UnmanagedType.I1)]
- public bool xRelease;
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xRelease;
- public short iFeedback;
- }
+ public short iFeedback;
+}
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIInterlock
- {
- public ushort wProcessINTLKStatus;
+// TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIInterlock
+{
+ public ushort wProcessINTLKStatus;
- public ushort wSafeyINTLKStatus;
+ public ushort wSafeyINTLKStatus;
- public ushort wProcessINTLKUsed;
+ public ushort wProcessINTLKUsed;
- public ushort wSafeyINTLKUsed;
+ public ushort wSafeyINTLKUsed;
- // 16 * String(80) = 81 bytes a 16 indexes
- // combined in one string because reading a two dimensional array is not possible
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = HMIConstants.StringLength * HMIConstants.NumInterlocks)]
- public byte[] asProcessINTLKName;
+ // 16 * String(80) = 81 bytes a 16 indexes
+ // combined in one string because reading a two dimensional array is not possible
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = HMIConstants.StringLength * HMIConstants.NumInterlocks)]
+ public byte[] asProcessINTLKName;
- // 16 * String(80) = 81 bytes a 16 indexes
- // combined in one string because reading a two dimensional array is not possible
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = HMIConstants.StringLength * HMIConstants.NumInterlocks)]
- public byte[] asSafetyINTLKName;
+ // 16 * String(80) = 81 bytes a 16 indexes
+ // combined in one string because reading a two dimensional array is not possible
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = HMIConstants.StringLength * HMIConstants.NumInterlocks)]
+ public byte[] asSafetyINTLKName;
- [MarshalAs(UnmanagedType.I1)]
- public bool xProcessINTLKOk;
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xProcessINTLKOk;
- [MarshalAs(UnmanagedType.I1)]
- public bool xSafetyINTLKOk;
- }
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xSafetyINTLKOk;
+}
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIValveData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
+// TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIValveData
+{
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
+ public string sName;
- public HMIControlButton stAutomaticButton;
+ public HMIControlButton stAutomaticButton;
- public HMIControlButton stManualButton;
+ public HMIControlButton stManualButton;
- public HMIControlButton stOpenButton;
+ public HMIControlButton stOpenButton;
- public HMIControlButton stCloseButton;
+ public HMIControlButton stCloseButton;
- // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
- public short iStatus;
+ // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
+ public short iStatus;
- // 1 = Automatic mode, 2 = Manual mode
- public short iCurrentMode;
+ // 1 = Automatic mode, 2 = Manual mode
+ public short iCurrentMode;
- public HMIInterlock stInterlock;
+ public HMIInterlock stInterlock;
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xUsed;
+}
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIAnalogValveData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIAnalogValveData
+{
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
+ public string sName;
- public HMIControlButton stAutomaticButton;
+ public HMIControlButton stAutomaticButton;
- public HMIControlButton stManualButton;
+ public HMIControlButton stManualButton;
- public HMIControlButton stOpenButton;
+ public HMIControlButton stOpenButton;
- public HMIControlButton stCloseButton;
+ public HMIControlButton stCloseButton;
- // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
- public short iStatus;
+ // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
+ public short iStatus;
- // 1 = Automatic mode, 2 = Manual mode
- public short iCurrentMode;
+ // 1 = Automatic mode, 2 = Manual mode
+ public short iCurrentMode;
- public HMIInterlock stInterlock;
+ public HMIInterlock stInterlock;
- HMIAnalogValue stSetpoint;
+ HMIAnalogValue stSetpoint;
- HMIAnalogValue stProcessValue;
+ HMIAnalogValue stProcessValue;
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xUsed;
+}
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIAnalogMotorData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
+// TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIAnalogMotorData
+{
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
+ public string sName;
- public HMIControlButton stAutomaticButton;
+ public HMIControlButton stAutomaticButton;
- public HMIControlButton stManualButton;
+ public HMIControlButton stManualButton;
- public HMIControlButton stStartButton;
+ public HMIControlButton stStartButton;
- public HMIControlButton stStopButton;
+ public HMIControlButton stStopButton;
- // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
- public short iStatus;
+ // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
+ public short iStatus;
- // 1 = Automatic mode, 2 = Manual mode
- public short iCurrentMode;
+ // 1 = Automatic mode, 2 = Manual mode
+ public short iCurrentMode;
- public HMIAnalogValue stSetpoint;
+ public HMIAnalogValue stSetpoint;
- public HMIAnalogValue stProcessValue;
+ public HMIAnalogValue stProcessValue;
- public HMIInterlock stInterlock;
+ public HMIInterlock stInterlock;
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xUsed;
+}
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIOrpSensorData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
+// TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
+[StructLayout(LayoutKind.Sequential, Pack = 0)]
+public struct HMIOrpSensorData
+{
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
+ public string sName;
- // 1 = Ok, 2 = Error
- public short iStatus;
+ // 1 = Ok, 2 = Error
+ public short iStatus;
- public float rValuePH;
+ public float rValuePH;
- public float rValueTemp;
+ public float rValueTemp;
- public float rValueORP;
+ public float rValueORP;
- public float rValueDLI;
+ public float rValueDLI;
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
+ [MarshalAs(UnmanagedType.I1)]
+ public bool xUsed;
+}
- static class HMIUtilities
- {
- // Converts the interlock byte array into a string array
- public static string[] GetInterlockStringArray(byte[] byteArray)
- {
- string[] temp = new string[HMIConstants.NumInterlocks];
- int size;
+static class HMIUtilities
+{
+ // Converts the interlock byte array into a string array
+ public static string[] GetInterlockStringArray(byte[] byteArray)
+ {
+ string[] temp = new string[HMIConstants.NumInterlocks];
+ int size;
- // Check if byteArray is of correct size
- if (byteArray.Length != (HMIConstants.StringLength * HMIConstants.NumInterlocks))
- return temp;
+ // Check if byteArray is of correct size
+ if (byteArray.Length != (HMIConstants.StringLength * HMIConstants.NumInterlocks))
+ return temp;
- for (int i = 0; i < HMIConstants.NumInterlocks; i++)
- {
- // Calculate length of string by finding the 0 terminator so the unused bytes get truncated
- size = Array.IndexOf(byteArray, (byte)0, i * HMIConstants.StringLength) - (i * HMIConstants.StringLength);
+ for (int i = 0; i < HMIConstants.NumInterlocks; i++)
+ {
+ // Calculate length of string by finding the 0 terminator so the unused bytes get truncated
+ size = Array.IndexOf(byteArray, (byte)0, i * HMIConstants.StringLength) - (i * HMIConstants.StringLength);
- // Check if we found a valid 0 terminator
- if (size >= 0)
- // Build string from byteArray with calculated size
- temp[i] = Encoding.ASCII.GetString(byteArray, i * HMIConstants.StringLength, size);
- else
- // No valid 0 string terminator was found so return an empty string
- temp[i] = "";
- }
+ // Check if we found a valid 0 terminator
+ if (size >= 0)
+ // Build string from byteArray with calculated size
+ temp[i] = Encoding.ASCII.GetString(byteArray, i * HMIConstants.StringLength, size);
+ else
+ // No valid 0 string terminator was found so return an empty string
+ temp[i] = "";
+ }
- return temp;
- }
- }
+ return temp;
+ }
}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/InfineonHMI.csproj b/uniper_hmi/UniperHMI/InfineonHMI.csproj
index b1d2dda..0c557a1 100644
--- a/uniper_hmi/UniperHMI/InfineonHMI.csproj
+++ b/uniper_hmi/UniperHMI/InfineonHMI.csproj
@@ -14,6 +14,8 @@
+
+
@@ -35,6 +37,8 @@
Always
+
+
diff --git a/uniper_hmi/UniperHMI/MainWindow.xaml b/uniper_hmi/UniperHMI/MainWindow.xaml
index 79b1fa6..9ae2ce6 100644
--- a/uniper_hmi/UniperHMI/MainWindow.xaml
+++ b/uniper_hmi/UniperHMI/MainWindow.xaml
@@ -4,22 +4,31 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
- xmlns:uniperHmi="clr-namespace:InfineonHMI"
+ xmlns:infineonHmi="clr-namespace:InfineonHMI"
mc:Ignorable="d"
x:Name="MainControlWindow"
- d:DataContext="{d:DesignInstance Type=uniperHmi:MainWindowVM}"
+ d:DataContext="{d:DesignInstance Type=infineonHmi:MainWindowVM}"
WindowStartupLocation="CenterScreen"
- Title="Infineon BiPolar" Height="2100" Width="3820" ResizeMode="NoResize">
-
+
+ Title="Infineon HMI"
+ Icon="Resources/Application.png"
+ Height="Auto"
+ Width="Auto"
+ ResizeMode="CanResizeWithGrip"
+ WindowState="Maximized"
+ WindowStyle="SingleBorderWindow">
+
-
+
-
+
+
+
@@ -82,21 +91,27 @@
-
-
+ >
+
+
+
+
+
+
+
-
diff --git a/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
index c1785df..01c26cf 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
@@ -1,22 +1,21 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class KukaRobotPage : Page
- {
- public KukaRobotPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace InfineonHMI;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AutomaticModePage.xaml
+///
+public partial class KukaRobotPage : Page
+{
+ public KukaRobotPage()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml
index 318316a..dc71b8e 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml
@@ -4,103 +4,125 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:uniperHmi="clr-namespace:InfineonHMI"
+ xmlns:common="clr-namespace:Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=uniperHmi:MachineOverviewPageVM, IsDesignTimeCreatable=True}"
Title="Production Overview">
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs
index fa8f63c..624af1c 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs
@@ -1,22 +1,22 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class MachineOverviewPage : Page
- {
- public MachineOverviewPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace InfineonHMI;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AutomaticModePage.xaml
+///
+public partial class MachineOverviewPage : Page
+{
+ public MachineOverviewPage()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml
index 574006c..39bb506 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml
@@ -20,19 +20,20 @@
-
-
-
+
+
+
-
+
-
+
+
@@ -41,5 +42,9 @@
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
index d5853dd..ced5722 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
@@ -1,22 +1,21 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class MediaCabinetPage : Page
- {
- public MediaCabinetPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace InfineonHMI;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AutomaticModePage.xaml
+///
+public partial class MediaCabinetPage : Page
+{
+ public MediaCabinetPage()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml
index 662da4b..507d2ee 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml
@@ -4,13 +4,15 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:InfineonHMI"
- xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="InfineonHMI.NIOStationPage"
+ xmlns:HMIToolkit="clr-namespace:HMIToolkit"
+ xmlns:common="clr-namespace:Common"
+ x:Class="InfineonHMI.NIOStationPage"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type local:NIOStationPageVM}}"
- d:DesignHeight="800" d:DesignWidth="1850"
+ d:DesignHeight="1554" d:DesignWidth="3390"
Title="NIOStationPage">
-
+
@@ -31,16 +33,16 @@
-
+
-
-
-
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
index 24b5fa1..fd9a541 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
@@ -1,22 +1,21 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class NIOStationPage : Page
- {
- public NIOStationPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace InfineonHMI;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AutomaticModePage.xaml
+///
+public partial class NIOStationPage : Page
+{
+ public NIOStationPage()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml
index f29a289..209a8c1 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml
@@ -8,80 +8,91 @@
d:DataContext="{d:DesignInstance Type=uniperHmi:ProductionOverviewPageVM, IsDesignTimeCreatable=True}"
Title="Production Overview">
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
-
-
-
diff --git a/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs
index 046c16d..2aec066 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs
@@ -1,22 +1,21 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class ProductionOverviewPage : Page
- {
- public ProductionOverviewPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
+namespace InfineonHMI;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für AutomaticModePage.xaml
+///
+public partial class ProductionOverviewPage : Page
+{
+ public ProductionOverviewPage()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml b/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml
index 55ffdf5..afc7ada 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml
@@ -7,17 +7,19 @@
xmlns:common="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=uniperHmi:ReceipePageVM, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
- d:DesignHeight="1900" d:DesignWidth="3800">
+ d:DesignHeight="1554" d:DesignWidth="3840">
-
+
+
-
-
-
-
+
+
+
@@ -40,34 +42,40 @@
-
-
-
+
-
+
+
-
-
-
+
+
+
@@ -88,8 +96,8 @@
-
-
+
+
@@ -97,22 +105,59 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AutoGenerateColumns="False" CanUserAddRows="False" FontSize="30">
+
-
-
+
+ SelectedValueBinding="{Binding Station, NotifyOnTargetUpdated=True, NotifyOnSourceUpdated=True}">
+
+
+
+
+
+
+
@@ -129,39 +174,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ AutoGenerateColumns="False" CanUserAddRows="False" FontSize="30">
diff --git a/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml.cs
index 875c4e2..418f88d 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/ReceipePage.xaml.cs
@@ -1,15 +1,14 @@
using System.Windows.Controls;
-namespace InfineonHMI.Pages.Views
+namespace InfineonHMI.Pages.Views;
+
+///
+/// Receipes Overview Page
+///
+public partial class ReceipePage : Page
{
- ///
- /// Receipes Overview Page
- ///
- public partial class ReceipePage : Page
+ public ReceipePage()
{
- public ReceipePage()
- {
- InitializeComponent();
- }
+ InitializeComponent();
}
-}
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml
index 948a325..85d1d0d 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml
@@ -4,17 +4,22 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:InfineonHMI"
+ xmlns:common="clr-namespace:Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:TrayFeederPageVM, IsDesignTimeCreatable=True}"
- d:DesignHeight="800" d:DesignWidth="1850"
+ d:DesignHeight="1554" d:DesignWidth="3390"
Title="Trayfeeder">
-
+
+
+
+
+
@@ -27,7 +32,10 @@
-
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
index b3140f2..c7cc084 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
@@ -1,16 +1,15 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class TrayFeederPage : Page
- {
- public TrayFeederPage()
- {
- InitializeComponent();
- }
+namespace InfineonHMI;
- }
-}
+///
+/// Interaktionslogik für AutomaticModePage.xaml
+///
+public partial class TrayFeederPage : Page
+{
+ public TrayFeederPage()
+ {
+ InitializeComponent();
+ }
+
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/Resources/application.png b/uniper_hmi/UniperHMI/Resources/application.png
new file mode 100644
index 0000000..d41f845
Binary files /dev/null and b/uniper_hmi/UniperHMI/Resources/application.png differ
diff --git a/uniper_hmi/UniperHMI/Resources/user.png b/uniper_hmi/UniperHMI/Resources/user.png
new file mode 100644
index 0000000..86ea4c0
Binary files /dev/null and b/uniper_hmi/UniperHMI/Resources/user.png differ
diff --git a/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml b/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml
index c9019d0..117a6dd 100644
--- a/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml
+++ b/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml
@@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
diff --git a/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml.cs b/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml.cs
index 8ac180f..87a99c8 100644
--- a/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml.cs
+++ b/uniper_hmi/UniperHMI/SettingsPage/SettingsPage.xaml.cs
@@ -1,22 +1,21 @@
using System.Windows.Controls;
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für SettingsPageView.xaml
- ///
- public partial class SettingsPage : Page
- {
- public SettingsPage()
- {
- InitializeComponent();
- Unloaded += OnUnloaded;
- }
+namespace InfineonHMI;
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
+///
+/// Interaktionslogik für SettingsPageView.xaml
+///
+public partial class SettingsPage : Page
+{
+ public SettingsPage()
+ {
+ InitializeComponent();
+ Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi/UniperHMI/SettingsPage/SettingsPageVM.cs b/uniper_hmi/UniperHMI/SettingsPage/SettingsPageVM.cs
index d8e5b68..5fa14b3 100644
--- a/uniper_hmi/UniperHMI/SettingsPage/SettingsPageVM.cs
+++ b/uniper_hmi/UniperHMI/SettingsPage/SettingsPageVM.cs
@@ -7,119 +7,118 @@ using TwinCAT.Ads.TypeSystem;
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
-namespace InfineonHMI
+namespace InfineonHMI;
+
+public partial class SettingsEntry : ObservableObject
{
- public partial class SettingsEntry : ObservableObject
- {
- [ObservableProperty]
- private string name = "";
+ [ObservableProperty]
+ private string name = "";
- [ObservableProperty]
- private string instancePath = "";
+ [ObservableProperty]
+ private string instancePath = "";
- [ObservableProperty]
- private string? dataType;
+ [ObservableProperty]
+ private string? dataType;
- [ObservableProperty]
- private Object? value;
+ [ObservableProperty]
+ private Object? value;
- public ObservableCollection SubEntries { get; set; } = [];
+ public ObservableCollection SubEntries { get; set; } = [];
- [ObservableProperty]
- private Visibility visibility = Visibility.Collapsed;
+ [ObservableProperty]
+ private Visibility visibility = Visibility.Collapsed;
- private readonly IAdsManager _adsManager;
+ private readonly IAdsManager _adsManager;
- public SettingsEntry(IAdsManager adsManager)
- {
- _adsManager = adsManager;
- }
+ public SettingsEntry(IAdsManager adsManager)
+ {
+ _adsManager = adsManager;
+ }
- partial void OnValueChanging(object? oldValue, object? newValue)
- {
- if (newValue == null)
- {
- newValue = oldValue;
- return;
- }
+ partial void OnValueChanging(object? oldValue, object? newValue)
+ {
+ if (newValue == null)
+ {
+ newValue = oldValue;
+ return;
+ }
- try
- {
- _adsManager.WriteValue(InstancePath, newValue);
- }
- catch (Exception)
- {
- newValue = oldValue;
- Debug.WriteLine("Value {0} could not be written to {1}", newValue, InstancePath);
- }
- }
- }
-
- public partial class SettingsPageVM : ObservableObject, IDisposable
- {
- public ObservableCollection RootItem { get; private set; } = [];
-
- private readonly IAdsManager _adsManager;
-
- private readonly string _variableName;
-
- public SettingsPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- _adsManager.Register(_variableName, ConfigChangedEvent);
- }
-
- private void ConfigChangedEvent(object? sender, ValueChangedEventArgs e)
- {
- App.Current.Invoke(CreateSettingsTree);
- }
-
- private void CreateSettingsTree()
- {
- ISymbolLoader? symbolLoader = _adsManager.GetSymbolLoader();
-
- if (symbolLoader == null)
- return;
-
- Symbol configSymbol = (Symbol)symbolLoader.Symbols[_variableName];
- SettingsEntry entry = GetSymbol(configSymbol);
- RootItem.Add(entry);
- }
-
- private SettingsEntry GetSymbol(Symbol symbol)
- {
- // Create Symbol
- SettingsEntry entry = new(_adsManager)
- {
- Name = symbol.InstanceName,
- InstancePath = symbol.InstancePath,
- DataType = symbol.DataType?.Name
- };
-
- // Check if symbol has sub symbols
- if (!symbol.IsPrimitiveType)
- {
- foreach (Symbol subSymbol in symbol.SubSymbols.Cast())
- {
- entry.SubEntries.Add(GetSymbol(subSymbol));
- }
- }
- else
- {
- entry.Visibility = Visibility.Visible;
-
- entry.Value = symbol.ReadValue();
- }
-
- return entry;
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName, ConfigChangedEvent);
- }
- }
+ try
+ {
+ _adsManager.WriteValue(InstancePath, newValue);
+ }
+ catch (Exception)
+ {
+ newValue = oldValue;
+ Debug.WriteLine("Value {0} could not be written to {1}", newValue, InstancePath);
+ }
+ }
}
+
+public partial class SettingsPageVM : ObservableObject, IDisposable
+{
+ public ObservableCollection RootItem { get; private set; } = [];
+
+ private readonly IAdsManager _adsManager;
+
+ private readonly string _variableName;
+
+ public SettingsPageVM(IAdsManager adsManager, string variableName)
+ {
+ _adsManager = adsManager;
+ _variableName = variableName;
+
+ _adsManager.Register(_variableName, ConfigChangedEvent);
+ }
+
+ private void ConfigChangedEvent(object? sender, ValueChangedEventArgs e)
+ {
+ App.Current.Invoke(CreateSettingsTree);
+ }
+
+ private void CreateSettingsTree()
+ {
+ ISymbolLoader? symbolLoader = _adsManager.GetSymbolLoader();
+
+ if (symbolLoader == null)
+ return;
+
+ Symbol configSymbol = (Symbol)symbolLoader.Symbols[_variableName];
+ SettingsEntry entry = GetSymbol(configSymbol);
+ RootItem.Add(entry);
+ }
+
+ private SettingsEntry GetSymbol(Symbol symbol)
+ {
+ // Create Symbol
+ SettingsEntry entry = new(_adsManager)
+ {
+ Name = symbol.InstanceName,
+ InstancePath = symbol.InstancePath,
+ DataType = symbol.DataType?.Name
+ };
+
+ // Check if symbol has sub symbols
+ if (!symbol.IsPrimitiveType)
+ {
+ foreach (Symbol subSymbol in symbol.SubSymbols.Cast())
+ {
+ entry.SubEntries.Add(GetSymbol(subSymbol));
+ }
+ }
+ else
+ {
+ entry.Visibility = Visibility.Visible;
+
+ entry.Value = symbol.ReadValue();
+ }
+
+ return entry;
+ }
+
+ public void Dispose()
+ {
+ _adsManager?.Deregister(_variableName, ConfigChangedEvent);
+ }
+}
\ No newline at end of file
diff --git a/uniper_hmi_old/.gitattributes b/uniper_hmi_old/.gitattributes
deleted file mode 100644
index 1ff0c42..0000000
--- a/uniper_hmi_old/.gitattributes
+++ /dev/null
@@ -1,63 +0,0 @@
-###############################################################################
-# Set default behavior to automatically normalize line endings.
-###############################################################################
-* text=auto
-
-###############################################################################
-# Set default behavior for command prompt diff.
-#
-# This is need for earlier builds of msysgit that does not have it on by
-# default for csharp files.
-# Note: This is only used by command line
-###############################################################################
-#*.cs diff=csharp
-
-###############################################################################
-# Set the merge driver for project and solution files
-#
-# Merging from the command prompt will add diff markers to the files if there
-# are conflicts (Merging from VS is not affected by the settings below, in VS
-# the diff markers are never inserted). Diff markers may cause the following
-# file extensions to fail to load in VS. An alternative would be to treat
-# these files as binary and thus will always conflict and require user
-# intervention with every merge. To do so, just uncomment the entries below
-###############################################################################
-#*.sln merge=binary
-#*.csproj merge=binary
-#*.vbproj merge=binary
-#*.vcxproj merge=binary
-#*.vcproj merge=binary
-#*.dbproj merge=binary
-#*.fsproj merge=binary
-#*.lsproj merge=binary
-#*.wixproj merge=binary
-#*.modelproj merge=binary
-#*.sqlproj merge=binary
-#*.wwaproj merge=binary
-
-###############################################################################
-# behavior for image files
-#
-# image files are treated as binary by default.
-###############################################################################
-#*.jpg binary
-#*.png binary
-#*.gif binary
-
-###############################################################################
-# diff behavior for common document formats
-#
-# Convert binary document formats to text before diffing them. This feature
-# is only available from the command line. Turn it on by uncommenting the
-# entries below.
-###############################################################################
-#*.doc diff=astextplain
-#*.DOC diff=astextplain
-#*.docx diff=astextplain
-#*.DOCX diff=astextplain
-#*.dot diff=astextplain
-#*.DOT diff=astextplain
-#*.pdf diff=astextplain
-#*.PDF diff=astextplain
-#*.rtf diff=astextplain
-#*.RTF diff=astextplain
diff --git a/uniper_hmi_old/.gitignore b/uniper_hmi_old/.gitignore
deleted file mode 100644
index da7cb42..0000000
--- a/uniper_hmi_old/.gitignore
+++ /dev/null
@@ -1,367 +0,0 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
-
-# User-specific files
-*.rsuser
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Testproject folders
-AdsSessionTest/
-HMI_Export/
-
-# Mono auto generated files
-mono_crash.*
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-[Ww][Ii][Nn]32/
-[Aa][Rr][Mm]/
-[Aa][Rr][Mm]64/
-bld/
-[Bb]in/
-[Oo]bj/
-[Oo]ut/
-[Ll]og/
-[Ll]ogs/
-
-# Visual Studio 2015/2017 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUnit
-*.VisualState.xml
-TestResult.xml
-nunit-*.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-project.lock.json
-project.fragment.lock.json
-artifacts/
-
-# ASP.NET Scaffolding
-ScaffoldingReadMe.txt
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_i.c
-*_p.c
-*_h.h
-*.ilk
-*.meta
-*.obj
-*.iobj
-*.pch
-*.pdb
-*.ipdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*_wpftmp.csproj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Coverlet is a free, cross platform Code Coverage Tool
-coverage*.json
-coverage*.xml
-coverage*.info
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# NuGet Symbol Packages
-*.snupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-*.appx
-*.appxbundle
-*.appxupload
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!?*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-orleans.codegen.cs
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.mdf
-*.ldf
-*.ndf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-*.rptproj.rsuser
-*- [Bb]ackup.rdl
-*- [Bb]ackup ([0-9]).rdl
-*- [Bb]ackup ([0-9][0-9]).rdl
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-node_modules/
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# CodeRush personal settings
-.cr/personal
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-# Local History for Visual Studio
-.localhistory/
-
-# BeatPulse healthcheck temp database
-healthchecksdb
-
-# Backup folder for Package Reference Convert tool in Visual Studio 2017
-MigrationBackup/
-
-# Ionide (cross platform F# VS Code tools) working folder
-.ionide/
-
-# Fody - auto-generated XML schema
-FodyWeavers.xsd
\ No newline at end of file
diff --git a/uniper_hmi_old/AdsSettings.json b/uniper_hmi_old/AdsSettings.json
deleted file mode 100644
index 98599c4..0000000
--- a/uniper_hmi_old/AdsSettings.json
+++ /dev/null
@@ -1 +0,0 @@
-{"AdsAdress":"10.103.32.50.1.1","AdsPort":851,"ReconnectIntervalMS":1000,"OnlineChangeCntVar":"TWinCAT_SystemInfoVarList._AppInfo.OnlineChangeCnt"}
\ No newline at end of file
diff --git a/uniper_hmi_old/Infineon.sln b/uniper_hmi_old/Infineon.sln
deleted file mode 100644
index 3de47d2..0000000
--- a/uniper_hmi_old/Infineon.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 18
-VisualStudioVersion = 18.2.11415.280
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InfineonHMI", "UniperHMI\InfineonHMI.csproj", "{8D725B27-1242-4C66-ACD8-45F02098C7D3}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Debug|x64.ActiveCfg = Debug|x64
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Debug|x64.Build.0 = Debug|x64
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Release|x64.ActiveCfg = Release|x64
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {13973C5F-C164-4478-A4B1-1694557CC459}
- EndGlobalSection
-EndGlobal
diff --git a/uniper_hmi_old/README.md b/uniper_hmi_old/README.md
deleted file mode 100644
index cf2e00b..0000000
--- a/uniper_hmi_old/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
-# Uniper
-Uniper maintenance hmi project.
-
-# Gitflow
-1. A develop branch is created from main
-2. A release branch is created from develop
-3. Feature branches are created from develop
-4. When a feature is complete it is merged into the develop branch
-5. When the release branch is done it is merged into develop and main
-6. If an issue in main is detected a hotfix branch is created from main
-7. Once the hotfix is complete it is merged to both develop and main
-
-## Start new feature
-```
-git flow feature start feature_branch
-```
-oder
-```
-git checkout develop
-git checkout -b feature_branch
-```
-
-## Finish a feature
-```
-git flow feature finish feature_branch
-```
-oder
-```
-git checkout develop
-git merge feature_branch
-```
-
-## Making a release
-```
-git flow release start 0.1.0
-```
-oder
-```
-git checkout develop
-git checkout -b release/0.1.0
-```
-
-## Finishing a release
-```
-git flow release finish '0.1.0'
-```
-oder
-```
-git checkout main
-git merge release/0.1.0
-```
-
-## Starting a Hotfix
-```
-git flow hotfix start hotfix_branch
-```
-oder
-```
-git checkout main
-git checkout -b hotfix_branch
-```
-
-## Finishing a Hotfix
-```
-git flow hotfix finish hotfix_branch
-```
-oder
-```
-git checkout main
-git merge hotfix_branch
-git checkout develop
-git merge hotfix_branch
-git branch -D hotfix_branch
-```
-
-## Workflow example
-```
-git checkout main
-git checkout -b develop
-git checkout -b feature_branch
-# work happens on feature branch
-git checkout develop
-git merge feature_branch
-git checkout main
-git merge develop
-git branch -d feature_branch
-```
-
-## Hotfix example
-```
-git checkout main
-git checkout -b hotfix_branch
-# work is done commits are added to the hotfix_branch
-git checkout develop
-git merge hotfix_branch
-git checkout main
-git merge hotfix_branch
-```
\ No newline at end of file
diff --git a/uniper_hmi_old/UniperHMI/3rdParty/AdsManager.dll b/uniper_hmi_old/UniperHMI/3rdParty/AdsManager.dll
deleted file mode 100644
index 35826ee..0000000
Binary files a/uniper_hmi_old/UniperHMI/3rdParty/AdsManager.dll and /dev/null differ
diff --git a/uniper_hmi_old/UniperHMI/Anlagenuebersicht.png b/uniper_hmi_old/UniperHMI/Anlagenuebersicht.png
deleted file mode 100644
index cc2fd0c..0000000
Binary files a/uniper_hmi_old/UniperHMI/Anlagenuebersicht.png and /dev/null differ
diff --git a/uniper_hmi_old/UniperHMI/App.xaml b/uniper_hmi_old/UniperHMI/App.xaml
deleted file mode 100644
index 9890229..0000000
--- a/uniper_hmi_old/UniperHMI/App.xaml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/App.xaml.cs b/uniper_hmi_old/UniperHMI/App.xaml.cs
deleted file mode 100644
index 4de6837..0000000
--- a/uniper_hmi_old/UniperHMI/App.xaml.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System.Windows;
-using Heisig.HMI.AdsManager;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using TcEventLoggerAdsProxyLib;
-
-namespace InfineonHMI;
-
-public partial class App : Application
-{
- public static IHost? AppHost { get; private set; }
-
- public App()
- {
- AppHost = Host.CreateDefaultBuilder()
- .ConfigureServices((hostContext, services) =>
- {
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- })
- .Build();
- }
-
- protected override async void OnStartup(StartupEventArgs e)
- {
- await AppHost!.StartAsync();
-
- var startupForm = AppHost.Services.GetRequiredService();
- startupForm.Show();
-
- base.OnStartup(e);
- }
-
- protected override async void OnExit(ExitEventArgs e)
- {
- await AppHost!.StopAsync();
-
- base.OnExit(e);
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/AssemblyInfo.cs b/uniper_hmi_old/UniperHMI/AssemblyInfo.cs
deleted file mode 100644
index b0ec827..0000000
--- a/uniper_hmi_old/UniperHMI/AssemblyInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Windows;
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
diff --git a/uniper_hmi_old/UniperHMI/Common/L4ItXmlSerializer.cs b/uniper_hmi_old/UniperHMI/Common/L4ItXmlSerializer.cs
deleted file mode 100644
index 3ee37b3..0000000
--- a/uniper_hmi_old/UniperHMI/Common/L4ItXmlSerializer.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System.IO;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace InfineonHMI.Common
-{
- public static class L4ItXmlSerializer
- {
- ///
- /// Serializes an object.
- ///
- ///
- ///
- ///
- ///
- ///
-
- public static void SerializeObject(T serializableObject, string fileName, bool encrypt = false, string rootElementName = null)
- {
- if (string.IsNullOrEmpty(fileName))
- return;
-
- if (serializableObject == null)
- return;
-
- XmlSerializer serializer;
- if (rootElementName != null)
- {
- var xmlRoot = new XmlRootAttribute(rootElementName);
- serializer = new XmlSerializer(serializableObject.GetType(), xmlRoot);
- }
- else
- {
- serializer = new XmlSerializer(serializableObject.GetType());
- }
-
- try
- {
- var dir = new FileInfo(fileName).DirectoryName;
- if (dir != null && !Directory.Exists(dir)) // Überprüfen Sie, ob dir nicht null ist, bevor Sie es verwenden
- Directory.CreateDirectory(dir);
-
- var xmlDocument = new XmlDocument();
- using var stream = new MemoryStream();
- serializer.Serialize(stream, serializableObject);
- stream.Position = 0;
- xmlDocument.Load(stream);
- if (encrypt && false)
- {
- //FileEncryption.SaveEncryptedToFile(fileName, xmlDocument.OuterXml);
- return;
- }
- xmlDocument.Save(fileName);
- }
- catch (Exception ex)
- {
- Console.Write(ex);
- }
- }
-
-
- ///
- /// Deserializes an xml file into an object list
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public static T DeSerializeObject(string fileName, bool decrypt = false, string rootElementName = null)
- {
- if (string.IsNullOrEmpty(fileName) || !File.Exists(fileName)) return default!;
-
- T objectOut;
-
- try
- {
- string xmlString;
- if (decrypt && false)
- {
- //xmlString = FileEncryption.ReadDecryptedFromFile(fileName)!;
- }
- else
- {
- var xmlDocument = new XmlDocument();
- xmlDocument.Load(fileName);
- xmlString = xmlDocument.OuterXml;
- }
-
- if (string.IsNullOrEmpty(xmlString))
- {
- // Handle empty xmlString if necessary
- return default!;
- }
-
- using var read = new StringReader(xmlString);
- var outType = typeof(T);
-
- XmlSerializer serializer;
- if (rootElementName != null)
- {
- var root = new XmlRootAttribute(rootElementName);
- serializer = new XmlSerializer(outType, root);
- }
- else
- {
- serializer = new XmlSerializer(outType);
- }
-
- using XmlReader reader = new XmlTextReader(read);
- objectOut = (T)serializer.Deserialize(reader)!;
- }
- catch (Exception ex)
- {
- Console.Write(ex);
- return default!;
- }
-
- return objectOut;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Common/MediaContainer.xaml b/uniper_hmi_old/UniperHMI/Common/MediaContainer.xaml
deleted file mode 100644
index 6594243..0000000
--- a/uniper_hmi_old/UniperHMI/Common/MediaContainer.xaml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Common/MediaContainer.xaml.cs b/uniper_hmi_old/UniperHMI/Common/MediaContainer.xaml.cs
deleted file mode 100644
index 4253985..0000000
--- a/uniper_hmi_old/UniperHMI/Common/MediaContainer.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Text.RegularExpressions;
-using System.Windows.Controls;
-using System.Windows.Input;
-
-namespace Common
-{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class MediaContainer : UserControl
- {
- public bool IsReadonly { get; set; }
-
- public MediaContainer()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
-
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Common/MediaContainerVm.cs b/uniper_hmi_old/UniperHMI/Common/MediaContainerVm.cs
deleted file mode 100644
index 88b11f6..0000000
--- a/uniper_hmi_old/UniperHMI/Common/MediaContainerVm.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.ComponentModel.DataAnnotations;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-using HMIToolkit;
-
-namespace Common;
-
-public sealed partial class MediaContainerVm : ObservableValidator, IDisposable
-{
-
- private IAdsManager? _adsManager;
- private string? _variableName;
-
- [ObservableProperty] private string? sName = "No Name";
-
- [ObservableProperty] private bool empty = false;
-
- [ObservableProperty] private bool full = false;
-
- [ObservableProperty] private bool overload = false;
-
- [ObservableProperty] private HMIControlButtonVM? emptyButton;
-
- [ObservableProperty] private HMIControlButtonVM? fillButton;
-
-
-
- public MediaContainerVm()
- {
- sName = "No Name";
- EmptyButton = new HMIControlButtonVM();
- FillButton = new HMIControlButtonVM();
-
- }
-
- public MediaContainerVm(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- sName = "No Name";
-
- EmptyButton = new HMIControlButtonVM(_adsManager, _variableName + ".stEmptyButton");
- FillButton = new HMIControlButtonVM(_adsManager, _variableName + ".stFillButton");
- _adsManager.Register(_variableName + ".xEmpty", EmptyChanged);
- _adsManager.Register(_variableName + ".xFull", FullChanged);
- _adsManager.Register(_variableName + ".xOverload", OverloadChanged);
-
- }
- private void EmptyChanged(object? sender, ValueChangedEventArgs e)
- {
- Empty = (bool)e.Value;
- }
- private void FullChanged(object? sender, ValueChangedEventArgs e)
- {
- Full = (bool)e.Value;
- }
- private void OverloadChanged(object? sender, ValueChangedEventArgs e)
- {
- Overload = (bool)e.Value;
- }
- public void Dispose()
- {
- EmptyButton?.Dispose();
- EmptyButton = null;
- FillButton?.Dispose();
- FillButton = null;
-
- _adsManager?.Deregister(_variableName + ".xEmpty", EmptyChanged);
- _adsManager?.Deregister(_variableName + ".xFull", FullChanged);
- _adsManager?.Deregister(_variableName + ".xOverload", OverloadChanged);
- }
-
-
-}
diff --git a/uniper_hmi_old/UniperHMI/Common/ParamControlFloat.xaml b/uniper_hmi_old/UniperHMI/Common/ParamControlFloat.xaml
deleted file mode 100644
index 398ce7f..0000000
--- a/uniper_hmi_old/UniperHMI/Common/ParamControlFloat.xaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Common/ParamControlFloat.xaml.cs b/uniper_hmi_old/UniperHMI/Common/ParamControlFloat.xaml.cs
deleted file mode 100644
index 8d404ec..0000000
--- a/uniper_hmi_old/UniperHMI/Common/ParamControlFloat.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Text.RegularExpressions;
-using System.Windows.Controls;
-using System.Windows.Input;
-
-namespace Common
-{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class ParamControlFloat : UserControl
- {
- public bool IsReadonly { get; set; }
-
- public ParamControlFloat()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
-
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Common/ParamControlFloatVM.cs b/uniper_hmi_old/UniperHMI/Common/ParamControlFloatVM.cs
deleted file mode 100644
index 508a24a..0000000
--- a/uniper_hmi_old/UniperHMI/Common/ParamControlFloatVM.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.ComponentModel.DataAnnotations;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace Common;
-
-public sealed partial class ParamControlFloatVm : ObservableValidator, IDisposable
-{
- [ObservableProperty]
- private string sName;
-
- [ObservableProperty]
- private float value;
-
- public ParamControlFloatVm()
- {
- SName = "No Name:";
- Value = 0.0f;
- }
-
-
- public void Dispose()
- {
- }
-
-}
diff --git a/uniper_hmi_old/UniperHMI/Common/ParamControlInt.xaml b/uniper_hmi_old/UniperHMI/Common/ParamControlInt.xaml
deleted file mode 100644
index 13250fa..0000000
--- a/uniper_hmi_old/UniperHMI/Common/ParamControlInt.xaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Common/ParamControlInt.xaml.cs b/uniper_hmi_old/UniperHMI/Common/ParamControlInt.xaml.cs
deleted file mode 100644
index 082170e..0000000
--- a/uniper_hmi_old/UniperHMI/Common/ParamControlInt.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Text.RegularExpressions;
-using System.Windows.Controls;
-using System.Windows.Input;
-
-namespace Common
-{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class ParamControlInt : UserControl
- {
- public bool IsReadonly { get; set; }
-
- public ParamControlInt()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
-
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Common/ParamControlIntVM.cs b/uniper_hmi_old/UniperHMI/Common/ParamControlIntVM.cs
deleted file mode 100644
index 2c650e0..0000000
--- a/uniper_hmi_old/UniperHMI/Common/ParamControlIntVM.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.ComponentModel.DataAnnotations;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace Common;
-
-public sealed partial class ParamControlIntVm : ObservableValidator, IDisposable
-{
- [ObservableProperty]
- private string sName;
-
- [ObservableProperty]
- private int value;
-
- public ParamControlIntVm()
- {
- SName = "No Name:";
- Value = 0;
- }
-
-
- public void Dispose()
- {
- }
-
-
-}
diff --git a/uniper_hmi_old/UniperHMI/DateTimeToEventTimeConverter.cs b/uniper_hmi_old/UniperHMI/DateTimeToEventTimeConverter.cs
deleted file mode 100644
index e61a166..0000000
--- a/uniper_hmi_old/UniperHMI/DateTimeToEventTimeConverter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Globalization;
-using System.Windows;
-using System.Windows.Data;
-
-namespace InfineonHMI
-{
- public class DateTimeToEventTimeConverter : IValueConverter
- {
- // 599264352000000000 ticks is a date used by beckhoff for events that didnt happen up to this point
- public const long NoTime = 599264352000000000;
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is DateTime dt)
- {
-
- if (dt.Ticks == NoTime)
- return "";
- else
- {
- CultureInfo cultureInfo = CultureInfo.CurrentCulture;
- return dt.ToString("G", cultureInfo);
- }
- }
- else
- throw new InvalidOperationException("Target must be of type DateTime");
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return DependencyProperty.UnsetValue;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/AnalogMotorWindow.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/AnalogMotorWindow.xaml
deleted file mode 100644
index 9702640..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/AnalogMotorWindow.xaml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/AnalogMotorWindow.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/AnalogMotorWindow.xaml.cs
deleted file mode 100644
index 9d6b34b..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/AnalogMotorWindow.xaml.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Windows;
-
-namespace HMIToolkit;
-
-///
-/// Interaktionslogik für AnalogMotorWindow.xaml
-///
-public partial class AnalogMotorWindow : Window
-{
- public AnalogMotorWindow()
- {
- InitializeComponent();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/BinaryValveWindow.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/BinaryValveWindow.xaml
deleted file mode 100644
index 51a66a1..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/BinaryValveWindow.xaml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs
deleted file mode 100644
index a91ea3e..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/BinaryValveWindow.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Windows;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für BinaryValveWindow.xaml
- ///
- public partial class BinaryValveWindow : Window
- {
- public BinaryValveWindow()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/FeedbackToColorConverter.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/FeedbackToColorConverter.cs
deleted file mode 100644
index 3411a73..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/FeedbackToColorConverter.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Globalization;
-using System.Windows;
-using System.Windows.Data;
-
-namespace HMIToolkit;
-
-class FeedbackToColorConverter : IValueConverter
-{
- public Object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
-
- if (targetType != typeof(System.Windows.Media.Brush))
- throw new InvalidOperationException("The target must be a brush");
-
-
- #pragma warning disable CS8604 // Mögliches Nullverweisargument.
- int num = int.Parse(value.ToString());
- #pragma warning restore CS8604 // Mögliches Nullverweisargument.
-
- switch (num)
- {
- case 0:
- return DependencyProperty.UnsetValue;
-
- case 1:
- return System.Windows.Media.Brushes.Green;
-
- case 2:
- return System.Windows.Media.Brushes.GreenYellow;
-
- case 3:
- return System.Windows.Media.Brushes.DarkOrange;
-
- case 4:
- return System.Windows.Media.Brushes.DarkRed;
-
- default:
- return DependencyProperty.UnsetValue;
- }
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return DependencyProperty.UnsetValue;
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml
deleted file mode 100644
index 626d329..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs
deleted file mode 100644
index d05d95d..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorControl.xaml.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Windows.Controls;
-
-
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für AnalogMotorControl.xaml
- ///
- public partial class AnalogMotorControl : UserControl
- {
- public AnalogMotorControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs
deleted file mode 100644
index 34ee644..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogMotorControl/AnalogMotorcontrolVM.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace HMIToolkit
-{
- public sealed partial class AnalogMotorControlVM : ObservableObject
- {
- [ObservableProperty]
- private string sName = "No Name";
-
- public HMIControlButtonVM? AutomaticButton { get; private set; }
- public HMIControlButtonVM? ManualButton { get; private set; }
- public HMIControlButtonVM StartButton { get; private set; }
- public HMIControlButtonVM StopButton { get; private set; }
- public IntlkControlVM? Interlocks { get; private set; }
- public AnalogValueVM? Setpoint { get; private set; }
- public AnalogValueVM? ProcessValue { get; private set; }
-
- private readonly string? _variableName;
-
- private IAdsManager? _adsManager;
-
- public AnalogMotorControlVM()
- {
- AutomaticButton = new HMIControlButtonVM();
- ManualButton = new HMIControlButtonVM();
- StartButton = new HMIControlButtonVM();
- StopButton = new HMIControlButtonVM();
- Interlocks = new IntlkControlVM();
- Setpoint = new AnalogValueVM();
- ProcessValue = new AnalogValueVM();
- }
-
- public AnalogMotorControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
- AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
- ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
- StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartButton");
- StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopButton");
- Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
- Setpoint = new AnalogValueVM(_adsManager, _variableName + ".stSetpoint", false);
- ProcessValue = new AnalogValueVM(_adsManager, _variableName + ".stProcessValue", true);
-
-
- _adsManager.Register(_variableName + ".sName", NameChanged);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager = null;
-
- AutomaticButton?.Dispose();
- AutomaticButton = null;
-
- ManualButton?.Dispose();
- ManualButton = null;
-
- StartButton?.Dispose();
- StartButton = null;
-
- StopButton?.Dispose();
- StopButton = null;
-
- Interlocks?.Dispose();
- Interlocks = null;
-
- Setpoint?.Dispose();
- Setpoint = null;
-
- ProcessValue?.Dispose();
- ProcessValue = null;
- }
-
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- SName = (string)e.Value;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs
deleted file mode 100644
index ec67e9b..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogRangeValidator.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.Globalization;
-using System.Windows.Controls;
-
-namespace HMIToolkit
-{
- public sealed partial class AnalogRangeValidator : ValidationRule
- {
- public float Min { get; set; }
-
- public float Max { get; set; }
-
- public override ValidationResult Validate(object value, CultureInfo cultureInfo)
- {
- float analogValue = 0;
-
- try
- {
- if (((string)value).Length > 0)
- analogValue = float.Parse((string)value);
- }
- catch (Exception e)
- {
- return new ValidationResult(false, $"Illegal characters or {e.Message}");
- }
-
- if ((analogValue < Min) || (analogValue > Max))
- return new ValidationResult(false, $"Please enter a value in the range: {Min}-{Max}.");
-
- return ValidationResult.ValidResult;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml
deleted file mode 100644
index 5a97e8b..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs
deleted file mode 100644
index 6170468..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValue.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Text.RegularExpressions;
-using System.Windows.Controls;
-using System.Windows.Input;
-
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für AnalogValue.xaml
- ///
- public partial class AnalogValue : UserControl
- {
- public bool IsReadonly { get; set; }
-
- public AnalogValue()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
-
- private void NumberValidation(object sender, TextCompositionEventArgs e)
- {
- Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
- e.Handled = regex.IsMatch(e.Text);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValueVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValueVM.cs
deleted file mode 100644
index 449541d..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValue/AnalogValueVM.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.ComponentModel.DataAnnotations;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace HMIToolkit;
-
-public sealed class InRangeAttribute(string propMin, string propMax) : ValidationAttribute
-{
- public string PropMin { get; } = propMin;
- public string PropMax { get; } = propMax;
-
- protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
- {
- object instance = validationContext.ObjectInstance;
- float minValue = (float)(instance.GetType().GetProperty(PropMin)?.GetValue(instance) ?? 0.0f);
- float maxValue = (float)(instance.GetType().GetProperty(PropMax)?.GetValue(instance) ?? 0.0f);
- float tempValue = (float)(value ?? 0.0f);
-
- if (tempValue <= maxValue && tempValue >= minValue)
- return ValidationResult.Success;
-
- return new($"Value has to be greater than {minValue} and smaller then {maxValue}");
- }
-}
-
-public sealed partial class AnalogValueVM : ObservableValidator, IDisposable
-{
- [ObservableProperty]
- private string sName;
-
- // 1 = Ok; 2 = Error
- [ObservableProperty]
- private short iStatus;
-
- private float rValue;
-
- [InRangeAttribute(nameof(RMin), nameof(RMax))]
- public float RValue
- {
- get => rValue;
- set
- {
- SetProperty(ref rValue, value, true);
- if (value >= RMin && value <= RMax)
- {
- if (!Readonly)
- WriteValue(value);
- }
- }
- }
-
- private void WriteValue(float value)
- {
- _adsManager?.WriteValue(_variableName + ".rValue", value);
- }
-
- [ObservableProperty]
- private string sUnit;
-
- [ObservableProperty]
- private float rMin;
-
- [ObservableProperty]
- private float rMax;
-
- public bool Readonly { get; private set; }
-
- private IAdsManager? _adsManager;
-
- private readonly string? _variableName;
-
- public AnalogValueVM()
- {
- sName = "No Name:";
- iStatus = 2;
- rValue = 0.0f;
- sUnit = "";
- Readonly = true;
- rMin = 0.0f;
- rMax = 100.0f;
- }
-
- public AnalogValueVM(IAdsManager adsManager, string variableName, bool isReadonly) : this()
- {
- _adsManager = adsManager;
- _variableName = variableName;
- Readonly = isReadonly;
-
- _adsManager.Register(_variableName + ".sName", NameChanged);
- _adsManager.Register(_variableName + ".iStatus", StatusChanged);
- //if (isReadonly)
- _adsManager.Register(_variableName + ".rValue", ValueChanged);
- _adsManager.Register(_variableName + ".sUnit", UnitChanged);
- _adsManager.Register(_variableName + ".rMin", MinChanged);
- _adsManager.Register(_variableName + ".rMax", MaxChanged);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager?.Deregister(_variableName + ".iStatus", StatusChanged);
- _adsManager?.Deregister(_variableName + ".rValue", ValueChanged);
- _adsManager?.Deregister(_variableName + ".sUnit", UnitChanged);
- _adsManager?.Deregister(_variableName + ".rMin", MinChanged);
- _adsManager?.Deregister(_variableName + ".rMax", MaxChanged);
-
- _adsManager = null;
- }
-
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- string temp = (string)e.Value;
- if (temp != String.Empty)
- SName = temp + ":";
- else
- SName = "";
- }
-
- private void StatusChanged(object? sender, ValueChangedEventArgs e)
- {
- IStatus = (short)e.Value;
- }
-
- private void ValueChanged(object? sender, ValueChangedEventArgs e)
- {
- RValue = (float)e.Value;
- }
-
- private void UnitChanged(object? sender, ValueChangedEventArgs e)
- {
- SUnit = (string)e.Value;
- }
-
- private void MinChanged(object? sender, ValueChangedEventArgs e)
- {
- RMin = (float)e.Value;
- }
-
- private void MaxChanged(object? sender, ValueChangedEventArgs e)
- {
- RMax = (float)e.Value;
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml
deleted file mode 100644
index 1adec03..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs
deleted file mode 100644
index 5d7d552..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControl.xaml.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-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.Navigation;
-using System.Windows.Shapes;
-
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für AnalogValveControl.xaml
- ///
- public partial class AnalogValveControl : UserControl
- {
- public AnalogValveControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs
deleted file mode 100644
index bdb66c2..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/AnalogValveControl/AnalogValveControlVM.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace HMIToolkit
-{
- public sealed partial class AnalogValveControlVM : ObservableObject
- {
- [ObservableProperty]
- private string sName = "No Name";
-
- public HMIControlButtonVM? AutomaticButton { get; private set; }
- public HMIControlButtonVM? ManualButton { get; private set; }
- public HMIControlButtonVM? OpenButton { get; private set; }
- public HMIControlButtonVM? CloseButton { get; private set; }
- public IntlkControlVM? Interlocks { get; private set; }
- public AnalogValueVM? Setpoint { get; private set; }
- public AnalogValueVM? ProcessValue { get; private set; }
-
- private readonly string? _variableName;
-
- private IAdsManager? _adsManager;
-
- public AnalogValveControlVM()
- {
- AutomaticButton = new HMIControlButtonVM();
- ManualButton = new HMIControlButtonVM();
- OpenButton = new HMIControlButtonVM();
- CloseButton = new HMIControlButtonVM();
- Interlocks = new IntlkControlVM();
- Setpoint = new AnalogValueVM();
- ProcessValue = new AnalogValueVM();
- }
-
- public AnalogValveControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
- AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
- ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
- OpenButton = new HMIControlButtonVM(_adsManager, _variableName + ".stOpenButton");
- CloseButton = new HMIControlButtonVM(_adsManager, _variableName + ".stCloseButton");
- Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
- Setpoint = new AnalogValueVM(_adsManager, _variableName + ".stSetpoint", false);
- ProcessValue = new AnalogValueVM(_adsManager, _variableName + ".stProcessValue", true);
-
-
- _adsManager.Register(_variableName + ".sName", NameChanged);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager = null;
-
- AutomaticButton?.Dispose();
- AutomaticButton = null;
-
- ManualButton?.Dispose();
- ManualButton = null;
-
- OpenButton?.Dispose();
- OpenButton = null;
-
- CloseButton?.Dispose();
- CloseButton = null;
-
- Interlocks?.Dispose();
- Interlocks = null;
-
- Setpoint?.Dispose();
- Setpoint = null;
-
- ProcessValue?.Dispose();
- ProcessValue = null;
- }
-
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- SName = (string)e.Value;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml
deleted file mode 100644
index 9e9a561..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs
deleted file mode 100644
index 8337f84..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControl.xaml.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-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.Navigation;
-using System.Windows.Shapes;
-
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für BinaryValveControl.xaml
- ///
- public partial class BinaryValveControl : UserControl
- {
- public BinaryValveControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs
deleted file mode 100644
index b99ac5a..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BinaryValveControl/BinaryValveControlVM.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-// {Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.OpenButton}
-
-namespace HMIToolkit
-{
- public sealed partial class BinaryValveControlVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private string sName = "No Name";
-
- public HMIControlButtonVM? AutomaticButton { get; private set; }
- public HMIControlButtonVM? ManualButton { get; private set; }
- public HMIControlButtonVM OpenButton { get; private set; }
- public HMIControlButtonVM CloseButton { get; private set; }
- public IntlkControlVM? Interlocks { get; private set; }
-
- private readonly string? _variableName;
-
- private IAdsManager? _adsManager;
-
- public BinaryValveControlVM()
- {
- AutomaticButton = new HMIControlButtonVM();
- ManualButton = new HMIControlButtonVM();
- OpenButton = new HMIControlButtonVM();
- CloseButton = new HMIControlButtonVM();
- Interlocks = new IntlkControlVM();
- }
-
- public BinaryValveControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
- AutomaticButton = new HMIControlButtonVM(_adsManager, _variableName + ".stAutomaticButton");
- ManualButton = new HMIControlButtonVM(_adsManager, _variableName + ".stManualButton");
- OpenButton = new HMIControlButtonVM(_adsManager, _variableName + ".stOpenButton");
- CloseButton = new HMIControlButtonVM(_adsManager, _variableName + ".stCloseButton");
- Interlocks = new IntlkControlVM(_adsManager, _variableName + ".stInterlock");
-
- _adsManager.Register(_variableName + ".sName", NameChanged);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".sName", NameChanged);
- _adsManager = null;
-
- AutomaticButton?.Dispose();
- AutomaticButton = null;
-
- ManualButton?.Dispose();
- ManualButton = null;
-
- OpenButton?.Dispose();
-
- CloseButton?.Dispose();
-
- Interlocks?.Dispose();
- Interlocks = null;
- }
-
- private void NameChanged(object? sender, ValueChangedEventArgs e)
- {
- SName = (string)e.Value;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs
deleted file mode 100644
index e99be2c..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/BoolToBrushConverter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System.Globalization;
-using System.Windows;
-using System.Windows.Data;
-using System.Windows.Media;
-
-namespace HMIToolkit
-{
- public class BoolToBrushConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (targetType != typeof(Brush))
- throw new InvalidOperationException("The target must be a brush");
-
- bool temp = bool.Parse(value.ToString()!);
-
- return (temp ? Brushes.DarkGreen : Brushes.DarkRed);
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return DependencyProperty.UnsetValue;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs
deleted file mode 100644
index a06fb4a..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/HMIControlButtonVM.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace HMIToolkit
-{
- public sealed partial class HMIControlButtonVM : ObservableObject, IDisposable
- {
- private IAdsManager? _adsManager;
- private readonly string _variableName;
-
- // Action triggered when the button is about to be clicked
- public event EventHandler? ButtonClickedStarted;
-
- // Action triggered when the button is done being clicked
- public event EventHandler? ButtonClickedEnded;
-
- // Event when button feedback changed
- public event EventHandler? FeedbackChanged;
-
- // Event when release changed
- public event EventHandler? ReleaseChanged;
-
- [ObservableProperty]
- private bool xRelease;
-
- // 0 = none, 1 = active, 2 = pending, 3 = waring, 4 = error
- [ObservableProperty]
- private short iFeedback;
-
- public HMIControlButtonVM()
- {
- _variableName = string.Empty;
- XRelease = false;
- IFeedback = 4;
- }
-
- public HMIControlButtonVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- _adsManager.Register(_variableName + ".xRelease", XReleaseCahnged);
- _adsManager.Register(_variableName + ".iFeedback", IFeedbackChanged);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".xRelease", XReleaseCahnged);
- _adsManager?.Deregister(_variableName + ".iFeedback", IFeedbackChanged);
- }
-
- [RelayCommand]
- private void ButtonClicked()
- {
- ButtonClickedStarted?.Invoke(this, EventArgs.Empty);
- _adsManager?.WriteValue(_variableName + ".xRequest", true);
- ButtonClickedEnded?.Invoke(this, EventArgs.Empty);
- }
-
- private void XReleaseCahnged(object? sender, ValueChangedEventArgs e)
- {
- XRelease = (bool)e.Value;
- ReleaseChanged?.Invoke(this, EventArgs.Empty);
- }
-
- private void IFeedbackChanged(object? sender, ValueChangedEventArgs e)
- {
- IFeedback = (short)e.Value;
- FeedbackChanged?.Invoke(this, EventArgs.Empty);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml
deleted file mode 100644
index 2ac5107..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Process
-
-
-
-
-
- Safety
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs
deleted file mode 100644
index 6f4ae19..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControl.xaml.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-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.Navigation;
-using System.Windows.Shapes;
-
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für ProcessIntlkButtonControl.xaml
- ///
- public partial class IntlkButtonControl : UserControl
- {
- public IntlkButtonControl()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControlVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControlVM.cs
deleted file mode 100644
index 8b66b64..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockControl/IntlkControlVM.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace HMIToolkit;
-
-public sealed partial class IntlkControlVM : ObservableObject, IDisposable
-{
- [ObservableProperty]
- private bool xProcessIntlkOk;
-
- [ObservableProperty]
- private bool xSafetyIntlkOk;
-
- [ObservableProperty]
- private IntlkDetailsVM safetyInterlocksVM;
-
- [ObservableProperty]
- private IntlkDetailsVM processInterlocksVM;
-
- private IntlkDetailsWindow? processIntlksDetailsWindow;
- private IntlkDetailsWindow? safetyIntlksDetailsWindow;
-
- private readonly string _variableName;
-
- private IAdsManager? _adsManager;
-
- public IntlkControlVM()
- {
- XProcessIntlkOk = false;
- XSafetyIntlkOk = false;
- _variableName = string.Empty;
- safetyInterlocksVM = new();
- processInterlocksVM = new();
- }
-
- public IntlkControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- SafetyInterlocksVM = new IntlkDetailsVM(_adsManager, _variableName + ".wSafetyINTLKStatus", _variableName + ".asSafetyINTLKName", "Safety Interlock");
- ProcessInterlocksVM = new IntlkDetailsVM(_adsManager, _variableName + ".wProcessINTLKStatus", _variableName + ".asProcessINTLKName", "Process Interlock");
-
- _adsManager.Register(_variableName + ".xProcessINTLKOk", ProcessIntlkOkChanged);
- _adsManager.Register(_variableName + ".xSafetyINTLKOk", SafetyIntlkOkChanged);
- }
-
- public void Dispose()
- {
- SafetyInterlocksVM.Dispose();
- ProcessInterlocksVM.Dispose();
-
- _adsManager?.Deregister(_variableName + ".xProcessINTLKOk", ProcessIntlkOkChanged);
- _adsManager?.Deregister(_variableName + ".xSafetyINTLKOk", SafetyIntlkOkChanged);
-
- processIntlksDetailsWindow?.Close();
- safetyIntlksDetailsWindow?.Close();
-
- _adsManager = null;
- }
-
- private void ProcessIntlkOkChanged(object? sender, ValueChangedEventArgs e)
- {
- XProcessIntlkOk = (bool)e.Value;
- }
-
- private void SafetyIntlkOkChanged(object? sender, ValueChangedEventArgs e)
- {
- XSafetyIntlkOk = (bool)e.Value;
- }
-
- [RelayCommand]
- private void ShowProcessIntlks()
- {
- if (_adsManager != null && processIntlksDetailsWindow == null)
- {
- processIntlksDetailsWindow = new() { DataContext = ProcessInterlocksVM };
- processIntlksDetailsWindow.Closed += ProcessIntlksDetailsWindow_Closed;
- processIntlksDetailsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
- processIntlksDetailsWindow.Show();
- }
- }
-
- private void ProcessIntlksDetailsWindow_Closed(object? sender, EventArgs e)
- {
- processIntlksDetailsWindow!.Close();
- processIntlksDetailsWindow = null;
- }
-
- [RelayCommand]
- private void ShowSafetyIntlks()
- {
- if (_adsManager != null && safetyIntlksDetailsWindow == null)
- {
- safetyIntlksDetailsWindow = new() { DataContext = SafetyInterlocksVM };
- safetyIntlksDetailsWindow.Closed += SafetyIntlksDetailsWindow_Closed;
- safetyIntlksDetailsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
- safetyIntlksDetailsWindow.Show();
- }
- }
-
- private void SafetyIntlksDetailsWindow_Closed(object? sender, EventArgs e)
- {
- safetyIntlksDetailsWindow!.Close();
- safetyIntlksDetailsWindow = null;
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml
deleted file mode 100644
index c45ae3d..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs
deleted file mode 100644
index b331460..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetails.xaml.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-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.Navigation;
-using System.Windows.Shapes;
-
-namespace HMIToolkit
-{
- ///
- /// Interaktionslogik für IntlkDetails.xaml
- ///
- public partial class IntlkDetails : UserControl
- {
- public IntlkDetails()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs
deleted file mode 100644
index 7f6b3aa..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsVM.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.Collections;
-using System.Windows;
-using System.Windows.Controls;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace HMIToolkit
-{
- public sealed partial class IntlkDetailsVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private string interlockName;
-
- [ObservableProperty]
- private BitArray interlockStatus;
-
- [ObservableProperty]
- private string[] interlockNames;
-
- [ObservableProperty]
- private ListBoxItem[] listBoxItemsLeft;
-
- [ObservableProperty]
- private ListBoxItem[] listBoxItemsRight;
-
- [ObservableProperty]
- private Visibility isVisible;
-
- private readonly BoolToBrushConverter boolToBrushConverter = new();
-
- private readonly int numIntlksLeftSide;
- private readonly int numIntlksRightSide;
-
- private readonly string _variableNameStatus;
- private readonly string _variableNameNames;
-
- private IAdsManager? _adsManager;
-
- public IntlkDetailsVM()
- {
- interlockName = "Interlocks";
- interlockStatus = new BitArray(HMIConstants.NumInterlocks);
- interlockNames = new string[HMIConstants.NumInterlocks];
- Array.Fill(interlockNames, "Not used");
-
- // Split all interlocks into two parts
- numIntlksLeftSide = (int)Math.Ceiling(HMIConstants.NumInterlocks * 0.5);
- numIntlksRightSide = HMIConstants.NumInterlocks - numIntlksLeftSide;
-
- listBoxItemsLeft = new ListBoxItem[numIntlksLeftSide];
- listBoxItemsRight = new ListBoxItem[numIntlksRightSide];
-
- _variableNameStatus = System.String.Empty;
- _variableNameNames = System.String.Empty;
-
- // CreateContent();
- }
-
- public IntlkDetailsVM(IAdsManager adsManager, string variableNameStatus, string variableNameNames, string intlkName) : this()
- {
- interlockName = intlkName;
- _variableNameStatus = variableNameStatus;
- _variableNameNames = variableNameNames;
- _adsManager = adsManager;
-
- interlockStatus = new BitArray(HMIConstants.NumInterlocks);
- interlockNames = new string[HMIConstants.NumInterlocks];
-
- _adsManager.Register(_variableNameStatus, InterlockStatusChanged);
- _adsManager.Register(_variableNameNames, InterlockNamesChanged);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableNameStatus, InterlockStatusChanged);
- _adsManager?.Deregister(_variableNameNames, InterlockNamesChanged);
-
- _adsManager = null;
- }
-
- /*private void CreateContent()
- {
- // Create left side
- for (int i = 0; i < HMIConstants.NumInterlocks; i++)
- {
- // Create the stack panel
- StackPanel stackPanel = new StackPanel
- {
- Orientation = Orientation.Horizontal
- };
-
- // Create the box
- //
- Rectangle rectangle = new Rectangle
- {
- Width = 10,
- Height = 10,
- RadiusX = 2,
- RadiusY = 2
- };
-
- // Create binding
- Binding binding = new()
- {
- Source = this,
- Path = new PropertyPath("InterlockStatus[" + i + "]"),
- Converter = boolToBrushConverter,
- };
-
- // Set binding
- rectangle.SetBinding(Rectangle.FillProperty, binding);
-
- // Create label
- Label label = new();
- binding = new()
- {
- Source = this,
- Path = new PropertyPath("InterlockNames[" + i + "]")
- };
- label.SetBinding(Label.ContentProperty, binding);
-
- // Add items to stack panel
- stackPanel.Children.Add(rectangle);
- stackPanel.Children.Add(label);
-
- // Add stack panel to listbox items
- ListBoxItem tempListBoxItem = new()
- {
- Content = stackPanel
- };
- if (i < numIntlksLeftSide)
- ListBoxItemsLeft[i] = tempListBoxItem;
- else
- ListBoxItemsRight[i - numIntlksLeftSide] = tempListBoxItem;
- }
-
- }*/
-
- private void InterlockStatusChanged(object? sender, ValueChangedEventArgs e)
- {
- ushort temp = (ushort)e.Value;
- InterlockStatus = new BitArray(BitConverter.GetBytes(temp));
- }
-
- private void InterlockNamesChanged(object? sender, ValueChangedEventArgs e)
- {
- InterlockNames = (string[])e.Value;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml
deleted file mode 100644
index 695641c..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs
deleted file mode 100644
index f1bb72d..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/InterlockDetailsControl/IntlkDetailsWindow.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-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 HMIToolkit
-{
- ///
- /// Interaktionslogik für IntlkDetailsWindow.xaml
- ///
- public partial class IntlkDetailsWindow : Window
- {
- public IntlkDetailsWindow()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs b/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs
deleted file mode 100644
index 332eb81..0000000
--- a/uniper_hmi_old/UniperHMI/HMIToolkit/HMIObjects/structures/HMIDataTypes.cs
+++ /dev/null
@@ -1,218 +0,0 @@
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace HMIToolkit
-{
- // PLC - C#
- // --------
- // int - short
- // word - ushort
-
- // Constants for interaction with data
- public static class HMIConstants
- {
- public const int StringLength = 81;
- public const int NumInterlocks = 16;
- }
-
-
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIAnalogValue
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
-
- // 1 = Ok, 2 = Error
- public short iStatus;
-
- public float rValue;
-
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sUnit;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
-
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIControlButton
- {
- [MarshalAs(UnmanagedType.I1)]
- public bool xRequest;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xRelease;
-
- public short iFeedback;
- }
-
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIInterlock
- {
- public ushort wProcessINTLKStatus;
-
- public ushort wSafeyINTLKStatus;
-
- public ushort wProcessINTLKUsed;
-
- public ushort wSafeyINTLKUsed;
-
- // 16 * String(80) = 81 bytes a 16 indexes
- // combined in one string because reading a two dimensional array is not possible
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = HMIConstants.StringLength * HMIConstants.NumInterlocks)]
- public byte[] asProcessINTLKName;
-
- // 16 * String(80) = 81 bytes a 16 indexes
- // combined in one string because reading a two dimensional array is not possible
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = HMIConstants.StringLength * HMIConstants.NumInterlocks)]
- public byte[] asSafetyINTLKName;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xProcessINTLKOk;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xSafetyINTLKOk;
- }
-
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIValveData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
-
- public HMIControlButton stAutomaticButton;
-
- public HMIControlButton stManualButton;
-
- public HMIControlButton stOpenButton;
-
- public HMIControlButton stCloseButton;
-
- // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
- public short iStatus;
-
- // 1 = Automatic mode, 2 = Manual mode
- public short iCurrentMode;
-
- public HMIInterlock stInterlock;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
-
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIAnalogValveData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
-
- public HMIControlButton stAutomaticButton;
-
- public HMIControlButton stManualButton;
-
- public HMIControlButton stOpenButton;
-
- public HMIControlButton stCloseButton;
-
- // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
- public short iStatus;
-
- // 1 = Automatic mode, 2 = Manual mode
- public short iCurrentMode;
-
- public HMIInterlock stInterlock;
-
- HMIAnalogValue stSetpoint;
-
- HMIAnalogValue stProcessValue;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
-
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIAnalogMotorData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
-
- public HMIControlButton stAutomaticButton;
-
- public HMIControlButton stManualButton;
-
- public HMIControlButton stStartButton;
-
- public HMIControlButton stStopButton;
-
- // 1 = Opened, 2 = Opening/Closing, 3 = Closed, 4 = Error
- public short iStatus;
-
- // 1 = Automatic mode, 2 = Manual mode
- public short iCurrentMode;
-
- public HMIAnalogValue stSetpoint;
-
- public HMIAnalogValue stProcessValue;
-
- public HMIInterlock stInterlock;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
-
- // TwinCAT2 Pack = 1, TwinCAT 3 Pack = 0
- [StructLayout(LayoutKind.Sequential, Pack = 0)]
- public struct HMIOrpSensorData
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = HMIConstants.StringLength)]
- public string sName;
-
- // 1 = Ok, 2 = Error
- public short iStatus;
-
- public float rValuePH;
-
- public float rValueTemp;
-
- public float rValueORP;
-
- public float rValueDLI;
-
- [MarshalAs(UnmanagedType.I1)]
- public bool xUsed;
- }
-
- static class HMIUtilities
- {
- // Converts the interlock byte array into a string array
- public static string[] GetInterlockStringArray(byte[] byteArray)
- {
- string[] temp = new string[HMIConstants.NumInterlocks];
- int size;
-
- // Check if byteArray is of correct size
- if (byteArray.Length != (HMIConstants.StringLength * HMIConstants.NumInterlocks))
- return temp;
-
- for (int i = 0; i < HMIConstants.NumInterlocks; i++)
- {
- // Calculate length of string by finding the 0 terminator so the unused bytes get truncated
- size = Array.IndexOf(byteArray, (byte)0, i * HMIConstants.StringLength) - (i * HMIConstants.StringLength);
-
- // Check if we found a valid 0 terminator
- if (size >= 0)
- // Build string from byteArray with calculated size
- temp[i] = Encoding.ASCII.GetString(byteArray, i * HMIConstants.StringLength, size);
- else
- // No valid 0 string terminator was found so return an empty string
- temp[i] = "";
- }
-
- return temp;
- }
- }
-}
\ No newline at end of file
diff --git a/uniper_hmi_old/UniperHMI/InfineonHMI.csproj b/uniper_hmi_old/UniperHMI/InfineonHMI.csproj
deleted file mode 100644
index b1d2dda..0000000
--- a/uniper_hmi_old/UniperHMI/InfineonHMI.csproj
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
- WinExe
- net8.0-windows8.0
- enable
- enable
- true
- 0.1.0
- 0.1
- AnyCPU;x64
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bin\x64\Debug\net8.0-windows8.0\AdsManager.dll
-
-
-
-
-
- Always
-
-
-
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
-
-
-
- PreserveNewest
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/MainWindow.xaml b/uniper_hmi_old/UniperHMI/MainWindow.xaml
deleted file mode 100644
index 79b1fa6..0000000
--- a/uniper_hmi_old/UniperHMI/MainWindow.xaml
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/MainWindow.xaml.cs b/uniper_hmi_old/UniperHMI/MainWindow.xaml.cs
deleted file mode 100644
index 96af677..0000000
--- a/uniper_hmi_old/UniperHMI/MainWindow.xaml.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using HMIToolkit;
-using MahApps.Metro.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow
- {
-
-
- public MainWindow(MainWindowVM mainWindowVM)
- {
- this.DataContext = mainWindowVM;
- InitializeComponent();
- Closed += OnClosedEvent;
- }
-
- private void OnClosedEvent(object? sender, EventArgs e)
- {
- if (DataContext is IDisposable dataContext)
- dataContext.Dispose();
- }
- }
-}
\ No newline at end of file
diff --git a/uniper_hmi_old/UniperHMI/MainWindowVM.cs b/uniper_hmi_old/UniperHMI/MainWindowVM.cs
deleted file mode 100644
index 85896e8..0000000
--- a/uniper_hmi_old/UniperHMI/MainWindowVM.cs
+++ /dev/null
@@ -1,298 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using System.Windows;
-using System.Windows.Controls;
-using TcEventLoggerAdsProxyLib;
-using InfineonHMI.Pages.Views;
-
-namespace InfineonHMI;
-
-public sealed partial class MainWindowVM : ObservableObject, IRecipient, IDisposable
-{
-
- [ObservableProperty] private StringControlButtonVM dummyStringVM;
-
- [ObservableProperty] private Page currentPage;
-
- [ObservableProperty] private Visibility statusBarVisible;
-
- [ObservableProperty] private string breadcrumb;
-
- [ObservableProperty] private string actualUser;
-
- private const string _actualUserPrefix = "Aktueller Benutzer: \n";
-
- private readonly IAdsManager _adsManager;
- private readonly IConfiguration _config;
- private readonly TcEventLogger _eventlogger;
-
- // Last active event
- [ObservableProperty] private string currentActiveEvent = "";
-
- private readonly object _lock = new();
-
- // Empty page
- private readonly Page _emptyPage;
-
- // Last navigate message
- private readonly Stack _messageStack = new();
- NavigateMessage? _currentMessage;
-
- // Events page view model
- [ObservableProperty] EventsPageVM _eventsPageVM;
-
- // Settings page viem model
- SettingsPageVM? _settingsPageVM;
-
- ProductionOverviewPageVM? _productionOverviewPageVM;
-
- private MachineOverviewPageVM? _machineOverviewPageVM;
-
- // Hot Coolplate page view model
- HotCoolPlatePageVM? _hotCoolplatePageVM;
-
-
- // Kuka Robot page view model
- ReceipePageVM? _receipePageVM;
-
- public MainWindowVM(IAdsManager adsManager, IConfiguration config, TcEventLogger eventLogger)
- {
- _adsManager = adsManager;
- _config = config;
-
- ActualUser = _actualUserPrefix + "---------";
- // Create dummy string
- DummyStringVM = new StringControlButtonVM();
-
- // Create empty page
- _emptyPage = new();
-
- // Create events page viewmodel
- _eventlogger = eventLogger;
- _eventsPageVM = new(_eventlogger);
-
- CurrentPage = _emptyPage;
- _currentMessage = new NavigateMessage("", typeof(Page));
- _messageStack.Push(_currentMessage);
-
- WeakReferenceMessenger.Default.Register(this);
-
- breadcrumb = "";
- }
-
- public void NavigateFromOuterPage(NavigateMessage message, NavigateMessage nextMessage)
- {
- _currentMessage = message;
-
- Navigate(message, nextMessage);
- }
-
-
- [RelayCommand]
- private void SettingsWindow()
- {
- StatusBarVisible = Visibility.Visible;
- _messageStack.Clear();
- NavigateMessage message = new("", typeof(SettingsPage));
- Receive(message);
- }
-
- [RelayCommand]
- private void ChangeUserClicked()
- {
-
- }
-
- [RelayCommand]
- private void WorkingModeSelectionClicked()
- {
-
- }
-
- [RelayCommand]
- private void OverviewWindowClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config[""]!, typeof(MachineOverviewPage));
- Receive(message);
- }
-
- [RelayCommand]
- private void ProductionWindowClicked()
- {
- StatusBarVisible = Visibility.Visible;
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config[""]!, typeof(ProductionOverviewPage));
- Receive(message);
- }
-
- [RelayCommand]
- private void ProtocolWindowClicked()
- {
- }
-
- [RelayCommand]
- private void ReceipesWindowClicked()
- {
- StatusBarVisible = Visibility.Visible;
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config[""]!, typeof(ReceipePage));
- Receive(message);
- }
-
- [RelayCommand]
- private void TrendWindowClicked()
- {
- }
-
- [RelayCommand]
- private void ComponentsWindowClicked()
- {
- }
-
- [RelayCommand]
- private void SettingsWindowClicked()
- {
- _messageStack.Clear();
- NavigateMessage message = new("", typeof(SettingsPage));
- Receive(message);
- }
-
-
- [RelayCommand]
- public void EventsListClicked()
- {
- StatusBarVisible = Visibility.Collapsed;
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new("", typeof(EventsPage));
- Receive(message);
- }
-
-
-
- // Only use for forward traversal!
- public void Receive(NavigateMessage message)
- {
- // Only change page if its a new page type
- if (CurrentPage.GetType() == message.type)
- return;
-
- // Push current message
- if (_currentMessage != null)
- _messageStack.Push(_currentMessage);
-
- // Save current message for later push
- _currentMessage = message;
-
-
- Navigate(message);
- }
-
- private void Navigate(NavigateMessage message, NavigateMessage? nextMessage = null)
- {
- // Dispose current pages viewmodel
- if (CurrentPage.DataContext is IDisposable viewModel)
- {
- CurrentPage.DataContext = null;
- viewModel.Dispose();
- }
-
- // Create new page
- switch (message.type.Name)
- {
- case nameof(ProductionOverviewPage):
-
- if (_productionOverviewPageVM == null || nextMessage != null)
- _productionOverviewPageVM = new ProductionOverviewPageVM(_adsManager, _config, _eventlogger, nextMessage);
- ProductionOverviewPage productionOverviewPage = new() { DataContext = _productionOverviewPageVM };
- CurrentPage = productionOverviewPage;
- break;
-
- case nameof(MachineOverviewPage):
- _machineOverviewPageVM?.Dispose();
-
- _machineOverviewPageVM = new MachineOverviewPageVM(_adsManager, _config,this, new ProductionOverviewPageVM(_adsManager, _config, _eventlogger), _eventlogger);
- MachineOverviewPage machineOverviewPage = new() { DataContext = _machineOverviewPageVM };
- CurrentPage = machineOverviewPage;
- break;
-
- case nameof(EventsPage):
-#pragma warning disable MVVMTK0034 // Direct field reference to [ObservableProperty] backing field
- EventsPage eventsPage = new() { DataContext = _eventsPageVM };
-#pragma warning restore MVVMTK0034 // Direct field reference to [ObservableProperty] backing field
- CurrentPage = eventsPage;
- Breadcrumb = " > Events";
- break;
-
- case nameof(SettingsPage):
- // Create seetings page view model only once
- if (_settingsPageVM == null)
- _settingsPageVM = new(_adsManager, "GVL_CONFIG.stUnitConfig");
-
- SettingsPage settingsPage = new() { DataContext = _settingsPageVM };
- CurrentPage = settingsPage;
- Breadcrumb = " > Settings";
- break;
-
- case nameof(ReceipePage):
- if (_receipePageVM == null)
- _receipePageVM = new();
-
- ReceipePage receipePage = new() { DataContext = _receipePageVM };
- CurrentPage = receipePage;
- Breadcrumb = " > Kuka Roboter";
- break;
-
-
-
- case nameof(HotCoolPlatePage):
- if (_hotCoolplatePageVM == null)
- _hotCoolplatePageVM = new(_adsManager, "GVL_Config.stHotCoolplateConfig");
-
- HotCoolPlatePage hotCoolPlatePage = new() {DataContext = _hotCoolplatePageVM };
- CurrentPage = hotCoolPlatePage;
- Breadcrumb = " > Heiz- /Kühlplatte";
- break;
-
-
-
- default:
- CurrentPage = new Page();
- break;
- }
- }
-
- private void AppendBreadcrumb(string path)
- {
- if (Breadcrumb[^1] != ' ')
- Breadcrumb += " > " + path;
- else
- Breadcrumb += "> " + path;
- }
-
- [RelayCommand]
- private void AckAlarms()
- {
- _adsManager.WriteValue("GVL_SCADA.stConfirmAlarmsBtn.xRequest", true);
- }
-
- public void Dispose()
- {
- // Dispose current pages viewmodel
- if (CurrentPage.DataContext is IDisposable viewModel)
- {
- CurrentPage.DataContext = null;
- viewModel.Dispose();
- }
-
- DummyStringVM.Dispose();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Model/Models.cs b/uniper_hmi_old/UniperHMI/Model/Models.cs
deleted file mode 100644
index 4adee16..0000000
--- a/uniper_hmi_old/UniperHMI/Model/Models.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace InfineonHMI.Model
-{
- public enum E_BMS_CONTROL_MODE : short
- {
- AUTO_REMOTE = 1,
- AUTO_LOCAL = 2,
- SAFETY_CHECK = 3,
- CAPACITY_TEST = 4,
- MANUAL = 5
- }
-
- public class BMSControlModeEntry(E_BMS_CONTROL_MODE mode, string name)
- {
- public E_BMS_CONTROL_MODE eMode = mode;
- public string Name = name;
-
- public override string ToString()
- {
- return Name;
- }
- }
-
- public enum PLCJobenum : short
- {
- NONE = 0,
- SCAN_QR_CODE = 10,
- VACUUM_ON_ALIGNER = 15,
- VACUUM_OFF_ALIGNER = 16,
- VACUUM_ON_ETCHER_1 = 20,
- VACUUM_ON_ETCHER_2 = 21,
- VACUUM_OFF_ETCHER_1 = 22,
- VACUUM_OFF_ETCHER_2 = 23,
- CHUCK_OPEN_ETCHER_1 = 60,
- CHUCK_OPEN_ETCHER_2 = 61,
- CHUCK_CLOSE_ETCHER_1 = 62,
- CHUCK_CLOSE_ETCHER_2 = 63,
- }
- public enum RobotJobenum : short
- {
- NONE = 0,
- PICK_TRAYFEEDER = 10,
- PLACE_TRAYFEEDER = 11,
- PUT_ALIGNMENT = 15,
- PICK_ALIGNMENT = 16,
- PUT_ETCHER_1 = 20,
- PUT_ETCHER_2 = 21,
- PICK_ETCHER_1 = 22,
- PICK_ETCHER_2 = 23,
- SWITCH_ETCHER_1 = 24,
- SWITCH_ETCHER_2 = 25,
- PUT_HVTEST_HOT = 30,
- PUT_HVTEST_COLD = 31,
- PICK_HVTEST_HOT = 32,
- PICK_HVTEST_COLD = 33,
- PUT_HOTPLATE = 40,
- PICK_HOTPLATE = 41,
- PUT_COOLPLATE = 42,
- PICK_COOLPLATE = 43,
- PICK_GRIPPER = 50,
- PICK_CHUCK_ETCHER_1 = 60,
- PICK_CHUCK_ETCHER_2 = 61,
- PUT_CHUCK_ETCHER_1 = 62,
- PUT_CHUCK_ETCHER_2 = 63,
- PUT_CHUCK_MAGAZIN = 64,
- PICK_CHUCK_MAGAZIN = 65,
- PUT_NIO_STATION = 70,
- PICK_NIO_STATION = 71,
- WARMUP = 80
- }
- public class PLCJobentry(PLCJobenum job, string name)
- {
- public PLCJobenum eJob = job;
- public string Name = name;
-
- public override string ToString()
- {
- return Name;
- }
- }
-
- public class RobotJobentry(RobotJobenum job, string name)
- {
- public RobotJobenum eJob = job;
- public string Name = name;
-
- public override string ToString()
- {
- return Name;
- }
- }
-
- public enum Stationenum : uint
- {
- EINGABE = 1,
- QRCODE = 2,
- AUSRICHTEN = 4,
- AETZEN = 8,
- HEIZPLATTE = 16,
- KUEHLPLATTE = 32,
- HOCHVOLTHEISS = 64,
- HOCHVOLTKALT = 128,
- AUSGABE = 256,
- NIOSTATION = 512
- }
-
-
- public class StationEntry(Stationenum station, string name)
- {
- public Stationenum eStation = station;
- public string sName = name;
-
- public override string ToString()
- {
- return sName;
- }
- }
-
- public class FlowReceipeEntry()
- {
- public int NodeId { get; set; }
- public UInt16 Priority { get; set; }
- public required StationEntry Station { get; set; }
- public UInt16 MaxRetries { get; set; }
-
- public int NextNodeSuccess { get; set; }
- public int NextNodeRetry { get; set; }
- public int NextNodeFail { get; set; }
-
-
- }
-
-}
diff --git a/uniper_hmi_old/UniperHMI/Model/ReceipeDto.cs b/uniper_hmi_old/UniperHMI/Model/ReceipeDto.cs
deleted file mode 100644
index f36fa5b..0000000
--- a/uniper_hmi_old/UniperHMI/Model/ReceipeDto.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-using System.IO;
-using System.Reflection.PortableExecutable;
-using System.Xml;
-using System.Xml.Serialization;
-using InfineonHMI.Common;
-
-namespace InfineonHMI.Model;
-
-public class ReceipeDto
-{
-
- public ReceipeDto()
- {
- ReceipeObject = new ReceipeObject();
- }
-
- public ReceipeObject ReceipeObject { get; set; }
- public void Write(string filename)
- {
- L4ItXmlSerializer.SerializeObject(ReceipeObject, filename);
- }
-
- public void Read(string filename)
- {
- ReceipeObject = L4ItXmlSerializer.DeSerializeObject(filename);
- }
-}
-
-public class ReceipeObject
-{
- public MachineParameters MachineParameters { get; set; }
- public ProductParameters ProductParameters { get; set; }
- public ReceipeHotplate ReceipeHotplate { get; set; }
- public ReceipeCoolplate ReceipeCoolplate { get; set; }
- public ReceipeEtcher ReceipeEtcher { get; set; }
- public ReceipeHighvoltageTester ReceipeHvTester { get; set; }
-
- public FlowReceipe Flowreceipe { get; set; }
-
-
- public ReceipeObject()
- {
- MachineParameters = new MachineParameters();
- ProductParameters = new ProductParameters();
- ReceipeHotplate = new ReceipeHotplate();
- ReceipeCoolplate = new ReceipeCoolplate();
- ReceipeEtcher = new ReceipeEtcher();
- ReceipeHvTester = new ReceipeHighvoltageTester();
- Flowreceipe = new FlowReceipe();
- }
-
-}
-
-
-
-public class MachineParameters
-{
- public List TrayPositions { get; set; }
-
- public int CameraPrograms { get; set; }
-
- public int Chucks { get; set; }
-
- public int Gripper { get; set; }
-
- ///
- /// Erlaubten Strahlparameter Abweichungen
- ///
- public float PermissibleBeamParameterDeviations { get; set; }
-
- public MachineParameters()
- {
- TrayPositions = new List();
- }
-}
-
-public class ProductParameters
-{
- public float Diameter { get; set; }
-
- public float Thickness { get; set; }
-
- public float TimeIntervallBeamCheck { get; set; }
-
-
-}
-
-public class ReceipeHotplate
-{
- public float RestingTime { get; set; }
- public float TargetTemperature { get; set; }
-}
-public class ReceipeCoolplate
-{
- public float RestingTime { get; set; }
- public float TargetTemperature { get; set; }
-}
-
-public class ReceipeHighvoltageTester
-{
- ///
- /// Test voltage in V
- ///
- public float TestVoltage { get; set; }
-
- ///
- /// Maximum test Current
- ///
- public float MaximumTestCurrent { get; set; }
-
- ///
- /// Ramp Time in milliseconds
- ///
- public float RampTime { get; set; }
-
- ///
- /// Testfrequency in HZ
- ///
- public float TestFrequency { get; set; }
-
- ///
- /// Polarity 1=Positive, 2=Negative
- ///
- public UInt16 Polarity { get; set; }
-
- ///
- /// Overpressure N2 in mbar
- ///
- public float TestpressureN2 { get; set; }
-
- ///
- /// N2 pre purging time in seconds
- ///
- public float N2PrePurgetime { get; set; }
-
- ///
- /// Test retries
- ///
- public UInt16 NumRetries { get; set; }
-
- ///
- /// Temperature for testing (only used in heated HV station)
- ///
- public float TestTemperature { get; set; }
-
- ///
- /// Test OK Voltage
- ///
- public float TestOkVoltage { get; set; }
-
- ///
- /// Test OK Current
- ///
- public float TestOkCurrent { get; set; }
-
-}
-
-public class ReceipeEtcher
-{
- ///
- /// Number of Robot positions
- ///
- public UInt16 NumberRobotPos { get; set; }
-
- public float Rpm { get; set; }
-
- ///
- /// Roboter position and setting data
- ///
- public List RobotStepData { get; set; }
-
- ///
- /// Radial position of water jet under the blank in mm
- ///
- public float RadialPosLowerWaterJet { get; set; }
-
- public ReceipeEtcher()
- {
- RobotStepData = new List();
- }
-
-}
-
-public class EtcherRobotStepData
-{
- public float PosX { get; set; }
- public float PosY { get; set; }
- public float PosZ { get; set; }
- public float AngleAlpha { get; set; }
- public float MoveSpeed { get; set; }
- public float Delay { get; set; }
- public UInt16 Medium { get; set; }
- public bool WaterFromBelow { get; set; }
- public bool WaterFromAbove { get; set; }
-
-}
-
-public class FlowReceipe
-{
- public int NodeCount { get; set; }
- public List Nodes { get; set; }
-
- public FlowReceipe()
- {
- Nodes = new List();
- }
-}
-
-public class FlowReceipeNode
-{
- public UInt16 Priority { get; set; }
- public Int32 StationType { get; set; }
-
- public UInt16 MaxRetries { get; set; }
- public int NextNodeSuccess { get; set; }
- public int NextNodeRetry { get; set; }
- public int NextNodeFail { get; set; }
-}
-
-public class TrayPosition
-{
- public int PosId { get; set; }
- public float PosX { get; set; }
- public float PosY { get; set; }
-}
\ No newline at end of file
diff --git a/uniper_hmi_old/UniperHMI/NavigateMessage.cs b/uniper_hmi_old/UniperHMI/NavigateMessage.cs
deleted file mode 100644
index 30c4284..0000000
--- a/uniper_hmi_old/UniperHMI/NavigateMessage.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace InfineonHMI;
-
-public record class NavigateMessage(string VariableName, Type type, string Header = "");
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/ModuleControlButtonVM.cs b/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/ModuleControlButtonVM.cs
deleted file mode 100644
index 5367d66..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/ModuleControlButtonVM.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-
-namespace UniperHMI;
-
-public sealed partial class ModuleControlButtonVM : SMUBaseVM, IDisposable
-{
- public ModuleControlButtonVM() : base() { }
-
- public ModuleControlButtonVM(IAdsManager adsManager, string variableName) : base(adsManager, variableName) { }
-
- [RelayCommand]
- private void Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName, typeof(ModuleOverviewPage)));
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/SMUBaseVM.cs b/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/SMUBaseVM.cs
deleted file mode 100644
index e07e3a1..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/SMUBaseVM.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using Heisig.HMI.AdsManager;
-using TwinCAT.TypeSystem;
-
-namespace InfineonHMI;
-
-public enum E_COMPONENT_STATUS : short
-{
- OFF = 0,
- ON = 1,
- CHARGING = 2,
- DISCHARGING = 3,
- ERROR = 4
-}
-
-public partial class SMUBaseVM : ObservableObject, IDisposable
-{
- [ObservableProperty]
- protected float voltage;
-
- [ObservableProperty]
- protected E_COMPONENT_STATUS status;
-
- protected readonly string _variableName;
-
- protected readonly IAdsManager? _adsManager;
-
- public SMUBaseVM()
- {
- _variableName = string.Empty;
- _adsManager = null;
- voltage = 0.0f;
- status = E_COMPONENT_STATUS.OFF;
- }
-
- public SMUBaseVM(IAdsManager adsManager, string variableName)
- {
- Status = E_COMPONENT_STATUS.OFF;
- _adsManager = adsManager;
- _variableName = variableName;
-
- _adsManager!.Register(_variableName + ".rVoltage", VoltageChanged);
- _adsManager.Register(_variableName + ".eStatus", StatusChanged);
- }
- protected void VoltageChanged(object? sender, ValueChangedEventArgs e)
- {
- Voltage = (float)e.Value;
- }
-
- protected void StatusChanged(object? sender, ValueChangedEventArgs e)
- {
- Status = (E_COMPONENT_STATUS)((short)e.Value);
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName + ".rVoltage", VoltageChanged);
- _adsManager?.Deregister(_variableName + ".eStatus", StatusChanged);
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/StringControlButtonVM.cs b/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/StringControlButtonVM.cs
deleted file mode 100644
index b998e00..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/StringControlButtonVM.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using Heisig.HMI.AdsManager;
-
-namespace InfineonHMI;
-
-public sealed partial class StringControlButtonVM : SMUBaseVM, IDisposable
-{
- public StringControlButtonVM() : base() { }
-
- public StringControlButtonVM(IAdsManager adsManager, string variableName) : base(adsManager, variableName) { }
-
- //[RelayCommand]
- //private void Clicked()
- //{
- // WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName, typeof(StringOverviewPage)));
- //}
-}
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/UnitControlButtonVM.cs b/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/UnitControlButtonVM.cs
deleted file mode 100644
index 76daf11..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/UnitControlButtonVM.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-
-namespace InfineonHMI.OwnControls
-{
- public sealed partial class UnitControlButtonVM : SMUBaseVM
- {
- public UnitControlButtonVM() : base() { }
-
- public UnitControlButtonVM(IAdsManager adsManager, string variableName) : base(adsManager, variableName) { }
-
- [RelayCommand]
- private void Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName, typeof(UnitDetailsControl)));
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/UnitDetailsControlVM.cs b/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/UnitDetailsControlVM.cs
deleted file mode 100644
index 82e89b5..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/ViewModels/UnitDetailsControlVM.cs
+++ /dev/null
@@ -1,494 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using HMIToolkit;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace InfineonHMI
-{
- public sealed partial class UnitDetailsControlVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private float rVoltage;
-
- [ObservableProperty]
- private E_COMPONENT_STATUS status;
-
- [ObservableProperty]
- private AnalogValueVM pressureNegolytSegmentInVM;
-
- [ObservableProperty]
- private AnalogValueVM pressureNegolytTankInVM;
-
- [ObservableProperty]
- private AnalogValueVM temperatureNegolytTankInVM;
-
- [ObservableProperty]
- private AnalogValueVM pressurePosolytSegmentInVM;
-
- [ObservableProperty]
- private AnalogValueVM pressurePosolytTankInVM;
-
- [ObservableProperty]
- private AnalogValueVM temperaturePosolytTankInVM;
-
- [ObservableProperty]
- private bool canOpenBothValves;
-
- [ObservableProperty]
- private bool canCloseBothValves;
-
- [ObservableProperty]
- private short feedbackOpenValves;
-
- [ObservableProperty]
- private short feedbackCloseValves;
-
- [ObservableProperty]
- private bool canStartBothPumps;
-
- [ObservableProperty]
- private bool canStopBothPumps;
-
- [ObservableProperty]
- private short feedbackStartPumps;
-
- [ObservableProperty]
- private short feedbackStopPumps;
-
- private float _posolytPumpOnSpeed;
- private float _negolytPumpOnSpeed;
-
- private float valveWindowHorizontalPosition;
-
- private readonly BinaryValveControlVM _valveNegolytVM;
- private readonly BinaryValveControlVM _valvePosolytVM;
- private readonly AnalogMotorControlVM _pumpNegolytVM;
- private readonly AnalogMotorControlVM _pumpPosolytVM;
-
- private BinaryValveWindow? _windowValveNegolyt;
- private BinaryValveWindow? _windowValvePosolyt;
-
- private AnalogMotorWindow? _windowPumpNegolyt;
- private AnalogMotorWindow? _windowPumpPosolyt;
-
- private readonly IAdsManager? _adsManager;
- private readonly string _variableName;
-
- public UnitDetailsControlVM()
- {
- Status = E_COMPONENT_STATUS.OFF;
- rVoltage = 0.0f;
- _variableName = "";
-
- // Negolyt
- PressureNegolytSegmentInVM = new AnalogValueVM();
- PressureNegolytTankInVM = new AnalogValueVM();
- TemperatureNegolytTankInVM = new AnalogValueVM();
- _valveNegolytVM = new BinaryValveControlVM();
- _pumpNegolytVM = new AnalogMotorControlVM();
-
- _windowValveNegolyt = null;
-
- // Posolyt
- PressurePosolytSegmentInVM = new AnalogValueVM();
- PressurePosolytTankInVM = new AnalogValueVM();
- TemperaturePosolytTankInVM = new AnalogValueVM();
- _valvePosolytVM = new BinaryValveControlVM();
- _pumpPosolytVM = new AnalogMotorControlVM();
-
- _windowValvePosolyt = null;
-
- valveWindowHorizontalPosition = 10;
-
- }
-
- public UnitDetailsControlVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
-
- Status = E_COMPONENT_STATUS.OFF;
- rVoltage = 0.0f;
-
-
- // Negolyt
- PressureNegolytSegmentInVM = new AnalogValueVM(_adsManager, _variableName + ".stP21", true);
- PressureNegolytTankInVM = new AnalogValueVM(_adsManager, _variableName + ".stP22", true);
- TemperatureNegolytTankInVM = new AnalogValueVM(_adsManager, _variableName + ".stT21", true);
- _valveNegolytVM = new BinaryValveControlVM(_adsManager, _variableName + ".stNS22");
- _valveNegolytVM.OpenButton.FeedbackChanged += OnValveNegolytOpenFeedbackChanged;
- _valveNegolytVM.CloseButton.FeedbackChanged += OnValveNegolytCloseFeedbackChanged;
- _valveNegolytVM.OpenButton.ReleaseChanged += OnValveNegolytOpenReleaseChanged;
- _valveNegolytVM.CloseButton.ReleaseChanged += OnValveNegolytCloseReleaseChanged;
- _pumpNegolytVM = new AnalogMotorControlVM(_adsManager, _variableName + ".stNS21");
- _pumpNegolytVM.StartButton.FeedbackChanged += OnPumpNegolytStartFeedbackChanged;
- _pumpNegolytVM.StopButton.FeedbackChanged += OnPumpNegolytStopFeedbackChanged;
- _pumpNegolytVM.StartButton.ReleaseChanged += OnPumpNegolytStartReleaseChanged;
- _pumpNegolytVM.StopButton.ReleaseChanged += OnPumpNegolytStopReleaseChanged;
-
-
- // Posolyt
- PressurePosolytSegmentInVM = new AnalogValueVM(_adsManager, _variableName + ".stP11", true);
- PressurePosolytTankInVM = new AnalogValueVM(_adsManager, _variableName + ".stP12", true);
- TemperaturePosolytTankInVM = new AnalogValueVM(_adsManager, _variableName + ".stT11", true);
- _valvePosolytVM = new BinaryValveControlVM(_adsManager, _variableName + ".stNS12");
- _valvePosolytVM.OpenButton.FeedbackChanged += OnValvePosolytOpenFeedbackChanged;
- _valvePosolytVM.CloseButton.FeedbackChanged += OnValvePosolytCloseFeedbackChanged;
- _valvePosolytVM.OpenButton.ReleaseChanged += OnValvePosolytOpenReleaseChanged;
- _valvePosolytVM.CloseButton.ReleaseChanged += OnValvePosolytCloseReleaseChanged;
- _pumpPosolytVM = new AnalogMotorControlVM(_adsManager, _variableName + ".stNS11");
- _pumpPosolytVM.StartButton.FeedbackChanged += OnPumpPosolytStartFeedbackChanged;
- _pumpPosolytVM.StopButton.FeedbackChanged += OnPumpPosolytStopFeedbackChanged;
- _pumpPosolytVM.StartButton.ReleaseChanged += OnPumpPosolytStartReleaseChanged;
- _pumpPosolytVM.StopButton.ReleaseChanged += OnPumpPosolytStopReleaseChanged;
-
-
- // Current status
- _adsManager.Register(_variableName + ".eStatus", StatusChanged);
- _adsManager.Register(_variableName + ".rVoltage", VoltageChanged);
-
-
- // Configured pump speed for on
- _adsManager.Register("GVL_CONFIG.rPumpNegolytOnPower", NegolytPumpOnSpeedChanged);
- _adsManager.Register("GVL_CONFIG.rPumpPosolytOnPower", PosolytPumpOnSpeedChanged);
-
- valveWindowHorizontalPosition = 10;
- }
-
- private void NegolytPumpOnSpeedChanged(object? sender, ValueChangedEventArgs e)
- {
- _negolytPumpOnSpeed = (float)e.Value;
- }
-
- private void PosolytPumpOnSpeedChanged(object? sender, ValueChangedEventArgs e)
- {
- _posolytPumpOnSpeed = (float)e.Value;
- }
-
- private void VoltageChanged(object? sender, ValueChangedEventArgs e)
- {
- RVoltage = (float)e.Value;
- }
-
- public void Dispose()
- {
- // Dispose all necessary view models
- // Negolyt
- PressureNegolytSegmentInVM.Dispose();
- PressureNegolytTankInVM.Dispose();
- TemperatureNegolytTankInVM.Dispose();
- _valveNegolytVM.OpenButton.FeedbackChanged -= OnValveNegolytOpenFeedbackChanged;
- _valveNegolytVM.CloseButton.FeedbackChanged -= OnValveNegolytCloseFeedbackChanged;
- _valveNegolytVM.OpenButton.ReleaseChanged -= OnValveNegolytOpenReleaseChanged;
- _valveNegolytVM.CloseButton.ReleaseChanged -= OnValveNegolytCloseReleaseChanged;
- _valveNegolytVM.Dispose();
- _pumpNegolytVM.Dispose();
-
- // Posolyt
- PressurePosolytSegmentInVM.Dispose();
- PressurePosolytTankInVM.Dispose();
- TemperaturePosolytTankInVM.Dispose();
- _valvePosolytVM.OpenButton.FeedbackChanged -= OnValvePosolytOpenFeedbackChanged;
- _valvePosolytVM.CloseButton.FeedbackChanged -= OnValvePosolytCloseFeedbackChanged;
- _valvePosolytVM.OpenButton.ReleaseChanged -= OnValvePosolytOpenReleaseChanged;
- _valvePosolytVM.CloseButton.ReleaseChanged -= OnValvePosolytCloseReleaseChanged;
- _valvePosolytVM.Dispose();
- _pumpPosolytVM.Dispose();
-
- // Deregister variables
- _adsManager?.Deregister(_variableName + ".eStatus", StatusChanged);
- _adsManager?.Deregister(_variableName + ".rVoltage", VoltageChanged);
- _adsManager?.Deregister("GVL_CONFIG.rPumpNegolytOnPower", NegolytPumpOnSpeedChanged);
- _adsManager?.Deregister("GVL_CONFIG.rPumpPosolytOnPower", PosolytPumpOnSpeedChanged);
-
- // Destroy windows
- _windowValveNegolyt?.Close();
- _windowValvePosolyt?.Close();
- _windowPumpNegolyt?.Close();
- _windowPumpPosolyt?.Close();
- }
-
- private void StatusChanged(object? sender, ValueChangedEventArgs e)
- {
- Status = (E_COMPONENT_STATUS)((short)e.Value);
- }
-
- [RelayCommand]
- private void ShowValveNegolyt()
- {
- if (_adsManager != null && _windowValveNegolyt == null)
- {
- _windowValveNegolyt = new() { DataContext = _valveNegolytVM };
- _windowValveNegolyt.Closed += WindowValveNegolyt_Closed;
- _windowValveNegolyt.Show();
- }
-
- }
-
- private void WindowValveNegolyt_Closed(object? sender, EventArgs e)
- {
- _windowValveNegolyt!.Close();
- _windowValveNegolyt = null;
- }
-
- [RelayCommand]
- private void ShowValvePosolyt()
- {
- if (_adsManager != null && _windowValvePosolyt == null)
- {
- _windowValvePosolyt = new() { DataContext = _valvePosolytVM };
- _windowValvePosolyt.Closed += WindowValvePosolyt_Closed;
- _windowValvePosolyt.Show();
- }
- }
-
- private void WindowValvePosolyt_Closed(object? sender, EventArgs e)
- {
- _windowValvePosolyt!.Close();
- _windowValvePosolyt = null;
- }
-
-
-
- [RelayCommand]
- public void ShowPumpNegolyt()
- {
- if (_adsManager != null && _windowPumpNegolyt == null)
- {
- _windowPumpNegolyt = new() { DataContext = _pumpNegolytVM };
- _windowPumpNegolyt.Closed += WindowPumpNegolyt_Closed;
- _windowPumpNegolyt.Show();
- }
- }
-
- private void WindowPumpNegolyt_Closed(object? sender, EventArgs e)
- {
- _windowPumpNegolyt!.Close();
- _windowPumpNegolyt = null;
- }
-
- [RelayCommand]
- public void ShowPumpPosolyt()
- {
- if (_adsManager != null && _windowPumpPosolyt == null)
- {
- _windowPumpPosolyt = new() { DataContext = _pumpPosolytVM };
- _windowPumpPosolyt.Closed += WindowPumpPosolyt_Closed;
- _windowPumpPosolyt.Show();
- }
- }
-
- [RelayCommand]
- private void OpenBothValves()
- {
- _valveNegolytVM.OpenButton?.ButtonClickedCommand.Execute(null);
- _valvePosolytVM.OpenButton?.ButtonClickedCommand.Execute(null);
- }
-
- [RelayCommand]
- private void CloseBothValves()
- {
- _valveNegolytVM.CloseButton?.ButtonClickedCommand.Execute(null);
- _valvePosolytVM.CloseButton?.ButtonClickedCommand.Execute(null);
- }
-
- private void OnValveNegolytOpenFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateOpenFeedback();
- }
-
- private void OnValvePosolytOpenFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateOpenFeedback();
- }
-
- private void CalculateOpenFeedback()
- {
- if (_valveNegolytVM?.OpenButton.IFeedback == 1 && _valvePosolytVM?.OpenButton.IFeedback == 1)
- FeedbackOpenValves = 1;
- else if (_valveNegolytVM?.OpenButton.IFeedback == 0 && _valvePosolytVM?.OpenButton.IFeedback == 0)
- FeedbackOpenValves = 0;
- else
- FeedbackOpenValves = 2;
- }
-
- private void OnValveNegolytCloseFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateCloseFeedback();
- }
-
- private void OnValvePosolytCloseFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateCloseFeedback();
- }
-
- private void CalculateCloseFeedback()
- {
- if (_valveNegolytVM?.CloseButton.IFeedback == 1 && _valvePosolytVM?.CloseButton.IFeedback == 1)
- FeedbackCloseValves = 1;
- else if (_valveNegolytVM?.CloseButton.IFeedback == 0 && _valvePosolytVM?.CloseButton.IFeedback == 0)
- FeedbackCloseValves = 0;
- else
- FeedbackCloseValves = 2;
- }
-
- private void OnValveNegolytOpenReleaseChanged(object? sender, EventArgs e)
- {
- CalculateOpenRelease();
- }
-
- private void OnValvePosolytOpenReleaseChanged(object? sender, EventArgs e)
- {
- CalculateOpenRelease();
- }
-
- private void CalculateOpenRelease()
- {
- if (_valvePosolytVM == null || _valveNegolytVM == null)
- return;
-
- if (_valveNegolytVM.OpenButton.XRelease && _valvePosolytVM.OpenButton.XRelease)
- CanOpenBothValves = true;
- else
- CanOpenBothValves = false;
- }
-
- private void OnValveNegolytCloseReleaseChanged(object? sender, EventArgs e)
- {
- CalculateCloseRelease();
- }
-
- private void OnValvePosolytCloseReleaseChanged(object? sender, EventArgs e)
- {
- CalculateCloseRelease();
- }
-
- private void CalculateCloseRelease()
- {
- if (_valvePosolytVM == null || _valveNegolytVM == null)
- return;
-
- if (_valveNegolytVM.CloseButton.XRelease && _valvePosolytVM.CloseButton.XRelease)
- CanCloseBothValves = true;
- else
- CanCloseBothValves = false;
- }
-
- [RelayCommand]
- private void StartBothPumps()
- {
- if (_adsManager == null || _pumpNegolytVM == null || _pumpPosolytVM == null)
- return;
-
- _pumpNegolytVM.Setpoint.RValue = _negolytPumpOnSpeed;
- _pumpPosolytVM.Setpoint.RValue = _posolytPumpOnSpeed;
-
- _pumpNegolytVM.StartButton?.ButtonClickedCommand.Execute(null);
- _pumpPosolytVM.StartButton?.ButtonClickedCommand.Execute(null);
- }
-
- [RelayCommand]
- private void StopBothPumps()
- {
- _pumpNegolytVM.StopButton?.ButtonClickedCommand.Execute(null);
- _pumpPosolytVM.StopButton?.ButtonClickedCommand.Execute(null);
- }
-
- private void CalculateStartRelease()
- {
- if (_pumpNegolytVM == null || _pumpPosolytVM == null)
- return;
-
- if (_pumpNegolytVM.StartButton.XRelease && _pumpPosolytVM.StartButton.XRelease)
- CanStartBothPumps = true;
- else
- CanStartBothPumps = false;
- }
-
- private void CalculatStopRelease()
- {
- if (_pumpNegolytVM == null || _pumpPosolytVM == null)
- return;
-
- if (_pumpNegolytVM.StopButton.XRelease && _pumpPosolytVM.StopButton.XRelease)
- CanStopBothPumps = true;
- else
- CanStopBothPumps = false;
- }
-
- private void CalculateStartFeedback()
- {
- if (_pumpNegolytVM == null || _pumpPosolytVM == null)
- return;
-
- if (_pumpNegolytVM.StartButton.IFeedback == 1 && _pumpPosolytVM.StartButton.IFeedback == 1)
- FeedbackStartPumps = 1;
- else if (_pumpNegolytVM.StartButton.IFeedback == 0 && _pumpPosolytVM.StartButton.IFeedback == 0)
- FeedbackStartPumps = 0;
- else
- FeedbackStartPumps = 2;
- }
-
- private void CalculateStopFeedback()
- {
- if (_pumpNegolytVM == null || _pumpPosolytVM == null)
- return;
-
- if (_pumpNegolytVM.StopButton.IFeedback == 1 && _pumpPosolytVM.StopButton.IFeedback == 1)
- FeedbackStopPumps = 1;
- else if (_pumpNegolytVM.StopButton.IFeedback == 0 && _pumpPosolytVM.StopButton.IFeedback == 0)
- FeedbackStopPumps = 0;
- else
- FeedbackStopPumps = 2;
-
- }
-
- private void OnPumpPosolytStopReleaseChanged(object? sender, EventArgs e)
- {
- CalculatStopRelease();
- }
-
- private void OnPumpPosolytStartReleaseChanged(object? sender, EventArgs e)
- {
- CalculateStartRelease();
- }
-
- private void OnPumpPosolytStopFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateStopFeedback();
- }
-
- private void OnPumpPosolytStartFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateStartFeedback();
- }
-
- private void OnPumpNegolytStopReleaseChanged(object? sender, EventArgs e)
- {
- CalculatStopRelease();
- }
-
- private void OnPumpNegolytStartReleaseChanged(object? sender, EventArgs e)
- {
- CalculateStartRelease();
- }
-
- private void OnPumpNegolytStopFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateStopFeedback();
- }
-
- private void OnPumpNegolytStartFeedbackChanged(object? sender, EventArgs e)
- {
- CalculateStartFeedback();
- }
-
- private void WindowPumpPosolyt_Closed(object? sender, EventArgs e)
- {
- _windowPumpPosolyt!.Close();
- _windowPumpPosolyt = null;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/Views/SMUControlButton.xaml b/uniper_hmi_old/UniperHMI/OwnControls/Views/SMUControlButton.xaml
deleted file mode 100644
index 68e41a3..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/Views/SMUControlButton.xaml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/Views/SMUControlButton.xaml.cs b/uniper_hmi_old/UniperHMI/OwnControls/Views/SMUControlButton.xaml.cs
deleted file mode 100644
index 96d038a..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/Views/SMUControlButton.xaml.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Windows;
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für StringControlButton.xaml
- ///
- public partial class SMUControlButton : Button
- {
- public static readonly DependencyProperty SMUNameProperty = DependencyProperty.Register("SMUName", typeof(string), typeof(SMUControlButton));
- public String SMUName
- {
- get { return (string)GetValue(SMUNameProperty); }
- set { SetValue(SMUNameProperty, value); }
- }
-
- public SMUControlButton()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/Views/UnitDetailsControl.xaml b/uniper_hmi_old/UniperHMI/OwnControls/Views/UnitDetailsControl.xaml
deleted file mode 100644
index 976067f..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/Views/UnitDetailsControl.xaml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/OwnControls/Views/UnitDetailsControl.xaml.cs b/uniper_hmi_old/UniperHMI/OwnControls/Views/UnitDetailsControl.xaml.cs
deleted file mode 100644
index d92834f..0000000
--- a/uniper_hmi_old/UniperHMI/OwnControls/Views/UnitDetailsControl.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows;
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für UnitControl.xaml
- ///
- public partial class UnitDetailsControl : UserControl
- {
- public static readonly DependencyProperty UnitNameProperty = DependencyProperty.Register("UnitName", typeof(string), typeof(UnitDetailsControl));
- public String UnitName
- {
- get { return (string)GetValue(UnitNameProperty); }
- set { SetValue(UnitNameProperty, value); }
- }
- public UnitDetailsControl()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/AlignmentStationPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/AlignmentStationPageVM.cs
deleted file mode 100644
index 6f6d8cb..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/AlignmentStationPageVM.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-namespace InfineonHMI
-{
- public sealed partial class AlignmentStationPageVM : ObservableValidator, IDisposable
- {
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- [ObservableProperty]
- private BinaryValveControlVM vacuumValveControlVm;
-
- public AlignmentStationPageVM()
- {
- VacuumValveControlVm = new BinaryValveControlVM();
- }
-
- public AlignmentStationPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- VacuumValveControlVm = new BinaryValveControlVM(_adsManager, _variableName + ".stVacuumValve");
- }
-
-
-
- public void Dispose()
- {
-
- }
-
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs
deleted file mode 100644
index eac5614..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-using UniperHMI.Model;
-
-namespace UniperHMI
-{
-
-
-
- public sealed partial class AutomaticModePageVM : ObservableValidator, IDisposable
- {
- private int _setpoint;
-
- [Range(-40000, 40000)]
- public int Setpoint
- {
- get => this._setpoint;
- set => SetProperty(ref this._setpoint, value, true);
- }
-
- [ObservableProperty]
- private int processValue;
-
- [ObservableProperty]
- public HMIControlButtonVM? startButton;
-
- [ObservableProperty]
- public HMIControlButtonVM? stopButton;
-
- [ObservableProperty]
- private E_BMS_CONTROL_MODE bmsControlMode;
-
- [ObservableProperty]
- public ObservableCollection reqBMSControlModes =
- [
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.AUTO_REMOTE, "Auto Remote"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.AUTO_LOCAL, "Auto Local"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.SAFETY_CHECK, "Safety Check"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.CAPACITY_TEST, "Capacity Test"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual")
- ];
-
- [ObservableProperty]
- private BMSControlModeEntry selectedControlMode;
-
- [ObservableProperty]
- private bool canChangeControlMode;
-
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- public AutomaticModePageVM()
- {
- StartButton = new HMIControlButtonVM();
- StopButton = new HMIControlButtonVM();
- SelectedControlMode = ReqBMSControlModes[1];
- canChangeControlMode = true;
- }
-
- public AutomaticModePageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartAutoButton");
- //StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopAutoButton");
-
- SelectedControlMode = ReqBMSControlModes[1];
-
- _adsManager.Register("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
- _adsManager.Register("GVL_SCADA.xCanChangeControlMode", CCCMChanged);
-
- _adsManager.Register(_variableName + ".diSetpointAutomatic", SetpointChanged);
- }
-
- private void SetpointChanged(object? sender, ValueChangedEventArgs e)
- {
- Setpoint = (int)e.Value;
- }
-
- private void CCCMChanged(object? sender, ValueChangedEventArgs e)
- {
- CanChangeControlMode = (bool)e.Value;
- }
-
- private void CurrentControlModeChanged(object? sender, ValueChangedEventArgs e)
- {
- BmsControlMode = (E_BMS_CONTROL_MODE)e.Value;
- SelectedControlMode.eMode = BmsControlMode;
- SelectedControlMode.Name = "Test";
- }
-
-
- public void Dispose()
- {
- StartButton?.Dispose();
- StartButton = null;
- StopButton?.Dispose();
- StopButton = null;
-
- _adsManager?.Deregister("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
- _adsManager?.Deregister("GVL_SCADA.xCanChangeControlMode", CCCMChanged);
-
- _adsManager?.Deregister(_variableName + ".diSetpointAutomatic", SetpointChanged);
- }
-
- [RelayCommand]
- private void StartAutomatic()
- {
- _adsManager?.WriteValue(_variableName + ".diSetpointAutomatic", Setpoint);
- }
-
- [RelayCommand]
- private void StopAutomatic()
- {
- _adsManager?.WriteValue(_variableName + ".diSetpointAutomatic", 0);
- Setpoint = 0;
- }
-
- public static ValidationResult ValidatePower(int power, ValidationContext context)
- {
- if (power < -40000 || power > 40000)
- return new("Must be between -40.000 and +40.000");
- else
- return ValidationResult.Success!;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/BatteryOverviewPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/BatteryOverviewPageVM.cs
deleted file mode 100644
index 9551e30..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/BatteryOverviewPageVM.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-
-namespace UniperHMI
-{
- public sealed partial class BatteryOverviewPageVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private StringControlButtonVM? string1VM;
-
- [ObservableProperty]
- private StringControlButtonVM? string2VM;
-
- [ObservableProperty]
- private StringControlButtonVM? dummyStringVM;
-
- private readonly IAdsManager? _adsManager;
-
- public BatteryOverviewPageVM()
- {
- string1VM = new StringControlButtonVM();
- string2VM = new StringControlButtonVM();
- }
-
- public BatteryOverviewPageVM(IAdsManager adsManager)
- {
- _adsManager = adsManager;
- string1VM = new StringControlButtonVM(adsManager, "GVL_SCADA.stHMIInterface[0]");
- string2VM = new StringControlButtonVM(adsManager, "GVL_SCADA.stHMIInterface[1]");
- }
-
- public void Dispose()
- {
- String1VM?.Dispose();
- String1VM = null;
-
- String2VM?.Dispose();
- String2VM = null;
- }
-
- [RelayCommand]
- private void String1Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage("GVL_SCADA.stHMIInterface[0]", typeof(StringOverviewPage), "String 1"));
- }
-
- [RelayCommand]
- private void String2Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage("GVL_SCADA.stHMIInterface[1]", typeof(StringOverviewPage), "String 2"));
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ChuckMagazinPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/ChuckMagazinPageVM.cs
deleted file mode 100644
index bbc7578..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ChuckMagazinPageVM.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using Heisig.HMI.AdsManager;
-using HMIToolkit;
-using System.Collections.ObjectModel;
-using System.ComponentModel.DataAnnotations;
-using System.Windows;
-using TwinCAT.TypeSystem;
-using UniperHMI.Model;
-namespace UniperHMI
-{
- public sealed partial class ChuckMagazinPageVM : ObservableValidator, IDisposable
- {
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- private const string sChuckOnPlace1 = "_adsVariable_MagazinPlace1";
- private const string sChuckOnPlace2 = "_adsVariable_MagazinPlace2";
- private const string sChuckOnPlace3 = "_adsVariable_MagazinPlace3";
- private const string sChuckOnPlace4 = "_adsVariable_MagazinPlace4";
- private const string sChuckOnPlace5 = "_adsVariable_MagazinPlace5";
- private const string sChuckOnPlace6 = "_adsVariable_MagazinPlace6";
-
- [ObservableProperty]
- private Visibility magazinPlace1;
-
- [ObservableProperty]
- private Visibility magazinPlace2;
-
- [ObservableProperty]
- private Visibility magazinPlace3;
-
- [ObservableProperty]
- private Visibility magazinPlace4;
-
- [ObservableProperty]
- private Visibility magazinPlace5;
-
- [ObservableProperty]
- private Visibility magazinPlace6;
-
- public ChuckMagazinPageVM()
- {
-
- }
-
- public ChuckMagazinPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- _adsManager.Register(sChuckOnPlace1, ChuckOnPlace1Changed);
- _adsManager.Register(sChuckOnPlace2, ChuckOnPlace2Changed);
- _adsManager.Register(sChuckOnPlace3, ChuckOnPlace3Changed);
- _adsManager.Register(sChuckOnPlace4, ChuckOnPlace4Changed);
- _adsManager.Register(sChuckOnPlace5, ChuckOnPlace5Changed);
- _adsManager.Register(sChuckOnPlace6, ChuckOnPlace6Changed);
-
- }
-
- private void ChuckOnPlace1Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace1 = Visibility.Visible;
- }
- else
- {
- MagazinPlace1 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace2Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace2 = Visibility.Visible;
- }
- else
- {
- MagazinPlace2 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace3Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace3 = Visibility.Visible;
- }
- else
- {
- MagazinPlace3 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace4Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace4 = Visibility.Visible;
- }
- else
- {
- MagazinPlace4 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace5Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace5 = Visibility.Visible;
- }
- else
- {
- MagazinPlace5 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace6Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace6 = Visibility.Visible;
- }
- else
- {
- MagazinPlace6 = Visibility.Hidden;
- }
- }
-
-
- public void Dispose()
- {
- _adsManager?.Deregister(sChuckOnPlace1, ChuckOnPlace1Changed);
- _adsManager?.Deregister(sChuckOnPlace2, ChuckOnPlace2Changed);
- _adsManager?.Deregister(sChuckOnPlace3, ChuckOnPlace3Changed);
- _adsManager?.Deregister(sChuckOnPlace4, ChuckOnPlace4Changed);
- _adsManager?.Deregister(sChuckOnPlace5, ChuckOnPlace5Changed);
- _adsManager?.Deregister(sChuckOnPlace6, ChuckOnPlace6Changed);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPage1VM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPage1VM.cs
deleted file mode 100644
index 6fe9fbd..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPage1VM.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-namespace InfineonHMI
-{
-
- public sealed partial class EtchingStation1PageVM : ObservableValidator, IDisposable
- {
-
- [ObservableProperty] private BinaryValveControlVM vacuumValveControlEtching1Vm;
-
- [ObservableProperty] private BinaryValveControlVM doorValveControlEtching1Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckUnlockValveLeftEtching1Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckUnlockValveRightEtching1Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckEjectValveFrontEtching1Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckEjectValveBackEtching1Vm;
-
- [ObservableProperty] private HMIControlButtonVM? chuckUnlockCmdButtonEtching1Vm;
-
- [ObservableProperty] private HMIControlButtonVM? chuckLockCmdButtonEtching1Vm;
-
- [ObservableProperty] private HMIControlButtonVM? chuckEjectCmdButtonEtching1Vm;
-
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- public EtchingStation1PageVM()
- {
- VacuumValveControlEtching1Vm = new BinaryValveControlVM();
- DoorValveControlEtching1Vm = new BinaryValveControlVM();
- ChuckUnlockValveLeftEtching1Vm = new BinaryValveControlVM();
- ChuckUnlockValveRightEtching1Vm = new BinaryValveControlVM();
- ChuckEjectValveFrontEtching1Vm = new BinaryValveControlVM();
- ChuckEjectValveBackEtching1Vm = new BinaryValveControlVM();
-
- ChuckUnlockCmdButtonEtching1Vm = new HMIControlButtonVM();
- ChuckLockCmdButtonEtching1Vm = new HMIControlButtonVM();
- ChuckEjectCmdButtonEtching1Vm = new HMIControlButtonVM();
-
- }
-
- public EtchingStation1PageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- VacuumValveControlEtching1Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stVacuumValve");
- DoorValveControlEtching1Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stDoorValve");
- ChuckUnlockValveLeftEtching1Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckUnlockLeft");
- ChuckUnlockValveRightEtching1Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckUnlockRight");
- ChuckEjectValveFrontEtching1Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckEjectFront");
- ChuckEjectValveBackEtching1Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckEjectBack");
-
- ChuckUnlockCmdButtonEtching1Vm = new HMIControlButtonVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckUnlockCmd");
- ChuckLockCmdButtonEtching1Vm = new HMIControlButtonVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckLockCmd");
- ChuckEjectCmdButtonEtching1Vm = new HMIControlButtonVM(_adsManager, "GVL_SCADA.stMachine.stEtcher1.stChuckEjectCmd");
-
-
- }
-
-
-
-
- public void Dispose()
- {
- VacuumValveControlEtching1Vm.Dispose();
- DoorValveControlEtching1Vm.Dispose();
- ChuckUnlockValveLeftEtching1Vm.Dispose();
- ChuckUnlockValveRightEtching1Vm.Dispose();
- ChuckEjectValveFrontEtching1Vm.Dispose();
- ChuckEjectValveBackEtching1Vm.Dispose();
- ChuckUnlockCmdButtonEtching1Vm?.Dispose();
- ChuckUnlockCmdButtonEtching1Vm = null;
- ChuckLockCmdButtonEtching1Vm?.Dispose();
- ChuckLockCmdButtonEtching1Vm = null;
- ChuckLockCmdButtonEtching1Vm?.Dispose();
- ChuckEjectCmdButtonEtching1Vm = null;
-
-
- }
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPage2VM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPage2VM.cs
deleted file mode 100644
index aaa10c2..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPage2VM.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-namespace InfineonHMI
-{
-
- public sealed partial class EtchingStation2PageVM : ObservableValidator, IDisposable
- {
-
- [ObservableProperty] private BinaryValveControlVM vacuumValveControlEtching2Vm;
-
- [ObservableProperty] private BinaryValveControlVM doorValveControlEtching2Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckUnlockValveLeftEtching2Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckUnlockValveRightEtching2Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckEjectValveFrontEtching2Vm;
-
- [ObservableProperty] private BinaryValveControlVM chuckEjectValveBackEtching2Vm;
-
- [ObservableProperty] private HMIControlButtonVM? chuckUnlockCmdButtonEtching2Vm;
-
- [ObservableProperty] private HMIControlButtonVM? chuckLockCmdButtonEtching2Vm;
-
- [ObservableProperty] private HMIControlButtonVM? chuckEjectCmdButtonEtching2Vm;
-
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- public EtchingStation2PageVM()
- {
-
-
- VacuumValveControlEtching2Vm = new BinaryValveControlVM();
- DoorValveControlEtching2Vm = new BinaryValveControlVM();
- ChuckUnlockValveLeftEtching2Vm = new BinaryValveControlVM();
- ChuckUnlockValveRightEtching2Vm = new BinaryValveControlVM();
- ChuckEjectValveFrontEtching2Vm = new BinaryValveControlVM();
- ChuckEjectValveBackEtching2Vm = new BinaryValveControlVM();
-
- ChuckUnlockCmdButtonEtching2Vm = new HMIControlButtonVM();
- ChuckLockCmdButtonEtching2Vm = new HMIControlButtonVM();
- ChuckEjectCmdButtonEtching2Vm = new HMIControlButtonVM();
- }
-
- public EtchingStation2PageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
-
- VacuumValveControlEtching2Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stVacuumValve");
- DoorValveControlEtching2Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stDoorValve");
- ChuckUnlockValveLeftEtching2Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckUnlockLeft");
- ChuckUnlockValveRightEtching2Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckUnlockRight");
- ChuckEjectValveFrontEtching2Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckEjectFront");
- ChuckEjectValveBackEtching2Vm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckEjectBack");
-
- ChuckUnlockCmdButtonEtching2Vm = new HMIControlButtonVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckUnlockCmd");
- ChuckLockCmdButtonEtching2Vm = new HMIControlButtonVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckLockCmd");
- ChuckEjectCmdButtonEtching2Vm = new HMIControlButtonVM(_adsManager, "GVL_SCADA.stMachine.stEtcher2.stChuckEjectCmd");
-
- }
-
-
- public void Dispose()
- {
- VacuumValveControlEtching2Vm.Dispose();
- DoorValveControlEtching2Vm.Dispose();
- ChuckUnlockValveLeftEtching2Vm.Dispose();
- ChuckUnlockValveRightEtching2Vm.Dispose();
- ChuckEjectValveFrontEtching2Vm.Dispose();
- ChuckEjectValveBackEtching2Vm.Dispose();
- ChuckUnlockCmdButtonEtching2Vm?.Dispose();
- ChuckUnlockCmdButtonEtching2Vm = null;
- ChuckLockCmdButtonEtching2Vm?.Dispose();
- ChuckLockCmdButtonEtching2Vm = null;
- ChuckLockCmdButtonEtching2Vm?.Dispose();
- ChuckEjectCmdButtonEtching2Vm = null;
-
- }
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPageVM.cs
deleted file mode 100644
index 4697af1..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EtchingStationPageVM.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using UniperHMI.Model;
-namespace UniperHMI
-{
-
- public sealed partial class EtchingStationPageVM : ObservableValidator, IDisposable
- {
- private int _setpoint;
-
- [Range(-40000, 40000)]
- public int Setpoint
- {
- get => this._setpoint;
- set => SetProperty(ref this._setpoint, value, true);
- }
-
- [ObservableProperty]
- private int processValue;
-
- [ObservableProperty]
- public HMIControlButtonVM? startButton;
-
- [ObservableProperty]
- public HMIControlButtonVM? stopButton;
-
- [ObservableProperty]
- private E_BMS_CONTROL_MODE bmsControlMode;
-
- [ObservableProperty]
- public ObservableCollection reqBMSControlModes =
- [
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.AUTO_REMOTE, "Auto Remote"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.AUTO_LOCAL, "Auto Local"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.SAFETY_CHECK, "Safety Check"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.CAPACITY_TEST, "Capacity Test"),
- new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual")
- ];
-
- [ObservableProperty]
- private BMSControlModeEntry selectedControlMode;
-
- [ObservableProperty]
- private bool canChangeControlMode;
-
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- public EtchingStationPageVM()
- {
- StartButton = new HMIControlButtonVM();
- StopButton = new HMIControlButtonVM();
- SelectedControlMode = ReqBMSControlModes[1];
- canChangeControlMode = true;
- }
-
- public EtchingStationPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- //StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartAutoButton");
- //StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopAutoButton");
-
- SelectedControlMode = ReqBMSControlModes[1];
-
- _adsManager.Register("GVL_SCADA.xCanChangeControlMode", CCCMChanged);
-
- _adsManager.Register(_variableName + ".diSetpointAutomatic", SetpointChanged);
- }
-
- private void SetpointChanged(object? sender, ValueChangedEventArgs e)
- {
- Setpoint = (int)e.Value;
- }
-
- private void CCCMChanged(object? sender, ValueChangedEventArgs e)
- {
- CanChangeControlMode = (bool)e.Value;
- }
-
-
- public void Dispose()
- {
- StartButton?.Dispose();
- StartButton = null;
- StopButton?.Dispose();
- StopButton = null;
-
- _adsManager?.Deregister("GVL_SCADA.xCanChangeControlMode", CCCMChanged);
-
- _adsManager?.Deregister(_variableName + ".diSetpointAutomatic", SetpointChanged);
- }
-
- [RelayCommand]
- private void StartAutomatic()
- {
- _adsManager?.WriteValue(_variableName + ".diSetpointAutomatic", Setpoint);
- }
-
- [RelayCommand]
- private void StopAutomatic()
- {
- _adsManager?.WriteValue(_variableName + ".diSetpointAutomatic", 0);
- Setpoint = 0;
- }
-
- public static ValidationResult ValidatePower(int power, ValidationContext context)
- {
- if (power < -40000 || power > 40000)
- return new("Must be between -40.000 and +40.000");
- else
- return ValidationResult.Success!;
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EventsPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/EventsPageVM.cs
deleted file mode 100644
index b9b7f27..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/EventsPageVM.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using System.Collections.ObjectModel;
-using System.Windows;
-using TcEventLoggerAdsProxyLib;
-
-namespace InfineonHMI
-{
- public partial class EventData : ObservableObject
- {
- [ObservableProperty]
- public uint id;
-
- [ObservableProperty]
- public string? message;
-
- [ObservableProperty]
- public DateTime raised;
-
- [ObservableProperty]
- public DateTime cleared;
-
- [ObservableProperty]
- public DateTime confirmed;
- };
-
- public sealed partial class EventsPageVM : ObservableObject
- {
- public ObservableCollection CurrentEvents { get; private set; } = [];
- private readonly object _lock = new();
-
- private readonly TcEventLogger _logger;
-
- [ObservableProperty]
- private EventData? currentEvent;
-
- // 599264352000000000 ticks is a date used by beckhoff for events that didnt happen up to this point
- private const long NoTime = 599264352000000000;
-
-
- public EventsPageVM(TcEventLogger logger)
- {
- _logger = logger;
-
- _logger.AlarmRaised += SimpleAlarmRaisedEvent;
- _logger.AlarmCleared += SimpleAlarmClearedEvent;
- _logger.AlarmConfirmed += SimpleConfirmedAlarmEvent;
-
-#if DEBUG
-
-#else
-
- _logger.Connect("10.103.32.50.1.1");
-#endif
-
- GetAllActiveEvents();
- }
-
- private void RebuildCurrentEventsList()
- {
- lock (_lock)
- {
- CurrentEvents.Clear();
- }
-
- GetAllActiveEvents();
- }
-
- private void SimpleConfirmedAlarmEvent(TcAlarm alarm, bool remove)
- {
- Application.Current.Dispatcher.BeginInvoke(RebuildCurrentEventsList);
- }
-
- private void SimpleAlarmClearedEvent(TcAlarm alarm, bool remove)
- {
- Application.Current.Dispatcher.BeginInvoke(RebuildCurrentEventsList);
- }
-
- private void SimpleAlarmRaisedEvent(TcAlarm alarm)
- {
- Application.Current.Dispatcher.BeginInvoke(RebuildCurrentEventsList);
- }
-
- private void GetAllActiveEvents()
- {
- EventData eventData;
- List tempEventList = [];
-
- lock (_lock)
- {
- foreach (var alarm in _logger.ActiveAlarms)
- {
- eventData = new()
- {
- Id = alarm.EventId,
- Message = alarm.GetText(1033),
- Raised = alarm.TimeRaised,
- Cleared = alarm.TimeCleared,
- Confirmed = alarm.TimeConfirmed
- };
-
- tempEventList.Add(eventData);
- }
-
- IEnumerable _eventQuery =
- from data in tempEventList
- orderby data.Raised descending
- select data;
-
- CurrentEvent = _eventQuery.FirstOrDefault();
- CurrentEvents = new ObservableCollection(_eventQuery);
- }
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/HighVoltageStationPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/HighVoltageStationPageVM.cs
deleted file mode 100644
index 6ec4449..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/HighVoltageStationPageVM.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-namespace InfineonHMI
-{
- public sealed partial class HighVoltageStationPageVM : ObservableValidator, IDisposable
- {
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- [ObservableProperty]
- private BinaryValveControlVM doorValveHotControlVm;
-
- [ObservableProperty]
- private BinaryValveControlVM testChamberHotValveVm;
-
- [ObservableProperty]
- private AnalogValueVM tempSPHotVm;
-
- [ObservableProperty]
- private BinaryValveControlVM doorValveColdControlVm;
-
- [ObservableProperty]
- private BinaryValveControlVM testChamberColdValveVm;
-
- [ObservableProperty]
- private AnalogValueVM tempSPColdVm;
-
- public HighVoltageStationPageVM()
- {
- DoorValveHotControlVm = new BinaryValveControlVM();
- TestChamberHotValveVm = new BinaryValveControlVM();
- TempSPHotVm = new AnalogValueVM();
-
- DoorValveColdControlVm = new BinaryValveControlVM();
- TestChamberColdValveVm = new BinaryValveControlVM();
- TempSPColdVm = new AnalogValueVM();
- }
-
- public HighVoltageStationPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- DoorValveHotControlVm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stHVTesterHot.stDoorValve");
- TestChamberHotValveVm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stHVTesterHot.stTestChamberValve");
- TempSPHotVm = new AnalogValueVM(_adsManager, "GVL_SCADA.stMachine.stHVTesterHot.stTempSP", false);
-
- DoorValveColdControlVm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stHVTesterCold.stDoorValve");
- TestChamberColdValveVm = new BinaryValveControlVM(_adsManager, "GVL_SCADA.stMachine.stHVTesterCold.stTestChamberValve");
- TempSPColdVm = new AnalogValueVM(_adsManager, "GVL_SCADA.stMachine.stHVTesterCold.stTempSP", false);
-
- }
-
- public void Dispose()
- {
- DoorValveHotControlVm.Dispose();
- TestChamberHotValveVm.Dispose();
- TempSPHotVm.Dispose();
- DoorValveColdControlVm.Dispose();
- TestChamberColdValveVm.Dispose();
- TempSPColdVm.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/HotCoolPlatePageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/HotCoolPlatePageVM.cs
deleted file mode 100644
index 5a4ed1f..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/HotCoolPlatePageVM.cs
+++ /dev/null
@@ -1,408 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-using System.Windows;
-namespace InfineonHMI
-{
- public sealed partial class HotCoolPlatePageVM : ObservableValidator, IDisposable
- {
-
- private const string sPieceOnHotplate1 = ".stHotplate.stPiece1";
- private const string sPieceOnHotplate2 = ".stHotplate.stPiece2";
- private const string sPieceOnHotplate3 = ".stHotplate.stPiece3";
- private const string sPieceOnHotplate4 = ".stHotplate.stPiece4";
- private const string sPieceOnHotplate5 = ".stHotplate.stPiece5";
- private const string sPieceOnHotplate6 = ".stHotplate.stPiece6";
- private const string sPieceOnHotplate7 = ".stHotplate.stPiece7";
- private const string sPieceOnHotplate8 = ".stHotplate.stPiece8";
- private const string sPieceOnHotplate9 = ".stHotplate.stPiece9";
-
- private const string sPieceOnCoolplate1 = ".stCoolplate.stPiece1";
- private const string sPieceOnCoolplate2 = ".stCoolplate.stPiece2";
- private const string sPieceOnCoolplate3 = ".stCoolplate.stPiece3";
- private const string sPieceOnCoolplate4 = ".stCoolplate.stPiece4";
- private const string sPieceOnCoolplate5 = ".stCoolplate.stPiece5";
- private const string sPieceOnCoolplate6 = ".stCoolplate.stPiece6";
- private const string sPieceOnCoolplate7 = ".stCoolplate.stPiece7";
- private const string sPieceOnCoolplate8 = ".stCoolplate.stPiece8";
- private const string sPieceOnCoolplate9 = ".stCoolplate.stPiece9";
-
- private readonly IAdsManager? _adsManager;
-
- private readonly string? _variableName;
-
- [ObservableProperty]
- private AnalogValueVM hotPlateTargetTemperature;
-
- [ObservableProperty]
- private AnalogValueVM hotPlateActualTemperature;
-
- [ObservableProperty] private HMIControlButtonVM? enableHotPlateButtonVm;
-
- [ObservableProperty] private HMIControlButtonVM? disableHotPlateButtonVm;
-
- [ObservableProperty]
- private AnalogValueVM coolPlateTargetTemperature;
-
- [ObservableProperty]
- private AnalogValueVM coolPlateActualTemperature;
-
- [ObservableProperty] private HMIControlButtonVM? enableCoolPlateButtonVm;
-
- [ObservableProperty] private HMIControlButtonVM? disableCoolPlateButtonVm;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility1;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility2;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility3;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility4;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility5;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility6;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility7;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility8;
-
- [ObservableProperty]
- private Visibility hotPlateVisibility9;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility1;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility2;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility3;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility4;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility5;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility6;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility7;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility8;
-
- [ObservableProperty]
- private Visibility coolPlateVisibility9;
-
- public HotCoolPlatePageVM()
- {
- EnableHotPlateButtonVm = new HMIControlButtonVM();
- DisableHotPlateButtonVm = new HMIControlButtonVM();
-
- EnableCoolPlateButtonVm = new HMIControlButtonVM();
- DisableCoolPlateButtonVm = new HMIControlButtonVM();
-
- HotPlateActualTemperature = new AnalogValueVM();
- HotPlateTargetTemperature = new AnalogValueVM();
-
- CoolPlateActualTemperature = new AnalogValueVM();
- CoolPlateTargetTemperature = new AnalogValueVM();
-
-
- }
- public HotCoolPlatePageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- EnableHotPlateButtonVm = new HMIControlButtonVM(_adsManager, _variableName + ".stHotplate.stEnableBtn");
- DisableHotPlateButtonVm = new HMIControlButtonVM(_adsManager, _variableName + ".stHotplate.stDisableBtn");
-
- EnableCoolPlateButtonVm = new HMIControlButtonVM(_adsManager, _variableName + ".stCoolplate.stEnableBtn");
- DisableCoolPlateButtonVm = new HMIControlButtonVM(_adsManager, _variableName + ".stCoolplate.stDisableBtn");
-
- HotPlateActualTemperature = new AnalogValueVM(_adsManager, "GVL_SCADA.stMachine.stHotplate.stPV", true);
- CoolPlateActualTemperature = new AnalogValueVM(_adsManager, "GVL_SCADA.stMachine.stCoolplate.stPV", true);
-
- HotPlateTargetTemperature = new AnalogValueVM(_adsManager, "GVL_SCADA.stMachine.stHotplate.stSetpoint", false);
- CoolPlateTargetTemperature = new AnalogValueVM(_adsManager, "GVL_SCADA.stMachine.stCoolplate.stSetpoint", false);
-
- _adsManager.Register(sPieceOnHotplate1, HotplatePiece1Changed);
- _adsManager.Register(sPieceOnHotplate2, HotplatePiece2Changed);
- _adsManager.Register(sPieceOnHotplate3, HotplatePiece3Changed);
- _adsManager.Register(sPieceOnHotplate4, HotplatePiece4Changed);
- _adsManager.Register(sPieceOnHotplate5, HotplatePiece5Changed);
- _adsManager.Register(sPieceOnHotplate6, HotplatePiece6Changed);
- _adsManager.Register(sPieceOnHotplate7, HotplatePiece7Changed);
- _adsManager.Register(sPieceOnHotplate8, HotplatePiece8Changed);
- _adsManager.Register(sPieceOnHotplate9, HotplatePiece9Changed);
-
- _adsManager.Register(sPieceOnCoolplate1, CoolplatePiece1Changed);
- _adsManager.Register(sPieceOnCoolplate2, CoolplatePiece2Changed);
- _adsManager.Register(sPieceOnCoolplate3, CoolplatePiece3Changed);
- _adsManager.Register(sPieceOnCoolplate4, CoolplatePiece4Changed);
- _adsManager.Register(sPieceOnCoolplate5, CoolplatePiece5Changed);
- _adsManager.Register(sPieceOnCoolplate6, CoolplatePiece6Changed);
- _adsManager.Register(sPieceOnCoolplate7, CoolplatePiece7Changed);
- _adsManager.Register(sPieceOnCoolplate8, CoolplatePiece8Changed);
- _adsManager.Register(sPieceOnCoolplate9, CoolplatePiece9Changed);
-
-
- }
-
- private void HotplatePiece1Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility1 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility1 = Visibility.Hidden;
- }
- }
- private void HotplatePiece2Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility2 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility2 = Visibility.Hidden;
- }
- }
- private void HotplatePiece3Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility3 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility3 = Visibility.Hidden;
- }
- }
- private void HotplatePiece4Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility4 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility4 = Visibility.Hidden;
- }
- }
- private void HotplatePiece5Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility5 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility5 = Visibility.Hidden;
- }
- }
- private void HotplatePiece6Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility6 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility6 = Visibility.Hidden;
- }
- }
- private void HotplatePiece7Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility7 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility7 = Visibility.Hidden;
- }
- }
- private void HotplatePiece8Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility8 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility8 = Visibility.Hidden;
- }
- }
- private void HotplatePiece9Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- HotPlateVisibility9 = Visibility.Visible;
- }
- else
- {
- HotPlateVisibility9 = Visibility.Hidden;
- }
- }
-
- private void CoolplatePiece1Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility1 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility1 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece2Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility2 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility2 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece3Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility3 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility3 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece4Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility4 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility4 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece5Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility5 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility5 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece6Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility6 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility6 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece7Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility7 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility7 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece8Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility8 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility8 = Visibility.Hidden;
- }
- }
- private void CoolplatePiece9Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- CoolPlateVisibility9 = Visibility.Visible;
- }
- else
- {
- CoolPlateVisibility9 = Visibility.Hidden;
- }
- }
-
-
- public void Dispose()
- {
- HotPlateActualTemperature.Dispose();
- HotPlateTargetTemperature.Dispose();
- CoolPlateActualTemperature.Dispose();
- CoolPlateTargetTemperature.Dispose();
-
- EnableCoolPlateButtonVm?.Dispose();
- EnableCoolPlateButtonVm = null;
- EnableHotPlateButtonVm?.Dispose();
- EnableHotPlateButtonVm = null;
- DisableCoolPlateButtonVm?.Dispose();
- DisableCoolPlateButtonVm = null;
- DisableHotPlateButtonVm?.Dispose();
- DisableHotPlateButtonVm = null;
- _adsManager?.Deregister(sPieceOnHotplate1, HotplatePiece1Changed);
- _adsManager?.Deregister(sPieceOnHotplate2, HotplatePiece2Changed);
- _adsManager?.Deregister(sPieceOnHotplate3, HotplatePiece3Changed);
- _adsManager?.Deregister(sPieceOnHotplate4, HotplatePiece4Changed);
- _adsManager?.Deregister(sPieceOnHotplate5, HotplatePiece5Changed);
- _adsManager?.Deregister(sPieceOnHotplate6, HotplatePiece6Changed);
- _adsManager?.Deregister(sPieceOnHotplate7, HotplatePiece7Changed);
- _adsManager?.Deregister(sPieceOnHotplate8, HotplatePiece8Changed);
- _adsManager?.Deregister(sPieceOnHotplate9, HotplatePiece9Changed);
-
- _adsManager?.Deregister(sPieceOnCoolplate1, CoolplatePiece1Changed);
- _adsManager?.Deregister(sPieceOnCoolplate2, CoolplatePiece2Changed);
- _adsManager?.Deregister(sPieceOnCoolplate3, CoolplatePiece3Changed);
- _adsManager?.Deregister(sPieceOnCoolplate4, CoolplatePiece4Changed);
- _adsManager?.Deregister(sPieceOnCoolplate5, CoolplatePiece5Changed);
- _adsManager?.Deregister(sPieceOnCoolplate6, CoolplatePiece6Changed);
- _adsManager?.Deregister(sPieceOnCoolplate7, CoolplatePiece7Changed);
- _adsManager?.Deregister(sPieceOnCoolplate8, CoolplatePiece8Changed);
- _adsManager?.Deregister(sPieceOnCoolplate9, CoolplatePiece9Changed);
-
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/KukaRobotPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/KukaRobotPageVM.cs
deleted file mode 100644
index 91ceede..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/KukaRobotPageVM.cs
+++ /dev/null
@@ -1,677 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-using System.Security.Policy;
-using System.Printing;
-using System.Windows;
-using InfineonHMI.Model;
-
-namespace InfineonHMI
-{
- public sealed partial class KukaRobotPageVM : ObservableValidator, IDisposable
- {
-
- private readonly string? _variableName = "_adsVariable_";
-
- private const string sStartRobotJob = "_adsVariable_kukaStartRobotJob";
- private const string sAbortRobotJob = "_adsVariable_kukaAbortRobotJob";
- private const string sResetState = "_adsVariable_kukaResetState";
- private const string sClearState = "_adsVariable_kukaClearState";
- private const string sAcknPLCJob = "_adsVariable_kukaAcknPLCJob";
- private const string sCoolplateIndex = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.byPlaceOnCoolPlate";
- private const string sHotplateIndex = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.byPlaceOnHotPlate";
- private const string sPieceThickness = "_adsVariable_kukaPieceThickness";
- private const string sJobGrippSide = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.byGripperNumber";
- private const string sJobGrippType = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.byGripperNumber";
- private const string sChuckMagazinPlace = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.byChuckNumber";
- private const string sSelectedRobotJob = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.eJob";
- private const string sActiveRobotJob = "_adsVariable_kukaActiveRobotJob";
- private const string sFinishedRobotJob = "_adsVariable_kukaFinishedRobotJob";
- private const string sSelectedPLCJob = "_adsVariable_kukaPLCJob";
- private const string sOffsetPick_X = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosX";
- private const string sOffsetPick_Y = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosY";
- private const string sOffsetPlace_X = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosX";
- private const string sOffsetPlace_Y = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosY";
- private const string sOffsetNIOPick_X = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosX";
- private const string sOffsetNIOPick_Y = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosY";
- private const string sOffsetNIOPlace_X = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosX";
- private const string sOffsetNIOPlace_Y = "GVL_SCADA.stMachine.stKukaRobot.stJobParams.rPosY";
-
-
- private BMSControlModeEntry currentControlMode;
- public BMSControlModeEntry CurrentControlMode
- {
- get { return currentControlMode; }
- set
- {
- currentControlMode = value;
- ccmChanged();
- }
- }
- private E_BMS_CONTROL_MODE bmsControlMode;
-
- [ObservableProperty]
- private bool canChangeRobotJob;
-
- [ObservableProperty]
- private RobotJobentry robotJobActiveValue;
-
- [ObservableProperty]
- private RobotJobentry robotJobFinishedValue;
-
- [ObservableProperty]
- private bool canStartRobotJob;
-
- [ObservableProperty]
- private HMIControlButtonVM? startButton;
-
- [ObservableProperty]
- private bool canAbortRobotJob;
-
- [ObservableProperty]
- private HMIControlButtonVM? abortButton;
-
- private const string sChuckOnPlace1 = "_adsVariable_MagazinPlace1";
- private const string sChuckOnPlace2 = "_adsVariable_MagazinPlace2";
- private const string sChuckOnPlace3 = "_adsVariable_MagazinPlace3";
- private const string sChuckOnPlace4 = "_adsVariable_MagazinPlace4";
- private const string sChuckOnPlace5 = "_adsVariable_MagazinPlace5";
- private const string sChuckOnPlace6 = "_adsVariable_MagazinPlace6";
-
- [ObservableProperty]
- private Visibility magazinPlace1;
-
- [ObservableProperty]
- private Visibility magazinPlace2;
-
- [ObservableProperty]
- private Visibility magazinPlace3;
-
- [ObservableProperty]
- private Visibility magazinPlace4;
-
- [ObservableProperty]
- private Visibility magazinPlace5;
-
- [ObservableProperty]
- private Visibility magazinPlace6;
-
- private int jobGrippSide;
- public int JobGrippSide
- {
- get { return jobGrippSide; }
- set
- {
- SetProperty(ref jobGrippSide, value);
- _adsManager?.WriteValue(sJobGrippSide, value);
- }
- }
-
- [ObservableProperty]
- private bool canChangeJobGrippSide;
-
-
- private int jobGrippType;
- public int JobGrippType
- {
- get { return jobGrippType; }
- set
- {
- SetProperty(ref jobGrippType, value);
- _adsManager?.WriteValue(sJobGrippType, value);
-
- }
- }
-
- [ObservableProperty]
- private bool canChangeJobGrippType;
-
-
- private int chuckMagazinPlace;
- public int ChuckMagazinPlace
- {
- get { return chuckMagazinPlace; }
- set
- {
- SetProperty(ref chuckMagazinPlace, value);
- _adsManager?.WriteValue(sChuckMagazinPlace, value);
- }
- }
-
- [ObservableProperty]
- private bool canChangeChuckMagazinPlace;
-
-
- private double pieceThickness;
- public double PieceThickness
- {
- get { return pieceThickness; }
- set
- {
- SetProperty(ref pieceThickness, value);
- _adsManager?.WriteValue(sPieceThickness, value);
- }
- }
-
- [ObservableProperty]
- private bool canChangePieceThickness;
-
-
- private double offsetPick_X;
- public double OffsetPick_X
- {
- get { return offsetPick_X; }
- set
- {
- SetProperty(ref offsetPick_X, value);
- _adsManager?.WriteValue(sOffsetPick_X, value);
- }
- }
-
-
- private double offsetPick_Y;
- public double OffsetPick_Y
- {
- get { return offsetPick_Y; }
- set
- {
- SetProperty(ref offsetPick_Y, value);
- _adsManager?.WriteValue(sOffsetPick_Y, value);
- }
- }
- [ObservableProperty]
- private bool canChangeOffsetPick;
-
-
- private double offsetPlace_X;
- public double OffsetPlace_X
- {
- get { return offsetPlace_X; }
- set
- {
- SetProperty(ref offsetPlace_X, value);
- _adsManager?.WriteValue(sOffsetPlace_X, value);
- }
- }
-
- private double offsetPlace_Y;
- public double OffsetPlace_Y
- {
- get { return offsetPlace_Y; }
- set
- {
- SetProperty(ref offsetPlace_Y, value);
- _adsManager?.WriteValue(sOffsetPlace_Y, value);
- }
- }
-
-
- [ObservableProperty]
- private bool canChangeOffsetPlace;
-
-
- private double offsetNIOPick_X;
- public double OffsetNIOPick_X
- {
- get { return offsetNIOPick_X; }
- set
- {
- SetProperty(ref offsetNIOPick_X, value);
- _adsManager?.WriteValue(sOffsetNIOPick_X, value);
- }
- }
-
- private double offsetNIOPick_Y;
- public double OffsetNIOPick_Y
- {
- get { return offsetNIOPick_Y; }
- set
- {
- SetProperty(ref offsetNIOPick_Y, value);
- _adsManager?.WriteValue(sOffsetNIOPick_Y, value);
- }
- }
- [ObservableProperty]
- private bool canChangeOffsetNIOPick;
-
-
- private double offsetNIOPlace_X;
- public double OffsetNIOPlace_X
- {
- get { return offsetNIOPlace_X; }
- set
- {
- SetProperty(ref offsetNIOPlace_X, value);
- _adsManager?.WriteValue(sOffsetNIOPlace_X, value);
- }
- }
-
- private double offsetNIOPlace_Y;
- public double OffsetNIOPlace_Y
- {
- get { return offsetNIOPlace_Y; }
- set
- {
- SetProperty(ref offsetNIOPlace_Y, value);
- _adsManager?.WriteValue(sOffsetNIOPlace_Y, value);
- }
- }
- [ObservableProperty]
- private bool canChangeOffsetNIOPlace;
-
-
- private int hotplateIndex;
- public int HotplateIndex
- {
- get { return hotplateIndex; }
- set
- {
- SetProperty(ref hotplateIndex, value);
- _adsManager?.WriteValue(sHotplateIndex, value);
- }
-
-
- }
- [ObservableProperty]
- private bool canChangeHotPlateIndex;
-
-
- private int coolplateIndex;
- public int CoolplateIndex
- {
- get { return coolplateIndex; }
- set
- {
- SetProperty(ref coolplateIndex, value);
- _adsManager?.WriteValue(sCoolplateIndex, value);
- }
- }
-
-
- [ObservableProperty]
- private bool canChangeCoolPlateIndex;
-
- [ObservableProperty]
- private RobotJobenum robotJob;
-
- [ObservableProperty]
- private ObservableCollection robotJobs =
- [
- new RobotJobentry(RobotJobenum.NONE, " ------- "),
- new RobotJobentry(RobotJobenum.PICK_TRAYFEEDER, "10 - Hole Teil von Trayfeeder 'Eingabe' "),
- new RobotJobentry(RobotJobenum.PLACE_TRAYFEEDER, "11 - Lege Teil in Trayfeeder 'Ausgabe' "),
- new RobotJobentry(RobotJobenum.PUT_ALIGNMENT, "15 - Lege Teil auf Ausrichtstation"),
- new RobotJobentry(RobotJobenum.PICK_ALIGNMENT, "16 - Hole Teil von Ausrichtstation"),
- new RobotJobentry(RobotJobenum.PUT_ETCHER_1, "20 - Lege Teil in Ätzer 1"),
- new RobotJobentry(RobotJobenum.PUT_ETCHER_2, "21 - Lege Teil in Ätzer 2"),
- new RobotJobentry(RobotJobenum.PICK_ETCHER_1, "22 - Hole Teil aus Ätzer 1"),
- new RobotJobentry(RobotJobenum.PICK_ETCHER_2, "23 - Hole Teil aus Ätzer 2"),
- new RobotJobentry(RobotJobenum.SWITCH_ETCHER_1, "24 - Tausche Teile in Ätzer 1"),
- new RobotJobentry(RobotJobenum.SWITCH_ETCHER_2, "25 - Tausche Teile in Ätzer 2"),
- new RobotJobentry(RobotJobenum.PUT_HVTEST_HOT, "30 - Lege Teil in HV-Teststation Warm"),
- new RobotJobentry(RobotJobenum.PUT_HVTEST_COLD, "31 - Lege Teil in HV-Teststation Kalt"),
- new RobotJobentry(RobotJobenum.PICK_HVTEST_HOT, "32 - Hole Teil aus HV-Teststation Warm"),
- new RobotJobentry(RobotJobenum.PICK_HVTEST_COLD, "33 - Hole Teil aus HV-Teststation Kalt"),
- new RobotJobentry(RobotJobenum.PUT_HOTPLATE, "40 - Lege Teil auf Heizplatte"),
- new RobotJobentry(RobotJobenum.PICK_HOTPLATE, "41 - Hole Teil von Heizplatte"),
- new RobotJobentry(RobotJobenum.PUT_COOLPLATE, "42 - Lege Teil auf Kühlplatte"),
- new RobotJobentry(RobotJobenum.PICK_COOLPLATE, "43 - Hole Teil von Kühlplatte"),
- new RobotJobentry(RobotJobenum.PICK_GRIPPER, "50 - Hole anderen Greifertyp"),
- new RobotJobentry(RobotJobenum.PICK_CHUCK_ETCHER_1, "60 - Hole Drehteller aus Ätzer 1"),
- new RobotJobentry(RobotJobenum.PICK_CHUCK_ETCHER_2, "61 - Hole Drehteller aus Ätzer 2"),
- new RobotJobentry(RobotJobenum.PUT_CHUCK_ETCHER_1, "62 - Lege Drehteller in Ätzer 1"),
- new RobotJobentry(RobotJobenum.PUT_CHUCK_ETCHER_2, "63 - Lege Drehteller in Ätzer 2"),
- new RobotJobentry(RobotJobenum.PUT_CHUCK_MAGAZIN, "64 - Lege Drehteller in Magazin"),
- new RobotJobentry(RobotJobenum.PICK_CHUCK_MAGAZIN, "65 - Hole Drehteller von Magazin"),
- new RobotJobentry(RobotJobenum.PUT_NIO_STATION, "70 - Lege Teil auf NIO-TRAY"),
- new RobotJobentry(RobotJobenum.PICK_NIO_STATION, "71 - Hole Teil von NIO-TRAY"),
- new RobotJobentry(RobotJobenum.WARMUP, "80 - Aufwärmprogramm")
- ];
-
- [ObservableProperty]
- private ObservableCollection pLCJobs =
- [
- new PLCJobentry(PLCJobenum.NONE, " ------- "),
- new PLCJobentry(PLCJobenum.SCAN_QR_CODE, "10 - QR Code Scannen"),
- new PLCJobentry(PLCJobenum.VACUUM_ON_ALIGNER, "15 - Vakuum Ausrichtstation einschalten"),
- new PLCJobentry(PLCJobenum.VACUUM_OFF_ALIGNER, "16 - Vakuum Ausrichtstation ausschalten"),
- new PLCJobentry(PLCJobenum.VACUUM_ON_ETCHER_1, "20 - Vakuum Ätzer 1 einschalten"),
- new PLCJobentry(PLCJobenum.VACUUM_ON_ETCHER_2, "21 - Vakuum Ätzer 2 einschalten"),
- new PLCJobentry(PLCJobenum.VACUUM_OFF_ETCHER_1, "22 - Vakuum Ätzer 1 ausschalten"),
- new PLCJobentry(PLCJobenum.VACUUM_OFF_ETCHER_2, "23 - Vakuum Ätzer 2 ausschalten"),
- new PLCJobentry(PLCJobenum.CHUCK_OPEN_ETCHER_1, "60 - Drehteller Ätzer 1 entriegeln"),
- new PLCJobentry(PLCJobenum.CHUCK_OPEN_ETCHER_2, "61 - Drehteller Ätzer 2 entriegeln"),
- new PLCJobentry(PLCJobenum.CHUCK_CLOSE_ETCHER_1, "62 - Drehteller Ätzer 1 verriegeln"),
- new PLCJobentry(PLCJobenum.CHUCK_CLOSE_ETCHER_2, "63 - Drehteller Ätzer 2 verriegeln"),
- ];
-
- private RobotJobentry selectedRobotJob;
- public RobotJobentry SelectedRobotJob
- {
- get { return selectedRobotJob; }
- set
- {
- SetProperty(ref selectedRobotJob, value);
- CanChangeChuckMagazinPlace = (value == RobotJobs.First(i => i.eJob == RobotJobenum.PICK_CHUCK_MAGAZIN))
- || (value == RobotJobs.First(i => i.eJob == RobotJobenum.PUT_CHUCK_MAGAZIN));
- CanChangeJobGrippType = value == RobotJobs.First(i => i.eJob == RobotJobenum.PICK_GRIPPER);
-
- _adsManager?.WriteValue(sSelectedRobotJob, SelectedRobotJob.eJob);
- }
- }
-
- [ObservableProperty]
- private PLCJobentry selectedPLCJob;
-
-
- private readonly IAdsManager? _adsManager;
-
- public KukaRobotPageVM()
- {
- StartButton = new HMIControlButtonVM();
- AbortButton = new HMIControlButtonVM();
- selectedRobotJob = RobotJobs.First(i => i.eJob == RobotJobenum.WARMUP);
- robotJobActiveValue = RobotJobs.First(i => i.eJob == RobotJobenum.PUT_HVTEST_COLD);
- robotJobFinishedValue = RobotJobs.First(i => i.eJob == RobotJobenum.PICK_HOTPLATE);
- selectedPLCJob = PLCJobs.First(i => i.eJob == PLCJobenum.NONE);
-
- canChangeRobotJob = true;currentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
-
- }
-
- public KukaRobotPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- StartButton = new HMIControlButtonVM(_adsManager, sStartRobotJob);
- AbortButton = new HMIControlButtonVM(_adsManager, sAbortRobotJob);
- currentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
- CurrentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
-
- selectedRobotJob = RobotJobs.First(i => i.eJob == RobotJobenum.NONE);
- robotJobActiveValue = RobotJobs.First(i => i.eJob == RobotJobenum.NONE);
- robotJobFinishedValue = RobotJobs.First(i => i.eJob == RobotJobenum.NONE);
- selectedPLCJob = PLCJobs.First(i => i.eJob == PLCJobenum.NONE);
-
- _adsManager.Register(sJobGrippSide, OnJobGrippSideValueChanged);
- _adsManager.Register(sJobGrippType, OnJobGrippTypeValueChanged);
- _adsManager.Register(sChuckMagazinPlace, OnChuckMagazinPlaceValueChanged);
- _adsManager.Register(sPieceThickness, OnPieceThicknessValueChanged);
- _adsManager.Register(sSelectedPLCJob, OnSelectedPLCJobValueChanged);
- _adsManager.Register(sSelectedRobotJob, OnSelectedRobotJobValueChanged);
- _adsManager.Register(sActiveRobotJob, OnActiveRobotJobValueChanged);
- _adsManager.Register(sFinishedRobotJob, OnFinishedRobotJobValueChanged);
- _adsManager.Register(sOffsetPick_X, OnOffsetPickXValueChanged);
- _adsManager.Register(sOffsetPick_Y, OnOffsetPickYValueChanged);
- _adsManager.Register(sCoolplateIndex, OnCoolPlateIndexValueChanged);
- _adsManager.Register(sHotplateIndex, OnHotPlateIndexValueChanged);
- _adsManager.Register(sOffsetNIOPlace_Y, OnOffsetNIOPlaceYValueChanged);
- _adsManager.Register(sOffsetNIOPlace_X, OnOffsetNIOPlaceXValueChanged);
- _adsManager.Register(sOffsetNIOPick_Y, OnOffsetNIOPickYValueChanged);
- _adsManager.Register(sOffsetNIOPick_X, OnOffsetNIOPickXValueChanged);
- _adsManager.Register(sOffsetPlace_Y, OnOffsetPlaceYValueChanged);
- _adsManager.Register(sOffsetPlace_X, OnOffsetPlaceXValueChanged);
-
- _adsManager.Register(sChuckOnPlace1, ChuckOnPlace1Changed);
- _adsManager.Register(sChuckOnPlace2, ChuckOnPlace2Changed);
- _adsManager.Register(sChuckOnPlace3, ChuckOnPlace3Changed);
- _adsManager.Register(sChuckOnPlace4, ChuckOnPlace4Changed);
- _adsManager.Register(sChuckOnPlace5, ChuckOnPlace5Changed);
- _adsManager.Register(sChuckOnPlace6, ChuckOnPlace6Changed);
-
- canChangeRobotJob = true;
- canChangeJobGrippType = false;
-
- canChangeChuckMagazinPlace = false;
- canChangeJobGrippType = false;
-
- _adsManager.Register("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
-
- }
-
- private void OnJobGrippSideValueChanged(object sender, ValueChangedEventArgs e)
- {
- JobGrippSide = (byte)e.Value;
- }
- private void OnJobGrippTypeValueChanged(object sender, ValueChangedEventArgs e)
- {
- JobGrippType = (byte)e.Value;
- }
- private void OnChuckMagazinPlaceValueChanged(object sender, ValueChangedEventArgs e)
- {
- ChuckMagazinPlace = (byte)e.Value;
- }
- private void OnPieceThicknessValueChanged(object sender, ValueChangedEventArgs e)
- {
- PieceThickness = (int)e.Value;
- }
- private void OnSelectedPLCJobValueChanged(object sender, ValueChangedEventArgs e)
- {
- SelectedPLCJob = PLCJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
- }
- private void OnSelectedRobotJobValueChanged(object sender, ValueChangedEventArgs e)
- {
- SelectedRobotJob = RobotJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
- }
- private void OnActiveRobotJobValueChanged(object sender, ValueChangedEventArgs e)
- {
- RobotJobActiveValue = RobotJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
- }
- private void OnFinishedRobotJobValueChanged(object sender, ValueChangedEventArgs e)
- {
- RobotJobFinishedValue = RobotJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
- }
- private void OnHotPlateIndexValueChanged(object sender, ValueChangedEventArgs e)
- {
- HotplateIndex = (byte)e.Value;
- }
- private void OnCoolPlateIndexValueChanged(object sender, ValueChangedEventArgs e)
- {
- CoolplateIndex = (byte)e.Value;
- }
- private void OnOffsetPickXValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetPick_X = (float)e.Value;
- }
- private void OnOffsetPickYValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetPick_Y = (float)e.Value;
- }
- private void OnOffsetPlaceXValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetPlace_X = (float)e.Value;
- }
- private void OnOffsetPlaceYValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetPlace_Y = (float)e.Value;
- }
- private void OnOffsetNIOPickXValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetNIOPick_X = (float)e.Value;
- }
- private void OnOffsetNIOPickYValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetNIOPick_Y = (float)e.Value;
- }
- private void OnOffsetNIOPlaceXValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetNIOPlace_X = (float)e.Value;
- }
- private void OnOffsetNIOPlaceYValueChanged(object sender, ValueChangedEventArgs e)
- {
- OffsetNIOPlace_Y = (float)e.Value;
- }
-
- private void ChuckOnPlace1Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace1 = Visibility.Visible;
- }
- else
- {
- MagazinPlace1 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace2Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace2 = Visibility.Visible;
- }
- else
- {
- MagazinPlace2 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace3Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace3 = Visibility.Visible;
- }
- else
- {
- MagazinPlace3 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace4Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace4 = Visibility.Visible;
- }
- else
- {
- MagazinPlace4 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace5Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace5 = Visibility.Visible;
- }
- else
- {
- MagazinPlace5 = Visibility.Hidden;
- }
- }
- private void ChuckOnPlace6Changed(object? sender, ValueChangedEventArgs e)
- {
- if ((bool)e.Value)
- {
- MagazinPlace6 = Visibility.Visible;
- }
- else
- {
- MagazinPlace6 = Visibility.Hidden;
- }
- }
-
- public void Dispose()
- {
- StartButton?.Dispose();
- StartButton = null;
- AbortButton?.Dispose();
- AbortButton = null;
-
- _adsManager?.Deregister(sJobGrippSide, OnJobGrippSideValueChanged);
- _adsManager?.Deregister(sJobGrippType, OnJobGrippTypeValueChanged);
- _adsManager?.Deregister(sChuckMagazinPlace, OnChuckMagazinPlaceValueChanged);
- _adsManager?.Deregister(sPieceThickness, OnPieceThicknessValueChanged);
- _adsManager?.Deregister(sSelectedPLCJob, OnSelectedPLCJobValueChanged);
- _adsManager?.Deregister(sSelectedRobotJob, OnSelectedRobotJobValueChanged);
- _adsManager?.Deregister(sActiveRobotJob, OnActiveRobotJobValueChanged);
- _adsManager?.Deregister(sFinishedRobotJob, OnFinishedRobotJobValueChanged);
- _adsManager?.Deregister(sOffsetPick_X, OnOffsetPickXValueChanged);
- _adsManager?.Deregister(sOffsetPick_Y, OnOffsetPickYValueChanged);
- _adsManager?.Deregister(sCoolplateIndex, OnCoolPlateIndexValueChanged);
- _adsManager?.Deregister(sHotplateIndex, OnHotPlateIndexValueChanged);
- _adsManager?.Deregister(sOffsetNIOPlace_Y, OnOffsetNIOPlaceYValueChanged);
- _adsManager?.Deregister(sOffsetNIOPlace_X, OnOffsetNIOPlaceXValueChanged);
- _adsManager?.Deregister(sOffsetNIOPick_Y, OnOffsetNIOPickYValueChanged);
- _adsManager?.Deregister(sOffsetNIOPick_X, OnOffsetNIOPickXValueChanged);
- _adsManager?.Deregister(sOffsetPlace_Y, OnOffsetPlaceYValueChanged);
- _adsManager?.Deregister(sOffsetPlace_X, OnOffsetPlaceXValueChanged);
-
- _adsManager?.Deregister(sChuckOnPlace1, ChuckOnPlace1Changed);
- _adsManager?.Deregister(sChuckOnPlace2, ChuckOnPlace2Changed);
- _adsManager?.Deregister(sChuckOnPlace3, ChuckOnPlace3Changed);
- _adsManager?.Deregister(sChuckOnPlace4, ChuckOnPlace4Changed);
- _adsManager?.Deregister(sChuckOnPlace5, ChuckOnPlace5Changed);
- _adsManager?.Deregister(sChuckOnPlace6, ChuckOnPlace6Changed);
-
- _adsManager?.Deregister("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
-
- }
-
- private void CurrentControlModeChanged(object? sender, ValueChangedEventArgs e)
- {
- bmsControlMode = (E_BMS_CONTROL_MODE)e.Value;
- currentControlMode.eMode = bmsControlMode;
- currentControlMode.Name = "Test";
- ccmChanged();
-
- }
-
- private void ccmChanged()
- {
- if (currentControlMode.eMode == E_BMS_CONTROL_MODE.MANUAL)
- {
- CanChangeCoolPlateIndex = true;
- CanChangeHotPlateIndex = true;
- CanChangeOffsetNIOPick = true;
- CanChangeOffsetNIOPlace = true;
- CanChangeOffsetPick = true;
- CanChangeOffsetPlace = true;
- CanChangePieceThickness = true;
- CanChangeRobotJob = true;
- CanChangeJobGrippSide = true;
-
- }
- else
- {
- CanChangeCoolPlateIndex = false;
- CanChangeHotPlateIndex = false;
- CanChangeOffsetNIOPick = false;
- CanChangeOffsetNIOPlace = false;
- CanChangeOffsetPick = false;
- CanChangeOffsetPlace = false;
- CanChangePieceThickness = false;
- CanChangeRobotJob = false;
- CanChangeJobGrippSide = false;
- }
- }
-
- [RelayCommand]
- private void ClearState()
- {
- _adsManager?.WriteValue(sClearState, true);
- }
-
- [RelayCommand]
- private void ResetState()
- {
- _adsManager?.WriteValue(sResetState, true);
- }
-
- [RelayCommand]
- private void StartRobotJob()
- {
- _adsManager?.WriteValue(sStartRobotJob, true);
- }
-
-
- [RelayCommand]
- private void AbortRobotJob()
- {
- _adsManager?.WriteValue(sAbortRobotJob, true);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/MachineOverviewPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/MachineOverviewPageVM.cs
deleted file mode 100644
index a1db088..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/MachineOverviewPageVM.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using System.Windows;
-using System.Windows.Controls;
-using TcEventLoggerAdsProxyLib;
-
-namespace InfineonHMI;
-
-public sealed partial class MachineOverviewPageVM : ObservableObject, IRecipient, IDisposable
-{
-
- [ObservableProperty] private StringControlButtonVM dummyStringVM;
-
- [ObservableProperty] private Page currentDetailPage;
-
-
-
- private readonly IAdsManager _adsManager;
- private readonly IConfiguration _config;
-
-
- // Last active event
- [ObservableProperty] private string currentActiveEvent = "";
-
- // Empty page
- private readonly Page _emptyPage;
-
- // Last navigate message
- private readonly Stack _messageStack = new();
- NavigateMessage? _currentMessage;
-
- // Hot Coolplate page view model
- HotCoolPlatePageVM? _hotCoolplatePageVM;
-
- AlignmentStationPageVM? _alignmentStationPageVM;
-
- EtchingStation1PageVM? _etchingStation1PageVm;
-
- EtchingStation2PageVM? _etchingStation2PageVm;
-
- HighVoltageStationPageVM? _highVoltageStationPageVm;
-
- MediaCabinetPageVM? _mediaCabinetPageVM;
-
- NIOStationPageVM? _nioStationPageVm;
-
- TrayFeederPageVM? _trayFeederPageVm;
-
- private ProductionOverviewPageVM? _prodVM;
-
- private MainWindowVM _mainVm;
-
- // Kuka Robot page view model
- KukaRobotPageVM? _kukaRobotPageVM;
-
- public MachineOverviewPageVM()
- {
- // default ctor
- }
- public MachineOverviewPageVM(IAdsManager adsManager, IConfiguration config,MainWindowVM mainVm, ProductionOverviewPageVM prodVm, TcEventLogger eventLogger)
- {
- _adsManager = adsManager;
- _config = config;
- _prodVM = prodVm;
- _mainVm = mainVm;
- // Create dummy string
- DummyStringVM = new StringControlButtonVM();
-
- // Create empty page
- _emptyPage = new();
-
- CurrentDetailPage = _emptyPage;
- _currentMessage = new NavigateMessage("", typeof(Page));
- _messageStack.Push(_currentMessage);
-
- WeakReferenceMessenger.Default.Register(this);
-
- }
-
-
-
- [RelayCommand]
- public void TrayfeederPageClicked()
- {
-
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(TrayFeederPage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
-
- }
-
- [RelayCommand]
- public void AlignerPageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(AlignmentStationPage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- [RelayCommand]
- public void Etching1PageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(EtchingStation1Page));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- [RelayCommand]
- public void Etching2PageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(EtchingStation2Page));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- [RelayCommand]
- public void HVTestPageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(HighVoltageStationPage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- [RelayCommand]
- public void HotCoolplatePageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(HotCoolPlatePage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- [RelayCommand]
- public void NIOStationPageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(NIOStationPage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
-
-
- [RelayCommand]
- public void KukaPageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(KukaRobotPage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- [RelayCommand]
- public void MediaCabinetPageClicked()
- {
- NavigateMessage message = new("", typeof(ProductionOverviewPage));
- NavigateMessage nextMessage = new("", typeof(MediaCabinetPage));
- this.Dispose();
- _mainVm?.NavigateFromOuterPage(message, nextMessage);
- }
-
- // Only use for forward traversal!
- public void Receive(NavigateMessage message)
- {
- // Only change page if its a new page type
- if (CurrentDetailPage.GetType() == message.type)
- return;
-
- // Push current message
- if (_currentMessage != null)
- _messageStack.Push(_currentMessage);
-
- // Save current message for later push
- _currentMessage = message;
-
- // Set can navigate back
-
- Navigate(message);
- }
-
- private void Navigate(NavigateMessage message)
- {
- // Dispose current pages viewmodel
- if (CurrentDetailPage.DataContext is IDisposable viewModel)
- {
- CurrentDetailPage.DataContext = null;
- viewModel.Dispose();
- }
-
-
- // Create new page
- switch (message.type.Name)
- {
- case nameof(TrayFeederPage):
- if (_trayFeederPageVm == null)
- _trayFeederPageVm = new(_adsManager, "GVL_CONFIG.stMachine");
-
- TrayFeederPage trayFeederPage = new() { DataContext = _trayFeederPageVm };
- CurrentDetailPage = trayFeederPage;
- break;
-
- case nameof(AlignmentStationPage):
- // Create seetings page view model only once
- if (_alignmentStationPageVM == null)
- _alignmentStationPageVM = new(_adsManager, "GVL_CONFIG.stMachine.stAligner");
-
- AlignmentStationPage settingsPage = new() { DataContext = _alignmentStationPageVM };
- CurrentDetailPage = settingsPage;
- break;
-
- case nameof(EtchingStation1Page):
- if (_etchingStation1PageVm == null)
- _etchingStation1PageVm = new(_adsManager, "GVL_CONFIG.stMachine.stEtcher1");
-
- EtchingStation1Page etchingStation1Page = new() { DataContext = _etchingStation1PageVm };
- CurrentDetailPage = etchingStation1Page;
- break;
-
- case nameof(EtchingStation2Page):
- if (_etchingStation2PageVm == null)
- _etchingStation2PageVm = new(_adsManager, "GVL_CONFIG.stMachine.stEtcher2");
-
- EtchingStation2Page etchingStation2Page = new() { DataContext = _etchingStation2PageVm };
- CurrentDetailPage = etchingStation2Page;
- break;
-
- case nameof(HighVoltageStationPage):
- if (_highVoltageStationPageVm == null)
- _highVoltageStationPageVm = new(_adsManager, "GVL_CONFIG.stMachine");
-
- HighVoltageStationPage highVoltageStationPage = new() { DataContext = _highVoltageStationPageVm };
- CurrentDetailPage = highVoltageStationPage;
- break;
-
- case nameof(HotCoolPlatePage):
- if (_hotCoolplatePageVM == null)
- _hotCoolplatePageVM = new(_adsManager, "GVL_Config.stMachine");
-
- HotCoolPlatePage hotCoolPlatePage = new() {DataContext = _hotCoolplatePageVM };
- CurrentDetailPage = hotCoolPlatePage;
- break;
-
- case nameof(NIOStationPage):
- if (_nioStationPageVm == null)
- _nioStationPageVm = new(_adsManager, "GVL_Config.stMachine.stNOK");
-
- NIOStationPage nIOStationPage = new() { DataContext = _nioStationPageVm };
- CurrentDetailPage = nIOStationPage;
- break;
-
- case nameof(KukaRobotPage):
- // Create page view model only once
- if (_kukaRobotPageVM == null)
- _kukaRobotPageVM = new(_adsManager, "GVL_CONFIG.stMachine.stKukaRobot");
-
- KukaRobotPage kukaRobotPage = new() { DataContext = _kukaRobotPageVM };
- CurrentDetailPage = kukaRobotPage;
- break;
-
- case nameof(MediaCabinetPage):
- if (_mediaCabinetPageVM == null)
- _mediaCabinetPageVM = new(_adsManager, "GVL_Config.stMachine");
-
- MediaCabinetPage mediaCabinetPage = new() { DataContext= _mediaCabinetPageVM };
- CurrentDetailPage = mediaCabinetPage;
- break;
-
- default:
- CurrentDetailPage = new Page();
- break;
- }
- }
-
- [RelayCommand]
- private void AckAlarms()
- {
- _adsManager.WriteValue("GVL_SCADA.stConfirmAlarmsBtn.xRequest", true);
- }
-
- public void Dispose()
- {
- // Dispose current pages viewmodel
- if (CurrentDetailPage.DataContext is IDisposable viewModel)
- {
- CurrentDetailPage.DataContext = null;
- viewModel.Dispose();
- }
-
- DummyStringVM.Dispose();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/MediaCabinetPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/MediaCabinetPageVM.cs
deleted file mode 100644
index 8d2fa11..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/MediaCabinetPageVM.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-using Common;
-using InfineonHMI.Model;
-
-namespace InfineonHMI
-{
- public sealed partial class MediaCabinetPageVM : ObservableValidator, IDisposable
- {
-
- private IAdsManager _adsManager;
- private string? _variableName;
-
- [ObservableProperty] private MediaContainerVm container1Vm;
- [ObservableProperty] private MediaContainerVm container2Vm;
- [ObservableProperty] private MediaContainerVm container3Vm;
- [ObservableProperty] private MediaContainerVm container4Vm;
- [ObservableProperty] private MediaContainerVm container5Vm;
- [ObservableProperty] private MediaContainerVm container6Vm;
- [ObservableProperty] private MediaContainerVm container7Vm;
- [ObservableProperty] private MediaContainerVm container8Vm;
- [ObservableProperty] private MediaContainerVm container9Vm;
-
-
- public MediaCabinetPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- Container1Vm = new MediaContainerVm(adsManager, variableName + ".stContainer1");
- Container2Vm = new MediaContainerVm(adsManager, variableName + ".stContainer2");
- Container3Vm = new MediaContainerVm(adsManager, variableName + ".stContainer3");
- Container4Vm = new MediaContainerVm(adsManager, variableName + ".stContainer4");
- Container5Vm = new MediaContainerVm(adsManager, variableName + ".stContainer5");
- Container6Vm = new MediaContainerVm(adsManager, variableName + ".stContainer6");
- Container7Vm = new MediaContainerVm(adsManager, variableName + ".stContainer7");
- Container8Vm = new MediaContainerVm(adsManager, variableName + ".stContainer8");
- Container9Vm = new MediaContainerVm(adsManager, variableName + ".stContainer9");
-
- Container1Vm.SName = "Container1";
- Container2Vm.SName = "Container2";
- Container3Vm.SName = "Container3";
- Container4Vm.SName = "Container4";
- Container5Vm.SName = "Container5";
- Container6Vm.SName = "Container6";
- Container7Vm.SName = "Container7";
- Container8Vm.SName = "Container8";
- Container9Vm.SName = "Container9";
-
- }
-
- public MediaCabinetPageVM()
- {
- Container1Vm = new MediaContainerVm();
- Container2Vm = new MediaContainerVm();
- Container3Vm = new MediaContainerVm();
- Container4Vm = new MediaContainerVm();
- Container5Vm = new MediaContainerVm();
- Container6Vm = new MediaContainerVm();
- Container7Vm = new MediaContainerVm();
- Container8Vm = new MediaContainerVm();
- Container9Vm = new MediaContainerVm();
-
-
- Container1Vm.SName = "Container1";
- Container2Vm.SName = "Container2";
- Container3Vm.SName = "Container3";
- Container4Vm.SName = "Container4";
- Container5Vm.SName = "Container5";
- Container6Vm.SName = "Container6";
- Container7Vm.SName = "Container7";
- Container8Vm.SName = "Container8";
- Container9Vm.SName = "Container9";
-
-
-
-
-
-
-
-
-
- }
-
-
- public void Dispose()
- {
-
- Container1Vm.Dispose();
- Container2Vm.Dispose();
- Container3Vm.Dispose();
- Container4Vm.Dispose();
- Container5Vm.Dispose();
- Container6Vm.Dispose();
- Container7Vm.Dispose();
- Container8Vm.Dispose();
- Container9Vm.Dispose();
-
- }
-
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ModuleOverviewPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/ModuleOverviewPageVM.cs
deleted file mode 100644
index cede5ce..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ModuleOverviewPageVM.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-using UniperHMI.OwnControls;
-
-namespace UniperHMI
-{
- public sealed partial class ModuleOverviewPageVM : ObservableObject, IDisposable
- {
- [ObservableProperty]
- private UnitControlButtonVM unit1;
-
- [ObservableProperty]
- private UnitControlButtonVM unit2;
-
- [ObservableProperty]
- private UnitControlButtonVM unit3;
-
- [ObservableProperty]
- private UnitControlButtonVM unit4;
-
- private readonly IAdsManager? _adsManager;
- private readonly string? _variableName;
-
- public ModuleOverviewPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- unit1 = new(_adsManager, _variableName + ".stHMIInterfaceUnit1");
- unit2 = new(_adsManager, _variableName + ".stHMIInterfaceUnit2");
- unit3 = new(_adsManager, _variableName + ".stHMIInterfaceUnit3");
- unit4 = new(_adsManager, _variableName + ".stHMIInterfaceUnit4");
- }
-
- public void Dispose()
- {
- Unit1?.Dispose();
- Unit2?.Dispose();
- Unit3?.Dispose();
- Unit4?.Dispose();
- }
-
- [RelayCommand]
- public void Unit1Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceUnit1", typeof(UnitOverviewPage), "Unit 1"));
- }
-
- [RelayCommand]
- public void Unit2Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceUnit2", typeof(UnitOverviewPage), "Unit 2"));
- }
-
- [RelayCommand]
- public void Unit3Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceUnit3", typeof(UnitOverviewPage), "Unit 3"));
- }
-
- [RelayCommand]
- public void Unit4Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceUnit4", typeof(UnitOverviewPage), "Unit 4"));
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs
deleted file mode 100644
index 2f3ddea..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-namespace InfineonHMI
-{
- public sealed partial class NIOStationPageVM : ObservableValidator, IDisposable
- {
-
-
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- [ObservableProperty] private BinaryValveControlVM clampDiagValveVm;
-
- [ObservableProperty] private BinaryValveControlVM clampAcrossValveVm;
-
- [ObservableProperty] private HMIControlButtonVM clampCmdButtonVm;
-
- [ObservableProperty] private HMIControlButtonVM unclampCmdButtonVm;
-
- public NIOStationPageVM()
- {
- ClampDiagValveVm = new BinaryValveControlVM();
- ClampAcrossValveVm = new BinaryValveControlVM();
- ClampCmdButtonVm = new HMIControlButtonVM();
- UnclampCmdButtonVm = new HMIControlButtonVM();
- }
-
- public NIOStationPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- ClampDiagValveVm = new BinaryValveControlVM(_adsManager, _variableName + ".stClampDiagValve");
- ClampAcrossValveVm = new BinaryValveControlVM(_adsManager, _variableName + ".stClampAcrossValve");
- ClampCmdButtonVm = new HMIControlButtonVM(_adsManager, _variableName + ".stClampCmd");
- UnclampCmdButtonVm = new HMIControlButtonVM(_adsManager, _variableName + "stUnclampCmd");
-
-
- }
-
- public void Dispose()
- {
- ClampDiagValveVm.Dispose();
- ClampAcrossValveVm.Dispose();
- ClampCmdButtonVm.Dispose();
- UnclampCmdButtonVm.Dispose();
- }
-
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ProductionOverviewPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/ProductionOverviewPageVM.cs
deleted file mode 100644
index 0e1890b..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ProductionOverviewPageVM.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using System.Windows;
-using System.Windows.Controls;
-using TcEventLoggerAdsProxyLib;
-
-namespace InfineonHMI;
-
-public sealed partial class ProductionOverviewPageVM : ObservableObject, IRecipient, IDisposable
-{
-
- [ObservableProperty] private StringControlButtonVM dummyStringVM;
-
- [ObservableProperty] private Page currentDetailPage;
-
- [ObservableProperty] private bool canNavigateBack;
-
- private readonly IAdsManager _adsManager;
- private readonly IConfiguration _config;
- private readonly TcEventLogger _eventlogger;
-
-
- // Last active event
- [ObservableProperty] private string currentActiveEvent = "";
-
- private readonly object _lock = new();
-
- // Empty page
- private readonly Page _emptyPage;
-
- // Last navigate message
- private readonly Stack _messageStack = new();
- NavigateMessage? _currentMessage;
-
- // Hot Coolplate page view model
- HotCoolPlatePageVM? _hotCoolplatePageVM;
-
- AlignmentStationPageVM? _alignmentStationPageVM;
-
- EtchingStation1PageVM? _etchingStation1PageVm;
-
- EtchingStation2PageVM? _etchingStation2PageVm;
-
- HighVoltageStationPageVM? _highVoltageStationPageVm;
-
- MediaCabinetPageVM? _mediaCabinetPageVM;
-
- NIOStationPageVM? _nioStationPageVm;
-
- TrayFeederPageVM? _trayFeederPageVm;
-
-
- // Kuka Robot page view model
- KukaRobotPageVM? _kukaRobotPageVM;
-
- public ProductionOverviewPageVM()
- {
- // default ctor
- }
- public ProductionOverviewPageVM(IAdsManager adsManager, IConfiguration config, TcEventLogger eventLogger, NavigateMessage? message = null)
- {
- _adsManager = adsManager;
- _config = config;
- // Create dummy string
- DummyStringVM = new StringControlButtonVM();
-
- // Create empty page
- _emptyPage = new();
-
- CurrentDetailPage = _emptyPage;
- _currentMessage = new NavigateMessage("", typeof(Page));
- _messageStack.Push(_currentMessage);
-
- if (message != null)
- {
- Receive(message);
- }
-
- WeakReferenceMessenger.Default.Register(this);
-
- }
-
- [RelayCommand]
- public void TrayfeederPageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["TrayFeederVarName"]!, typeof(TrayFeederPage));
- Receive(message);
- }
-
- [RelayCommand]
- public void AlignerPageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["AlignerVarName"]!, typeof(AlignmentStationPage));
- Receive(message);
- }
-
- [RelayCommand]
- public void Etching1PageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["Etching1VarName"]!, typeof(EtchingStation1Page));
- Receive(message);
- }
-
- [RelayCommand]
- public void Etching2PageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["Etching2VarName"]!, typeof(EtchingStation2Page));
- Receive(message);
- }
-
- [RelayCommand]
- public void HVTestPageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["HVTestVarName"]!, typeof(HighVoltageStationPage));
- Receive(message);
- }
-
- [RelayCommand]
- public void HotCoolplatePageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["HotCoolplateVarName"]!, typeof(HotCoolPlatePage));
- Receive(message);
- }
-
- [RelayCommand]
- public void NIOStationPageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["NIOStationVarName"]!, typeof(NIOStationPage));
- Receive(message);
- }
-
-
-
- [RelayCommand]
- public void KukaPageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["KukaRobotVarName"]!, typeof(KukaRobotPage));
- Receive(message);
- }
-
- [RelayCommand]
- public void MediaCabinetPageClicked()
- {
- _messageStack.Clear();
- _currentMessage = new NavigateMessage("", typeof(Page));
- NavigateMessage message = new(_config["MediaCabinetVarName"]!, typeof(MediaCabinetPage));
- Receive(message);
- }
-
- // Only use for forward traversal!
- public void Receive(NavigateMessage message)
- {
- // Only change page if its a new page type
- if (CurrentDetailPage.GetType() == message.type)
- return;
-
- // Push current message
- if (_currentMessage != null)
- _messageStack.Push(_currentMessage);
-
- // Save current message for later push
- _currentMessage = message;
-
- // Set can navigate back
- CanNavigateBack = true;
-
- Navigate(message);
- }
-
- public void NavigateFromOuterPage(NavigateMessage message)
- {
- _currentMessage = message;
-
- CanNavigateBack = true;
- Navigate(message);
- }
-
- private void Navigate(NavigateMessage message)
- {
- // Dispose current pages viewmodel
- if (CurrentDetailPage.DataContext is IDisposable viewModel)
- {
- CurrentDetailPage.DataContext = null;
- viewModel.Dispose();
- }
-
- // Create new page
- switch (message.type.Name)
- {
- case nameof(TrayFeederPage):
- if (_trayFeederPageVm == null)
- _trayFeederPageVm = new(_adsManager, "GVL_CONFIG.stMachine");
-
- TrayFeederPage trayFeederPage = new() { DataContext = _trayFeederPageVm };
- CurrentDetailPage = trayFeederPage;
- break;
-
- case nameof(AlignmentStationPage):
- // Create seetings page view model only once
- if (_alignmentStationPageVM == null)
- _alignmentStationPageVM = new(_adsManager, "GVL_CONFIG.stMachine.stAligner");
-
- AlignmentStationPage settingsPage = new() { DataContext = _alignmentStationPageVM };
- CurrentDetailPage = settingsPage;
- break;
-
- case nameof(EtchingStation1Page):
- if (_etchingStation1PageVm == null)
- _etchingStation1PageVm = new(_adsManager, "GVL_CONFIG.stMachine.stEtcher1");
-
- EtchingStation1Page etchingStation1Page = new() { DataContext = _etchingStation1PageVm };
- CurrentDetailPage = etchingStation1Page;
- break;
-
- case nameof(EtchingStation2Page):
- if (_etchingStation2PageVm == null)
- _etchingStation2PageVm = new(_adsManager, "GVL_CONFIG.stMachine.stEtcher2");
-
- EtchingStation2Page etchingStation2Page = new() { DataContext = _etchingStation2PageVm };
- CurrentDetailPage = etchingStation2Page;
- break;
-
- case nameof(HighVoltageStationPage):
- if (_highVoltageStationPageVm == null)
- _highVoltageStationPageVm = new(_adsManager, "GVL_CONFIG.stMachine");
-
- HighVoltageStationPage highVoltageStationPage = new() { DataContext = _highVoltageStationPageVm };
- CurrentDetailPage = highVoltageStationPage;
- break;
-
- case nameof(HotCoolPlatePage):
- if (_hotCoolplatePageVM == null)
- _hotCoolplatePageVM = new(_adsManager, "GVL_Config.stMachine");
-
- HotCoolPlatePage hotCoolPlatePage = new() {DataContext = _hotCoolplatePageVM };
- CurrentDetailPage = hotCoolPlatePage;
- break;
-
- case nameof(NIOStationPage):
- if (_nioStationPageVm == null)
- _nioStationPageVm = new(_adsManager, "GVL_Config.stMachine.stNOK");
-
- NIOStationPage nIOStationPage = new() { DataContext = _nioStationPageVm };
- CurrentDetailPage = nIOStationPage;
- break;
-
- case nameof(KukaRobotPage):
- // Create page view model only once
- if (_kukaRobotPageVM == null)
- _kukaRobotPageVM = new(_adsManager, "GVL_CONFIG.stMachine.stKukaRobot");
-
- KukaRobotPage kukaRobotPage = new() { DataContext = _kukaRobotPageVM };
- CurrentDetailPage = kukaRobotPage;
- break;
-
- case nameof(MediaCabinetPage):
- if (_mediaCabinetPageVM == null)
- _mediaCabinetPageVM = new(_adsManager, "GVL_Config.stMachine");
-
- MediaCabinetPage mediaCabinetPage = new() { DataContext= _mediaCabinetPageVM };
- CurrentDetailPage = mediaCabinetPage;
- break;
-
- default:
- CurrentDetailPage = new Page();
- break;
- }
- }
-
- [RelayCommand]
- private void AckAlarms()
- {
- _adsManager.WriteValue("GVL_SCADA.stConfirmAlarmsBtn.xRequest", true);
- }
-
- public void Dispose()
- {
- // Dispose current pages viewmodel
- if (CurrentDetailPage.DataContext is IDisposable viewModel)
- {
- CurrentDetailPage.DataContext = null;
- viewModel.Dispose();
- }
-
- DummyStringVM.Dispose();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ReceipePageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/ReceipePageVM.cs
deleted file mode 100644
index 3b80b15..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/ReceipePageVM.cs
+++ /dev/null
@@ -1,746 +0,0 @@
-using System.Collections.ObjectModel;
-using System.Printing;
-using System.Runtime.InteropServices.JavaScript;
-using System.Windows.Automation;
-using System.Windows.Input;
-using Common;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using Heisig.HMI.AdsManager;
-using InfineonHMI.Model;
-using Microsoft.Win32;
-using InfineonHMI.Common;
-using TwinCAT.PlcOpen;
-
-namespace InfineonHMI;
-
-public sealed partial class ReceipePageVM : ObservableValidator, IDisposable
-{
-
- #region Properties
- private AdsManager _adsManager;
-
- private int maxFlowNodes = 10;
- private int maxTrayPositions = 20;
- private int maxEtcherRobotPositions = 20;
-
- [ObservableProperty] private ObservableCollection trayPositions;
- [ObservableProperty] private ParamControlIntVm cameraProgramsVm = new ();
- [ObservableProperty] private ParamControlIntVm chucksVm = new ();
- [ObservableProperty] private ParamControlIntVm gripperVm = new ();
- [ObservableProperty] private ParamControlFloatVm permissibleBeamParamDeviationsVm = new ();
-
- [ObservableProperty] private ParamControlFloatVm diameterVm = new ();
- [ObservableProperty] private ParamControlFloatVm thicknessVm = new ();
- [ObservableProperty] private ParamControlFloatVm timeIntervallBeamCheckVm = new ();
-
- [ObservableProperty] private ParamControlFloatVm restingTimeHotplateVm = new ();
- [ObservableProperty] private ParamControlFloatVm targetTemperatureHotplateVm = new ();
- [ObservableProperty] private ParamControlFloatVm restingTimeCoolplateVm = new ();
- [ObservableProperty] private ParamControlFloatVm targetTemperatureCoolplateVm = new ();
-
- [ObservableProperty] private ParamControlFloatVm hvtestVoltageVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvmaxTestCurrentVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvrampTimeVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvtestFrequencyVm = new ();
- [ObservableProperty] private ParamControlIntVm hvpolarityVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvtestPressureN2Vm = new ();
- [ObservableProperty] private ParamControlFloatVm hvn2PrePurgeTimeVm = new ();
- [ObservableProperty] private ParamControlIntVm hvnumRetriesVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvtestTemperatureVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvTestOkVoltageVm = new ();
- [ObservableProperty] private ParamControlFloatVm hvTestOkCurrentVm = new ();
-
- [ObservableProperty] private ParamControlIntVm numberRobotPositionsVm = new ();
- [ObservableProperty] private ParamControlFloatVm chuckRpmVm = new ();
- [ObservableProperty] private ObservableCollection etcherRobotSteps;
- [ObservableProperty] private ParamControlFloatVm radialPosLowerWaterJetVm = new ();
-
- [ObservableProperty] private ParamControlIntVm flowNodeCountVm = new ();
-
-
- #endregion Properties
-
- #region FlowReceipe
-
- [ObservableProperty]
- private ObservableCollection flowStationsVm =
- [
- new StationEntry(Stationenum.EINGABE, "Eingabetray"),
- new StationEntry(Stationenum.QRCODE, "QR Code Scan"),
- new StationEntry(Stationenum.AUSRICHTEN, "Ausrichten"),
- new StationEntry(Stationenum.AETZEN, "Ätzstation 1/2"),
- new StationEntry(Stationenum.HEIZPLATTE, "Heizplatte"),
- new StationEntry(Stationenum.KUEHLPLATTE, "Kühlplatte"),
- new StationEntry(Stationenum.HOCHVOLTHEISS, "Hochvolt Heiss"),
- new StationEntry(Stationenum.HOCHVOLTKALT, "Hochvolt Kalt"),
- new StationEntry(Stationenum.AUSGABE, "Ausgabetray"),
- new StationEntry(Stationenum.NIOSTATION, "NIO Station")
-
- ];
-
- [ObservableProperty] private ObservableCollection flowReceipeEntries;
-
- [RelayCommand]
- public void AddFlowReceipeEntry()
- {
- var nodeid = FlowReceipeEntries.Count;
- FlowReceipeEntries.Add(new FlowReceipeEntry
- {
- NodeId = nodeid,
- MaxRetries = 0,
- NextNodeFail = -1,
- NextNodeSuccess = -1,
- NextNodeRetry = -1,
- Priority = 100,
- Station = FlowStationsVm[0]
- });
- if (FlowReceipeEntries.Count >= maxFlowNodes)
- {
- CanAddFlowReceipeEntry = false;
- }
-
- if (FlowReceipeEntries.Count > 0)
- {
- CanRemoveFlowReceipeEntry = true;
- }
- }
-
- private void addFlowReceipeEntry(FlowReceipeEntry fre)
- {
- var nodeid = FlowReceipeEntries.Count;
- FlowReceipeEntries.Add(new FlowReceipeEntry
- {
- NodeId = nodeid,
- MaxRetries = fre.MaxRetries,
- NextNodeFail = fre.NextNodeFail,
- NextNodeSuccess = fre.NextNodeSuccess,
- NextNodeRetry = fre.NextNodeRetry,
- Priority = fre.Priority,
- Station = new StationEntry(fre.Station.eStation, fre.Station.sName)
- });
- }
-
- [RelayCommand]
- public void RemoveFlowReceipeEntry()
- {
- FlowReceipeEntries.Remove(SelectedFlowReceipeEntry);
- var receipes = new ObservableCollection(FlowReceipeEntries);
-
- FlowReceipeEntries.Clear();
-
- foreach (var receipe in receipes)
- addFlowReceipeEntry(receipe);
-
-
- if (FlowReceipeEntries.Count < maxFlowNodes)
- {
- CanAddFlowReceipeEntry = true;
- }
-
- if (FlowReceipeEntries.Count > 0)
- {
- CanRemoveFlowReceipeEntry = true;
- }
- else
- {
- CanRemoveFlowReceipeEntry = false;
- }
-
- }
-
- [RelayCommand]
- public void FlowReceipeEntryUp()
- {
- var selectedIndex = FlowReceipeEntries.IndexOf(SelectedFlowReceipeEntry);
- if (selectedIndex == 0)
- return;
- FlowReceipeEntries.Move(selectedIndex, selectedIndex - 1);
-
- var receipes = new ObservableCollection(FlowReceipeEntries);
- FlowReceipeEntries.Clear();
-
- foreach (var receipe in receipes)
- addFlowReceipeEntry(receipe);
-
- }
-
- [RelayCommand]
- public void FlowReceipeEntryDown()
- {
- var selectedIndex = FlowReceipeEntries.IndexOf(SelectedFlowReceipeEntry);
- if (selectedIndex >= FlowReceipeEntries.Count)
- return;
- FlowReceipeEntries.Move(selectedIndex, selectedIndex + 1);
-
- var receipes = new ObservableCollection(FlowReceipeEntries);
- FlowReceipeEntries.Clear();
-
- foreach (var receipe in receipes)
- addFlowReceipeEntry(receipe);
-
- }
-
- [ObservableProperty] private bool canAddFlowReceipeEntry;
- [ObservableProperty] private bool canRemoveFlowReceipeEntry;
-
- [ObservableProperty] private FlowReceipeEntry selectedFlowReceipeEntry;
-
- #endregion Flowreceipe
-
- #region Traypositions
- [ObservableProperty] private TrayPosition selectedTrayPosition;
-
-
- [ObservableProperty] private bool canAddTrayPosition;
- [ObservableProperty] private bool canRemoveTrayPosition;
-
- [RelayCommand]
- public void AddTrayPosition()
- {
- var posId = TrayPositions.Count;
- TrayPositions.Add(new TrayPosition
- {
- PosId = posId,
- PosX = 0.0f,
- PosY = 0.0f,
-
- });
- if (TrayPositions.Count >= maxTrayPositions)
- {
- CanAddTrayPosition = false;
- }
-
- if (TrayPositions.Count > 0)
- {
- CanRemoveTrayPosition = true;
- }
- }
-
- private void addTrayPosition(TrayPosition trayPos)
- {
- var posId = TrayPositions.Count;
- TrayPositions.Add(new TrayPosition
- {
- PosId = posId,
- PosX = trayPos.PosX,
- PosY = trayPos.PosY
- });
- }
-
- [RelayCommand]
- public void RemoveTrayPosition()
- {
- TrayPositions.Remove(SelectedTrayPosition);
- var positions = new ObservableCollection(TrayPositions);
-
- TrayPositions.Clear();
-
- foreach (var position in positions)
- addTrayPosition(position);
-
-
- if (TrayPositions.Count < maxTrayPositions)
- {
- CanAddTrayPosition = true;
- }
-
- if (TrayPositions.Count > 0)
- {
- CanRemoveTrayPosition = true;
- }
- else
- {
- CanRemoveTrayPosition = false;
- }
-
- }
-
- [RelayCommand]
- public void TrayPositionUp()
- {
- var selectedIndex = TrayPositions.IndexOf(SelectedTrayPosition);
- if (selectedIndex == 0)
- return;
- TrayPositions.Move(selectedIndex, selectedIndex - 1);
-
- var positions = new ObservableCollection(TrayPositions);
- TrayPositions.Clear();
-
- foreach (var pos in positions)
- addTrayPosition(pos);
-
- }
-
- [RelayCommand]
- public void TrayPositionDown()
- {
- var selectedIndex = TrayPositions.IndexOf(SelectedTrayPosition);
- if (selectedIndex >= TrayPositions.Count)
- return;
- TrayPositions.Move(selectedIndex, selectedIndex + 1);
-
- var positions = new ObservableCollection(TrayPositions);
- TrayPositions.Clear();
-
- foreach (var pos in positions)
- addTrayPosition(pos);
-
- }
-
-
-
- #endregion Traypositions
-
- #region EtcherRobotPositions
-
- [ObservableProperty] private EtcherRobotStepData selectedEtchRobotStep;
-
-
- [ObservableProperty] private bool canAddEtchRobotStep;
- [ObservableProperty] private bool canRemoveEtchRobotStep;
-
- [RelayCommand]
- public void AddEtchRobotStep()
- {
- EtcherRobotSteps.Add(new EtcherRobotStepData()
- {
- PosX = 0.0f,
- PosY = 0.0f,
- PosZ = 0.0f,
- MoveSpeed = 0.0f,
- AngleAlpha = 0.0f,
- WaterFromAbove = false,
- WaterFromBelow = false,
- Medium = 0,
- Delay = 0.0f
- });
- if (EtcherRobotSteps.Count >= maxEtcherRobotPositions)
- {
- CanAddEtchRobotStep = false;
- }
-
- if (EtcherRobotSteps.Count > 0)
- {
- CanRemoveEtchRobotStep = true;
- }
- }
-
- private void addEtchRobotStep(EtcherRobotStepData etchStep)
- {
- var posId = EtcherRobotSteps.Count;
- EtcherRobotSteps.Add(new EtcherRobotStepData()
- {
- PosX = etchStep.PosX,
- PosY = etchStep.PosY,
- PosZ = etchStep.PosZ,
- MoveSpeed = etchStep.MoveSpeed,
- AngleAlpha = etchStep.AngleAlpha,
- WaterFromAbove = etchStep.WaterFromAbove,
- WaterFromBelow = etchStep.WaterFromBelow,
- Medium = etchStep.Medium,
- Delay = etchStep.Delay
- });
- }
-
- [RelayCommand]
- public void RemoveEtchRobotStep()
- {
- EtcherRobotSteps.Remove(SelectedEtchRobotStep);
- var steps = new ObservableCollection(EtcherRobotSteps);
-
- EtcherRobotSteps.Clear();
-
- foreach (var step in steps)
- addEtchRobotStep(step);
-
-
- if (EtcherRobotSteps.Count < maxEtcherRobotPositions)
- {
- CanAddEtchRobotStep = true;
- }
-
- if (EtcherRobotSteps.Count > 0)
- {
- CanRemoveEtchRobotStep = true;
- }
- else
- {
- CanRemoveEtchRobotStep = false;
- }
-
- }
-
- [RelayCommand]
- public void EtchRobotStepUp()
- {
- var selectedIndex = EtcherRobotSteps.IndexOf(SelectedEtchRobotStep);
- if (selectedIndex == 0)
- return;
- EtcherRobotSteps.Move(selectedIndex, selectedIndex - 1);
-
- var steps = new ObservableCollection(EtcherRobotSteps);
- EtcherRobotSteps.Clear();
-
- foreach (var step in steps)
- addEtchRobotStep(step);
-
- }
-
- [RelayCommand]
- public void EtchRobotStepDown()
- {
- var selectedIndex = EtcherRobotSteps.IndexOf(SelectedEtchRobotStep);
- if (selectedIndex >= EtcherRobotSteps.Count)
- return;
- EtcherRobotSteps.Move(selectedIndex, selectedIndex + 1);
-
- var steps = new ObservableCollection(EtcherRobotSteps);
- EtcherRobotSteps.Clear();
-
- foreach (var step in steps)
- addEtchRobotStep(step);
-
- }
-
- #endregion
-
- #region Commands
-
- [RelayCommand]
- public void WriteToPlc()
- {
- SendDataToPLC();
- }
-
- [RelayCommand]
- public void ReadReceipeFile()
- {
- var dlg = new OpenFileDialog();
- if (dlg.ShowDialog() != true)
- return ;
-
- var dto = new ReceipeDto();
- dto.Read(dlg.FileName);
- GetDto(dto);
- }
-
- [RelayCommand]
- public void WriteReceipeFile()
- {
- var dlg = new SaveFileDialog();
- if (dlg.ShowDialog() != true)
- return;
-
- var dto = SetDto();
- dto.Write(dlg.FileName);
- }
-
-
- #endregion Commands
-
-
- #region ctor
-
- public ReceipePageVM()
- {
-
-
- maxFlowNodes = 10;
- maxEtcherRobotPositions = 10;
- maxTrayPositions = 10;
-
- TrayPositions = new ();
- EtcherRobotSteps = new ();
- FlowReceipeEntries = new ();
-
- CameraProgramsVm.SName = "Kameraprogramme: ";
- ChucksVm.SName = "Drehteller: ";
- GripperVm.SName = "Greifertyp: ";
- PermissibleBeamParamDeviationsVm.SName = "Max. Strahlabweichung: ";
- DiameterVm.SName = "Teiledurchmesser: ";
- ThicknessVm.SName = "Teiledicke: ";
- TimeIntervallBeamCheckVm.SName = "Intervall Strahlvermessung: ";
- RestingTimeHotplateVm.SName = "Verweilzeit Heizplatte: ";
- TargetTemperatureHotplateVm.SName = "Zieltemperatur Heizplatte: ";
- RestingTimeCoolplateVm.SName = "Verweilzeit Kühlplatte: ";
- TargetTemperatureCoolplateVm.SName = "Zieltemperatur Kühlplatte";
-
- RadialPosLowerWaterJetVm.SName = "Radial Position Unterwasserstrahl: ";
- ChuckRpmVm.SName = "Drehzahl: ";
- HvmaxTestCurrentVm.SName = "HV: Max. Teststrom: ";
- Hvn2PrePurgeTimeVm.SName = "HV: Vorreinigungszeit: ";
- HvnumRetriesVm.SName = "HV: Anzahl Wiederholversuche: ";
- HvpolarityVm.SName = "HV: Polarität (1=Pos, 2=Neg): ";
- HvrampTimeVm.SName = "HV: Rampenzeit: ";
- HvtestFrequencyVm.SName = "HV: Testfrequenz: ";
- HvTestOkCurrentVm.SName = "HV: Teststrom Teil OK";
- HvTestOkVoltageVm.SName = "HV: Testspannung Teil OK";
- HvtestTemperatureVm.SName = "HV: Testtemperatur: ";
- HvtestVoltageVm.SName = "HV: Testspannung: ";
- HvtestPressureN2Vm.SName = "HV: DruckN2: ";
-
- FlowReceipeEntries = new();
-
- FlowReceipeEntries.Add(new FlowReceipeEntry
- {
- Priority = 100,
- Station = FlowStationsVm[0],
- MaxRetries = 0,
- NextNodeSuccess = 1,
- NextNodeRetry = -1,
- NextNodeFail = -1
- });
-
-
- CanAddTrayPosition = true;
- CanRemoveTrayPosition = false;
- CanAddFlowReceipeEntry = true;
- CanRemoveFlowReceipeEntry = false;
- CanAddEtchRobotStep = true;
- CanRemoveEtchRobotStep = false;
-
- }
-
- public ReceipePageVM(AdsManager adsManager)
- {
- _adsManager = adsManager;
-
- var val = _adsManager.ReadValue("GVL_Scheduler.MAX_RECIPE_NODES");
- maxFlowNodes = (val == null) ? 10 : (int)val; ;
- val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
- maxEtcherRobotPositions = (val == null) ? 10 : (int)val;
- val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
- maxTrayPositions = (val == null) ? 10 : (int)val;
-
-
-
- TrayPositions = new ();
- EtcherRobotSteps = new ();
- FlowReceipeEntries = new ();
-
- CameraProgramsVm.SName = "Kameraprogramme: ";
- ChucksVm.SName = "Drehteller: ";
- GripperVm.SName = "Greifertyp: ";
- PermissibleBeamParamDeviationsVm.SName = "Max. Strahlabweichung: ";
- DiameterVm.SName = "Teiledurchmesser: ";
- ThicknessVm.SName = "Teiledicke: ";
- TimeIntervallBeamCheckVm.SName = "Intervall Strahlvermessung: ";
- RestingTimeHotplateVm.SName = "Verweilzeit Heizplatte: ";
- TargetTemperatureHotplateVm.SName = "Zieltemperatur Heizplatte: ";
- RestingTimeCoolplateVm.SName = "Verweilzeit Kühlplatte: ";
- TargetTemperatureCoolplateVm.SName = "Zieltemperatur Kühlplatte";
-
- RadialPosLowerWaterJetVm.SName = "Radial Position Unterwasserstrahl: ";
- ChuckRpmVm.SName = "Drehzahl: ";
- HvmaxTestCurrentVm.SName = "HV: Max. Teststrom: ";
- Hvn2PrePurgeTimeVm.SName = "HV: Vorreinigungszeit: ";
- HvnumRetriesVm.SName = "HV: Anzahl Wiederholversuche: ";
- HvpolarityVm.SName = "HV: Polarität (1=Pos, 2=Neg): ";
- HvrampTimeVm.SName = "HV: Rampenzeit: ";
- HvtestFrequencyVm.SName = "HV: Testfrequenz: ";
- HvTestOkCurrentVm.SName = "HV: Teststrom Teil OK";
- HvTestOkVoltageVm.SName = "HV: Testspannung Teil OK";
- HvtestTemperatureVm.SName = "HV: Testtemperatur: ";
- HvtestVoltageVm.SName = "HV: Testspannung: ";
- HvtestPressureN2Vm.SName = "HV: DruckN2: ";
-
-
-
-
- }
-
- #endregion ctor
-
-
-
- private ReceipeDto SetDto()
- {
- var receipe = new ReceipeDto();
-
- receipe.ReceipeObject.MachineParameters.TrayPositions = new List(TrayPositions);
- receipe.ReceipeObject.MachineParameters.CameraPrograms = CameraProgramsVm.Value;
- receipe.ReceipeObject.MachineParameters.Chucks = ChucksVm.Value;
- receipe.ReceipeObject.MachineParameters.Gripper = GripperVm.Value;
- receipe.ReceipeObject.MachineParameters.PermissibleBeamParameterDeviations = PermissibleBeamParamDeviationsVm.Value;
-
- receipe.ReceipeObject.ProductParameters.Diameter = DiameterVm.Value;
- receipe.ReceipeObject.ProductParameters.Thickness = ThicknessVm.Value;
- receipe.ReceipeObject.ProductParameters.TimeIntervallBeamCheck = TimeIntervallBeamCheckVm.Value;
-
- receipe.ReceipeObject.ReceipeHotplate.RestingTime = RestingTimeHotplateVm.Value;
- receipe.ReceipeObject.ReceipeHotplate.TargetTemperature = TargetTemperatureHotplateVm.Value;
-
- receipe.ReceipeObject.ReceipeCoolplate.RestingTime = RestingTimeCoolplateVm.Value;
- receipe.ReceipeObject.ReceipeCoolplate.TargetTemperature = TargetTemperatureCoolplateVm.Value;
-
- receipe.ReceipeObject.ReceipeEtcher.NumberRobotPos = (ushort)NumberRobotPositionsVm.Value;
- receipe.ReceipeObject.ReceipeEtcher.RadialPosLowerWaterJet = RadialPosLowerWaterJetVm.Value;
- receipe.ReceipeObject.ReceipeEtcher.Rpm = ChuckRpmVm.Value;
- receipe.ReceipeObject.ReceipeEtcher.RobotStepData = new List(EtcherRobotSteps);
-
- receipe.ReceipeObject.ReceipeHvTester.MaximumTestCurrent = HvmaxTestCurrentVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.N2PrePurgetime = Hvn2PrePurgeTimeVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.NumRetries = (ushort)HvnumRetriesVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.Polarity = (ushort)HvpolarityVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.RampTime = HvrampTimeVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.TestFrequency = HvtestFrequencyVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.TestOkCurrent = HvTestOkCurrentVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.TestOkVoltage = HvTestOkVoltageVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.TestTemperature = HvtestTemperatureVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.TestVoltage = HvtestVoltageVm.Value;
- receipe.ReceipeObject.ReceipeHvTester.TestpressureN2 = HvtestPressureN2Vm.Value;
-
- receipe.ReceipeObject.Flowreceipe.Nodes = new List();
- foreach (var entry in FlowReceipeEntries)
- {
- var node = new FlowReceipeNode();
- node.StationType = (ushort)entry.Station.eStation;
- node.Priority = entry.Priority;
- node.NextNodeSuccess = entry.NextNodeSuccess;
- node.NextNodeRetry = entry.NextNodeRetry;
- node.NextNodeFail = entry.NextNodeFail;
- node.MaxRetries = entry.MaxRetries;
-
- receipe.ReceipeObject.Flowreceipe.Nodes.Add(node);
- }
-
- receipe.ReceipeObject.Flowreceipe.NodeCount = receipe.ReceipeObject.Flowreceipe.Nodes.Count;
-
-
- return receipe;
- }
-
- private void GetDto(ReceipeDto receipe)
- {
- TrayPositions = new (receipe.ReceipeObject.MachineParameters.TrayPositions);
- CameraProgramsVm.Value = receipe.ReceipeObject.MachineParameters.CameraPrograms;
- ChucksVm.Value = receipe.ReceipeObject.MachineParameters.Chucks;
- GripperVm.Value = receipe.ReceipeObject.MachineParameters.Gripper;
- PermissibleBeamParamDeviationsVm.Value = receipe.ReceipeObject.MachineParameters.PermissibleBeamParameterDeviations;
-
- DiameterVm.Value = receipe.ReceipeObject.ProductParameters.Diameter;
- ThicknessVm.Value = receipe.ReceipeObject.ProductParameters.Thickness;
- TimeIntervallBeamCheckVm.Value = receipe.ReceipeObject.ProductParameters.TimeIntervallBeamCheck;
-
- RestingTimeHotplateVm.Value = receipe.ReceipeObject.ReceipeHotplate.RestingTime;
- TargetTemperatureHotplateVm.Value = receipe.ReceipeObject.ReceipeHotplate.TargetTemperature;
-
- RestingTimeCoolplateVm.Value = receipe.ReceipeObject.ReceipeCoolplate.RestingTime;
- TargetTemperatureCoolplateVm.Value = receipe.ReceipeObject.ReceipeCoolplate.TargetTemperature;
-
- NumberRobotPositionsVm.Value = receipe.ReceipeObject.ReceipeEtcher.NumberRobotPos;
- RadialPosLowerWaterJetVm.Value = receipe.ReceipeObject.ReceipeEtcher.RadialPosLowerWaterJet;
- ChuckRpmVm.Value = receipe.ReceipeObject.ReceipeEtcher.Rpm;
- EtcherRobotSteps = new (receipe.ReceipeObject.ReceipeEtcher.RobotStepData);
-
- HvmaxTestCurrentVm.Value = receipe.ReceipeObject.ReceipeHvTester.MaximumTestCurrent;
- Hvn2PrePurgeTimeVm.Value = receipe.ReceipeObject.ReceipeHvTester.N2PrePurgetime;
- HvnumRetriesVm.Value = receipe.ReceipeObject.ReceipeHvTester.NumRetries;
- HvpolarityVm.Value = receipe.ReceipeObject.ReceipeHvTester.Polarity;
- HvrampTimeVm.Value = receipe.ReceipeObject.ReceipeHvTester.RampTime;
- HvtestFrequencyVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestFrequency;
- HvTestOkCurrentVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestOkCurrent;
- HvTestOkVoltageVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestOkVoltage;
- HvtestTemperatureVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestTemperature;
- HvtestVoltageVm.Value = receipe.ReceipeObject.ReceipeHvTester.TestVoltage;
- HvtestPressureN2Vm.Value = receipe.ReceipeObject.ReceipeHvTester.TestpressureN2;
-
- FlowReceipeEntries.Clear();
- foreach (var node in receipe.ReceipeObject.Flowreceipe.Nodes)
- {
- var station = FlowStationsVm.First(i => (uint)i.eStation == (uint)node.StationType);
-
- AddFlowReceipeEntry();
- FlowReceipeEntries.Last().MaxRetries = node.MaxRetries;
- FlowReceipeEntries.Last().NextNodeRetry = node.NextNodeRetry;
- FlowReceipeEntries.Last().NextNodeFail = node.NextNodeFail;
- FlowReceipeEntries.Last().NextNodeSuccess = node.NextNodeSuccess;
- FlowReceipeEntries.Last().Priority = node.Priority;
- FlowReceipeEntries.Last().Station = station;
- }
-
- FlowNodeCountVm.Value = receipe.ReceipeObject.Flowreceipe.NodeCount;
- }
-
- private void SendDataToPLC()
- {
- var val = _adsManager.ReadValue("GVL_Scheduler.MAX_RECIPE_NODES");
- maxFlowNodes = (val == null) ? 10 : (int)val; ;
- val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
- maxEtcherRobotPositions = (val == null) ? 10:(int)val;
- val = _adsManager.ReadValue("GVL_ETCHER.MAX_ROBOT_POS");
- maxTrayPositions = (val == null) ? 20 : (int)val;
-
- for (var i = 0; i < maxTrayPositions && i < TrayPositions.Count; i++)
- {
- _adsManager.WriteValue("GVL_SCADA.stMachine.stTray.arPosX[" + i + "]", TrayPositions[i].PosX);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stTray.arPosY[" + i + "]", TrayPositions[i].PosY);
- }
-
- var trayPosCountToPlc = TrayPositions.Count < maxTrayPositions ? TrayPositions.Count : maxTrayPositions;
- _adsManager.WriteValue("GVL_SCADA.stMachine.stTray.iPosCnt", trayPosCountToPlc);
-
- for (var i = 0; i < maxEtcherRobotPositions && i < EtcherRobotSteps.Count; i++)
- {
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rPosX", EtcherRobotSteps[i].PosX);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rPosY", EtcherRobotSteps[i].PosY);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rPosZ", EtcherRobotSteps[i].PosZ);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rAngleAlpha", EtcherRobotSteps[i].AngleAlpha);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rMoveSpeed", EtcherRobotSteps[i].MoveSpeed);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].rDelay", EtcherRobotSteps[i].Delay);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].uiMedium", EtcherRobotSteps[i].Medium);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].xWaterFromBelow", EtcherRobotSteps[i].WaterFromBelow);
- _adsManager.WriteValue("GVL_SCADA.stRecipeEtcher.stRobotStepData[" + i + "].xWaterFromAbove", EtcherRobotSteps[i].WaterFromAbove);
- }
-
-
- for (var i = 0; (i < maxFlowNodes && i < FlowReceipeEntries.Count); i++)
- {
-
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].Priority);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].Station.eStation);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].MaxRetries);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].NextNodeSuccess);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].NextNodeRetry);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.astNodes[" + i + "].uiPriority", FlowReceipeEntries[i].NextNodeFail);
-
- }
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterFlowRecipe.uiNodeCnt", FlowNodeCountVm.Value);
-
-
-
- _adsManager.WriteValue("GVL_SCADA.stMachine", CameraProgramsVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine", ChucksVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine", GripperVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine", PermissibleBeamParamDeviationsVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine", DiameterVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine", ThicknessVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine", TimeIntervallBeamCheckVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHotplate.rRestingTime", RestingTimeHotplateVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHotplate.rTemp", TargetTemperatureHotplateVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeCoolplate.rRestingTime", RestingTimeCoolplateVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeCoolplate.rTemp", TargetTemperatureCoolplateVm.Value);
-
- _adsManager.WriteValue("GVL_SCADA.stMachine.stRecipeEtcher.uiNumRobotPos", NumberRobotPositionsVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stRecipeEtcher.rRadialPosLowerWaterJet", RadialPosLowerWaterJetVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stRecipeEtcher.rChuckRPM", ChuckRpmVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestVoltage", HvtestVoltageVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rMaxTestCurrent", HvmaxTestCurrentVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rRampTime", HvrampTimeVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestFrequency", HvtestFrequencyVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.uiPolarity", HvpolarityVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestPresN2", HvtestPressureN2Vm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rN2PrePurgeTime", Hvn2PrePurgeTimeVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.uiNumRetries", HvnumRetriesVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestTemp", HvtestTemperatureVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestOkVoltage", HvTestOkVoltageVm.Value);
- _adsManager.WriteValue("GVL_SCADA.stMachine.stMasterRecipeHVTest.rTestOkCurrent", HvTestOkCurrentVm.Value);
-
- }
-
- public void Dispose()
- {
-
- }
-}
\ No newline at end of file
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/StringOverviewPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/StringOverviewPageVM.cs
deleted file mode 100644
index fec6971..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/StringOverviewPageVM.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using CommunityToolkit.Mvvm.Messaging;
-using Heisig.HMI.AdsManager;
-
-namespace UniperHMI;
-
-public sealed partial class StringOverviewPageVM : ObservableObject, IDisposable
-{
- [ObservableProperty]
- private ModuleControlButtonVM module1;
-
- [ObservableProperty]
- private ModuleControlButtonVM module2;
-
- [ObservableProperty]
- private ModuleControlButtonVM module3;
-
- private readonly IAdsManager? _adsManager;
- private readonly string? _variableName;
-
- public StringOverviewPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- module1 = new(_adsManager, _variableName + ".stHMIInterfaceModule1");
- module2 = new(_adsManager, _variableName + ".stHMIInterfaceModule2");
- module3 = new(_adsManager, _variableName + ".stHMIInterfaceModule3");
- }
-
- public void Dispose()
- {
- Module1?.Dispose();
- Module2?.Dispose();
- Module3?.Dispose();
- }
-
- [RelayCommand]
- private void Module1Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceModule1", typeof(ModuleOverviewPage), "Module 1"));
- }
-
- [RelayCommand]
- private void Module2Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceModule2", typeof(ModuleOverviewPage), "Module 2"));
- }
-
- [RelayCommand]
- private void Module3Clicked()
- {
- WeakReferenceMessenger.Default.Send(new NavigateMessage(_variableName + ".stHMIInterfaceModule3", typeof(ModuleOverviewPage), "Module 3"));
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/TrayFeederPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/TrayFeederPageVM.cs
deleted file mode 100644
index 181f4cc..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/TrayFeederPageVM.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using HMIToolkit;
-using System.ComponentModel.DataAnnotations;
-using Heisig.HMI.AdsManager;
-using CommunityToolkit.Mvvm.Input;
-using TwinCAT.TypeSystem;
-using System.Collections.ObjectModel;
-
-using InfineonHMI.Model;
-namespace InfineonHMI
-{
- public sealed partial class TrayFeederPageVM : ObservableValidator, IDisposable
- {
- private readonly string? _variableName;
-
- private readonly IAdsManager? _adsManager;
-
- public TrayFeederPageVM()
- {
-
- }
-
- public TrayFeederPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
-
- }
-
-
-
- public void Dispose()
- {
-
- }
-
-
-
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/ViewModels/UnitOverviewPageVM.cs b/uniper_hmi_old/UniperHMI/Pages/ViewModels/UnitOverviewPageVM.cs
deleted file mode 100644
index 06610da..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/ViewModels/UnitOverviewPageVM.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using Heisig.HMI.AdsManager;
-
-namespace UniperHMI;
-
-public sealed partial class UnitOverviewPageVM : ObservableObject, IDisposable
-{
- [ObservableProperty]
- private string unitName;
-
- [ObservableProperty]
- private UnitDetailsControlVM unitControlVM;
-
- private readonly IAdsManager? _adsManager;
- private readonly string? _variableName;
-
- public UnitOverviewPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- unitControlVM = new(_adsManager, _variableName);
-
- unitName = "Unit X";
- }
-
- public void Dispose()
- {
- UnitControlVM?.Dispose();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/AlignmentStationPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/AlignmentStationPage.xaml
deleted file mode 100644
index cbed7e2..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/AlignmentStationPage.xaml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/AlignmentStationPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/AlignmentStationPage.xaml.cs
deleted file mode 100644
index 7db7064..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/AlignmentStationPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class AlignmentStationPage : Page
- {
- public AlignmentStationPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/AutomaticModePage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/AutomaticModePage.xaml
deleted file mode 100644
index 9442731..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/AutomaticModePage.xaml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/AutomaticModePage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/AutomaticModePage.xaml.cs
deleted file mode 100644
index 193799a..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/AutomaticModePage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace UniperHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class AutomaticModePage : Page
- {
- public AutomaticModePage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/BatteryOverviewPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/BatteryOverviewPage.xaml
deleted file mode 100644
index 0ee7c55..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/BatteryOverviewPage.xaml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/BatteryOverviewPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/BatteryOverviewPage.xaml.cs
deleted file mode 100644
index 370e029..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/BatteryOverviewPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace UniperHMI
-{
- ///
- /// Interaktionslogik für ManualModePage.xaml
- ///
- public partial class BatteryOverviewPage : Page
- {
- public BatteryOverviewPage()
- {
- InitializeComponent();
- //Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ChuckMagazinPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/ChuckMagazinPage.xaml
deleted file mode 100644
index 413bf70..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ChuckMagazinPage.xaml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ChuckMagazinPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/ChuckMagazinPage.xaml.cs
deleted file mode 100644
index 96603c9..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ChuckMagazinPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace UniperHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class ChuckMagazinPage : Page
- {
- public ChuckMagazinPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation1Page.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation1Page.xaml
deleted file mode 100644
index 6367ae8..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation1Page.xaml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation1Page.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation1Page.xaml.cs
deleted file mode 100644
index 263adde..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation1Page.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class EtchingStation1Page : Page
- {
- public EtchingStation1Page()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation2Page.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation2Page.xaml
deleted file mode 100644
index 45335fe..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation2Page.xaml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation2Page.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation2Page.xaml.cs
deleted file mode 100644
index fa78f83..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStation2Page.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class EtchingStation2Page : Page
- {
- public EtchingStation2Page()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStationPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStationPage.xaml
deleted file mode 100644
index 03177ad..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStationPage.xaml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStationPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStationPage.xaml.cs
deleted file mode 100644
index 437d98f..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EtchingStationPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace UniperHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class EtchingStationPage : Page
- {
- public EtchingStationPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EventsPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/EventsPage.xaml
deleted file mode 100644
index e965015..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EventsPage.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/EventsPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/EventsPage.xaml.cs
deleted file mode 100644
index 0921b88..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/EventsPage.xaml.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI;
-
-///
-/// Interaktionslogik für EventsPage.xaml
-///
-public partial class EventsPage : Page
-{
- public EventsPage()
- {
- InitializeComponent();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/HighVoltageStationPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/HighVoltageStationPage.xaml
deleted file mode 100644
index ccea37e..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/HighVoltageStationPage.xaml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/HighVoltageStationPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/HighVoltageStationPage.xaml.cs
deleted file mode 100644
index ed135c0..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/HighVoltageStationPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class HighVoltageStationPage : Page
- {
- public HighVoltageStationPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/HotCoolPlatePage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/HotCoolPlatePage.xaml
deleted file mode 100644
index b03837d..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/HotCoolPlatePage.xaml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/HotCoolPlatePage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/HotCoolPlatePage.xaml.cs
deleted file mode 100644
index c5b335f..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/HotCoolPlatePage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class HotCoolPlatePage : Page
- {
- public HotCoolPlatePage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/KukaRobotPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/KukaRobotPage.xaml
deleted file mode 100644
index 3c6702f..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/KukaRobotPage.xaml
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
deleted file mode 100644
index c1785df..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class KukaRobotPage : Page
- {
- public KukaRobotPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/MachineOverviewPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/MachineOverviewPage.xaml
deleted file mode 100644
index 318316a..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/MachineOverviewPage.xaml
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs
deleted file mode 100644
index fa8f63c..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/MachineOverviewPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class MachineOverviewPage : Page
- {
- public MachineOverviewPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/MediaCabinetPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/MediaCabinetPage.xaml
deleted file mode 100644
index 574006c..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/MediaCabinetPage.xaml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
deleted file mode 100644
index d5853dd..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class MediaCabinetPage : Page
- {
- public MediaCabinetPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ModuleOverviewPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/ModuleOverviewPage.xaml
deleted file mode 100644
index f6d3f84..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ModuleOverviewPage.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/NIOStationPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/NIOStationPage.xaml
deleted file mode 100644
index 662da4b..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/NIOStationPage.xaml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/NIOStationPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
deleted file mode 100644
index 24b5fa1..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class NIOStationPage : Page
- {
- public NIOStationPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ProductionOverviewPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/ProductionOverviewPage.xaml
deleted file mode 100644
index f29a289..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ProductionOverviewPage.xaml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs
deleted file mode 100644
index 046c16d..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ProductionOverviewPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class ProductionOverviewPage : Page
- {
- public ProductionOverviewPage()
- {
- InitializeComponent();
- // Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ReceipePage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/ReceipePage.xaml
deleted file mode 100644
index 55ffdf5..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ReceipePage.xaml
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/ReceipePage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/ReceipePage.xaml.cs
deleted file mode 100644
index 875c4e2..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/ReceipePage.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI.Pages.Views
-{
- ///
- /// Receipes Overview Page
- ///
- public partial class ReceipePage : Page
- {
- public ReceipePage()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/StringOverviewPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/StringOverviewPage.xaml
deleted file mode 100644
index 76aeeaa..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/StringOverviewPage.xaml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/StringOverviewPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/StringOverviewPage.xaml.cs
deleted file mode 100644
index 379fc5a..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/StringOverviewPage.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Windows.Controls;
-
-namespace UniperHMI
-{
- ///
- /// Interaktionslogik für StringOverviewPage.xaml
- ///
- public partial class StringOverviewPage : Page
- {
- public StringOverviewPage()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/TrayFeederPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/TrayFeederPage.xaml
deleted file mode 100644
index 948a325..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/TrayFeederPage.xaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
deleted file mode 100644
index b3140f2..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für AutomaticModePage.xaml
- ///
- public partial class TrayFeederPage : Page
- {
- public TrayFeederPage()
- {
- InitializeComponent();
- }
-
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/UnitOverviewPage.xaml b/uniper_hmi_old/UniperHMI/Pages/Views/UnitOverviewPage.xaml
deleted file mode 100644
index 34886cf..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/UnitOverviewPage.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/Pages/Views/UnitOverviewPage.xaml.cs b/uniper_hmi_old/UniperHMI/Pages/Views/UnitOverviewPage.xaml.cs
deleted file mode 100644
index 8531080..0000000
--- a/uniper_hmi_old/UniperHMI/Pages/Views/UnitOverviewPage.xaml.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Windows.Controls;
-
-namespace UniperHMI;
-
-///
-/// Interaktionslogik für UnitOverviewPage.xaml
-///
-public partial class UnitOverviewPage : Page
-{
- public UnitOverviewPage()
- {
- InitializeComponent();
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPage.xaml b/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPage.xaml
deleted file mode 100644
index c9019d0..0000000
--- a/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPage.xaml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPage.xaml.cs b/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPage.xaml.cs
deleted file mode 100644
index 8ac180f..0000000
--- a/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows.Controls;
-
-namespace InfineonHMI
-{
- ///
- /// Interaktionslogik für SettingsPageView.xaml
- ///
- public partial class SettingsPage : Page
- {
- public SettingsPage()
- {
- InitializeComponent();
- Unloaded += OnUnloaded;
- }
-
- private void OnUnloaded(object? sender, EventArgs e)
- {
- var disposable = DataContext as IDisposable;
- disposable?.Dispose();
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPageVM.cs b/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPageVM.cs
deleted file mode 100644
index d8e5b68..0000000
--- a/uniper_hmi_old/UniperHMI/SettingsPage/SettingsPageVM.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using MahApps.Metro.Controls;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Windows;
-using TwinCAT.Ads.TypeSystem;
-using TwinCAT.TypeSystem;
-using Heisig.HMI.AdsManager;
-
-namespace InfineonHMI
-{
- public partial class SettingsEntry : ObservableObject
- {
- [ObservableProperty]
- private string name = "";
-
- [ObservableProperty]
- private string instancePath = "";
-
- [ObservableProperty]
- private string? dataType;
-
- [ObservableProperty]
- private Object? value;
-
- public ObservableCollection SubEntries { get; set; } = [];
-
- [ObservableProperty]
- private Visibility visibility = Visibility.Collapsed;
-
- private readonly IAdsManager _adsManager;
-
- public SettingsEntry(IAdsManager adsManager)
- {
- _adsManager = adsManager;
- }
-
- partial void OnValueChanging(object? oldValue, object? newValue)
- {
- if (newValue == null)
- {
- newValue = oldValue;
- return;
- }
-
-
- try
- {
- _adsManager.WriteValue(InstancePath, newValue);
- }
- catch (Exception)
- {
- newValue = oldValue;
- Debug.WriteLine("Value {0} could not be written to {1}", newValue, InstancePath);
- }
- }
- }
-
- public partial class SettingsPageVM : ObservableObject, IDisposable
- {
- public ObservableCollection RootItem { get; private set; } = [];
-
- private readonly IAdsManager _adsManager;
-
- private readonly string _variableName;
-
- public SettingsPageVM(IAdsManager adsManager, string variableName)
- {
- _adsManager = adsManager;
- _variableName = variableName;
-
- _adsManager.Register(_variableName, ConfigChangedEvent);
- }
-
- private void ConfigChangedEvent(object? sender, ValueChangedEventArgs e)
- {
- App.Current.Invoke(CreateSettingsTree);
- }
-
- private void CreateSettingsTree()
- {
- ISymbolLoader? symbolLoader = _adsManager.GetSymbolLoader();
-
- if (symbolLoader == null)
- return;
-
- Symbol configSymbol = (Symbol)symbolLoader.Symbols[_variableName];
- SettingsEntry entry = GetSymbol(configSymbol);
- RootItem.Add(entry);
- }
-
- private SettingsEntry GetSymbol(Symbol symbol)
- {
- // Create Symbol
- SettingsEntry entry = new(_adsManager)
- {
- Name = symbol.InstanceName,
- InstancePath = symbol.InstancePath,
- DataType = symbol.DataType?.Name
- };
-
- // Check if symbol has sub symbols
- if (!symbol.IsPrimitiveType)
- {
- foreach (Symbol subSymbol in symbol.SubSymbols.Cast())
- {
- entry.SubEntries.Add(GetSymbol(subSymbol));
- }
- }
- else
- {
- entry.Visibility = Visibility.Visible;
-
- entry.Value = symbol.ReadValue();
- }
-
- return entry;
- }
-
- public void Dispose()
- {
- _adsManager?.Deregister(_variableName, ConfigChangedEvent);
- }
- }
-}
diff --git a/uniper_hmi_old/UniperHMI/UniperHMI.csproj b/uniper_hmi_old/UniperHMI/UniperHMI.csproj
deleted file mode 100644
index 276ad45..0000000
--- a/uniper_hmi_old/UniperHMI/UniperHMI.csproj
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
- WinExe
- net8.0-windows8.0
- enable
- enable
- true
- 0.1.0
- 0.1
- AnyCPU;x64
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
- bin\x64\Debug\net8.0-windows8.0\AdsManager.dll
-
-
-
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
-
-
-
- PreserveNewest
-
-
-
-
diff --git a/uniper_hmi_old/UniperHMI/appsettings.json b/uniper_hmi_old/UniperHMI/appsettings.json
deleted file mode 100644
index e8160cb..0000000
--- a/uniper_hmi_old/UniperHMI/appsettings.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "AutomaticModeVarName": "GVL_SCADA.stAutomaticModeHMI",
- "String1VarName": "GVL_SCADA.stHMIInterface",
-
- "KukaRobotVarName": "GVL_SCADA.stMachine.stKukaRobot",
- "Module1VarName": ".stHMIInterfaceModule1",
- "Module2VarName": ".stHMIInterfaceModule2",
- "Module3VarName": ".stHMIInterfaceModule3"
-}
\ No newline at end of file