protected virtual void motoControl_SensorUpdate(object sender, SensorUpdateEventArgs e) { if (m_runmotor == false) { return; } string position = e.Value.ToString(); //pCallback("motoControl_SensorUpdate", position); }
protected override void motoControl_SensorUpdate(object sender, SensorUpdateEventArgs e) { if (m_motorIndex != e.Index) { return; } string position = (e.Value * m_motorLengthInMili).ToString(); MotorLogic((float)(e.Value * m_motorLengthInMili)); pCallback("motoControl_SensorUpdate", position.ToString()); }
private void TDSensorEvent(IntPtr protocol, IntPtr model, int id, int dataType, IntPtr value, int timestamp, int callbackId, IntPtr context) { string parsedProtocol = Marshal.PtrToStringAnsi(protocol); string parsedModel = Marshal.PtrToStringAnsi(model); string parsedValue = Marshal.PtrToStringAnsi(value); SensorUpdateEventArgs eventArgs = new SensorUpdateEventArgs { Value = new SensorValue { SensorID = id, Type = (SensorValueType)dataType, Value = parsedValue, Timestamp = timestamp.ToLocalDateTime() } }; SensorUpdated.Trigger(this, eventArgs); }
protected override void motoControl_SensorUpdate(object sender, SensorUpdateEventArgs e) { if (m_motorIndex != e.Index) { return; } if (m_position < m_targetPosition) { m_position += 0.1f; } else if (m_position > m_targetPosition) { m_position -= 0.1f; } MotorLogic(m_position); pCallback("motoControl_SensorUpdate", m_position.ToString()); }
private void TelldusCoreService_SensorUpdated(object sender, SensorUpdateEventArgs e) { logger.LogInformation($"Received sensor update from sensor with ID '{e?.Value?.SensorID}'."); webHookService.SendSensorWebHook(e.Value); }
void motoControl_SensorUpdate(object sender, SensorUpdateEventArgs e) { TextBox sensorsTxt = ((TextBox)sensorsGroup.Controls["sensor" + e.Index + "Txt"]); sensorsTxt.Text = e.Value.ToString(); }