Push Alpha Version

This commit is contained in:
2026-02-27 16:09:59 +01:00
parent a0ef457995
commit d2665d17fa
209 changed files with 13423 additions and 1034 deletions

View File

@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.2.11415.280 d18.0
VisualStudioVersion = 18.2.11415.280
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UniperHMI", "UniperHMI\UniperHMI.csproj", "{8D725B27-1242-4C66-ACD8-45F02098C7D3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InfineonHMI", "UniperHMI\InfineonHMI.csproj", "{8D725B27-1242-4C66-ACD8-45F02098C7D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View File

@@ -1,7 +1,7 @@
<Application x:Class="UniperHMI.App"
<Application x:Class="InfineonHMI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UniperHMI">
xmlns:local="clr-namespace:InfineonHMI">
<Application.Resources>
<!-- MahApps Metro style themes -->
<ResourceDictionary>

View File

@@ -4,7 +4,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using TcEventLoggerAdsProxyLib;
namespace UniperHMI;
namespace InfineonHMI;
public partial class App : Application
{
@@ -18,10 +18,6 @@ public partial class App : Application
services.AddSingleton<MainWindow>();
services.AddSingleton<MainWindowVM>();
services.AddSingleton<IAdsManager, AdsManager>();
services.AddTransient<AutomaticModePageVM>();
services.AddTransient<BatteryOverviewPageVM>();
services.AddTransient<StringOverviewPageVM>();
services.AddTransient<ModuleOverviewPageVM>();
services.AddSingleton<TcEventLogger>();
})
.Build();

View File

@@ -0,0 +1,127 @@
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
{
/// <summary>
/// Serializes an object.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="serializableObject"></param>
/// <param name="fileName"></param>
/// <param name="encrypt"></param>
/// <param name="rootElementName"></param>
public static void SerializeObject<T>(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);
}
}
/// <summary>
/// Deserializes an xml file into an object list
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="fileName"></param>
/// <param name="decrypt"></param>
/// <param name="rootElementName"></param>
/// <returns></returns>
///
///
public static T DeSerializeObject<T>(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;
}
}
}

View File

@@ -0,0 +1,83 @@
<UserControl x:Class="Common.MediaContainer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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: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">
<UserControl.Resources>
<HMIToolkit:FeedbackToColorConverter x:Key="feedbackConverter" />
</UserControl.Resources>
<!-- :DataContext="{d:DesignInstance Type=local:AnalogValueVM, IsDesignTimeCreatable=True}" -->
<!-- Style to see things in the designer-->
<d:DesignerProperties.DesignStyle>
<Style TargetType="UserControl">
<!-- Property="Background" Value="White" /> -->
<Setter Property="Height" Value="300" />
<Setter Property="Width" Value="100" />
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
<RowDefinition Height="30*"/>
<RowDefinition Height="30*"/>
<RowDefinition Height="30*"/>
</Grid.RowDefinitions>
<Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="White" BorderThickness="2"/>
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{Binding SName, Mode=OneWay }" HorizontalAlignment="Center" FontSize="24"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="1" />
<Border Grid.Row="1" BorderBrush="White" BorderThickness="1" />
<Label Grid.Row="0" VerticalAlignment="Center" Content="Übervoll" HorizontalAlignment="Center" FontSize="16"/>
<RadioButton Margin="5" Grid.Row="1" IsChecked="{Binding Overload}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Column="0" Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="1" />
<Border Grid.Row="1" BorderBrush="White" BorderThickness="1" />
<Label Grid.Row="0" VerticalAlignment="Center" Content="Voll" HorizontalAlignment="Center" FontSize="16"/>
<RadioButton Grid.Row="1" Margin="5" IsChecked="{Binding Full}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="1" />
<Border Grid.Row="1" BorderBrush="White" BorderThickness="1" />
<Label Grid.Row="0" VerticalAlignment="Center" Content="Leer" HorizontalAlignment="Center" FontSize="16"/>
<RadioButton Grid.Row="1" Margin="5" IsChecked="{Binding Empty}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Border Grid.Column="1" Grid.Row="1" Grid.RowSpan="3" BorderBrush="White" BorderThickness="1"></Border>
<Grid Grid.Column="1" Grid.Row="1" Grid.RowSpan="3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button x:Name="btnFill" DataContext="{Binding FillButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="0" Grid.Column="0" Content="Füllen" Margin="5" />
<Button x:Name="btnOpen" DataContext="{Binding EmptyButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="1" Grid.Column="0" Content="Leeren" Margin="5" />
</Grid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Input;
namespace Common
{
/// <summary>
/// Interaktionslogik für AnalogValue.xaml
/// </summary>
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);
}
}
}

View File

@@ -0,0 +1,76 @@
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);
}
}

View File

@@ -0,0 +1,33 @@
<UserControl x:Class="Common.ParamControlFloat"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=local:ParamControlFloatVm, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
Width="Auto"
Height="Auto">
<!-- :DataContext="{d:DesignInstance Type=local:AnalogValueVM, IsDesignTimeCreatable=True}" -->
<!-- Style to see things in the designer-->
<d:DesignerProperties.DesignStyle>
<Style TargetType="UserControl">
<!-- Property="Background" Value="White" /> -->
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="280" />
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<!-- <ColumnDefinition Width="Auto" /> -->
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<Label x:Name="tbName" Grid.Column="0" Content="{Binding SName, Mode=OneWay }" Width="200"/>
<TextBox x:Name="tbValue" Text="{Binding Value, Mode=TwoWay, StringFormat=N2}" Grid.Column="1" MaxLines="1" Width="80" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsReadOnly="{Binding Readonly}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Input;
namespace Common
{
/// <summary>
/// Interaktionslogik für AnalogValue.xaml
/// </summary>
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);
}
}
}

View File

@@ -0,0 +1,27 @@
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()
{
}
}

View File

@@ -0,0 +1,33 @@
<UserControl x:Class="Common.ParamControlInt"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:common="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=common:ParamControlIntVm, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
Width="Auto"
Height="Auto">
<!-- :DataContext="{d:DesignInstance Type=local:AnalogValueVM, IsDesignTimeCreatable=True}" -->
<!-- Style to see things in the designer-->
<d:DesignerProperties.DesignStyle>
<Style TargetType="UserControl">
<!-- Property="Background" Value="White" /> -->
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="280" />
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<!-- <ColumnDefinition Width="Auto" /> -->
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<Label x:Name="tbName" Grid.Column="0" Content="{Binding SName, Mode=OneWay }" Width="200"/>
<TextBox x:Name="tbValue" Text="{Binding Value, Mode=TwoWay}" Grid.Column="1" MaxLines="1" Width="80" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsReadOnly="{Binding Readonly}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Input;
namespace Common
{
/// <summary>
/// Interaktionslogik für AnalogValue.xaml
/// </summary>
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);
}
}
}

View File

@@ -0,0 +1,28 @@
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()
{
}
}

View File

@@ -2,7 +2,7 @@
using System.Windows;
using System.Windows.Data;
namespace UniperHMI
namespace InfineonHMI
{
public class DateTimeToEventTimeConverter : IValueConverter
{

View File

@@ -1,9 +1,9 @@
<Window xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="UniperHMI.BinaryValveWindow"
<Window xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="InfineonHMI.BinaryValveWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:HMIToolkit"
mc:Ignorable="d"
Title="BinaryValveWindow" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
<Grid>

View File

@@ -1,6 +1,6 @@
using System.Windows;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für BinaryValveWindow.xaml

View File

@@ -26,8 +26,8 @@
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<TextBox x:Name="tbValue" Text="{Binding RValue, Mode=TwoWay, StringFormat=N2}" Grid.Column="0" MaxLines="1" Width="125" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsReadOnly="{Binding Readonly}" />
<Label Grid.Column="1" Content="{Binding SUnit}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox x:Name="tbValue" Text="{Binding RValue, Mode=TwoWay, StringFormat=N2}" Grid.Column="0" MaxLines="1" FontSize="40" Width="150" HorizontalContentAlignment="Center" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left" IsReadOnly="{Binding Readonly}" />
<Label Grid.Column="1" Content="{Binding SUnit}" VerticalAlignment="Center" FontSize="35" HorizontalAlignment="Left"/>
</Grid>
</UserControl>

View File

@@ -8,6 +8,7 @@
mc:Ignorable="d"
Height="Auto"
Width="Auto">
<UserControl.Resources>
<local:FeedbackToColorConverter x:Key="feedbackConverter" />
</UserControl.Resources>
@@ -20,19 +21,20 @@
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Margin="5" ShowGridLines="True">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="55" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Row 0 -->
<Label Grid.Row="0" Content="{Binding SName}" HorizontalAlignment="Center" FontSize="24" FontWeight="Bold"/>
<Label Grid.Row="0" Content="{Binding SName}" HorizontalAlignment="Center" FontSize="35" FontWeight="Bold"/>
<!-- Row 1 -->
<Label Grid.Row="1" Content="Interlocks:" Margin="0,0,0,-3"/>
<Label Grid.Row="1" Content="Interlocks:" FontSize="30"/>
<!-- Row 2 -->
<Grid Grid.Row="2">
@@ -49,9 +51,9 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Control:" Margin="0,0,0,-3" />
<Button x:Name="btnOpen" DataContext="{Binding OpenButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="1" Grid.Column="0" Content="Open" Height="80" Width="80" Margin="0,0,5,5" />
<Button x:Name="btnClose" DataContext="{Binding CloseButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="1" Grid.Column="1" Content="Close" Height="80" Width="80" Margin="0,-5,0,0"/>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="30" Content="Control:"/>
<Button x:Name="btnOpen" DataContext="{Binding OpenButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="1" Grid.Column="0" Content="Open" FontSize="40" Height="100" Width="180" Margin="0,0,5,5" />
<Button x:Name="btnClose" DataContext="{Binding CloseButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="1" Grid.Column="1" Content="Close" FontSize="40" Height="100" Width="180" Margin="0,-5,0,0"/>
</Grid>
<!-- Row 4 -->
@@ -65,9 +67,9 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Mode:" Margin="0,0,0,-3" />
<Button x:Name="btnAuto" DataContext="{Binding AutomaticButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Grid.Row="1" Grid.Column="0" Content="Auto" Height="80" Width="80" Margin="0,0,5,0"/>
<Button x:Name="btnManual" DataContext="{Binding ManualButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Grid.Row="1" Grid.Column="1" Content="Man" Height="80" Width="80" Margin="0,-5,0,-5"/>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="30" Content="Mode:" />
<Button x:Name="btnAuto" DataContext="{Binding AutomaticButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Grid.Row="1" Grid.Column="0" Content="Auto" FontSize="35" Height="100" Width="180" Margin="0,0,5,0"/>
<Button x:Name="btnManual" DataContext="{Binding ManualButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Grid.Row="1" Grid.Column="1" Content="Man" FontSize="35" Height="100" Width="180" Margin="0,-5,0,-5"/>
</Grid>
</Grid>

View File

@@ -16,13 +16,13 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Padding="0" Command="{Binding ShowProcessIntlksCommand}">
<Button Grid.Column="0" FontSize="35" Height="80" Width="180" Padding="0" Command="{Binding ShowProcessIntlksCommand}">
<StackPanel Orientation="Horizontal">
<Label>Process</Label>
<Rectangle Width="10" Height="10" Fill="{Binding Path=XProcessIntlkOk, Converter={StaticResource myBoolConverter}}" RadiusX="2" RadiusY="2" Margin="0,2,0,0"/>
</StackPanel>
</Button>
<Button Grid.Column="1" Padding="0" Margin="5,0,0,0" Command="{Binding ShowSafetyIntlksCommand}">
<Button Grid.Column="1" Padding="0" FontSize="35" Height="80" Width="180" Margin="5,0,0,0" Command="{Binding ShowSafetyIntlksCommand}">
<StackPanel Orientation="Horizontal">
<Label>Safety</Label>
<Rectangle Width="10" Height="10" Fill="{Binding Path=XSafetyIntlkOk, Converter={StaticResource myBoolConverter}}" RadiusX="2" RadiusY="2" Margin="0,2,0,0"/>

View File

@@ -0,0 +1,79 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<AssemblyVersion>0.1.0</AssemblyVersion>
<FileVersion>0.1</FileVersion>
<Platforms>AnyCPU;x64</Platforms>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<None Remove="Anlagenuebersicht.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Beckhoff.TwinCAT.Ads" Version="6.1.197" />
<PackageReference Include="Beckhoff.TwinCAT.TcEventLoggerAdsProxy.Net" Version="2.7.11" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="AdsManager">
<HintPath>bin\x64\Debug\net8.0-windows8.0\AdsManager.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Resource Include="Anlagenuebersicht.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Compile Update="Common\MediaContainer.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Common\ParamControlInt.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Common\ParamControlFloat.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\AnalogMotorControl\AnalogMotorControl.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\AnalogValue\AnalogValue.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\AnalogValveControl\AnalogValveControl.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\BinaryValveControl\BinaryValveControl.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\InterlockControl\IntlkControl.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\InterlockDetailsControl\IntlkDetails.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="HMIToolkit\HMIObjects\InterlockDetailsControl\IntlkDetailsWindow.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -1,39 +1,29 @@
<Window x:Class="UniperHMI.MainWindow"
<Window x:Class="InfineonHMI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:UniperHMI" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:uniperHmi="clr-namespace:InfineonHMI"
mc:Ignorable="d"
x:Name="MainControlWindow"
d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"
d:DataContext="{d:DesignInstance Type=uniperHmi:MainWindowVM}"
WindowStartupLocation="CenterScreen"
Title="Uniper HMI" Height="1030" Width="1900" ResizeMode="NoResize">
Title="Infineon BiPolar" Height="2100" Width="3820" ResizeMode="NoResize">
<Viewbox Stretch="Fill">
<Grid Width="3840" Height="2100">
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="0.08*"/>
<RowDefinition Height="0.04*"/>
<RowDefinition Height="0.04*"/>
<RowDefinition Height="0.74*"/>
<RowDefinition Height="0.10*"/>
</Grid.RowDefinitions>
<!-- Latest event line -->
<Grid Grid.Row="0">
<Border BorderThickness="0px 0px 0px 2px" BorderBrush="White" Background="Black">
<Label Content="{Binding EventsPageVM.CurrentEvent.Message}" FontSize="20" Height="45" VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="{Binding StatusBarVisible}"/>
</Border>
</Grid>
<!-- Breadcrumb line -->
<Label Grid.Row="1" Content="{Binding Breadcrumb}"/>
<!-- Page frame -->
<Frame x:Name="MainFrame" NavigationUIVisibility="Hidden" Content="{Binding CurrentPage}" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
<!-- Softkey grid -->
<Grid Grid.Row="3" Margin="5,5,3,5" Width="Auto">
<!-- Header line -->
<Grid Grid.Row="0" Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
@@ -51,47 +41,150 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.Resources>
<!--Set x: share to get the latest every time-->
<system:DateTime x:Key="DateTime"
x:Shared="False" />
<Storyboard x:Key="Storyboard">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="DataContext"
Duration="0:0:1"
RepeatBehavior="Forever"
AutoReverse="False">
<DiscreteObjectKeyFrame KeyTime="50%"
Value="{StaticResource DateTime}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<TextBlock Text="{Binding RelativeSource={RelativeSource Self},Path=DataContext.Now,StringFormat={}{0:dd.MM.yyyy}}"
DataContext="{StaticResource DateTime}"
FontSize="48"
Foreground="White">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard Storyboard="{StaticResource Storyboard}" />
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
<TextBlock Text="{Binding RelativeSource={RelativeSource Self},Path=DataContext.Now,StringFormat={}{0:hh:mm:ss}}"
DataContext="{StaticResource DateTime}"
FontSize="48"
Margin="0,50,0,0"
Foreground="White">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard Storyboard="{StaticResource Storyboard}" />
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
</Grid>
<Button Grid.Column="10"
Grid.ColumnSpan="2"
Margin="10"
FontSize="44"
Content="{Binding ActualUser}"
Command="{Binding ChangeUserClickedCommand}"/>
<Button Grid.Column="12"
Grid.ColumnSpan="2"
Margin="10"
FontSize="44"
Content="Auswahl&#xD;&#xA;Betriebsart"
Command="{Binding WorkingModeSelectionClickedCommand}"/>
<Label Grid.Column="1"
Grid.ColumnSpan="3"
Content="BiPolar Randätzer"
FontSize="60"
VerticalAlignment="Top"/>
<Label Grid.Column="1"
Grid.ColumnSpan="3"
Content="V 01.00"
FontSize="40"
VerticalAlignment="Bottom"/>
</Grid>
<!-- Latest event line -->
<Border Grid.Row="1" BorderBrush="White" BorderThickness="0,0,0,2">
<Label Content="{Binding EventsPageVM.CurrentEvent.Message}"
FontSize="28"
VerticalAlignment="Center"/>
</Border>
<!-- Breadcrumb line -->
<Label Grid.Row="2"
Content="{Binding Breadcrumb}"
FontSize="28"/>
<!-- Page frame -->
<Frame x:Name="MainFrame"
Grid.Row="3"
NavigationUIVisibility="Hidden"
Content="{Binding CurrentPage}"/>
<!-- Softkey grid -->
<Grid Grid.Row="4" Margin="20">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<UniformGrid Columns="7" Grid.ColumnSpan="7">
<!-- Softkey 1 -->
<Button Grid.Column="0" MinWidth="80" MinHeight="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}" Margin="0,0,2,0" Content="Automatik" Command="{Binding AutomaticModeClickedCommand}"/>
<Button Grid.Column="0" Content="Übersicht" FontSize="38" Margin="10"
Command="{Binding OverviewWindowClickedCommand}" />
<!-- Command="{Binding AutomaticModeCommand}" -->
<!-- Softkey 2 -->
<Button Grid.Column="1" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Manuell" Command="{Binding ManualModeClickedCommand}" />
<Button Grid.Column="0" Content="Stationen" FontSize="38" Margin="10"
Command="{Binding ProductionWindowClickedCommand}"/>
<!-- Command="{Binding ManualModeCommand}" -->
<!-- Softkey 3 -->
<Button Grid.Column="2" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Einstellungen" Command="{Binding SettingsWindowCommand}" />
<!-- Command="{Binding SettingsWindowCommand}" -->
<Button Grid.Column="0" Content="Protokoll" FontSize="38" Margin="10"
Command="{Binding ProtocolWindowClickedCommand}" Visibility="Collapsed"/>
<!-- Softkey 4 -->
<Button Grid.Column="3" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Trayfeeder &#xD;&#xA;Ein- /Ausgabe" Command="{Binding EventsListClickedCommand}"/>
<Button Grid.Column="0" Content="Rezepte" FontSize="38" Margin="10"
Command="{Binding ReceipesWindowClickedCommand}" />
<!-- Command="{Binding SettingsWindowCommand}" -->
<!-- Softkey 5 -->
<Button Grid.Column="4" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Heiz-/Kühlplatte" Command="{Binding HotCoolplateClickedCommand}" />
<Button Grid.Column="0" Content="Trend" FontSize="38" Margin="10"
Command="{Binding TrendWindowClickedCommand}" Visibility="Collapsed"/>
<!-- Softkey 6 -->
<Button Grid.Column="5" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Hochvolt-Test" />
<Button Grid.Column="0" Content="Komponenten" FontSize="38" Margin="10"
Command="{Binding ComponentsWindowClickedCommand}" Visibility="Collapsed"/>
<!-- Softkey 7 -->
<Button Grid.Column="6" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Ätzstationen"/>
<!-- Softkey 8 -->
<Button Grid.Column="7" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Ausrichtstation"/>
<Button Content="Einstellungen" FontSize="38" Margin="10"
Command="{Binding SettingsWindowClickedCommand}" Visibility="Collapsed"/>
</UniformGrid>
<Button Grid.Column="7" Content="Meldungen" FontSize="38" Margin="10"
Command="{Binding EventsListClickedCommand}"/>
<!-- Softkey 9 -->
<Button Grid.Column="8" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="NIO"/>
<Button Grid.Column="8" Content="Ack Alarms" FontSize="38" Margin="10"
Command="{Binding AckAlarmsCommand}"/>
<!-- Softkey 10 -->
<Button Grid.Column="9" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Tellermagazin" Command="{Binding ChuckMagazinClickedCommand}"/>
<!-- Softkey 11 -->
<Button Grid.Column="10" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Kuka-Roboter" Command="{Binding KukaRobotClickedCommand}"/>
<Button Grid.Column="11" MinWidth="80" MinHeight="80" Margin="0,0,2,0" Content="Medien-Schrank"/>
<Button Grid.Column="12" Content="Back" Command="{Binding NavigateBackCommand}" IsEnabled="{Binding CanNavigateBack}" MinWidth="80" MinHeight="80" Margin="0,0,2,0" />
<Button Grid.Column="13" Content="Ack Alarms" Command="{Binding AckAlarmsCommand}" MinWidth="80" MinHeight="80" Margin="0,0,2,0" />
</Grid>
</Grid>
</Grid>
</Viewbox>
</Window>

View File

@@ -1,7 +1,7 @@
using HMIToolkit;
using MahApps.Metro.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaction logic for MainWindow.xaml

View File

@@ -7,35 +7,31 @@ using Microsoft.Extensions.DependencyInjection;
using System.Windows;
using System.Windows.Controls;
using TcEventLoggerAdsProxyLib;
using InfineonHMI.Pages.Views;
namespace UniperHMI;
namespace InfineonHMI;
public sealed partial class MainWindowVM : ObservableObject, IRecipient<NavigateMessage>, IDisposable
{
[ObservableProperty]
private StringControlButtonVM dummyStringVM;
[ObservableProperty] private StringControlButtonVM dummyStringVM;
[ObservableProperty]
private Page currentPage;
[ObservableProperty] private Page currentPage;
[ObservableProperty]
private bool canNavigateBack;
[ObservableProperty] private Visibility statusBarVisible;
[ObservableProperty]
private Visibility statusBarVisible;
[ObservableProperty] private string breadcrumb;
[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 = "";
[ObservableProperty] private string currentActiveEvent = "";
private readonly object _lock = new();
@@ -47,26 +43,28 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
NavigateMessage? _currentMessage;
// Events page view model
[ObservableProperty]
EventsPageVM _eventsPageVM;
[ObservableProperty] EventsPageVM _eventsPageVM;
// Settings page viem model
SettingsPageVM? _settingsPageVM;
ProductionOverviewPageVM? _productionOverviewPageVM;
private MachineOverviewPageVM? _machineOverviewPageVM;
// Hot Coolplate page view model
HotCoolPlatePageVM? _hotCoolplatePageVM;
// Chuck Magazin page view model
ChuckMagazinPageVM? _chuckMagazinPageVM;
// Kuka Robot page view model
KukaRobotPageVM? _kukaRobotPageVM;
ReceipePageVM? _receipePageVM;
public MainWindowVM(IAdsManager adsManager, IConfiguration config, TcEventLogger eventLogger)
{
_adsManager = adsManager;
_config = config;
ActualUser = _actualUserPrefix + "---------";
// Create dummy string
DummyStringVM = new StringControlButtonVM();
@@ -86,6 +84,14 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
breadcrumb = "";
}
public void NavigateFromOuterPage(NavigateMessage message, NavigateMessage nextMessage)
{
_currentMessage = message;
Navigate(message, nextMessage);
}
[RelayCommand]
private void SettingsWindow()
{
@@ -96,25 +102,70 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
}
[RelayCommand]
public void AutomaticModeClicked()
private void ChangeUserClicked()
{
}
[RelayCommand]
private void WorkingModeSelectionClicked()
{
}
[RelayCommand]
private void OverviewWindowClicked()
{
StatusBarVisible = Visibility.Visible;
_messageStack.Clear();
_currentMessage = new NavigateMessage("", typeof(Page));
NavigateMessage message = new(_config["AutomaticModeVarName"]!, typeof(AutomaticModePage));
NavigateMessage message = new(_config[""]!, typeof(MachineOverviewPage));
Receive(message);
}
[RelayCommand]
public void ManualModeClicked()
private void ProductionWindowClicked()
{
StatusBarVisible = Visibility.Visible;
_messageStack.Clear();
_currentMessage = new NavigateMessage("", typeof(Page));
NavigateMessage message = new("", typeof(BatteryOverviewPage));
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()
{
@@ -124,68 +175,8 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
NavigateMessage message = new("", typeof(EventsPage));
Receive(message);
}
[RelayCommand]
public void KukaRobotClicked()
{
StatusBarVisible = Visibility.Visible;
_messageStack.Clear();
_currentMessage = new NavigateMessage("", typeof(Page));
NavigateMessage message = new(_config["KukaRobotVarName"]!, typeof(KukaRobotPage));
Receive(message);
}
[RelayCommand]
public void HotCoolplateClicked()
{
StatusBarVisible = Visibility.Visible;
_messageStack.Clear();
_currentMessage = new NavigateMessage("", typeof(Page));
NavigateMessage message = new(_config["HotCoolplateVarName"]!, typeof(HotCoolPlatePage));
Receive(message);
}
[RelayCommand]
public void ChuckMagazinClicked()
{
StatusBarVisible = Visibility.Visible;
_messageStack.Clear();
_currentMessage = new NavigateMessage("", typeof(Page));
NavigateMessage message = new(_config["ChuckMagazinVarName"]!, typeof(ChuckMagazinPage));
Receive(message);
}
[RelayCommand]
public void NavigateBack()
{
if (_messageStack.Count == 0)
{
CanNavigateBack = false;
return;
}
_currentMessage = _messageStack.Pop();
// Update if we can use the navigate back button
if (_messageStack.Count > 0)
CanNavigateBack = true;
else
{
StatusBarVisible = Visibility.Visible;
CanNavigateBack = false;
}
// Remove last two entrys from Breadcrumbs
int index = -1;
for (int i = 0; i < 2; i++)
{
index = Breadcrumb.LastIndexOf('>');
if (index != -1)
Breadcrumb = Breadcrumb[..index];
}
// Navigate to page
Navigate(_currentMessage);
}
// Only use for forward traversal!
public void Receive(NavigateMessage message)
@@ -201,13 +192,11 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
// Save current message for later push
_currentMessage = message;
// Set can navigate back
CanNavigateBack = true;
Navigate(message);
}
private void Navigate(NavigateMessage message)
private void Navigate(NavigateMessage message, NavigateMessage? nextMessage = null)
{
// Dispose current pages viewmodel
if (CurrentPage.DataContext is IDisposable viewModel)
@@ -219,43 +208,20 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
// Create new page
switch (message.type.Name)
{
case nameof(AutomaticModePage):
var automaticModeViewModel = (AutomaticModePageVM)ActivatorUtilities.CreateInstance(App.AppHost!.Services, typeof(AutomaticModePageVM), message.VariableName); //App.AppHost!.Services.GetRequiredService<AutomaticModePageVM>();
AutomaticModePage automaticModePage = new() { DataContext = automaticModeViewModel };
CurrentPage = automaticModePage;
Breadcrumb = "> Automatic";
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(BatteryOverviewPage):
var batteryOverviewPageVM = App.AppHost!.Services.GetRequiredService<BatteryOverviewPageVM>();
BatteryOverviewPage batteryOverviewPage = new() { DataContext = batteryOverviewPageVM };
CurrentPage = batteryOverviewPage;
Breadcrumb = "> Manual";
break;
case nameof(MachineOverviewPage):
_machineOverviewPageVM?.Dispose();
case nameof(StringOverviewPage):
var stringOverviewVM = (StringOverviewPageVM)ActivatorUtilities.CreateInstance(App.AppHost!.Services, typeof(StringOverviewPageVM), message.VariableName);
StringOverviewPage stringPage = new() { DataContext = stringOverviewVM };
CurrentPage = stringPage;
if (message.Header.Length > 0)
AppendBreadcrumb(message.Header);
break;
case nameof(ModuleOverviewPage):
var moduleOverviewVM = (ModuleOverviewPageVM)ActivatorUtilities.CreateInstance(App.AppHost!.Services, typeof(ModuleOverviewPageVM), message.VariableName);
ModuleOverviewPage modulePage = new() { DataContext = moduleOverviewVM };
CurrentPage = modulePage;
if (message.Header.Length > 0)
AppendBreadcrumb(message.Header);
break;
case nameof(UnitOverviewPage):
var unitOverviewVM = (UnitOverviewPageVM)ActivatorUtilities.CreateInstance(App.AppHost!.Services, typeof(UnitOverviewPageVM), message.VariableName);
unitOverviewVM.UnitName = message.Header;
UnitOverviewPage unitPage = new() { DataContext = unitOverviewVM };
CurrentPage = unitPage;
if (message.Header.Length > 0)
AppendBreadcrumb(message.Header);
_machineOverviewPageVM = new MachineOverviewPageVM(_adsManager, _config,this, new ProductionOverviewPageVM(_adsManager, _config, _eventlogger), _eventlogger);
MachineOverviewPage machineOverviewPage = new() { DataContext = _machineOverviewPageVM };
CurrentPage = machineOverviewPage;
break;
case nameof(EventsPage):
@@ -276,16 +242,17 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
Breadcrumb = " > Settings";
break;
case nameof(KukaRobotPage):
// Create page view model only once
if (_kukaRobotPageVM == null)
_kukaRobotPageVM = new(_adsManager, "GVL_CONFIG.stRobotConfig");
case nameof(ReceipePage):
if (_receipePageVM == null)
_receipePageVM = new();
KukaRobotPage kukaRobotPage = new() { DataContext = _kukaRobotPageVM };
CurrentPage = kukaRobotPage;
ReceipePage receipePage = new() { DataContext = _receipePageVM };
CurrentPage = receipePage;
Breadcrumb = " > Kuka Roboter";
break;
case nameof(HotCoolPlatePage):
if (_hotCoolplatePageVM == null)
_hotCoolplatePageVM = new(_adsManager, "GVL_Config.stHotCoolplateConfig");
@@ -296,14 +263,6 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
break;
case nameof(ChuckMagazinPage):
if (_chuckMagazinPageVM == null)
_chuckMagazinPageVM = new(_adsManager, "GVL_Config.stChuckMagazinConfig");
ChuckMagazinPage chuckMagazinPage = new() { DataContext= _chuckMagazinPageVM };
CurrentPage = chuckMagazinPage;
Breadcrumb = " > Tellermagazin";
break;
default:
CurrentPage = new Page();
@@ -322,7 +281,7 @@ public sealed partial class MainWindowVM : ObservableObject, IRecipient<Navigate
[RelayCommand]
private void AckAlarms()
{
_adsManager.WriteValue("GVL_SCADA.stAckAlarmsButton.xRequest", true);
_adsManager.WriteValue("GVL_SCADA.stConfirmAlarmsBtn.xRequest", true);
}
public void Dispose()

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UniperHMI.Model
namespace InfineonHMI.Model
{
public enum E_BMS_CONTROL_MODE : short
{
@@ -94,4 +94,45 @@ namespace UniperHMI.Model
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; }
}
}

View File

@@ -0,0 +1,225 @@
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<ReceipeObject>(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<TrayPosition> TrayPositions { get; set; }
public int CameraPrograms { get; set; }
public int Chucks { get; set; }
public int Gripper { get; set; }
/// <summary>
/// Erlaubten Strahlparameter Abweichungen
/// </summary>
public float PermissibleBeamParameterDeviations { get; set; }
public MachineParameters()
{
TrayPositions = new List<TrayPosition>();
}
}
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
{
/// <summary>
/// Test voltage in V
/// </summary>
public float TestVoltage { get; set; }
/// <summary>
/// Maximum test Current
/// </summary>
public float MaximumTestCurrent { get; set; }
/// <summary>
/// Ramp Time in milliseconds
/// </summary>
public float RampTime { get; set; }
/// <summary>
/// Testfrequency in HZ
/// </summary>
public float TestFrequency { get; set; }
/// <summary>
/// Polarity 1=Positive, 2=Negative
/// </summary>
public UInt16 Polarity { get; set; }
/// <summary>
/// Overpressure N2 in mbar
/// </summary>
public float TestpressureN2 { get; set; }
/// <summary>
/// N2 pre purging time in seconds
/// </summary>
public float N2PrePurgetime { get; set; }
/// <summary>
/// Test retries
/// </summary>
public UInt16 NumRetries { get; set; }
/// <summary>
/// Temperature for testing (only used in heated HV station)
/// </summary>
public float TestTemperature { get; set; }
/// <summary>
/// Test OK Voltage
/// </summary>
public float TestOkVoltage { get; set; }
/// <summary>
/// Test OK Current
/// </summary>
public float TestOkCurrent { get; set; }
}
public class ReceipeEtcher
{
/// <summary>
/// Number of Robot positions
/// </summary>
public UInt16 NumberRobotPos { get; set; }
public float Rpm { get; set; }
/// <summary>
/// Roboter position and setting data
/// </summary>
public List<EtcherRobotStepData> RobotStepData { get; set; }
/// <summary>
/// Radial position of water jet under the blank in mm
/// </summary>
public float RadialPosLowerWaterJet { get; set; }
public ReceipeEtcher()
{
RobotStepData = new List<EtcherRobotStepData>();
}
}
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<FlowReceipeNode> Nodes { get; set; }
public FlowReceipe()
{
Nodes = new List<FlowReceipeNode>();
}
}
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; }
}

View File

@@ -1,3 +1,3 @@
namespace UniperHMI;
namespace InfineonHMI;
public record class NavigateMessage(string VariableName, Type type, string Header = "");

View File

@@ -2,7 +2,7 @@
using Heisig.HMI.AdsManager;
using TwinCAT.TypeSystem;
namespace UniperHMI;
namespace InfineonHMI;
public enum E_COMPONENT_STATUS : short
{

View File

@@ -1,6 +1,6 @@
using Heisig.HMI.AdsManager;
namespace UniperHMI;
namespace InfineonHMI;
public sealed partial class StringControlButtonVM : SMUBaseVM, IDisposable
{

View File

@@ -2,7 +2,7 @@
using CommunityToolkit.Mvvm.Messaging;
using Heisig.HMI.AdsManager;
namespace UniperHMI.OwnControls
namespace InfineonHMI.OwnControls
{
public sealed partial class UnitControlButtonVM : SMUBaseVM
{

View File

@@ -4,7 +4,7 @@ using HMIToolkit;
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
namespace UniperHMI
namespace InfineonHMI
{
public sealed partial class UnitDetailsControlVM : ObservableObject, IDisposable
{

View File

@@ -1,9 +1,9 @@
<Button x:Class="UniperHMI.SMUControlButton"
<Button x:Class="InfineonHMI.SMUControlButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
d:DataContext="{d:DesignInstance Type=local:StringControlButtonVM, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
Style="{StaticResource MahApps.Styles.Button}"

View File

@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für StringControlButton.xaml

View File

@@ -1,9 +1,9 @@
<UserControl xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="UniperHMI.UnitDetailsControl"
<UserControl xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="InfineonHMI.UnitDetailsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:UnitDetailsControlVM, IsDesignTimeCreatable=True}"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto"

View File

@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für UnitControl.xaml

View File

@@ -6,58 +6,21 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using UniperHMI.Model;
namespace UniperHMI
using InfineonHMI.Model;
namespace InfineonHMI
{
public sealed partial class AlignmentStationPageVM : 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]
private HMIControlButtonVM? startButton;
[ObservableProperty]
private HMIControlButtonVM? stopButton;
[ObservableProperty]
private E_BMS_CONTROL_MODE bmsControlMode;
[ObservableProperty]
private ObservableCollection<BMSControlModeEntry> 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;
[ObservableProperty]
private BinaryValveControlVM vacuumValveControlVm;
public AlignmentStationPageVM()
{
StartButton = new HMIControlButtonVM();
StopButton = new HMIControlButtonVM();
SelectedControlMode = ReqBMSControlModes[1];
canChangeControlMode = true;
VacuumValveControlVm = new BinaryValveControlVM();
}
public AlignmentStationPageVM(IAdsManager adsManager, string variableName)
@@ -65,25 +28,10 @@ namespace UniperHMI
_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);
VacuumValveControlVm = new BinaryValveControlVM(_adsManager, _variableName + ".stVacuumValve");
}
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()
{

View File

@@ -0,0 +1,94 @@
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;
}
}
}

View File

@@ -0,0 +1,92 @@
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;
}
}
}

View File

@@ -3,7 +3,7 @@ using System.Collections.ObjectModel;
using System.Windows;
using TcEventLoggerAdsProxyLib;
namespace UniperHMI
namespace InfineonHMI
{
public partial class EventData : ObservableObject
{

View File

@@ -6,58 +6,42 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using UniperHMI.Model;
namespace UniperHMI
using InfineonHMI.Model;
namespace InfineonHMI
{
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<BMSControlModeEntry> 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;
[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()
{
StartButton = new HMIControlButtonVM();
StopButton = new HMIControlButtonVM();
SelectedControlMode = ReqBMSControlModes[1];
canChangeControlMode = true;
DoorValveHotControlVm = new BinaryValveControlVM();
TestChamberHotValveVm = new BinaryValveControlVM();
TempSPHotVm = new AnalogValueVM();
DoorValveColdControlVm = new BinaryValveControlVM();
TestChamberColdValveVm = new BinaryValveControlVM();
TempSPColdVm = new AnalogValueVM();
}
public HighVoltageStationPageVM(IAdsManager adsManager, string variableName)
@@ -65,57 +49,24 @@ namespace UniperHMI
_adsManager = adsManager;
_variableName = variableName;
//StartButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStartAutoButton");
//StopButton = new HMIControlButtonVM(_adsManager, _variableName + ".stStopAutoButton");
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);
SelectedControlMode = ReqBMSControlModes[1];
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);
_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!;
DoorValveHotControlVm.Dispose();
TestChamberHotValveVm.Dispose();
TempSPHotVm.Dispose();
DoorValveColdControlVm.Dispose();
TestChamberColdValveVm.Dispose();
TempSPColdVm.Dispose();
}
}
}

View File

@@ -6,50 +6,56 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using UniperHMI.Model;
using InfineonHMI.Model;
using System.Windows;
namespace UniperHMI
namespace InfineonHMI
{
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 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 = "_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 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;
[ObservableProperty]
private double hotPlateTargetTemperature;
private readonly string? _variableName;
[ObservableProperty]
private double hotPlateActualTemperature;
private AnalogValueVM hotPlateTargetTemperature;
[ObservableProperty]
private double coolPlateTargetTemperature;
private AnalogValueVM hotPlateActualTemperature;
[ObservableProperty] private HMIControlButtonVM? enableHotPlateButtonVm;
[ObservableProperty] private HMIControlButtonVM? disableHotPlateButtonVm;
[ObservableProperty]
private double coolPlateActualTemperature;
private AnalogValueVM coolPlateTargetTemperature;
[ObservableProperty]
private AnalogValueVM coolPlateActualTemperature;
[ObservableProperty] private HMIControlButtonVM? enableCoolPlateButtonVm;
[ObservableProperty] private HMIControlButtonVM? disableCoolPlateButtonVm;
[ObservableProperty]
private Visibility hotPlateVisibility1;
@@ -107,15 +113,36 @@ namespace UniperHMI
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;
_adsManager.Register(sHotplateActualTemp, HotplateTempChanged);
_adsManager.Register(sCoolplateActualTemp, CoolplateTempChanged);
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);
@@ -140,14 +167,6 @@ namespace UniperHMI
}
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)
@@ -351,8 +370,19 @@ namespace UniperHMI
public void Dispose()
{
_adsManager?.Deregister(sHotplateActualTemp, HotplateTempChanged);
_adsManager?.Deregister(sCoolplateActualTemp, CoolplateTempChanged);
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);

View File

@@ -6,10 +6,11 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using System.Security.Policy;
using UniperHMI.Model;
using System.Printing;
using System.Windows;
using InfineonHMI.Model;
namespace UniperHMI
namespace InfineonHMI
{
public sealed partial class KukaRobotPageVM : ObservableValidator, IDisposable
{
@@ -21,24 +22,24 @@ namespace UniperHMI
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 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 = "_adsVariable_kukaJobGrippSide";
private const string sJobGrippType = "_adsVariable_kukaJobGrippType";
private const string sChuckMagazinPlace = "_adsVariable_kukaChuckMagazinPlace";
private const string sSelectedRobotJob = "_adsVariable_kukaRobotJob";
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 = "_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 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;
@@ -74,6 +75,30 @@ namespace UniperHMI
[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
@@ -81,7 +106,7 @@ namespace UniperHMI
get { return jobGrippSide; }
set
{
jobGrippSide = value;
SetProperty(ref jobGrippSide, value);
_adsManager?.WriteValue(sJobGrippSide, value);
}
}
@@ -96,7 +121,7 @@ namespace UniperHMI
get { return jobGrippType; }
set
{
jobGrippType = value;
SetProperty(ref jobGrippType, value);
_adsManager?.WriteValue(sJobGrippType, value);
}
@@ -112,7 +137,7 @@ namespace UniperHMI
get { return chuckMagazinPlace; }
set
{
chuckMagazinPlace = value;
SetProperty(ref chuckMagazinPlace, value);
_adsManager?.WriteValue(sChuckMagazinPlace, value);
}
}
@@ -127,7 +152,7 @@ namespace UniperHMI
get { return pieceThickness; }
set
{
pieceThickness = value;
SetProperty(ref pieceThickness, value);
_adsManager?.WriteValue(sPieceThickness, value);
}
}
@@ -142,7 +167,7 @@ namespace UniperHMI
get { return offsetPick_X; }
set
{
offsetPick_X = value;
SetProperty(ref offsetPick_X, value);
_adsManager?.WriteValue(sOffsetPick_X, value);
}
}
@@ -154,7 +179,7 @@ namespace UniperHMI
get { return offsetPick_Y; }
set
{
offsetPick_Y = value;
SetProperty(ref offsetPick_Y, value);
_adsManager?.WriteValue(sOffsetPick_Y, value);
}
}
@@ -168,7 +193,7 @@ namespace UniperHMI
get { return offsetPlace_X; }
set
{
offsetPlace_X = value;
SetProperty(ref offsetPlace_X, value);
_adsManager?.WriteValue(sOffsetPlace_X, value);
}
}
@@ -179,7 +204,7 @@ namespace UniperHMI
get { return offsetPlace_Y; }
set
{
offsetPlace_Y = value;
SetProperty(ref offsetPlace_Y, value);
_adsManager?.WriteValue(sOffsetPlace_Y, value);
}
}
@@ -195,7 +220,7 @@ namespace UniperHMI
get { return offsetNIOPick_X; }
set
{
offsetNIOPick_X = value;
SetProperty(ref offsetNIOPick_X, value);
_adsManager?.WriteValue(sOffsetNIOPick_X, value);
}
}
@@ -206,7 +231,7 @@ namespace UniperHMI
get { return offsetNIOPick_Y; }
set
{
offsetNIOPick_Y = value;
SetProperty(ref offsetNIOPick_Y, value);
_adsManager?.WriteValue(sOffsetNIOPick_Y, value);
}
}
@@ -220,7 +245,7 @@ namespace UniperHMI
get { return offsetNIOPlace_X; }
set
{
offsetNIOPlace_X = value;
SetProperty(ref offsetNIOPlace_X, value);
_adsManager?.WriteValue(sOffsetNIOPlace_X, value);
}
}
@@ -231,7 +256,7 @@ namespace UniperHMI
get { return offsetNIOPlace_Y; }
set
{
offsetNIOPlace_Y = value;
SetProperty(ref offsetNIOPlace_Y, value);
_adsManager?.WriteValue(sOffsetNIOPlace_Y, value);
}
}
@@ -245,7 +270,7 @@ namespace UniperHMI
get { return hotplateIndex; }
set
{
hotplateIndex = value;
SetProperty(ref hotplateIndex, value);
_adsManager?.WriteValue(sHotplateIndex, value);
}
@@ -261,7 +286,7 @@ namespace UniperHMI
get { return coolplateIndex; }
set
{
coolplateIndex = value;
SetProperty(ref coolplateIndex, value);
_adsManager?.WriteValue(sCoolplateIndex, value);
}
}
@@ -330,7 +355,7 @@ namespace UniperHMI
get { return selectedRobotJob; }
set
{
selectedRobotJob = value;
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);
@@ -352,10 +377,9 @@ namespace UniperHMI
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");
canChangeRobotJob = true;currentControlMode = new BMSControlModeEntry(E_BMS_CONTROL_MODE.MANUAL, "Manual");
}
@@ -369,6 +393,11 @@ namespace UniperHMI
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);
@@ -377,8 +406,8 @@ namespace UniperHMI
_adsManager.Register(sSelectedRobotJob, OnSelectedRobotJobValueChanged);
_adsManager.Register(sActiveRobotJob, OnActiveRobotJobValueChanged);
_adsManager.Register(sFinishedRobotJob, OnFinishedRobotJobValueChanged);
_adsManager.Register(sOffsetPick_X, OnOffsetPickYValueChanged);
_adsManager.Register(sOffsetPick_Y, OnOffsetPickXValueChanged);
_adsManager.Register(sOffsetPick_X, OnOffsetPickXValueChanged);
_adsManager.Register(sOffsetPick_Y, OnOffsetPickYValueChanged);
_adsManager.Register(sCoolplateIndex, OnCoolPlateIndexValueChanged);
_adsManager.Register(sHotplateIndex, OnHotPlateIndexValueChanged);
_adsManager.Register(sOffsetNIOPlace_Y, OnOffsetNIOPlaceYValueChanged);
@@ -386,7 +415,14 @@ namespace UniperHMI
_adsManager.Register(sOffsetNIOPick_Y, OnOffsetNIOPickYValueChanged);
_adsManager.Register(sOffsetNIOPick_X, OnOffsetNIOPickXValueChanged);
_adsManager.Register(sOffsetPlace_Y, OnOffsetPlaceYValueChanged);
_adsManager.Register(sOffsetPlace_X, OnOffsetNIOPlaceXValueChanged);
_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;
@@ -400,75 +436,142 @@ namespace UniperHMI
private void OnJobGrippSideValueChanged(object sender, ValueChangedEventArgs e)
{
jobGrippSide = (int)e.Value;
JobGrippSide = (byte)e.Value;
}
private void OnJobGrippTypeValueChanged(object sender, ValueChangedEventArgs e)
{
jobGrippType = (int)e.Value;
JobGrippType = (byte)e.Value;
}
private void OnChuckMagazinPlaceValueChanged(object sender, ValueChangedEventArgs e)
{
chuckMagazinPlace = (int)e.Value;
ChuckMagazinPlace = (byte)e.Value;
}
private void OnPieceThicknessValueChanged(object sender, ValueChangedEventArgs e)
{
pieceThickness = (int)e.Value;
PieceThickness = (int)e.Value;
}
private void OnSelectedPLCJobValueChanged(object sender, ValueChangedEventArgs e)
{
selectedPLCJob = PLCJobs.First(i => (int)i.eJob == (int)e.Value);
SelectedPLCJob = PLCJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
}
private void OnSelectedRobotJobValueChanged(object sender, ValueChangedEventArgs e)
{
selectedRobotJob = RobotJobs.First(i => (int)i.eJob == (int)e.Value);
SelectedRobotJob = RobotJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
}
private void OnActiveRobotJobValueChanged(object sender, ValueChangedEventArgs e)
{
robotJobActiveValue = RobotJobs.First(i => (int)i.eJob == (int)e.Value);
RobotJobActiveValue = RobotJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
}
private void OnFinishedRobotJobValueChanged(object sender, ValueChangedEventArgs e)
{
robotJobFinishedValue = RobotJobs.First(i => (int)i.eJob == (int)e.Value);
RobotJobFinishedValue = RobotJobs.First(i => (ushort)i.eJob == (ushort)e.Value);
}
private void OnHotPlateIndexValueChanged(object sender, ValueChangedEventArgs e)
{
hotplateIndex = (int)e.Value;
HotplateIndex = (byte)e.Value;
}
private void OnCoolPlateIndexValueChanged(object sender, ValueChangedEventArgs e)
{
coolplateIndex = (int)e.Value;
CoolplateIndex = (byte)e.Value;
}
private void OnOffsetPickXValueChanged(object sender, ValueChangedEventArgs e)
{
offsetPick_X = (double)e.Value;
OffsetPick_X = (float)e.Value;
}
private void OnOffsetPickYValueChanged(object sender, ValueChangedEventArgs e)
{
offsetPick_Y = (double)e.Value;
OffsetPick_Y = (float)e.Value;
}
private void OnOffsetPlaceXValueChanged(object sender, ValueChangedEventArgs e)
{
offsetPlace_X = (double)e.Value;
OffsetPlace_X = (float)e.Value;
}
private void OnOffsetPlaceYValueChanged(object sender, ValueChangedEventArgs e)
{
offsetPlace_X = (double)e.Value;
OffsetPlace_Y = (float)e.Value;
}
private void OnOffsetNIOPickXValueChanged(object sender, ValueChangedEventArgs e)
{
offsetNIOPick_X = (double)e.Value;
OffsetNIOPick_X = (float)e.Value;
}
private void OnOffsetNIOPickYValueChanged(object sender, ValueChangedEventArgs e)
{
offsetNIOPick_Y = (double)e.Value;
OffsetNIOPick_Y = (float)e.Value;
}
private void OnOffsetNIOPlaceXValueChanged(object sender, ValueChangedEventArgs e)
{
offsetNIOPlace_X = (double)e.Value;
OffsetNIOPlace_X = (float)e.Value;
}
private void OnOffsetNIOPlaceYValueChanged(object sender, ValueChangedEventArgs e)
{
OffsetNIOPlace_Y = (double)e.Value;
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()
@@ -486,8 +589,8 @@ namespace UniperHMI
_adsManager?.Deregister(sSelectedRobotJob, OnSelectedRobotJobValueChanged);
_adsManager?.Deregister(sActiveRobotJob, OnActiveRobotJobValueChanged);
_adsManager?.Deregister(sFinishedRobotJob, OnFinishedRobotJobValueChanged);
_adsManager?.Deregister(sOffsetPick_X, OnOffsetPickYValueChanged);
_adsManager?.Deregister(sOffsetPick_Y, OnOffsetPickXValueChanged);
_adsManager?.Deregister(sOffsetPick_X, OnOffsetPickXValueChanged);
_adsManager?.Deregister(sOffsetPick_Y, OnOffsetPickYValueChanged);
_adsManager?.Deregister(sCoolplateIndex, OnCoolPlateIndexValueChanged);
_adsManager?.Deregister(sHotplateIndex, OnHotPlateIndexValueChanged);
_adsManager?.Deregister(sOffsetNIOPlace_Y, OnOffsetNIOPlaceYValueChanged);
@@ -495,7 +598,14 @@ namespace UniperHMI
_adsManager?.Deregister(sOffsetNIOPick_Y, OnOffsetNIOPickYValueChanged);
_adsManager?.Deregister(sOffsetNIOPick_X, OnOffsetNIOPickXValueChanged);
_adsManager?.Deregister(sOffsetPlace_Y, OnOffsetPlaceYValueChanged);
_adsManager?.Deregister(sOffsetPlace_X, OnOffsetNIOPlaceXValueChanged);
_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);

View File

@@ -0,0 +1,300 @@
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<NavigateMessage>, 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<NavigateMessage> _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<NavigateMessage>(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();
}
}

View File

@@ -5,117 +5,104 @@ using Heisig.HMI.AdsManager;
using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using Common;
using InfineonHMI.Model;
using UniperHMI.Model;
namespace UniperHMI
namespace InfineonHMI
{
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);
}
private IAdsManager _adsManager;
private string? _variableName;
[ObservableProperty]
private int processValue;
[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;
[ObservableProperty]
public HMIControlButtonVM? startButton;
[ObservableProperty]
public HMIControlButtonVM? stopButton;
[ObservableProperty]
private E_BMS_CONTROL_MODE bmsControlMode;
[ObservableProperty]
public ObservableCollection<BMSControlModeEntry> 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");
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");
SelectedControlMode = ReqBMSControlModes[1];
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";
_adsManager.Register("GVL_SCADA.xCanChangeControlMode", CCCMChanged);
_adsManager.Register(_variableName + ".diSetpointAutomatic", SetpointChanged);
}
private void SetpointChanged(object? sender, ValueChangedEventArgs e)
public MediaCabinetPageVM()
{
Setpoint = (int)e.Value;
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";
}
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);
Container1Vm.Dispose();
Container2Vm.Dispose();
Container3Vm.Dispose();
Container4Vm.Dispose();
Container5Vm.Dispose();
Container6Vm.Dispose();
Container7Vm.Dispose();
Container8Vm.Dispose();
Container9Vm.Dispose();
_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!;
}
}
}

View File

@@ -6,8 +6,8 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using UniperHMI.Model;
namespace UniperHMI
using InfineonHMI.Model;
namespace InfineonHMI
{
public sealed partial class NIOStationPageVM : ObservableValidator, IDisposable
{
@@ -17,12 +17,20 @@ namespace UniperHMI
private readonly IAdsManager? _adsManager;
[ObservableProperty]
private BinaryValveControlVM cylinderNIOPlateVM;
[ObservableProperty] private BinaryValveControlVM clampDiagValveVm;
[ObservableProperty] private BinaryValveControlVM clampAcrossValveVm;
[ObservableProperty] private HMIControlButtonVM clampCmdButtonVm;
[ObservableProperty] private HMIControlButtonVM unclampCmdButtonVm;
public NIOStationPageVM()
{
cylinderNIOPlateVM = new BinaryValveControlVM();
ClampDiagValveVm = new BinaryValveControlVM();
ClampAcrossValveVm = new BinaryValveControlVM();
ClampCmdButtonVm = new HMIControlButtonVM();
UnclampCmdButtonVm = new HMIControlButtonVM();
}
public NIOStationPageVM(IAdsManager adsManager, string variableName)
@@ -30,14 +38,20 @@ namespace UniperHMI
_adsManager = adsManager;
_variableName = variableName;
cylinderNIOPlateVM = new BinaryValveControlVM(_adsManager, _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()
{
CylinderNIOPlateVM?.Dispose();
ClampDiagValveVm.Dispose();
ClampAcrossValveVm.Dispose();
ClampCmdButtonVm.Dispose();
UnclampCmdButtonVm.Dispose();
}

View File

@@ -0,0 +1,307 @@
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<NavigateMessage>, 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<NavigateMessage> _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<NavigateMessage>(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();
}
}

View File

@@ -0,0 +1,746 @@
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<TrayPosition> 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<EtcherRobotStepData> etcherRobotSteps;
[ObservableProperty] private ParamControlFloatVm radialPosLowerWaterJetVm = new ();
[ObservableProperty] private ParamControlIntVm flowNodeCountVm = new ();
#endregion Properties
#region FlowReceipe
[ObservableProperty]
private ObservableCollection<StationEntry> 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<FlowReceipeEntry> 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<FlowReceipeEntry>(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<FlowReceipeEntry>(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<FlowReceipeEntry>(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<TrayPosition>(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<TrayPosition>(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<TrayPosition>(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<EtcherRobotStepData>(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<EtcherRobotStepData>(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<EtcherRobotStepData>(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<TrayPosition>(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<EtcherRobotStepData>(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<FlowReceipeNode>();
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()
{
}
}

View File

@@ -6,58 +6,18 @@ using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using UniperHMI.Model;
namespace UniperHMI
using InfineonHMI.Model;
namespace InfineonHMI
{
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<BMSControlModeEntry> 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)
@@ -65,57 +25,18 @@ namespace UniperHMI
_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!;
}
}
}

View File

@@ -1,49 +1,36 @@
<Page x:Class="UniperHMI.AlignmentStationPage"
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="InfineonHMI.AlignmentStationPage"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type local:AlignmentStationPageVM}}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="Blablubb">
Title="AlignmentStationPage" FontSize="40">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="1" Grid.Column="1" Content="Requested Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<ComboBox Grid.Row="1" Grid.Column="2" IsEnabled="{Binding CanChangeControlMode}" ItemsSource="{Binding ReqBMSControlModes}" SelectedItem="{Binding SelectedControlMode}"/>
<Label Grid.Row="0" Grid.Column="0" Content="Alignment Station" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Label Grid.Row="2" Grid.Column="1" Content="Current Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding BmsControlMode}" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<Label Grid.Row="3" Grid.Column="1" Content="Status:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="3" Width="125" Grid.Column="2" Text="Charging" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<Label Grid.Row="4" Grid.Column="1" Content="Target Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="4" Width="125" Grid.Column="2" Text="{Binding Setpoint}" MaxLines="1" Margin="0,5,0,0" TextAlignment="Right" />
<Label Grid.Row="5" Grid.Column="1" Content="Actual Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="5" Width="125" Grid.Column="2" Text="{Binding ProcessValue}" MaxLines="1" Margin="0,5,0,0" IsReadOnly="True" TextAlignment="Right" />
<Button Grid.Row="6" Grid.Column="1" Command="{Binding StartAutomaticCommand}" Content="Start" Margin="0,5,5,0" />
<Button Grid.Row="6" Grid.Column="2" Command="{Binding StopAutomaticCommand}" Content="Stop" Margin="5,5,0,0" />
<HMIToolkit:BinaryValveControl Grid.Column="0" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="center" VerticalAlignment="Center" DataContext="{Binding Path=VacuumValveControlVm}"/>
</Grid>
</Page>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml

View File

@@ -0,0 +1,49 @@
<Page x:Class="InfineonHMI.EtchingStation1Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:InfineonHMI"
xmlns:hmiToolkit="clr-namespace:HMIToolkit"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:EtchingStation1PageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="EtchingStationPage">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Etching Station 1" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="35" />
<hmiToolkit:BinaryValveControl Grid.Column="0" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding VacuumValveControlEtching1Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding DoorValveControlEtching1Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="2" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckUnlockValveLeftEtching1Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="0" Grid.Row="3" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckUnlockValveRightEtching1Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="1" Grid.Row="3" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckEjectValveFrontEtching1Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="2" Grid.Row="3" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckEjectValveBackEtching1Vm}"/>
<Button Grid.Row="1" Grid.Column="3" Content="Teller Entriegeln" DataContext="{Binding ChuckUnlockCmdButtonEtching1Vm}" HorizontalAlignment="Center" Width="320" Height="140" FontSize="30" />
<Button Grid.Row="2" Grid.Column="3" Content="Teller Verriegeln" DataContext="{Binding ChuckLockCmdButtonEtching1Vm}" HorizontalAlignment="Center" Width="320" Height="140" FontSize="30"/>
<Button Grid.Row="3" Grid.Column="3" Content="Teller Auswerfen" DataContext="{Binding ChuckEjectCmdButtonEtching1Vm}" HorizontalAlignment="Center" Width="320" Height="140" FontSize="30"/>
</Grid>
</Page>

View File

@@ -0,0 +1,22 @@
using System.Windows.Controls;
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml
/// </summary>
public partial class EtchingStation1Page : Page
{
public EtchingStation1Page()
{
InitializeComponent();
// Unloaded += OnUnloaded;
}
private void OnUnloaded(object? sender, EventArgs e)
{
var disposable = DataContext as IDisposable;
disposable?.Dispose();
}
}
}

View File

@@ -0,0 +1,48 @@
<Page x:Class="InfineonHMI.EtchingStation2Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:InfineonHMI"
xmlns:hmiToolkit="clr-namespace:HMIToolkit"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:EtchingStation2PageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="EtchingStationPage">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Etching Station 2" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="35" />
<hmiToolkit:BinaryValveControl Grid.Column="0" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding VacuumValveControlEtching2Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding DoorValveControlEtching2Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="2" Grid.Row="0" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckUnlockValveLeftEtching2Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="0" Grid.Row="3" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckUnlockValveRightEtching2Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="1" Grid.Row="3" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckEjectValveFrontEtching2Vm}"/>
<hmiToolkit:BinaryValveControl Grid.Column="2" Grid.Row="3" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ChuckEjectValveBackEtching2Vm}"/>
<Button Grid.Row="1" Grid.Column="3" Content="Teller Entriegeln" DataContext="{Binding ChuckUnlockCmdButtonEtching2Vm}" HorizontalAlignment="Center" Width="320" Height="140" FontSize="30"/>
<Button Grid.Row="2" Grid.Column="3" Content="Teller Verriegeln" DataContext="{Binding ChuckLockCmdButtonEtching2Vm}" HorizontalAlignment="Center" Width="320" Height="140" FontSize="30"/>
<Button Grid.Row="3" Grid.Column="3" Content="Teller Auswerfen" DataContext="{Binding ChuckEjectCmdButtonEtching2Vm}" HorizontalAlignment="Center" Width="320" Height="140" FontSize="30"/>
</Grid>
</Page>

View File

@@ -0,0 +1,22 @@
using System.Windows.Controls;
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml
/// </summary>
public partial class EtchingStation2Page : Page
{
public EtchingStation2Page()
{
InitializeComponent();
// Unloaded += OnUnloaded;
}
private void OnUnloaded(object? sender, EventArgs e)
{
var disposable = DataContext as IDisposable;
disposable?.Dispose();
}
}
}

View File

@@ -1,9 +1,9 @@
<Page x:Class="UniperHMI.EventsPage"
<Page x:Class="InfineonHMI.EventsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:EventsPageVM, IsDesignTimeCreatable=False}"
d:DesignHeight="450" d:DesignWidth="800"

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI;
namespace InfineonHMI;
/// <summary>
/// Interaktionslogik für EventsPage.xaml

View File

@@ -1,49 +1,52 @@
<Page x:Class="UniperHMI.HighVoltageStationPage"
<Page x:Class="InfineonHMI.HighVoltageStationPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
xmlns:hmiToolkit="clr-namespace:HMIToolkit"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
d:DataContext="{d:DesignInstance Type=local:HighVoltageStationPageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="Blablubb">
Title="High Voltage Test Station">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="1" Grid.Column="1" Content="Requested Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<ComboBox Grid.Row="1" Grid.Column="2" IsEnabled="{Binding CanChangeControlMode}" ItemsSource="{Binding ReqBMSControlModes}" SelectedItem="{Binding SelectedControlMode}"/>
<Label Grid.Row="0" Grid.Column="0" Content="Hochvolt Test Station Heiß" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="35"/>
<Label Grid.Row="0" Grid.Column="3" Content="Hochvolt Test Station Kalt" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="35"/>
<Border Grid.Row="0" Grid.Column="2" Grid.RowSpan="9" BorderBrush="White" BorderThickness="0,0,1,0"></Border>
<Border Grid.Row="0" Grid.Column="3" Grid.RowSpan="9" BorderBrush="White" BorderThickness="1,0,0,0"></Border>
<Label Grid.Row="2" Grid.Column="1" Content="Current Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding BmsControlMode}" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<hmiToolkit:BinaryValveControl Grid.Column="0" Grid.Row="1" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding DoorValveHotControlVm }"/>
<hmiToolkit:BinaryValveControl Grid.Column="3" Grid.Row="1" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding DoorValveColdControlVm }"/>
<hmiToolkit:BinaryValveControl Grid.Column="1" Grid.Row="1" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding TestChamberHotValveVm }"/>
<hmiToolkit:BinaryValveControl Grid.Column="4" Grid.Row="1" Grid.RowSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding TestChamberColdValveVm }"/>
<Label Grid.Row="3" Grid.Column="1" Content="Status:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="3" Width="125" Grid.Column="2" Text="Charging" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<Label Grid.Row="4" Grid.Column="1" Content="Target Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="4" Width="125" Grid.Column="2" Text="{Binding Setpoint}" MaxLines="1" Margin="0,5,0,0" TextAlignment="Right" />
<Label Grid.Row="5" Grid.Column="1" Content="Actual Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="5" Width="125" Grid.Column="2" Text="{Binding ProcessValue}" MaxLines="1" Margin="0,5,0,0" IsReadOnly="True" TextAlignment="Right" />
<Label Grid.Column="2" Grid.Row="1" FontSize="40" Content="Solltemperatur" HorizontalAlignment="left" Margin="5"/>
<hmiToolkit:AnalogValue Grid.Column="2" Grid.Row="1" Height="60" Width="260" HorizontalAlignment="Left" Margin="60" VerticalAlignment="Center" DataContext="{Binding TempSPHotVm}"/>
<Label Grid.Column="5" Grid.Row="1" FontSize="40" Content="Solltemperatur" Margin="5"/>
<hmiToolkit:AnalogValue Grid.Column="5" Grid.Row="1" Height="60" Width="260" Margin="60" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding TempSPColdVm}"/>
<Button Grid.Row="6" Grid.Column="1" Command="{Binding StartAutomaticCommand}" Content="Start" Margin="0,5,5,0" />
<Button Grid.Row="6" Grid.Column="2" Command="{Binding StopAutomaticCommand}" Content="Stop" Margin="5,5,0,0" />
</Grid>
</Page>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml

View File

@@ -1,11 +1,11 @@
<Page xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="UniperHMI.HotCoolPlatePage"
<Page xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="InfineonHMI.HotCoolPlatePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
d:DataContext="{d:DesignInstance Type=local:HotCoolPlatePageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="HotCoolPlatePage">
@@ -19,8 +19,6 @@
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
@@ -33,62 +31,70 @@
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.RowSpan="9" Grid.Column="5" BorderBrush="WhiteSmoke" BorderThickness="2,0,0,0" />
<Border Grid.Row="0" Grid.RowSpan="9" Grid.Column="4" BorderBrush="WhiteSmoke" BorderThickness="0,0,2,0" />
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Content="Heizplatte" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Label Grid.Row="0" Grid.Column="5" Grid.ColumnSpan="5" Content="Kühlplatte" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Border Grid.Row="0" Grid.RowSpan="9" Grid.Column="4" BorderBrush="WhiteSmoke" BorderThickness="2,0,0,0" />
<Border Grid.Row="0" Grid.RowSpan="9" Grid.Column="3" BorderBrush="WhiteSmoke" BorderThickness="0,0,2,0" />
<Label Grid.Row="0" Grid.Column="0" FontSize="35" Content="Heizplatte" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
<Label Grid.Row="0" Grid.Column="4" FontSize="35" Content="Kühlplatte" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
<Label Grid.Row="2" Grid.Column="0" Content="Belegung:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<Label Grid.Row="2" Grid.Column="5" Content="Belegung:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<Label Grid.Row="1" Grid.Column="0" Content="Temperatur Soll" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<TextBox Grid.Row="1" Grid.Column="1" Margin="10" Text="{Binding HotPlateTargetTemperature}"/>
<Label Grid.Row="1" Grid.Column="2" Content="Temperatur Ist" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<TextBox Grid.Row="1" Grid.Column="3" Margin="10" Text="{Binding HotPlateActualTemperature}" IsEnabled="False"/>
<Label Grid.Row="1" Grid.Column="5" Content="Temperatur Soll" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<TextBox Grid.Row="1" Grid.Column="6" Margin="10" Text="{Binding CoolPlateTargetTemperature}"/>
<Label Grid.Row="1" Grid.Column="7" Content="Temperatur Ist" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<TextBox Grid.Row="1" Grid.Column="8" Margin="10" Text="{Binding CoolPlateActualTemperature}" IsEnabled="False"/>
<Ellipse Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="2" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="3" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="1" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="2" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="3" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="1" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="2" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="3" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility1}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="2" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility2}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="3" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility3}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="1" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility4}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="2" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility5}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="3" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility6}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="1" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility7}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="2" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility8}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="3" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotplateVisibility9}" VerticalAlignment="Center" Width="120"/>
<Button Grid.Row="0" Grid.Column="1" Content="Einschalten" DataContext="{Binding EnableHotPlateButtonVm}" HorizontalAlignment="Center" Width="280" Height="100" FontSize="35" />
<Button Grid.Row="0" Grid.Column="2" Content="Ausschalten" DataContext="{Binding DisableHotPlateButtonVm}" HorizontalAlignment="Center" Width="280" Height="100" FontSize="35" />
<Ellipse Grid.Column="6" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="7" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="8" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="6" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="7" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="8" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="6" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="7" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="8" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="6" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility1}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="7" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility2}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="8" Grid.Row="3" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility3}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="6" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility4}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="7" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility5}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="8" Grid.Row="5" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility6}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="6" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility7}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="7" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility8}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="8" Grid.Row="7" Grid.RowSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolplateVisibility9}" VerticalAlignment="Center" Width="120"/>
<Button Grid.Row="0" Grid.Column="5" Content="Einschalten" DataContext="{Binding EnableCoolPlateButtonVm}" HorizontalAlignment="Center" Width="280" Height="100" FontSize="35" />
<Button Grid.Row="0" Grid.Column="6" Content="Ausschalten" DataContext="{Binding DisableCoolPlateButtonVm}" HorizontalAlignment="Center" Width="280" Height="100" FontSize="35" />
<Label Grid.Row="2" Grid.Column="0" FontSize="35" Content="Belegung:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<Label Grid.Row="2" Grid.Column="4" FontSize="35" Content="Belegung:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" />
<Label Grid.Row="1" Grid.Column="1" FontSize="40" Content="Temperatur Soll" VerticalAlignment="Top" HorizontalAlignment="Center"/>
<HMIToolkit:AnalogValue Grid.Column="1" Grid.Row="1" Height="80" Width="160" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding HotPlateTargetTemperature}"/>
<Label Grid.Row="1" Grid.Column="2" Content="Temperatur Ist" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="40" />
<HMIToolkit:AnalogValue Grid.Column="2" Grid.Row="1" Height="80" Width="160" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding HotPlateActualTemperature}"/>
<Label Grid.Row="1" Grid.Column="5" Content="Temperatur Soll" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="40"/>
<HMIToolkit:AnalogValue Grid.Column="5" Grid.Row="1" Height="80" Width="160" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding CoolPlateTargetTemperature}"/>
<Label Grid.Row="1" Grid.Column="6" Content="Temperatur Ist" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="40"/>
<HMIToolkit:AnalogValue Grid.Column="6" Grid.Row="1" Height="80" Width="160" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding CoolPlateActualTemperature}"/>
<Ellipse Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="1" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="2" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="0" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="1" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="2" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="0" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="1" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="2" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility1}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="1" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility2}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="2" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility3}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="0" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility4}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="1" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility5}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="2" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility6}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="0" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility7}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="1" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility8}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="2" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding HotPlateVisibility9}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="4" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="5" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="6" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="4" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="5" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="6" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="4" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="5" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="6" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="150" Margin="10" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="150"/>
<Ellipse Grid.Column="4" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility1}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="5" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility2}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="6" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility3}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="4" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility4}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="5" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility5}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="6" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility6}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="4" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility7}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="5" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility8}" VerticalAlignment="Center" Width="120"/>
<Ellipse Grid.Column="6" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="120" Margin="10" Stroke="WhiteSmoke" Fill="Gray" Visibility="{Binding CoolPlateVisibility9}" VerticalAlignment="Center" Width="120"/>
</Grid>
</Page>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml

View File

@@ -1,11 +1,11 @@
<Page x:Class="UniperHMI.KukaRobotPage"
<Page x:Class="InfineonHMI.KukaRobotPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
d:DataContext="{d:DesignInstance Type=local:KukaRobotPageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="KukaRobotPage">
@@ -79,33 +79,32 @@
<Button Grid.Row="5" Grid.Column="0" Command="{Binding ClearStateCommand}" Content="Clear" Margin="15,15,10,15" />
<Button Grid.Row="5" Grid.Column="1" Command="{Binding ResetStateCommand}" Content="Reset" Margin="10,15,15,15" />
<Border Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,4,1,1" Margin="5,5,0,0"/>
<Border Grid.Row="3" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,4,4,1" Margin="0,5,5,0"/>
<Label Grid.Row="3" Grid.Column="2" Content="Offset Abholen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="3" Grid.Column="4" Content="Offset Abholen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="3" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetPick}" Text="{Binding OffsetPick_X}" MaxLines="1" Margin="10,15,10,10" TextAlignment="Right" />
<TextBox Grid.Row="3" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetPick}" Text="{Binding OffsetPick_Y}" MaxLines="1" Margin="10,15,15,10" TextAlignment="Right" />
<Border Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,4,1,1" Margin="5,5,0,0"/>
<Border Grid.Row="2" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,4,4,1" Margin="0,5,5,0"/>
<Label Grid.Row="2" Grid.Column="2" Content="Offset Abholen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="2" Grid.Column="4" Content="Offset Abholen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="2" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetPick}" Text="{Binding OffsetPick_Y}" MaxLines="1" Margin="10,15,15,10" TextAlignment="Right" />
<TextBox Grid.Row="2" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetPick}" Text="{Binding OffsetPick_X}" MaxLines="1" Margin="10,15,15,10" TextAlignment="Right" />
<Border Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,1,1,1" Margin="5,0,0,0"/>
<Border Grid.Row="3" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,1,4,1" Margin="0,0,5,0"/>
<Label Grid.Row="3" Grid.Column="2" Content="Offset Ablegen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="3" Grid.Column="4" Content="Offset Ablegen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="3" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetPlace}" Text="{Binding OffsetPlace_Y}" MaxLines="1" Margin="10,10,15,10" TextAlignment="Right" />
<TextBox Grid.Row="3" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetPlace}" Text="{Binding OffsetPlace_X}" MaxLines="1" Margin="10,10,15,10" TextAlignment="Right" />
<Border Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,1,1,1" Margin="5,0,0,0"/>
<Border Grid.Row="4" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,1,4,1" Margin="0,0,5,0"/>
<Label Grid.Row="4" Grid.Column="2" Content="Offset Ablegen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="4" Grid.Column="4" Content="Offset Ablegen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="4" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetPlace}" Text="{Binding OffsetPlace_X}" MaxLines="1" Margin="10,10,10,10" TextAlignment="Right" />
<TextBox Grid.Row="4" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetPlace}" Text="{Binding OffsetPlace_Y}" MaxLines="1" Margin="10,10,15,10" TextAlignment="Right" />
<Label Grid.Row="4" Grid.Column="2" Content="Offset NIO Abholen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="4" Grid.Column="4" Content="Offset NIO Abholen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="4" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetNIOPick}" Text="{Binding OffsetNIOPick_Y}" MaxLines="1" Margin="10,10,15,10" TextAlignment="Right" />
<TextBox Grid.Row="4" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetNIOPick}" Text="{Binding OffsetNIOPick_X}" MaxLines="1" Margin="10,10,15,10" TextAlignment="Right" />
<Border Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,1,1,1" Margin="5,0,0,0"/>
<Border Grid.Row="5" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,1,4,1" Margin="0,0,5,0"/>
<Label Grid.Row="5" Grid.Column="2" Content="Offset NIO Abholen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="5" Grid.Column="4" Content="Offset NIO Abholen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="5" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetNIOPick}" Text="{Binding OffsetNIOPick_X}" MaxLines="1" Margin="10,10,10,10" TextAlignment="Right" />
<TextBox Grid.Row="5" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetNIOPick}" Text="{Binding OffsetNIOPick_Y}" MaxLines="1" Margin="10,10,15,10" TextAlignment="Right" />
<Border Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,1,1,4" Margin="5,0,0,5"/>
<Border Grid.Row="6" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,1,4,4" Margin="0,0,5,5"/>
<Label Grid.Row="6" Grid.Column="2" Content="Offset NIO Ablegen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="6" Grid.Column="4" Content="Offset NIO Ablegen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="6" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetNIOPlace}" Text="{Binding OffsetNIOPlace_Y}" MaxLines="1" Margin="10,10,15,15" TextAlignment="Right" />
<TextBox Grid.Row="6" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetNIOPlace}" Text="{Binding OffsetNIOPlace_X}" MaxLines="1" Margin="10,10,10,15" TextAlignment="Right" />
<Border Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="4,1,1,4" Margin="5,0,0,5"/>
<Border Grid.Row="5" Grid.Column="4" Grid.ColumnSpan="2" BorderBrush="WhiteSmoke" BorderThickness="1,1,4,4" Margin="0,0,5,5"/>
<Label Grid.Row="5" Grid.Column="2" Content="Offset NIO Ablegen in mm (X):" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
<Label Grid.Row="5" Grid.Column="4" Content="Offset NIO Ablegen in mm (Y):" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="5" Grid.Column="5" IsEnabled="{Binding CanChangeOffsetNIOPlace}" Text="{Binding OffsetNIOPlace_Y}" MaxLines="1" Margin="10,10,15,15" TextAlignment="Right" />
<TextBox Grid.Row="5" Grid.Column="3" IsEnabled="{Binding CanChangeOffsetNIOPlace}" Text="{Binding OffsetNIOPlace_X}" MaxLines="1" Margin="10,10,15,15" TextAlignment="Right" />
@@ -116,8 +115,55 @@
<TextBox Grid.Row="6" Grid.Column="1" IsEnabled="{Binding CanChangeHotPlateIndex}" Text="{Binding HotplateIndex}" MaxLines="1" Margin="10,15,15,10" TextAlignment="Right" />
<TextBox Grid.Row="7" Grid.Column="1" IsEnabled="{Binding CanChangeCoolPlateIndex}" Text="{Binding CoolplateIndex}" MaxLines="1" Margin="10,10,15,15" TextAlignment="Right" />
<Label Grid.Row="6" Grid.Column="3" Content="Magazinbelegung: " VerticalAlignment="Center" HorizontalAlignment="Center" />
<Grid Grid.Column ="4" Grid.Row="6" Grid.RowSpan="3" Grid.ColumnSpan="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Tellerplatz 1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10" />
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2" Content="Tellerplatz 2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10" />
<Label Grid.Row="0" Grid.Column="6" Grid.ColumnSpan="2" Content="Tellerplatz 3" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="Tellerplatz 4" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10" />
<Label Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="2" Content="Tellerplatz 5" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10" />
<Label Grid.Row="3" Grid.Column="6" Grid.ColumnSpan="2" Content="Tellerplatz 6" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10" />
<Ellipse Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="85" Margin="0" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="85"/>
<Ellipse Grid.Column="3" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="85" Margin="0" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="85"/>
<Ellipse Grid.Column="6" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="85" Margin="0" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="85"/>
<Ellipse Grid.Column="0" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="85" Margin="0" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="85"/>
<Ellipse Grid.Column="3" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="85" Margin="0" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="85"/>
<Ellipse Grid.Column="6" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="85" Margin="0" Stroke="WhiteSmoke" Fill="WhiteSmoke" VerticalAlignment="Center" Width="85"/>
<Ellipse Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="80" Margin="0" Stroke="WhiteSmoke" Fill="DarkCyan" Visibility="{Binding MagazinPlace1}" VerticalAlignment="Center" Width="80"/>
<Ellipse Grid.Column="3" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="80" Margin="0" Stroke="WhiteSmoke" Fill="DarkCyan" Visibility="{Binding MagazinPlace2}" VerticalAlignment="Center" Width="80"/>
<Ellipse Grid.Column="6" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="80" Margin="0" Stroke="WhiteSmoke" Fill="DarkCyan" Visibility="{Binding MagazinPlace3}" VerticalAlignment="Center" Width="80"/>
<Ellipse Grid.Column="0" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="80" Margin="0" Stroke="WhiteSmoke" Fill="DarkCyan" Visibility="{Binding MagazinPlace4}" VerticalAlignment="Center" Width="80"/>
<Ellipse Grid.Column="3" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="80" Margin="0" Stroke="WhiteSmoke" Fill="DarkCyan" Visibility="{Binding MagazinPlace5}" VerticalAlignment="Center" Width="80"/>
<Ellipse Grid.Column="6" Grid.Row="4" Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Height="80" Margin="0" Stroke="WhiteSmoke" Fill="DarkCyan" Visibility="{Binding MagazinPlace6}" VerticalAlignment="Center" Width="80"/>
</Grid>
</Grid>
</Page>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml

View File

@@ -0,0 +1,163 @@
<Page x:Class="InfineonHMI.MachineOverviewPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:uniperHmi="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=uniperHmi:MachineOverviewPageVM, IsDesignTimeCreatable=True}"
Title="Production Overview">
<Viewbox Stretch="none">
<Grid Width="3840" Height="1650">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.12*"/>
<ColumnDefinition Width="0.93*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="25 0 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Grid.Row="0"
Margin="5"
FontSize="36"
FontFamily="Arial"
Content="Trayfeeder&#xD;&#xA;Ein-/Ausgabe"
Command="{Binding TrayfeederPageClickedCommand}"/>
<Button Grid.Row="1"
Margin="5"
FontSize="39"
Content="Ausrichtstation"
Command="{Binding AlignerPageClickedCommand}"/>
<Button Grid.Row="2"
Margin="5"
FontSize="36"
Content="Ätzer 1"
Command="{Binding Etching1PageClickedCommand}"/>
<Button Grid.Row="3"
Margin="5"
FontSize="36"
Content="Ätzer 2"
Command="{Binding Etching2PageClickedCommand}"/>
<Button Grid.Row="4"
Margin="5"
FontSize="36"
Content="HV Test"
Command="{Binding HVTestPageClickedCommand}"/>
<Button Grid.Row="5"
Margin="5"
FontSize="36"
Content="Heiz-&#xD;&#xA;/Kühlplatte"
Command="{Binding HotCoolplatePageClickedCommand}"/>
<Button Grid.Row="6"
Margin="5"
FontSize="36"
Content="NOK Station"
Command="{Binding NIOStationPageClickedCommand}"/>
<Border Grid.Row="7"
BorderBrush="White"
BorderThickness="0,5,0,0"/>
<Button Grid.Row="7"
Margin="5,15,5,5"
FontSize="36" Content="Kuka Roboter"
Command="{Binding KukaPageClickedCommand}"/>
<Button Grid.Row="8"
Margin="5"
FontSize="36"
FontFamily="Arial"
Content="Medienschrank"
Command="{Binding MediaCabinetPageClickedCommand}"/>
</Grid>
<!-- DETAIL PAGE -->
<Frame x:Name="DetailFrame"
Grid.Column="1"
NavigationUIVisibility="Hidden"
Content="{Binding CurrentDetailPage}"/>
<Image Grid.Column="1" Source="/Anlagenuebersicht.png" Stretch="Fill" Height="1504" Width="1936"/>
<Button Command="{Binding TrayfeederPageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="2203,572,820,780"/>
<Button Command="{Binding KukaPageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="1822,610,1380,780"/>
<Button Command="{Binding Etching1PageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="1480,819,1749,644" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-23.091"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button Command="{Binding Etching2PageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="1431,473,1770,971" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="24.991"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button Command="{Binding HVTestPageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="1706,183,1472,1202" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-105.32"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button Command="{Binding HotCoolplatePageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="2039,316,1175,1106" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-56.721"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button Command="{Binding MediaCabinetPageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="878,565,2350,641"/>
<Button Command="{Binding AlignerPageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="1633,1048,1594,474" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="27.441"/>
<TranslateTransform/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button Command="{Binding NIOStationPageClickedCommand}" Background="Transparent" Grid.Column="1" Margin="1707,932,1543,601" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="27.441"/>
<TranslateTransform/>
</TransformGroup>
</Button.RenderTransform>
</Button>
</Grid>
</Viewbox>
</Page>

View File

@@ -0,0 +1,22 @@
using System.Windows.Controls;
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml
/// </summary>
public partial class MachineOverviewPage : Page
{
public MachineOverviewPage()
{
InitializeComponent();
// Unloaded += OnUnloaded;
}
private void OnUnloaded(object? sender, EventArgs e)
{
var disposable = DataContext as IDisposable;
disposable?.Dispose();
}
}
}

View File

@@ -1,49 +1,45 @@
<Page x:Class="UniperHMI.MediaCabinetPage"
<Page x:Class="InfineonHMI.MediaCabinetPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
xmlns:common="clr-namespace:Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="Blablubb">
d:DataContext="{d:DesignInstance Type=local:MediaCabinetPageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="1600" d:DesignWidth="3800"
Title="Media Cabinet">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition />
<RowDefinition Height="2*"/>
<RowDefinition Height="33*" />
<RowDefinition Height="33*" />
<RowDefinition Height="33*" />
</Grid.RowDefinitions>
<Label Grid.Row="1" Grid.Column="1" Content="Requested Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<ComboBox Grid.Row="1" Grid.Column="2" IsEnabled="{Binding CanChangeControlMode}" ItemsSource="{Binding ReqBMSControlModes}" SelectedItem="{Binding SelectedControlMode}"/>
<Label Grid.Row="0" Grid.Column="0" Content="Mediacabinet Page" VerticalAlignment="Center" HorizontalAlignment="Left" />
<Label Grid.Row="2" Grid.Column="1" Content="Current Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding BmsControlMode}" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<common:MediaContainer Grid.Row="1" Grid.Column="0" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container1Vm}"/>
<common:MediaContainer Grid.Row="2" Grid.Column="0" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container2Vm}"/>
<common:MediaContainer Grid.Row="3" Grid.Column="0" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container3Vm}"/>
<Label Grid.Row="3" Grid.Column="1" Content="Status:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="3" Width="125" Grid.Column="2" Text="Charging" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<Label Grid.Row="4" Grid.Column="1" Content="Target Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="4" Width="125" Grid.Column="2" Text="{Binding Setpoint}" MaxLines="1" Margin="0,5,0,0" TextAlignment="Right" />
<common:MediaContainer Grid.Row="1" Grid.Column="1" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container4Vm}"/>
<common:MediaContainer Grid.Row="2" Grid.Column="1" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container5Vm}"/>
<common:MediaContainer Grid.Row="3" Grid.Column="1" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container6Vm}"/>
<Label Grid.Row="5" Grid.Column="1" Content="Actual Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="5" Width="125" Grid.Column="2" Text="{Binding ProcessValue}" MaxLines="1" Margin="0,5,0,0" IsReadOnly="True" TextAlignment="Right" />
<Button Grid.Row="6" Grid.Column="1" Command="{Binding StartAutomaticCommand}" Content="Start" Margin="0,5,5,0" />
<Button Grid.Row="6" Grid.Column="2" Command="{Binding StopAutomaticCommand}" Content="Stop" Margin="5,5,0,0" />
<common:MediaContainer Grid.Row="1" Grid.Column="2" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container7Vm}"/>
<common:MediaContainer Grid.Row="2" Grid.Column="2" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container8Vm}"/>
<common:MediaContainer Grid.Row="3" Grid.Column="2" Height="400" Width="300" Margin="10" HorizontalAlignment="Center" DataContext="{Binding Container9Vm}"/>
</Grid>
</Page>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml

View File

@@ -3,12 +3,12 @@
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:local="clr-namespace:UniperHMI"
xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="UniperHMI.NIOStationPage"
xmlns:local="clr-namespace:InfineonHMI"
xmlns:HMIToolkit="clr-namespace:HMIToolkit" x:Class="InfineonHMI.NIOStationPage"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type local:AutomaticModePageVM}}"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type local:NIOStationPageVM}}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="Blablubb">
Title="NIOStationPage">
<Grid>
<Grid.ColumnDefinitions>
@@ -20,8 +20,6 @@
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
@@ -35,8 +33,13 @@
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Spannzylinder: " HorizontalAlignment="Left" VerticalAlignment="Center"/>
<HMIToolkit:BinaryValveControl DataContext="{Binding CylinderNIOPlateVM}" Grid.Column="0" HorizontalAlignment="Center" Grid.Row="1" Grid.RowSpan="4" VerticalAlignment="Top" />
<Label Grid.Row="0" Grid.Column="0" Content="NIO Station" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<HMIToolkit:BinaryValveControl DataContext="{Binding ClampDiagValveVm}" Grid.Column="0" HorizontalAlignment="Center" Grid.Row="1" Grid.RowSpan="4" VerticalAlignment="Top" />
<HMIToolkit:BinaryValveControl DataContext="{Binding ClampAcrossValveVm}" Grid.Column="1" HorizontalAlignment="Center" Grid.Row="1" Grid.RowSpan="4" VerticalAlignment="Top" />
<Button Grid.Row="1" Grid.Column="2" Content="Tray Fixieren" DataContext="{Binding ClampCmdButtonVm}" HorizontalAlignment="Center" Width="180" Height="60" />
<Button Grid.Row="2" Grid.Column="2" Content="Tray Lösen" DataContext="{Binding UnclampCmdButtonVm}" HorizontalAlignment="Center" Width="180" Height="60" />
</Grid>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml

View File

@@ -0,0 +1,100 @@
<Page x:Class="InfineonHMI.ProductionOverviewPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:uniperHmi="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=uniperHmi:ProductionOverviewPageVM, IsDesignTimeCreatable=True}"
Title="Production Overview">
<Viewbox Stretch="none">
<Grid Width="3840" Height="1650">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.12*"/>
<ColumnDefinition Width="0.93*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="25 0 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Grid.Row="0"
Margin="5"
FontSize="36"
FontFamily="Arial"
Content="Trayfeeder&#xD;&#xA;Ein-/Ausgabe"
Command="{Binding TrayfeederPageClickedCommand}"/>
<Button Grid.Row="1"
Margin="5"
FontSize="39"
Content="Ausrichtstation"
Command="{Binding AlignerPageClickedCommand}"/>
<Button Grid.Row="2"
Margin="5"
FontSize="36"
Content="Ätzer 1"
Command="{Binding Etching1PageClickedCommand}"/>
<Button Grid.Row="3"
Margin="5"
FontSize="36"
Content="Ätzer 2"
Command="{Binding Etching2PageClickedCommand}"/>
<Button Grid.Row="4"
Margin="5"
FontSize="36"
Content="HV Test"
Command="{Binding HVTestPageClickedCommand}"/>
<Button Grid.Row="5"
Margin="5"
FontSize="36"
Content="Heiz-&#xD;&#xA;/Kühlplatte"
Command="{Binding HotCoolplatePageClickedCommand}"/>
<Button Grid.Row="6"
Margin="5"
FontSize="36"
Content="NOK Station"
Command="{Binding NIOStationPageClickedCommand}"/>
<Border Grid.Row="7"
BorderBrush="White"
BorderThickness="0,5,0,0"/>
<Button Grid.Row="7"
Margin="5,15,5,5"
FontSize="36" Content="Kuka Roboter"
Command="{Binding KukaPageClickedCommand}"/>
<Button Grid.Row="8"
Margin="5"
FontSize="36"
FontFamily="Arial"
Content="Medienschrank"
Command="{Binding MediaCabinetPageClickedCommand}"/>
</Grid>
<!-- DETAIL PAGE -->
<Frame x:Name="DetailFrame"
Grid.Column="1"
NavigationUIVisibility="Hidden"
Content="{Binding CurrentDetailPage}"/>
</Grid>
</Viewbox>
</Page>

View File

@@ -0,0 +1,22 @@
using System.Windows.Controls;
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml
/// </summary>
public partial class ProductionOverviewPage : Page
{
public ProductionOverviewPage()
{
InitializeComponent();
// Unloaded += OnUnloaded;
}
private void OnUnloaded(object? sender, EventArgs e)
{
var disposable = DataContext as IDisposable;
disposable?.Dispose();
}
}
}

View File

@@ -0,0 +1,192 @@
<Page x:Class="InfineonHMI.Pages.Views.ReceipePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:uniperHmi="clr-namespace:InfineonHMI"
xmlns:common="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=uniperHmi:ReceipePageVM, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
d:DesignHeight="1900" d:DesignWidth="3800">
<Page.Resources>
<CollectionViewSource x:Key="FlowStations" Source="{Binding FlowStationsVm}"></CollectionViewSource>
</Page.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="33*"/>
<ColumnDefinition Width="33*"/>
<ColumnDefinition Width="17*"/>
<ColumnDefinition Width="17*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Button Grid.Row="0" x:Name="BtnReadReceipeFile"
Content="Rezept aus Datei Laden"
Width="120"
Command="{Binding ReadReceipeFileCommand}"
HorizontalAlignment="Left"
Margin="10"/>
<Button Grid.Row="0" x:Name="BtnWriteReceipeFile"
Content="Rezept speichern"
Width="120"
Command="{Binding WriteReceipeFileCommand}"
HorizontalAlignment="Left"
Margin="10"/>
<Button Grid.Row="0" x:Name="BtnWriteToPlc"
Content="Sende Daten an SPS"
Width="120"
Command="{Binding WriteToPlcCommand}"
HorizontalAlignment="Left"
Margin="10"/>
</StackPanel>
<Label Grid.Column="0" Grid.Row="1" Content="Allgemein: " VerticalAlignment="Center" FontSize="24"></Label>
<common:ParamControlFloat Grid.Column="0" Grid.Row="2" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding CameraProgramsVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="3" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding ChucksVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="4" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding GripperVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="6" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding DiameterVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="7" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding ThicknessVm}"/>
<Label Grid.Column="0" Grid.Row="9" Content="Heiz-/ Kühlplatte: " VerticalAlignment="Center" FontSize="24"></Label>
<common:ParamControlFloat Grid.Column="0" Grid.Row="10" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding RestingTimeHotplateVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="11" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding TargetTemperatureHotplateVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="12" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding RestingTimeCoolplateVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="13" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding TargetTemperatureCoolplateVm}"/>
<Label Grid.Column="0" Grid.Row="15" Content="Ätzerparameter: " VerticalAlignment="Center" FontSize="24"></Label>
<common:ParamControlFloat Grid.Column="0" Grid.Row="16" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding PermissibleBeamParamDeviationsVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="17" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding TimeIntervallBeamCheckVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="18" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding RadialPosLowerWaterJetVm}"/>
<common:ParamControlFloat Grid.Column="0" Grid.Row="19" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding ChuckRpmVm}"/>
<Label Grid.Column="1" Grid.Row="1" Content="Hochvolt Parameter: " VerticalAlignment="Center" FontSize="24"></Label>
<common:ParamControlFloat Grid.Column="1" Grid.Row="2" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvmaxTestCurrentVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="3" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding Hvn2PrePurgeTimeVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="4" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvnumRetriesVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="5" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvpolarityVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="6" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvrampTimeVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="7" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvtestFrequencyVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="8" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvTestOkCurrentVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="9" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvTestOkVoltageVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="10" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvtestTemperatureVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="11" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvtestVoltageVm}"/>
<common:ParamControlFloat Grid.Column="1" Grid.Row="12" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" DataContext="{Binding HvtestPressureN2Vm}"/>
<Label Grid.Column="1" Grid.Row="14" Content="Durchlaufrezept Tabelle"></Label>
<Grid Grid.Column="1" Grid.Row="15" Grid.RowSpan="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<DataGrid Grid.Column="0" ItemsSource="{Binding FlowReceipeEntries}"
SelectedItem="{Binding SelectedFlowReceipeEntry, UpdateSourceTrigger=PropertyChanged}"
AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="NodeID" Binding="{Binding NodeId}"/>
<DataGridTextColumn Header="Priorität" Binding="{Binding Priority}"/>
<DataGridComboBoxColumn Header="Station"
ItemsSource="{Binding Source={StaticResource FlowStations}}"
SelectedValueBinding="{Binding Station, NotifyOnTargetUpdated=True, NotifyOnSourceUpdated=True}"/>
<DataGridTextColumn Header="Max. Wdh." Binding="{Binding MaxRetries}"/>
<DataGridTextColumn Header="Nächste Node" Binding="{Binding NextNodeSuccess}"/>
<DataGridTextColumn Header="Nächste Node bei Wdh." Binding="{Binding NextNodeRetry}"/>
<DataGridTextColumn Header="Nächste Node bei Fail" Binding="{Binding NextNodeFail}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Column="1" Orientation="Vertical">
<Button Content="+" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding AddFlowReceipeEntryCommand}" IsEnabled="{Binding CanAddFlowReceipeEntry}"></Button>
<Button Content="-" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding RemoveFlowReceipeEntryCommand}" IsEnabled="{Binding CanRemoveFlowReceipeEntry}"></Button>
<Button Content="↑" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding FlowReceipeEntryUpCommand}"></Button>
<Button Content="↓" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding FlowReceipeEntryDownCommand}"></Button>
</StackPanel>
</Grid>
<Label Grid.Column="2" Grid.Row="1" Content="Traypositionen" FontSize="24"></Label>
<Grid Grid.Column="2" Grid.Row="1" Grid.RowSpan="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<DataGrid Grid.Column="0" ItemsSource="{Binding TrayPositions}"
SelectedItem="{Binding SelectedTrayPosition}"
AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Pos Nr." Binding="{Binding PosId}"/>
<DataGridTextColumn Header="Pos X" Binding="{Binding PosX}"/>
<DataGridTextColumn Header="Pos Y" Binding="{Binding PosY}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Column="1" Orientation="Vertical">
<Button Content="+" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding AddTrayPositionCommand}" IsEnabled="{Binding CanAddTrayPosition}"></Button>
<Button Content="-" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding RemoveTrayPositionCommand}" IsEnabled="{Binding CanRemoveTrayPosition}"></Button>
<Button Content="↑" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding TrayPositionUpCommand}"></Button>
<Button Content="↓" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding TrayPositionDownCommand}"></Button>
</StackPanel>
</Grid>
<Label Grid.Column="2" Grid.Row="9" Content="Ätzschritte Mecademic Roboter"></Label>
<Grid Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="10" Grid.RowSpan="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<DataGrid Grid.Column="0" ItemsSource="{Binding EtcherRobotSteps}"
SelectedItem="{Binding SelectedEtchRobotStep, UpdateSourceTrigger=PropertyChanged}"
AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Pos X" Binding="{Binding PosX}"/>
<DataGridTextColumn Header="Pos Y" Binding="{Binding PosY}"/>
<DataGridTextColumn Header="Pos Z" Binding="{Binding PosZ}"/>
<DataGridTextColumn Header="Winkel Alpha" Binding="{Binding AngleAlpha}"/>
<DataGridTextColumn Header="Geschw." Binding="{Binding MoveSpeed}"/>
<DataGridTextColumn Header="Wartezeit" Binding="{Binding Delay}"/>
<DataGridTextColumn Header="Medium" Binding="{Binding Medium}"/>
<DataGridCheckBoxColumn Header="Oberwasseer" Binding="{Binding WaterFromAbove}"/>
<DataGridCheckBoxColumn Header="Unterwasser" Binding="{Binding WaterFromBelow}"/>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Column="1" Orientation="Vertical">
<Button Content="+" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding AddEtchRobotStepCommand}" IsEnabled="{Binding CanAddEtchRobotStep}"></Button>
<Button Content="-" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding RemoveEtchRobotStepCommand}" IsEnabled="{Binding CanRemoveEtchRobotStep}"></Button>
<Button Content="↑" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding EtchRobotStepUpCommand}"></Button>
<Button Content="↓" FontSize="24" Width="60" Height="60" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10" Command="{Binding EtchRobotStepDownCommand}"></Button>
</StackPanel>
</Grid>
</Grid>
</Page>

View File

@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace InfineonHMI.Pages.Views
{
/// <summary>
/// Receipes Overview Page
/// </summary>
public partial class ReceipePage : Page
{
public ReceipePage()
{
InitializeComponent();
}
}
}

View File

@@ -1,49 +1,33 @@
<Page x:Class="UniperHMI.TrayFeederPage"
<Page x:Class="InfineonHMI.TrayFeederPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:AutomaticModePageVM, IsDesignTimeCreatable=True}"
d:DataContext="{d:DesignInstance Type=local:TrayFeederPageVM, IsDesignTimeCreatable=True}"
d:DesignHeight="800" d:DesignWidth="1850"
Title="Blablubb">
Title="Trayfeeder">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="1" Grid.Column="1" Content="Requested Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<ComboBox Grid.Row="1" Grid.Column="2" IsEnabled="{Binding CanChangeControlMode}" ItemsSource="{Binding ReqBMSControlModes}" SelectedItem="{Binding SelectedControlMode}"/>
<Label Grid.Row="2" Grid.Column="1" Content="Current Control Mode:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding BmsControlMode}" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<Label Grid.Row="3" Grid.Column="1" Content="Status:" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="3" Width="125" Grid.Column="2" Text="Charging" MaxLines="1" IsReadOnly="True" TextAlignment="Right"/>
<Label Grid.Row="4" Grid.Column="1" Content="Target Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox Grid.Row="4" Width="125" Grid.Column="2" Text="{Binding Setpoint}" MaxLines="1" Margin="0,5,0,0" TextAlignment="Right" />
<Label Grid.Row="5" Grid.Column="1" Content="Actual Power (W):" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Grid.Row="5" Width="125" Grid.Column="2" Text="{Binding ProcessValue}" MaxLines="1" Margin="0,5,0,0" IsReadOnly="True" TextAlignment="Right" />
<Button Grid.Row="6" Grid.Column="1" Command="{Binding StartAutomaticCommand}" Content="Start" Margin="0,5,5,0" />
<Button Grid.Row="6" Grid.Column="2" Command="{Binding StopAutomaticCommand}" Content="Stop" Margin="5,5,0,0" />
<Label Grid.Row="0" Grid.Column="0" Content="TrayFeederPage" VerticalAlignment="Center" HorizontalAlignment="Left" />
</Grid>
</Page>

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für AutomaticModePage.xaml
@@ -10,13 +10,7 @@ namespace UniperHMI
public TrayFeederPage()
{
InitializeComponent();
// Unloaded += OnUnloaded;
}
private void OnUnloaded(object? sender, EventArgs e)
{
var disposable = DataContext as IDisposable;
disposable?.Dispose();
}
}
}

View File

@@ -1,18 +1,34 @@
<Page x:Class="UniperHMI.SettingsPage"
<Page x:Class="InfineonHMI.SettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:UniperHMI"
xmlns:local="clr-namespace:InfineonHMI"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance Type=local:SettingsPageVM}"
Title="SettingsPageView">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button x:Name="BtnReadIni"
Content="Ini Datei einlesen"
Width="120"
HorizontalAlignment="Left"
Margin="10"/>
<!-- {d:SampleData ItemCount=5} -->
<!--<DataGrid d:ItemsSource="{Binding CollectionView.View}"/>-->
<TreeView x:Name="treeview" ItemsSource="{Binding RootItem}" SelectedValuePath="Value" MinWidth="200" >
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding SubEntries}">

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls;
namespace UniperHMI
namespace InfineonHMI
{
/// <summary>
/// Interaktionslogik für SettingsPageView.xaml

View File

@@ -7,7 +7,7 @@ using TwinCAT.Ads.TypeSystem;
using TwinCAT.TypeSystem;
using Heisig.HMI.AdsManager;
namespace UniperHMI
namespace InfineonHMI
{
public partial class SettingsEntry : ObservableObject
{

View File

@@ -2,6 +2,7 @@
"AutomaticModeVarName": "GVL_SCADA.stAutomaticModeHMI",
"String1VarName": "GVL_SCADA.stHMIInterface",
"KukaRobotVarName": "GVL_SCADA.stMachine.stKukaRobot",
"Module1VarName": ".stHMIInterfaceModule1",
"Module2VarName": ".stHMIInterfaceModule2",
"Module3VarName": ".stHMIInterfaceModule3"

63
uniper_hmi_old/.gitattributes vendored Normal file
View File

@@ -0,0 +1,63 @@
###############################################################################
# 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

367
uniper_hmi_old/.gitignore vendored Normal file
View File

@@ -0,0 +1,367 @@
## 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

View File

@@ -0,0 +1,25 @@
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

98
uniper_hmi_old/README.md Normal file
View File

@@ -0,0 +1,98 @@
# 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
```

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View File

@@ -0,0 +1,17 @@
<Application x:Class="InfineonHMI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:InfineonHMI">
<Application.Resources>
<!-- MahApps Metro style themes -->
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Dark.Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,42 @@
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<MainWindow>();
services.AddSingleton<MainWindowVM>();
services.AddSingleton<IAdsManager, AdsManager>();
services.AddSingleton<TcEventLogger>();
})
.Build();
}
protected override async void OnStartup(StartupEventArgs e)
{
await AppHost!.StartAsync();
var startupForm = AppHost.Services.GetRequiredService<MainWindow>();
startupForm.Show();
base.OnStartup(e);
}
protected override async void OnExit(ExitEventArgs e)
{
await AppHost!.StopAsync();
base.OnExit(e);
}
}

View File

@@ -0,0 +1,10 @@
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)
)]

View File

@@ -0,0 +1,127 @@
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
{
/// <summary>
/// Serializes an object.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="serializableObject"></param>
/// <param name="fileName"></param>
/// <param name="encrypt"></param>
/// <param name="rootElementName"></param>
public static void SerializeObject<T>(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);
}
}
/// <summary>
/// Deserializes an xml file into an object list
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="fileName"></param>
/// <param name="decrypt"></param>
/// <param name="rootElementName"></param>
/// <returns></returns>
///
///
public static T DeSerializeObject<T>(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;
}
}
}

View File

@@ -0,0 +1,83 @@
<UserControl x:Class="Common.MediaContainer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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: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">
<UserControl.Resources>
<HMIToolkit:FeedbackToColorConverter x:Key="feedbackConverter" />
</UserControl.Resources>
<!-- :DataContext="{d:DesignInstance Type=local:AnalogValueVM, IsDesignTimeCreatable=True}" -->
<!-- Style to see things in the designer-->
<d:DesignerProperties.DesignStyle>
<Style TargetType="UserControl">
<!-- Property="Background" Value="White" /> -->
<Setter Property="Height" Value="300" />
<Setter Property="Width" Value="100" />
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
<RowDefinition Height="30*"/>
<RowDefinition Height="30*"/>
<RowDefinition Height="30*"/>
</Grid.RowDefinitions>
<Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="White" BorderThickness="2"/>
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{Binding SName, Mode=OneWay }" HorizontalAlignment="Center" FontSize="24"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="1" />
<Border Grid.Row="1" BorderBrush="White" BorderThickness="1" />
<Label Grid.Row="0" VerticalAlignment="Center" Content="Übervoll" HorizontalAlignment="Center" FontSize="16"/>
<RadioButton Margin="5" Grid.Row="1" IsChecked="{Binding Overload}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Column="0" Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="1" />
<Border Grid.Row="1" BorderBrush="White" BorderThickness="1" />
<Label Grid.Row="0" VerticalAlignment="Center" Content="Voll" HorizontalAlignment="Center" FontSize="16"/>
<RadioButton Grid.Row="1" Margin="5" IsChecked="{Binding Full}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="1" />
<Border Grid.Row="1" BorderBrush="White" BorderThickness="1" />
<Label Grid.Row="0" VerticalAlignment="Center" Content="Leer" HorizontalAlignment="Center" FontSize="16"/>
<RadioButton Grid.Row="1" Margin="5" IsChecked="{Binding Empty}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Border Grid.Column="1" Grid.Row="1" Grid.RowSpan="3" BorderBrush="White" BorderThickness="1"></Border>
<Grid Grid.Column="1" Grid.Row="1" Grid.RowSpan="3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button x:Name="btnFill" DataContext="{Binding FillButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="0" Grid.Column="0" Content="Füllen" Margin="5" />
<Button x:Name="btnOpen" DataContext="{Binding EmptyButton}" Command="{Binding ButtonClickedCommand}" IsEnabled="{Binding XRelease}" Background="{Binding IFeedback, Converter={StaticResource feedbackConverter}}" Grid.Row="1" Grid.Column="0" Content="Leeren" Margin="5" />
</Grid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Input;
namespace Common
{
/// <summary>
/// Interaktionslogik für AnalogValue.xaml
/// </summary>
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);
}
}
}

View File

@@ -0,0 +1,76 @@
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);
}
}

View File

@@ -0,0 +1,33 @@
<UserControl x:Class="Common.ParamControlFloat"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=local:ParamControlFloatVm, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
Width="Auto"
Height="Auto">
<!-- :DataContext="{d:DesignInstance Type=local:AnalogValueVM, IsDesignTimeCreatable=True}" -->
<!-- Style to see things in the designer-->
<d:DesignerProperties.DesignStyle>
<Style TargetType="UserControl">
<!-- Property="Background" Value="White" /> -->
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="280" />
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<!-- <ColumnDefinition Width="Auto" /> -->
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<Label x:Name="tbName" Grid.Column="0" Content="{Binding SName, Mode=OneWay }" Width="200"/>
<TextBox x:Name="tbValue" Text="{Binding Value, Mode=TwoWay, StringFormat=N2}" Grid.Column="1" MaxLines="1" Width="80" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsReadOnly="{Binding Readonly}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Input;
namespace Common
{
/// <summary>
/// Interaktionslogik für AnalogValue.xaml
/// </summary>
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);
}
}
}

View File

@@ -0,0 +1,27 @@
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()
{
}
}

View File

@@ -0,0 +1,33 @@
<UserControl x:Class="Common.ParamControlInt"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:common="clr-namespace:Common"
d:DataContext="{d:DesignInstance Type=common:ParamControlIntVm, IsDesignTimeCreatable=True}"
mc:Ignorable="d"
Width="Auto"
Height="Auto">
<!-- :DataContext="{d:DesignInstance Type=local:AnalogValueVM, IsDesignTimeCreatable=True}" -->
<!-- Style to see things in the designer-->
<d:DesignerProperties.DesignStyle>
<Style TargetType="UserControl">
<!-- Property="Background" Value="White" /> -->
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="280" />
</Style>
</d:DesignerProperties.DesignStyle>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<!-- <ColumnDefinition Width="Auto" /> -->
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- <Label Grid.Column="0" Content="{Binding SName}" VerticalAlignment="Center" HorizontalAlignment="Left"/> -->
<Label x:Name="tbName" Grid.Column="0" Content="{Binding SName, Mode=OneWay }" Width="200"/>
<TextBox x:Name="tbValue" Text="{Binding Value, Mode=TwoWay}" Grid.Column="1" MaxLines="1" Width="80" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsReadOnly="{Binding Readonly}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Input;
namespace Common
{
/// <summary>
/// Interaktionslogik für AnalogValue.xaml
/// </summary>
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);
}
}
}

View File

@@ -0,0 +1,28 @@
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()
{
}
}

View File

@@ -0,0 +1,33 @@
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;
}
}
}

View File

@@ -0,0 +1,12 @@
<Window x:Class="HMIToolkit.AnalogMotorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:HMIToolkit"
mc:Ignorable="d"
Title="AnalogMotorWindow" SizeToContent="WidthAndHeight">
<Grid>
<local:AnalogMotorControl />
</Grid>
</Window>

Some files were not shown because too many files have changed in this diff Show More