A UWP dashboard which provides live updates for the 'Personal Flash in Real-Time (Andy)' and 'Personal Flash in Real-Time (Tony)' artworks -- part of the 'Return to Ritherdon' project by Nicola Ellis. Documentation can be found at
https://git.abbether.net/return-to-ritherdon/rtr-docs/src/branch/master/eyes-and-ears
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.
273 lines
15 KiB
273 lines
15 KiB
<Page |
|
x:Class="EyesAndEars.UWP.MainPage" |
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:local="using:EyesAndEars.UWP" |
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
mc:Ignorable="d" |
|
Background="{ThemeResource SystemControlAcrylicWindowBrush}"> |
|
|
|
<Grid Margin="12"> |
|
|
|
<Grid.RowDefinitions> |
|
<RowDefinition Height="96"/> |
|
<RowDefinition Height="Auto"/> |
|
<RowDefinition Height="*"/> |
|
<RowDefinition Height="Auto"/> |
|
</Grid.RowDefinitions> |
|
|
|
<TextBlock x:Name="VersionNumber" Grid.Row="0" Padding="0" Margin="0" |
|
FontSize="12" VerticalAlignment="Top" |
|
HorizontalAlignment="Right"/> |
|
|
|
<TextBlock x:Name="Time" Grid.Row="0" FontSize="78" |
|
VerticalAlignment="Stretch" HorizontalAlignment="Right" |
|
Text="{x:Bind _vm.CurrentTime, Mode=OneWay, FallbackValue=00}" |
|
Margin="0" Padding="0"/> |
|
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal" |
|
VerticalAlignment="Top"> |
|
<Image Grid.Column="0" Width="88" Height="88" VerticalAlignment="Center" |
|
Source="Images\logo.png"/> |
|
<StackPanel Padding="8,0"> |
|
<TextBlock Text="Return to Ritherdon Project" FontSize="40"/> |
|
<StackPanel Orientation="Horizontal"> |
|
<TextBlock Text="Unnamed Project" Padding="0" FontSize="24" |
|
VerticalAlignment="Bottom"/> |
|
<TextBlock Text="by Nicola Ellis" Padding="0" Margin="12,0" |
|
FontSize="18" VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
</StackPanel> |
|
</StackPanel> |
|
|
|
<Grid Grid.Row="1" Margin="0,12"> |
|
|
|
<Grid.ColumnDefinitions> |
|
<ColumnDefinition Width="Auto"/> |
|
<ColumnDefinition Width="Auto"/> |
|
<ColumnDefinition Width="Auto"/> |
|
</Grid.ColumnDefinitions> |
|
|
|
<Grid.RowDefinitions> |
|
<RowDefinition Height="Auto"/> |
|
<RowDefinition Height="Auto"/> |
|
</Grid.RowDefinitions> |
|
|
|
<Grid x:Name="Factory1Grid" Grid.Row="0" Grid.Column="0" |
|
Background="{x:Bind _vm.Device1.StatusColour, Mode=OneWay, |
|
FallbackValue=Pink}" Margin="0,0,0,12" Width="300" Height="300" |
|
CornerRadius="10"> |
|
<StackPanel Margin="12" VerticalAlignment="Stretch"> |
|
<TextBlock x:Name="Factory1Time" |
|
Text="{x:Bind _vm.Device1.LatestReading.time, |
|
Mode=OneWay, FallbackValue=404}" |
|
Foreground="White" FontSize="24"/> |
|
<TextBlock x:Name="Factory1Reading" |
|
Text="{x:Bind _vm.Device1.LatestReading.reading, |
|
Mode=OneWay, FallbackValue=404}" Foreground="White" |
|
VerticalAlignment="Bottom" FontSize="144"/> |
|
<TextBlock Text="Factory 1" Foreground="White" FontSize="36" |
|
VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
</Grid> |
|
|
|
<Grid x:Name="Factory2Grid" Grid.Row="0" Grid.Column="1" |
|
Background="{x:Bind _vm.Device2.StatusColour, Mode=OneWay, |
|
FallbackValue=Orange}" Margin="12,0,12,12" Width="300" Height="300" |
|
CornerRadius="10"> |
|
<StackPanel Margin="12" VerticalAlignment="Stretch"> |
|
<TextBlock x:Name="Factory2Time" Foreground="White" FontSize="24" |
|
Text="{x:Bind _vm.Device2.LatestReading.time, |
|
Mode=OneWay, FallbackValue=404}" /> |
|
<TextBlock x:Name="Factory2Reading" |
|
Text="{x:Bind _vm.Device2.LatestReading.reading, |
|
Mode=OneWay, FallbackValue=404}" Foreground="White" |
|
VerticalAlignment="Bottom" FontSize="144"/> |
|
<TextBlock Text="Factory 2" Foreground="White" FontSize="36" |
|
VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
</Grid> |
|
|
|
<Grid Grid.Row="0" Grid.Column="2" Grid.RowSpan="2"> |
|
<StackPanel Orientation="Vertical"> |
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,5"> |
|
<Rectangle Fill="LightSeaGreen" Width="92" Height="52" |
|
RadiusX="5" RadiusY="5"/> |
|
<TextBlock Text="Device is on" FontSize="42" |
|
VerticalAlignment="Center" Margin="12,0"/> |
|
</StackPanel> |
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,5"> |
|
<Rectangle Fill="DarkSeaGreen" Width="92" Height="52" |
|
RadiusX="5" RadiusY="5"/> |
|
<TextBlock Text="Welding detected" FontSize="42" |
|
VerticalAlignment="Center" Margin="12,0"/> |
|
</StackPanel> |
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,5"> |
|
<Rectangle Fill="LightSkyBlue" Width="92" Height="52" |
|
RadiusX="5" RadiusY="5"/> |
|
<TextBlock Text="Low light in factory" FontSize="42" |
|
VerticalAlignment="Center" Margin="12,0"/> |
|
</StackPanel> |
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,5"> |
|
<Rectangle Fill="DarkOrange" Width="92" Height="52" |
|
RadiusX="5" RadiusY="5"/> |
|
<TextBlock Text="Unable to retrieve data" FontSize="42" |
|
VerticalAlignment="Center" Margin="12,0"/> |
|
</StackPanel> |
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,5"> |
|
<Rectangle Fill="DarkRed" Width="92" Height="52" |
|
RadiusX="5" RadiusY="5"/> |
|
<TextBlock Text="Device is off" FontSize="42" |
|
VerticalAlignment="Center" Margin="12,0"/> |
|
</StackPanel> |
|
<TextBlock Text="Factory: 07:00 - 16:00" FontSize="42" |
|
VerticalAlignment="Center" Margin="0"/> |
|
<TextBlock Text="Gallery: 10:00 - 18:00" FontSize="42" |
|
VerticalAlignment="Center" Margin="0"/> |
|
<TextBlock Text="Dashboard updates at slower rate than devices." |
|
FontSize="18" Margin="0" Foreground="SlateGray" |
|
VerticalAlignment="Center"/> |
|
</StackPanel> |
|
|
|
</Grid> |
|
<!-- This device is not in use. Uncomment if becomes available. --> |
|
<!--<Grid x:Name="Factory3Grid" Grid.Row="0" Grid.Column="2" |
|
Background="{x:Bind _vm.Device3.StatusColour, Mode=OneWay, |
|
FallbackValue=Pink}" Margin="0,0,0,12" Width="300" Height="300"> |
|
<StackPanel Margin="12" VerticalAlignment="Stretch"> |
|
<TextBlock x:Name="Factory3Time" |
|
Text="{x:Bind _vm.Device3.LatestStatus.time, |
|
Mode=OneWay, FallbackValue=404}" |
|
Foreground="White" FontSize="24"/> |
|
<TextBlock x:Name="Factory3Reading" Foreground="White" |
|
Text="{x:Bind _vm.Device3.LatestReading.reading, |
|
Mode=OneWay, FallbackValue=404}" FontSize="144" |
|
VerticalAlignment="Bottom"/> |
|
<TextBlock Text="Factory 3" Foreground="White" FontSize="36" |
|
VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
</Grid>--> |
|
|
|
<Grid x:Name="Gallery1Grid" Grid.Row="1" Grid.Column="0" |
|
Background="{x:Bind _vm.Device4.StatusColour, Mode=OneWay, |
|
FallbackValue=Pink}" Margin="0,0,0,12" Width="300" Height="150" |
|
CornerRadius="10"> |
|
<StackPanel Margin="12" VerticalAlignment="Bottom"> |
|
<TextBlock x:Name="Gallery1Time" Foreground="White" |
|
Text="{x:Bind _vm.Device4.LatestStatus.time, |
|
Mode=OneWay, FallbackValue=404}" FontSize="24"/> |
|
<TextBlock Text="Gallery 1" Foreground="White" FontSize="36" |
|
VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
<TextBlock Text="{x:Bind _vm.Device1.LatestReading.reading , |
|
Mode=OneWay, FallbackValue=404}" Foreground="White" |
|
HorizontalAlignment="Right" FontSize="16" |
|
VerticalAlignment="Bottom" Padding="4"/> |
|
</Grid> |
|
|
|
<Grid x:Name="Gallery2Grid" Grid.Row="1" Grid.Column="1" |
|
Background="{x:Bind _vm.Device5.StatusColour, Mode=OneWay, |
|
FallbackValue=Pink}" Margin="0,0,0,12" Width="300" Height="150" |
|
CornerRadius="10"> |
|
<StackPanel Margin="12" VerticalAlignment="Bottom"> |
|
<TextBlock x:Name="Gallery2Time" Foreground="White" FontSize="24" |
|
Text="{x:Bind _vm.Device5.LatestStatus.time, |
|
Mode=OneWay, FallbackValue=404}" |
|
/> |
|
<TextBlock Text="Gallery 2" Foreground="White" FontSize="36" |
|
VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
<TextBlock Text="{x:Bind _vm.Device2.LatestReading.reading , |
|
Mode=OneWay, FallbackValue=404}" Foreground="White" |
|
HorizontalAlignment="Right" FontSize="16" |
|
VerticalAlignment="Bottom" Padding="4"/> |
|
</Grid> |
|
|
|
<!-- This device is not in use. Uncomment if becomes available. --> |
|
<!--<Grid x:Name="Gallery3Grid" Grid.Row="1" Grid.Column="2" |
|
Background="{x:Bind _vm.Device6.StatusColour, Mode=OneWay, |
|
FallbackValue=Pink}" Margin="0,0,0,12" Width="300" Height="150"> |
|
<StackPanel Margin="12" VerticalAlignment="Bottom"> |
|
<TextBlock x:Name="Gallery3Time" Foreground="White" FontSize="24" |
|
Text="{x:Bind _vm.Device6.LatestStatus.time, |
|
Mode=OneWay, FallbackValue=404}" /> |
|
<TextBlock Text="Gallery 3" Foreground="White" FontSize="36" |
|
VerticalAlignment="Bottom"/> |
|
</StackPanel> |
|
<TextBlock Text="{x:Bind _vm.Device3.LatestReading.reading , |
|
Mode=OneWay, FallbackValue=404}" Foreground="White" |
|
HorizontalAlignment="Right" FontSize="16" |
|
VerticalAlignment="Bottom" Padding="4"/> |
|
</Grid>--> |
|
|
|
</Grid> |
|
|
|
<Grid Grid.Row="2" Margin="0,0,0,0"> |
|
<ScrollViewer x:Name="LogViewer" Visibility="Visible" |
|
VerticalScrollBarVisibility="Visible" |
|
HorizontalScrollMode="Disabled" |
|
VerticalScrollMode="Enabled" Margin="0,20"> |
|
<RichTextBlock x:Name="Logs" FontSize="16" |
|
FontFamily="Consolas"> |
|
</RichTextBlock> |
|
</ScrollViewer> |
|
</Grid> |
|
|
|
<Grid Grid.Row="3" Margin="0"> |
|
|
|
<Grid.ColumnDefinitions> |
|
<ColumnDefinition Width="Auto"/> |
|
<ColumnDefinition Width="*" MinWidth="350"/> |
|
<ColumnDefinition Width="Auto"/> |
|
</Grid.ColumnDefinitions> |
|
|
|
<StackPanel Orientation="Horizontal" Grid.Column="0"> |
|
|
|
<ToggleButton x:Name="LogToggle" FontFamily="Segoe MDL2 Assets" |
|
Content="" HorizontalAlignment="Right" |
|
VerticalAlignment="Top" FontSize="28" |
|
Height="79" Width="79" |
|
Unchecked="LogToggle_Unchecked" |
|
Checked="LogToggle_Checked" |
|
IsChecked="True"/> |
|
|
|
<HyperlinkButton x:Name="InfoButton" Grid.Column="0" |
|
NavigateUri="http://www.nicolaellis.com" |
|
FontFamily="Segoe MDL2 Assets" Content="" |
|
Height="79" Width="79" VerticalAlignment="Center" |
|
HorizontalAlignment="Left" FontSize="28" |
|
ToolTipService.Placement="Mouse" |
|
ToolTipService.ToolTip="This is a link to a webpage with information about Nicola and the project."/> |
|
</StackPanel> |
|
|
|
<TextBox x:Name="WebAddressBox" Grid.Column="1" FontSize="26" |
|
Text="{x:Bind _vm.BaseURL , Mode=TwoWay}" |
|
Padding="20" TextAlignment="Left" |
|
HorizontalAlignment="Stretch" TextWrapping="NoWrap" |
|
Margin="0" VerticalAlignment="Center" |
|
HorizontalContentAlignment="Left" |
|
ToolTipService.Placement="Mouse" |
|
ToolTipService.ToolTip="The base U.R.L. used to form the A.P.I. queries." |
|
PlaceholderText="Enter the base U.R.L. here..." /> |
|
|
|
<StackPanel Orientation="Horizontal" Grid.Column="2"> |
|
<ToggleButton x:Name="PlayButton" FontFamily="Segoe MDL2 Assets" |
|
Content="" Height="79" Width="79" |
|
VerticalAlignment="Center" FontSize="28" |
|
Margin="0,0,12,0" ToolTipService.Placement="Mouse" |
|
IsChecked="False" Unchecked="PlayButton_Unchecked" |
|
Checked="PlayButton_Checked" |
|
ToolTipService.ToolTip="Click to pause the service. It will give the server a moment before it starts receiving requests from this app. again."/> |
|
<Button x:Name="SaveURLButton" FontFamily="Segoe MDL2 Assets" |
|
Content="" Height="79" Width="79" |
|
VerticalAlignment="Center" FontSize="28" |
|
Click="SaveURLButton_Click" |
|
ToolTipService.Placement="Mouse" |
|
ToolTipService.ToolTip="Click to save the base U.R.L."/> |
|
</StackPanel> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
</Page>
|
|
|