public class Magnetometer extends Sensor implements MagnetometerSensor
simulatedOnly, validLoad
Constructor and Description |
---|
Magnetometer()
Loads the default connected sensor
|
Modifier and Type | Method and Description |
---|---|
double[] |
getMagnetometerData() |
float |
getMagnetometerX() |
float |
getMagnetometerY() |
float |
getMagnetometerZ() |
java.lang.String |
getSensorName()
Returns the sensor name, typically the make/model of the hardware sensor that this class refers to.
|
void |
reloadSimulation()
Override this on any classes you need to do something as a simulated sensor
|
void |
resetToDefault()
Remove all rounding
|
Magnetometer |
setRounding(int resolution)
Set the resolution for all three axis to the number of decimal places
set by resolution.
|
void |
setXRounding(int resolution)
Set the resolution for X axis to the number of decimal places
set by resolution.
|
void |
setYRounding(int resolution)
Set the resolution for Y axis to the number of decimal places
set by resolution.
|
void |
setZRounding(int resolution)
Set the resolution for Z axis to the number of decimal places
set by resolution.
|
addListener, addNonResettableListener, addNonResettableValueChangedListener, addValueChangedListener, clearListeners, getSensor, isSimulatedOnly, isValidLoadedSensor, notifyListeners, removeListener, removeListener, roundValue, scaleValue, setSimulatedOnly, setValidLoad, storeSensor
public void resetToDefault()
resetToDefault
in class Sensor
public void reloadSimulation()
Sensor
reloadSimulation
in class Sensor
public Magnetometer setRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void setXRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void setYRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void setZRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic java.lang.String getSensorName()
Sensor
getSensorName
in class Sensor
String
representing the sensor's name.public double[] getMagnetometerData()
getMagnetometerData
in interface MagnetometerSensor
public float getMagnetometerX()
getMagnetometerX
in interface MagnetometerSensor
public float getMagnetometerY()
getMagnetometerY
in interface MagnetometerSensor
public float getMagnetometerZ()
getMagnetometerZ
in interface MagnetometerSensor