100 myChosenTarget(myChosenValue, NULL, MID_OPTION),
103 mySpeedTarget(mySpeed),
105 myChosenTarget.setTarget(
this);
106 FXVerticalFrame* f1 =
107 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
109 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed",
110 GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
111 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
114 FXHorizontalFrame* gf1 =
115 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
116 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
117 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
118 0, 0, 0, 0, 2, 2, 0, 0);
122 FXHorizontalFrame* gf0 =
123 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
124 new FXRadioButton(gf0,
"Loaded", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
125 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
126 0, 0, 0, 0, 2, 2, 0, 0);
130 FXHorizontalFrame* gf2 =
131 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
132 new FXRadioButton(gf2,
"Predefined: ", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
133 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
134 0, 0, 0, 0, 2, 2, 0, 0);
136 new FXComboBox(gf2, 10,
this, MID_PRE_DEF,
137 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
138 myPredefinedValues->appendItem(
"20 km/h");
139 myPredefinedValues->appendItem(
"40 km/h");
140 myPredefinedValues->appendItem(
"60 km/h");
141 myPredefinedValues->appendItem(
"80 km/h");
142 myPredefinedValues->appendItem(
"100 km/h");
143 myPredefinedValues->appendItem(
"120 km/h");
144 myPredefinedValues->appendItem(
"140 km/h");
145 myPredefinedValues->appendItem(
"160 km/h");
146 myPredefinedValues->appendItem(
"180 km/h");
147 myPredefinedValues->appendItem(
"200 km/h");
148 myPredefinedValues->setNumVisible(5);
152 FXHorizontalFrame* gf12 =
153 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
154 new FXRadioButton(gf12,
"Free Entry: ", &myChosenTarget, FXDataTarget::ID_OPTION + 3,
155 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
156 0, 0, 0, 0, 2, 2, 0, 0);
159 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
160 myUserDefinedSpeed->setFormatString(
"%.0f km/h");
161 myUserDefinedSpeed->setIncrements(1, 10, 10);
162 myUserDefinedSpeed->setRange(0, 300);
163 myUserDefinedSpeed->setValue(0);
166 new FXButton(f1,
"Close", NULL,
this,
MID_CLOSE,
167 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
194 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
213 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
280 const std::string& aXMLFilename,
281 const std::string& outputFilename,
284 MSCalibrator(id, edge, lane, pos, aXMLFilename, outputFilename, freq, edge->getLength(), probe),
287 const std::vector<MSLane*>& destLanes = edge->
getLanes();
288 for (std::vector<MSLane*>::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) {
289 if (lane == 0 || (*i) == lane) {
338 const std::string nextStart =
342 ret->
mkItem(
"inactive until",
false, nextStart);
353 std::string flow =
"-";
354 std::string speed =
"-";
368 glTranslated(pos.
x(), pos.
y(),
getType());
369 glRotated(rot, 0, 0, 1);
371 glScaled(exaggeration, exaggeration, 1);
372 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
374 glBegin(GL_TRIANGLES);
375 glColor3d(1, .8f, 0);
377 glVertex2d(0 - 1.4, 0);
378 glVertex2d(0 - 1.4, 6);
379 glVertex2d(0 + 1.4, 6);
380 glVertex2d(0 + 1.4, 0);
381 glVertex2d(0 - 1.4, 0);
382 glVertex2d(0 + 1.4, 6);
386 if (s.
scale * exaggeration >= 1.) {
387 glTranslated(0, 0, .1);
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
double scale
information about a lane's width (temporary, used for a single view)
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Changes the speed allowed on a set of lanes (gui version)
GUIVisualizationTextSettings addName
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
virtual int passed() const
Writes routes of vehicles passing a certain edge.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
std::string time2string(SUMOTime t)
double x() const
Returns the x-position.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
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)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static const RGBColor BLACK
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
long onCmdChangeOption(FXObject *, FXSelector, void *)
double currentSpeed() const
measured speed in the current interval
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
long onUpdPreDef(FXObject *, FXSelector, void *)
A class that stores a 2D geometrical boundary.
FXDEFMAP(GUICalibrator::GUIManip_Calibrator) GUIManip_CalibratorMap[]
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
int totalWished() const
number of vehicles expected to pass this interval
A road/street connecting two junctions.
GUICalibratorPopupMenuMap[]
GUIVisualizationSizeSettings addSize
virtual ~GUIManip_Calibrator()
Destructor.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::vector< AspiredState >::const_iterator myCurrentStateInterval
Iterator pointing to the current interval.
Boundary myBoundary
The boundary of this rerouter.
A point in 2D or 3D with translation and scaling methods.
long onCmdPreDef(FXObject *, FXSelector, void *)
double myDefaultSpeed
The default (maximum) speed on the segment.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
RotCont myFGRotations
The rotations in full-geometry mode.
Boundary & grow(double by)
extends the boundary by the given amount
std::vector< AspiredState > myIntervals
List of adaptation intervals.
long onCmdClose(FXObject *, FXSelector, void *)
Open the object's manipulator.
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
PosCont myFGPositions
The positions in full-geometry mode.
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)
Constructor.
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.
Calibrates the flow on a segment to a specified one.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
long onCmdUserDef(FXObject *, FXSelector, void *)
long onUpdUserDef(FXObject *, FXSelector, void *)
const std::string & getFullName() const
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Representation of a lane in the micro simulation.
A window containing a gl-object's parameter.
double currentFlow() const
flow in the current interval in veh/h
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.