mirror of https://codeberg.org/topola/topola.git
autorouter: route all ratline endpoint pairs
Routed bands are intersecting with each other for some reason, but at least this doesn't crash.
This commit is contained in:
parent
531bc6d22c
commit
2be8baab55
|
|
@ -24,38 +24,32 @@ impl<R: RulesTrait> Autorouter<R> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn autoroute(&mut self, observer: &mut impl RouterObserverTrait<R>) {
|
pub fn autoroute(&mut self, observer: &mut impl RouterObserverTrait<R>) {
|
||||||
//for ratline in self.overlay.ratsnest().graph().edge_references() {
|
for ratline in self.ratsnest.graph().edge_references() {
|
||||||
|
let from = self
|
||||||
// For now, let's only take the first ratline.
|
.ratsnest
|
||||||
let ratline = self.ratsnest.graph().edge_references().next().unwrap();
|
|
||||||
|
|
||||||
self.route(
|
|
||||||
self.ratsnest
|
|
||||||
.graph()
|
.graph()
|
||||||
.node_weight(ratline.source())
|
.node_weight(ratline.source())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.vertex_index(),
|
.vertex_index();
|
||||||
self.ratsnest
|
let to = self
|
||||||
|
.ratsnest
|
||||||
.graph()
|
.graph()
|
||||||
.node_weight(ratline.target())
|
.node_weight(ratline.target())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.vertex_index(),
|
.vertex_index();
|
||||||
observer,
|
|
||||||
);
|
|
||||||
|
|
||||||
//}
|
let from_dot = match from {
|
||||||
}
|
RatsnestVertexIndex::FixedDot(dot) => dot,
|
||||||
|
RatsnestVertexIndex::Zone(zone) => self.router.layout_mut().zone_apex(zone),
|
||||||
|
};
|
||||||
|
|
||||||
fn route(
|
let to_dot = match to {
|
||||||
&mut self,
|
RatsnestVertexIndex::FixedDot(dot) => dot,
|
||||||
from: RatsnestVertexIndex,
|
RatsnestVertexIndex::Zone(zone) => self.router.layout_mut().zone_apex(zone),
|
||||||
to: RatsnestVertexIndex,
|
};
|
||||||
observer: &mut impl RouterObserverTrait<R>,
|
|
||||||
) -> Result<BandIndex, RoutingError> {
|
|
||||||
let from_dot = self.terminating_dot(from);
|
|
||||||
let to_dot = self.terminating_dot(to);
|
|
||||||
|
|
||||||
self.router.route_band(from_dot, to_dot, 100.0, observer)
|
self.router.route_band(from_dot, to_dot, 100.0, observer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn terminating_dot(&mut self, vertex: RatsnestVertexIndex) -> FixedDotIndex {
|
fn terminating_dot(&mut self, vertex: RatsnestVertexIndex) -> FixedDotIndex {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue