]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/locomotive.cpp
Add Track::get_endpoint_position to avoid duplicating calculations
[r2c2.git] / source / libmarklin / locomotive.cpp
index ecacea19a833af43f918823523951740d9a0e69c..6329196710583014bc76ee80028daf476bb77ef7 100644 (file)
@@ -27,6 +27,8 @@ void Locomotive::set_speed(unsigned spd)
        speed=min(spd, 14U);
 
        send_command(false);
+
+       signal_speed_changed.emit(speed);
 }
 
 void Locomotive::set_reverse(bool rev)
@@ -62,7 +64,7 @@ void Locomotive::refresh_status()
        cmd[0]=CMD_LOK_STATUS;
        cmd[1]=addr&0xFF;
        cmd[2]=(addr>>8)&0xFF;
-       control.command(string(cmd,3)).signal_done.connect(sigc::mem_fun(this,&Locomotive::status_reply));
+       control.command(string(cmd, 3)).signal_done.connect(sigc::mem_fun(this, &Locomotive::status_reply));
 }
 
 void Locomotive::send_command(bool setf)