reverse(false),
funcs(0)
{
- control.add_locomotive(this);
+ control.add_locomotive(*this);
refresh_status();
}
speed=min(spd, 14U);
send_command(false);
+
+ signal_speed_changed.emit(speed);
}
void Locomotive::set_reverse(bool rev)
if(speed)
{
- (new Time::Timer((500+speed*150)*Time::msec))->signal_timeout.connect(sigc::mem_fun(this, &Locomotive::reverse_timeout));
+ control.set_timer((500+speed*150)*Time::msec).signal_timeout.connect(sigc::mem_fun(this, &Locomotive::reverse_timeout));
set_speed(0);
}
else
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)