Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions application/apps/indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ thiserror = "2.0"
lazy_static = "1.5"
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
dlt-core = "0.20"
#dlt-core = "0.20.2"
dlt-core = { git = "https://github.com/kruss/dlt-core.git", branch = "fix_fibex_non_verbose_args" }
crossbeam-channel = "0.5"
futures = "0.3"
tokio-util = "0.7"
Expand Down Expand Up @@ -83,7 +84,7 @@ egui = "0.33"
eframe = { version = "0.33", default-features = false }
rfd = "0.17"
egui_extras = { version = "0.33", default-features = false }
egui_table = "0.6"
egui_table = "0.7"
egui_plot = "0.34"
# We don't have direct dependency to winit but we need to specify it here to activate
# its default features which won't be activated otherwise without activating egui default
Expand All @@ -99,6 +100,10 @@ criterion = { version = "0.5", features = ["html_reports"] }
insta = { version = "1.41", features = ["yaml"] }
proptest = "1.6"

[patch.crates-io]
# This is needed until corresponding PR is merged. Link: https://github.com/rerun-io/egui_table/pull/47
egui_table = { git = "https://github.com/AmmarAbouZor/egui_table.git", rev = "348d5fa8b44f6070fd7f311211a93ebc44473851" }

[workspace.lints.clippy]
undocumented_unsafe_blocks = "deny"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ pub enum SessionMessage {

/// Source has been added to session.
SourceAdded { observe_op: Box<ObserveOperation> },

/// Triggered when a file is opened within the session.
/// Although `chipmunk` continues to monitor the file for changes,
/// this event is triggered upon the completion of file reading.
/// This event is not triggered for streams within a session.
FileReadCompleted,
}
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ impl SessionService {
})
.await;
}
CallbackEvent::FileRead => {
self.senders
.send_session_msg(SessionMessage::FileReadCompleted)
.await;
}
event => {
println!("************** DEBUG: Received unhandled callback: {event:?}");
log::warn!("Unhandled callback: {event}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use egui::{Color32, Sense, TextBuffer, Ui};
use egui_table::{CellInfo, Column, HeaderCellInfo, PrefetchInfo, TableDelegate};
use processor::grabber::LineRange;
use std::sync::mpsc::Receiver as StdReceiver;
use stypes::GrabbedElement;
use stypes::{GrabbedElement, ObserveOrigin};
use tokio::sync::mpsc::Sender;

use crate::{
Expand Down Expand Up @@ -53,11 +53,27 @@ impl LogsTable {
actions: &mut UiActions,
ui: &mut Ui,
) {
let stick_to_bottom =
shared
.observe
.operations()
.first()
.is_some_and(|op| match &op.origin {
ObserveOrigin::File(..) => {
// Enable stick to bottom for files only when they reach tailing phase
// after reading the already existed data in that file.
op.phase().is_running() && shared.observe.is_file_read_completed()
}
ObserveOrigin::Concat(..) => false,
ObserveOrigin::Stream(..) => true,
});

let mut table = egui_table::Table::new()
.id_salt("logs_table")
.num_rows(shared.logs.logs_count)
.columns(self.columns.as_ref())
.num_sticky_cols(1);
.num_sticky_cols(1)
.stick_to_bottom(stick_to_bottom);

if !self.schema.has_headers() {
table = table.headers(Vec::new());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ impl Session {
}
// Potential components which keep track for operations can go here.
}
SessionMessage::FileReadCompleted => self.shared.observe.set_file_read_completed(),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ use crate::{
pub struct ObserveState {
sources_count: usize,
operations: Vec<ObserveOperation>,
/// Indicates if the initial file reading process has completed.
/// This is only relevant for file sources.
file_read_completed: bool,
}

impl ObserveState {
pub fn new(observe_op: ObserveOperation) -> Self {
let mut state = Self {
sources_count: 0,
operations: Vec::with_capacity(1),
file_read_completed: false,
};
state.add_operation(observe_op);

Expand All @@ -35,6 +39,7 @@ impl ObserveState {
let Self {
sources_count,
operations,
file_read_completed: _,
} = self;

operations.push(observe_op);
Expand Down Expand Up @@ -73,4 +78,14 @@ impl ObserveState {
pub fn is_initial_loading(&self) -> bool {
self.operations.iter().all(ObserveOperation::initializing)
}

/// Mark the initial file reading as completed.
pub fn set_file_read_completed(&mut self) {
self.file_read_completed = true
}

/// Check if the initial file reading has completed.
pub fn is_file_read_completed(&self) -> bool {
self.file_read_completed
}
}
5 changes: 3 additions & 2 deletions application/apps/indexer/parsers/src/dlt/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ impl FormattableMessage<'_> {
Ok(())
}

fn info_from_metadata<'b>(&'b self, id: u32, data: &[u8]) -> Option<NonVerboseInfo<'b>> {
fn info_from_metadata<'b>(&'b self, id: u32, mut data: &[u8]) -> Option<NonVerboseInfo<'b>> {
let fibex = self.fibex_dlt_metadata?;
let md = extract_metadata(fibex, id, self.message.extended_header.as_ref())?;
let msg_type: Option<MessageType> = message_type(&self.message, md.message_info.as_deref());
Expand Down Expand Up @@ -525,10 +525,11 @@ impl FormattableMessage<'_> {
};
arguments.push(arg);
} else {
if let Ok(mut new_args) =
if let Ok((rest, mut new_args)) =
construct_arguments(self.message.header.endianness, &pdu.signal_types, data)
{
arguments.append(&mut new_args);
data = rest;
}
trace!("Constructed {} arguments", arguments.len());
};
Expand Down
5 changes: 3 additions & 2 deletions plugins/examples/rust/dlt_parser/src/dlt/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl FormattableMessage<'_> {
}
}

fn info_from_metadata<'b>(&'b self, id: u32, data: &[u8]) -> Option<NonVerboseInfo<'b>> {
fn info_from_metadata<'b>(&'b self, id: u32, mut data: &[u8]) -> Option<NonVerboseInfo<'b>> {
let fibex = self.fibex_dlt_metadata?;
let md = extract_metadata(fibex, id, self.message.extended_header.as_ref())?;
let msg_type: Option<MessageType> = message_type(&self.message, md.message_info.as_deref());
Expand Down Expand Up @@ -292,10 +292,11 @@ impl FormattableMessage<'_> {
};
arguments.push(arg);
} else {
if let Ok(mut new_args) =
if let Ok((rest, mut new_args)) =
construct_arguments(self.message.header.endianness, &pdu.signal_types, data)
{
arguments.append(&mut new_args);
data = rest;
}
trace!("Constructed {} arguments", arguments.len());
};
Expand Down