Skip to content

Commit 094372a

Browse files
committed
Add DLT statistics native-ui
1 parent 7a64c52 commit 094372a

9 files changed

Lines changed: 810 additions & 50 deletions

File tree

‎application/apps/indexer/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ clap = { version = "4", features = ["derive"] }
8181

8282
egui = "0.33"
8383
eframe = { version = "0.33", default-features = false }
84+
egui_extras = "0.33"
8485
rfd = {version = "0.15", default-features = false, features = [ "tokio", "xdg-portal"] }
8586
egui_table = "0.6"
8687
egui_plot = "0.34"

‎application/apps/indexer/gui/application/Cargo.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ chrono.workspace = true
3838
chrono-tz.workspace = true
3939
dirs.workspace = true
4040
serialport.workspace = true
41+
dlt-core.workspace = true
42+
lazy_static.workspace = true
43+
rustc-hash = "2.1"
4144

4245
#TODO: Replace env logger with log4rs
4346
env_logger.workspace = true
4447

4548
winit.workspace = true
4649
egui.workspace = true
50+
egui_extras.workspace = true
51+
4752
# TODO: Check which dependency is needed in the final version.
4853
# Enabling the default features provides the system title bar on ubuntu 22.04
4954
eframe = { workspace = true, default_features = false, features = [

‎application/apps/indexer/gui/application/src/host/service/mod.rs‎

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::{ops::Not, os::unix::fs::MetadataExt, path::PathBuf, thread};
22

3+
use parsers::dlt::DltFilterConfig;
34
use stypes::{
45
DltParserSettings, FileFormat, ObserveOptions, ObserveOrigin, ParserType, SomeIpParserSettings,
56
Transport,
@@ -142,7 +143,7 @@ impl HostService {
142143
FileFormat::Text => ParserConfig::Text,
143144
FileFormat::Binary => {
144145
if extension.is_some_and(|ext| ext.eq_ignore_ascii_case("dlt")) {
145-
ParserConfig::Dlt(DltParserConfig::new(true))
146+
ParserConfig::Dlt(DltParserConfig::new(true, Some(file_path.clone())))
146147
} else {
147148
return Err(HostError::InitSessionError(InitSessionError::Other(
148149
"File extension is not supported".to_owned(),
@@ -192,7 +193,7 @@ impl HostService {
192193
};
193194

194195
let parser = match parser {
195-
ParserNames::Dlt => ParserConfig::Dlt(DltParserConfig::new(false)),
196+
ParserNames::Dlt => ParserConfig::Dlt(DltParserConfig::new(false, None)),
196197
ParserNames::SomeIP => ParserConfig::SomeIP(SomeIpParserConfig::default()),
197198
ParserNames::Text => ParserConfig::Text,
198199
ParserNames::Plugins => todo!(),
@@ -241,8 +242,67 @@ impl HostService {
241242
.collect()
242243
});
243244

245+
let (app_ids, app_id_count) =
246+
if !config.dlt_tables.app_table.selected_ids.is_empty() {
247+
(
248+
Some(
249+
config
250+
.dlt_tables
251+
.app_table
252+
.selected_ids
253+
.iter()
254+
.cloned()
255+
.collect::<Vec<String>>(),
256+
),
257+
config.dlt_tables.app_table.selected_ids.len() as i64,
258+
)
259+
} else {
260+
(None, 0)
261+
};
262+
263+
let (context_ids, context_id_count) =
264+
if !config.dlt_tables.ctx_table.selected_ids.is_empty() {
265+
(
266+
Some(
267+
config
268+
.dlt_tables
269+
.ctx_table
270+
.selected_ids
271+
.iter()
272+
.cloned()
273+
.collect::<Vec<String>>(),
274+
),
275+
config.dlt_tables.ctx_table.selected_ids.len() as i64,
276+
)
277+
} else {
278+
(None, 0)
279+
};
280+
281+
let ecu_ids = if !config.dlt_tables.ecu_table.selected_ids.is_empty() {
282+
Some(
283+
config
284+
.dlt_tables
285+
.ecu_table
286+
.selected_ids
287+
.iter()
288+
.cloned()
289+
.collect::<Vec<String>>(),
290+
)
291+
} else {
292+
None
293+
};
294+
295+
let filter_config = DltFilterConfig {
296+
min_log_level: Some(config.log_level as u8),
297+
app_ids: app_ids,
298+
ecu_ids: ecu_ids,
299+
context_ids: context_ids,
300+
app_id_count: app_id_count,
301+
context_id_count: context_id_count,
302+
};
303+
244304
let dlt_config = DltParserSettings {
245-
filter_config: None,
305+
filter_config: Some(filter_config),
246306
fibex_file_paths,
247307
with_storage_header: config.with_storage_header,
248308
tz: config.timezone,

0 commit comments

Comments
 (0)