Skip to main content

WaveData

Struct WaveData 

Source
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: DisplayedItemTree

Root items (variables, dividers, …) to display

§displayed_items: HashMap<DisplayedItemRef, DisplayedItem>§display_item_ref_counter: usize

Tracks 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: u64

Generation 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

Source

fn get_item_y(&self, y: &GraphicsY) -> Option<f32>

Source

pub(crate) fn draw_graphics( &self, ctx: &mut DrawingContext<'_>, size: Vec2, viewport: &Viewport, theme: &SurferTheme, )

Source§

impl WaveData

Source

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

Source

pub fn draw_cursor( &self, theme: &SurferTheme, ctx: &mut DrawingContext<'_>, size: Vec2, viewport: &Viewport, )

Source

pub fn draw_markers( &self, theme: &SurferTheme, ctx: &mut DrawingContext<'_>, size: Vec2, viewport: &Viewport, )

Source

pub fn can_add_marker(&self) -> bool

Source

pub fn add_marker( &mut self, location: &BigInt, name: Option<String>, move_focus: bool, ) -> Option<DisplayedItemRef>

Source

pub fn remove_marker(&mut self, idx: u8)

Source

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

Source

pub fn move_marker_to_cursor(&mut self, idx: u8)

Source

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

Source

pub fn draw_marker_number_boxes( &self, ctx: &mut DrawingContext<'_>, size: Vec2, theme: &SurferTheme, viewport: &Viewport, )

Source§

impl WaveData

Source

pub fn draw_tick_line( &self, x: f32, ctx: &mut DrawingContext<'_>, stroke: &Stroke, )

Source

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

Source§

impl WaveData

Source

pub fn update_with_waves( self, new_waves: Box<WaveContainer>, source: WaveSource, format: WaveFormat, translators: &TranslatorList, keep_unavailable: bool, ) -> (WaveData, Option<LoadSignalsCmd>)

Source

pub fn update_with_items( &mut self, new_items: &HashMap<DisplayedItemRef, DisplayedItem>, items_tree: DisplayedItemTree, translators: &TranslatorList, ) -> Option<LoadSignalsCmd>

Source

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

Source

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.

Source

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.

Source

fn update_displayed_items( &self, waves: &WaveContainer, items: &HashMap<DisplayedItemRef, DisplayedItem>, keep_unavailable: bool, translators: &TranslatorList, ) -> HashMap<DisplayedItemRef, DisplayedItem>

Source

pub fn select_preferred_translator( &self, var: &VariableMeta, translators: &TranslatorList, ) -> String

Source

pub fn variable_translator<'a>( &'a self, field: &DisplayedFieldRef, translators: &'a TranslatorList, ) -> &'a DynTranslator

Source

pub fn variable_translator_with_meta<'a>( &'a self, field: &DisplayedFieldRef, translators: &'a TranslatorList, meta: &VariableMeta, ) -> &'a DynTranslator

Source

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>)

Source

pub fn remove_displayed_item(&mut self, id: DisplayedItemRef)

Remove a single item, it’s legal to call this function with an invalid ID

Source

pub fn add_divider( &mut self, name: Option<String>, vidx: Option<VisibleItemIndex>, )

Source

pub fn add_timeline(&mut self, vidx: Option<VisibleItemIndex>)

Source

pub fn add_group( &mut self, name: String, target_position: Option<TargetPosition>, ) -> DisplayedItemRef

Source

pub fn add_generator(&mut self, gen_ref: TransactionStreamRef)

Source

pub fn add_stream(&mut self, stream_ref: TransactionStreamRef)

Source

pub fn add_all_streams(&mut self)

Source

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
Source

pub fn end_insert_position(&self) -> TargetPosition

Return insert position as last item

Source

pub fn index_for_ref_or_focus( &self, item_ref: Option<DisplayedItemRef>, ) -> Option<ItemIndex>

Source

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.

Source

pub fn go_to_cursor_if_not_in_view(&mut self) -> bool

Source

pub fn numbered_marker_location( &self, idx: u8, viewport: &Viewport, view_width: f32, ) -> f32

Source

pub fn numbered_marker_time(&self, idx: u8) -> &BigInt

Source

pub fn viewport_all(&self) -> Viewport

Source

pub fn remove_placeholders(&mut self)

Source

pub fn any_displayed(&self) -> bool

Source

pub fn get_top_item(&self) -> usize

Find the top-most of the currently visible items.

Source

pub fn get_item_at_y(&self, y: f32) -> Option<VisibleItemIndex>

Find the item at a given y-location.

Source

pub fn scroll_to_item(&mut self, idx: usize)

Source

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.

Source

pub fn next_displayed_item_ref(&mut self) -> DisplayedItemRef

Source

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.

Source

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.

Source

pub fn get_displayed_item_index( &self, item_ref: &DisplayedItemRef, ) -> Option<VisibleItemIndex>

Source

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

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for WaveData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetSetFdFlags for T

Source§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
Source§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
Source§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Pointer = u32

Source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,