Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
ControlBase Class ReferenceBase class for all items in the Controller hierarchy. More...
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 87 of file ControlBase.h.
Member Typedef Documentation
shorthand for the map between menu names and associated map of entries, see getControllerEntries() Definition at line 184 of file ControlBase.h.
Definition at line 183 of file ControlBase.h. Typically would use MotionManager::MC_ID, but re-specified here for convenience and to avoid dependence on MotionManager.h. Definition at line 90 of file ControlBase.h. Member Enumeration Documentationprovides options for registerControllerEntry() and by extension REGISTER_CONTROLLER_OPT and REGISTER_CONTROLLER_MENU
Definition at line 172 of file ControlBase.h. Constructor & Destructor Documentation
Contructor. Definition at line 96 of file ControlBase.h. Referenced by EventLogger::EventLogger(), PostureEditor::PostureEditor(), SensorObserverControl::SensorObserverControl(), and WalkCalibration::WalkCalibration().
Contructor, initializes with a name. Definition at line 97 of file ControlBase.h.
Contructor, initializes with a name. Definition at line 98 of file ControlBase.h.
Destructor. Definition at line 101 of file ControlBase.h.
you can override, but don't call this... 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 BatteryCheckControl, BehaviorActivatorControl, BehaviorSwitchControlBase, FileBrowserControl, HelpControl, NullControl, PostureEditor, RebootControl, ShutdownControl, ToggleControl, TorqueCalibrate::TakeMeasurementControl, ValueEditControl< T >, WalkCalibration, WaypointWalkControl, and XWalkEdit. Definition at line 13 of file ControlBase.cc.
clears the display (if use_VT100 is on) Definition at line 452 of file ControlBase.cc. Referenced by deactivate(), doSelect(), refresh(), and takeInput().
deletes each slot item and clears the slots Reimplemented in ConfigurationEditor, and EventLogger. Definition at line 411 of file ControlBase.cc. Referenced by ConfigurationEditor::NamedEnumerationEditor::deactivate(), ConfigurationEditor::NewCollectionEntry::deactivate(), ConfigurationEditor::AddCollectionEntry::deactivate(), FileBrowserControl::rebuildmenu(), TorqueCalibrate::TakeMeasurementControl::refresh(), WalkCalibration::setupChoose(), WalkCalibration::setupMoving(), WalkCalibration::setupReading1(), WalkCalibration::setupReading2(), WalkCalibration::setupReady(), WalkCalibration::setupRoot(), SensorObserverControl::updateRT(), ~ControlBase(), and FreeMemReportControl::~FreeMemReportControl().
called when this control is being popped from the control stack Reimplemented in BatteryCheckControl, ConfigurationEditor::AddCollectionEntry, ConfigurationEditor::NewCollectionEntry, ConfigurationEditor::NamedEnumerationEditor, MoCapLogger, PostureEditor, SensorObserverControl::RTViewControl, TorqueCalibrate::TakeMeasurementControl, WalkCalibration, WaypointWalkControl, and XWalkEdit. Definition at line 103 of file ControlBase.cc.
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 200 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 164 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 182 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 206 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 >, MoCapLogger, NullControl, RebootControl, SensorObserverControl, ShutdownControl, ToggleControl, ValueEditControl< T >, WalkCalibration, WaypointWalkControl, and WaypointWalkControl::WaypointEditControl. Definition at line 119 of file ControlBase.cc. Referenced by ConfigurationEditor::NewCollectionEntry::doSelect(), and takeInput().
sets the name of the control Definition at line 355 of file ControlBase.cc.
Provides static/global storage of behaviors requesting to be added to controller menus. This collection is processed by the startup behavior to build the menu structure. Definition at line 188 of file ControlBase.h. Referenced by registerControllerEntry(), and BehaviorBase::registerControllerEntry().
returns a short description of what the control does Reimplemented in BehaviorSwitchControlBase, and BehaviorSwitchControl< B, Al >. Definition at line 151 of file ControlBase.h.
returns display being used Definition at line 165 of file ControlBase.h.
returns a vector of the indicies of hilighted slots Definition at line 161 of file ControlBase.h.
returns the name of the control Reimplemented in BehaviorSwitchControlBase, BehaviorSwitchControl< B, Al >, FreeMemReportControl, and ValueEditControl< T >. Definition at line 148 of file ControlBase.h. Referenced by SensorObserverControl::checkLogFile(), EventLogger::checkLogFile(), StringInputControl::doReadStdIn(), SensorObserverControl::doSelect(), FileBrowserControl::doSelect(), EventLogger::doSelect(), EventLogger::processEvent(), refresh(), and registerControllerEntry().
returns the string that will appear in slot i Definition at line 391 of file ControlBase.cc. Referenced by refresh().
returns the vector of sub-controls Definition at line 153 of file ControlBase.h. Referenced by SensorObserverControl::processEvent(), HelpControl::report(), Controller::select(), and SensorObserverControl::updateRT().
sets the hilight to the first non-null slot Reimplemented in WalkCalibration. Definition at line 434 of file ControlBase.cc. Referenced by activate().
returns the average of the hilighted indicies - used to know to play the "next" sound, or the "prev" sound when the hilight changes Definition at line 468 of file ControlBase.cc. Referenced by setHilights().
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 459 of file ControlBase.cc. Referenced by takeInput().
you can override, but don't call this...
called when a control is being overriden by a child, or the control system is deactivating (e-stop being turned off) Reimplemented in BatteryCheckControl, PostureEditor, SensorObserverControl::RTViewControl, and ValueEditControl< T >. Definition at line 21 of file ControlBase.cc. Referenced by WaypointWalkControl::doSelect().
sets next unused element of options to o Definition at line 407 of file ControlBase.cc. Referenced by EventLogger::EventLogger(), TorqueCalibrate::init(), FreeMemReportControl::init(), FileBrowserControl::init(), ConfigurationEditor::init(), MoCapLogger::MoCapLogger(), PostureEditor::PostureEditor(), FileBrowserControl::rebuildmenu(), WaypointWalkControl::refresh(), TorqueCalibrate::TakeMeasurementControl::refresh(), ConfigurationEditor::NamedEnumerationEditor::refresh(), ConfigurationEditor::NewCollectionEntry::refresh(), ConfigurationEditor::AddCollectionEntry::refresh(), ConfigurationEditor::refresh(), SensorObserverControl::SensorObserverControl(), WalkCalibration::setupChoose(), WalkCalibration::setupClear(), WalkCalibration::setupMoving(), WalkCalibration::setupReading1(), WalkCalibration::setupReading2(), WalkCalibration::setupReady(), WalkCalibration::setupRoot(), SensorObserverControl::updateRT(), WalkCalibration::WalkCalibration(), WaypointWalkControl::WaypointEditControl::WaypointEditControl(), and WaypointWalkControl::WaypointWalkControl().
called when the child has deactivated and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed Reimplemented in BatteryCheckControl, ConfigurationEditor, ConfigurationEditor::AddCollectionEntry, ConfigurationEditor::NewCollectionEntry, ConfigurationEditor::NamedEnumerationEditor, EventLogger, FreeMemReportControl, MoCapLogger, PostureEditor, SensorObserverControl, SensorObserverControl::RTViewControl, StringInputControl, TorqueCalibrate::TakeMeasurementControl, TorqueCalibrate, ValueEditControl< T >, WalkCalibration, and WaypointWalkControl. Definition at line 27 of file ControlBase.cc. Referenced by activate(), doNextItem(), doPrevItem(), FileBrowserControl::doSelect(), invalidInput(), setHilights(), and takeInput().
Registers a ControlBase to be added to the specified Controller menu, use '/' to specify sub-menus, see REGISTER_CONTROLLER macro. This only works when called as an initializer to a static variable. Once the menus have been initialized, later calls to this function won't update the menus. Definition at line 443 of file ControlBase.cc.
Called when the control is picked up from the control registry (implies it is now safe to access global resources, such as erouter). Reimplemented in MoCapLogger. Definition at line 142 of file ControlBase.h.
sets the description of the control Definition at line 150 of file ControlBase.h. Referenced by WaypointWalkControl::doSelect(), and TorqueCalibrate::refresh().
sets display to use Definition at line 166 of file ControlBase.h.
sets the hilighted slots Reimplemented in ConfigurationEditor::NamedEnumerationEditor, and WalkCalibration. Definition at line 418 of file ControlBase.cc. Referenced by ConfigurationEditor::NamedEnumerationEditor::setHilights().
sets the name of the control Reimplemented in ToggleControl. Definition at line 147 of file ControlBase.h. Referenced by SensorObserverControl::checkLogFile(), EventLogger::checkLogFile(), WaypointWalkControl::doSelect(), MoCapLogger::doSelect(), MoCapLogger::gotMoCapGUI(), TorqueCalibrate::refresh(), MoCapLogger::refresh(), MoCapLogger::rename(), WalkCalibration::setupClear(), and WalkCalibration::setupRoot().
sets i'th element of options to o Definition at line 401 of file ControlBase.cc.
returns the number of options available Definition at line 156 of file ControlBase.h. Referenced by BehaviorSwitchControlBase::activate(), WalkCalibration::hilightFirst(), WaypointWalkControl::refresh(), refresh(), WalkCalibration::setHilights(), SensorObserverControl::updateRT(), and WaypointWalkControl::WaypointWalkControl().
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 239 of file ControlBase.cc. Referenced by doReadStdIn(), Controller::select(), NullControl::takeInput(), FileBrowserControl::takeInput(), BehaviorSwitchControlBase::takeInput(), and Controller::takeLine().
may be called before takeInput to verify this Control can make sense of msg Definition at line 350 of file ControlBase.cc. Member Data Documentation
the description of this control Definition at line 209 of file ControlBase.h. Referenced by getDescription(), and setDescription().
LedMC to use for displaying selection. Definition at line 216 of file ControlBase.h. Referenced by activate(), deactivate(), doReadStdIn(), doSelect(), getDisplay(), refresh(), and setDisplay().
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 212 of file ControlBase.h. Referenced by deactivate(), doSelect(), pause(), refresh(), DumpFileControl::selectedFile(), and takeInput().
socket to communicate with the GUI, if it is connected Definition at line 217 of file ControlBase.h. Referenced by activate(), StringInputControl::doReadStdIn(), doReadStdIn(), doSelect(), WalkCalibration::refresh(), ValueEditControl< T >::refresh(), refresh(), and ConfigurationEditor::NamedEnumerationEditor::refresh().
keep sorted - index(es) of current selection - can have multiple if using GUI Definition at line 210 of file ControlBase.h. Referenced by clearSlots(), deactivate(), doNextItem(), doPrevItem(), WaypointWalkControl::WaypointEditControl::doSelect(), WaypointWalkControl::doSelect(), WalkCalibration::doSelect(), SensorObserverControl::doSelect(), FileBrowserControl::doSelect(), EventLogger::doSelect(), doSelect(), ConfigurationEditor::NamedEnumerationEditor::doSelect(), ConfigurationEditor::NewCollectionEntry::doSelect(), getHilights(), hilightFirst(), hilightsAvg(), FileBrowserControl::rebuildmenu(), refresh(), setHilights(), WalkCalibration::setupChoose(), and takeInput().
Typically would use MotionManager::invalid_MC_ID, but re-specified here for convenience and to avoid dependence on MotionManager.h. Definition at line 92 of file ControlBase.h. Referenced by WaypointWalkControl::activate(), ValueSetControl< T >::activate(), PostureEditor::activate(), WaypointWalkControl::deactivate(), TorqueCalibrate::TakeMeasurementControl::deactivate(), PostureEditor::deactivate(), deactivate(), doReadStdIn(), doSelect(), TorqueCalibrate::TakeMeasurementControl::processEvent(), RunSequenceControl< SequenceSize >::processEvent(), LoadPostureControl::processEvent(), refresh(), LoadWalkControl::selectedFile(), SaveWalkControl::takeInput(), LoadPostureControl::~LoadPostureControl(), and RunSequenceControl< SequenceSize >::~RunSequenceControl().
the name of this control Definition at line 208 of file ControlBase.h. Referenced by findSlot(), getName(), ToggleControl::getStatusChar(), invalidInput(), PostureEngine::loadLine(), ToggleControl::setName(), setName(), ToggleControl::setStatus(), and takeInput().
vector of controls to select from Definition at line 211 of file ControlBase.h. Referenced by EventLogger::checkLogFile(), clearMenu(), clearSlots(), ConfigurationEditor::clearSlots(), doNextItem(), doPrevItem(), WaypointWalkControl::WaypointEditControl::doSelect(), WaypointWalkControl::doSelect(), WalkCalibration::doSelect(), SensorObserverControl::doSelect(), FileBrowserControl::doSelect(), EventLogger::doSelect(), doSelect(), ConfigurationEditor::NamedEnumerationEditor::doSelect(), ConfigurationEditor::NewCollectionEntry::doSelect(), findSlot(), getSlotName(), getSlots(), WalkCalibration::hilightFirst(), hilightFirst(), EventLogger::processEvent(), pushSlot(), FileBrowserControl::rebuildmenu(), WaypointWalkControl::refresh(), PostureEditor::refresh(), FreeMemReportControl::refresh(), refresh(), ConfigurationEditor::NamedEnumerationEditor::refresh(), ConfigurationEditor::NewCollectionEntry::refresh(), ConfigurationEditor::AddCollectionEntry::refresh(), ConfigurationEditor::refresh(), WalkCalibration::setHilights(), setHilights(), ConfigurationEditor::setRootCollection(), setSlot(), EventLogger::setStatus(), WalkCalibration::setupChoose(), WalkCalibration::setupClear(), slotsSize(), FileBrowserControl::takeInput(), takeInput(), BehaviorSwitchControlBase::takeInput(), validInput(), PostureEditor::~PostureEditor(), and WalkCalibration::~WalkCalibration(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:06 2016 by Doxygen 1.6.3 |