X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Flibmarklin%2Ftrain.h;h=ccfcbec1058f0dd6c12ab5409ad66415e4c27298;hb=cf52013784607dc4d307bd1244c5346ee88336a4;hp=4289d3c0dd9b5b77e13224b8c8a01eb616771def;hpb=9ddcd066e37e4c72685817c042c30897786ece05;p=r2c2.git diff --git a/source/libmarklin/train.h b/source/libmarklin/train.h index 4289d3c..ccfcbec 100644 --- a/source/libmarklin/train.h +++ b/source/libmarklin/train.h @@ -18,6 +18,7 @@ namespace Marklin { class ControlModel; class LocoType; class Route; +class Timetable; class Vehicle; class Train: public sigc::trackable @@ -36,6 +37,8 @@ public: void name(const std::string &); void real_speed(unsigned, float, float); void route(const std::string &); + void timetable(); + void vehicle(unsigned); }; sigc::signal signal_name_changed; @@ -68,11 +71,13 @@ private: const LocoType &loco_type; unsigned address; std::string name; + int priority; std::vector vehicles; std::list cur_blocks; std::list rsv_blocks; Block *pending_block; ControlModel *control; + Timetable *timetable; bool active; unsigned current_speed; bool speed_changing; @@ -88,6 +93,8 @@ private: float travel_dist; bool pure_speed; std::vector real_speed; + bool accurate_position; + float overshoot_dist; public: Train(Layout &, const LocoType &, unsigned); @@ -98,6 +105,8 @@ public: unsigned get_address() const { return address; } void set_name(const std::string &); const std::string &get_name() const { return name; } + void set_priority(int); + int get_priority() const { return priority; } ControlModel &get_control() const { return *control; } Vehicle &get_vehicle(unsigned); @@ -111,6 +120,9 @@ public: bool get_function(unsigned) const; unsigned get_functions() const { return functions; } + void set_timetable(Timetable *); + Timetable *get_timetable() { return timetable; } + void set_route(const Route *); void go_to(const Track &); const Route *get_route() const { return route; } @@ -130,6 +142,7 @@ private: void loco_func_event(unsigned, unsigned, bool); void sensor_event(unsigned, bool); void turnout_event(unsigned, bool); + void halt_event(bool); void block_reserved(const Block &, const Train *); unsigned reserve_more(); float get_real_speed(unsigned) const;