| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include <cstdint> |
| 24 |
#include <string> |
| 25 |
|
| 26 |
|
| 27 |
typedef uint8_t ControlID; |
| 28 |
|
| 29 |
|
| 30 |
typedef uint16_t ObjectID; |
| 31 |
|
| 32 |
|
| 33 |
typedef ObjectID LocoID; |
| 34 |
typedef uint16_t Address; |
| 35 |
typedef uint16_t Speed; |
| 36 |
typedef uint32_t Length; |
| 37 |
|
| 38 |
|
| 39 |
typedef ObjectID MultipleUnitID; |
| 40 |
|
| 41 |
|
| 42 |
typedef ObjectID AccessoryID; |
| 43 |
|
| 44 |
|
| 45 |
typedef ObjectID FeedbackID; |
| 46 |
typedef uint32_t FeedbackPin; |
| 47 |
|
| 48 |
|
| 49 |
typedef ObjectID TrackID; |
| 50 |
typedef ObjectID ClusterID; |
| 51 |
|
| 52 |
|
| 53 |
typedef AccessoryID SwitchID; |
| 54 |
|
| 55 |
|
| 56 |
typedef AccessoryID SignalID; |
| 57 |
|
| 58 |
|
| 59 |
typedef ObjectID RouteID; |
| 60 |
typedef uint16_t Delay; |
| 61 |
|
| 62 |
|
| 63 |
typedef int16_t LayerID; |
| 64 |
|
| 65 |
|
| 66 |
typedef uint16_t Priority; |
| 67 |
|
| 68 |
typedef uint8_t Pause; |
| 69 |
|
| 70 |
|
| 71 |
typedef ObjectID TextID; |
| 72 |
|
| •73 |
|
| 74 |
typedef ObjectID CounterID; |
| 75 |
|
| 76 |
static const Address AddressNone = 0; |
| 77 |
static const Address AddressDefault = 3; |
| 78 |
static const LocoID LocoNone = 0; |
| 79 |
static const MultipleUnitID MultipleUnitNone = 0; |
| 80 |
static const MultipleUnitID MultipleUnitIdPrefix = 0x8000; |
| 81 |
static const ObjectID ObjectNone = 0; |
| 82 |
static const AccessoryID AccessoryNone = 0; |
| 83 |
static const FeedbackID FeedbackNone = 0; |
| 84 |
static const FeedbackPin FeedbackPinNone = 0; |
| 85 |
static const TrackID TrackNone = 0; |
| 86 |
static const SwitchID SwitchNone = 0; |
| 87 |
static const RouteID RouteNone = 0; |
| 88 |
static const RouteID RouteAuto = 0; |
| 89 |
static const RouteID RouteStop = 0xFFFF; |
| 90 |
static const ControlID ControlNone = 0; |
| 91 |
static const LayerID LayerNone = 0; |
| 92 |
static const LayerID LayerUndeletable = 1; |
| 93 |
static const SignalID SignalNone = 0; |
| 94 |
static const ClusterID ClusterNone = 0; |
| 95 |
static const TextID TextNone = 0; |
| •96 |
static const CounterID CounterNone = 0; |
| 97 |
|
| 98 |
static const Speed MaxSpeed = 1023; |
| 99 |
static const Speed DefaultTravelSpeed = 700; |
| 100 |
static const Speed DefaultReducedSpeed = 400; |
| 101 |
static const Speed DefaultCreepingSpeed = 100; |
| 102 |
static const Speed MinSpeed = 0; |
| 103 |
|
| 104 |
enum ControlType : uint8_t |
| 105 |
{ |
| 106 |
ControlTypeHardware = 0, |
| 107 |
ControlTypeInternal, |
| 108 |
ControlTypeWebServer, |
| 109 |
ControlTypeZ21Server, |
| 110 |
ControlTypeCS2Server |
| 111 |
}; |
| 112 |
|
| 113 |
enum ControlIDs : ControlID |
| 114 |
{ |
| 115 |
ControlIdNone = 0, |
| 116 |
ControlIdWebServer, |
| 117 |
ControlIdZ21Server, |
| 118 |
ControlIdCS2Server, |
| 119 |
ControlIdFirstHardware = 10 |
| 120 |
}; |
| 121 |
|
| 122 |
enum BoosterState : bool |
| 123 |
{ |
| 124 |
BoosterStateStop = false, |
| 125 |
BoosterStateGo = true |
| 126 |
}; |
| 127 |
|
| 128 |
enum Protocol : uint8_t |
| 129 |
{ |
| 130 |
ProtocolNone = 0, |
| 131 |
ProtocolServer = 1, |
| 132 |
ProtocolMM1 = 2, |
| 133 |
ProtocolMM2 = 3, |
| 134 |
ProtocolMFX = 4, |
| 135 |
ProtocolDCC = 5, |
| 136 |
ProtocolDCC14 = 6, |
| 137 |
ProtocolDCC28 = 7, |
| 138 |
ProtocolDCC128 = 8, |
| 139 |
ProtocolMM = 9, |
| 140 |
ProtocolMM15 = 10, |
| 141 |
ProtocolSX1 = 11, |
| 142 |
ProtocolSX2 = 12, |
| 143 |
ProtocolFMZ = 13, |
| 144 |
ProtocolMultipleUnit = 14, |
| 145 |
ProtocolEnd = ProtocolMultipleUnit |
| 146 |
}; |
| 147 |
|
| 148 |
static const std::string ProtocolSymbols[] = |
| 149 |
{ |
| 150 |
"none", |
| 151 |
"all", |
| 152 |
"MM 1", |
| 153 |
"MM 2", |
| 154 |
"mfx", |
| 155 |
"DCC", |
| 156 |
"DCC 14", |
| 157 |
"DCC 28", |
| 158 |
"DCC 128", |
| 159 |
"MM", |
| 160 |
"MM 1.5", |
| 161 |
"SX1", |
| 162 |
"SX2", |
| 163 |
"FMZ", |
| 164 |
"Multi" |
| 165 |
}; |
| 166 |
|
| 167 |
enum AddressType : uint8_t |
| 168 |
{ |
| 169 |
AddressTypeLoco = 0, |
| 170 |
AddressTypeMultipleUnit, |
| 171 |
AddressTypeAccessory |
| 172 |
}; |
| 173 |
|
| 174 |
enum AddressPort : uint8_t |
| 175 |
{ |
| 176 |
AddressPortRed = 0, |
| 177 |
AddressPortGreen = 1 |
| 178 |
}; |
| 179 |
|
| 180 |
enum LocoType : uint8_t |
| 181 |
{ |
| 182 |
LocoTypeLoco = 0, |
| 183 |
LocoTypeMultipleUnit |
| 184 |
}; |
| 185 |
|
| 186 |
enum ArgumentType : uint8_t |
| 187 |
{ |
| 188 |
ArgumentTypeIpAddress = 1, |
| 189 |
ArgumentTypeSerialPort = 2, |
| 190 |
ArgumentTypeS88Modules = 3, |
| 191 |
ArgumentTypeMainSecundary = 4 |
| 192 |
}; |
| 193 |
|
| 194 |
enum HardwareType : uint8_t |
| 195 |
{ |
| 196 |
HardwareTypeNone = 0, |
| 197 |
HardwareTypeVirtual = 1, |
| 198 |
HardwareTypeCS2Udp = 2, |
| 199 |
HardwareTypeM6051 = 3, |
| 200 |
|
| 201 |
HardwareTypeOpenDcc = 5, |
| 202 |
HardwareTypeHsi88 = 6, |
| 203 |
HardwareTypeZ21 = 7, |
| 204 |
HardwareTypeCcSchnitte = 8, |
| 205 |
HardwareTypeEcos = 9, |
| 206 |
HardwareTypeCS2Tcp = 10, |
| 207 |
HardwareTypeIntellibox = 11, |
| 208 |
HardwareTypeMasterControl = 12, |
| 209 |
HardwareTypeTwinCenter = 13, |
| 210 |
HardwareTypeMasterControl2 = 14, |
| 211 |
HardwareTypeRedBox = 15, |
| 212 |
HardwareTypeRektor = 16, |
| 213 |
HardwareTypeDR5000 = 17, |
| 214 |
HardwareTypeCS1 = 18, |
| 215 |
HardwareTypeDccPpExTcp = 19, |
| 216 |
HardwareTypeDccPpExSerial = 20, |
| 217 |
HardwareTypeIntellibox2 = 21, |
| 218 |
HardwareTypeLocoNetAdapter63120 = 22, |
| 219 |
HardwareTypeLocoNetAdapter63820 = 23, |
| 220 |
HardwareTypeSystemControl7 = 24 |
| 221 |
}; |
| 222 |
|
| 223 |
enum Automode : bool |
| 224 |
{ |
| 225 |
AutomodeNo = false, |
| 226 |
AutomodeYes = true |
| 227 |
}; |
| 228 |
|
| 229 |
enum ObjectType : uint8_t |
| 230 |
{ |
| 231 |
ObjectTypeNone = 0, |
| 232 |
ObjectTypeLoco = 1, |
| 233 |
ObjectTypeTrack = 2, |
| 234 |
ObjectTypeFeedback = 3, |
| 235 |
ObjectTypeAccessory = 4, |
| 236 |
ObjectTypeSwitch = 5, |
| 237 |
ObjectTypeRoute = 6, |
| 238 |
ObjectTypeLayer = 7, |
| 239 |
ObjectTypeSignal = 8, |
| 240 |
ObjectTypeCluster = 9, |
| 241 |
ObjectTypeTimeTable = 10, |
| 242 |
ObjectTypeText = 11, |
| 243 |
ObjectTypePause = 12, |
| 244 |
ObjectTypeMultipleUnit = 13, |
| •245 |
ObjectTypeBooster = 14, |
| 246 |
ObjectTypeCounter = 15 |
| 247 |
}; |
| 248 |
|
| 249 |
enum Orientation : uint8_t |
| 250 |
{ |
| 251 |
OrientationLeft = 0, |
| 252 |
OrientationRight = 1, |
| 253 |
OrientationChange = 2 |
| 254 |
}; |
| 255 |
|
| 256 |
enum StartupInitLocos : uint8_t |
| 257 |
{ |
| 258 |
StartupInitLocosNone = 0, |
| 259 |
StartupInitLocosSpeed = 1, |
| 260 |
StartupInitLocosAll = 2, |
| 261 |
}; |
| 262 |
|
| 263 |
enum ProgramMode : uint8_t |
| 264 |
{ |
| 265 |
ProgramModeNone, |
| 266 |
ProgramModeDccDirect, |
| 267 |
ProgramModeDccPomLoco, |
| 268 |
ProgramModeDccPomAccessory, |
| 269 |
ProgramModeMm, |
| 270 |
ProgramModeMmPom, |
| 271 |
ProgramModeMfx, |
| 272 |
ProgramModeDccPage, |
| 273 |
ProgramModeDccRegister |
| 274 |
}; |
| 275 |
|
| 276 |
typedef uint16_t CvNumber; |
| 277 |
typedef uint8_t CvValue; |
| 278 |
|
| 279 |
enum Propulsion : uint8_t |
| 280 |
{ |
| 281 |
PropulsionUnknown = 0x00, |
| 282 |
PropulsionSteam = 0x01, |
| 283 |
PropulsionDiesel = 0x02, |
| 284 |
PropulsionGas = 0x04, |
| 285 |
PropulsionElectric = 0x08, |
| 286 |
PropulsionHydrogen = 0x10, |
| 287 |
PropulsionAccu = 0x20, |
| 288 |
PropulsionOther = 0x80, |
| 289 |
PropulsionAll = PropulsionSteam |
| 290 |
| PropulsionDiesel |
| 291 |
| PropulsionGas |
| 292 |
| PropulsionElectric |
| 293 |
| PropulsionHydrogen |
| 294 |
| PropulsionAccu |
| 295 |
| PropulsionOther |
| 296 |
}; |
| 297 |
|
| 298 |
enum TrainType : uint32_t |
| 299 |
{ |
| 300 |
TrainTypeUnknown = 0x00000000, |
| 301 |
|
| 302 |
TrainTypeInternationalHighSpeed = 0x00000001, |
| 303 |
TrainTypeNationalHighSpeed = 0x00000002, |
| 304 |
TrainTypeInternationalLongDistance = 0x00000004, |
| 305 |
TrainTypeNationalLongDistance = 0x00000008, |
| 306 |
TrainTypeInternationalNight = 0x00000010, |
| 307 |
TrainTypeNationalNight = 0x00000020, |
| 308 |
TrainTypeLongDistanceFastLocal = 0x00000040, |
| 309 |
TrainTypeFastLocal = 0x00000080, |
| 310 |
TrainTypeLocal = 0x00000100, |
| 311 |
TrainTypeSuburban = 0x00000200, |
| 312 |
TrainTypeUnderground = 0x00000400, |
| 313 |
TrainTypeHistoric = 0x00001000, |
| 314 |
TrainTypeExtra = 0x00002000, |
| 315 |
|
| 316 |
TrainTypePassengerWithCargo = 0x00008000, |
| 317 |
|
| 318 |
TrainTypePassenger = TrainTypeInternationalHighSpeed |
| 319 |
| TrainTypeNationalHighSpeed |
| 320 |
| TrainTypeInternationalLongDistance |
| 321 |
| TrainTypeNationalLongDistance |
| 322 |
| TrainTypeInternationalNight |
| 323 |
| TrainTypeNationalNight |
| 324 |
| TrainTypeLongDistanceFastLocal |
| 325 |
| TrainTypeFastLocal |
| 326 |
| TrainTypeLocal |
| 327 |
| TrainTypeSuburban |
| 328 |
| TrainTypeUnderground |
| 329 |
| TrainTypeHistoric |
| 330 |
| TrainTypeExtra |
| 331 |
| TrainTypePassengerWithCargo, |
| 332 |
|
| 333 |
TrainTypeCargoLongDistance = 0x00010000, |
| 334 |
TrainTypeCargoLocal = 0x00020000, |
| 335 |
TrainTypeCargoBlock = 0x00040000, |
| 336 |
TrainTypeCargoTractor = 0x00080000, |
| 337 |
TrainTypeCargoExpress = 0x00100000, |
| 338 |
|
| 339 |
TrainTypeCargoWithPassenger = 0x00800000, |
| 340 |
|
| 341 |
TrainTypeCargo = TrainTypeCargoLongDistance |
| 342 |
| TrainTypeCargoLocal |
| 343 |
| TrainTypeCargoBlock |
| 344 |
| TrainTypeCargoTractor |
| 345 |
| TrainTypeCargoExpress |
| 346 |
| TrainTypeCargoWithPassenger, |
| 347 |
|
| 348 |
TrainTypeRescue = 0x01000000, |
| 349 |
TrainTypeConstruction = 0x02000000, |
| 350 |
TrainTypeEmpty = 0x04000000, |
| 351 |
TrainTypeLoco = 0x08000000, |
| 352 |
TrainTypeCleaning = 0x10000000, |
| 353 |
|
| 354 |
TrainTypeOther = 0x40000000, |
| 355 |
|
| 356 |
|
| 357 |
TrainTypeAll = TrainTypePassenger |
| 358 |
| TrainTypeCargo |
| 359 |
| TrainTypeRescue |
| 360 |
| TrainTypeConstruction |
| 361 |
| TrainTypeEmpty |
| 362 |
| TrainTypeLoco |
| 363 |
| TrainTypeCleaning |
| 364 |
| TrainTypeOther |
| 365 |
}; |