Smart Camera ESP32
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
system_control_types.h
1
6#pragma once
7
8#include <stdint.h>
9
17{
18public:
23 enum Mode : uint8_t {
25 AI_MODE = 1
26 };
27
32 constexpr SystemControl(Mode mode = AI_MODE) : _mode(mode) {}
33
35 bool is_ai() const { return this->_mode == AI_MODE; }
36
38 bool is_user() const { return this->_mode == USER_MODE; }
39
45 {
46 this->_mode = (this->_mode == USER_MODE) ? AI_MODE : USER_MODE;
47 return this->_mode;
48 }
49
54 const char* to_string() const { return (this->_mode == USER_MODE) ? "USER_MODE" : "AI_MODE"; }
55
57 Mode get_mode() const { return this->_mode; }
58
60 operator uint8_t() const { return static_cast<uint8_t>(this->_mode); }
61
63 bool operator==(Mode m) const { return this->_mode == m; }
64
66 bool operator!=(Mode m) const { return this->_mode != m; }
67
68private:
69 Mode _mode;
70};
Encapsulates the primary control authority of the turret.
Definition system_control_types.h:17
Mode
Internal mode values.
Definition system_control_types.h:23
@ AI_MODE
Definition system_control_types.h:25
@ USER_MODE
Definition system_control_types.h:24
bool is_user() const
Checks if the system is in User mode.
Definition system_control_types.h:38
bool is_ai() const
Checks if the system is in AI mode.
Definition system_control_types.h:35
Mode get_mode() const
Gets the underlying Mode enum.
Definition system_control_types.h:57
constexpr SystemControl(Mode mode=AI_MODE)
Construct a new SystemControl object.
Definition system_control_types.h:32
const char * to_string() const
Converts the current mode to a human-readable string.
Definition system_control_types.h:54
bool operator==(Mode m) const
Equality comparison with Mode enum.
Definition system_control_types.h:63
bool operator!=(Mode m) const
Inequality comparison with Mode enum.
Definition system_control_types.h:66
Mode toggle_mode()
Toggles the state between USER_MODE and AI_MODE.
Definition system_control_types.h:44