turnout_id(0),
sensor_id(0),
links(type.get_endpoints().size()),
- active_path(0)
+ active_path(0),
+ path_changing(false)
{
if(type.is_turnout())
turnout_id = layout.allocate_turnout_id();
if(!(type.get_paths()&(1<<p)))
throw invalid_argument("Track::set_active_path");
+ path_changing = true;
layout.get_driver().set_turnout(turnout_id, p);
}
if(addr==turnout_id)
{
active_path = state;
+ path_changing = false;
signal_path_changed.emit(active_path);
}
}
unsigned sensor_id;
std::vector<Track *> links;
unsigned active_path;
+ bool path_changing;
Track(const Track &);
Track &operator=(const Track &);
unsigned get_sensor_id() const { return sensor_id; }
void set_active_path(unsigned);
unsigned get_active_path() const { return active_path; }
+ bool is_path_changing() const { return path_changing; }
int get_endpoint_by_link(Track &) const;
Vector get_endpoint_position(unsigned) const;