X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Flocomotive.h;h=89b275ecb0db2020cc635dc695c8853648bd1d02;hb=7839b7c3d782abb5c98a24d51cae109407068c02;hp=7142701a28e3c5d9e6d5552db523ba00c469e18f;hpb=06c100aacb559fbbe7380e15981c4772092c269b;p=r2c2.git diff --git a/source/libmarklin/locomotive.h b/source/libmarklin/locomotive.h index 7142701..89b275e 100644 --- a/source/libmarklin/locomotive.h +++ b/source/libmarklin/locomotive.h @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef LIBMARKLIN_LOCOMOTIVE_H_ #define LIBMARKLIN_LOCOMOTIVE_H_ @@ -9,13 +16,27 @@ namespace Marklin { class Control; +class LocoType; +class Reply; class Locomotive { +private: + const LocoType &type; + Control &control; + unsigned addr; + unsigned speed; + bool reverse; + unsigned funcs; + public: + sigc::signal signal_speed_changing; sigc::signal signal_speed_changed; + sigc::signal signal_function_changed; + + Locomotive(const LocoType &, Control &, unsigned); - Locomotive(Control &, unsigned); + const LocoType &get_type() const { return type; } void set_speed(unsigned); void set_reverse(bool); void set_function(unsigned, bool); @@ -25,17 +46,10 @@ public: bool get_function(unsigned f) const { return (funcs>>f)&1; } void refresh_status(); private: - Control &control; - unsigned addr; - unsigned speed; - bool reverse; - unsigned funcs; - void send_command(bool); - void status_reply(Error, const std::string &); + void status_reply(const Reply &); bool reverse_timeout(); }; -typedef std::list LocomotiveSeq; } // namespace Marklin