|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectikayaki.squid.Magnetometer
public class Magnetometer
Offers an interface for controlling the magnetometer."
Field Summary | |
---|---|
private boolean |
measuring
|
private Stack<String> |
messageBuffer
Buffer for incoming messages, readed when needed. |
private int |
pollTimeout
|
private SynchronousQueue<String> |
queue
Synchronous queue for waiting result message from magnetometer |
protected SerialIO |
serialIO
COM port for communication. |
private boolean |
waitingForMessage
|
Constructor Summary | |
---|---|
Magnetometer()
Creates a new magnetometer interface. |
Method Summary | |
---|---|
void |
clearFlux(char axis)
Clears flux counter for axis. |
protected void |
configure(char axis,
char subcommand,
char option)
Used for configuring Magnetometer parameters. |
protected String |
getData(char axis,
char command,
String datavalues)
Generic send message sender, use with caution and knowledge. |
char[] |
getFilters()
Returns filter configurations for all axis. |
boolean[] |
getLoop()
Returns if Loops have been opened on axes. |
char[] |
getRange()
Returns range configurations for all axis. |
boolean[] |
getSlew()
Returns Fast Slew options value. |
boolean |
isMeasuring()
|
boolean |
isOK()
Checks if connection is ok. |
protected void |
latchAnalog(char axis)
|
protected void |
latchCounter(char axis)
|
void |
pulseReset(char axis)
Pulse reset (open then close) feedback loop for axis. |
double[] |
readData()
Latches axes, reads counters and analog. |
protected void |
reset(char axis)
Reset settings for axis. |
protected void |
resetCounter(char axis)
Reset counter for axis. |
void |
serialIOEvent(SerialIOEvent event)
Propagates serial port message event. |
void |
updateSettings()
Checks which settings have changed and updates the magnetometer interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Stack<String> messageBuffer
private SynchronousQueue<String> queue
private int pollTimeout
protected SerialIO serialIO
private boolean waitingForMessage
private boolean measuring
Constructor Detail |
---|
public Magnetometer() throws SerialIOException
SerialIOException
Method Detail |
---|
public void updateSettings()
protected void reset(char axis)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.protected void resetCounter(char axis)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.protected void configure(char axis, char subcommand, char option)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.subcommand
- The CONFIGURE subcommands follow: option
- see data values from subcommands.protected void latchAnalog(char axis)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.protected void latchCounter(char axis)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.protected String getData(char axis, char command, String datavalues)
axis
- 'X', 'Y' or 'Z'. All characters are in upper case.command
- "D" Send back the analog data last captured with the LATCH command. The data field is not
required. datavalues
- Datavalues one or more: public void pulseReset(char axis)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.public void clearFlux(char axis)
axis
- 'X', 'Y', 'Z' or 'A' (all). All characters are in upper case.public double[] readData()
public boolean isMeasuring()
public char[] getFilters()
public char[] getRange()
public boolean[] getSlew()
public boolean[] getLoop()
public boolean isOK()
public void serialIOEvent(SerialIOEvent event)
SerialIOListener
serialIOEvent
in interface SerialIOListener
event
- the event that happened.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |