Layout &layout = train.get_layout();
layout.signal_block_reserved.connect(sigc::mem_fun(this, &BlockAllocator::block_reserved));
layout.signal_sensor_state_changed.connect(sigc::mem_fun(this, &BlockAllocator::sensor_state_changed));
+ layout.get_driver().signal_halt.connect(sigc::mem_fun(this, &BlockAllocator::halt_event));
const set<Track *> &tracks = layout.get_all<Track>();
for(set<Track *>::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
if(blocks.empty())
throw logic_error("no blocks");
+ if(train.get_layout().get_driver().is_halted())
+ return;
+
BlockIter start = blocks.back();
if(&*start==stop_at_block)
return;
next_sensor = 0;
}
+void BlockAllocator::halt_event(bool halted)
+{
+ if(active && !halted)
+ reserve_more();
+}
+
void BlockAllocator::save(list<DataFile::Statement> &st) const
{
if(!blocks.empty() && cur_blocks_end!=blocks.begin())
void block_reserved(Block &, const Train *);
void sensor_state_changed(Sensor &, Sensor::State);
void update_next_sensor(Sensor *);
+ void halt_event(bool);
public:
void save(std::list<Msp::DataFile::Statement> &) const;