Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIParam_PopupMenu.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A popup-menu for dynamic patameter table entries
20/****************************************************************************/
21#include <config.h>
22
23#include <iostream>
24#include <string>
27#include "GUIParam_PopupMenu.h"
32
33
34// ===========================================================================
35// FOX callback mapping
36// ===========================================================================
37FXDEFMAP(GUIParam_PopupMenuInterface) GUIParam_PopupMenuInterfaceMap[] = {
39};
40
41// Object implementation
42FXIMPLEMENT(GUIParam_PopupMenuInterface, FXMenuPane, GUIParam_PopupMenuInterfaceMap, ARRAYNUMBER(GUIParam_PopupMenuInterfaceMap))
43
44
45// ===========================================================================
46// method definitions
47// ===========================================================================
49 GUIParameterTableWindow& parentWindow, GUIGlObject& o, const std::string& varName,
50 ValueSource<double>* src)
51 : FXMenuPane(&parentWindow), myObject(&o), myParentWindow(&parentWindow),
52 myApplication(&app), myVarName(varName), mySource(src) {
53}
54
55
59
60
61long
62GUIParam_PopupMenuInterface::onCmdOpenTracker(FXObject*, FXSelector, void*) {
63 std::string trackerName = myVarName + " from " + myObject->getFullName();
67 tr->addTracked(*myObject, mySource->copy(), newTracked);
68 tr->create();
69 tr->show();
70 }
71 return 1;
72}
73
74
75/****************************************************************************/
@ MID_OPENTRACKER
A Tracker shall be opened.
Definition GUIAppEnum.h:543
FXDEFMAP(GUIParam_PopupMenuInterface) GUIParam_PopupMenuInterfaceMap[]
const std::string & getFullName() const
Definition GUIGlObject.h:94
virtual double getTrackerInterval() const =0
get tracker interval (must be implemented in all children)
virtual SUMOTime getCurrentSimTime() const =0
get current sim time (must be implemented in all children)
A popup-menu for dynamic patameter table entries.
std::string myVarName
The name of the value.
long onCmdOpenTracker(FXObject *, FXSelector, void *)
Called when a tracker for the value shall be opened.
GUIGlObject * myObject
The object the table displays.
ValueSource< double > * mySource
The source of the value.
GUIMainWindow * myApplication
The main application window; holder of some needed values.
A window containing a gl-object's parameter.
A window which displays the time line of one (or more) value(s)
void addTracked(GUIGlObject &o, ValueSource< double > *src, TrackerValueDesc *newTracked)
Adds a further time line to display.
void create()
Creates the window.
static bool addTrackedMultiplot(GUIGlObject &o, ValueSource< double > *src, TrackerValueDesc *newTracked)
all value source to multiplot trackers
static const RGBColor BLACK
Definition RGBColor.h:193
Representation of a timeline of floats with their names and moments.
virtual ValueSource * copy() const =0
Definition json.hpp:4471