|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <remote_map_state.hpp>
Public Types | |
| enum class | MouseButton { LEFT , RIGHT } |
A class to be used in conjunction with a CommandMapping to be placed in the CommandMapper. A particular RemoteMapState is used to capture a sequence of user inputs that must be triggered for a Command to be scheduled.
To use this class, when possible use one of the constructors provided below to create a mapping. We have the ability to map any combination of remote switches, keyboard keys, or mouse buttons to a particular set of Commands. To cover every possible combination, additional initialize functions have been provided to be used in conjunction with class constructors.
RemoteMapState to the CommandMapper.negKeySet. This can be thought of a key mapping that when matched, no matter what the state of the RemoteMapState is, the RemoteMapState is no longer satisfied.
|
strong |
Use to distinguish between the left and mouse button when initializing a RemoteMapState that uses the mouse as input.
| Enumerator | |
|---|---|
| LEFT | The left mouse button. |
| RIGHT | The right mouse button. |
|
default |
| tap::control::RemoteMapState::RemoteMapState | ( | tap::communication::serial::Remote::SwitchState | leftss, |
| tap::communication::serial::Remote::SwitchState | rightss, | ||
| const std::list< tap::communication::serial::Remote::Key > & | keySet, | ||
| const std::list< tap::communication::serial::Remote::Key > & | negKeySet, | ||
| bool | mouseButtonLeftPressed, | ||
| bool | mouseButtonRightPressed | ||
| ) |
Generic constructor that takes all possible remote map state configurations for maximum configurability, initializes the RemoteMapState with all given information.
| [in] | leftss | The switch state for the left switch. If UNKNOWN, the switch state will not be initialized. |
| [in] | rightss | The switch state for the right switch. If UNKNOWN, the switch state will not be initialized. |
| [in] | keySet | The set of keys to use for initialization. |
| [in] | negKeySet | The set of keys to be used as negations in the RemoteMapState. |
| [in] | mouseButtonLeftPressed | Initialize the RemoteMapState to match a remote map state when the left mouse button is pressed. |
| [in] | mouseButtonRightPressed | Initialize the RemoteMapState to match a remote map state when the right mouse button is pressed. |
keySet and negKeySet must be mutally exclusive sets, otherwise the negKeySet will not be properly initialized. | tap::control::RemoteMapState::RemoteMapState | ( | tap::communication::serial::Remote::Switch | swh, |
| tap::communication::serial::Remote::SwitchState | switchState | ||
| ) |
Initializes a RemoteMapState with a single switch to the given switch state.
| [in] | swh | The switch to use in the map state. |
| [in] | switchState | The switch state of the given switch. |
| tap::control::RemoteMapState::RemoteMapState | ( | tap::communication::serial::Remote::SwitchState | leftss, |
| tap::communication::serial::Remote::SwitchState | rightss | ||
| ) |
Initializes a RemoteMapState with particular switch states for both remote switches.
| [in] | leftss | The switch state for the left switch. |
| [in] | rightss | The switch state for the right switch. |
| tap::control::RemoteMapState::RemoteMapState | ( | const std::list< tap::communication::serial::Remote::Key > & | keySet, |
| const std::list< tap::communication::serial::Remote::Key > & | negKeySet = {} |
||
| ) |
Initializes a RemoteMapState with a particular set of keys and optionally a particular set of negation keys.
| [in] | keySet | The set of keys to use for initialization. |
| [in] | negKeySet | The set of keys to be used as negations in the RemoteMapState. |
keySet and negKeySet must be mutally exclusive sets, otherwise the negKeySet will not be properly initialized. | tap::control::RemoteMapState::RemoteMapState | ( | RemoteMapState::MouseButton | button, |
| const std::list< tap::communication::serial::Remote::Key > & | keySet, | ||
| const std::list< tap::communication::serial::Remote::Key > & | negKeySet = {} |
||
| ) |
Initializes a RemoteMapState with a particular mouse button and set of keys and optionally a particular set of negation keys.
| [in] | button | The mouse button The button to use for initialization. |
| [in] | keySet | The set of keys to use for initialization. |
| [in] | negKeySet | The set of keys to be used as negations in the RemoteMapState. |
keySet and negKeySet must be mutally exclusive sets, otherwise the negKeySet will not be properly initialized. | tap::control::RemoteMapState::RemoteMapState | ( | MouseButton | button | ) |
Initializes a RemoteMapState that will use the given mouse button (either left or right) in the mapping.
| [in] | button | The MouseButton to use. |
|
inline |
RemoteMapState.
|
inline |
|
inline |
|
inline |
|
inline |
true if the neg key set has been initialized, false otherwise.
|
inline |
|
inline |
| void tap::control::RemoteMapState::initKeys | ( | const std::list< tap::communication::serial::Remote::Key > & | keySet | ) |
initKeys. Interprets the list and passes that on as a bit mapped set of keys. | void tap::control::RemoteMapState::initKeys | ( | uint16_t | keys | ) |
Initializes the keys to the bit mapped set of keys provided.
keys must be mutally exclusive with any set of negKeys already provided. | void tap::control::RemoteMapState::initLMouseButton | ( | ) |
Initializes the left mouse button to be mapped when clicked.
| void tap::control::RemoteMapState::initLSwitch | ( | tap::communication::serial::Remote::SwitchState | ss | ) |
Initializes the left switch with the particular Remote::SwitchState provided.
| void tap::control::RemoteMapState::initNegKeys | ( | const std::list< tap::communication::serial::Remote::Key > & | negKeySet | ) |
initNegKeys. Interprets the list and passes that on as a bit mapped set of keys. | void tap::control::RemoteMapState::initNegKeys | ( | uint16_t | negKeys | ) |
Initializes the neg keys to the bit mapped set of neg keys provided.
negKeys must be mutally exclusive with any set of keys already provided. | void tap::control::RemoteMapState::initRMouseButton | ( | ) |
Initializes the right mouse button to be mapped when clicked.
| void tap::control::RemoteMapState::initRSwitch | ( | tap::communication::serial::Remote::SwitchState | ss | ) |
Initializes the right switch with the particular Remote::SwitchState provided.
| bool friend tap::control::RemoteMapState::operator!= | ( | const RemoteMapState & | rms1, |
| const RemoteMapState & | rms2 | ||
| ) |
Opposite of operator==.
| bool friend tap::control::RemoteMapState::operator== | ( | const RemoteMapState & | rms1, |
| const RemoteMapState & | rms2 | ||
| ) |
Straight equality.
| [in] | rms1 | The first RemoteMapState to check equality for. |
| [in] | rms1 | The second RemoteMapState to check equality for. |
| bool tap::control::RemoteMapState::stateSubsetOf | ( | const RemoteMapState & | other | ) | const |
Checks if this is a subset of other. this is a subset of other under the following conditions:
this's left switch state is UNKNOWN or this's left switch state is equal to other's left switch state.this's right switch state is UNKNOWN or this's right switch state is equal to other's left switch state.this's left mouse button is not initialized or both this and other's left mouse buttons are both initialized.this's right mouse button is not initialized or both this and other's right mouse buttons are both initialized.this's key set is a subset of other's key set, i.e. (this.keySet & other.keySet) == this.keySet.| [other] | The RemoteMapState to check if this is a subset of. |
true if this RemoteMapState is a subset of the other RemoteMapState. See above for description of what it means for a RemoteMapState to be a subset of another.