private void InitializeCharts() { var EventTimeProperty = typeof(Ruuvi_DataRecord).GetProperty("EventTime"); var properties = new System.Collections.Generic.List <System.Reflection.PropertyInfo>() { typeof(Ruuvi_DataRecord).GetProperty("Temperature"), typeof(Ruuvi_DataRecord).GetProperty("Pressure"), typeof(Ruuvi_DataRecord).GetProperty("Humidity"), }; var names = new List <string>() { "Temperature", "Pressure", "Humidity", }; Ruuvi_DataChart.SetDataProperties(properties, EventTimeProperty, names); Ruuvi_DataChart.SetTitle("Ruuvi Data Chart"); Ruuvi_DataChart.UISpec = new BluetoothDeviceController.Names.UISpecifications() { tableType = "standard", chartType = "standard", chartCommand = "AddYTime<Ruuvi_PeriodRecord>(addResult, Ruuvi_PeriodRecordData)", chartYAxisCombined = Names.UISpecifications.YMinMaxCombined.Separate, chartDefaultMinY0 = 15, // Common indoor temperature, C chartDefaultMaxY0 = 25, chartDefaultMinY1 = 990, // common pressure mbar chartDefaultMaxY1 = 1050, chartDefaultMinY2 = 0, // Y2 is Humidity per the name and properties listings chartDefaultMaxY2 = 100, }; }
private async void Di_UpdatedRuuviAdvertisement(RuuviTag.Ruuvi_DataRecord record) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { // Add to the text box! uiResults.Text += record.ToString() + "\n"; Ruuvi_Data_Temperature.Text = record.Temperature.ToString(); // "N0"); // either N or F3 based on DEC HEX FIXED. hex needs conversion to int first? Ruuvi_Data_Humidity.Text = record.Humidity.ToString(); // "N0"); // either N or F3 based on DEC HEX FIXED. hex needs conversion to int first? Ruuvi_Data_Pressure.Text = record.Pressure.ToString(); // "N0"); // either N or F3 based on DEC HEX FIXED. hex needs conversion to int first? var addResult = Ruuvi_DataRecordData.AddRecord(record); Ruuvi_DataChart.AddYTime <Ruuvi_DataRecord>(addResult, Ruuvi_DataRecordData); }); }
private void OnKeepCountRuuvi_Data(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count != 1) { return; } int value; var ok = Int32.TryParse((e.AddedItems[0] as FrameworkElement).Tag as string, out value); if (!ok) { return; } Ruuvi_DataRecordData.MaxLength = value; Ruuvi_DataChart.RedrawYTime <Ruuvi_DataRecord>(Ruuvi_DataRecordData); }