mirror of https://codeberg.org/topola/topola.git
egui: expose autorouter options in the GUI
This commit is contained in:
parent
a52515f6d3
commit
59f88e854c
|
|
@ -1,4 +1,5 @@
|
||||||
menu-file = File
|
menu-file = File
|
||||||
|
menu-options = Options
|
||||||
menu-debug = Debug
|
menu-debug = Debug
|
||||||
|
|
||||||
action-open-dsn = Open
|
action-open-dsn = Open
|
||||||
|
|
@ -16,6 +17,8 @@ action-measure-length = Measure Length
|
||||||
action-undo = Undo
|
action-undo = Undo
|
||||||
action-redo = Redo
|
action-redo = Redo
|
||||||
|
|
||||||
|
presort-by-pairwise-detours = Presort by pairwise detours
|
||||||
|
|
||||||
show-ratsnest = Show Ratsnest
|
show-ratsnest = Show Ratsnest
|
||||||
show-navmesh = Show Navmesh
|
show-navmesh = Show Navmesh
|
||||||
show-bboxes = Show BBoxes
|
show-bboxes = Show BBoxes
|
||||||
|
|
|
||||||
|
|
@ -170,8 +170,6 @@ impl eframe::App for App {
|
||||||
|
|
||||||
/// Called each time the UI has to be repainted.
|
/// Called each time the UI has to be repainted.
|
||||||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||||
self.update_state(ctx.input(|i| i.stable_dt));
|
|
||||||
|
|
||||||
self.top.update(
|
self.top.update(
|
||||||
ctx,
|
ctx,
|
||||||
&self.translator,
|
&self.translator,
|
||||||
|
|
@ -183,6 +181,8 @@ impl eframe::App for App {
|
||||||
&self.maybe_design,
|
&self.maybe_design,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
self.update_state(ctx.input(|i| i.stable_dt));
|
||||||
|
|
||||||
if let Some(ref mut layers) = self.maybe_layers {
|
if let Some(ref mut layers) = self.maybe_layers {
|
||||||
if let Some(invoker) = self.arc_mutex_maybe_invoker.lock().unwrap().as_ref() {
|
if let Some(invoker) = self.arc_mutex_maybe_invoker.lock().unwrap().as_ref() {
|
||||||
layers.update(ctx, invoker.autorouter().board());
|
layers.update(ctx, invoker.autorouter().board());
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct Top {
|
pub struct Top {
|
||||||
|
pub autorouter_options: AutorouterOptions,
|
||||||
pub is_placing_via: bool,
|
pub is_placing_via: bool,
|
||||||
pub show_ratsnest: bool,
|
pub show_ratsnest: bool,
|
||||||
pub show_navmesh: bool,
|
pub show_navmesh: bool,
|
||||||
|
|
@ -31,6 +32,7 @@ pub struct Top {
|
||||||
impl Top {
|
impl Top {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
autorouter_options: AutorouterOptions::new(),
|
||||||
is_placing_via: false,
|
is_placing_via: false,
|
||||||
show_ratsnest: false,
|
show_ratsnest: false,
|
||||||
show_navmesh: false,
|
show_navmesh: false,
|
||||||
|
|
@ -135,6 +137,15 @@ impl Top {
|
||||||
|
|
||||||
autoroute.button(ctx, ui);
|
autoroute.button(ctx, ui);
|
||||||
|
|
||||||
|
ui.menu_button(tr.text("menu-options"), |ui| {
|
||||||
|
ui.checkbox(
|
||||||
|
&mut self.autorouter_options.presort_by_pairwise_detours,
|
||||||
|
tr.text("presort-by-pairwise-detours"),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.separator();
|
||||||
|
|
||||||
place_via.toggle_widget(ctx, ui, &mut self.is_placing_via);
|
place_via.toggle_widget(ctx, ui, &mut self.is_placing_via);
|
||||||
|
|
||||||
remove_bands.button(ctx, ui);
|
remove_bands.button(ctx, ui);
|
||||||
|
|
@ -252,7 +263,7 @@ impl Top {
|
||||||
maybe_execute.insert(ExecuteWithStatus::new(invoker.execute_stepper(
|
maybe_execute.insert(ExecuteWithStatus::new(invoker.execute_stepper(
|
||||||
Command::Autoroute(
|
Command::Autoroute(
|
||||||
selection.pin_selection,
|
selection.pin_selection,
|
||||||
AutorouterOptions::new(),
|
self.autorouter_options,
|
||||||
),
|
),
|
||||||
)?));
|
)?));
|
||||||
}
|
}
|
||||||
|
|
@ -309,7 +320,7 @@ impl Top {
|
||||||
maybe_execute.insert(ExecuteWithStatus::new(invoker.execute_stepper(
|
maybe_execute.insert(ExecuteWithStatus::new(invoker.execute_stepper(
|
||||||
Command::CompareDetours(
|
Command::CompareDetours(
|
||||||
selection.pin_selection,
|
selection.pin_selection,
|
||||||
AutorouterOptions::new(),
|
self.autorouter_options,
|
||||||
),
|
),
|
||||||
)?));
|
)?));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue