]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/locomotive.cpp
Allow intercepting and denying turnout route and locomotive speed changes
[r2c2.git] / source / libmarklin / locomotive.cpp
index a42d8d7820f0c4b3ce18e3c0bf7bfc19a7a6e8f4..32f2ecc1a185f2fa1ac387cb4659ad61e1926f01 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-200 Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -33,8 +33,10 @@ Locomotive::Locomotive(const LocoType &t, Control &c, unsigned a):
 
 void Locomotive::set_speed(unsigned spd)
 {
-       speed=min(spd, 14U);
+       spd=min(spd, 14U);
+       signal_speed_changing.emit(spd);
 
+       speed=spd;
        send_command(false);
 
        signal_speed_changed.emit(speed);