|
|
|
<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="*"/>
|
|
|
|
<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: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">
|
|
|
|
<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">
|
|
|
|
<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">
|
|
|
|
<StackPanel Orientation="Vertical">
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<Rectangle Fill="SeaGreen" Width="92" Height="52"/>
|
|
|
|
<TextBlock Text="Device is on" FontSize="42"
|
|
|
|
VerticalAlignment="Center" Margin="12,0"/>
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<Rectangle Fill="DarkRed" Width="92" Height="52"/>
|
|
|
|
<TextBlock Text="Device is off" FontSize="42"
|
|
|
|
VerticalAlignment="Center" Margin="12,0"/>
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<Rectangle Fill="DarkOrange" Width="92" Height="52"/>
|
|
|
|
<TextBlock Text="Unable to retrieve data" FontSize="42"
|
|
|
|
VerticalAlignment="Center" Margin="12,0"/>
|
|
|
|
</StackPanel>
|
|
|
|
</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">
|
|
|
|
<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">
|
|
|
|
<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">
|
|
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
<ColumnDefinition Width="*" MinWidth="350"/>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
<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."/>
|
|
|
|
|
|
|
|
<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>
|