Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ serde_json = "1.0"
size = "0.5.0"
evmap = "10.0.2"
nohash-hasher = "0.2.0"
tungstenite = "0.28.0"
tungstenite = "0.29.0"
assert_cmd = "2.1"
predicates = "3.1"
portpicker = "0.1.1"
Expand All @@ -86,7 +86,7 @@ regex = "1.12.2"
quick-xml = "0.37.5" # todo update to 0.39.0
bincode = "2.0.1" # todo update to bincode-next 2.0.4???
funty = "2.0.0"
ablf = "0.2.0"
ablf = "0.2.1"
afibex = "0.11.1"
asomeip = "0.9.3"
fancy-regex = "0.17.0"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/adlt/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ pub fn convert<W: std::io::Write + Send + 'static>(
let input_file_streams: Vec<StreamEntry> = input_file_streams
.into_iter()
.map(|(hashset, mut time_files)| {
time_files.sort_by(|a, b| a.0.cmp(&b.0));
time_files.sort_by_key(|a| a.0);
time_files.dedup(); // remove duplicates
(hashset, time_files)
})
Expand Down
5 changes: 3 additions & 2 deletions src/bin/adlt/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub fn remote(
.name("server".to_string())
.spawn(move || {
let log = logc;
#[allow(clippy::result_large_err)]
let callback = |req: &Request, mut response: Response| {
info!(log, "Received a new ws handshake");
info!(log, "The request's path is: {}", req.uri().path());
Expand Down Expand Up @@ -583,7 +584,7 @@ fn file_names_to_file_streams(
let input_file_streams: Vec<StreamEntry> = input_file_streams
.into_iter()
.map(|(hashset, mut time_files)| {
time_files.sort_by(|a, b| a.0.cmp(&b.0));
time_files.sort_by_key(|a| a.0);
// time_files.dedup(); // remove duplicates (not needed here)
(hashset, time_files)
})
Expand Down Expand Up @@ -1854,7 +1855,7 @@ fn process_file_context<T: Read + Write>(
fc.last_lcs_w_refresh_index = new_lcs_w_refresh_index;
if !lcs.is_empty() {
// we do send them sorted (even in case only updates are sent)
lcs.sort_unstable_by(|a, b| a.start_time.cmp(&b.start_time));
lcs.sort_unstable_by_key(|a| a.start_time);
let encoded: Vec<u8> =
bincode::encode_to_vec(remote_types::BinType::Lifecycles(lcs), BINCODE_CONFIG)
.unwrap(); // todo
Expand Down
11 changes: 3 additions & 8 deletions src/filter/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,9 @@ pub fn filters_from_dlf<B: std::io::BufRead>(reader: B) -> Result<Vec<Filter>, q
found_dltfilter_start = true;
found_dltfilter_end = false;
}
b"filter" => {
if found_dltfilter_start && !found_dltfilter_end {
let filter = Filter::from_quick_xml_reader(&mut reader);
filters.push(filter?);
} else {
// we ignore those
//println!("ignoring filter as outside dltfilter!");
}
b"filter" if found_dltfilter_start && !found_dltfilter_end => {
let filter = Filter::from_quick_xml_reader(&mut reader);
filters.push(filter?);
}
_ => {
// println!("ignoring start '{:?}'", e.local_name())
Expand Down
120 changes: 56 additions & 64 deletions src/plugins/can.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,14 @@ impl Plugin for CanPlugin {
let mut args = msg.into_iter();
let message_id_arg = args.next();
let message_id = match message_id_arg {
Some(a) => {
if a.payload_raw.len() == 4 {
if a.is_big_endian {
u32::from_be_bytes(a.payload_raw.get(0..4).unwrap().try_into().unwrap())
} else {
u32::from_le_bytes(a.payload_raw.get(0..4).unwrap().try_into().unwrap())
}
Some(a) if a.payload_raw.len() == 4 => {
if a.is_big_endian {
u32::from_be_bytes(a.payload_raw.get(0..4).unwrap().try_into().unwrap())
} else {
0
u32::from_le_bytes(a.payload_raw.get(0..4).unwrap().try_into().unwrap())
}
}
None => 0,
_ => 0,
};
if message_id == SERVICE_ID_GET_LOG_INFO {
let payload_arg = args.next();
Expand Down Expand Up @@ -480,7 +476,7 @@ fn md_for_compu_methods(compu_methods: &Vec<CompuMethod>) -> String {
})
.map(|cs| (cs.mask.unwrap(), &cs.lower_limit.as_ref().unwrap().0, cs))
.collect::<Vec<_>>();
masks.sort_by(|a, b| a.0.cmp(&b.0));
masks.sort_by_key(|a| a.0);
let def_v = XsDouble::I64(0);
r += &masks
.iter()
Expand Down Expand Up @@ -549,61 +545,57 @@ fn js_for_compu_methods(compu_methods: &Vec<CompuMethod>) -> String {
let mut closing_str = String::with_capacity(2);
for cm in compu_methods {
match cm.category {
CompuCategory::TextTable => {
if r.len() == initial_r_len {
// we support only either a TextTable or Bitfield
r += "new Map(["; // texttable uses a Map
closing_str += "])";
r += &cm
.internal_to_phys_scales
.iter()
.filter(|cs| cs.get_single_value().is_some() && cs.compu_const.is_some())
.map(|cs| {
format!(
"[{},{:?}]",
cs.get_single_value().unwrap(),
if let Some(afibex::fibex::VvT::VT(en)) = &cs.compu_const {
en // todo needs escaping of "!
} else {
""
}
)
})
.collect::<Vec<_>>()
.join(",");
}
CompuCategory::TextTable if r.len() == initial_r_len => {
// we support only either a TextTable or Bitfield
r += "new Map(["; // texttable uses a Map
closing_str += "])";
r += &cm
.internal_to_phys_scales
.iter()
.filter(|cs| cs.get_single_value().is_some() && cs.compu_const.is_some())
.map(|cs| {
format!(
"[{},{:?}]",
cs.get_single_value().unwrap(),
if let Some(afibex::fibex::VvT::VT(en)) = &cs.compu_const {
en // todo needs escaping of "!
} else {
""
}
)
})
.collect::<Vec<_>>()
.join(",");
}
CompuCategory::BitfieldTextTable => {
if r.len() == initial_r_len {
// we encode the bitfields as an array or tuple(array) with mask/value/text
r += "[";
r += &cm
.internal_to_phys_scales
.iter()
.filter(|cs| {
cs.get_single_value().is_some()
&& cs.mask.is_some()
&& cs.compu_const.is_some()
&& cs.get_single_value().unwrap() != &XsDouble::I64(0)
})
.map(|cs| {
let v = cs.get_single_value().unwrap();
let mask = cs.mask.unwrap();
format!(
"[{},{},{:?}]",
mask,
v,
if let Some(afibex::fibex::VvT::VT(en)) = &cs.compu_const {
en // todo needs escaping of "!
} else {
""
}
)
})
.collect::<Vec<_>>()
.join(",");
closing_str += "]";
}
CompuCategory::BitfieldTextTable if r.len() == initial_r_len => {
// we encode the bitfields as an array or tuple(array) with mask/value/text
r += "[";
r += &cm
.internal_to_phys_scales
.iter()
.filter(|cs| {
cs.get_single_value().is_some()
&& cs.mask.is_some()
&& cs.compu_const.is_some()
&& cs.get_single_value().unwrap() != &XsDouble::I64(0)
})
.map(|cs| {
let v = cs.get_single_value().unwrap();
let mask = cs.mask.unwrap();
format!(
"[{},{},{:?}]",
mask,
v,
if let Some(afibex::fibex::VvT::VT(en)) = &cs.compu_const {
en // todo needs escaping of "!
} else {
""
}
)
})
.collect::<Vec<_>>()
.join(",");
closing_str += "]";
}
_ => {}
}
Expand Down
Loading
Loading