1 #ifndef LIBMARKLIN_CONTROL_H_
2 #define LIBMARKLIN_CONTROL_H_
6 #include <msp/time/timestamp.h>
9 #include "locomotive.h"
19 sigc::signal<void, unsigned, bool> signal_turnout_event;
20 sigc::signal<void, unsigned, bool> signal_sensor_event;
24 void set_debug(bool d) { debug=d; }
25 bool get_power() const { return power; }
26 const TurnoutMap &get_turnouts() const { return turnouts; }
27 Turnout *get_turnout(unsigned) const;
28 Locomotive *get_locomotive(unsigned) const;
29 Sensor *get_sensor(unsigned) const;
30 unsigned get_queue_length() const { return queue.size(); }
31 void open(const std::string &);
32 Command &command(const std::string &);
33 void add_turnout(Turnout *);
34 void add_locomotive(Locomotive *);
35 void add_sensor(Sensor *);
42 std::list<Command> queue;
44 LocomotiveSeq locomotives;
46 Msp::Time::TimeStamp next_event_query;
50 void read_all(int, char *, int);
51 std::string read_reply(Cmd);
52 void event_query_done(Error, const std::string &);
53 void turnout_event_done(Error, const std::string &);
54 void sensor_event_done(Error, const std::string &);
57 } // namespace Marklin