From: Mikko Rasa Date: Wed, 26 Mar 2014 20:36:37 +0000 (+0200) Subject: Generate an event for reaching each waypoint X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0be77238bcd33baf23594f3b54464205d2d51b31;p=r2c2.git Generate an event for reaching each waypoint --- diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 2be3c88..b388bb2 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -255,6 +255,8 @@ void TrainRouter::train_advanced(Block &block) if(!wp.has_track(*t_iter)) { waypoints.erase(waypoints.begin()); + signal_waypoint_reached.emit(&wp); + signal_event.emit(Message("waypoint-reached", &wp)); break; } else if(!block.has_track(*t_iter)) diff --git a/source/libr2c2/trainrouter.h b/source/libr2c2/trainrouter.h index 9efc3a6..4f62076 100644 --- a/source/libr2c2/trainrouter.h +++ b/source/libr2c2/trainrouter.h @@ -25,6 +25,7 @@ public: sigc::signal signal_route_changed; sigc::signal signal_arrived; + sigc::signal signal_waypoint_reached; private: struct Wait