void Imager_TemperatureEvent(object sender, TemperatureEventArgs e) { if (this.Dispatcher.CheckAccess()) { if (e.GoodReading) { VM.CameraTemp = e.Temperature; VM.CameraTempString = e.Temperature.ToString(); } else { VM.CameraTempString = "-"; } } else { this.Dispatcher.BeginInvoke(new Action(() => { if (e.GoodReading) { VM.CameraTemp = e.Temperature; VM.CameraTempString = e.Temperature.ToString(); } else { VM.CameraTempString = "-"; } })); } }
void m_imager_temperatureEvent(object sender, TemperatureEventArgs e) { if (e.GoodReading) { VM.TemperatureText = e.Temperature.ToString(); } }
protected void onTemperatureRead(Object sender, EventArgs e) { TemperatureEventArgs tempArgs = e as TemperatureEventArgs; if (tempArgs != null && tempArgs.Index0Based == extruderIndex0Based) { actualTempIndicator.Text = string.Format("{0:0.0}°C", tempArgs.Temperature); } }
//3.开始监控气温,同时发布事件 public void Monitor(int tp) { TemperatureEventArgs e = new TemperatureEventArgs(tp); if (OnWarning != null) { OnWarning(this, e); } }
protected void onTemperatureSet(Object sender, EventArgs e) { TemperatureEventArgs tempArgs = e as TemperatureEventArgs; if (tempArgs != null) { SetTargetTemperature(tempArgs.Temperature); } }
protected void onTemperatureSet(Object sender, EventArgs e) { TemperatureEventArgs tempArgs = e as TemperatureEventArgs; if (tempArgs != null && tempArgs.Index0Based == extruderIndex0Based) { SetTargetTemperature(tempArgs.Temperature); } }
public void Alarming(object sender, TemperatureEventArgs args) { if (args.temperature >= 95) { Console.WriteLine("温度上升, 注意安全!"); if (args.temperature == 100) { Console.WriteLine("已经烧开拉."); } } }
void m_imager_m_insideTemperatureEvent(object sender, TemperatureEventArgs e) { if (e.GoodReading) { VM.InsideTemp = e.Temperature; VM.InsideTempString = e.Temperature.ToString(); } else { VM.InsideTempString = "-"; } }
private void BoilWater(object sender, ElapsedEventArgs e) { temperature++; if (temperature >= 100) { timer.Stop(); } //对温度进行封装 TemperatureEventArgs args = new TemperatureEventArgs(temperature); if (HeaterHandler != null) { HeaterHandler(this, args); } if (OnHeatHandler != null) { OnHeatHandler(this, args); } }
//第三步 声明事件时调用方法 private void Tw_OnWarning(object sender, TemperatureEventArgs e) { if (e.Temperate < 35) { lblShow.Text = "正常"; lblColor.BackColor = Color.Blue; } else if (e.Temperate < 37) { lblShow.Text = "高温黄色预警"; lblColor.BackColor = Color.Yellow; } else if (e.Temperate < 40) { lblShow.Text = "高温橙色预警"; lblColor.BackColor = Color.Orange; } else if (e.Temperate < 37) { lblShow.Text = "高温红色预警"; lblColor.BackColor = Color.Red; } }
public void ShowTemperatuer(object sengder, TemperatureEventArgs tempArg) { Console.WriteLine("当前温度为" + tempArg.temperature); }
void m_imager_m_temperatureEvent(object sender, TemperatureEventArgs e) { VM.CameraTemp = e.Temperature; }
private static void Thermostat_TemperatureMeasuredNotification(object sender, TemperatureEventArgs e) { decimal temperature = e.Temperature; }
private void TempSensor_OnTargetTempReceived(object sender, TemperatureEventArgs ea) { logger.LogWarning("TargetTempUpdated: " + ea.Temperature); this.ProcessTempUpdateAsync(ea.Temperature).Wait(); }
void InstrumentClusterElectronics_TemperatureChanged(TemperatureEventArgs e) { UpdateItems(); }
void m_imager_temperatureEvent(object sender, TemperatureEventArgs e) { }
private void InstrumentClusterElectronics_TemperatureChanged(TemperatureEventArgs e) { UpdateIKEGauge(GaugeType.CoolantTemperatureBC, e.Coolant); UpdateIKEGauge(GaugeType.OutsideTemperature, e.Outside); }