mirror of https://codeberg.org/topola/topola.git
cli: implement SES export
This commit is contained in:
parent
9e2a0acab0
commit
8d2db0a0dc
|
|
@ -7,7 +7,7 @@ use std::io::BufReader;
|
|||
struct Cli {
|
||||
input: std::path::PathBuf,
|
||||
output: std::path::PathBuf,
|
||||
history: Option<std::path::PathBuf>,
|
||||
history: std::path::PathBuf,
|
||||
}
|
||||
|
||||
fn main() -> Result<(), std::io::Error> {
|
||||
|
|
@ -19,14 +19,15 @@ fn main() -> Result<(), std::io::Error> {
|
|||
let design = topola::specctra::design::SpecctraDesign::load(design_bufread).unwrap();
|
||||
let board = design.make_board();
|
||||
|
||||
if let Some(history) = args.history {
|
||||
let history_file = File::open(history)?;
|
||||
let mut history_bufread = BufReader::new(history_file);
|
||||
let mut invoker = topola::autorouter::invoker::Invoker::new(
|
||||
topola::autorouter::Autorouter::new(board).unwrap(),
|
||||
);
|
||||
invoker.replay(serde_json::from_reader(history_bufread).unwrap())
|
||||
}
|
||||
let history_file = File::open(args.history)?;
|
||||
let mut history_bufread = BufReader::new(history_file);
|
||||
let mut invoker = topola::autorouter::invoker::Invoker::new(
|
||||
topola::autorouter::Autorouter::new(board).unwrap(),
|
||||
);
|
||||
invoker.replay(serde_json::from_reader(history_bufread).unwrap());
|
||||
|
||||
let mut file = File::create(args.output).unwrap();
|
||||
design.write_ses(invoker.autorouter().board(), &mut file);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue