73 std::ostringstream information;
75 switch (
myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty()->getTag()) {
79 <<
"- " <<
TL(
"Click over a route to create a vehicle.");
83 <<
"- " <<
TL(
"Select two edges to create a trip.");
87 <<
"- " <<
TL(
"Select two edges to create a vehicle with embedded route.");
91 <<
"- " <<
TL(
"Select two junctions to create a trip.");
95 <<
"- " <<
TL(
"Select two TAZS to create a trip.");
100 <<
"- " <<
TL(
"Click over a route to create a routeFlow.");
104 <<
"- " <<
TL(
"Select two edges to create a flow.");
108 <<
"- " <<
TL(
"Select two edges to create a flow with embedded route.");
112 <<
"- " <<
TL(
"Select two junctions to create a flow.");
116 <<
"- " <<
TL(
"Select two TAZs to create a flow.");
130 GNEFrame(viewParent, viewNet,
TL(
"Vehicles")),
170 for (
const auto& edge :
myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
171 edge.second->resetCandidateFlags();
174 for (
const auto& junction :
myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
175 junction.second->resetCandidateFlags();
197 myViewNet->setStatusBarText(
TL(
"Current selected vehicle isn't valid."));
202 myViewNet->setStatusBarText(
TL(
"Current selected vehicle type isn't valid."));
315 myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed());
322 std::vector<std::string> viaEdges;
323 for (
int i = 1; i < ((int)
myPathCreator->getSelectedEdges().size() - 1); i++) {
324 viaEdges.push_back(
myPathCreator->getSelectedEdges().at(i)->getID());
340 if (tripParameters) {
348 delete tripParameters;
358 std::vector<std::string> routeEdges;
360 for (
const auto& edge : subPath.getSubPath()) {
361 routeEdges.push_back(edge->getID());
365 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
372 if (vehicleParameters) {
385 delete vehicleParameters;
398 if (flowParameters) {
406 delete flowParameters;
414 std::vector<std::string> routeEdges;
416 for (
const auto& edge : subPath.getSubPath()) {
417 routeEdges.push_back(edge->getID());
421 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
428 if (flowParameters) {
441 delete flowParameters;
456 if (tripParameters) {
463 delete tripParameters;
478 if (tripParameters) {
485 delete tripParameters;
498 if (flowParameters) {
505 delete flowParameters;
518 if (flowParameters) {
525 delete flowParameters;
551 myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed());
556 if (departLane >= (
int)route->
getParentEdges().front()->getChildLanes().size()) {
583 if (vehicleParameters) {
589 delete vehicleParameters;
602 if (routeFlowParameters) {
608 delete routeFlowParameters;
613 if (vehicle && !
myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
614 myViewNet->centerTo(vehicle->getPositionInView(),
false);
621 myViewNet->setStatusBarText(
toString(vehicleTag) +
" has to be placed within a route.");
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_TRIP_TAZS
a single trip definition that uses TAZs
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ GNE_TAG_FLOW_TAZS
a flow between TAZs
@ SUMO_TAG_ROUTE
description of a route
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ GNE_ATTR_DEMAND_FILE
demand demand file
@ SUMO_ATTR_FROM_JUNCTION
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_POISSON
poisson definition (used in flow)
@ SUMO_ATTR_COLOR
A color information.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void addIntAttribute(const SumoXMLAttr attr, const int value)
add int attribute into current SumoBaseObject node
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
const std::string getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
GNEFrame(GNEViewParent *viewParent, GNEViewNet *viewNet, const std::string &frameLabel)
Constructor.
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
GNEPathManager * getDemandPathManager()
get demand path manager
bool isRoute() const
return true if tag correspond to a route element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
~HelpCreation()
destructor
void showHelpCreation()
show HelpCreation
MFXDynamicLabel * myInformationLabel
Label with creation information.
void hideHelpCreation()
hide HelpCreation
void updateHelpCreation()
update HelpCreation
GNEVehicleFrame * myVehicleFrameParent
pointer to Vehicle Frame Parent
HelpCreation(GNEVehicleFrame *vehicleFrameParent)
constructor
GNETagSelector * myVehicleTagSelector
vehicle tag selector (used to select diffent kind of vehicles)
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
GNEDemandElementSelector * myTypeSelector
Vehicle Type selectors.
GNEAttributesEditor * getVehicleAttributesEditor() const
get attributes creator
bool createPath(const bool useLastRoute)
create path
CommonXMLStructure::SumoBaseObject * myVehicleBaseObject
vehicle base object
~GNEVehicleFrame()
Destructor.
GNEPathCreator * myPathCreator
edge path creator (used for trips and flows)
void updateFlowAttributes()
update flow attributes
bool buildVehicleOverRoute(SumoXMLTag vehicleTag, GNEDemandElement *route)
build vehicle over route
GNEDemandElementSelector * getTypeSelector() const
getVehicle Type selectors
void tagSelected()
Tag selected in GNETagSelector.
HelpCreation * myHelpCreation
Help creation.
GNEAttributesEditor * myVehicleAttributesEditor
attributes editor
GNEVehicleFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void demandElementSelected()
selected vehicle type in DemandElementSelector
GNEPathLegendModule * myPathLegend
path legend modul
bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
GNETagSelector * getVehicleTagSelector() const
get vehicle tag selector (needed for transform vehicles)
class used to group all variables related with objects under cursor after a click over view
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
GNENet * getNet() const
get the net object
A single child window which contains a view of the simulation area.
A list item which allows for custom coloring.
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
void setParameters(const Parameterised ¶ms)
set the given key/value map in map<string, string> format
static const RGBColor INVISIBLE
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
Encapsulated Xerces-SAX-attributes.
Structure representing possible vehicle parameter.
std::string routeid
The vehicle's route id.
static SUMOVehicleParameter * parseVehicleAttributes(int element, const SUMOSAXAttributes &attrs, const bool hardFail, const bool optionalID=false, const bool skipDepart=false, const bool allowInternalRoutes=false)
Parses a vehicle's attributes.
static SUMOVehicleParameter * parseFlowAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs, const bool hardFail, const bool needID, const SUMOTime beginDefault, const SUMOTime endDefault, const bool allowInternalRoutes=false)
Parses a flow's attributes.