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, bool> signal_reverse_changed;
28 sigc::signal<void, unsigned, bool> signal_function_changed;
39 Locomotive(const LocoType &, Control &, unsigned);
41 const LocoType &get_type() const { return type; }
42 unsigned get_address() const { return addr; }
43 void set_speed(unsigned);
44 void set_reverse(bool);
45 void set_function(unsigned, bool);
46 unsigned get_speed() const { return speed; }
47 bool get_reverse() const { return reverse; }
48 bool get_function(unsigned f) const { return (funcs>>f)&1; }
49 unsigned get_functions() const { return funcs; }
50 void refresh_status();
52 void send_command(bool);
53 void status_reply(const Reply &);
54 bool reverse_timeout();
57 } // namespace Marklin