Skip to content

Commit

Permalink
tlmcmddb-csv: parse V3
Browse files Browse the repository at this point in the history
  • Loading branch information
kobkaz committed Jan 15, 2024
1 parent c779cbd commit 52761de
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions tlmcmddb-csv/src/tlm/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ struct LineConversionInfo {
}

struct LineDisplayInfo {
label: Option<String>,
unit: Option<String>,
format: Option<String>,
label: String,
unit: String,
format: String,
}

impl TryFrom<LineConversionInfo> for model::ConversionInfo {
Expand Down Expand Up @@ -455,9 +455,9 @@ impl From<LineV2> for LineV3 {
a3: line.a3,
a4: line.a4,
a5: line.a5,
label: None,
unit: None,
format: None,
label: "".to_owned(),
unit: "".to_owned(),
format: "".to_owned(),
status: line.status,
description: line.description,
note: line.note,
Expand Down Expand Up @@ -492,9 +492,9 @@ struct LineV3 {
a4: Option<f64>,
a5: Option<f64>,
status: Option<String>,
label: Option<String>,
unit: Option<String>,
format: Option<String>,
label: String,
unit: String,
format: String,
description: String,
note: String,
}
Expand All @@ -515,9 +515,9 @@ impl LineV3 {

fn take_display_info(&mut self) -> LineDisplayInfo {
LineDisplayInfo {
label: self.label.take(),
unit: self.unit.take(),
format: self.unit.take(),
label: std::mem::take(&mut self.label),
unit: std::mem::take(&mut self.unit),
format: std::mem::take(&mut self.format),
}
}
}
Expand Down Expand Up @@ -578,7 +578,6 @@ impl TryFrom<LineV3> for model::Field {
conversion_info: conversion_info.try_into()?,
display_info: display_info.into(),
description: unescape(&line.description),
display_info: Default::default(),
note: unescape(&line.note),
})
}
Expand Down

0 comments on commit 52761de

Please sign in to comment.