SUMO - Simulation of Urban MObility
StdDefs.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2014-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include "RGBColor.h"
27 #include "StdDefs.h"
28 
29 
30 #ifdef CHECK_MEMORY_LEAKS
31 #include <foreign/nvwa/debug_new.h>
32 #endif // CHECK_MEMORY_LEAKS
33 
34 /* -------------------------------------------------------------------------
35  * color constants for link states
36  * ----------------------------------------------------------------------- */
37 const RGBColor SUMO_color_TL_GREEN_MAJOR(0, 255, 0);
38 const RGBColor SUMO_color_TL_GREEN_MINOR(0, 179, 0);
39 const RGBColor SUMO_color_TL_RED(255, 0, 0);
40 const RGBColor SUMO_color_TL_REDYELLOW(255, 128, 0);
41 const RGBColor SUMO_color_TL_YELLOW_MAJOR(255, 255, 0);
42 const RGBColor SUMO_color_TL_YELLOW_MINOR(255, 255, 0);
43 const RGBColor SUMO_color_TL_OFF_BLINKING(128, 64, 0);
44 const RGBColor SUMO_color_TL_OFF_NOSIGNAL(0, 255, 255);
45 const RGBColor SUMO_color_MAJOR(255, 255, 255);
46 const RGBColor SUMO_color_MINOR(51, 51, 51);
47 const RGBColor SUMO_color_EQUAL(128, 128, 128);
48 const RGBColor SUMO_color_STOP(128, 0, 128);
49 const RGBColor SUMO_color_ALLWAY_STOP(0, 0, 192);
50 const RGBColor SUMO_color_ZIPPER(192, 128, 64);
51 const RGBColor SUMO_color_DEADEND(0, 0, 0);
52 
53 const RGBColor& getLinkColor(const LinkState& ls) {
54  switch (ls) {
59  case LINKSTATE_TL_RED:
60  return SUMO_color_TL_RED;
71  case LINKSTATE_MAJOR:
72  return SUMO_color_MAJOR;
73  case LINKSTATE_MINOR:
74  return SUMO_color_MINOR;
75  case LINKSTATE_EQUAL:
76  return SUMO_color_EQUAL;
77  case LINKSTATE_STOP:
78  return SUMO_color_STOP;
81  case LINKSTATE_ZIPPER:
82  return SUMO_color_ZIPPER;
83  case LINKSTATE_DEADEND:
84  return SUMO_color_DEADEND;
85  default:
86  throw ProcessError("No color defined for LinkState '" + std::string(ls, 1) + "'");
87  }
88 }
89 
90 
91 bool gDebugFlag1 = false;
92 bool gDebugFlag2 = false;
93 bool gDebugFlag3 = false;
94 bool gDebugFlag4 = false;
95 std::string gDebugSelectedVehicle = "";
96 
97 /****************************************************************************/
98 
bool gDebugFlag1
global utility flags for debugging
Definition: StdDefs.cpp:91
const RGBColor SUMO_color_DEADEND(0, 0, 0)
The link has green light, may pass.
const RGBColor SUMO_color_MINOR(51, 51, 51)
const RGBColor SUMO_color_ALLWAY_STOP(0, 0, 192)
const RGBColor SUMO_color_STOP(128, 0, 128)
The link has green light, has to brake.
This is an uncontrolled, minor link, has to stop.
bool gDebugFlag3
Definition: StdDefs.cpp:93
const RGBColor SUMO_color_TL_YELLOW_MINOR(255, 255, 0)
const RGBColor & getLinkColor(const LinkState &ls)
Definition: StdDefs.cpp:53
This is a dead end link.
This is an uncontrolled, right-before-left link.
The link is controlled by a tls which is off, not blinking, may pass.
This is an uncontrolled, all-way stop link.
This is an uncontrolled, zipper-merge link.
std::string gDebugSelectedVehicle
Definition: StdDefs.cpp:95
This is an uncontrolled, minor link, has to brake.
const RGBColor SUMO_color_TL_OFF_BLINKING(128, 64, 0)
const RGBColor SUMO_color_TL_OFF_NOSIGNAL(0, 255, 255)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
const RGBColor SUMO_color_TL_GREEN_MAJOR(0, 255, 0)
bool gDebugFlag4
Definition: StdDefs.cpp:94
const RGBColor SUMO_color_TL_YELLOW_MAJOR(255, 255, 0)
const RGBColor SUMO_color_ZIPPER(192, 128, 64)
const RGBColor SUMO_color_EQUAL(128, 128, 128)
const RGBColor SUMO_color_TL_GREEN_MINOR(0, 179, 0)
const RGBColor SUMO_color_TL_RED(255, 0, 0)
The link has yellow light, may pass.
The link is controlled by a tls which is off and blinks, has to brake.
const RGBColor SUMO_color_TL_REDYELLOW(255, 128, 0)
The link has red light (must brake)
This is an uncontrolled, major link, may pass.
const RGBColor SUMO_color_MAJOR(255, 255, 255)
bool gDebugFlag2
Definition: StdDefs.cpp:92
The link has yellow light, has to brake anyway.
The link has red light (must brake) but indicates upcoming green.