#include <sigc++/signal.h>
#include <sigc++/trackable.h>
#include <msp/datafile/objectloader.h>
-#include <msp/time/timestamp.h>
-#include "block.h"
+#include <msp/time/timedelta.h>
#include "blockallocator.h"
#include "controller.h"
+#include "sensor.h"
#include "trainai.h"
namespace R2C2 {
class ArticleNumber;
+class Block;
class SpeedQuantizer;
class Vehicle;
class VehicleType;
void name(const std::string &);
void quantized_speed();
void router();
- void timetable();
void vehicle(ArticleNumber);
};
unsigned current_speed_step;
bool speed_changing;
bool reverse;
- Msp::Time::TimeStamp stop_timeout;
+ Msp::Time::TimeDelta stop_timeout;
unsigned functions;
- Msp::Time::TimeStamp last_entry_time;
- float travel_dist;
+ BlockIter last_entry_block;
+ Msp::Time::TimeDelta travel_time;
bool pure_speed;
SpeedQuantizer *speed_quantizer;
bool accurate_position;
const BlockAllocator &get_block_allocator() const { return allocator; }
float get_reserved_distance() const;
- void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &);
+ void tick(const Msp::Time::TimeDelta &);
void save(std::list<Msp::DataFile::Statement> &) const;
private:
void control_changed(const Controller::Control &);
void loco_speed_event(unsigned, unsigned, bool);
void loco_func_event(unsigned, unsigned, bool);
- void block_state_changed(Block &, Block::State);
+ void sensor_state_changed(Sensor &, Sensor::State);
void halt_event(bool);
void block_reserved(const Block &, const Train *);
- float get_reserved_distance_until(const Block *, bool) const;
+ float get_reserved_distance_until(const Block *) const;
};
} // namespace R2C2