const map<unsigned, Turnout *> &turnouts = trfc_mgr.get_control().get_turnouts();
for(map<unsigned, Turnout *>::const_iterator i=turnouts.begin(); i!=turnouts.end(); ++i)
{
- i->second->signal_route_changing.connect(sigc::bind(sigc::mem_fun(this, &Train::turnout_route_changing), i->second));
- i->second->signal_route_changed.connect(sigc::bind(sigc::mem_fun(this, &Train::turnout_route_changed), i->second));
+ i->second->signal_path_changing.connect(sigc::bind(sigc::mem_fun(this, &Train::turnout_path_changing), i->second));
+ i->second->signal_path_changed.connect(sigc::bind(sigc::mem_fun(this, &Train::turnout_path_changed), i->second));
}
}
if(cur_track)
{
- unsigned route = 0;
+ unsigned path = 0;
if(cur_track->get_turnout_id())
- route = trfc_mgr.get_control().get_turnout(cur_track->get_turnout_id()).get_route();
+ path = trfc_mgr.get_control().get_turnout(cur_track->get_turnout_id()).get_path();
offset += get_real_speed(loco.get_speed())*(dt/Time::sec);
- if(offset>cur_track->get_type().get_route_length(route))
+ if(offset>cur_track->get_type().get_path_length(path))
{
- int out = cur_track->traverse(cur_track_ep, route);
+ int out = cur_track->traverse(cur_track_ep, path);
if(out>=0)
{
Track *next = cur_track->get_link(out);
}
if(cur_track)
- pos = cur_track->get_point(cur_track_ep, route, offset);
+ pos = cur_track->get_point(cur_track_ep, path, offset);
}
}
if(cur_track)
{
- unsigned route = 0;
+ unsigned path = 0;
if(unsigned turnout = cur_track->get_turnout_id())
- route = trfc_mgr.get_control().get_turnout(turnout).get_route();
- cur_track_ep = cur_track->traverse(cur_track_ep, route);
- offset = cur_track->get_type().get_route_length(route)-offset;
+ path = trfc_mgr.get_control().get_turnout(turnout).get_path();
+ cur_track_ep = cur_track->traverse(cur_track_ep, path);
+ offset = cur_track->get_type().get_path_length(path)-offset;
}
}
}
}
-void Train::turnout_route_changing(unsigned, Turnout *turnout)
+void Train::turnout_path_changing(unsigned, Turnout *turnout)
{
unsigned tid = turnout->get_address();
for(list<BlockRef>::const_iterator i=cur_blocks.begin(); i!=cur_blocks.end(); ++i)
}
}
-void Train::turnout_route_changed(unsigned, Turnout *turnout)
+void Train::turnout_path_changed(unsigned, Turnout *turnout)
{
unsigned tid = turnout->get_address();
for(list<BlockRef>::iterator i=rsv_blocks.begin(); i!=rsv_blocks.end(); ++i)