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-2025 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
22#include <netedit/GNENet.h>
30
31#include "GNEStopFrame.h"
32
33// ===========================================================================
34// method definitions
35// ===========================================================================
36
37// ---------------------------------------------------------------------------
38// GNEStopFrame::HelpCreation - methods
39// ---------------------------------------------------------------------------
40
42 GNEGroupBoxModule(StopFrameParent, TL("Help")),
43 myStopFrameParent(StopFrameParent) {
45}
46
47
49
50
51void
53 // first update help creation
54 updateHelpCreation();
55 // show module
56 show();
57}
58
59
60void
64
65
66void
68 // create information label
69 std::ostringstream information;
70 // set text depending of selected Stop type
71 if (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()) {
72 switch (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()->getTagProperty()->getTag()) {
75 information
76 << "- " << TL("Shift+Click to select parent") << "\n"
77 << "- " << TL("Click over a bus stop to create a stop.");
78 break;
81 information
82 << "- " << TL("Shift+Click to select parent") << "\n"
83 << "- " << TL("Click over a train stop to create a stop.");
84 break;
87 information
88 << "- " << TL("Shift+Click to select parent") << "\n"
89 << "- " << TL("Click over a container stop to create a stop.");
90 break;
93 information
94 << "- " << TL("Shift+Click to select parent") << "\n"
95 << "- " << TL("Click over a charging station to create a stop.");
96 break;
99 information
100 << "- " << TL("Shift+Click to select parent") << "\n"
101 << "- " << TL("Click over a parking area to create a stop.");
102 break;
105 information
106 << "- " << TL("Shift+Click to select parent") << "\n"
107 << "- " << TL("Click over a lane to create a stop.");
108 break;
109 default:
110 information
111 << "- " << TL("No stop parents in current network.");
112 break;
113 }
114 }
115 // set information label
116 myInformationLabel->setText(information.str().c_str());
117}
118
119// ---------------------------------------------------------------------------
120// GNEStopFrame - methods
121// ---------------------------------------------------------------------------
122
124 GNEFrame(viewParent, viewNet, TL("Stops")),
125 myStopParentBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
126
127 // Create Stop parent selector
129
130 // Create item Selector module for Stops
132
133 // Create attributes editor
135
136 // Create Help Creation Module
137 myHelpCreation = new HelpCreation(this);
138
139 // refresh myStopParentMatchBox
141}
142
143
147
148
149void
151 // first check if stop frame modules can be shown
152 bool validStopParent = false;
153 // check if at least there an item that supports an stop
154 for (auto i = myStopParentSelector->getAllowedTags().begin(); (i != myStopParentSelector->getAllowedTags().end()) && (validStopParent == false); i++) {
155 if (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(*i).size() > 0) {
156 validStopParent = true;
157 }
158 }
159 // show or hide modules depending of validStopParent
160 if (validStopParent) {
161 // refresh tag selector
163 // refresh vType selector
165 // refresh tag selector
167 // show
170 } else {
171 // hide modules (except help creation)
175 // show help creation module
177 }
178 // reset last position
180 // show frame
182}
183
184
185bool
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 last position
194 WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
195 return false;
196 }
197 // check if we're selecting a new stop parent
198 if (mouseButtonKeyPressed.shiftKeyPressed()) {
199 if (viewObjects.getDemandElementFront() &&
202 WRITE_WARNINGF(TL("Selected % '%' as stop parent."), viewObjects.getDemandElementFront()->getTagStr(), viewObjects.getDemandElementFront()->getID());
203 return true;
204 } else {
205 WRITE_WARNING(TL("Selected Stop parent isn't valid."));
206 return false;
207 }
208 } else {
209 // now check if stop parent selector is valid
211 WRITE_WARNING(TL("Current selected Stop parent isn't valid."));
212 return false;
213 }
214 // create stop base object
216 viewObjects.getLaneFront(), viewObjects.getAdditionalFront());
218 // declare route handler
221 // build stop
223 myStopParentBaseObject->getSumoBaseObjectChildren().front()->getStopParameter());
224 // show all trips
227 } else {
229 }
230 // stop successfully created, then return true
231 return true;
232 } else {
233 return false;
234 }
235 }
236}
237
238bool
239GNEStopFrame::getStopParameter(const SumoXMLTag stopTag, const GNELane* lane, const GNEAdditional* stoppingPlace) {
240 // first clear containers
243 // declare stop parameters
245 // first check that current selected Stop is valid
246 if (stopTag == SUMO_TAG_NOTHING) {
247 WRITE_WARNING(TL("Current selected Stop type isn't valid."));
248 return false;
249 } else if ((stopTag == GNE_TAG_STOP_LANE) || (stopTag == GNE_TAG_WAYPOINT_LANE)) {
250 if (lane) {
251 stop.lane = lane->getID();
252 if ((stopTag == GNE_TAG_WAYPOINT_LANE) && (stop.speed == 0)) {
253 stop.speed = lane->getSpeed();
254 }
256 const double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(viewPosSnapped) / lane->getLengthGeometryFactor();
257 stop.startPos = mousePositionOverLane - 10;
258 if (stop.startPos < 0) {
259 stop.startPos = 0;
260 }
262 stop.endPos = mousePositionOverLane;
264 } else {
265 WRITE_WARNING("Click over a " + toString(SUMO_TAG_LANE) + " to create a stop placed in a " + toString(SUMO_TAG_LANE));
266 return false;
267 }
268 } else if ((stopTag == GNE_TAG_STOPPERSON_EDGE) || (stopTag == GNE_TAG_STOPCONTAINER_EDGE)) {
269 if (lane) {
270 stop.edge = lane->getParentEdge()->getID();
272 } else {
273 WRITE_WARNING("Click over a " + toString(SUMO_TAG_EDGE) + " to create a stop placed in a " + toString(SUMO_TAG_EDGE));
274 return false;
275 }
276 } else if (stoppingPlace) {
277 if (stoppingPlace->getTagProperty()->getTag() == SUMO_TAG_BUS_STOP) {
278 if ((stopTag != GNE_TAG_STOP_BUSSTOP) && (stopTag != GNE_TAG_WAYPOINT_BUSSTOP) && (stopTag != GNE_TAG_STOPPERSON_BUSSTOP)) {
279 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty()->getTagStr());
280 return false;
281 } else {
282 stop.busstop = stoppingPlace->getID();
284 if ((stopTag == GNE_TAG_WAYPOINT_BUSSTOP) && (stop.speed == 0)) {
285 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
286 }
287 stop.startPos = 0;
288 stop.endPos = 0;
289 }
290 } else if (stoppingPlace->getTagProperty()->getTag() == SUMO_TAG_TRAIN_STOP) {
291 if ((stopTag != GNE_TAG_STOP_TRAINSTOP) && (stopTag != GNE_TAG_WAYPOINT_TRAINSTOP)) {
292 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty()->getTagStr());
293 return false;
294 } else {
295 stop.busstop = stoppingPlace->getID();
297 if ((stopTag == GNE_TAG_WAYPOINT_TRAINSTOP) && (stop.speed == 0)) {
298 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
299 }
300 stop.startPos = 0;
301 stop.endPos = 0;
302 }
303 } else if (stoppingPlace->getTagProperty()->getTag() == SUMO_TAG_CONTAINER_STOP) {
304 if ((stopTag != GNE_TAG_STOP_CONTAINERSTOP) && (stopTag != GNE_TAG_WAYPOINT_CONTAINERSTOP)) {
305 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty()->getTagStr());
306 return false;
307 } else {
308 stop.containerstop = stoppingPlace->getID();
310 if ((stopTag == GNE_TAG_WAYPOINT_CONTAINERSTOP) && (stop.speed == 0)) {
311 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
312 }
313 stop.startPos = 0;
314 stop.endPos = 0;
315 }
316 } else if (stoppingPlace->getTagProperty()->getTag() == SUMO_TAG_CHARGING_STATION) {
317 if ((stopTag != GNE_TAG_STOP_CHARGINGSTATION) && (stopTag != GNE_TAG_WAYPOINT_CHARGINGSTATION)) {
318 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty()->getTagStr());
319 return false;
320 } else {
321 stop.chargingStation = stoppingPlace->getID();
323 if ((stopTag == GNE_TAG_WAYPOINT_CHARGINGSTATION) && (stop.speed == 0)) {
324 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
325 }
326 stop.startPos = 0;
327 stop.endPos = 0;
328 }
329 } else if (stoppingPlace->getTagProperty()->getTag() == SUMO_TAG_PARKING_AREA) {
330 if ((stopTag != GNE_TAG_STOP_PARKINGAREA) && (stopTag != GNE_TAG_WAYPOINT_PARKINGAREA)) {
331 WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty()->getTagStr());
332 return false;
333 } else {
334 stop.parkingarea = stoppingPlace->getID();
336 if ((stopTag == GNE_TAG_WAYPOINT_PARKINGAREA) && (stop.speed == 0)) {
337 stop.speed = stoppingPlace->getParentLanes().front()->getSpeed();
338 }
339 stop.startPos = 0;
340 stop.endPos = 0;
341 }
342 }
343 } else {
344 if ((stopTag == GNE_TAG_STOP_BUSSTOP) || (stopTag == GNE_TAG_WAYPOINT_BUSSTOP)) {
345 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_BUSSTOP) + " to create a stop placed in a " + toString(GNE_TAG_STOP_BUSSTOP));
346 } else if ((stopTag == GNE_TAG_STOP_TRAINSTOP) || (stopTag == GNE_TAG_WAYPOINT_TRAINSTOP)) {
347 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_TRAINSTOP) + " to create a stop placed in a " + toString(GNE_TAG_STOP_TRAINSTOP));
348 } else if ((stopTag == GNE_TAG_STOP_CONTAINERSTOP) || (stopTag == GNE_TAG_WAYPOINT_CONTAINERSTOP)) {
349 WRITE_WARNING("Click over a " + toString(SUMO_TAG_CONTAINER_STOP) + " to create a stop placed in a " + toString(SUMO_TAG_CONTAINER_STOP));
350 } else if ((stopTag == GNE_TAG_STOP_CHARGINGSTATION) || (stopTag == GNE_TAG_WAYPOINT_CHARGINGSTATION)) {
351 WRITE_WARNING("Click over a " + toString(SUMO_TAG_CHARGING_STATION) + " to create a stop placed in a " + toString(SUMO_TAG_CHARGING_STATION));
352 } else if ((stopTag == GNE_TAG_STOP_PARKINGAREA) || (stopTag == GNE_TAG_WAYPOINT_PARKINGAREA)) {
353 WRITE_WARNING("Click over a " + toString(SUMO_TAG_PARKING_AREA) + " to create a stop placed in a " + toString(SUMO_TAG_PARKING_AREA));
354 } else if (stopTag == GNE_TAG_STOPPERSON_BUSSTOP) {
355 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_BUSSTOP) + " to create a person stop placed in a " + toString(GNE_TAG_STOP_BUSSTOP));
356 } else if (stopTag == GNE_TAG_STOPPERSON_TRAINSTOP) {
357 WRITE_WARNING("Click over a " + toString(GNE_TAG_STOP_TRAINSTOP) + " to create a person stop placed in a " + toString(GNE_TAG_STOP_TRAINSTOP));
358 }
359 return false;
360 }
361 // check if stop attributes are valid
363 return false;
364 }
365 // get stop parent
367 // if stopParent is a route, check that stop is placed over a route's edge
368 if (stopParent->isRoute() && lane) {
369 bool found = false;
370 for (const auto& edge : stopParent->getParentEdges()) {
371 if (edge == lane->getParentEdge()) {
372 found = true;
373 }
374 }
375 if (!found) {
376 WRITE_WARNING(TL("Stop must be placed over a route's edge"));
377 return false;
378 }
379 }
380 // same if stoParent is a vehicle/flow with embedded route
381 if (stopParent->getChildDemandElements().size() > 0 && stopParent->getChildDemandElements().front()->getTagProperty()->isRoute() && lane) {
382 bool found = false;
383 for (const auto& edge : stopParent->getChildDemandElements().front()->getParentEdges()) {
384 if (edge == lane->getParentEdge()) {
385 found = true;
386 }
387 }
388 if (!found) {
389 WRITE_WARNING(TL("Stop must be placed over an embedded route's edge"));
390 return false;
391 }
392 }
393 // set parent tag and id
396 // add route, from and to attributes
397 if (stopParent->getTagProperty()->hasAttribute(SUMO_ATTR_ROUTE)) {
399 }
400 if (stopParent->getTagProperty()->hasAttribute(SUMO_ATTR_FROM)) {
402 }
403 if (stopParent->getTagProperty()->hasAttribute(SUMO_ATTR_TO)) {
405 }
406 // create stop object
408 // get stop attributes
409 myAttributesEditor->fillSumoBaseObject(stopBaseObject);
410 // obtain friendly position
411 if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_FRIENDLY_POS)) {
413 }
414 // obtain posLat
415 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_POSITION_LAT)) {
416 if (GNEAttributeCarrier::canParse<double>(stopBaseObject->getStringAttribute(SUMO_ATTR_POSITION_LAT))) {
417 stop.posLat = GNEAttributeCarrier::parse<double>(stopBaseObject->getStringAttribute(SUMO_ATTR_POSITION_LAT));
419 } else {
420 stop.posLat = INVALID_DOUBLE;
421 }
422 }
423 // obtain actType
424 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_ACTTYPE)) {
425 stop.actType = stopBaseObject->getStringAttribute(SUMO_ATTR_ACTTYPE);
426 }
427 // fill rest of parameters depending if it was edited
428 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_DURATION)) {
429 stop.duration = stopBaseObject->getTimeAttribute(SUMO_ATTR_DURATION);
430 if (stop.duration >= 0) {
432 }
433 }
434 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_UNTIL)) {
435 stop.until = stopBaseObject->getTimeAttribute(SUMO_ATTR_UNTIL);
436 if (stop.until >= 0) {
438 }
439 }
440 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_EXTENSION)) {
441 stop.extension = stopBaseObject->getTimeAttribute(SUMO_ATTR_EXTENSION);
442 if (stop.extension >= 0) {
444 }
445 }
446 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIGGERED)) {
447 if ((stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "person") || (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "true")) {
449 stop.triggered = true;
450 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "container") {
452 stop.containerTriggered = true;
453 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "join") {
455 stop.joinTriggered = true;
456 }
457 }
458 if (stopBaseObject->hasStringListAttribute(SUMO_ATTR_EXPECTED)) {
459 const auto expected = stopBaseObject->getStringListAttribute(SUMO_ATTR_EXPECTED);
460 if (expected.size() > 0) {
461 if (stop.triggered) {
462 for (const auto& id : expected) {
463 stop.awaitedPersons.insert(id);
464 }
466 } else if (stop.containerTriggered) {
467 for (const auto& id : expected) {
468 stop.awaitedContainers.insert(id);
469 }
471 }
472 }
473 }
474 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_JOIN)) {
475 stop.join = stopBaseObject->getStringAttribute(SUMO_ATTR_JOIN);
476 if (stop.join.size() > 0) {
478 }
479 }
480 if (stopBaseObject->hasStringListAttribute(SUMO_ATTR_PERMITTED)) {
481 const auto permitted = stopBaseObject->getStringListAttribute(SUMO_ATTR_PERMITTED);
482 if (permitted.size() > 0) {
484 for (const auto& permit : permitted) {
485 stop.permitted.insert(permit);
486 }
487 }
488 }
489 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_PARKING)) {
490 if (stopBaseObject->getStringAttribute(SUMO_ATTR_PARKING) == "true") {
493 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_PARKING) == "opportunistic") {
496 } else {
498 }
499 }
500 if (stopBaseObject->hasTimeAttribute(SUMO_ATTR_JUMP)) {
501 stop.jump = stopBaseObject->getTimeAttribute(SUMO_ATTR_JUMP);
502 if (stop.jump >= 0) {
504 }
505 }
506 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_SPLIT)) {
507 stop.split = stopBaseObject->getStringAttribute(SUMO_ATTR_SPLIT);
508 if (stop.split.size() > 0) {
510 }
511 }
512 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIP_ID)) {
513 stop.tripId = stopBaseObject->getStringAttribute(SUMO_ATTR_TRIP_ID);
514 if (stop.tripId.size() > 0) {
516 }
517 }
518 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_LINE)) {
519 stop.line = stopBaseObject->getStringAttribute(SUMO_ATTR_LINE);
520 if (stop.line.size() > 0) {
522 }
523 }
524 if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_ONDEMAND)) {
525 stop.onDemand = stopBaseObject->getBoolAttribute(SUMO_ATTR_ONDEMAND);
526 if (stop.onDemand) {
528 }
529 }
530 if (stopBaseObject->hasDoubleAttribute(SUMO_ATTR_SPEED) && (stopBaseObject->getDoubleAttribute(SUMO_ATTR_SPEED) > 0)) {
531 stop.speed = stopBaseObject->getDoubleAttribute(SUMO_ATTR_SPEED);
532 if (stop.speed > 0) {
534 }
535 }
536 if (stopBaseObject->hasStringAttribute(SUMO_ATTR_INDEX)) {
537 if (stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX) == "fit") {
538 stop.index = STOP_INDEX_FIT;
539 } else if (stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX) == "end") {
540 stop.index = STOP_INDEX_END;
541 } else if (GNEAttributeCarrier::canParse<int>(stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX))) {
542 stop.index = GNEAttributeCarrier::parse<int>(stopBaseObject->getStringAttribute(SUMO_ATTR_INDEX));
543 } else {
544 stop.index = STOP_INDEX_END;
545 }
546 } else {
547 stop.index = STOP_INDEX_END;
548 }
549 // refresh attributes editor
551 // set tag
552 stopBaseObject->setTag(stopTag);
553 stopBaseObject->setStopParameter(stop);
554 return true;
555}
556
557
562
563// ===========================================================================
564// protected
565// ===========================================================================
566
567void
570 // show Stop type selector module
573 } else {
574 // hide all modules if stop parent isn't valid
577 }
578}
579
580
581void
583 // show or hide modules depending if current selected stop parent is valid
587 // show modules
590 } else {
593 }
594 } else {
595 // hide modules
599 }
600}
601
602/****************************************************************************/
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:281
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:287
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
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
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_ROUTE_EMBEDDED
embedded route
@ GNE_TAG_STOPPERSON_EDGE
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_PARKING
@ SUMO_ATTR_EXTENSION
@ SUMO_ATTR_SPEED
@ 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:68
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
virtual FileBucket * getFileBucket() const =0
get reference to fileBucket in which save this AC
const std::string getID() const override
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
virtual std::string getAttribute(SumoXMLAttr key) const =0
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject) const
fill sumo Base object
void showAttributesEditor(GNEAttributeCarrier *AC, const bool primaryAttributeEditor)
edit attributes of the given AC (usually the edited template AC)
void refreshAttributesEditor()
refresh attribute editor
bool checkAttributes(const bool showWarning)
check if current edited attributes are valid
void hideAttributesEditor()
hide attribute editor
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:122
virtual void show()
show Frame
Definition GNEFrame.cpp:110
virtual void hide()
hide Frame
Definition GNEFrame.cpp:119
GNEGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:232
double getLengthGeometryFactor() const
get length geometry factor
Definition GNELane.cpp:1965
double getSpeed() const
returns the current speed of lane
Definition GNELane.cpp:637
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:214
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
bool isRoute() const
check if pathElement is a route
bool 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
Position myLastClickedPosition
last clicked position
void show()
show Frame
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.
GNEDemandElementSelector * getStopParentSelector() const
get stop parent selector
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
GNEAttributesEditor * myAttributesEditor
attributes editor
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
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
GNEViewParent * getViewParent() const
get the net object
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
A list item which allows for custom coloring.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:323
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
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