|
|
|
using EyesAndEars.UWP.Models;
|
|
|
|
using EyesAndEars.UWP.ViewModels;
|
|
|
|
using System;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace EyesAndEars.UWP.Services {
|
|
|
|
public static class DataServices {
|
|
|
|
|
|
|
|
public static async Task<FactoryDevice> UpdateFactoryDevice(int deviceId) {
|
|
|
|
// This should cause an error right now -- deliberate for error checking.
|
|
|
|
var t = await WebServices.GetLightReading("ht", deviceId);
|
|
|
|
// Need to map the json result to the models and display in view.
|
|
|
|
return new FactoryDevice();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static async Task<GalleryDevice> UpdateGalleryDevice(int deviceId) {
|
|
|
|
// This should cause an error right now -- deliberate for error checking.
|
|
|
|
var t = await WebServices.GetLightReading("ht", deviceId);
|
|
|
|
// Need to map the json result to the models and display in view.
|
|
|
|
return new GalleryDevice();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static MainPageVM CreateFallBackViewModel() {
|
|
|
|
// "999" and "-" are acting as sentinals in this context.
|
|
|
|
var r = new LightReading(0, 999, DateTime.Now);
|
|
|
|
var s = new DeviceStatus(0, "-", DateTime.Now);
|
|
|
|
var fD1 = new FactoryDevice(1, r, s);
|
|
|
|
var fD2 = new FactoryDevice(2, r, s);
|
|
|
|
var fD3 = new FactoryDevice(3, r, s);
|
|
|
|
var gD1 = new GalleryDevice(4, s);
|
|
|
|
var gD2 = new GalleryDevice(5, s);
|
|
|
|
var gD3 = new GalleryDevice(6, s);
|
|
|
|
var vm = new MainPageVM();
|
|
|
|
vm.FactoryDevice1 = fD1;
|
|
|
|
vm.FactoryDevice2 = fD2;
|
|
|
|
vm.FactoryDevice3 = fD3;
|
|
|
|
vm.GalleryDevice1 = gD1;
|
|
|
|
vm.GalleryDevice2 = gD2;
|
|
|
|
vm.GalleryDevice3 = gD3;
|
|
|
|
return vm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|