My Project
Loading...
Searching...
No Matches
enums.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
9
10// String switch paridgam
11struct channelTypeMap : public std::map<std::string, ChannelType> {
13 {
14 this->operator[]("espPin") = ChannelType::EspPinChannel;
15 this->operator[]("bleHub") = ChannelType::BleHubChannel;
16 };
18};
19
26
27// String switch paridgam
28struct deviceTypeMap : public std::map<std::string, DeviceType> {
30 {
31 this->operator[]("") = DeviceType::Nothing;
32 this->operator[]("nothing") = DeviceType::Nothing;
33 this->operator[]("motor") = DeviceType::Motor;
34 this->operator[]("light") = DeviceType::Light;
35 this->operator[]("status") = DeviceType::StatusLight;
36 };
38};
39
41 BLACK = 0,
42 PINK = 1,
43 PURPLE = 2,
44 BLUE = 3,
46 CYAN = 5,
47 GREEN = 6,
48 YELLOW = 7,
49 ORANGE = 8,
50 RED = 9,
51 WHITE = 10,
53 NONE = 255
54};
55
56// String switch paridgam
57struct hubLedColorMap : public std::map<std::string, HubLedColor> {
59 {
60 this->operator[]("") = HubLedColor::NONE;
61 this->operator[]("off") = HubLedColor::BLACK;
62 this->operator[]("black") = HubLedColor::BLACK;
63 this->operator[]("pink") = HubLedColor::PINK;
64 this->operator[]("purple") = HubLedColor::PURPLE;
65 this->operator[]("blue") = HubLedColor::BLUE;
66 this->operator[]("lightblue") = HubLedColor::LIGHTBLUE;
67 this->operator[]("cyan") = HubLedColor::CYAN;
68 this->operator[]("green") = HubLedColor::GREEN;
69 this->operator[]("yellow") = HubLedColor::YELLOW;
70 this->operator[]("orange") = HubLedColor::ORANGE;
71 this->operator[]("red") = HubLedColor::RED;
72 this->operator[]("white") = HubLedColor::WHITE;
73 };
75};
76
78 // Locomotive.
80
81 // RocRail.
83};
84
85// String switch paridgam
86struct triggerSourceMap : public std::map<std::string, MCTriggerSource> {
88 {
89 this->operator[]("") = MCTriggerSource::Loco;
90 this->operator[]("loco") = MCTriggerSource::Loco;
91 this->operator[]("rr") = MCTriggerSource::RocRail;
92 };
94};
95
96// Function supported by the generic controller.
133
134// String switch paridgam
135struct functionMap : public std::map<std::string, MCFunction> {
137 {
138 this->operator[]("status") = MCFunction::Status;
139 this->operator[]("f0") = MCFunction::F0;
140 this->operator[]("f1") = MCFunction::F1;
141 this->operator[]("f2") = MCFunction::F2;
142 this->operator[]("f3") = MCFunction::F3;
143 this->operator[]("f4") = MCFunction::F4;
144 this->operator[]("f5") = MCFunction::F5;
145 this->operator[]("f6") = MCFunction::F6;
146 this->operator[]("f7") = MCFunction::F7;
147 this->operator[]("f8") = MCFunction::F8;
148 this->operator[]("f9") = MCFunction::F9;
149 this->operator[]("f10") = MCFunction::F10;
150 this->operator[]("f11") = MCFunction::F11;
151 this->operator[]("f12") = MCFunction::F12;
152 this->operator[]("f13") = MCFunction::F13;
153 this->operator[]("f14") = MCFunction::F14;
154 this->operator[]("f15") = MCFunction::F15;
155 this->operator[]("f16") = MCFunction::F16;
156 this->operator[]("f17") = MCFunction::F17;
157 this->operator[]("f18") = MCFunction::F18;
158 this->operator[]("f19") = MCFunction::F19;
159 this->operator[]("f20") = MCFunction::F20;
160 this->operator[]("f21") = MCFunction::F21;
161 this->operator[]("f22") = MCFunction::F22;
162 this->operator[]("f23") = MCFunction::F23;
163 this->operator[]("f24") = MCFunction::F24;
164 this->operator[]("f25") = MCFunction::F25;
165 this->operator[]("f26") = MCFunction::F26;
166 this->operator[]("f27") = MCFunction::F27;
167 this->operator[]("f28") = MCFunction::F28;
168 this->operator[]("f29") = MCFunction::F29;
169 this->operator[]("f30") = MCFunction::F30;
170 this->operator[]("f31") = MCFunction::F31;
171 this->operator[]("f32") = MCFunction::F32;
172 };
174};
ChannelType
Definition enums.h:5
@ BleHubChannel
Definition enums.h:7
@ EspPinChannel
Definition enums.h:6
HubLedColor
Definition enums.h:40
@ PINK
Definition enums.h:42
@ LIGHTBLUE
Definition enums.h:45
@ PURPLE
Definition enums.h:43
@ WHITE
Definition enums.h:51
@ BLUE
Definition enums.h:44
@ GREEN
Definition enums.h:47
@ CYAN
Definition enums.h:46
@ NONE
Definition enums.h:53
@ NUM_COLORS
Definition enums.h:52
@ ORANGE
Definition enums.h:49
@ YELLOW
Definition enums.h:48
@ BLACK
Definition enums.h:41
@ RED
Definition enums.h:50
MCFunction
Definition enums.h:97
@ F3
Definition enums.h:102
@ F24
Definition enums.h:123
@ F0
Definition enums.h:99
@ F5
Definition enums.h:104
@ F30
Definition enums.h:129
@ Status
Definition enums.h:98
@ F16
Definition enums.h:115
@ F19
Definition enums.h:118
@ F17
Definition enums.h:116
@ F28
Definition enums.h:127
@ F11
Definition enums.h:110
@ F26
Definition enums.h:125
@ F1
Definition enums.h:100
@ F23
Definition enums.h:122
@ F18
Definition enums.h:117
@ F7
Definition enums.h:106
@ F31
Definition enums.h:130
@ F12
Definition enums.h:111
@ F14
Definition enums.h:113
@ F4
Definition enums.h:103
@ F32
Definition enums.h:131
@ F9
Definition enums.h:108
@ F6
Definition enums.h:105
@ F2
Definition enums.h:101
@ F27
Definition enums.h:126
@ F22
Definition enums.h:121
@ F13
Definition enums.h:112
@ F8
Definition enums.h:107
@ F20
Definition enums.h:119
@ F21
Definition enums.h:120
@ F15
Definition enums.h:114
@ F10
Definition enums.h:109
@ F25
Definition enums.h:124
@ F29
Definition enums.h:128
MCTriggerSource
Definition enums.h:77
@ Loco
Definition enums.h:79
@ RocRail
Definition enums.h:82
DeviceType
Definition enums.h:20
@ Nothing
Definition enums.h:21
@ Motor
Definition enums.h:22
@ Light
Definition enums.h:23
@ StatusLight
Definition enums.h:24
Definition enums.h:11
channelTypeMap()
Definition enums.h:12
~channelTypeMap()
Definition enums.h:17
Definition enums.h:28
~deviceTypeMap()
Definition enums.h:37
deviceTypeMap()
Definition enums.h:29
Definition enums.h:135
~functionMap()
Definition enums.h:173
functionMap()
Definition enums.h:136
Definition enums.h:57
~hubLedColorMap()
Definition enums.h:74
hubLedColorMap()
Definition enums.h:58
Definition enums.h:86
triggerSourceMap()
Definition enums.h:87
~triggerSourceMap()
Definition enums.h:93