]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/train.h
Streamline various block-related algorithms
[r2c2.git] / source / libr2c2 / train.h
index 6b384f8220b9eece5e5873ead9ab07283d601755..ece5b4bb6340351119fe162532a0fbb725198a45 100644 (file)
@@ -5,14 +5,15 @@
 #include <sigc++/trackable.h>
 #include <msp/datafile/objectloader.h>
 #include <msp/time/timestamp.h>
-#include "block.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;
@@ -63,8 +64,8 @@ private:
        Msp::Time::TimeStamp stop_timeout;
        unsigned functions;
 
+       BlockIter last_entry_block;
        Msp::Time::TimeStamp last_entry_time;
-       float travel_dist;
        bool pure_speed;
        SpeedQuantizer *speed_quantizer;
        bool accurate_position;
@@ -130,10 +131,10 @@ 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