3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBMARKLIN_LOCOMOTIVE_H_
9 #define LIBMARKLIN_LOCOMOTIVE_H_
13 #include <sigc++/signal.h>
14 #include "constants.h"
33 sigc::signal<void, unsigned> signal_speed_changed;
34 sigc::signal<void, unsigned, bool> signal_function_changed;
36 Locomotive(const LocoType &, Control &, unsigned);
38 const LocoType &get_type() const { return type; }
39 void set_speed(unsigned);
40 void set_reverse(bool);
41 void set_function(unsigned, bool);
42 unsigned get_address() const { return addr; }
43 unsigned get_speed() const { return speed; }
44 bool get_reverse() const { return reverse; }
45 bool get_function(unsigned f) const { return (funcs>>f)&1; }
46 void refresh_status();
48 void send_command(bool);
49 void status_reply(const Reply &);
50 bool reverse_timeout();
53 } // namespace Marklin