Skip to content

Commit

Permalink
do not write empty stop names, unspecified names default to blank in gui
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@23651 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
namdre committed Mar 24, 2017
1 parent 85a0c64 commit c328ce5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions sumo/src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4084,12 +4084,12 @@ MSVehicle::loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset) {
std::istringstream bis(attrs.getString(SUMO_ATTR_STATE));
bis >> myDeparture;
bis >> routeOffset;
bis >> myDepartPos;
bis >> myWaitingTime;
if (hasDeparted()) {
myDeparture -= offset;
myCurrEdge += routeOffset;
myDeparture -= offset;
}
bis >> myDepartPos;
bis >> myWaitingTime;
myState.myPos = attrs.getFloat(SUMO_ATTR_POSITION);
myState.mySpeed = attrs.getFloat(SUMO_ATTR_SPEED);
myState.myPosLat = attrs.getFloat(SUMO_ATTR_POSITION_LAT);
Expand Down
2 changes: 1 addition & 1 deletion sumo/src/microsim/MSVehicleTransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ MSVehicleTransfer::loadState(const SUMOSAXAttributes& attrs, const SUMOTime offs
}
SUMOTime proceedTime = (SUMOTime)attrs.getLong(SUMO_ATTR_DEPART);
MSLane* parkingLane = attrs.hasAttribute(SUMO_ATTR_PARKING) ? MSLane::dictionary(attrs.getString(SUMO_ATTR_PARKING)) : 0;
myVehicles.push_back(VehicleInformation(veh, proceedTime + offset, parkingLane != 0));
myVehicles.push_back(VehicleInformation(veh, proceedTime - offset, parkingLane != 0));
if (parkingLane != 0) {
myParkingVehicles[parkingLane].insert(veh);
veh->setTentativeLaneAndPosition(parkingLane, veh->getPositionOnLane());
Expand Down
4 changes: 3 additions & 1 deletion sumo/src/netbuild/NBPTStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ void NBPTStop::setLaneID(const std::string& laneId) {
void NBPTStop::write(OutputDevice& device) {
device.openTag(SUMO_TAG_BUS_STOP);
device.writeAttr(SUMO_ATTR_ID,myPTStopId);
device.writeAttr(SUMO_ATTR_NAME,myName);
if (myName != "") {
device.writeAttr(SUMO_ATTR_NAME,myName);
}
device.writeAttr(SUMO_ATTR_LANE,myLaneId);
device.writeAttr(SUMO_ATTR_STARTPOS,myFrom);
device.writeAttr(SUMO_ATTR_ENDPOS,myTo);
Expand Down
7 changes: 2 additions & 5 deletions sumo/src/netload/NLTriggerBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,8 @@ NLTriggerBuilder::parseAndBuildStoppingPlace(MSNet& net, const SUMOSAXAttributes
throw ProcessError();
}

//get the name set to id if not given or empty
std::string ptStopName = attrs.get<std::string>(SUMO_ATTR_NAME,0,ok);
if (!ok) {
ptStopName = id;
}
//get the name, leave blank if not given
const std::string ptStopName = attrs.getOpt<std::string>(SUMO_ATTR_NAME, id.c_str(), ok, "");

// get the lane
MSLane* lane = getLane(attrs, toString(element), id);
Expand Down

0 comments on commit c328ce5

Please sign in to comment.