component_manager, strict_eval.js
This commit is contained in:
parent
d97f98485b
commit
6b52067a95
11 changed files with 119 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
use shared::wellen_helpers;
|
||||
use std::sync::Mutex;
|
||||
use wellen::simple::Waveform;
|
||||
use zoon::*;
|
||||
use zoon::{*, eprintln};
|
||||
|
||||
#[derive(Default)]
|
||||
struct BrowserPlatformStore {
|
||||
|
@ -120,3 +120,11 @@ pub(super) async fn unload_signal(signal_ref: wellen::SignalRef) {
|
|||
let waveform = waveform_lock.as_mut().unwrap_throw();
|
||||
waveform.unload_signals(&[signal_ref]);
|
||||
}
|
||||
|
||||
pub(super) async fn add_decoders(
|
||||
_decoder_paths: Vec<super::DecoderPath>,
|
||||
) -> super::AddedDecodersCount {
|
||||
// @TODO error message for user
|
||||
eprintln!("Adding decoders is not supported in the browser.");
|
||||
0
|
||||
}
|
||||
|
|
|
@ -56,6 +56,13 @@ pub(super) async fn unload_signal(signal_ref: wellen::SignalRef) {
|
|||
.unwrap_throw()
|
||||
}
|
||||
|
||||
pub(super) async fn add_decoders(
|
||||
decoder_paths: Vec<super::DecoderPath>,
|
||||
) -> super::AddedDecodersCount {
|
||||
serde_wasm_bindgen::from_value(tauri_glue::add_decoders(decoder_paths).await.unwrap_throw())
|
||||
.unwrap_throw()
|
||||
}
|
||||
|
||||
mod tauri_glue {
|
||||
use zoon::*;
|
||||
|
||||
|
@ -86,5 +93,10 @@ mod tauri_glue {
|
|||
|
||||
#[wasm_bindgen(catch)]
|
||||
pub async fn unload_signal(signal_ref_index: usize) -> Result<(), JsValue>;
|
||||
|
||||
#[wasm_bindgen(catch)]
|
||||
pub async fn add_decoders(
|
||||
decoder_paths: Vec<super::super::DecoderPath>,
|
||||
) -> Result<JsValue, JsValue>;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue