Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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>
27
28#include "GNEStopFrame.h"
29
30// ===========================================================================
31// method definitions
32// ===========================================================================
33
34// ---------------------------------------------------------------------------
35// GNEStopFrame::HelpCreation - methods
36// ---------------------------------------------------------------------------
37
39 MFXGroupBoxModule(StopFrameParent, TL("Help")),
40 myStopFrameParent(StopFrameParent) {
42}
43
44
46
47
48void
50 // first update help creation
51 updateHelpCreation();
52 // show module
53 show();
54}
55
56
57void
61
62
63void
65 // create information label
66 std::ostringstream information;
67 // set text depending of selected Stop type
68 if (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()) {
69 switch (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
72 information
73 << "- " << TL("Shift+Click to select parent") << "\n"
74 << "- " << TL("Click over a bus stop to create a stop.");
75 break;
78 information
79 << "- " << TL("Shift+Click to select parent") << "\n"
80 << "- " << TL("Click over a train stop to create a stop.");
81 break;
84 information
85 << "- " << TL("Shift+Click to select parent") << "\n"
86 << "- " << TL("Click over a container stop to create a stop.");
87 break;
90 information
91 << "- " << TL("Shift+Click to select parent") << "\n"
92 << "- " << TL("Click over a charging station to create a stop.");
93 break;
96 information
97 << "- " << TL("Shift+Click to select parent") << "\n"
98 << "- " << TL("Click over a parking area to create a stop.");
99 break;
102 information
103 << "- " << TL("Shift+Click to select parent") << "\n"
104 << "- " << TL("Click over a lane to create a stop.");
105 break;
106 default:
107 information
108 << "- " << TL("No stop parents in current network.");
109 break;
110 }
111 }
112 // set information label
113 myInformationLabel->setText(information.str().c_str());
114}
115
116// ---------------------------------------------------------------------------
117// GNEStopFrame - methods
118// ---------------------------------------------------------------------------
119
121 GNEFrame(viewParent, viewNet, TL("Stops")),
122 myRouteHandler("", viewNet->getNet(), myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed(), false),
123 myStopParentBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
124
125 // Create Stop parent selector
127
128 // Create item Selector module for Stops
130
131 // Create Stop parameters
133
134 // Create Netedit parameter
136
137 // Create Help Creation Module
138 myHelpCreation = new HelpCreation(this);
139
140 // refresh myStopParentMatchBox
142}
143
144
148
149
150void
152 // first check if stop frame modules can be shown
153 bool validStopParent = false;
154 // check if at least there an item that supports an stop
155 for (auto i = myStopParentSelector->getAllowedTags().begin(); (i != myStopParentSelector->getAllowedTags().end()) && (validStopParent == false); i++) {
156 if (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(*i).size() > 0) {
157 validStopParent = true;
158 }
159 }
160 // show or hide modules depending of validStopParent
161 if (validStopParent) {
162 // refresh tag selector
164 // refresh vType selector
166 // refresh tag selector
168 // show
171 } else {
172 // hide modules (except help creation)
177 // show help creation module
179 }
180 // reset last position
182 // show frame
184}
185
186
187bool
189 // first check stop type
190 if (myStopTagSelector->getCurrentTemplateAC() == nullptr) {
191 WRITE_WARNING(TL("Selected Stop type isn't valid."));
192 return false;
193 }
194 // check if we're selecting a new stop parent
195 if (mouseButtonKeyPressed.shiftKeyPressed()) {
196 if (viewObjects.getDemandElementFront() &&
199 WRITE_WARNINGF(TL("Selected % '%' as stop parent."), viewObjects.getDemandElementFront()->getTagStr(), viewObjects.getDemandElementFront()->getID());
200 return true;
201 } else {
202 WRITE_WARNING(TL("Selected Stop parent isn't valid."));
203 return false;
204 }
205 } else {
206 // now check if stop parent selector is valid
208 WRITE_WARNING(TL("Current selected Stop parent isn't valid."));
209 return false;
210 }
211 // create stop base object
213 viewObjects.getLaneFront(), viewObjects.getAdditionalFront());
216 myStopParentBaseObject->getSumoBaseObjectChildren().front()->getStopParameter());
217 // show all trips
220 } else {
222 }
223 // stop successfully created, then return true
224 return true;
225 } else {
226 return false;
227 }
228 }
229}
230
231bool
232GNEStopFrame::getStopParameter(const SumoXMLTag stopTag, const GNELane* lane, const GNEAdditional* stoppingPlace) {
233 // first clear containers
236 // declare stop parameters
238 // first check that current selected Stop is valid
239 if (stopTag == SUMO_TAG_NOTHING) {
240 WRITE_WARNING(TL("Current selected Stop type isn't valid."));
241 return false;
242 } else if ((stopTag == GNE_TAG_STOP_LANE) || (stopTag == GNE_TAG_WAYPOINT_LANE)) {
243 if (lane) {
244 stop.lane = lane->getID();
245 if ((stopTag == GNE_TAG_WAYPOINT_LANE) && (stop.speed == 0)) {
246 stop.speed = lane->getSpeed();
247 }
248 } else {
249 WRITE_WARNING("Click over a " + toString(SUMO_TAG_LANE) + " to create a stop placed in a " + toString(SUMO_TAG_LANE));
250 return false;
251 }
252 } else if ((stopTag == GNE_TAG_STOPPERSON_EDGE) || (stopTag == GNE_TAG_STOPCONTAINER_EDGE)) {
253 if (lane) {
254 stop.edge = lane->getParentEdge()->getID();
256 } else {
257 WRITE_WARNING("Click over a " + toString(SUMO_TAG_EDGE) + " to create a stop placed in a " + toString(SUMO_TAG_EDGE));
258 return false;
259 }
260 } else if (stoppingPlace) {
261 if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_BUS_STOP) {
262 if ((stopTag != GNE_TAG_STOP_BUSSTOP) && (stopTag != GNE_TAG_WAYPOINT_BUSSTOP) && (stopTag != GNE_TAG_STOPPERSON_BUSSTOP)) {
263 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
264 return false;
265 } else {
266 stop.busstop = stoppingPlace->getID();
268 if ((stopTag == GNE_TAG_WAYPOINT_BUSSTOP) && (stop.speed == 0)) {
269 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
270 }
271 stop.startPos = 0;
272 stop.endPos = 0;
273 }
274 } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_TRAIN_STOP) {
275 if ((stopTag != GNE_TAG_STOP_TRAINSTOP) && (stopTag != GNE_TAG_WAYPOINT_TRAINSTOP)) {
276 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
277 return false;
278 } else {
279 stop.busstop = stoppingPlace->getID();
281 if ((stopTag == GNE_TAG_WAYPOINT_TRAINSTOP) && (stop.speed == 0)) {
282 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
283 }
284 stop.startPos = 0;
285 stop.endPos = 0;
286 }
287 } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CONTAINER_STOP) {
288 if ((stopTag != GNE_TAG_STOP_CONTAINERSTOP) && (stopTag != GNE_TAG_WAYPOINT_CONTAINERSTOP)) {
289 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
290 return false;
291 } else {
292 stop.containerstop = stoppingPlace->getID();
294 if ((stopTag == GNE_TAG_WAYPOINT_CONTAINERSTOP) && (stop.speed == 0)) {
295 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
296 }
297 stop.startPos = 0;
298 stop.endPos = 0;
299 }
300 } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CHARGING_STATION) {
301 if ((stopTag != GNE_TAG_STOP_CHARGINGSTATION) && (stopTag != GNE_TAG_WAYPOINT_CHARGINGSTATION)) {
302 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
303 return false;
304 } else {
305 stop.chargingStation = stoppingPlace->getID();
307 if ((stopTag == GNE_TAG_WAYPOINT_CHARGINGSTATION) && (stop.speed == 0)) {
308 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
309 }
310 stop.startPos = 0;
311 stop.endPos = 0;
312 }
313 } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA) {
314 if ((stopTag != GNE_TAG_STOP_PARKINGAREA) && (stopTag != GNE_TAG_WAYPOINT_PARKINGAREA)) {
315 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr());
316 return false;
317 } else {
318 stop.parkingarea = stoppingPlace->getID();
320 if ((stopTag == GNE_TAG_WAYPOINT_PARKINGAREA) && (stop.speed == 0)) {
321 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
322 }
323 stop.startPos = 0;
324 stop.endPos = 0;
325 }
326 }
327 } else {
328 if ((stopTag == GNE_TAG_STOP_BUSSTOP) || (stopTag == GNE_TAG_WAYPOINT_BUSSTOP)) {
329 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_BUSSTOP) + " to create a stop placed in a " + toString(GNE_TAG_STOP_BUSSTOP));
330 } else if ((stopTag == GNE_TAG_STOP_TRAINSTOP) || (stopTag == GNE_TAG_WAYPOINT_TRAINSTOP)) {
331 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_TRAINSTOP) + " to create a stop placed in a " + toString(GNE_TAG_STOP_TRAINSTOP));
332 } else if ((stopTag == GNE_TAG_STOP_CONTAINERSTOP) || (stopTag == GNE_TAG_WAYPOINT_CONTAINERSTOP)) {
333 WRITE_WARNING("Click over a " + toString(SUMO_TAG_CONTAINER_STOP) + " to create a stop placed in a " + toString(SUMO_TAG_CONTAINER_STOP));
334 } else if ((stopTag == GNE_TAG_STOP_CHARGINGSTATION) || (stopTag == GNE_TAG_WAYPOINT_CHARGINGSTATION)) {
335 WRITE_WARNING("Click over a " + toString(SUMO_TAG_CHARGING_STATION) + " to create a stop placed in a " + toString(SUMO_TAG_CHARGING_STATION));
336 } else if ((stopTag == GNE_TAG_STOP_PARKINGAREA) || (stopTag == GNE_TAG_WAYPOINT_PARKINGAREA)) {
337 WRITE_WARNING("Click over a " + toString(SUMO_TAG_PARKING_AREA) + " to create a stop placed in a " + toString(SUMO_TAG_PARKING_AREA));
338 } else if (stopTag == GNE_TAG_STOPPERSON_BUSSTOP) {
339 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_BUSSTOP) + " to create a person stop placed in a " + toString(GNE_TAG_STOP_BUSSTOP));
340 } else if (stopTag == GNE_TAG_STOPPERSON_TRAINSTOP) {
341 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_TRAINSTOP) + " to create a person stop placed in a " + toString(GNE_TAG_STOP_TRAINSTOP));
342 }
343 return false;
344 }
345 // check if stop attributes are valid
348 return false;
349 }
350 // get stop parent
352 // if stopParent is a route, check that stop is placed over a route's edge
353 if (stopParent->isRoute() && lane) {
354 bool found = false;
355 for (const auto& edge : stopParent->getParentEdges()) {
356 if (edge == lane->getParentEdge()) {
357 found = true;
358 }
359 }
360 if (!found) {
361 WRITE_WARNING(TL("Stop must be placed over a route's edge"));
362 return false;
363 }
364 }
365 // same if stoParent is a vehicle/flow with embedded route
366 if (stopParent->getChildDemandElements().size() > 0 && stopParent->getChildDemandElements().front()->getTagProperty().isRoute() && lane) {
367 bool found = false;
368 for (const auto& edge : stopParent->getChildDemandElements().front()->getParentEdges()) {
369 if (edge == lane->getParentEdge()) {
370 found = true;
371 }
372 }
373 if (!found) {
374 WRITE_WARNING(TL("Stop must be placed over an embedded route's edge"));
375 return false;
376 }
377 }
378 // set parent tag and id
381 // add route, from and to attributes
382 if (stopParent->getTagProperty().hasAttribute(SUMO_ATTR_ROUTE)) {
384 }
385 if (stopParent->getTagProperty().hasAttribute(SUMO_ATTR_FROM)) {
387 }
388 if (stopParent->getTagProperty().hasAttribute(SUMO_ATTR_TO)) {
390 }
391 // create stop object
393 // get stop attributes
394 myStopAttributes->getAttributesAndValues(stopBaseObject, true);
395 // add netedit values
396 if (!stop.edge.empty() || !stop.lane.empty()) {
398 // check if start position can be parsed
399 if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_STARTPOS)) {
400 stop.startPos = stopBaseObject->getDoubleAttribute(SUMO_ATTR_STARTPOS);
402 } else {
404 }
405 // check if end position can be parsed
406 if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_ENDPOS)) {
407 stop.endPos = stopBaseObject->getDoubleAttribute(SUMO_ATTR_ENDPOS);
409 } else {
410 stop.endPos = INVALID_DOUBLE;
411 }
412 }
413 // obtain friendly position
414 if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_FRIENDLY_POS)) {
416 }
417 // obtain posLat
418 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_POSITION_LAT)) {
419 if (GNEAttributeCarrier::canParse<double>(stopBaseObject->getStringAttribute(SUMO_ATTR_POSITION_LAT))) {
420 stop.posLat = GNEAttributeCarrier::parse<double>(stopBaseObject->getStringAttribute(SUMO_ATTR_POSITION_LAT));
422 } else {
423 stop.posLat = INVALID_DOUBLE;
424 }
425 }
426 // obtain actType
427 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_ACTTYPE)) {
428 stop.actType = stopBaseObject->getStringAttribute(SUMO_ATTR_ACTTYPE);
429 }
430 // fill rest of parameters depending if it was edited
431 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_DURATION)) {
432 stop.duration = stopBaseObject->getTimeAttribute(SUMO_ATTR_DURATION);
433 if (stop.duration >= 0) {
435 }
436 }
437 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_UNTIL)) {
438 stop.until = stopBaseObject->getTimeAttribute(SUMO_ATTR_UNTIL);
439 if (stop.until >= 0) {
441 }
442 }
443 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_EXTENSION)) {
444 stop.extension = stopBaseObject->getTimeAttribute(SUMO_ATTR_EXTENSION);
445 if (stop.extension >= 0) {
447 }
448 }
449 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIGGERED)) {
450 if ((stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "person") || (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "true")) {
452 stop.triggered = true;
453 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "container") {
455 stop.containerTriggered = true;
456 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "join") {
458 stop.joinTriggered = true;
459 }
460 }
461 if (stopBaseObject->hasStringListAttribute(SUMO_ATTR_EXPECTED)) {
462 const auto expected = stopBaseObject->getStringListAttribute(SUMO_ATTR_EXPECTED);
463 if (expected.size() > 0) {
464 if (stop.triggered) {
465 for (const auto& id : expected) {
466 stop.awaitedPersons.insert(id);
467 }
469 } else if (stop.containerTriggered) {
470 for (const auto& id : expected) {
471 stop.awaitedContainers.insert(id);
472 }
474 }
475 }
476 }
477 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_JOIN)) {
478 stop.join = stopBaseObject->getStringAttribute(SUMO_ATTR_JOIN);
479 if (stop.join.size() > 0) {
481 }
482 }
483 if (stopBaseObject->hasStringListAttribute(SUMO_ATTR_PERMITTED)) {
484 const auto permitted = stopBaseObject->getStringListAttribute(SUMO_ATTR_PERMITTED);
485 if (permitted.size() > 0) {
487 for (const auto& permit : permitted) {
488 stop.permitted.insert(permit);
489 }
490 }
491 }
492 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_PARKING)) {
493 if (stopBaseObject->getStringAttribute(SUMO_ATTR_PARKING) == "true") {
496 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_PARKING) == "opportunistic") {
499 } else {
501 }
502 }
503 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_JUMP)) {
504 stop.jump = stopBaseObject->getTimeAttribute(SUMO_ATTR_JUMP);
505 if (stop.jump >= 0) {
507 }
508 }
509 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_SPLIT)) {
510 stop.split = stopBaseObject->getStringAttribute(SUMO_ATTR_SPLIT);
511 if (stop.split.size() > 0) {
513 }
514 }
515 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIP_ID)) {
516 stop.tripId = stopBaseObject->getStringAttribute(SUMO_ATTR_TRIP_ID);
517 if (stop.tripId.size() > 0) {
519 }
520 }
521 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_LINE)) {
522 stop.line = stopBaseObject->getStringAttribute(SUMO_ATTR_LINE);
523 if (stop.line.size() > 0) {
525 }
526 }
527 if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_ONDEMAND)) {
528 stop.onDemand = stopBaseObject->getBoolAttribute(SUMO_ATTR_ONDEMAND);
529 if (stop.onDemand) {
531 }
532 }
533 if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_SPEED) && (stopBaseObject->getDoubleAttribute(SUMO_ATTR_SPEED) > 0)) {
534 stop.speed = stopBaseObject->getDoubleAttribute(SUMO_ATTR_SPEED);
535 if (stop.speed > 0) {
537 }
538 }
539 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_INDEX)) {
540 if (stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX) == "fit") {
541 stop.index = STOP_INDEX_FIT;
542 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX) == "end") {
543 stop.index = STOP_INDEX_END;
544 } else if (GNEAttributeCarrier::canParse<int>(stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX))) {
545 stop.index = GNEAttributeCarrier::parse<int>(stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX));
546 } else {
547 stop.index = STOP_INDEX_END;
548 }
549 } else {
550 stop.index = STOP_INDEX_END;
551 }
552 // refresh stop attributes
554 // set tag
555 stopBaseObject->setTag(stopTag);
556 stopBaseObject->setStopParameter(stop);
557 return true;
558}
559
560
565
566// ===========================================================================
567// protected
568// ===========================================================================
569
570void
586
587
588void
611
612
613/****************************************************************************/
#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
@ 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
@ GNE_TAG_WAYPOINT_CONTAINERSTOP
@ GNE_TAG_STOPCONTAINER_EDGE
@ GNE_TAG_WAYPOINT_BUSSTOP
@ SUMO_TAG_BUS_STOP
A bus stop.
@ GNE_TAG_WAYPOINT_CHARGINGSTATION
@ 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
@ 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
std::string toParkingArea
to parkingArea
std::string toChargingStation
to chargingStation
std::string toContainerStop
to containerStop
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
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.
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:635
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:125
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 CommonXMLStructure::PlanParameters &planParameters, 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.
CommonXMLStructure::SumoBaseObject * myStopParentBaseObject
stop parent base object
void show()
show Frame
GNERouteHandler myRouteHandler
route handler
bool getStopParameter(const SumoXMLTag stopTag, const GNELane *lane, const GNEAdditional *stoppingPlace)
get stop parameters
~GNEStopFrame()
Destructor.
CommonXMLStructure::PlanParameters myPlanParameters
plan parameters
GNEStopFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
GNEDemandElementSelector * myStopParentSelector
Stop parent selectors.
void demandElementSelected()
selected demand element in DemandElementSelector
GNETagSelector * myStopTagSelector
stop tag selector selector (used to select diffent kind of Stops)
HelpCreation * myHelpCreation
Help creation.
void tagSelected()
Tag selected in GNETagSelector.
GNEAttributesCreator * myStopAttributes
internal Stop attributes
GNEDemandElementSelector * getStopParentSelector() const
get stop parent selector
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
GNENeteditAttributes * myNeteditAttributes
Netedit parameter.
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
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
A single child window which contains a view of the simulation area.
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