protected void timedReportCallback(YFunction source, YMeasure m) { if (_updateFrequency != "auto") { _currentValue = m.get_averageValue(); } }
public void SensorValuecallback(CustomYSensor source, YMeasure M) { if (prop == null) { return; } if (source == prop.DataSource_source) { _angularGauge.DisableRedraw(); if (prop.DataSource_source is NullYSensor) { showStatus("N/A"); _angularGauge.unit = ""; } else if (!prop.DataSource_source.isOnline()) { showStatus("OFFLINE"); } else { _angularGauge.DisableRedraw(); showStatus(""); source.get_unit(); // make sure unit is in cache before UI is refresh (redraw might call value formatter, which will call get_unit) _angularGauge.unit = source.get_unit(); _angularGauge.value = M.get_averageValue(); _angularGauge.AllowRedraw(); } _angularGauge.AllowRedraw(); } }
public void SensorValuecallback(CustomYSensor source, YMeasure M) { if (prop == null) { return; } if (prop.DataSource_source is NullYSensor) { _display.alternateValue = "N/A"; } else if (!prop.DataSource_source.isOnline()) { _display.alternateValue = "OFFLINE"; } else if (M == null) { _display.alternateValue = "--" + unit; } else if (source == prop.DataSource_source) { _display.DisableRedraw(); source.get_unit(); // make sure unit is in cache before UI is refresh (redraw might call value formatter, which will call get_unit) _display.alternateValue = null; _display.value = M.get_averageValue(); _display.AllowRedraw(); } }
public void newTempSensorData(YTemperature source, YMeasure data) { pointXY p = new pointXY() { x = data.get_endTimeUTC(), y = data.get_averageValue() }; TempData.Add(p); monitor_tData.AddPoint(p); }
public void newGenericSensorData(YGenericSensor source, YMeasure data) { pointXY p = new pointXY() { x = data.get_endTimeUTC(), y = data.get_averageValue() }; WeightData.Add(p); monitor_wData.AddPoint(p); }
// automatically called on a regular basis with sensor value public void newSensorValue(YFunction f, YMeasure m) { double t = m.get_endTimeUTC(); chart1.Series[0].Points.AddXY(UnixTimeStampToDateTime(t), m.get_averageValue()); if (FirstPointDate < 0) { FirstPointDate = t; } LastPointDate = t; setGraphScale(); }
public void SensorValuecallback(CustomYSensor source, YMeasure M) { if (prop == null) { return; } if (source == prop.DataSource_source) { _solidGauge.value = source.isOnline() ? M.get_averageValue() : 0; } }
static void dumpSensor(YSensor sensor) { string fmt = "dd MMM yyyy hh:mm:ss,fff"; Console.WriteLine("Using DataLogger of " + sensor.get_friendlyName()); YDataSet dataset = sensor.get_recordedData(0, 0); Console.WriteLine("loading summary... "); dataset.loadMore(); YMeasure summary = dataset.get_summary(); String line = String.Format("from {0} to {1} : min={2:0.00}{5} avg={3:0.00}{5} max={4:0.00}{5}", summary.get_startTimeUTC_asDateTime().ToString(fmt), summary.get_endTimeUTC_asDateTime().ToString(fmt), summary.get_minValue(), summary.get_averageValue(), summary.get_maxValue(), sensor.get_unit()); Console.WriteLine(line); Console.Write("loading details : 0%"); int progress = 0; do { progress = dataset.loadMore(); Console.Write(String.Format("\b\b\b\b{0,3:##0}%", progress)); } while(progress < 100); Console.WriteLine(""); List <YMeasure> details = dataset.get_measures(); foreach (YMeasure m in details) { Console.WriteLine( String.Format("from {0} to {1} : min={2:0.00}{5} avg={3:0.00}{5} max={4:0.00}{5}", m.get_startTimeUTC_asDateTime().ToString(fmt), m.get_endTimeUTC_asDateTime().ToString(fmt), m.get_minValue(), m.get_averageValue(), m.get_maxValue(), sensor.get_unit())); } }
private List <YMeasure> LoadQT(string hwid) { YQt qt = YQt.FindQt(hwid); YDataSet dataset = qt.get_recordedData(0, 0); int progress = 0; do { progress = dataset.loadMore(); } while(progress < 100); Console.WriteLine("Using DataLogger of " + qt.get_friendlyName()); YMeasure summary = dataset.get_summary(); List <YMeasure> res_bad = dataset.get_measures(); List <YMeasure> res = new List <YMeasure>(); foreach (YMeasure m in res_bad) { if (m.get_startTimeUTC() > 100) { res.Add(m); } } String line = String.Format("from {0} to {1} : min={2:0.00} avg={3:0.00} max={4:0.00}", summary.get_startTimeUTC_asDateTime().ToString(fmt), summary.get_endTimeUTC_asDateTime().ToString(fmt), summary.get_minValue(), summary.get_averageValue(), summary.get_maxValue() ); Console.WriteLine(line); return(res); }
async Task sensorTimedReportCallBack(YSensor fct, YMeasure measure) { Output.Text += await fct.get_hardwareId() + ": " + measure.get_averageValue() + " " + await fct.get_userData() + " (timed report)\n"; }
static void sensorTimedReportCallBack(YSensor fct, YMeasure measure) { Console.WriteLine(fct.get_hardwareId() + ": " + measure.get_averageValue() + " " + fct.get_userData() + " (timed report)"); }