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"
32 sigc::signal<void, unsigned> signal_speed_changed;
33 sigc::signal<void, unsigned, bool> signal_function_changed;
35 Locomotive(const LocoType &, Control &, unsigned);
37 const LocoType &get_type() const { return type; }
38 void set_speed(unsigned);
39 void set_reverse(bool);
40 void set_function(unsigned, bool);
41 unsigned get_address() const { return addr; }
42 unsigned get_speed() const { return speed; }
43 bool get_reverse() const { return reverse; }
44 bool get_function(unsigned f) const { return (funcs>>f)&1; }
45 void refresh_status();
47 void send_command(bool);
48 void status_reply(Error, const std::string &);
49 bool reverse_timeout();
52 } // namespace Marklin