Advanced Distributed Systems module at HSLU
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

100 lines
5.2 KiB

<Window x:Class="RobotClientWpf.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:local="clr-namespace:RobotClientWpf"
xmlns:views="clr-namespace:RobotClientWpf.Views"
xmlns:dj="clr-namespace:DJ;assembly=NLogViewer"
mc:Ignorable="d" FontSize="15"
Title="Challenge UI" Height="700" Width="1200" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Closing="Window_Closing" Loaded="Window_Loaded" KeyDown="Window_KeyDown">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
<RowDefinition Height="220"/>
<!-- <RowDefinition Height="30"/> Bottom message (NOT USED) -->
</Grid.RowDefinitions>
<!-- ROW 0: Broker IP and states-->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5">
<Label FontWeight="Bold">MQTT Broker IP:</Label>
<TextBox x:Name="tbIp" Width="120" Height="25" FontSize="15" TextAlignment="Left" Margin="10 0 0 0">192.168.156.156</TextBox>
<Button x:Name="btnConnectDisconnect" Content="Connect" Width="100" Margin="20 0 0 0" Click="btnConnectDisconnect_Click"></Button>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
<Label FontWeight="Bold">Robot states:</Label>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Robot Mobile:" Margin="5 0 0 0"/>
<Ellipse Fill="Gray" x:Name="elRobotMobileIndicator" Width="20" Height="20" Margin="15 0" Opacity="100"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Robot Stationary:" Margin="5 0 0 0"/>
<Ellipse Fill="Gray" x:Name="elRobotStationaryIndicator" Width="20" Height="20" Margin="15 0" Opacity="100"/>
</StackPanel>
</StackPanel>
</Grid>
<!-- ROW 1: Tab control -->
<TabControl Grid.Row="1" x:Name="tabControlMain" Grid.ColumnSpan="2">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Header" Value="{Binding Header}" />
</Style>
</TabControl.ItemContainerStyle>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/robot-industrial.png" Height="18" />
<TextBlock Text=" Main" Foreground="Green" FontSize="16" />
</StackPanel>
</TabItem.Header>
<views:MainView x:Name="mainView"/>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/cog.png" Height="18" />
<TextBlock Text=" Config" Foreground="Blue" FontSize="16"/>
</StackPanel>
</TabItem.Header>
<views:ConfigView x:Name="configView"/>
</TabItem>
</TabControl>
<!-- ROW 2: NLOG viewer -->
<dj:NLogViewer Grid.Row="2" Margin="5" DebugForeground="Black" MaxCount="150" ErrorForeground="Black" FatalForeground="Black" TraceForeground="Black" InfoForeground="Black" WarnForeground="Black" >
<dj:NLogViewer.WarnBackground>
<SolidColorBrush Color="#FFFF9D00" Opacity="0.5"/>
</dj:NLogViewer.WarnBackground>
<dj:NLogViewer.TraceBackground>
<SolidColorBrush Color="#FF9B9B9B" Opacity="0.5"/>
</dj:NLogViewer.TraceBackground>
<dj:NLogViewer.InfoBackground>
<SolidColorBrush Color="#FF9B9B9B" Opacity="0.5"/>
</dj:NLogViewer.InfoBackground>
<dj:NLogViewer.DebugBackground>
<SolidColorBrush Color="#FF003DC3" Opacity="0.5"/>
</dj:NLogViewer.DebugBackground>
<dj:NLogViewer.ErrorBackground>
<SolidColorBrush Color="#FFFF2E00" Opacity="0.5"/>
</dj:NLogViewer.ErrorBackground>
<dj:NLogViewer.FatalBackground>
<SolidColorBrush Color="Red" Opacity="0.5"/>
</dj:NLogViewer.FatalBackground>
</dj:NLogViewer>
<!-- ROW 3: Bottom message (NOT USED) -->
<!--<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,150,0,0">
<TextBlock x:Name="tbBottomMessage" FontSize="15" Margin="10 5"/>
</StackPanel>-->
</Grid>
</Window>