X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fturnout.h;h=c7a603c78e53db9224b75951aa3474d107c62338;hb=02c9a9779954d993cb73fe5f7a72b0847e87f633;hp=801772b711d73f14781542971ad9104829ae6a91;hpb=52cbe8d99669f843f8f75c51128e2748584dd03a;p=r2c2.git diff --git a/source/libmarklin/turnout.h b/source/libmarklin/turnout.h index 801772b..c7a603c 100644 --- a/source/libmarklin/turnout.h +++ b/source/libmarklin/turnout.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_TURNOUT_H_ #define LIBMARKLIN_TURNOUT_H_ @@ -10,24 +17,33 @@ namespace Marklin { class Control; +class Reply; class Turnout { public: - sigc::signal signal_route_changed; + sigc::signal signal_path_changing; + sigc::signal signal_path_changed; - Turnout(Control &, unsigned); - void set_route(unsigned); - unsigned get_address() const { return addr; } - unsigned get_route() const { return route; } private: - Control &control; + Control &control; unsigned addr; - unsigned route; + unsigned char path; + unsigned char pending_path; + unsigned char pending_cmds; + bool dual; + bool on; - void command(bool); - void status_reply(Error, const std::string &); - bool switch_timeout(); +public: + Turnout(Control &, unsigned, bool =false); + + void set_path(unsigned char); + unsigned get_address() const { return addr; } + unsigned char get_path() const { return path; } +private: + void command(unsigned char); + void command_reply(const Reply &, unsigned char); + void status_reply(const Reply &, unsigned char); void turnout_event(unsigned, bool); };