94 myChosenTarget(myChosenValue,
nullptr, MID_OPTION),
97 mySpeedTarget(mySpeed),
99 myChosenTarget.setTarget(
this);
100 FXVerticalFrame* f1 =
101 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
103 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed",
104 GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
105 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
108 FXHorizontalFrame* gf1 =
109 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
110 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
111 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
112 0, 0, 0, 0, 2, 2, 0, 0);
116 FXHorizontalFrame* gf0 =
117 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
118 new FXRadioButton(gf0,
"Loaded", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
119 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
120 0, 0, 0, 0, 2, 2, 0, 0);
124 FXHorizontalFrame* gf2 =
125 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
126 new FXRadioButton(gf2,
"Predefined: ", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
127 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
128 0, 0, 0, 0, 2, 2, 0, 0);
130 new FXComboBox(gf2, 10,
this, MID_PRE_DEF,
131 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
132 myPredefinedValues->appendItem(
"20 km/h");
133 myPredefinedValues->appendItem(
"40 km/h");
134 myPredefinedValues->appendItem(
"60 km/h");
135 myPredefinedValues->appendItem(
"80 km/h");
136 myPredefinedValues->appendItem(
"100 km/h");
137 myPredefinedValues->appendItem(
"120 km/h");
138 myPredefinedValues->appendItem(
"140 km/h");
139 myPredefinedValues->appendItem(
"160 km/h");
140 myPredefinedValues->appendItem(
"180 km/h");
141 myPredefinedValues->appendItem(
"200 km/h");
142 myPredefinedValues->setNumVisible(5);
146 FXHorizontalFrame* gf12 =
147 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
148 new FXRadioButton(gf12,
"Free Entry: ", &myChosenTarget, FXDataTarget::ID_OPTION + 3,
149 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
150 0, 0, 0, 0, 2, 2, 0, 0);
152 new FXRealSpinner(gf12, 10,
this, MID_USER_DEF,
153 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
156 myUserDefinedSpeed->setIncrement(10);
157 myUserDefinedSpeed->setRange(0, 300);
158 myUserDefinedSpeed->setValue(0);
161 new FXButton(f1,
"Close",
nullptr,
this, MID_CLOSE,
162 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
189 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
191 myParent->updateChildren();
208 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
210 myParent->updateChildren();
263 *myApplication, *myParent);
275 const std::vector<MSLane*>& destLanes = calibrator->
myEdge->
getLanes();
277 const double pos = calibrator->
myPos;
278 for (std::vector<MSLane*>::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) {
279 if (lane ==
nullptr || (*i) == lane) {
315 ret->
mkItem(
"interval start",
false,
STEPS2TIME(myCurrentStateInterval->begin));
316 ret->
mkItem(
"interval end",
false,
STEPS2TIME(myCurrentStateInterval->end));
317 ret->
mkItem(
"aspired flow [veh/h]",
false, myCurrentStateInterval->q);
318 ret->
mkItem(
"aspired speed",
false, myCurrentStateInterval->v);
329 const std::string nextStart =
333 ret->
mkItem(
"inactive until",
false, nextStart);
344 std::string flow =
"-";
345 std::string speed =
"-";
348 if (myCurrentStateInterval->v >= 0) {
349 speed =
toString(myCurrentStateInterval->v) +
"m/s";
351 if (myCurrentStateInterval->q >= 0) {
352 flow =
toString((
int)myCurrentStateInterval->q) +
"v/h";
360 glTranslated(pos.
x(), pos.
y(),
getType());
361 glRotated(rot, 0, 0, 1);
363 glScaled(exaggeration, exaggeration, 1);
364 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
366 glBegin(GL_TRIANGLES);
367 glColor3d(1, .8f, 0);
369 glVertex2d(0 - 1.4, 0);
370 glVertex2d(0 - 1.4, 6);
371 glVertex2d(0 + 1.4, 6);
372 glVertex2d(0 + 1.4, 0);
373 glVertex2d(0 - 1.4, 0);
374 glVertex2d(0 + 1.4, 6);
378 if (s.
scale * exaggeration >= 1.) {
379 glTranslated(0, 0, .1);
@ MID_MANIP
Open the object's manipulator.
FXDEFMAP(GUICalibrator::GUIManip_Calibrator) GUIManip_CalibratorMap[]
GUICalibratorPopupMenuMap[]
@ GLO_CALIBRATOR
a Calibrator
std::string time2string(SUMOTime t)
convert SUMOTime to string
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
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, const int align=0, double width=-1)
long onCmdClose(FXObject *, FXSelector, void *)
long onCmdChangeOption(FXObject *, FXSelector, void *)
long onCmdUserDef(FXObject *, FXSelector, void *)
long onCmdPreDef(FXObject *, FXSelector, void *)
virtual ~GUIManip_Calibrator()
Destructor.
long onUpdUserDef(FXObject *, FXSelector, void *)
long onUpdPreDef(FXObject *, FXSelector, void *)
Changes the speed allowed on a set of lanes (gui version)
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
MSCalibrator * myCalibrator
the calibrator being wrapped
RotCont myFGRotations
The rotations in full-geometry mode.
PosCont myFGPositions
The positions in full-geometry mode.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
Boundary myBoundary
The boundary of this rerouter.
GUICalibrator(MSCalibrator *calibrator)
Constructor.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
const std::string & getFullName() const
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationSizeSettings addSize
double scale
information about a lane's width (temporary, used for a single view)
Calibrates the flow on a segment to a specified one.
double currentSpeed() const
measured speed in the current interval
const MSEdge *const myEdge
the edge on which this calibrator lies
virtual int passed() const
std::vector< AspiredState >::const_iterator myCurrentStateInterval
Iterator pointing to the current interval.
double currentFlow() const
flow in the current interval in veh/h
std::vector< AspiredState > myIntervals
List of adaptation intervals.
const double myPos
the position on the edge where this calibrator lies
int totalWished() const
number of vehicles expected to pass this interval
double myDefaultSpeed
The default (maximum) speed on the segment.
MSLane *const myLane
the lane on which this calibrator lies (0 if the whole edge is covered at once)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Representation of a lane in the micro simulation.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
static const RGBColor BLACK
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values