-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rs
41 lines (33 loc) · 907 Bytes
/
main.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use std::{error::Error, path::PathBuf};
use clap::Parser;
use eframe::egui;
use field_effect::{load_circuit, simulate};
#[derive(Parser)]
struct FieldEffectArgs {
circuit_file: PathBuf,
}
struct FieldEffect {
args: FieldEffectArgs,
}
impl FieldEffect {
fn new(_cc: &eframe::CreationContext<'_>, args: FieldEffectArgs) -> Self {
FieldEffect { args }
}
}
impl eframe::App for FieldEffect {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Hello World!");
});
}
}
fn main() -> Result<(), Box<dyn Error>> {
let args = FieldEffectArgs::parse();
let native_options = eframe::NativeOptions::default();
eframe::run_native(
"Field Effect",
native_options,
Box::new(|cc| Box::new(FieldEffect::new(cc, args))),
)?;
Ok(())
}