Eclipse SUMO - Simulation of Urban MObility
GNEStopFrame.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 /****************************************************************************/
18 // The Widget for add Stops elements
19 /****************************************************************************/
20 #include <config.h>
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEViewNet.h>
25 
26 #include "GNEStopFrame.h"
27 
28 // ===========================================================================
29 // method definitions
30 // ===========================================================================
31 
32 // ---------------------------------------------------------------------------
33 // GNEStopFrame::HelpCreation - methods
34 // ---------------------------------------------------------------------------
35 
37  MFXGroupBoxModule(StopFrameParent, TL("Help")),
38  myStopFrameParent(StopFrameParent) {
40 }
41 
42 
44 
45 
46 void
48  // first update help creation
49  updateHelpCreation();
50  // show module
51  show();
52 }
53 
54 
55 void
57  hide();
58 }
59 
60 
61 void
63  // create information label
64  std::ostringstream information;
65  // set text depending of selected Stop type
66  if (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()) {
67  switch (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
70  information
71  << "- " << TL("Shift+Click to select parent") << "\n"
72  << "- " << TL("Click over a bus stop to create a stop.");
73  break;
76  information
77  << "- " << TL("Shift+Click to select parent") << "\n"
78  << "- " << TL("Click over a train stop to create a stop.");
79  break;
82  information
83  << "- " << TL("Shift+Click to select parent") << "\n"
84  << "- " << TL("Click over a container stop to create a stop.");
85  break;
88  information
89  << "- " << TL("Shift+Click to select parent") << "\n"
90  << "- " << TL("Click over a charging station to create a stop.");
91  break;
94  information
95  << "- " << TL("Shift+Click to select parent") << "\n"
96  << "- " << TL("Click over a parking area to create a stop.");
97  break;
98  case GNE_TAG_STOP_LANE:
100  information
101  << "- " << TL("Shift+Click to select parent") << "\n"
102  << "- " << TL("Click over a lane to create a stop.");
103  break;
104  default:
105  information
106  << "- " << TL("No stop parents in current network.");
107  break;
108  }
109  }
110  // set information label
111  myInformationLabel->setText(information.str().c_str());
112 }
113 
114 // ---------------------------------------------------------------------------
115 // GNEStopFrame - methods
116 // ---------------------------------------------------------------------------
117 
119  GNEFrame(viewParent, viewNet, TL("Stops")),
120  myRouteHandler("", viewNet->getNet(), true, false),
121  myStopParentBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
122 
123  // Create Stop parent selector
124  myStopParentSelector = new GNEDemandElementSelector(this, {GNETagProperties::TagType::VEHICLE, GNETagProperties::TagType::ROUTE});
125 
126  // Create item Selector module for Stops
127  myStopTagSelector = new GNETagSelector(this, GNETagProperties::TagType::VEHICLESTOP, GNE_TAG_STOP_LANE);
128 
129  // Create Stop parameters
131 
132  // Create Netedit parameter
134 
135  // Create Help Creation Module
136  myHelpCreation = new HelpCreation(this);
137 
138  // refresh myStopParentMatchBox
140 }
141 
142 
144  delete myStopParentBaseObject;
145 }
146 
147 
148 void
150  // first check if stop frame modules can be shown
151  bool validStopParent = false;
152  // check if at least there an item that supports an stop
153  for (auto i = myStopParentSelector->getAllowedTags().begin(); (i != myStopParentSelector->getAllowedTags().end()) && (validStopParent == false); i++) {
154  if (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(*i).size() > 0) {
155  validStopParent = true;
156  }
157  }
158  // show or hide modules depending of validStopParent
159  if (validStopParent) {
160  // refresh tag selector
162  // refresh vType selector
164  // refresh tag selector
166  // show
169  } else {
170  // hide modules (except help creation)
175  // show help creation module
177  }
178  // reset last position
180  // show frame
181  GNEFrame::show();
182 }
183 
184 
185 bool
187  // first check stop type
188  if (myStopTagSelector->getCurrentTemplateAC() == nullptr) {
189  WRITE_WARNING(TL("Selected Stop type isn't valid."));
190  return false;
191  }
192  // check if we're selecting a new stop parent
193  if (mouseButtonKeyPressed.shiftKeyPressed()) {
194  if (viewObjects.getDemandElementFront() &&
197  WRITE_WARNINGF(TL("Selected % '%' as stop parent."), viewObjects.getDemandElementFront()->getTagStr(), viewObjects.getDemandElementFront()->getID());
198  return true;
199  } else {
200  WRITE_WARNING(TL("Selected Stop parent isn't valid."));
201  return false;
202  }
203  } else {
204  // now check if stop parent selector is valid
205  if (myStopParentSelector->getCurrentDemandElement() == nullptr) {
206  WRITE_WARNING(TL("Current selected Stop parent isn't valid."));
207  return false;
208  }
209  // create stop base object
211  viewObjects.getLaneFront(), viewObjects.getAdditionalFront());
214  myStopParentBaseObject->getSumoBaseObjectChildren().front()->getStopParameter());
215  // show all trips
218  } else {
220  }
221  // stop successfully created, then return true
222  return true;
223  } else {
224  return false;
225  }
226  }
227 }
228 
229 bool
230 GNEStopFrame::getStopParameter(const SumoXMLTag stopTag, const GNELane* lane, const GNEAdditional* stoppingPlace) {
231  // first clear stop base object
233  // declare stop parameters
235  // first check that current selected Stop is valid
236  if (stopTag == SUMO_TAG_NOTHING) {
237  WRITE_WARNING(TL("Current selected Stop type isn't valid."));
238  return false;
239  } else if ((stopTag == GNE_TAG_STOP_LANE) || (stopTag == GNE_TAG_WAYPOINT_LANE)) {
240  if (lane) {
241  stop.lane = lane->getID();
242  if ((stopTag == GNE_TAG_WAYPOINT_LANE) && (stop.speed == 0)) {
243  stop.speed = lane->getSpeed();
244  }
245  } else {
246  WRITE_WARNING("Click over a " + toString(SUMO_TAG_LANE) + " to create a stop placed in a " + toString(SUMO_TAG_LANE));
247  return false;
248  }
249  } else if (stopTag == GNE_TAG_STOPPERSON_EDGE) {
250  if (lane) {
251  stop.edge = lane->getParentEdge()->getID();
252  } else {
253  WRITE_WARNING("Click over a " + toString(SUMO_TAG_EDGE) + " to create a stop placed in a " + toString(SUMO_TAG_EDGE));
254  return false;
255  }
256  } else if (stoppingPlace) {
257  if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_BUS_STOP) {
258  if ((stopTag != GNE_TAG_STOP_BUSSTOP) && (stopTag != GNE_TAG_WAYPOINT_BUSSTOP) && (stopTag != GNE_TAG_STOPPERSON_BUSSTOP)) {
259  WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
260  return false;
261  } else {
262  stop.busstop = stoppingPlace->getID();
263  if ((stopTag == GNE_TAG_WAYPOINT_BUSSTOP) && (stop.speed == 0)) {
264  stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
265  }
266  stop.startPos = 0;
267  stop.endPos = 0;
268  }
269  } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_TRAIN_STOP) {
270  if ((stopTag != GNE_TAG_STOP_TRAINSTOP) && (stopTag != GNE_TAG_WAYPOINT_TRAINSTOP)) {
271  WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
272  return false;
273  } else {
274  stop.busstop = stoppingPlace->getID();
275  if ((stopTag == GNE_TAG_WAYPOINT_TRAINSTOP) && (stop.speed == 0)) {
276  stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
277  }
278  stop.startPos = 0;
279  stop.endPos = 0;
280  }
281  } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CONTAINER_STOP) {
282  if ((stopTag != GNE_TAG_STOP_CONTAINERSTOP) && (stopTag != GNE_TAG_WAYPOINT_CONTAINERSTOP)) {
283  WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
284  return false;
285  } else {
286  stop.containerstop = stoppingPlace->getID();
287  if ((stopTag == GNE_TAG_WAYPOINT_CONTAINERSTOP) && (stop.speed == 0)) {
288  stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
289  }
290  stop.startPos = 0;
291  stop.endPos = 0;
292  }
293  } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CHARGING_STATION) {
294  if ((stopTag != GNE_TAG_STOP_CHARGINGSTATION) && (stopTag != GNE_TAG_WAYPOINT_CHARGINGSTATION)) {
295  WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
296  return false;
297  } else {
298  stop.chargingStation = stoppingPlace->getID();
299  if ((stopTag == GNE_TAG_WAYPOINT_CHARGINGSTATION) && (stop.speed == 0)) {
300  stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
301  }
302  stop.startPos = 0;
303  stop.endPos = 0;
304  }
305  } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA) {
306  if ((stopTag != GNE_TAG_STOP_PARKINGAREA) && (stopTag != GNE_TAG_WAYPOINT_PARKINGAREA)) {
307  WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
308  return false;
309  } else {
310  stop.parkingarea = stoppingPlace->getID();
311  if ((stopTag == GNE_TAG_WAYPOINT_PARKINGAREA) && (stop.speed == 0)) {
312  stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
313  }
314  stop.startPos = 0;
315  stop.endPos = 0;
316  }
317  }
318  } else {
319  if ((stopTag == GNE_TAG_STOP_BUSSTOP) || (stopTag == GNE_TAG_WAYPOINT_BUSSTOP)) {
320  WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_BUSSTOP) + " to create a stop placed in a " + toString(GNE_TAG_STOP_BUSSTOP));
321  } else if ((stopTag == GNE_TAG_STOP_TRAINSTOP) || (stopTag == GNE_TAG_WAYPOINT_TRAINSTOP)) {
322  WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_TRAINSTOP) + " to create a stop placed in a " + toString(GNE_TAG_STOP_TRAINSTOP));
323  } else if ((stopTag == GNE_TAG_STOP_CONTAINERSTOP) || (stopTag == GNE_TAG_WAYPOINT_CONTAINERSTOP)) {
324  WRITE_WARNING("Click over a " + toString(SUMO_TAG_CONTAINER_STOP) + " to create a stop placed in a " + toString(SUMO_TAG_CONTAINER_STOP));
325  } else if ((stopTag == GNE_TAG_STOP_CHARGINGSTATION) || (stopTag == GNE_TAG_WAYPOINT_CHARGINGSTATION)) {
326  WRITE_WARNING("Click over a " + toString(SUMO_TAG_CHARGING_STATION) + " to create a stop placed in a " + toString(SUMO_TAG_CHARGING_STATION));
327  } else if ((stopTag == GNE_TAG_STOP_PARKINGAREA) || (stopTag == GNE_TAG_WAYPOINT_PARKINGAREA)) {
328  WRITE_WARNING("Click over a " + toString(SUMO_TAG_PARKING_AREA) + " to create a stop placed in a " + toString(SUMO_TAG_PARKING_AREA));
329  } else if (stopTag == GNE_TAG_STOPPERSON_BUSSTOP) {
330  WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_BUSSTOP) + " to create a person stop placed in a " + toString(GNE_TAG_STOP_BUSSTOP));
331  } else if (stopTag == GNE_TAG_STOPPERSON_TRAINSTOP) {
332  WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_TRAINSTOP) + " to create a person stop placed in a " + toString(GNE_TAG_STOP_TRAINSTOP));
333  }
334  return false;
335  }
336  // check if stop attributes are valid
339  return false;
340  }
341  // get stop parent
343  // if stopParent is a route, check that stop is placed over a route's edge
344  if (stopParent->isRoute() && lane) {
345  bool found = false;
346  for (const auto& edge : stopParent->getParentEdges()) {
347  if (edge == lane->getParentEdge()) {
348  found = true;
349  }
350  }
351  if (!found) {
352  WRITE_WARNING(TL("Stop must be placed over a route's edge"));
353  return false;
354  }
355  }
356  // same if stoParent is a vehicle/flow with embedded route
357  if (stopParent->getChildDemandElements().size() > 0 && stopParent->getChildDemandElements().front()->getTagProperty().isRoute() && lane) {
358  bool found = false;
359  for (const auto& edge : stopParent->getChildDemandElements().front()->getParentEdges()) {
360  if (edge == lane->getParentEdge()) {
361  found = true;
362  }
363  }
364  if (!found) {
365  WRITE_WARNING(TL("Stop must be placed over an embedded route's edge"));
366  return false;
367  }
368  }
369  // set parent tag and id
372  // add route, from and to attributes
373  if (stopParent->getTagProperty().hasAttribute(SUMO_ATTR_ROUTE)) {
375  }
376  if (stopParent->getTagProperty().hasAttribute(SUMO_ATTR_FROM)) {
378  }
379  if (stopParent->getTagProperty().hasAttribute(SUMO_ATTR_TO)) {
381  }
382  // create stop object
384  // get stop attributes
385  myStopAttributes->getAttributesAndValues(stopBaseObject, true);
386  // add netedit values
387  if (!stop.edge.empty() || !stop.lane.empty()) {
388  myNeteditAttributes->getNeteditAttributesAndValues(stopBaseObject, lane);
389  // check if start position can be parsed
390  if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_STARTPOS)) {
391  stop.startPos = stopBaseObject->getDoubleAttribute(SUMO_ATTR_STARTPOS);
393  } else {
394  stop.startPos = INVALID_DOUBLE;
395  }
396  // check if end position can be parsed
397  if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_ENDPOS)) {
398  stop.endPos = stopBaseObject->getDoubleAttribute(SUMO_ATTR_ENDPOS);
399  stop.parametersSet |= STOP_END_SET;
400  } else {
401  stop.endPos = INVALID_DOUBLE;
402  }
403  }
404  // obtain friendly position
405  if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_FRIENDLY_POS)) {
406  stop.friendlyPos = stopBaseObject->getBoolAttribute(SUMO_ATTR_FRIENDLY_POS);
407  }
408  // obtain posLat
409  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_POSITION_LAT)) {
410  if (GNEAttributeCarrier::canParse<double>(stopBaseObject->getStringAttribute(SUMO_ATTR_POSITION_LAT))) {
411  stop.posLat = GNEAttributeCarrier::parse<double>(stopBaseObject->getStringAttribute(SUMO_ATTR_POSITION_LAT));
413  } else {
414  stop.posLat = INVALID_DOUBLE;
415  }
416  }
417  // obtain actType
418  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_ACTTYPE)) {
419  stop.actType = stopBaseObject->getStringAttribute(SUMO_ATTR_ACTTYPE);
420  }
421  // fill rest of parameters depending if it was edited
422  if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_DURATION)) {
423  stop.duration = stopBaseObject->getTimeAttribute(SUMO_ATTR_DURATION);
424  if (stop.duration >= 0) {
426  }
427  }
428  if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_UNTIL)) {
429  stop.until = stopBaseObject->getTimeAttribute(SUMO_ATTR_UNTIL);
430  if (stop.until >= 0) {
432  }
433  }
434  if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_EXTENSION)) {
435  stop.extension = stopBaseObject->getTimeAttribute(SUMO_ATTR_EXTENSION);
436  if (stop.extension >= 0) {
438  }
439  }
440  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIGGERED)) {
441  if ((stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "person") || (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "true")) {
443  stop.triggered = true;
444  } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "container") {
446  stop.containerTriggered = true;
447  } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "join") {
449  stop.joinTriggered = true;
450  }
451  }
452  if (stopBaseObject->hasStringListAttribute(SUMO_ATTR_EXPECTED)) {
453  const auto expected = stopBaseObject->getStringListAttribute(SUMO_ATTR_EXPECTED);
454  if (expected.size() > 0) {
455  if (stop.triggered) {
456  for (const auto& id : expected) {
457  stop.awaitedPersons.insert(id);
458  }
460  } else if (stop.containerTriggered) {
461  for (const auto& id : expected) {
462  stop.awaitedContainers.insert(id);
463  }
465  }
466  }
467  }
468  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_JOIN)) {
469  stop.join = stopBaseObject->getStringAttribute(SUMO_ATTR_JOIN);
470  if (stop.join.size() > 0) {
472  }
473  }
474  if (stopBaseObject->hasStringListAttribute(SUMO_ATTR_PERMITTED)) {
475  const auto permitted = stopBaseObject->getStringListAttribute(SUMO_ATTR_PERMITTED);
476  if (permitted.size() > 0) {
478  for (const auto& permit : permitted) {
479  stop.permitted.insert(permit);
480  }
481  }
482  }
483  if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_PARKING)) {
484  if (stopBaseObject->getBoolAttribute(SUMO_ATTR_PARKING)) {
485  // temporal, currently OPPORTUNISTIC don't supported
488  }
489  }
490  if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_JUMP)) {
491  stop.jump = stopBaseObject->getTimeAttribute(SUMO_ATTR_JUMP);
492  if (stop.jump >= 0) {
494  }
495  }
496  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_SPLIT)) {
497  stop.split = stopBaseObject->getStringAttribute(SUMO_ATTR_SPLIT);
498  if (stop.split.size() > 0) {
500  }
501  }
502  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIP_ID)) {
503  stop.tripId = stopBaseObject->getStringAttribute(SUMO_ATTR_TRIP_ID);
504  if (stop.tripId.size() > 0) {
506  }
507  }
508  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_LINE)) {
509  stop.line = stopBaseObject->getStringAttribute(SUMO_ATTR_LINE);
510  if (stop.line.size() > 0) {
512  }
513  }
514  if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_ONDEMAND)) {
515  stop.onDemand = stopBaseObject->getBoolAttribute(SUMO_ATTR_ONDEMAND);
516  if (stop.onDemand) {
518  }
519  }
520  if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_SPEED) && (stopBaseObject->getDoubleAttribute(SUMO_ATTR_SPEED) > 0)) {
521  stop.speed = stopBaseObject->getDoubleAttribute(SUMO_ATTR_SPEED);
522  if (stop.speed > 0) {
524  }
525  }
526  if (stopBaseObject->hasStringAttribute(SUMO_ATTR_INDEX)) {
527  if (stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX) == "fit") {
528  stop.index = STOP_INDEX_FIT;
529  } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX) == "end") {
530  stop.index = STOP_INDEX_END;
531  } else if (GNEAttributeCarrier::canParse<int>(stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX))) {
532  stop.index = GNEAttributeCarrier::parse<int>(stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX));
533  } else {
534  stop.index = STOP_INDEX_END;
535  }
536  } else {
537  stop.index = STOP_INDEX_END;
538  }
539  // refresh stop attributes
541  // set tag
542  stopBaseObject->setTag(stopTag);
543  stopBaseObject->setStopParameter(stop);
544  return true;
545 }
546 
547 
550  return myStopParentSelector;
551 }
552 
553 // ===========================================================================
554 // protected
555 // ===========================================================================
556 
557 void
560  // show Stop type selector module
564  // reset last position
566  } else {
567  // hide all modules if stop parent isn't valid
571  }
572 }
573 
574 
575 void
577  // show or hide modules depending if current selected stop parent is valid
581  // show modules
585  } else {
589  }
590  } else {
591  // hide modules
596  }
597 }
598 
599 
600 /****************************************************************************/
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:285
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:296
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:295
#define TL(string)
Definition: MsgHandler.h:315
const int STOP_DURATION_SET
const int STOP_INDEX_END
const int STOP_POSLAT_SET
const int STOP_EXPECTED_SET
const int STOP_SPEED_SET
const int STOP_UNTIL_SET
const int STOP_LINE_SET
const int STOP_PARKING_SET
const int STOP_TRIP_ID_SET
const int STOP_PERMITTED_SET
const int STOP_SPLIT_SET
const int STOP_START_SET
const int STOP_JOIN_SET
const int STOP_CONTAINER_TRIGGER_SET
const int STOP_EXTENSION_SET
const int STOP_INDEX_FIT
const int STOP_TRIGGER_SET
const int STOP_JUMP_SET
const int STOP_ONDEMAND_SET
const int STOP_END_SET
const int STOP_EXPECTED_CONTAINERS_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_WAYPOINT_PARKINGAREA
waypoint placed over a parking area
@ GNE_TAG_STOP_PARKINGAREA
stop placed over a parking area
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ GNE_TAG_STOP_BUSSTOP
stop placed over a busStop
@ GNE_TAG_WAYPOINT_TRAINSTOP
waypoint placed over a busStop
@ GNE_TAG_WAYPOINT_CONTAINERSTOP
waypoint placed over a containerStop
@ GNE_TAG_WAYPOINT_BUSSTOP
waypoint placed over a busStop
@ SUMO_TAG_BUS_STOP
A bus stop.
@ GNE_TAG_WAYPOINT_CHARGINGSTATION
waypoint placed over a charging station
@ GNE_TAG_STOPPERSON_BUSSTOP
@ GNE_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_WAYPOINT_LANE
waypoint placed over a lane
@ GNE_TAG_STOP_LANE
stop placed over a lane
@ GNE_TAG_STOPPERSON_TRAINSTOP
@ GNE_TAG_STOP_TRAINSTOP
stop placed over a trainStop
@ GNE_TAG_STOP_CHARGINGSTATION
stop placed over a charging station
@ GNE_TAG_STOPPERSON_EDGE
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_PARKING
@ SUMO_ATTR_EXTENSION
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_SPLIT
@ SUMO_ATTR_ACTTYPE
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_EXPECTED
@ SUMO_ATTR_LINE
@ SUMO_ATTR_ONDEMAND
@ SUMO_ATTR_INDEX
@ SUMO_ATTR_TRIP_ID
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_PERMITTED
@ SUMO_ATTR_JOIN
@ SUMO_ATTR_JUMP
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_ID
@ SUMO_ATTR_UNTIL
@ SUMO_ATTR_TRIGGERED
@ SUMO_ATTR_DURATION
const double INVALID_DOUBLE
invalid double
Definition: StdDefs.h:64
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time attribute
bool hasBoolAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given bool attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
bool hasTimeAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given time attribute
SumoXMLTag getTag() const
get XML myTag
bool hasDoubleAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given double attribute
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
void setStopParameter(const SUMOVehicleParameter::Stop &stopParameter)
add stop parameters
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::vector< std::string > & getStringListAttribute(const SumoXMLAttr attr) const
get string list attribute
bool hasStringListAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given string list attribute
void clear()
clear SumoBaseObject
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::vector< SumoBaseObject * > & getSumoBaseObjectChildren() const
get SumoBaseObject children
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
const std::string getID() const
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
bool areValuesValid() const
check if parameters of attributes are valid
void showAttributesCreatorModule(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show GNEAttributesCreator modul
void hideAttributesCreatorModule()
hide group box
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
void refreshAttributesCreator()
refresh attribute creator
virtual std::string getAttribute(SumoXMLAttr key) const =0
void showDemandElementSelector()
show demand element selector
void setDemandElement(GNEDemandElement *demandElement)
set current demand element
void refreshDemandElementSelector()
refresh demand element selector
GNEDemandElement * getCurrentDemandElement() const
get current demand element
const std::vector< SumoXMLTag > & getAllowedTags() const
void hideDemandElementSelector()
hide demand element selector
GNEViewNet * myViewNet
FOX need this.
Definition: GNEFrame.h:117
virtual void show()
show Frame
Definition: GNEFrame.cpp:115
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:124
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
double getSpeed() const
returns the current speed of lane
Definition: GNELane.cpp:655
GNEEdge * getParentEdge() const
get parent edge
Definition: GNELane.cpp:196
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:123
void showNeteditAttributesModule(GNEAttributeCarrier *templateAC)
show Netedit attributes modul
void hideNeteditAttributesModule()
hide Netedit attributes modul
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
bool isRoute() const
check if pathElement is a route
void buildStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter::Stop &stopParameters)
build stop
void updateHelpCreation()
update HelpCreation
void showHelpCreation()
show HelpCreation
void hideHelpCreation()
hide HelpCreation
HelpCreation(GNEStopFrame *StopFrameParent)
constructor
MFXDynamicLabel * myInformationLabel
Label with creation information.
Definition: GNEStopFrame.h:70
CommonXMLStructure::SumoBaseObject * myStopParentBaseObject
stop parent base object
Definition: GNEStopFrame.h:110
void show()
show Frame
GNERouteHandler myRouteHandler
route handler
Definition: GNEStopFrame.h:107
bool getStopParameter(const SumoXMLTag stopTag, const GNELane *lane, const GNEAdditional *stoppingPlace)
get stop parameters
~GNEStopFrame()
Destructor.
GNEStopFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
GNEDemandElementSelector * myStopParentSelector
Stop parent selectors.
Definition: GNEStopFrame.h:113
void demandElementSelected()
selected demand element in DemandElementSelector
GNETagSelector * myStopTagSelector
stop tag selector selector (used to select diffent kind of Stops)
Definition: GNEStopFrame.h:116
HelpCreation * myHelpCreation
Help creation.
Definition: GNEStopFrame.h:125
void tagSelected()
Tag selected in GNETagSelector.
GNEAttributesCreator * myStopAttributes
internal Stop attributes
Definition: GNEStopFrame.h:119
GNEDemandElementSelector * getStopParentSelector() const
get stop parent selector
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
GNENeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEStopFrame.h:122
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
bool isVehicle() const
return true if tag correspond to a vehicle element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
bool isVehicleStop() const
return true if tag correspond to a vehicle stop element
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
void showTagSelector()
show item selector
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
void hideTagSelector()
hide item selector
class used to group all variables related with objects under cursor after a click over view
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
GNENet * getNet() const
get the net object
void resetLastClickedPosition()
reset last clicked position
Definition: GNEViewNet.cpp:813
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:721
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:88
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
A list item which allows for custom coloring.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at.
ParkingType parking
whether the vehicle is removed from the net while stopping
std::string lane
The lane to stop at.
SUMOTime extension
The maximum time extension for boarding / loading.
bool friendlyPos
enable or disable friendly position (used by netedit)
double speed
the speed at which this stop counts as reached (waypoint mode)
std::string parkingarea
(Optional) parking area if one is assigned to the stop
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
double startPos
The stopping position start.
std::string line
the new line id of the trip within a cyclical public transport route
double posLat
the lateral offset when stopping
bool onDemand
whether the stop may be skipped
std::string chargingStation
(Optional) charging station if one is assigned to the stop
std::set< std::string > permitted
IDs of persons or containers that may board/load at this stop.
int parametersSet
Information for the output which parameter were set.
int index
at which position in the stops list
SUMOTime jump
transfer time if there shall be a jump from this stop to the next route edge
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
SUMOTime until
The time at which the vehicle may continue its journey.
std::string actType
act Type (only used by Persons) (used by netedit)
bool triggered
whether an arriving person lets the vehicle continue
double endPos
The stopping position end.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
std::string busstop
(Optional) bus stop if one is assigned to the stop
bool joinTriggered
whether an joined vehicle lets this vehicle continue
std::string tripId
id of the trip within a cyclical public transport route
std::string containerstop
(Optional) container stop if one is assigned to the stop
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime duration
The stopping duration.
MFXCheckableButton * menuCheckShowAllTrips
show all trips
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event