X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Flibmarklin%2Fcontrol.h;fp=source%2Flibmarklin%2Fcontrol.h;h=0000000000000000000000000000000000000000;hb=651698847d5293cfb15b6fb23a394701388c0151;hp=a041e957caaf1b009ee216b43ef34e1794cf52e7;hpb=dcfa1e9503b7e97b61396d7458f0b2e5896779cd;p=r2c2.git diff --git a/source/libmarklin/control.h b/source/libmarklin/control.h deleted file mode 100644 index a041e95..0000000 --- a/source/libmarklin/control.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - -#ifndef LIBMARKLIN_CONTROL_H_ -#define LIBMARKLIN_CONTROL_H_ - -#include -#include -#include -#include -#include "constants.h" -#include "sensor.h" -#include "locomotive.h" -#include "turnout.h" - -namespace Marklin { - -class Command; -class Reply; - -class Control -{ -public: - sigc::signal signal_power_event; - sigc::signal signal_turnout_event; - sigc::signal signal_sensor_event; - -private: - int serial_fd; - bool power; - std::list queue; - std::map turnouts; - std::map locomotives; - std::map sensors; - Msp::Time::TimeStamp next_event_query; - bool poll_sensors; - bool debug; - Msp::Time::Timer timer; - -public: - Control(); - ~Control(); - - void open(const std::string &); - void set_debug(bool); - void set_power(bool); - bool get_power() const { return power; } - Command &command(Cmd); - Command &command(Cmd, unsigned char); - Command &command(Cmd, const unsigned char *, unsigned); - unsigned get_queue_length() const { return queue.size(); } - void flush(); - - void add_turnout(Turnout &); - Turnout &get_turnout(unsigned) const; - const std::map &get_turnouts() const { return turnouts; } - void add_locomotive(Locomotive &); - Locomotive &get_locomotive(unsigned) const; - const std::map &get_locomotives() const { return locomotives; } - void add_sensor(Sensor &); - Sensor &get_sensor(unsigned) const; - const std::map &get_sensors() const { return sensors; } - - void tick(); - Msp::Time::Timer::Slot &set_timer(const Msp::Time::TimeDelta &); -private: - void status_done(const Reply &); - void event_query_done(const Reply &); - void turnout_event_done(const Reply &); - void sensor_event_done(const Reply &); -}; - -} // namespace Marklin - -#endif