-void AIControl::set_control(const string &n, float v)
-{
- if(n=="speed")
- {
- if(v && !train.is_active())
- train.set_active(true);
-
- target_speed.set(v);
- if(state!=BLOCKED)
- {
- float approach_speed = 5*train.get_layout().get_catalogue().get_scale();
- if(state==APPROACH && target_speed.value>approach_speed)
- next_ctrl->set_control("speed", approach_speed);
- else
- next_ctrl->set_control("speed", target_speed.value);
- }
-
- signal_control_changed.emit(target_speed);
- }
- else
- next_ctrl->set_control(n, v);