pub struct WaveData {Show 22 fields
pub inner: DataContainer,
pub source: WaveSource,
pub format: WaveFormat,
pub active_scope: Option<ScopeType>,
pub items_tree: DisplayedItemTree,
pub displayed_items: HashMap<DisplayedItemRef, DisplayedItem>,
pub display_item_ref_counter: usize,
pub viewports: Vec<Viewport>,
pub cursor: Option<BigInt>,
pub markers: HashMap<u8, BigInt>,
pub focused_item: Option<VisibleItemIndex>,
pub focused_transaction: (Option<TransactionRef>, Option<Transaction>),
pub default_variable_name_type: VariableNameType,
pub scroll_offset: f32,
pub display_variable_indices: bool,
pub graphics: HashMap<GraphicId, Graphic>,
pub drawing_infos: Vec<ItemDrawingInfo>,
pub top_item_draw_offset: f32,
pub total_height: f32,
pub old_num_timestamps: Option<BigInt>,
pub cache_generation: u64,
pub inflight_caches: HashMap<AnalogCacheKey, Arc<AnalogCacheEntry>>,
}Fields§
§inner: DataContainer§source: WaveSource§format: WaveFormat§active_scope: Option<ScopeType>§items_tree: DisplayedItemTreeRoot items (variables, dividers, …) to display
displayed_items: HashMap<DisplayedItemRef, DisplayedItem>§display_item_ref_counter: usizeTracks the consecutive displayed item refs
viewports: Vec<Viewport>§cursor: Option<BigInt>§markers: HashMap<u8, BigInt>§focused_item: Option<VisibleItemIndex>§focused_transaction: (Option<TransactionRef>, Option<Transaction>)§default_variable_name_type: VariableNameType§scroll_offset: f32§display_variable_indices: bool§graphics: HashMap<GraphicId, Graphic>§drawing_infos: Vec<ItemDrawingInfo>These are just stored during operation, so no need to serialize
top_item_draw_offset: f32§total_height: f32§old_num_timestamps: Option<BigInt>§cache_generation: u64Generation counter for analog cache invalidation on waveform reload.
inflight_caches: HashMap<AnalogCacheKey, Arc<AnalogCacheEntry>>Registry of in-flight analog cache builds for sharing. Cleared on waveform reload when generation changes.
Implementations§
Source§impl WaveData
impl WaveData
fn get_item_y(&self, y: &GraphicsY) -> Option<f32>
pub(crate) fn draw_graphics( &self, ctx: &mut DrawingContext<'_>, size: Vec2, viewport: &Viewport, theme: &SurferTheme, )
Source§impl WaveData
impl WaveData
Sourcefn get_marker_color(&self, idx: u8, theme: &SurferTheme) -> Color32
fn get_marker_color(&self, idx: u8, theme: &SurferTheme) -> Color32
Get the color for a marker by its index, falling back to cursor color if not found
pub fn draw_cursor( &self, theme: &SurferTheme, ctx: &mut DrawingContext<'_>, size: Vec2, viewport: &Viewport, )
pub fn draw_markers( &self, theme: &SurferTheme, ctx: &mut DrawingContext<'_>, size: Vec2, viewport: &Viewport, )
pub fn can_add_marker(&self) -> bool
pub fn add_marker( &mut self, location: &BigInt, name: Option<String>, move_focus: bool, ) -> Option<DisplayedItemRef>
pub fn remove_marker(&mut self, idx: u8)
Sourcepub fn set_marker_position(&mut self, idx: u8, location: &BigInt)
pub fn set_marker_position(&mut self, idx: u8, location: &BigInt)
Set the marker with the specified id to the location. If the marker doesn’t exist already, it will be created
pub fn move_marker_to_cursor(&mut self, idx: u8)
Sourcefn draw_text_with_background(
ctx: &mut DrawingContext<'_>,
x: f32,
y: f32,
text: &str,
text_size: f32,
background_color: Color32,
foreground_color: Color32,
padding: f32,
)
fn draw_text_with_background( ctx: &mut DrawingContext<'_>, x: f32, y: f32, text: &str, text_size: f32, background_color: Color32, foreground_color: Color32, padding: f32, )
Draw text with background box at the specified position Returns the text and its background rectangle info for reuse if needed
pub fn draw_marker_number_boxes( &self, ctx: &mut DrawingContext<'_>, size: Vec2, theme: &SurferTheme, viewport: &Viewport, )
Source§impl WaveData
impl WaveData
pub fn draw_tick_line( &self, x: f32, ctx: &mut DrawingContext<'_>, stroke: &Stroke, )
Sourcepub fn draw_ticks(
&self,
color: Color32,
ticks: &[(String, f32)],
ctx: &DrawingContext<'_>,
y_offset: f32,
align: Align2,
)
pub fn draw_ticks( &self, color: Color32, ticks: &[(String, f32)], ctx: &DrawingContext<'_>, y_offset: f32, align: Align2, )
Draw the text for each tick location.
Source§impl WaveData
impl WaveData
pub fn compute_variable_display_names(&mut self)
pub fn force_variable_name_type(&mut self, name_type: VariableNameType)
Source§impl WaveData
impl WaveData
pub fn update_with_waves( self, new_waves: Box<WaveContainer>, source: WaveSource, format: WaveFormat, translators: &TranslatorList, keep_unavailable: bool, ) -> (WaveData, Option<LoadSignalsCmd>)
pub fn update_with_items( &mut self, new_items: &HashMap<DisplayedItemRef, DisplayedItem>, items_tree: DisplayedItemTree, translators: &TranslatorList, ) -> Option<LoadSignalsCmd>
Sourcefn update_metadata(&mut self, translators: &TranslatorList)
fn update_metadata(&mut self, translators: &TranslatorList)
Go through all signals and update the metadata for all signals
Used after loading new waves, signals or switching a bunch of translators
Sourcefn load_waves(&mut self) -> Option<LoadSignalsCmd>
fn load_waves(&mut self) -> Option<LoadSignalsCmd>
Get the underlying wave container to load all signals that are being displayed
This is needed for wave containers that lazy-load signals.
Sourcepub fn update_viewports(&mut self)
pub fn update_viewports(&mut self)
Needs to be called after update_with, once the new number of timestamps is available in
the inner WaveContainer.
fn update_displayed_items( &self, waves: &WaveContainer, items: &HashMap<DisplayedItemRef, DisplayedItem>, keep_unavailable: bool, translators: &TranslatorList, ) -> HashMap<DisplayedItemRef, DisplayedItem>
pub fn select_preferred_translator( &self, var: &VariableMeta, translators: &TranslatorList, ) -> String
pub fn variable_translator<'a>( &'a self, field: &DisplayedFieldRef, translators: &'a TranslatorList, ) -> &'a DynTranslator
pub fn variable_translator_with_meta<'a>( &'a self, field: &DisplayedFieldRef, translators: &'a TranslatorList, meta: &VariableMeta, ) -> &'a DynTranslator
pub fn add_variables( &mut self, translators: &TranslatorList, variables: Vec<VariableRef>, target_position: Option<TargetPosition>, update_display_names: bool, ignore_failures: bool, variable_name_type: Option<VariableNameType>, ) -> (Option<LoadSignalsCmd>, Vec<DisplayedItemRef>)
Sourcepub fn remove_displayed_item(&mut self, id: DisplayedItemRef)
pub fn remove_displayed_item(&mut self, id: DisplayedItemRef)
Remove a single item, it’s legal to call this function with an invalid ID
pub fn add_divider( &mut self, name: Option<String>, vidx: Option<VisibleItemIndex>, )
pub fn add_timeline(&mut self, vidx: Option<VisibleItemIndex>)
pub fn add_group( &mut self, name: String, target_position: Option<TargetPosition>, ) -> DisplayedItemRef
pub fn add_generator(&mut self, gen_ref: TransactionStreamRef)
pub fn add_stream(&mut self, stream_ref: TransactionStreamRef)
pub fn add_all_streams(&mut self)
Sourcepub fn insert_position(
&self,
vidx: Option<VisibleItemIndex>,
) -> Option<TargetPosition>
pub fn insert_position( &self, vidx: Option<VisibleItemIndex>, ) -> Option<TargetPosition>
Return an insert position based on item
If an item is passed, and it is
- an unfolded group, insert index is to the first element of the group
- a folded group, insert index is to before the next sibling (if exists)
- otherwise insert index is past it on the same level
Sourcepub fn end_insert_position(&self) -> TargetPosition
pub fn end_insert_position(&self) -> TargetPosition
Return insert position as last item
pub fn index_for_ref_or_focus( &self, item_ref: Option<DisplayedItemRef>, ) -> Option<ItemIndex>
Sourcepub(crate) fn insert_item(
&mut self,
new_item: DisplayedItem,
target_position: Option<TargetPosition>,
move_focus: bool,
) -> DisplayedItemRef
pub(crate) fn insert_item( &mut self, new_item: DisplayedItem, target_position: Option<TargetPosition>, move_focus: bool, ) -> DisplayedItemRef
Insert item after item vidx if Some(vidx).
If None, insert in relation to focused item (see [Self::focused_insert_position()]).
If nothing is selected, fall back to appending.
Focus on the inserted item if there was a focused item.
pub fn go_to_cursor_if_not_in_view(&mut self) -> bool
pub fn numbered_marker_location( &self, idx: u8, viewport: &Viewport, view_width: f32, ) -> f32
pub fn numbered_marker_time(&self, idx: u8) -> &BigInt
pub fn viewport_all(&self) -> Viewport
pub fn remove_placeholders(&mut self)
pub fn any_displayed(&self) -> bool
Sourcepub fn get_top_item(&self) -> usize
pub fn get_top_item(&self) -> usize
Find the top-most of the currently visible items.
Sourcepub fn get_item_at_y(&self, y: f32) -> Option<VisibleItemIndex>
pub fn get_item_at_y(&self, y: f32) -> Option<VisibleItemIndex>
Find the item at a given y-location.
pub fn scroll_to_item(&mut self, idx: usize)
Sourcepub fn set_cursor_at_transition(
&mut self,
next: bool,
variable: Option<VisibleItemIndex>,
skip_zero: bool,
)
pub fn set_cursor_at_transition( &mut self, next: bool, variable: Option<VisibleItemIndex>, skip_zero: bool, )
Set cursor at next (or previous, if next is false) transition of variable. If skip_zero is true,
use the next transition to a non-zero value.
pub fn next_displayed_item_ref(&mut self) -> DisplayedItemRef
Sourcepub fn num_timestamps(&self) -> Option<BigInt>
pub fn num_timestamps(&self) -> Option<BigInt>
Returns the number of timestamps in the current waves. For now, this adjusts the number of timestamps as returned by wave sources if they specify 0 timestamps. This is done to avoid having to consider what happens with the viewport.
Sourcepub fn safe_num_timestamps(&self) -> BigInt
pub fn safe_num_timestamps(&self) -> BigInt
Returns the number of timestamps in the current waves. This is like num_timestamps but
will always return at least 1.
pub fn get_displayed_item_index( &self, item_ref: &DisplayedItemRef, ) -> Option<VisibleItemIndex>
Sourcepub fn build_analog_cache_async(
&self,
entry: Arc<AnalogCacheEntry>,
variable_ref: &VariableRef,
translator: AnyTranslator,
sender: &Sender<Message>,
) -> Option<()>
pub fn build_analog_cache_async( &self, entry: Arc<AnalogCacheEntry>, variable_ref: &VariableRef, translator: AnyTranslator, sender: &Sender<Message>, ) -> Option<()>
Spawn async worker to build analog cache. Worker holds Arc clone.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WaveData
impl<'de> Deserialize<'de> for WaveData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WaveData
impl !RefUnwindSafe for WaveData
impl Send for WaveData
impl Sync for WaveData
impl Unpin for WaveData
impl !UnwindSafe for WaveData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more