layout.get_driver().signal_sensor.connect(sigc::mem_fun(this, &Train::sensor_event));
layout.get_driver().signal_turnout.connect(sigc::mem_fun(this, &Train::turnout_event));
+ layout.get_driver().signal_halt.connect(sigc::mem_fun(this, &Train::halt_event));
+
control->signal_control_changed.connect(signal_control_changed);
}
{
overshoot_dist += d;
if(overshoot_dist>40*layout.get_catalogue().get_scale())
+ {
layout.emergency(name+" has not arrived at sensor");
+ accurate_position = false;
+ }
}
}
else if(end_of_route)
}
}
+void Train::halt_event(bool h)
+{
+ if(h)
+ accurate_position = false;
+}
+
void Train::block_reserved(const Block &block, const Train *train)
{
if(&block==pending_block && !train)
void loco_func_event(unsigned, unsigned, bool);
void sensor_event(unsigned, bool);
void turnout_event(unsigned, bool);
+ void halt_event(bool);
void block_reserved(const Block &, const Train *);
unsigned reserve_more();
float get_real_speed(unsigned) const;