Package com.inertia.promove
Class Config.AccelConfigExt
java.lang.Object
com.inertia.promove.Config.AccelConfig
com.inertia.promove.Config.AccelConfigExt
- All Implemented Interfaces:
Config.AbstractConfig
,Config.LegacyConfig
- Enclosing class:
- Config
public static class Config.AccelConfigExt extends Config.AccelConfig
AccelConfigExt configuration
-
Field Summary
Fields Modifier and Type Field Description boolean
adoptMod
boolean
adoptOffset
boolean
adoptScale
int
channelPositionMask
boolean
enableLogging
boolean
enableSampling
boolean
enableTransmit
int
instance
long
mod
int
offsetX
int
offsetY
int
offsetZ
int
revision
int
samplingChannel
double
scaleX
double
scaleY
double
scaleZ
int
wordSize
Fields inherited from class com.inertia.promove.Config.AccelConfig
hardwareRate1, hardwareRate2, hardwareScale1, hardwareScale2, hardwareType
-
Constructor Summary
Constructors Constructor Description AccelConfigExt()
-
Method Summary
Modifier and Type Method Description int
getBytes(byte[] out)
encode current configuration in a byte arrayConfig.Mask
getMask()
get maskint
parse(byte[] in)
pare input byte array to relevant configuration and return length of encoded configvoid
set(int _instance, int _samplingChannel, int _wordSize, int _revision, int _channelPositionMask)
set all parametersvoid
setMod(long _mod)
set modulus for sampling (i.e.void
setOffset(int _offsetX, int _offsetY, int _offsetZ)
set offset in all directionsvoid
setSampling(boolean _enableSampling, boolean _enableTransmit, boolean _enableLogging)
set sampling related booleansvoid
setScale(double _scaleX, double _scaleY, double _scaleZ)
set scale in all directionsjava.lang.String
toString()
create a string representation of the configurationMethods inherited from class com.inertia.promove.Config.AccelConfig
getRangeFactor, set, set, setCustomRangeFactor
-
Field Details
-
instance
public int instance -
samplingChannel
public int samplingChannel -
wordSize
public int wordSize -
revision
public int revision -
channelPositionMask
public int channelPositionMask -
adoptOffset
public boolean adoptOffset -
adoptScale
public boolean adoptScale -
scaleX
public double scaleX -
scaleY
public double scaleY -
scaleZ
public double scaleZ -
offsetX
public int offsetX -
offsetY
public int offsetY -
offsetZ
public int offsetZ -
enableSampling
public boolean enableSampling -
enableTransmit
public boolean enableTransmit -
enableLogging
public boolean enableLogging -
adoptMod
public boolean adoptMod -
mod
public long mod
-
-
Constructor Details
-
AccelConfigExt
public AccelConfigExt()
-
-
Method Details
-
set
public void set(int _instance, int _samplingChannel, int _wordSize, int _revision, int _channelPositionMask)set all parameters- Parameters:
_instance
- the sensor instance_samplingChannel
- the sampling channel_wordSize
- the wordsize in bits_revision
- the sensor revision_channelPositionMask
- the mask for enabled values within the channel
-
parse
Description copied from interface:Config.AbstractConfig
pare input byte array to relevant configuration and return length of encoded config- Specified by:
parse
in interfaceConfig.AbstractConfig
- Overrides:
parse
in classConfig.AccelConfig
- Parameters:
in
- input byte array- Returns:
- length of encoded config
- Throws:
InertiaException
- upon error such as when length is insufficient
-
getBytes
public int getBytes(byte[] out)Description copied from interface:Config.AbstractConfig
encode current configuration in a byte array- Specified by:
getBytes
in interfaceConfig.AbstractConfig
- Overrides:
getBytes
in classConfig.AccelConfig
- Parameters:
out
- byte array for encoded configuration- Returns:
- length of encoded configuration
-
toString
public java.lang.String toString()Description copied from interface:Config.AbstractConfig
create a string representation of the configuration- Specified by:
toString
in interfaceConfig.AbstractConfig
- Overrides:
toString
in classConfig.AccelConfig
- Returns:
- string representation of configuration
-
setScale
public void setScale(double _scaleX, double _scaleY, double _scaleZ)set scale in all directions- Parameters:
_scaleX
- the scale factor to apply for X_scaleY
- the scale factor to apply for Y_scaleZ
- the scale factor to apply for Z
-
setOffset
public void setOffset(int _offsetX, int _offsetY, int _offsetZ)set offset in all directions- Parameters:
_offsetX
- the offset to apply for X_offsetY
- the offset to apply for Y_offsetZ
- the offset to apply for Z
-
setSampling
public void setSampling(boolean _enableSampling, boolean _enableTransmit, boolean _enableLogging)set sampling related booleans- Parameters:
_enableSampling
- enable sampling?_enableTransmit
- enable transmission?_enableLogging
- enable logging?
-
setMod
public void setMod(long _mod)set modulus for sampling (i.e. divider of global sampling frequency)- Parameters:
_mod
- the modulus
-
getMask
Description copied from interface:Config.AbstractConfig
get mask- Specified by:
getMask
in interfaceConfig.AbstractConfig
- Returns:
- mask for this config
-