|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.Box
brbrain.GUI
brbrain.PoseGUI
public class PoseGUI
Dynamixel GUI component for a Pose
.
Displays a table of all of the registers of all of the dynamixels in
Pose
. The registers are either in columns or rows depending on
whether registerAxis
is BoxLayout.Y_AXIS
or
BoxLayout.X_AXIS
, respectively.
Dynamixels names are displayed (passing null for any or all dynamixel names uses default names generated from the dynamixel IDs), and register names and units are optionally displayed. The data for each register can be configured to display in either raw or natural units.
Each register may be editable and if so accepts and validates typing from the user.
The GUI further supports synchronization of the data with an BRBrain
, either read-only (data in GUI updated to reflect current state of
hardware) or read/write, using the write span of the pose
.
Copyright (C) 2007 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Nested Class Summary | |
---|---|
protected class |
PoseGUI.DynamixelBox
displays a dynamixel name and PoseGUI.ValueBox es |
protected class |
PoseGUI.RegisterNameBox
shows register names and units |
protected class |
PoseGUI.ValueBox
A box containing the numeric value of a dynamixel register, either in raw or natural units according to useNaturalUnits . |
Nested classes/interfaces inherited from class brbrain.GUI |
---|
GUI.RemoveTask |
Nested classes/interfaces inherited from class javax.swing.Box |
---|
javax.swing.Box.AccessibleBox, javax.swing.Box.Filler |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int[] |
adcValue
most recently read CM-5 raw ADC values |
static int |
AUTO_SYNC_THREAD_GRANULARITY_MS
update granularity of autoSyncThread |
protected static java.util.List<PoseGUI> |
autoSyncAddList
global auto sync add list |
protected BRBrain |
autoSyncBRBrain
the BRBrain to auto sync, if any |
protected javax.swing.JCheckBox |
autoSyncCheckBox
auto sync box |
protected boolean |
autoSyncEnableWrite
whether to enable write in auto sync |
protected javax.swing.JCheckBox |
autoSyncEnableWriteCheckBox
auto sync enable write box |
protected static java.util.List<PoseGUI> |
autoSyncList
global auto sync list |
protected java.lang.Object |
autoSyncLock
lock for changing auto sync params |
protected int |
autoSyncMinUpdatePeriodMS
min period of auto sync |
protected javax.swing.JTextField |
autoSyncMinUpdatePeriodMSField
auto min update period field box |
protected boolean |
autoSyncSaveAndRestoreFormat
whether to save and restore format in auto sync |
protected javax.swing.JCheckBox |
autoSyncSaveAndRestoreFormatsCheckBox
auto sync save/restore formats box |
protected boolean |
autoSyncSetFormats
whether to set format in auto sync |
protected javax.swing.JCheckBox |
autoSyncSetFormatsCheckBox
auto sync set formats box |
protected static java.lang.Thread |
autoSyncThread
the auto sync daemon thread, if any |
int[] |
axIDs
the set of dynamixelIDs; do not mutate |
private static java.lang.String |
cvsid
|
static boolean |
DEF_SYNC_ENABLE_WRITE
default for sync |
static int |
DEF_SYNC_MIN_UPDATE_PERIOD_MS
default for sync |
static boolean |
DEF_SYNC_SAVE_AND_RESTORE_FORMAT
default for sync |
static boolean |
DEF_SYNC_SET_FORMAT
default for sync |
protected BRBrain |
defSyncBRBrain
default sync BRBrain |
protected boolean |
defSyncEnableWrite
default sync enable write |
protected int |
defSyncMinUpdatePeriodMS
default sync min update period |
protected boolean |
defSyncSaveAndRestoreFormats
default sync save and restore formats |
protected boolean |
defSyncSetFormats
default sync set formats |
protected PoseGUI.DynamixelBox[] |
dynamixelBoxes
the PoseGUI.DynamixelBox es |
protected java.lang.String[] |
dynamixelNames
the names to display for each dynamixel |
protected javax.swing.JCheckBox |
enableWriteCheckBox
manual sync enable write box |
protected javax.swing.JButton |
estopButton
the estop button, if any |
protected java.text.DecimalFormat |
floatFormat
format a float with two decimal digits |
protected int |
lastSyncStartTimeMS
start time of latest sync |
protected int |
lastSyncTimeMS
latest sync transaction duration |
protected int |
lastUpdatePeriodMS
latest time between syncs |
protected javax.swing.JLabel |
negVoltageLabel
negative battery voltage label |
int |
numDynamixels
the number of dynamixels in pose |
int |
numRegisters
the number of registers in pose |
protected int |
numSyncs
total number of syncs so far |
protected Pose |
pose
the Pose reference, synchronized by poseLock |
protected java.lang.Object |
poseLock
lock for changing the pose reference |
protected javax.swing.JLabel |
posVoltageLabel
positive battery voltage label |
protected int[] |
readAXIDSave
saved read format dynamixel IDs |
protected int[] |
readLengthSave
saved read format lengths |
int |
readNum
the number of regs in the BRBrain read format |
AXRegister |
readStart
the first reg in the BRBrain read format |
protected AXRegister[] |
readStartSave
saved read format starts |
static int |
REFRESH_PERIOD_MS
gui refresh period |
protected static java.util.List<PoseGUI> |
refreshList
global gui refresh list |
protected java.lang.Object |
refreshLock
lock for GUI update from pose |
protected boolean |
refreshPending
whether a refresh is still waiting to happen |
protected static java.lang.Thread |
refreshThread
global gui refresh thread |
protected int |
registerAxis
the axis along which registers are arrayed |
protected PoseGUI.RegisterNameBox |
registerNameBox
the PoseGUI.RegisterNameBox , if any |
AXRegister[] |
registers
the set of registers; do not mutate |
protected javax.swing.JCheckBox |
saveAndRestoreFormatsCheckBox
manual sync save/restore formats box |
protected javax.swing.JCheckBox |
setFormatsCheckBox
manual sync set formats box |
static int |
STRUT
component spacing |
protected javax.swing.JButton |
syncButton
manual sync button |
protected int[] |
syncReadData
BRBrain read block |
protected java.lang.String |
syncText
text to display in sync label |
protected int[] |
syncWriteData
BRBrain write block |
protected boolean |
syncWritePending
whether a write should be done if enabled on the next sync |
protected javax.swing.JLabel |
thermLabel
thermistor label |
protected java.util.Map<AXRegister,java.lang.Boolean> |
useNaturalUnits
whether to use natural units for each register |
static int |
VALUE_FIELD_HEIGHT
height of PoseGUI.ValueBox fields |
static int |
VALUE_FIELD_WIDTH
width of PoseGUI.ValueBox fields |
protected java.util.Map<AXRegister,PoseGUI.ValueBox[]> |
valueBoxes
PoseGUI.ValueBox es indexed first by register then by dynamixel index |
protected int[] |
writeAXIDSave
saved write format dynamixel IDs |
protected int[] |
writeLengthSave
saved write format lengths |
int |
writeNum
the number of regs in the BRBrain write format, or 0 if none |
AXRegister |
writeStart
the first reg in the BRBrain write format, or null if none |
protected AXRegister[] |
writeStartSave
saved write format starts |
Fields inherited from class brbrain.GUI |
---|
lastFrame, MAX_SPLIT_LABEL_CHARS |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PoseGUI(int[] axIDs,
AXRegister[] registers,
AXRegister writeStart,
int writeNum,
int registerAxis,
java.lang.String[] dynamixelNames,
boolean showRegisterNames,
boolean[] registerEditable,
boolean enableShowEstop,
boolean showADCs,
boolean showManualSync,
boolean showAutoSync)
make a gui with a new Pose |
|
PoseGUI(int[] axIDs,
AXRegister[] registers,
AXRegister writeStart,
int writeNum,
int registerAxis,
java.lang.String[] dynamixelNames,
boolean showRegisterNames,
boolean editable,
boolean enableShowEstop,
boolean showADCs,
boolean showManualSync,
boolean showAutoSync)
make a gui where everything is either editable or not |
|
PoseGUI(int axID,
AXRegister[] registers,
AXRegister writeStart,
int writeNum,
int registerAxis,
java.lang.String dynamixelName,
boolean showRegisterNames,
boolean editable,
boolean enableShowEstop,
boolean showADCs,
boolean showManualSync,
boolean showAutoSync)
make a GUI for one dynamixel |
|
PoseGUI(Pose pose,
int registerAxis,
java.lang.String[] dynamixelNames,
boolean showRegisterNames,
boolean[] registerEditable,
boolean enableShowEstop,
boolean showADCs,
boolean showManualSync,
boolean showAutoSync)
make a gui for an existing Pose |
Method Summary | |
---|---|
protected void |
addGUI(GUI gui)
hook for adding the main gui |
protected static void |
addToRefreshList(PoseGUI gui)
add a gui to the global refresh list |
void |
autoSync()
Covers autoSync(BRBrain, int, boolean, boolean, boolean) , uses
sync defaults. |
void |
autoSync(BRBrain brBrain)
Covers autoSync(BRBrain, int, boolean, boolean, boolean) , uses
sync defaults. |
void |
autoSync(BRBrain brBrain,
int minUpdatePeriodMS,
boolean enableWrite,
boolean setFormats,
boolean saveAndRestoreFormat)
Initiate or change automatic periodic synchronization of this GUI with the hardware via an BRBrain . |
void |
autoSync(int minUpdatePeriodMS)
Covers autoSync(BRBrain, int, boolean, boolean, boolean) , uses
sync defaults. |
protected static boolean[] |
consEditable(AXRegister[] registers,
boolean editable)
make up an editable array |
protected void |
didSync(Pose pose,
BRBrain brBrain,
boolean didWrite,
boolean didRead,
boolean setFormats,
boolean savedAndRestoredFormat,
int syncNum,
long startTime,
long duration)
Hook called after each sync, while synchronized on refreshLock
and pose . |
void |
doEstop()
Attempt to estop all dynamixels that we know about. |
Pose |
getPose()
Get a reference to the current pose , internally synchronized
with setPose(brbrain.Pose) . |
java.lang.String |
getSyncStats()
Get a stats report on all sync(BRBrain, boolean, boolean,
boolean) till now. |
protected void |
handleEditAutoSync()
handle edits to the auto sync GUI |
protected void |
refresh()
do actual gui refresh from within the AWT event thread |
void |
refreshFromPose()
Schedule a refresh of the GUI from the curent data in pose . |
protected static void |
removeFromRefreshList(PoseGUI gui)
remove a gui from the global refresh list |
Pose |
setPose(Pose pose)
Set pose . |
void |
setSyncDefaults(BRBrain defSyncBRBrain,
int defSyncMinUpdatePeriodMS,
boolean defSyncEnableWrite,
boolean defSyncSetFormats,
boolean defSyncSaveAndRestoreFormats)
set default sync params |
void |
setSyncFormats(BRBrain brBrain)
covers setSyncFormats(BRBrain, boolean) , sets write format |
void |
setSyncFormats(BRBrain brBrain,
boolean setWriteFormat)
Set the read and optionally the write formats of brBrain to those of pose . |
void |
setUseNaturalUnits(AXRegister register,
boolean enable)
use natural units for the specified register |
void |
setUseNaturalUnits(boolean enable)
use natural units for all registers |
void |
sync()
Covers sync(BRBrain, boolean, boolean, boolean) , uses sync
defaults. |
void |
sync(BRBrain brBrain)
Covers sync(BRBrain, boolean, boolean, boolean) , uses sync
defaults. |
void |
sync(BRBrain brBrain,
boolean enableWrite,
boolean setFormats,
boolean saveAndRestoreFormat)
Synchronize this GUI to the hardware via an BRBrain . |
void |
useAllLabelledNaturalUnits()
Use natural units for all regs which specify an AXRegister.naturalUnitsLabel . |
Methods inherited from class brbrain.GUI |
---|
addRemoveTask, addTitledBorder, addTitledBorder, dbgLayout, dbgLayout, makeSplitLabel, otherAxis, wrapInFrame, wrapInFrame |
Methods inherited from class javax.swing.Box |
---|
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, paintComponent, setLayout |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String cvsid
public static final boolean DEF_SYNC_ENABLE_WRITE
public static final int DEF_SYNC_MIN_UPDATE_PERIOD_MS
public static final boolean DEF_SYNC_SET_FORMAT
public static final boolean DEF_SYNC_SAVE_AND_RESTORE_FORMAT
public static final int VALUE_FIELD_WIDTH
PoseGUI.ValueBox
fields
public static final int VALUE_FIELD_HEIGHT
PoseGUI.ValueBox
fields
public static final int STRUT
public static final int REFRESH_PERIOD_MS
protected static final java.util.List<PoseGUI> refreshList
protected final java.lang.Object refreshLock
pose
protected final java.lang.Object poseLock
protected final java.lang.Object autoSyncLock
protected Pose pose
Pose
reference, synchronized by poseLock
public final int[] axIDs
public final AXRegister[] registers
public final AXRegister readStart
BRBrain
read format
public final AXRegister writeStart
BRBrain
write format, or null if none
public final int readNum
BRBrain
read format
public final int writeNum
BRBrain
write format, or 0 if none
public final int numDynamixels
pose
public final int numRegisters
pose
protected final java.lang.String[] dynamixelNames
protected final java.util.Map<AXRegister,java.lang.Boolean> useNaturalUnits
protected final int registerAxis
protected boolean refreshPending
protected boolean syncWritePending
protected final java.util.Map<AXRegister,PoseGUI.ValueBox[]> valueBoxes
PoseGUI.ValueBox
es indexed first by register then by dynamixel index
protected final PoseGUI.DynamixelBox[] dynamixelBoxes
PoseGUI.DynamixelBox
es
protected final PoseGUI.RegisterNameBox registerNameBox
PoseGUI.RegisterNameBox
, if any
protected int lastSyncStartTimeMS
protected int lastSyncTimeMS
protected int lastUpdatePeriodMS
protected int numSyncs
protected final int[] syncWriteData
protected final int[] syncReadData
protected int[] writeAXIDSave
protected int[] readAXIDSave
protected AXRegister[] writeStartSave
protected AXRegister[] readStartSave
protected int[] writeLengthSave
protected int[] readLengthSave
public static final int AUTO_SYNC_THREAD_GRANULARITY_MS
autoSyncThread
protected static final java.util.List<PoseGUI> autoSyncList
protected static final java.util.List<PoseGUI> autoSyncAddList
protected BRBrain autoSyncBRBrain
protected int autoSyncMinUpdatePeriodMS
protected boolean autoSyncEnableWrite
protected boolean autoSyncSetFormats
protected boolean autoSyncSaveAndRestoreFormat
protected javax.swing.JButton estopButton
protected javax.swing.JLabel posVoltageLabel
protected javax.swing.JLabel negVoltageLabel
protected javax.swing.JLabel thermLabel
protected javax.swing.JButton syncButton
protected javax.swing.JCheckBox enableWriteCheckBox
protected javax.swing.JCheckBox setFormatsCheckBox
protected javax.swing.JCheckBox saveAndRestoreFormatsCheckBox
protected javax.swing.JCheckBox autoSyncCheckBox
protected javax.swing.JTextField autoSyncMinUpdatePeriodMSField
protected javax.swing.JCheckBox autoSyncEnableWriteCheckBox
protected javax.swing.JCheckBox autoSyncSaveAndRestoreFormatsCheckBox
protected javax.swing.JCheckBox autoSyncSetFormatsCheckBox
protected BRBrain defSyncBRBrain
BRBrain
protected int defSyncMinUpdatePeriodMS
protected boolean defSyncEnableWrite
protected boolean defSyncSetFormats
protected boolean defSyncSaveAndRestoreFormats
protected java.lang.String syncText
protected java.text.DecimalFormat floatFormat
protected int[] adcValue
protected static final java.lang.Thread autoSyncThread
protected static final java.lang.Thread refreshThread
Constructor Detail |
---|
public PoseGUI(Pose pose, int registerAxis, java.lang.String[] dynamixelNames, boolean showRegisterNames, boolean[] registerEditable, boolean enableShowEstop, boolean showADCs, boolean showManualSync, boolean showAutoSync)
Pose
public PoseGUI(int[] axIDs, AXRegister[] registers, AXRegister writeStart, int writeNum, int registerAxis, java.lang.String[] dynamixelNames, boolean showRegisterNames, boolean[] registerEditable, boolean enableShowEstop, boolean showADCs, boolean showManualSync, boolean showAutoSync)
Pose
public PoseGUI(int[] axIDs, AXRegister[] registers, AXRegister writeStart, int writeNum, int registerAxis, java.lang.String[] dynamixelNames, boolean showRegisterNames, boolean editable, boolean enableShowEstop, boolean showADCs, boolean showManualSync, boolean showAutoSync)
public PoseGUI(int axID, AXRegister[] registers, AXRegister writeStart, int writeNum, int registerAxis, java.lang.String dynamixelName, boolean showRegisterNames, boolean editable, boolean enableShowEstop, boolean showADCs, boolean showManualSync, boolean showAutoSync)
Method Detail |
---|
protected void handleEditAutoSync()
protected void addGUI(GUI gui)
protected static boolean[] consEditable(AXRegister[] registers, boolean editable)
public void setUseNaturalUnits(AXRegister register, boolean enable)
public void setUseNaturalUnits(boolean enable)
public void useAllLabelledNaturalUnits()
Use natural units for all regs which specify an AXRegister.naturalUnitsLabel
.
public java.lang.String getSyncStats()
Get a stats report on all sync(BRBrain, boolean, boolean,
boolean)
till now.
public void setSyncFormats(BRBrain brBrain, boolean setWriteFormat) throws java.io.IOException, java.lang.InterruptedException
Set the read and optionally the write formats of brBrain to
those of pose
.
java.io.IOException
java.lang.InterruptedException
public void setSyncFormats(BRBrain brBrain) throws java.io.IOException, java.lang.InterruptedException
setSyncFormats(BRBrain, boolean)
, sets write format
java.io.IOException
java.lang.InterruptedException
public void sync(BRBrain brBrain, boolean enableWrite, boolean setFormats, boolean saveAndRestoreFormat) throws java.io.IOException, java.lang.InterruptedException
Synchronize this GUI to the hardware via an BRBrain
.
The synchronization always includes a read of all the registers in this
GUI from the hardware, and may optionally include a write of the registers
in the pose
write span to the hardware. If a write is incurred,
it is done before the readback.
Internally synchronized with respect to pose
, the GUI, and
brBrain.
enableWrite
- whether to even consider doing the write. Write will
only actually be incurred if this is true and syncWritePending
,
which is set only when pose
is changed by setPose(brbrain.Pose)
or
when the user has validly edited a value which is both writeable and
editable.setFormats
- whether to setSyncFormats(BRBrain, boolean)
before doing the transactionsaveAndRestoreFormat
- whether to save and restore the current read
write (if necessary) formats on the brBrain before and after doing the
transaction
java.io.IOException
java.lang.InterruptedException
protected void didSync(Pose pose, BRBrain brBrain, boolean didWrite, boolean didRead, boolean setFormats, boolean savedAndRestoredFormat, int syncNum, long startTime, long duration)
Hook called after each sync, while synchronized on refreshLock
and pose
.
public void sync(BRBrain brBrain) throws java.io.IOException, java.lang.InterruptedException
Covers sync(BRBrain, boolean, boolean, boolean)
, uses sync
defaults.
java.io.IOException
java.lang.InterruptedException
public void sync() throws java.io.IOException, java.lang.InterruptedException
Covers sync(BRBrain, boolean, boolean, boolean)
, uses sync
defaults.
java.io.IOException
java.lang.InterruptedException
public void setSyncDefaults(BRBrain defSyncBRBrain, int defSyncMinUpdatePeriodMS, boolean defSyncEnableWrite, boolean defSyncSetFormats, boolean defSyncSaveAndRestoreFormats)
public void autoSync(BRBrain brBrain, int minUpdatePeriodMS, boolean enableWrite, boolean setFormats, boolean saveAndRestoreFormat)
Initiate or change automatic periodic synchronization of this GUI with
the hardware via an BRBrain
.
sync(BRBrain, boolean, boolean, boolean)
will be called by a
daemon thread at the specified rate with the specified arguments.
brBrain
- the BRBrain
to sync, or null to disable auto syncminUpdatePeriodMS
- the minimum time in milliseconds between syncs,
negative to disable auto syncpublic void autoSync(BRBrain brBrain)
Covers autoSync(BRBrain, int, boolean, boolean, boolean)
, uses
sync defaults.
public void autoSync(int minUpdatePeriodMS)
Covers autoSync(BRBrain, int, boolean, boolean, boolean)
, uses
sync defaults.
public void autoSync()
Covers autoSync(BRBrain, int, boolean, boolean, boolean)
, uses
sync defaults.
public Pose getPose()
Get a reference to the current pose
, internally synchronized
with setPose(brbrain.Pose)
.
public Pose setPose(Pose pose)
Set pose
.
Iff the new pose differs from the current one syncWritePending
is set and refreshFromPose()
is called after setting the new
pose.
Internally synchronized with getPose()
, sync(brbrain.BRBrain, boolean, boolean, boolean)
, and
refreshFromPose()
.
pose
- the new pose, not null, and must be same format as the current
pose
pose
protected static void addToRefreshList(PoseGUI gui)
protected static void removeFromRefreshList(PoseGUI gui)
public void refreshFromPose()
Schedule a refresh of the GUI from the curent data in pose
.
The refresh will occur at some later time from within the AWT event thread. Multiple scheduled refreshes will be coalesced.
protected void refresh()
public void doEstop()
Attempt to estop all dynamixels that we know about.
This can succeed only if a default syncable BRBrain
has been
established by calling sync(brbrain.BRBrain, boolean, boolean, boolean)
, autoSync(brbrain.BRBrain, int, boolean, boolean, boolean)
, or setSyncDefaults(brbrain.BRBrain, int, boolean, boolean, boolean)
prior to this call. That BRBrain is taken as the one on
which to estop the dynamixels.
Our pose
must contain either AX12Register.AX12_TORQUE_ENABLE
or both AX12Register.AX12_GOAL_POSITION
and AX12Register.AX12_PRESENT_POSITION
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |