90 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
92 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed", GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
93 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
96 FXHorizontalFrame* gf1 =
new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
97 new FXRadioButton(gf1,
"Default", &
myChosenTarget, FXDataTarget::ID_OPTION + 0, ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
98 0, 0, 0, 0, 2, 2, 0, 0);
102 FXHorizontalFrame* gf0 =
new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
103 new FXRadioButton(gf0,
"Loaded", &
myChosenTarget, FXDataTarget::ID_OPTION + 1, ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
104 0, 0, 0, 0, 2, 2, 0, 0);
108 FXHorizontalFrame* gf2 =
new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
109 new FXRadioButton(gf2,
"Predefined: ", &
myChosenTarget, FXDataTarget::ID_OPTION + 2, ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
110 0, 0, 0, 0, 2, 2, 0, 0);
112 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
126 FXHorizontalFrame* gf12 =
new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
127 new FXRadioButton(gf12,
"Free Entry: ", &
myChosenTarget, FXDataTarget::ID_OPTION + 3,
128 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
129 0, 0, 0, 0, 2, 2, 0, 0);
139 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
166 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
185 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
252 if (calibrator->
getEdge() !=
nullptr) {
253 const std::vector<MSLane*>& destLanes = calibrator->getEdge()->getLanes();
254 const MSLane* lane = calibrator->getLane();
255 const double pos = calibrator->myPos;
256 for (std::vector<MSLane*>::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) {
257 if (lane == nullptr || (*i) == lane) {
258 const PositionVector& v = (*i)->getShape();
259 myFGPositions.push_back(v.positionAtOffset(pos));
260 myBoundary.add(v.positionAtOffset(pos));
261 myFGRotations.push_back(-v.rotationDegreeAtOffset(pos));
265 if (calibrator->myNode !=
nullptr) {
266 myBoundary.add(calibrator->myNode->getPosition());
291 auto myCurrentStateInterval =
myCalibrator->myCurrentStateInterval;
297 ret->
mkItem(
TL(
"aspired flow [veh/h]"),
false, myCurrentStateInterval->q);
298 ret->
mkItem(
TL(
"aspired speed"),
false, myCurrentStateInterval->v);
309 const std::string nextStart =
310 (myCurrentStateInterval !=
myCalibrator->myIntervals.end() ?
313 ret->
mkItem(
TL(
"inactive until"),
false, nextStart);
325 std::string flow =
"-";
326 std::string speed =
"-";
328 auto myCurrentStateInterval =
myCalibrator->myCurrentStateInterval;
329 if (myCurrentStateInterval->v >= 0) {
330 speed =
toString(myCurrentStateInterval->v) +
"m/s";
332 if (myCurrentStateInterval->q >= 0) {
333 flow =
toString((
int)myCurrentStateInterval->q) +
"v/h";
340 glTranslated(pos.
x(), pos.
y(),
getType());
341 glRotated(rot, 0, 0, 1);
343 glScaled(exaggeration, exaggeration, 1);
344 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
346 glBegin(GL_TRIANGLES);
347 glColor3d(1, .8f, 0);
349 glVertex2d(0 - 1.4, 0);
350 glVertex2d(0 - 1.4, 6);
351 glVertex2d(0 + 1.4, 6);
352 glVertex2d(0 + 1.4, 0);
353 glVertex2d(0 - 1.4, 0);
354 glVertex2d(0 + 1.4, 6);
358 if (s.
scale * exaggeration >= 1.) {
359 glTranslated(0, 0, .1);
@ MID_MANIP
Open the object's manipulator.
FXDEFMAP(GUICalibrator::GUICalibratorPopupMenu) GUICalibratorPopupMenuMap[]
#define GUIDesignComboBoxVisibleItems
@ GLO_CALIBRATOR
a calibrator
GUIIcon
An enumeration of icons used by the gui applications.
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void popName()
pop Name
static void pushMatrix()
push matrix
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 *)
MFXComboBoxIcon * myPredefinedValues
long onCmdChangeOption(FXObject *, FXSelector, void *)
FXRealSpinner * myUserDefinedSpeed
GUIManip_Calibrator(GUIMainWindow &app, const std::string &name, GUICalibrator &o, int xpos, int ypos)
Constructor.
long onCmdUserDef(FXObject *, FXSelector, void *)
long onCmdPreDef(FXObject *, FXSelector, void *)
virtual ~GUIManip_Calibrator()
Destructor.
long onUpdUserDef(FXObject *, FXSelector, void *)
FXDataTarget mySpeedTarget
long onUpdPreDef(FXObject *, FXSelector, void *)
FXDataTarget myChosenTarget
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
MSCalibrator * myCalibrator
the calibrator being wrapped
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
RotCont myFGRotations
The rotations in full-geometry mode.
PosCont myFGPositions
The positions in full-geometry mode.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
Boundary myBoundary
The boundary of this rerouter.
GUICalibrator(MSCalibrator *calibrator)
Constructor.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string &id, FXIcon *icon)
constructor
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app, bool addSeparator=true) const
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.
virtual Position getCenter() const
GUIGlID getGlID() const
Returns the numerical id of the object.
GUIGlObject(GUIGlObjectType type, const std::string µsimID, FXIcon *icon)
Constructor.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
GUIManipulator(GUIMainWindow &app, const std::string &name, int xpos, int ypos)
Constructor.
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
virtual int passed() const
double currentFlow() const
flow in the current interval in veh/h
int totalWished() const
number of vehicles expected to pass this interval
const MSEdge * getEdge() const
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.
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