mirror of https://codeberg.org/topola/topola.git
sdl2-demo: use `Autorouter` object
This commit is contained in:
parent
b3f36d22b4
commit
2cd33dac60
|
|
@ -12,6 +12,7 @@ macro_rules! dbg_dot {
|
||||||
use geo::point;
|
use geo::point;
|
||||||
use painter::Painter;
|
use painter::Painter;
|
||||||
use petgraph::visit::{EdgeRef, IntoEdgeReferences};
|
use petgraph::visit::{EdgeRef, IntoEdgeReferences};
|
||||||
|
use topola::autorouter::Autorouter;
|
||||||
use topola::drawing::dot::FixedDotWeight;
|
use topola::drawing::dot::FixedDotWeight;
|
||||||
use topola::drawing::graph::{MakePrimitive, PrimitiveIndex};
|
use topola::drawing::graph::{MakePrimitive, PrimitiveIndex};
|
||||||
use topola::drawing::primitive::MakePrimitiveShape;
|
use topola::drawing::primitive::MakePrimitiveShape;
|
||||||
|
|
@ -261,9 +262,7 @@ fn main() -> Result<(), anyhow::Error> {
|
||||||
]),
|
]),
|
||||||
}));*/
|
}));*/
|
||||||
|
|
||||||
let design = DsnDesign::load_from_file(
|
let design = DsnDesign::load_from_file("tests/data/0603_breakout/0603_breakout.dsn")?;
|
||||||
"tests/data/prerouted_lm317_breakout/prerouted_lm317_breakout.dsn",
|
|
||||||
)?;
|
|
||||||
//let design = DsnDesign::load_from_file("tests/data/test/test.dsn")?;
|
//let design = DsnDesign::load_from_file("tests/data/test/test.dsn")?;
|
||||||
//dbg!(&design);
|
//dbg!(&design);
|
||||||
let layout = Arc::new(Mutex::new(design.make_layout()));
|
let layout = Arc::new(Mutex::new(design.make_layout()));
|
||||||
|
|
@ -289,6 +288,23 @@ fn main() -> Result<(), anyhow::Error> {
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let mut autorouter = Autorouter::new(layout.clone()).unwrap();
|
||||||
|
if let Some(mut autoroute) = autorouter.autoroute_iter() {
|
||||||
|
while let Some(()) = autoroute.next(
|
||||||
|
&mut autorouter,
|
||||||
|
&mut DebugRouterObserver::new(
|
||||||
|
&mut event_pump,
|
||||||
|
&window,
|
||||||
|
&mut renderer,
|
||||||
|
&font_context,
|
||||||
|
&mut view,
|
||||||
|
Some(autoroute.navmesh().clone()),
|
||||||
|
),
|
||||||
|
) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// these are both on net 1 in the test file
|
// these are both on net 1 in the test file
|
||||||
/*let _ = router.route_band(
|
/*let _ = router.route_band(
|
||||||
dot_indices[1],
|
dot_indices[1],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue