X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fdummy.h;h=2c6f992c64d05ee5ca7cba8456093abdebe6d0db;hb=ab64a17394440c3cb18d0b30d75fb4ed6297a6b4;hp=d388ca6ecc87eb9402af1f46197b5c50766e71f8;hpb=247742fbc1c27bfc9fdef4630afcdc2408cdd550;p=r2c2.git diff --git a/source/libr2c2/dummy.h b/source/libr2c2/dummy.h index d388ca6..2c6f992 100644 --- a/source/libr2c2/dummy.h +++ b/source/libr2c2/dummy.h @@ -1,14 +1,9 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef LIBR2C2_DUMMY_H_ #define LIBR2C2_DUMMY_H_ #include +#include +#include #include "driver.h" namespace R2C2 { @@ -16,6 +11,13 @@ namespace R2C2 { class Dummy: public Driver { private: + struct TurnoutState + { + unsigned state; + unsigned pending; + Msp::Time::TimeStamp timeout; + }; + struct LocoState { unsigned speed; @@ -23,12 +25,13 @@ private: }; bool power; - std::map turnouts; + std::map turnouts; std::map locos; std::map sensors; + Msp::Time::TimeDelta turnout_delay; public: - Dummy(); + Dummy(const std::string &); virtual void set_power(bool); virtual bool get_power() const { return power; } @@ -46,11 +49,15 @@ public: virtual void set_turnout(unsigned, unsigned); virtual unsigned get_turnout(unsigned) const; + virtual void add_signal(unsigned, const SignalType &) { } + virtual void set_signal(unsigned, unsigned) { } + virtual unsigned get_signal(unsigned) const { return 0; } + virtual void add_sensor(unsigned) { } virtual void set_sensor(unsigned, bool); virtual bool get_sensor(unsigned) const; - virtual void tick() { } + virtual void tick(); virtual void flush() { } };