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: EngineConfigWhere the engine starts and what Help says.
session: SessionThe open log, its view state and transforms.
preferences: PreferencesPer-tag display preferences; outlive logs.
message: Option<Message>The last message for the page, if any.
last_dir: PathBufThe 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
impl Viewer
Sourcepub fn new(config: EngineConfig) -> Result<Self, Error>
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.
Sourcefn remember_dir(&mut self, path: &Path)
fn remember_dir(&mut self, path: &Path)
Remembers path’s directory for the next dialog.
Sourcepub fn command(&mut self, cmd: &str, args: &Value)
pub fn command(&mut self, cmd: &str, args: &Value)
Applies one command; see the module’s table.
Sourcefn open(&mut self, path: &Path)
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.
Sourcefn load_preferences(&mut self, path: &Path)
fn load_preferences(&mut self, path: &Path)
File > Preferences > Load: replaces every entry from the file, then applies the open log’s.
Sourcefn store_preferences(&mut self, path: &Path)
fn store_preferences(&mut self, path: &Path)
File > Preferences > Store: remembers the open log’s choices, then writes every entry.
Sourcepub fn query(&mut self, name: &str, args: &Value) -> Value
pub fn query(&mut self, name: &str, args: &Value) -> Value
Answers one query; see the module’s table.
Sourcefn compass_at(&mut self, t: Option<f64>) -> Value
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.
Sourcefn envelope(&mut self, args: &Value) -> Value
fn envelope(&mut self, args: &Value) -> Value
Every drawn trace’s envelope over [t0, t1] at width columns.
Sourcepub fn view_state(&mut self) -> Value
pub fn view_state(&mut self) -> Value
The whole view state the page draws from.