Skip to main content

Viewer

Struct Viewer 

Source
pub struct Viewer {
    config: EngineConfig,
    session: Session,
    preferences: Preferences,
    message: Option<Message>,
    last_dir: PathBuf,
    compass: Vec<OrientationSample>,
}
Expand description

Everything the engine thread owns.

Fields§

§config: EngineConfig

Where the engine starts and what Help says.

§session: Session

The open log, its view state and transforms.

§preferences: Preferences

Per-tag display preferences; outlive logs.

§message: Option<Message>

The last message for the page, if any.

§last_dir: PathBuf

The directory of the last file opened or saved, where dialogs start.

§compass: Vec<OrientationSample>

The open log’s compass samples, for the compass panel; empty without one.

Implementations§

Source§

impl Viewer

Source

pub fn new(config: EngineConfig) -> Result<Self, Error>

A viewer with no log open.

§Errors

The library’s error when it cannot make a session or a preference store.

Source

fn tell(&mut self, title: &str, text: impl Into<String>)

Queues a message for the page.

Source

fn remember_dir(&mut self, path: &Path)

Remembers path’s directory for the next dialog.

Source

fn has_log(&mut self) -> bool

Whether a log is open.

Source

pub fn command(&mut self, cmd: &str, args: &Value)

Applies one command; see the module’s table.

Source

fn open(&mut self, path: &Path)

File > Load: remembers the open log’s display choices for its tag, then opens path and applies its tag’s preferences.

Source

fn load_preferences(&mut self, path: &Path)

File > Preferences > Load: replaces every entry from the file, then applies the open log’s.

Source

fn store_preferences(&mut self, path: &Path)

File > Preferences > Store: remembers the open log’s choices, then writes every entry.

Source

pub fn query(&mut self, name: &str, args: &Value) -> Value

Answers one query; see the module’s table.

Source

fn compass_at(&mut self, t: Option<f64>) -> Value

The compass panel at t (the first sample if none is given), as the Qt app’s MyCompass.qml shows it: from the sample at or after t (the last after the end), its display angles (the core’s), the declination added to the heading, and with the battery aft the heading turned 180 degrees and pitch and roll negated.

Source

fn envelope(&mut self, args: &Value) -> Value

Every drawn trace’s envelope over [t0, t1] at width columns.

Source

pub fn view_state(&mut self) -> Value

The whole view state the page draws from.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.