Scripting, save & reload vars, layout improvements #3

Merged
MartinKavik merged 17 commits from scripting into main 2024-06-19 17:09:00 +00:00
3 changed files with 6 additions and 4 deletions
Showing only changes of commit 24d2c0b2dc - Show all commits

View file

@ -140,7 +140,7 @@ impl HeaderPanel {
platform::pick_and_load_waveform(Some(file)).await
{
loaded_filename.set_neq(Some(filename));
hierarchy.set(Some(Rc::new(platform::get_hierarchy().await)))
hierarchy.set(Some(Arc::new(platform::get_hierarchy().await)))
}
})
})

View file

@ -26,6 +26,7 @@ type Filename = String;
struct Store {
selected_var_refs: MutableVec<wellen::VarRef>,
hierarchy: Mutable<Option<Arc<wellen::Hierarchy>>>,
loaded_filename: Mutable<Option<Filename>>,
}
static STORE: Lazy<Store> = lazy::default();
@ -43,7 +44,7 @@ fn root() -> impl Element {
let hierarchy = STORE.hierarchy.clone();
let selected_var_refs = STORE.selected_var_refs.clone();
let layout: Mutable<Layout> = <_>::default();
let loaded_filename: Mutable<Option<Filename>> = <_>::default();
let loaded_filename = STORE.loaded_filename.clone();
Column::new()
.s(Height::fill())
.s(Scrollbars::y_and_clip_x())

View file

@ -49,8 +49,9 @@ impl FW {
0
}
pub fn loaded_filename() -> String {
format!("todo loaded filename")
/// JS: `FW.loaded_filename()` -> `simple.vcd`
pub fn loaded_filename() -> Option<String> {
STORE.loaded_filename.get_cloned()
}
/// JS: `FW.selected_vars()` -> `["simple_tb.s.A", "simple_tb.s.B"]`