public DigitalSensorSimulator(byte id, Button button) { ioRegister = new WritableRegister <BoolData>(id, 0f); button.MouseDown += Button_MouseDown; button.MouseUp += Button_MouseUp; Button_MouseUp(null, null); }
public PressureSensorSimulator(byte id, TrackBar temp, TrackBar pres) { SensorRegister = new WritableRegister <Vector2Data>(id, 0f); initTrackBar(temp, 10 * 5, 30 * 5, 25 * 5); initTrackBar(pres, atmPressure * 5, (atmPressure + pressureRange) * 5, atmPressure * 5); temp.Scroll += Temp_Scroll; pres.Scroll += Pres_Scroll; Temp_Scroll(temp, null); Pres_Scroll(pres, null); }
public ImuSimulator( byte TemperatureId, TrackBar TemperatureTrackBar, Label TemperatureFeedbackLabel, byte accelId, TrackBar trackBarX, TrackBar trackBarY, TrackBar trackBarZ, byte magnetometerId, byte gyroscopeId, byte eulerId, byte linearAccelId, byte gravityId, byte quatId ) { TemperatureRegister = new WritableRegister <Int8Data>(TemperatureId, 0f); this.tempFeedbackLabel = TemperatureFeedbackLabel; if (TemperatureTrackBar.Maximum < sbyte.MaxValue) { TemperatureTrackBar.Maximum = sbyte.MaxValue; TemperatureTrackBar.Value = sbyte.MaxValue; TemperatureTrackBar.Minimum = sbyte.MinValue; } else { TemperatureTrackBar.Minimum = sbyte.MinValue; TemperatureTrackBar.Value = sbyte.MinValue; TemperatureTrackBar.Maximum = sbyte.MaxValue; } TemperatureTrackBar.Value = 25; TemperatureTrackBar.Maximum = sbyte.MaxValue; TemperatureTrackBar.Minimum = sbyte.MinValue; TemperatureTrackBar.Scroll += TemperatureTrackBar_ValueChanged; TemperatureTrackBar_ValueChanged(TemperatureTrackBar, null); AccelerometerRegister = new WritableRegister <Imu100Vector3Data>(accelId, 0f); initTrackBar(trackBarX); initTrackBar(trackBarY); initTrackBar(trackBarZ); trackBarX.Scroll += AccelTrackBarX_ValueChanged; trackBarY.Scroll += AccelTrackBarY_ValueChanged; trackBarZ.Scroll += AccelTrackBarZ_ValueChanged; AccelTrackBarX_ValueChanged(trackBarX, null); AccelTrackBarY_ValueChanged(trackBarY, null); AccelTrackBarZ_ValueChanged(trackBarZ, null); MagnetometerRegister = new WritableRegister <Imu16Vector3Data>(magnetometerId, 0f); GyroscopeRegister = new WritableRegister <Imu16Vector3Data>(gyroscopeId, 0f); EulerRegister = new WritableRegister <Imu16Vector3Data>(eulerId, 0f); LinearAccelRegister = new WritableRegister <Imu100Vector3Data>(linearAccelId, 0f); GravityRegister = new WritableRegister <Imu100Vector3Data>(gravityId, 0f); QuaternionRegister = new WritableRegister <ImuQuaternionData>(quatId, 0f); }
public DigitalActuator(byte id, float refreshRate = 50f) { ioRegister = new WritableRegister <BoolData>(id, refreshRate); }