Skip to content

Commit

Permalink
fixing problem on reload #1922
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Mar 27, 2024
1 parent 1b122d1 commit 405cd5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/microsim/devices/MSDevice_FCDReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ MSDevice_FCDReplay::buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDev

void
MSDevice_FCDReplay::init() {
myHandler.reset();
const OptionsCont& oc = OptionsCont::getOptions();
if (oc.isSet("device.fcd-replay.file")) {
if (!XMLSubSys::runParser(myHandler, oc.getString("device.fcd-replay.file"))) {
Expand Down Expand Up @@ -158,6 +159,13 @@ MSDevice_FCDReplay::FCDHandler::myStartElement(int element, const SUMOSAXAttribu
}


void
MSDevice_FCDReplay::FCDHandler::reset() {
myTrajectories.clear();
myRoutes.clear();
}


void
MSDevice_FCDReplay::FCDHandler::addTrafficObjects() {
for (const auto& desc : myRoutes) {
Expand Down
1 change: 1 addition & 0 deletions src/microsim/devices/MSDevice_FCDReplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class MSDevice_FCDReplay : public MSVehicleDevice {

class FCDHandler : public SUMOSAXHandler {
public:
void reset();
void addTrafficObjects();

protected:
Expand Down

0 comments on commit 405cd5b

Please sign in to comment.