3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2009 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"
25 sigc::signal<void, unsigned> signal_speed_changing;
26 sigc::signal<void, unsigned> signal_speed_changed;
27 sigc::signal<void, unsigned, bool> signal_function_changed;
38 Locomotive(const LocoType &, Control &, unsigned);
40 const LocoType &get_type() const { return type; }
41 unsigned get_address() const { return addr; }
42 void set_speed(unsigned);
43 void set_reverse(bool);
44 void set_function(unsigned, bool);
45 unsigned get_speed() const { return speed; }
46 bool get_reverse() const { return reverse; }
47 bool get_function(unsigned f) const { return (funcs>>f)&1; }
48 void refresh_status();
50 void send_command(bool);
51 void status_reply(const Reply &);
52 bool reverse_timeout();
55 } // namespace Marklin