diff --git a/ads-wrapper/AdsManager.csproj b/ads-wrapper/AdsManager.csproj
index b03c255..c271c8e 100644
--- a/ads-wrapper/AdsManager.csproj
+++ b/ads-wrapper/AdsManager.csproj
@@ -4,15 +4,16 @@
net8.0
enable
enable
- True
+ False
Ads Manager
M.Heisig
Heisig GmbH
Wrapper für den Ads Client von Beckhoff um automatische reconnects und onlinechanges zu behandeln.
README.md
- C:\Users\matthias.heisig\Documents\nuget_packages
+ C:\Users\C.Bliestle\Documents\0010_Obducat\WPF_HMI_Infineon\packages
https://gitlab.cmblu.de/matthias.heisig/ads-wrapper
1.0.0.7
+ x64
diff --git a/ads-wrapper/AdsManager.sln b/ads-wrapper/AdsManager.sln
index de2b583..d0ff34c 100644
--- a/ads-wrapper/AdsManager.sln
+++ b/ads-wrapper/AdsManager.sln
@@ -1,20 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.8.34525.116
+# Visual Studio Version 18
+VisualStudioVersion = 18.2.11415.280 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsManager", "AdsManager.csproj", "{4B80F068-4E6D-4D2D-831B-8150970600C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4B80F068-4E6D-4D2D-831B-8150970600C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4B80F068-4E6D-4D2D-831B-8150970600C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4B80F068-4E6D-4D2D-831B-8150970600C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4B80F068-4E6D-4D2D-831B-8150970600C7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4B80F068-4E6D-4D2D-831B-8150970600C7}.Debug|x64.ActiveCfg = Debug|x64
+ {4B80F068-4E6D-4D2D-831B-8150970600C7}.Debug|x64.Build.0 = Debug|x64
+ {4B80F068-4E6D-4D2D-831B-8150970600C7}.Release|x64.ActiveCfg = Release|x64
+ {4B80F068-4E6D-4D2D-831B-8150970600C7}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/uniper_hmi/Uniper.sln b/uniper_hmi/Uniper.sln
index 90d9631..a2ac41a 100644
--- a/uniper_hmi/Uniper.sln
+++ b/uniper_hmi/Uniper.sln
@@ -1,20 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.8.34408.163
+# Visual Studio Version 18
+VisualStudioVersion = 18.2.11415.280 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UniperHMI", "UniperHMI\UniperHMI.csproj", "{8D725B27-1242-4C66-ACD8-45F02098C7D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8D725B27-1242-4C66-ACD8-45F02098C7D3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {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
diff --git a/uniper_hmi/UniperHMI/3rdParty/AdsManager.dll b/uniper_hmi/UniperHMI/3rdParty/AdsManager.dll
new file mode 100644
index 0000000..35826ee
Binary files /dev/null and b/uniper_hmi/UniperHMI/3rdParty/AdsManager.dll differ
diff --git a/uniper_hmi/UniperHMI/MainWindow.xaml b/uniper_hmi/UniperHMI/MainWindow.xaml
index e8d2872..e2e4dc8 100644
--- a/uniper_hmi/UniperHMI/MainWindow.xaml
+++ b/uniper_hmi/UniperHMI/MainWindow.xaml
@@ -9,7 +9,7 @@
x:Name="MainControlWindow"
d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"
WindowStartupLocation="CenterScreen"
- Title="Uniper HMI" Height="800" Width="1024" ResizeMode="NoResize">
+ Title="Uniper HMI" Height="1030" Width="1900" ResizeMode="NoResize">
@@ -45,41 +45,53 @@
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/MainWindowVM.cs b/uniper_hmi/UniperHMI/MainWindowVM.cs
index a17210b..b2bad13 100644
--- a/uniper_hmi/UniperHMI/MainWindowVM.cs
+++ b/uniper_hmi/UniperHMI/MainWindowVM.cs
@@ -53,6 +53,9 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient 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 AlignmentStationPageVM()
+ {
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ SelectedControlMode = ReqBMSControlModes[1];
+ canChangeControlMode = true;
+ }
+
+ public AlignmentStationPageVM(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/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs
index 7e0a27d..eac5614 100644
--- a/uniper_hmi/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/AutomaticModePageVM.cs
@@ -5,29 +5,12 @@ using Heisig.HMI.AdsManager;
using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
+using UniperHMI.Model;
namespace UniperHMI
{
- 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 sealed partial class AutomaticModePageVM : ObservableValidator, IDisposable
{
@@ -85,7 +68,7 @@ namespace UniperHMI
_adsManager = adsManager;
_variableName = variableName;
- //StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartAutoButton");
+ StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartAutoButton");
//StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopAutoButton");
SelectedControlMode = ReqBMSControlModes[1];
diff --git a/uniper_hmi/UniperHMI/Pages/ViewModels/ChuckMagazinPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/ChuckMagazinPageVM.cs
new file mode 100644
index 0000000..72b5595
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/ChuckMagazinPageVM.cs
@@ -0,0 +1,120 @@
+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 ChuckMagazinPageVM : 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 ChuckMagazinPageVM()
+ {
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ SelectedControlMode = ReqBMSControlModes[1];
+ canChangeControlMode = true;
+ }
+
+ public ChuckMagazinPageVM(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/UniperHMI/Pages/ViewModels/EtchingStationPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/EtchingStationPageVM.cs
new file mode 100644
index 0000000..4697af1
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/EtchingStationPageVM.cs
@@ -0,0 +1,123 @@
+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/UniperHMI/Pages/ViewModels/EventsPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/EventsPageVM.cs
index 22a2326..e47706d 100644
--- a/uniper_hmi/UniperHMI/Pages/ViewModels/EventsPageVM.cs
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/EventsPageVM.cs
@@ -45,7 +45,12 @@ namespace UniperHMI
_logger.AlarmCleared += SimpleAlarmClearedEvent;
_logger.AlarmConfirmed += SimpleConfirmedAlarmEvent;
+#if DEBUG
+
+#else
+
_logger.Connect("10.103.32.50.1.1");
+#endif
GetAllActiveEvents();
}
diff --git a/uniper_hmi/UniperHMI/Pages/ViewModels/HighVoltageStationPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/HighVoltageStationPageVM.cs
new file mode 100644
index 0000000..80600c8
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/HighVoltageStationPageVM.cs
@@ -0,0 +1,121 @@
+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 HighVoltageStationPageVM : 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 HighVoltageStationPageVM()
+ {
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ SelectedControlMode = ReqBMSControlModes[1];
+ canChangeControlMode = true;
+ }
+
+ public HighVoltageStationPageVM(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/UniperHMI/Pages/ViewModels/HotCoolPlatePageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/HotCoolPlatePageVM.cs
new file mode 100644
index 0000000..7e7542d
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/HotCoolPlatePageVM.cs
@@ -0,0 +1,374 @@
+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;
+using System.Windows;
+namespace UniperHMI
+{
+ public sealed partial class HotCoolPlatePageVM : ObservableValidator, IDisposable
+ {
+
+ private const string sPieceOnHotplate1 = "_adsVariable_hotPlatePiece1";
+ private const string sPieceOnHotplate2 = "_adsVariable_hotPlatePiece2";
+ private const string sPieceOnHotplate3 = "_adsVariable_hotPlatePiece3";
+ private const string sPieceOnHotplate4 = "_adsVariable_hotPlatePiece4";
+ private const string sPieceOnHotplate5 = "_adsVariable_hotPlatePiece5";
+ private const string sPieceOnHotplate6 = "_adsVariable_hotPlatePiece6";
+ private const string sPieceOnHotplate7 = "_adsVariable_hotPlatePiece7";
+ private const string sPieceOnHotplate8 = "_adsVariable_hotPlatePiece8";
+ private const string sPieceOnHotplate9 = "_adsVariable_hotPlatePiece9";
+ private const string sHotplateTargetTemp = "_adsVariable_hotPlateTargetTemp";
+ private const string sHotplateActualTemp = "_adsVariable_hotPlateActualTemp";
+
+ private const string sPieceOnCoolplate1 = "_adsVariable_CoolPlatePiece1";
+ private const string sPieceOnCoolplate2 = "_adsVariable_CoolPlatePiece2";
+ private const string sPieceOnCoolplate3 = "_adsVariable_CoolPlatePiece3";
+ private const string sPieceOnCoolplate4 = "_adsVariable_CoolPlatePiece4";
+ private const string sPieceOnCoolplate5 = "_adsVariable_CoolPlatePiece5";
+ private const string sPieceOnCoolplate6 = "_adsVariable_CoolPlatePiece6";
+ private const string sPieceOnCoolplate7 = "_adsVariable_CoolPlatePiece7";
+ private const string sPieceOnCoolplate8 = "_adsVariable_CoolPlatePiece8";
+ private const string sPieceOnCoolplate9 = "_adsVariable_CoolPlatePiece9";
+ private const string sCoolplateTargetTemp = "_adsVariable_coolPlateTargetTemp";
+ private const string sCoolplateActualTemp = "_adsVariable_coolPlateActualTemp";
+
+ private readonly IAdsManager? _adsManager;
+
+ [ObservableProperty]
+ private double hotPlateTargetTemperature;
+
+ [ObservableProperty]
+ private double hotPlateActualTemperature;
+
+ [ObservableProperty]
+ private double coolPlateTargetTemperature;
+
+ [ObservableProperty]
+ private double coolPlateActualTemperature;
+
+ [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(IAdsManager adsManager, string variableName)
+ {
+ _adsManager = adsManager;
+
+ _adsManager.Register(sHotplateActualTemp, HotplateTempChanged);
+ _adsManager.Register(sCoolplateActualTemp, CoolplateTempChanged);
+
+ _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 HotplateTempChanged(object? sender, ValueChangedEventArgs e)
+ {
+ HotPlateActualTemperature = (double)e.Value;
+ }
+ private void CoolplateTempChanged(object? sender, ValueChangedEventArgs e)
+ {
+ HotPlateActualTemperature = (double)e.Value;
+ }
+ 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()
+ {
+ _adsManager?.Register(sHotplateActualTemp, HotplateTempChanged);
+ _adsManager?.Register(sCoolplateActualTemp, CoolplateTempChanged);
+ _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);
+
+ }
+ }
+}
diff --git a/uniper_hmi/UniperHMI/Pages/ViewModels/KukaRobotPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/KukaRobotPageVM.cs
new file mode 100644
index 0000000..ef29151
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/KukaRobotPageVM.cs
@@ -0,0 +1,482 @@
+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 UniperHMI.Model;
+using System.Printing;
+
+namespace UniperHMI
+{
+ 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 = "_adsVariable_kukaCoolplateIndex";
+ private const string sHotplateIndex = "_adsVariable_kukaHotPlateIndex";
+ private const string sPieceThickness = "_adsVariable_kukaPieceThickness";
+ private const string sJobGrippSide = "_adsVariable_kukaJobGrippSide";
+ private const string sJobGrippType = "_adsVariable_kukaJobGrippType";
+ private const string sChuckMagazinPlace = "_adsVariable_kukaChuckMagazinPlace";
+ private const string sSelectedRobotJob = "_adsVariable_kukaRobotJob";
+ private const string sOffsetPick_X = "_adsVariable_kukaOffsetPick_X";
+ private const string sOffsetPick_Y = "_adsVariable_kukaOffsetPick_Y";
+ private const string sOffsetPlace_X = "_adsVariable_kukaOffsetPlace_X";
+ private const string sOffsetPlace_Y = "_adsVariable_kukaOffsetPlace_Y";
+ private const string sOffsetNIOPick_X = "_adsVariable_kukaOffsetNIOPick_X";
+ private const string sOffsetNIOPick_Y = "_adsVariable_kukaOffsetNIOPick_Y";
+ private const string sOffsetNIOPlace_X = "_adsVariable_kukaOffsetNIOPlace_X";
+ private const string sOffsetNIOPlace_Y = "_adsVariable_kukaOffsetNIOPlace_Y";
+
+
+ private BMSControlModeEntry currentControlMode;
+ public BMSControlModeEntry CurrentControlMode
+ {
+ get { return currentControlMode; }
+ set
+ {
+ currentControlMode = value;
+ ccmChanged();
+ }
+ }
+ private E_BMS_CONTROL_MODE bmsControlMode;
+
+ [ObservableProperty]
+ public bool canChangeRobotJob;
+
+ [ObservableProperty]
+ public RobotJobentry robotJobActiveValue;
+
+ [ObservableProperty]
+ public RobotJobentry robotJobFinishedValue;
+
+ [ObservableProperty]
+ public bool canStartRobotJob;
+
+ [ObservableProperty]
+ public HMIControlButtonVM? startButton;
+
+ [ObservableProperty]
+ public bool canAbortRobotJob;
+
+ [ObservableProperty]
+ public HMIControlButtonVM? abortButton;
+
+
+ private int jobGrippSide;
+ public int JobGrippSide
+ {
+ get { return jobGrippSide; }
+ set
+ {
+ jobGrippSide = value;
+ _adsManager?.WriteValue(sJobGrippSide, value);
+ }
+ }
+
+ [ObservableProperty]
+ public bool canChangeJobGrippSide;
+
+
+ private int jobGrippType;
+ public int JobGrippType
+ {
+ get { return jobGrippType; }
+ set
+ {
+ jobGrippType = value;
+ _adsManager?.WriteValue(sJobGrippType, value);
+
+ }
+ }
+
+ [ObservableProperty]
+ public bool canChangeJobGrippType;
+
+
+ private int chuckMagazinPlace;
+ public int ChuckMagazinPlace
+ {
+ get { return chuckMagazinPlace; }
+ set
+ {
+ chuckMagazinPlace = value;
+ _adsManager?.WriteValue(sChuckMagazinPlace, value);
+ }
+ }
+
+ [ObservableProperty]
+ public bool canChangeChuckMagazinPlace;
+
+
+ private double pieceThickness;
+ public double PieceThickness
+ {
+ get { return pieceThickness; }
+ set
+ {
+ pieceThickness = value;
+ _adsManager?.WriteValue(sPieceThickness, value);
+ }
+ }
+
+ [ObservableProperty]
+ public bool canChangePieceThickness;
+
+
+ private double offsetPick_X;
+ public double OffsetPick_X
+ {
+ get { return offsetPick_X; }
+ set
+ {
+ offsetPick_X = value;
+ _adsManager?.WriteValue(sOffsetPick_X, value);
+ }
+ }
+
+
+ private double offsetPick_Y;
+ public double OffsetPick_Y
+ {
+ get { return offsetPick_Y; }
+ set
+ {
+ offsetPick_Y = value;
+ _adsManager?.WriteValue(sOffsetPick_Y, value);
+ }
+ }
+ [ObservableProperty]
+ public bool canChangeOffsetPick;
+
+
+ private double offsetPlace_X;
+ public double OffsetPlace_X
+ {
+ get { return offsetPlace_X; }
+ set
+ {
+ offsetPlace_X = value;
+ _adsManager?.WriteValue(sOffsetPlace_X, value);
+ }
+ }
+
+ private double offsetPlace_Y;
+ public double OffsetPlace_Y
+ {
+ get { return offsetPlace_Y; }
+ set
+ {
+ offsetPlace_Y = value;
+ _adsManager?.WriteValue(sOffsetPlace_Y, value);
+ }
+ }
+
+
+ [ObservableProperty]
+ public bool canChangeOffsetPlace;
+
+
+ private double offsetNIOPick_X;
+ public double OffsetNIOPick_X
+ {
+ get { return offsetNIOPick_X; }
+ set
+ {
+ offsetNIOPick_X = value;
+ _adsManager?.WriteValue(sOffsetNIOPick_X, value);
+ }
+ }
+
+ private double offsetNIOPick_Y;
+ public double OffsetNIOPick_Y
+ {
+ get { return offsetNIOPick_Y; }
+ set
+ {
+ offsetNIOPick_Y = value;
+ _adsManager?.WriteValue(sOffsetNIOPick_Y, value);
+ }
+ }
+ [ObservableProperty]
+ public bool canChangeOffsetNIOPick;
+
+
+ private double offsetNIOPlace_X;
+ public double OffsetNIOPlace_X
+ {
+ get { return offsetNIOPlace_X; }
+ set
+ {
+ offsetNIOPlace_X = value;
+ _adsManager?.WriteValue(sOffsetNIOPlace_X, value);
+ }
+ }
+
+ private double offsetNIOPlace_Y;
+ public double OffsetNIOPlace_Y
+ {
+ get { return offsetNIOPlace_Y; }
+ set
+ {
+ offsetNIOPlace_Y = value;
+ _adsManager?.WriteValue(sOffsetNIOPlace_Y, value);
+ }
+ }
+ [ObservableProperty]
+ public bool canChangeOffsetNIOPlace;
+
+
+ private int hotplateIndex;
+ public int HotplateIndex
+ {
+ get { return hotplateIndex; }
+ set
+ {
+ hotplateIndex = value;
+ _adsManager?.WriteValue(sHotplateIndex, value);
+ }
+
+
+ }
+ [ObservableProperty]
+ public bool canChangeHotPlateIndex;
+
+
+ private int coolplateIndex;
+ public int CoolplateIndex
+ {
+ get { return coolplateIndex; }
+ set
+ {
+ coolplateIndex = value;
+ _adsManager?.WriteValue(sCoolplateIndex, value);
+ }
+ }
+
+
+ [ObservableProperty]
+ public bool canChangeCoolPlateIndex;
+
+ [ObservableProperty]
+ private RobotJobenum robotJob;
+
+ [ObservableProperty]
+ public 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]
+ public 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
+ {
+ 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);
+
+ canChangeRobotJob = true;
+ selectedPLCJob = PLCJobs.First(i => i.eJob == PLCJobenum.NONE);
+ 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.WARMUP);
+ canChangeRobotJob = true;
+ selectedPLCJob = PLCJobs.First(i => i.eJob == PLCJobenum.NONE);
+
+ jobGrippSide = 1;
+ jobGrippType = 2;
+ canChangeJobGrippType = false;
+ robotJobActiveValue = RobotJobs.First(i => i.eJob == RobotJobenum.PUT_HVTEST_COLD);
+ robotJobFinishedValue = RobotJobs.First(i => i.eJob == RobotJobenum.PICK_HOTPLATE);
+
+ chuckMagazinPlace = 2;
+ canChangeChuckMagazinPlace = false;
+ canChangeJobGrippType = false;
+
+
+
+ pieceThickness = 2.7;
+
+ offsetPlace_X = 88;
+ offsetPlace_Y = 79;
+
+ offsetPick_X = 89;
+ offsetPick_Y = 81;
+
+ offsetNIOPick_X = 176;
+ offsetNIOPick_Y = 90;
+
+ offsetNIOPlace_X = 123;
+ offsetNIOPlace_Y = 313;
+
+ hotplateIndex = 3;
+ coolplateIndex = 5;
+
+ //_adsManager.Register("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
+
+ //_adsManager.Register(_variableName + ".diSetpointAutomatic", SetpointChanged);
+ }
+
+ public void Dispose()
+ {
+ StartButton?.Dispose();
+ StartButton = null;
+ AbortButton?.Dispose();
+ AbortButton = null;
+
+ _adsManager?.Deregister("GVL_SCADA.eCurrentControlMode", CurrentControlModeChanged);
+
+ //_adsManager?.Deregister(_variableName + ".diSetpointAutomatic", SetpointChanged);
+ }
+
+ 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/UniperHMI/Pages/ViewModels/MediaCabinetPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/MediaCabinetPageVM.cs
new file mode 100644
index 0000000..275ce61
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/MediaCabinetPageVM.cs
@@ -0,0 +1,121 @@
+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 MediaCabinetPageVM : 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 MediaCabinetPageVM()
+ {
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ SelectedControlMode = ReqBMSControlModes[1];
+ canChangeControlMode = true;
+ }
+
+ public MediaCabinetPageVM(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/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs
new file mode 100644
index 0000000..5cf5747
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs
@@ -0,0 +1,121 @@
+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 NIOStationPageVM : 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 NIOStationPageVM()
+ {
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ SelectedControlMode = ReqBMSControlModes[1];
+ canChangeControlMode = true;
+ }
+
+ public NIOStationPageVM(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/UniperHMI/Pages/ViewModels/TrayFeederPageVM.cs b/uniper_hmi/UniperHMI/Pages/ViewModels/TrayFeederPageVM.cs
new file mode 100644
index 0000000..6fd7cce
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/ViewModels/TrayFeederPageVM.cs
@@ -0,0 +1,121 @@
+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 TrayFeederPageVM : 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 TrayFeederPageVM()
+ {
+ StartButton = new HMIControlButtonVM();
+ StopButton = new HMIControlButtonVM();
+ SelectedControlMode = ReqBMSControlModes[1];
+ canChangeControlMode = true;
+ }
+
+ public TrayFeederPageVM(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/UniperHMI/Pages/Views/AlignmentStationPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/AlignmentStationPage.xaml
new file mode 100644
index 0000000..0105ef6
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/AlignmentStationPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/AlignmentStationPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/AlignmentStationPage.xaml.cs
new file mode 100644
index 0000000..27f79dd
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/AlignmentStationPage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// 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/UniperHMI/Pages/Views/AutomaticModePage.xaml b/uniper_hmi/UniperHMI/Pages/Views/AutomaticModePage.xaml
index 2903f90..9442731 100644
--- a/uniper_hmi/UniperHMI/Pages/Views/AutomaticModePage.xaml
+++ b/uniper_hmi/UniperHMI/Pages/Views/AutomaticModePage.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:UniperHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
- d:DesignHeight="450" d:DesignWidth="800"
+ d:DesignHeight="800" d:DesignWidth="1850"
Title="AutomaticModePage">
diff --git a/uniper_hmi/UniperHMI/Pages/Views/ChuckMagazinPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/ChuckMagazinPage.xaml
new file mode 100644
index 0000000..ce1bf77
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/ChuckMagazinPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/ChuckMagazinPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/ChuckMagazinPage.xaml.cs
new file mode 100644
index 0000000..96603c9
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/ChuckMagazinPage.xaml.cs
@@ -0,0 +1,22 @@
+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/UniperHMI/Pages/Views/EtchingStationPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/EtchingStationPage.xaml
new file mode 100644
index 0000000..03177ad
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/EtchingStationPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/EtchingStationPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/EtchingStationPage.xaml.cs
new file mode 100644
index 0000000..437d98f
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/EtchingStationPage.xaml.cs
@@ -0,0 +1,22 @@
+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/UniperHMI/Pages/Views/HighVoltageStationPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/HighVoltageStationPage.xaml
new file mode 100644
index 0000000..a92b05c
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/HighVoltageStationPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/HighVoltageStationPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/HighVoltageStationPage.xaml.cs
new file mode 100644
index 0000000..9e175c0
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/HighVoltageStationPage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// 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/UniperHMI/Pages/Views/HotCoolPlatePage.xaml b/uniper_hmi/UniperHMI/Pages/Views/HotCoolPlatePage.xaml
new file mode 100644
index 0000000..d247c1f
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/HotCoolPlatePage.xaml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/HotCoolPlatePage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/HotCoolPlatePage.xaml.cs
new file mode 100644
index 0000000..f66a43b
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/HotCoolPlatePage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// 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/UniperHMI/Pages/Views/KukaRobotPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml
new file mode 100644
index 0000000..139ddc3
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
new file mode 100644
index 0000000..05e6043
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/KukaRobotPage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// 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/UniperHMI/Pages/Views/MediaCabinetPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml
new file mode 100644
index 0000000..28a2e4d
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
new file mode 100644
index 0000000..2cef51a
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/MediaCabinetPage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// 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/UniperHMI/Pages/Views/NIOStationPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml
new file mode 100644
index 0000000..4567885
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
new file mode 100644
index 0000000..d100af7
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/NIOStationPage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// 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/UniperHMI/Pages/Views/TrayFeederPage.xaml b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml
new file mode 100644
index 0000000..feb0f47
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
new file mode 100644
index 0000000..f245cb9
--- /dev/null
+++ b/uniper_hmi/UniperHMI/Pages/Views/TrayFeederPage.xaml.cs
@@ -0,0 +1,22 @@
+using System.Windows.Controls;
+
+namespace UniperHMI
+{
+ ///
+ /// Interaktionslogik für AutomaticModePage.xaml
+ ///
+ public partial class TrayFeederPage : Page
+ {
+ public TrayFeederPage()
+ {
+ InitializeComponent();
+ // Unloaded += OnUnloaded;
+ }
+
+ private void OnUnloaded(object? sender, EventArgs e)
+ {
+ var disposable = DataContext as IDisposable;
+ disposable?.Dispose();
+ }
+ }
+}
diff --git a/uniper_hmi/UniperHMI/UniperHMI.csproj b/uniper_hmi/UniperHMI/UniperHMI.csproj
index e6af748..276ad45 100644
--- a/uniper_hmi/UniperHMI/UniperHMI.csproj
+++ b/uniper_hmi/UniperHMI/UniperHMI.csproj
@@ -2,16 +2,17 @@
WinExe
- net8.0-windows
+ net8.0-windows8.0
enable
enable
true
0.1.0
0.1
+ AnyCPU;x64
+ False
-
@@ -20,6 +21,12 @@
+
+
+ bin\x64\Debug\net8.0-windows8.0\AdsManager.dll
+
+
+
Code