]> git.tdb.fi Git - r2c2.git/commitdiff
Emit a signal before changing the path of a turnout
authorMikko Rasa <tdb@tdb.fi>
Tue, 25 Jun 2013 15:28:38 +0000 (18:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 25 Jun 2013 15:28:38 +0000 (18:28 +0300)
Since changing the path is an asynchronous operation, this lets other
components react to an impending change.

source/libr2c2/track.cpp
source/libr2c2/track.h

index ecb86bbad33ad02e20699a05ef7655eb3d2d30a0..71c570cee86ccd251d6269c080b1c619bac18054 100644 (file)
@@ -151,6 +151,7 @@ void Track::set_active_path(unsigned p)
        if(!(type.get_paths()&(1<<p)))
                throw invalid_argument("Track::set_active_path");
 
+       signal_path_changing(p);
        path_changing = true;
        layout.get_driver().set_turnout(turnout_id, p);
 }
index 168ac37eb669bffe2f15a8457152feb068c1fe77..e1349a1ff8be919f7fced788ce823227dfa7f4c0 100644 (file)
@@ -29,6 +29,7 @@ public:
        };
 
        sigc::signal<void, unsigned, Track *> signal_link_changed;
+       sigc::signal<void, unsigned> signal_path_changing;
        sigc::signal<void, unsigned> signal_path_changed;
 
 private: