Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
remote_map_state.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_REMOTE_MAP_STATE_HPP_
25#define TAPROOT_REMOTE_MAP_STATE_HPP_
26
27#include <cstdint>
28#include <list>
29
31
32namespace tap
33{
34namespace control
35{
56{
57public:
62 enum class MouseButton
63 {
64 LEFT,
65 RIGHT
66 };
67
68 RemoteMapState() = default;
69
90 const std::list<tap::communication::serial::Remote::Key> &keySet,
91 const std::list<tap::communication::serial::Remote::Key> &negKeySet,
92 bool mouseButtonLeftPressed,
93 bool mouseButtonRightPressed);
94
104
115
126 const std::list<tap::communication::serial::Remote::Key> &keySet,
127 const std::list<tap::communication::serial::Remote::Key> &negKeySet = {});
128
141 const std::list<tap::communication::serial::Remote::Key> &keySet,
142 const std::list<tap::communication::serial::Remote::Key> &negKeySet = {});
143
151
156
161
166 void initKeys(uint16_t keys);
167
172 void initNegKeys(uint16_t negKeys);
173
177 void initKeys(const std::list<tap::communication::serial::Remote::Key> &keySet);
178
182 void initNegKeys(const std::list<tap::communication::serial::Remote::Key> &negKeySet);
183
187 void initLMouseButton();
188
192 void initRMouseButton();
193
215 bool stateSubsetOf(const RemoteMapState &other) const;
216
223 bool friend operator==(const RemoteMapState &rms1, const RemoteMapState &rms2);
224
228 bool friend operator!=(const RemoteMapState &rms1, const RemoteMapState &rms2);
229
233 uint16_t getNegKeys() const { return negKeys; }
234
238 bool getNegKeysUsed() const { return negKeys != 0; }
239
243 uint16_t getKeys() const { return keys; }
244
245 bool getLMouseButton() const { return lMouseButton; }
246
247 bool getRMouseButton() const { return rMouseButton; }
248
250
252
253private:
256
259
260 uint16_t keys = 0;
261
262 uint16_t negKeys = 0; // if certain keys are pressed, the remote map will not do mapping
263
264 bool lMouseButton = false;
265
266 bool rMouseButton = false;
267}; // class RemoteState
268} // namespace control
269} // namespace tap
270
271#endif // TAPROOT_REMOTE_MAP_STATE_HPP_
Switch
Definition remote.hpp:73
SwitchState
Definition remote.hpp:82
Definition remote_map_state.hpp:56
tap::communication::serial::Remote::SwitchState getLSwitch() const
Definition remote_map_state.hpp:249
uint16_t getNegKeys() const
Definition remote_map_state.hpp:233
bool getNegKeysUsed() const
Definition remote_map_state.hpp:238
bool getRMouseButton() const
Definition remote_map_state.hpp:247
void initLSwitch(tap::communication::serial::Remote::SwitchState ss)
Definition remote_map_state.cpp:113
bool friend operator!=(const RemoteMapState &rms1, const RemoteMapState &rms2)
tap::communication::serial::Remote::SwitchState getRSwitch() const
Definition remote_map_state.hpp:251
void initNegKeys(uint16_t negKeys)
Definition remote_map_state.cpp:144
void initRSwitch(tap::communication::serial::Remote::SwitchState ss)
Definition remote_map_state.cpp:122
bool getLMouseButton() const
Definition remote_map_state.hpp:245
MouseButton
Definition remote_map_state.hpp:63
void initRMouseButton()
Definition remote_map_state.cpp:177
bool friend operator==(const RemoteMapState &rms1, const RemoteMapState &rms2)
bool stateSubsetOf(const RemoteMapState &other) const
Definition remote_map_state.cpp:179
void initLMouseButton()
Definition remote_map_state.cpp:175
uint16_t getKeys() const
Definition remote_map_state.hpp:243
void initKeys(uint16_t keys)
Definition remote_map_state.cpp:131
Definition ballistics.cpp:29