platform
This commit is contained in:
parent
645e03ea86
commit
ea38f61058
14 changed files with 123 additions and 19 deletions
|
@ -6,3 +6,6 @@ repository.workspace = true
|
|||
authors.workspace = true
|
||||
readme.workspace = true
|
||||
publish.workspace = true
|
||||
|
||||
[dependencies]
|
||||
wellen.workspace = true
|
||||
|
|
|
@ -1 +1 @@
|
|||
|
||||
pub mod wellen_helpers;
|
||||
|
|
15
shared/src/wellen_helpers.rs
Normal file
15
shared/src/wellen_helpers.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
use wellen::{simple::Waveform, *};
|
||||
|
||||
pub fn read_from_bytes(bytes: Vec<u8>) -> Result<Waveform> {
|
||||
read_from_bytes_with_options(bytes, &LoadOptions::default())
|
||||
}
|
||||
|
||||
pub fn read_from_bytes_with_options(bytes: Vec<u8>, options: &LoadOptions) -> Result<Waveform> {
|
||||
let header = viewers::read_header_from_bytes(bytes, options)?;
|
||||
let body = viewers::read_body(header.body, &header.hierarchy, None)?;
|
||||
Ok(Waveform::new(
|
||||
header.hierarchy,
|
||||
body.source,
|
||||
body.time_table,
|
||||
))
|
||||
}
|
Reference in a new issue