]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/train.h
Support setting routes for trains
[r2c2.git] / source / libmarklin / train.h
index b891a660ac4e8ca381947421a7bc73c3c6b4397d..90627ae4561d021dc372ac8fe3090a1a94794677 100644 (file)
@@ -16,6 +16,7 @@ Distributed under the GPL
 namespace Marklin {
 
 class Locomotive;
+class Route;
 class Sensor;
 class TrafficManager;
 class Turnout;
@@ -33,6 +34,7 @@ public:
 
        sigc::signal<void, const std::string &> signal_name_changed;
        sigc::signal<void, unsigned> signal_target_speed_changed;
+       sigc::signal<void, const Route *> signal_route_changed;
        sigc::signal<void, const std::string &> signal_status_changed;
 
 private:
@@ -59,6 +61,7 @@ private:
        std::list<BlockRef> cur_blocks;
        std::list<BlockRef> rsv_blocks;
        unsigned target_speed;
+       const Route *route;
        Msp::Time::TimeStamp try_reserve;
        std::string status;
 
@@ -79,9 +82,11 @@ public:
        void set_name(const std::string &);
        void set_speed(unsigned);
        void set_reverse(bool);
+       void set_route(const Route *);
        const std::string &get_name() const { return name; }
        Locomotive &get_locomotive() const { return loco; }
        unsigned get_target_speed() const { return target_speed; }
+       const Route *get_route() const { return route; }
        const std::string &get_status() const { return status; }
        const Point &get_position() const { return pos; }
        void place(Block *, unsigned);