1
0
Fork 0
Browse Source

removed 'factory3' and 'gallery3' from dashboard.

The logic for 'factory3' and 'gallery3' is still in place but is not bound to the view (MainPage.xml). The view xml is commented out and not removed. This should make it easier to re-add it if the need comes about.
pull/6/head
Craig Oates 3 years ago
parent
commit
58f79e6b3c
  1. 12
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml
  2. 6
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml.cs
  3. 4
      src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs
  4. 4
      src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs

12
src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml

@ -79,8 +79,9 @@
VerticalAlignment="Bottom"/>
</StackPanel>
</Grid>
<Grid x:Name="Factory3Grid" Grid.Row="0" Grid.Column="2"
<!-- 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">
@ -95,7 +96,7 @@
<TextBlock Text="Factory 3" Foreground="White" FontSize="36"
VerticalAlignment="Bottom"/>
</StackPanel>
</Grid>
</Grid>-->
<Grid x:Name="Gallery1Grid" Grid.Row="1" Grid.Column="0"
Background="{x:Bind _vm.Device4.StatusColour, Mode=OneWay,
@ -130,7 +131,8 @@
VerticalAlignment="Bottom" Padding="4"/>
</Grid>
<Grid x:Name="Gallery3Grid" Grid.Row="1" Grid.Column="2"
<!-- 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">
@ -144,7 +146,7 @@
Mode=OneWay, FallbackValue=404}" Foreground="White"
HorizontalAlignment="Right" FontSize="16"
VerticalAlignment="Bottom" Padding="4"/>
</Grid>
</Grid>-->
</Grid>

6
src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml.cs

@ -28,13 +28,14 @@ namespace EyesAndEars.UWP {
}
async void IntialiseDataContext() {
// Device 3 and 6 are not in use.
_vm.BaseURL = await DataServices.GetBaseURLAsync();
_vm.Device1 = DataServices.CreateFallBackDevice(1);
_vm.Device2 = DataServices.CreateFallBackDevice(2);
_vm.Device3 = DataServices.CreateFallBackDevice(3);
// _vm.Device3 = DataServices.CreateFallBackDevice(3);
_vm.Device4 = DataServices.CreateFallBackDevice(4);
_vm.Device5 = DataServices.CreateFallBackDevice(5);
_vm.Device6 = DataServices.CreateFallBackDevice(6);
// _vm.Device6 = DataServices.CreateFallBackDevice(6);
DataContext = _vm;
}
@ -48,6 +49,7 @@ namespace EyesAndEars.UWP {
async void UpdateViewModel(object sender, object e) {
var url = _vm.BaseURL;
if (!string.IsNullOrEmpty(url)) {
// Devices 3 and 6 are not in use.
_vm.Device1 = await DataServices.UpdateDevice(url, 1);
_vm.Device2 = await DataServices.UpdateDevice(url, 2);
_vm.Device3 = await DataServices.UpdateDevice(url, 3);

4
src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs

@ -44,8 +44,8 @@ namespace EyesAndEars.UWP.Services {
* ================================================================
* Every device in the project is paired up with another.
* Factory1 => Gallery1 | Device1 => Device4
* Factory1 => Gallery2 | Device2 => Device5
* Factory1 => Gallery3 | Device3 => Device6
* Factory2 => Gallery2 | Device2 => Device5
* Factory3 => Gallery3 | Device3 => Device6 (Note in use at this time)
* At the moment, when a device completes a status update, each one
* is ran throught the "UpdateDevice" function (above). This means
* the latest light reading for a light meter (factory) must be

4
src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs

@ -22,10 +22,10 @@ namespace EyesAndEars.UWP.ViewModels {
Device1 = f1;
Device2 = f2;
Device3 = f3;
Device3 = f3; // Not in use.
Device4 = g1;
Device5 = g2;
Device6 = g3;
Device6 = g3; // Not in use.
}
string _baseURL;