]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/train.h
Change the control system to separate speed and reverse
[r2c2.git] / source / libmarklin / train.h
index ee66e1d1ca29e0dc38df83e4fc86dc0a3f0b548a..f9ea6f17ae0001b39432e8cd83b57ac8fb4cf9ce 100644 (file)
@@ -20,6 +20,7 @@ class Route;
 class Timetable;
 class Vehicle;
 class VehicleType;
+struct TrainControl;
 
 class Train: public sigc::trackable
 {
@@ -109,7 +110,7 @@ public:
        const std::string &get_name() const { return name; }
        void set_priority(int);
        int get_priority() const { return priority; }
-       ControlModel &get_control() const { return *control; }
+       ControlModel &get_control_model() const { return *control; }
 
        void add_vehicle(const VehicleType &);
        void remove_vehicle(unsigned);
@@ -121,6 +122,7 @@ public:
        void set_active(bool);
        void set_function(unsigned, bool);
        float get_control(const std::string &) const;
+       float get_speed() const;
        bool is_active() const { return active; }
        bool get_function(unsigned) const;
        unsigned get_functions() const { return functions; }
@@ -143,6 +145,7 @@ public:
 
        void save(std::list<Msp::DataFile::Statement> &) const;
 private:
+       void control_changed(const TrainControl &);
        void loco_speed_event(unsigned, unsigned, bool);
        void loco_func_event(unsigned, unsigned, bool);
        void sensor_event(unsigned, bool);