X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftimetable.h;h=3abbf83149e87e256bb9852a1c146a49c833c629;hb=59e4c75da550e96ae74162a5ed70e8b1999721d8;hp=3c76055e712e6d54d82d29bff77b3511da4e0248;hpb=a277834b140eb5987419e2c335032c534a7184cd;p=r2c2.git diff --git a/source/libmarklin/timetable.h b/source/libmarklin/timetable.h index 3c76055..3abbf83 100644 --- a/source/libmarklin/timetable.h +++ b/source/libmarklin/timetable.h @@ -27,6 +27,7 @@ public: public: Loader(Timetable &); private: + void arrive(); void go_to(const std::string &); void route(const std::string &); void speed(int); @@ -39,6 +40,7 @@ public: GOTO, TRAVEL, WAIT, + ARRIVE, SPEED, ROUTE }; @@ -51,10 +53,15 @@ public: Row(RowType, int); Row(RowType, const std::string &); + + std::string str() const; + + static Row parse(const std::string &); }; private: Train &train; + bool enabled; std::vector rows; unsigned current_row; bool executing; @@ -64,6 +71,16 @@ private: public: Timetable(Train &); + void set_enabled(bool); + bool is_enabled() const { return enabled; } + void reset(); + + void clear(); + void append(const Row &); + void insert(unsigned, const Row &); + unsigned get_n_rows() const { return rows.size(); } + const Row &get_row(unsigned) const; + void tick(const Msp::Time::TimeStamp &); void save(std::list &) const; private: