Files
Tempering-Machine-Control-S…/DaireApplication/Views/MainWindow.axaml

488 lines
22 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:DaireApplication.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="DaireApplication.Views.MainWindow"
Icon="/Assets/avalonia-logo.ico"
Title="DaireApplication"
Background="#B3B3B3"
FontFamily="Helvetica"
WindowState="Maximized"
SystemDecorations="None"
Topmost="False"
Width="1280" Height="800">
<Grid RowDefinitions="Auto,2*,Auto">
<!-- Titel Bar-->
<Grid x:Name="TitelBar" Grid.Row="0" Background="WhiteSmoke" Height="90" Margin="0">
<Grid.Styles>
<Style Selector="Button">
<Setter Property="Background" Value="Transparent"></Setter>
</Style>
<Style Selector="Button:pointerover /template/ContentPresenter">
<Setter Property="Foreground" Value="Black"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
</Style>
</Grid.Styles>
<Grid ColumnDefinitions="Auto,5*,Auto">
<StackPanel Width="160" Height="40" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" Margin="0,0,40,0">
<Button x:Name="logoBtn" BorderThickness="0" Background="Transparent" Width="220" Height="200">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Transparent" BorderThickness="1" Background="Transparent">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Image Source="/Assets/Logo.png" Width="160" Height="40" />
</Button>
</StackPanel>
<StackPanel Background="Transparent" HorizontalAlignment="Left" Grid.Column="1" Orientation="Horizontal" Spacing="-10" ZIndex="-1">
<!-- Home Button with One-Sided Arrow -->
<Button x:Name="HomeTrack" BorderThickness="2" Width="140" Height="60" Click="HomeTraclBtn" >
<Grid Width="140" Height="50" >
<Polygon x:Name="HomePolygon" Points="20,0 120,0 140,25 120,50 20,50 20,0"
Stroke="Black" StrokeThickness="2" Fill="#E6E6E6"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<Image Source="/Assets/Home.png" Width="20" Height="20" Margin="5,0,5,0" />
<TextBlock Text="HOME" FontSize="18" FontWeight="Normal" Foreground="Black"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</StackPanel>
</Grid>
</Button>
<!-- Recipe Selection Button -->
<Button x:Name="RecipeSelTrack" BorderThickness="2" Width="150" Height="60" Click="RecipeSelTrackBtn">
<Grid Width="150" Height="50">
<Polygon x:Name="RecipeSelPolygon" Points="0,0 130,0 150,25 130,50 0,50 20,25"
Stroke="Black" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="RECIPE SEL." FontSize="18" Margin="10,0,0,0"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- Recipe Panel Button -->
<Button x:Name="RecipePanelTrack" BorderThickness="2" Width="170" Height="60" Click="RecipeSelTrackBtn">
<Grid Width="170" Height="50">
<Polygon x:Name="RecipePanelPolygon" Points="0,0 150,0 170,25 150,50 0,50 20,25"
Stroke="Black" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="RECIPE PANEL" FontSize="18" FontWeight="Normal"
Foreground="Black" HorizontalAlignment="Center"
Padding="10,0,0,0"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- Settings Button -->
<Button x:Name="SettingTrack" BorderThickness="2" Width="150" Height="60" Click="SettingTrackBtn">
<Grid Width="150" Height="50">
<Polygon x:Name="SettingPolygon" Points="0,0 130,0 150,25 130,50 0,50 20,25"
Stroke="Black" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="SETTINGS" FontSize="18" FontWeight="Normal"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- Recipe Edit Button -->
<Button x:Name="RecipeEditTrack" BorderThickness="2" Width="170" Height="60">
<Grid Width="170" Height="50">
<Polygon x:Name="RecipeEditPolygon" Points="0,0 150,0 170,25 150,50 0,50 20,25"
Stroke="#A4275D" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="RECIPE EDIT" FontSize="18" FontWeight="Normal"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- Run Interface Button -->
<Button x:Name="RunInterfaceTrack" BorderThickness="2" Width="200" Height="60" IsVisible="False">
<Grid Width="200" Height="50">
<Polygon x:Name="RunInterfacePolygon" Points="0,0 170,0 190,25 170,50 0,50 20,25"
Stroke="#A4275D" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="RUN INTERFACE" FontSize="18" FontWeight="Normal" Margin="0,0,0,0"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- DIAGNOSTICS Button -->
<Button x:Name="DiagnosticsTrack" BorderThickness="2" Width="170" Height="60" IsVisible="False" Click="DiagnosticsBtn">
<Grid Width="170" Height="50">
<Polygon x:Name="DiagnosticsPolygon" Points="0,0 150,0 170,25 150,50 0,50 20,25"
Stroke="#A4275D" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="DIAGNOSTICS" FontSize="20" FontWeight="Normal" Margin="11,0,0,0"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- SOFTWARE Button -->
<Button x:Name="SoftwareTrack" BorderThickness="2" Width="170" Height="60" Margin="0,0,0,0" IsVisible="False" Click="SoftwareBtn">
<Grid Width="170" Height="50">
<Polygon x:Name="SoftwarePolygon" Points="0,0 150,0 170,25 150,50 0,50 20,25"
Stroke="#A4275D" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="SOFTWARE" FontSize="18" FontWeight="Normal" Margin="0,0,0,0"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- ADVANCE SETTINGS Button -->
<Button x:Name="AdvanceSettingsTrack" BorderThickness="2" Width="220" Height="60" Margin="0,0,0,0" IsVisible="False" Click="AdvanceSettingsView">
<Grid Width="220" Height="50">
<Polygon x:Name="AdvanceSettingsPolygon" Points="0,0 200,0 220,25 200,50 0,50 20,25"
Stroke="#A4275D" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="ADVANCE SETTINGS" FontSize="18" FontWeight="Normal" Margin="0,0,0,0"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- MANUAL CONTROL Button -->
<Button x:Name="ManualControlTrack" BorderThickness="2" Width="200" Height="60" IsVisible="False" Click="ChefManualBtn">
<Grid Width="200" Height="50">
<Polygon x:Name="ManualControlPolygon" Points="0,0 170,0 190,25 170,50 0,50 20,25"
Stroke="#A4275D" StrokeThickness="2" Fill="#E6E6E6"/>
<TextBlock Text="MANUAL CONTROL" FontSize="18" FontWeight="Normal" Margin="0,0,-5,0"
Foreground="Black" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Button>
</StackPanel>
<StackPanel Grid.Column="2"
HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,0,5,0"
Spacing="0">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="version" VerticalAlignment="Center" FontSize="30" Foreground="Black" Margin="0,0,0,0" IsVisible="True" >V0.6</TextBlock>
<Button x:Name="errorLogoBtn" Background="Transparent" Click="errorLogoClick">
<Image x:Name="errorLogo" IsVisible="False" Tag="Error" Source="/Assets/errorIcon.png" Width="60" Height="60" Stretch="Uniform" Margin="0,0,0,0" ></Image>
</Button>
<Button Background="Transparent" Click="warningLogoClick">
<Image x:Name="warningLogo" IsVisible="False" Tag="Warning" Source="/Assets/warningIcon.png" Height="60" Margin="0,0,0,0" ></Image>
</Button>
<Image x:Name="wifiLogo" IsVisible="False" Tag="Warning" Source="/Assets/wifi.png" Height="60" Margin="0,0,0,0"></Image>
<Image x:Name="nowifiLogo" IsVisible="True" Tag="Warning" Source="/Assets/wifioff.png" Height="60" Margin="0,0,0,0"></Image>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<!-- Recipe Button -->
<Button x:Name="TitleBtn" Background="#A4275D" Foreground="White"
Width="180" Height="50" CornerRadius="10" Margin="10,0,30,0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
>
<Button.Styles>
<Style Selector="Button:pointerover /template/ContentPresenter">
<Setter Property="Background" Value="#A4275D"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style Selector="TextBlock">
<Setter Property="Foreground" Value="White"/>
</Style>
</Button.Styles>
<TextBlock Text="Product" Foreground="White" FontSize="24" FontWeight="Normal"
HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="Title"></TextBlock>
</Button>
<!-- minimize Button -->
<Button x:Name="minimizeBtn" CornerRadius="10" Width="50" Height="50" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Foreground="White" Background="#666666" FontSize="24" FontWeight="Normal"
Content="-"
IsVisible="False">
<Button.Styles>
<Style Selector="Button:pointerover /template/ContentPresenter">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</Button.Styles>
</Button>
<!-- User Button -->
<Button Content="ALL USERS" x:Name="UserName" CornerRadius="10" Width="220" Height="50" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Foreground="White" Background="#666666" FontSize="24" FontWeight="Normal"
>
<Button.Styles>
<Style Selector="Button:pointerover /template/ContentPresenter">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</Button.Styles>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
<!-- Main Area-->
<ContentControl Padding="0" Margin="0" Grid.Row="1" x:Name="ContentArea" Height="620" Background="#b3b3b3" />
<!--Footer-->
<Grid Grid.Row="2" Margin="0,0,0,0" ColumnDefinitions="Auto,*,Auto" Background="White" x:Name="footer" Height="90" >
<Grid.Styles>
<Style Selector="Button.RecipeStart:pointerover /template/ContentPresenter">
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="Background" Value="#008000"></Setter>
</Style>
<Style Selector="Button.PreHeating:pointerover /template/ContentPresenter">
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="Background" Value="#d45500"></Setter>
</Style>
</Grid.Styles>
<StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Spacing="20" Height="80" Margin="20,0,0,0">
<StackPanel x:Name="footerStartBtn" Orientation="Horizontal" Spacing="20" IsVisible="False">
<!-- START Button -->
<Button Content="START RECIPE"
x:Name="recipeStartBtn" Classes="RecipeStart" Width="320" Height="60" FontSize="40"
Background="#008000" Foreground="White" BorderBrush="#008000"
CornerRadius="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
VerticalAlignment="Center" Padding="0,0,0,0" Margin="0,0,0,0" Click="RecipeStartBtn" >
<Button.Styles>
<!-- Custom Style for Disabled Button -->
<Style Selector="Button:disabled /template/ContentPresenter">
<Setter Property="Background" Value="#E6E6E6"/>
<Setter Property="Foreground" Value="#231F20"/>
</Style>
</Button.Styles>
</Button>
<!--PRE-HEATING Button-->
<Button Content="PRE-HEATING" x:Name="PreHeatingBtn" Classes="PreHeating" Width="320" Height="60" FontSize="40"
Background="#d45500" Foreground="White" BorderBrush="#d45500"
CornerRadius="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
VerticalAlignment="Center" Padding="0,0,0,0" Margin="0,0,0,0"
Click="PreHeatingClick" >
<Button.Styles>
<!-- Custom Style for Disabled Button -->
<Style Selector="Button:disabled /template/ContentPresenter">
<Setter Property="Background" Value="#E6E6E6"/>
<Setter Property="Foreground" Value="#231F20"/>
</Style>
</Button.Styles>
</Button>
</StackPanel>
</StackPanel>
<StackPanel x:Name="adminBtns" IsVisible="False" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Spacing="20" Height="80">
<!-- DIAGNOSTICS Button -->
<StackPanel.Styles>
<Style Selector="Button:pointerover /template/ContentPresenter">
<Setter Property="Foreground" Value="Black"></Setter>
<Setter Property="Background" Value="LightGray"></Setter>
<Setter Property="RenderTransform" Value="scale(1.11)"></Setter>
</Style>
</StackPanel.Styles>
<Button Content="DIAGNOSTICS" Width="300" Height="60" FontSize="28" FontWeight="Normal"
Background="LightGray" Foreground="Black" BorderBrush="LightGray"
CornerRadius="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
VerticalAlignment="Center" Margin="40,0,0,0" IsVisible="True" Click="DiagnosticsBtn"/>
<Button Content="SOFTWARE" Width="240" Height="60" FontSize="28" FontWeight="Normal"
Background="LightGray" Foreground="Black" BorderBrush="LightGray"
CornerRadius="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
VerticalAlignment="Center" Margin="40,0,0,0" IsVisible="True" Click="SoftwareBtn"/>
<!-- EDIT Button -->
<!--
<Button Content="EDIT" Click="EditClick" Width="120" Height="50" FontSize="20"
Background="Transparent" Foreground="Gray" BorderBrush="#B0B0B0"
CornerRadius="10" BorderThickness="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
-->
</StackPanel>
<StackPanel x:Name="chefBtns" IsVisible="False" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Spacing="20" Height="80">
<!-- DIAGNOSTICS Button -->
<StackPanel.Styles>
<Style Selector="Button:pointerover /template/ContentPresenter">
<Setter Property="Foreground" Value="Black"></Setter>
<Setter Property="Background" Value="LightGray"></Setter>
<Setter Property="RenderTransform" Value="scale(1.11)"></Setter>
</Style>
</StackPanel.Styles>
<Button Content="MANUAL CONTROL" Width="300" Height="60" FontSize="28" FontWeight="Normal"
Background="LightGray" Foreground="Black" BorderBrush="LightGray"
CornerRadius="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
VerticalAlignment="Center" Margin="40,0,0,0" IsVisible="True" Click="ChefManualBtn"/>
</StackPanel>
<Grid Grid.Column="1" x:Name="TextCenter" Margin="" >
<StackPanel VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="35" Foreground="Green" x:Name="footerMsg"
IsVisible="True" Padding="0,0,0,0"
TextWrapping="WrapWithOverflow">Ready</TextBlock>
</StackPanel>
</Grid>
<Grid Grid.Column="2" RowDefinitions="*,*" x:Name="footerDateContainer" IsVisible="" Height="55" VerticalAlignment="Center" Margin="0,0,10,0" >
<StackPanel Grid.Row="0" >
<TextBlock VerticalAlignment="Bottom"
FontSize="28" Foreground="Black" HorizontalAlignment="Right"
Margin="0,0,5,0" x:Name="footerTime">12:55 PM</TextBlock>
</StackPanel>
<StackPanel Grid.Row="1" >
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Bottom"
FontSize="28" Foreground="Black" Padding="0,0,0,0" Margin="0,0,0,0" x:Name="footerDate">20/02/2025</TextBlock>
</StackPanel>
</Grid>
</Grid>
<!-- Overlay Background for Popup -->
<Border x:Name="errorPopupOverlay" Background="#80000000" Grid.RowSpan="3" IsVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ZIndex="99"
PointerPressed="OnErrorPopupOverlayPointerPressed">
<!-- Popup User Control -->
<!-- Module for Name Entry -->
<Grid PointerPressed="" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20" IsVisible="True">
<Border Background="White" CornerRadius="10" Padding="20" BorderThickness="1" ZIndex="101" BorderBrush="#CCC">
<StackPanel Spacing="15">
<!-- Label for Text Input -->
<!-- Label -->
<Grid ColumnDefinitions="Auto,*">
<Grid Grid.Column="0">
<TextBlock x:Name="errorTitel" Text="Error"
FontSize="20"
FontWeight="Bold"
Foreground="Red"
Margin="0,0,40,8" />
</Grid>
<Grid Grid.Column="1">
<Button Background="Red" Foreground="White"
CornerRadius="5"
Width="100"
Height="40"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
VerticalAlignment="Center"
HorizontalAlignment="Center"
x:Name="resetErrorsBtn"
Click="ResetErrors">Reset Errors</Button>
</Grid>
</Grid>
<StackPanel>
<TextBlock x:Name="errorMsg" Text=""
FontSize="20"
FontWeight="Bold"
Foreground="Black"
Margin="0,0,0,8" />
</StackPanel>
<!-- Button Panel -->
</StackPanel>
</Border>
</Grid>
</Border>
<!-- Overlay Background for Popup -->
<Border x:Name="warningPopupOverlay" Background="#80000000" Grid.RowSpan="3" IsVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ZIndex="99" PointerPressed="OnWarningPopupOverlayPointerPressed">
<!-- Popup User Control -->
<!-- Module for Name Entry -->
<Grid PointerPressed="" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20" IsVisible="True">
<Border Background="White" CornerRadius="10" Padding="20" BorderThickness="1" ZIndex="101" BorderBrush="#CCC">
<StackPanel Spacing="15">
<!-- Label for Text Input -->
<!-- Label -->
<TextBlock x:Name="warningTitel" Text="Warning"
FontSize="20"
FontWeight="Bold"
Foreground="Red"
Margin="0,0,0,8" />
<StackPanel>
<TextBlock x:Name="warningMsg" Text=""
FontSize="20"
FontWeight="Bold"
Foreground="Black"
Margin="0,0,0,8" />
</StackPanel>
<!-- Button Panel -->
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</Window>