private void PopulateChart(DeviceDataCollection newValue) { chart.Series[0].ItemsSource = newValue; var axis = chart.Axes.OfType <CategoryXAxis>().First(); axis.ItemsSource = newValue; }
public bool GetData() { //IsBusy = true; new CloudantDataService ().GetDeviceData ().ContinueWith((d)=> { Data = d.Result; //IsBusy = false; }); return true; }
public bool GetData() { //IsBusy = true; new CloudantDataService().GetDeviceData().ContinueWith((d) => { Data = d.Result; //IsBusy = false; }); return(true); }
private async Task <DeviceDataCollection> HandleResponse(string data) { return(await Task.Run(() => { var cloudantData = JsonConvert.DeserializeObject <CloudantData> (data); if (cloudantData == null) { return null; } var deviceDataCollection = new DeviceDataCollection(); foreach (var item in cloudantData.Rows) { item.Doc.DeviceData.Timestamp = item.Doc.DeviceData.Timestamp.ToLocalTime(); deviceDataCollection.Add(item.Doc.DeviceData); } return deviceDataCollection; })); }
private async Task<DeviceDataCollection> HandleResponse(string data) { return await Task.Run (()=>{ var cloudantData = JsonConvert.DeserializeObject<CloudantData> (data); if (cloudantData == null) { return null; } var deviceDataCollection = new DeviceDataCollection (); foreach (var item in cloudantData.Rows) { item.Doc.DeviceData.Timestamp = item.Doc.DeviceData.Timestamp.ToLocalTime(); deviceDataCollection.Add (item.Doc.DeviceData); } return deviceDataCollection; }); }
public async Task <DeviceDataCollection> GetDeviceData() { return(await Task.Run(() => { var deviceDataCol = new DeviceDataCollection(); var csv = DataProvider.GetResourceCsvFileData(@"BluemixIoT.Data.air_quality.csv"); for (var i = 1; i < csv.Rows.Count; i++) { var data = csv[i, "d"]; var deviceData = new DeviceData { Id = csv[i, "_id"], Data = JsonConvert.DeserializeObject <AirQuality>(csv[i, "d"]), Timestamp = Convert.ToDateTime(csv[i, "ts"]), }; deviceDataCol.Add(deviceData); } return deviceDataCol; })); }
public async Task<DeviceDataCollection> GetDeviceData() { return await Task.Run(() => { var deviceDataCol = new DeviceDataCollection(); var csv = DataProvider.GetResourceCsvFileData(@"BluemixIoT.Data.air_quality.csv"); for (var i = 1; i < csv.Rows.Count; i++) { var data = csv[i, "d"]; var deviceData = new DeviceData { Id = csv[i, "_id"], Data = JsonConvert.DeserializeObject<AirQuality>(csv[i, "d"]), Timestamp = Convert.ToDateTime(csv[i, "ts"]), }; deviceDataCol.Add(deviceData); } return deviceDataCol; }); }
private void PopulateChart(DeviceDataCollection newValue) { chart.Series[0].ItemsSource = newValue; var axis = chart.Axes.OfType<CategoryXAxis>().First(); axis.ItemsSource = newValue; }
private static void OnDataChanged(BindableObject bindable, DeviceDataCollection oldvalue, DeviceDataCollection newvalue) { ((ChartView)bindable).OnDataChanged(oldvalue, newvalue); }
public void OnDataChanged(DeviceDataCollection oldValue, DeviceDataCollection newValue) { PopulateChart(newValue); }
public void OnDataChanged(DeviceDataCollection oldValue, DeviceDataCollection newValue) { PopulateChart(newValue); }
private static void OnDataChanged(BindableObject bindable, DeviceDataCollection oldvalue, DeviceDataCollection newvalue) { ((ChartView)bindable).OnDataChanged(oldvalue, newvalue); }