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."));
314 myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed(),
true);
321 std::vector<std::string> viaEdges;
322 for (
int i = 1; i < ((int)
myPathCreator->getSelectedEdges().size() - 1); i++) {
323 viaEdges.push_back(
myPathCreator->getSelectedEdges().at(i)->getID());
339 if (tripParameters) {
347 delete tripParameters;
357 std::vector<std::string> routeEdges;
359 for (
const auto& edge : subPath.getSubPath()) {
360 routeEdges.push_back(edge->getID());
364 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
371 if (vehicleParameters) {
384 delete vehicleParameters;
397 if (flowParameters) {
405 delete flowParameters;
413 std::vector<std::string> routeEdges;
415 for (
const auto& edge : subPath.getSubPath()) {
416 routeEdges.push_back(edge->getID());
420 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
427 if (flowParameters) {
440 delete flowParameters;
455 if (tripParameters) {
462 delete tripParameters;
477 if (tripParameters) {
484 delete tripParameters;
497 if (flowParameters) {
504 delete flowParameters;
517 if (flowParameters) {
524 delete flowParameters;
549 myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed(),
true);
554 if (departLane >= (
int)route->
getParentEdges().front()->getChildLanes().size()) {
581 if (vehicleParameters) {
587 delete vehicleParameters;
600 if (routeFlowParameters) {
606 delete routeFlowParameters;
611 if (vehicle && !
myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
612 myViewNet->centerTo(vehicle->getPositionInView(),
false);
619 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)
@ 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
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
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
GNEGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
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
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.
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.