SUMO - Simulation of Urban MObility
GNEChange_VariableSpeedSignItem.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // A change in the values of Variable Speed Signs in netedit
18 /****************************************************************************/
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #ifdef _MSC_VER
24 #include <windows_config.h>
25 #else
26 #include <config.h>
27 #endif
28 
31 
33 #include "GNEVariableSpeedSign.h"
35 #include "GNENet.h"
36 #include "GNEViewNet.h"
37 
38 
39 
40 // ===========================================================================
41 // FOX-declarations
42 // ===========================================================================
43 FXIMPLEMENT_ABSTRACT(GNEChange_VariableSpeedSignItem, GNEChange, NULL, 0)
44 
45 // ===========================================================================
46 // member method definitions
47 // ===========================================================================
48 
50  GNEChange(variableSpeedSignStep->getVariableSpeedSignParent()->getViewNet()->getNet(), forward),
51  myVariableSpeedSignStep(variableSpeedSignStep) {
52  myVariableSpeedSignStep->incRef("GNEChange_VariableSpeedSignItem");
53 }
54 
55 
57  myVariableSpeedSignStep->decRef("GNEChange_VariableSpeedSignItem");
59  // show extra information for tests
60  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
61  WRITE_WARNING("Deleting Step of Variable Speed Sign '" + myVariableSpeedSignStep->getVariableSpeedSignParent()->getID() + "'");
62  }
64  }
65 }
66 
67 
68 void
70  if (myForward) {
71  // show extra information for tests
72  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
73  WRITE_WARNING("Removing Step from Variable Speed Sign '" + myVariableSpeedSignStep->getVariableSpeedSignParent()->getID() + "'");
74  }
75  // remove step from Variable Speed Sign
77  } else {
78  // show extra information for tests
79  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
80  WRITE_WARNING("Adding Step to Variable Speed Sign '" + myVariableSpeedSignStep->getVariableSpeedSignParent()->getID() + "'");
81  }
82  // add step to Variable Speed Sign
84  }
85  // enable save additionals
87 }
88 
89 
90 void
92  if (myForward) {
93  // show extra information for tests
94  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
95  WRITE_WARNING("Adding Step to Variable Speed Sign '" + myVariableSpeedSignStep->getVariableSpeedSignParent()->getID() + "'");
96  }
97  // add step to Variable Speed Sign
99  } else {
100  // show extra information for tests
101  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
102  WRITE_WARNING("Removing Step from Variable Speed Sign '" + myVariableSpeedSignStep->getVariableSpeedSignParent()->getID() + "'");
103  }
104  // remove step from Variable Speed Sign
106  }
107  // enable save additionals
109 }
110 
111 
112 FXString
114  return ("Undo change " + toString(myVariableSpeedSignStep->getTag()) + " values").c_str();
115 }
116 
117 
118 FXString
120  return ("Redo change " + toString(myVariableSpeedSignStep->getTag()) + " values").c_str();
121 }
void requiereSaveAdditionals()
inform that additionals has to be saved
Definition: GNENet.cpp:1736
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:48
void removeVariableSpeedSignStep(GNEVariableSpeedSignStep *step)
remove an existent step of variable speed signal
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:64
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
GNEVariableSpeedSignStep * myVariableSpeedSignStep
modified Variable Speed Sign interval
const std::string getID() const
function to support debugging
void decRef(const std::string &debugMsg="")
Decrease reference.
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:81
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:86
bool unreferenced()
check if object ins&#39;t referenced
GNEVariableSpeedSign * getVariableSpeedSignParent() const
get variable speed sign parent
void addVariableSpeedSignStep(GNEVariableSpeedSignStep *step)
insert a new step in variable speed signal
SumoXMLTag getTag() const
get XML Tag assigned to this object