| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
ControlBase Class Reference#include <ControlBase.h>
Inheritance diagram for ControlBase: ![]() Detailed DescriptionBase class for all items in the Controller hierarchy.These are similar to behaviors in that they can do processing and are told when to start and stop. However, the important difference is that these have to follow a much tighter set of guidelines for a more refined purpose - user interface. Controls do not directly receive events - the Controller will process events for them and call the appropriate functions at the appropriate times. Controls are expected to fit into a heirarchical scheme, where each control (except the root) has a parent which created it, and may return its own children where appropriate. Controls can be very powerful, and a class can be both a behavior and a control. This allows integrated user interface to controlling a complex behavior. Some controls may simply need EventListener access instead to perform a few tricks. Mix and match as you see fit. (multiple inheritance can be nice if it's planned for, as these have been)
This base class will do most of the work of maintaining submenus for you, and will call appropriate virtual functions which you are expected to override. Controls generally live in The ControlBase pointers which are returned at various points are the responsibility of the creator. Controller will not delete them upon deactivation.
GUI Theory:
Obviously, higher levels require more technological resources, which also means there's more to go wrong and debug. However, another important distinction between the first level and the others is that the first level does not require the user to lose direct contact with the robot. Requiring the user to move back and forth from robot to computer can be much more frustrating than decoding LED signals or press head buttons. There are also safety issues when triggering behaviors remotely if the robot is out of immediate reach. But of course, having a GUI and text output is extremely valuable in terms of ease of use and efficiency. So, the lesson is to try to support all 3 levels so that your interfaces will be robust and efficient in a variety of environments. You'll thank yourself when you're demoing on the road and you can't get wavelan up, or the guest machine you're supposed to use doesn't have Java, or whatever.
Definition at line 65 of file ControlBase.h.
Member Function Documentation
Called when the control is activated (or the control system is reactivating). Takes the id number of a LedMC which the control should use, maintained by Controller. Controls share the display which is passed, and may use the socket gui to communicate with the GUI controller, if it is connected.
Reimplemented in PostureEditor, TorqueCalibrate::TakeMeasurementControl, and WaypointWalkControl. Referenced by WalkCalibration::activate(), ValueEditControl< T >::activate(), FileBrowserControl::activate(), BehaviorSwitchControlBase::activate(), BatteryCheckControl::activate(), and doSelect().
when the user wants to cancel - you should almost always return NULL now unless you need to override the cancel in order to confirm something (e.g. "Save changes?")
The value which is returned is then activate()ed and pushed on the Controller's stack, you probably want to return Definition at line 185 of file ControlBase.cc.
when the user wants to increment the control - default is to hilight the first non-null slot after the last hilight, and return
The value which is returned is then activate()ed and pushed on the Controller's stack, so you probably want to return Reimplemented in NullControl, and ValueEditControl< T >. Definition at line 149 of file ControlBase.cc.
when the user wants to decrement the control - default is to hilight the last non-null slot before the first hilight, and return
The value which is returned is then activate()ed and pushed on the Controller's stack, so you probably want to return Reimplemented in NullControl, and ValueEditControl< T >. Definition at line 167 of file ControlBase.cc.
prompt the user for text input on the current input device (cin, tekkotsu console (sout), or GUI)
The value which is returned is then activate()ed and pushed on the Controller's stack, so you probably want to return Reimplemented in NullControl, and StringInputControl. Definition at line 191 of file ControlBase.cc. Referenced by StringInputControl::doReadStdIn(), WalkCalibration::processEvent(), and WalkCalibration::takeInput().
when the user has trigger an "open selection" - default is to return the hilighted control*/ The value which is returned is then activate()ed and pushed on the Controller's stack Reimplemented in BatteryCheckControl, ConfigurationEditor::NewCollectionEntry, ConfigurationEditor::NamedEnumerationEditor, EventLogger, FileBrowserControl, MCValueEditControl< T >, NullControl, RebootControl, SensorObserverControl, ShutdownControl, ToggleControl, ValueEditControl< T >, WalkCalibration, WaypointWalkControl, and WaypointWalkControl::WaypointEditControl. Definition at line 108 of file ControlBase.cc. Referenced by WaypointWalkControl::WaypointEditControl::doSelect(), WaypointWalkControl::doSelect(), WalkCalibration::doSelect(), FileBrowserControl::doSelect(), ConfigurationEditor::NewCollectionEntry::doSelect(), and takeInput().
called by takeInput if the input doesn't match any slots or matches multiple slots -- the ControlBase implementation displays an error and returns itself
Reimplemented in FileInputControl. Definition at line 396 of file ControlBase.cc. Referenced by FileInputControl::invalidInput(), and takeInput().
called when the user has supplied a text string (may or may not have been prompted by doReadStdIn()! May not even be active yet - the user can direct the same input to a set of hilighted menus) The value which is returned is then activate()ed and pushed on the Controller's stack Reimplemented in BehaviorSwitchControlBase, FileBrowserControl, NullControl, SavePostureControl, SaveWalkControl, StringInputControl, TorqueCalibrate::TakeMeasurementControl, ValueEditControl< T >, and WalkCalibration. Definition at line 222 of file ControlBase.cc. Referenced by doReadStdIn(), Controller::select(), WalkCalibration::takeInput(), NullControl::takeInput(), FileBrowserControl::takeInput(), BehaviorSwitchControlBase::takeInput(), and Controller::takeLine().
Member Data Documentation
toggles using VT100 codes to reposition the cursor at the beginning of the menu we don't always want to do this, any time someone else might have written to the display we set this to false so we don't overwrite it. Definition at line 158 of file ControlBase.h. Referenced by deactivate(), doSelect(), pause(), refresh(), DumpFileControl::selectedFile(), and takeInput().
The documentation for this class was generated from the following files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Fri May 11 20:07:59 2007 by Doxygen 1.4.7 |