 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
93 myChosenTarget(myChosenValue,
nullptr, MID_OPTION),
96 mySpeedTarget(mySpeed),
98 myChosenTarget.setTarget(
this);
100 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
102 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed",
103 GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
104 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
107 FXHorizontalFrame* gf1 =
108 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
109 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
110 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
111 0, 0, 0, 0, 2, 2, 0, 0);
115 FXHorizontalFrame* gf0 =
116 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
117 new FXRadioButton(gf0,
"Loaded", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
118 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
119 0, 0, 0, 0, 2, 2, 0, 0);
123 FXHorizontalFrame* gf2 =
124 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
125 new FXRadioButton(gf2,
"Predefined: ", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
126 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
127 0, 0, 0, 0, 2, 2, 0, 0);
129 new FXComboBox(gf2, 10,
this, MID_PRE_DEF,
130 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
131 myPredefinedValues->appendItem(
"20 km/h");
132 myPredefinedValues->appendItem(
"40 km/h");
133 myPredefinedValues->appendItem(
"60 km/h");
134 myPredefinedValues->appendItem(
"80 km/h");
135 myPredefinedValues->appendItem(
"100 km/h");
136 myPredefinedValues->appendItem(
"120 km/h");
137 myPredefinedValues->appendItem(
"140 km/h");
138 myPredefinedValues->appendItem(
"160 km/h");
139 myPredefinedValues->appendItem(
"180 km/h");
140 myPredefinedValues->appendItem(
"200 km/h");
141 myPredefinedValues->setNumVisible(5);
145 FXHorizontalFrame* gf12 =
146 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
147 new FXRadioButton(gf12,
"Free Entry: ", &myChosenTarget, FXDataTarget::ID_OPTION + 3,
148 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
149 0, 0, 0, 0, 2, 2, 0, 0);
151 new FXRealSpinner(gf12, 10,
this, MID_USER_DEF,
152 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
155 myUserDefinedSpeed->setIncrement(10);
156 myUserDefinedSpeed->setRange(0, 300);
157 myUserDefinedSpeed->setValue(0);
160 new FXButton(f1,
"Close",
nullptr,
this, MID_CLOSE,
161 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
188 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
190 myParent->updateChildren();
207 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
209 myParent->updateChildren();
261 static_cast<GUICalibrator*>(myObject)->openManipulator(
262 *myApplication, *myParent);
274 const std::string& aXMLFilename,
275 const std::string& outputFilename,
278 const std::string& vTypes,
279 bool addLaneMeanData) :
280 MSCalibrator(id, edge, lane, pos, aXMLFilename, outputFilename, freq, edge->getLength(), probe, vTypes, addLaneMeanData),
283 const std::vector<MSLane*>& destLanes = edge->
getLanes();
284 for (std::vector<MSLane*>::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) {
285 if (lane ==
nullptr || (*i) == lane) {
334 const std::string nextStart =
338 ret->
mkItem(
"inactive until",
false, nextStart);
349 std::string flow =
"-";
350 std::string speed =
"-";
364 glTranslated(pos.
x(), pos.
y(),
getType());
365 glRotated(rot, 0, 0, 1);
367 glScaled(exaggeration, exaggeration, 1);
368 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
370 glBegin(GL_TRIANGLES);
371 glColor3d(1, .8f, 0);
373 glVertex2d(0 - 1.4, 0);
374 glVertex2d(0 - 1.4, 6);
375 glVertex2d(0 + 1.4, 6);
376 glVertex2d(0 + 1.4, 0);
377 glVertex2d(0 - 1.4, 0);
378 glVertex2d(0 + 1.4, 6);
382 if (s.
scale * exaggeration >= 1.) {
383 glTranslated(0, 0, .1);
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
long onCmdClose(FXObject *, FXSelector, void *)
virtual int passed() const
A window containing a gl-object's parameter.
virtual ~GUIManip_Calibrator()
Destructor.
Representation of a lane in the micro simulation.
double currentFlow() const
flow in the current interval in veh/h
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
static const RGBColor BLACK
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
Writes routes of vehicles passing a certain edge.
Changes the speed allowed on a set of lanes (gui version)
double currentSpeed() const
measured speed in the current interval
std::vector< AspiredState >::const_iterator myCurrentStateInterval
Iterator pointing to the current interval.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
const std::string & getFullName() const
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
double myDefaultSpeed
The default (maximum) speed on the segment.
Boundary myBoundary
The boundary of this rerouter.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
GUICalibratorPopupMenuMap[]
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
GUIVisualizationTextSettings addName
FXDEFMAP(GUICalibrator::GUIManip_Calibrator) GUIManip_CalibratorMap[]
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
long onUpdUserDef(FXObject *, FXSelector, void *)
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
PosCont myFGPositions
The positions in full-geometry mode.
long onCmdUserDef(FXObject *, FXSelector, void *)
double scale
information about a lane's width (temporary, used for a single view)
A point in 2D or 3D with translation and scaling methods.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double x() const
Returns the x-position.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
int totalWished() const
number of vehicles expected to pass this interval
std::string time2string(SUMOTime t)
long onCmdChangeOption(FXObject *, FXSelector, void *)
A road/street connecting two junctions.
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
long onUpdPreDef(FXObject *, FXSelector, void *)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double y() const
Returns the y-position.
Open the object's manipulator.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
GUICalibrator(const std::string &id, MSEdge *edge, MSLane *lane, double pos, const std::string &aXMLFilename, const std::string &outputFilename, const SUMOTime freq, const MSRouteProbe *probe, const std::string &vTypes, bool addLaneMeanData=true)
Constructor.
GUIVisualizationSizeSettings addSize
RotCont myFGRotations
The rotations in full-geometry mode.
Boundary & grow(double by)
extends the boundary by the given amount
long onCmdPreDef(FXObject *, FXSelector, void *)
Stores the information about how to visualize structures.
Calibrates the flow on a segment to a specified one.
std::vector< AspiredState > myIntervals
List of adaptation intervals.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values