From 4b08ac679aa0e8a36c53c411b7c32f082b31d4f8 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Kazuhiro Date: Fri, 12 Jan 2024 17:17:51 +0900 Subject: [PATCH 1/2] tlmcmdb: add display info --- tlmcmddb-csv/src/tlm/body.rs | 1 + tlmcmddb/src/tlm.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/tlmcmddb-csv/src/tlm/body.rs b/tlmcmddb-csv/src/tlm/body.rs index 6b33035..8e13e6a 100644 --- a/tlmcmddb-csv/src/tlm/body.rs +++ b/tlmcmddb-csv/src/tlm/body.rs @@ -413,6 +413,7 @@ impl TryFrom for model::Field { extraction_info, conversion_info: conversion_info.try_into()?, description: unescape(&line.description), + display_info: Default::default(), note: unescape(&line.note), }) } diff --git a/tlmcmddb/src/tlm.rs b/tlmcmddb/src/tlm.rs index 255b162..7a10c0c 100644 --- a/tlmcmddb/src/tlm.rs +++ b/tlmcmddb/src/tlm.rs @@ -64,6 +64,9 @@ pub struct Field { /// テレメトリのオクテット列からこのフィールドの値を抜き出す際に必要な情報 pub extraction_info: FieldExtractionInfo, pub conversion_info: ConversionInfo, + /// GS SW などでテレメトリを表示するときの情報 + #[serde(default)] + pub display_info: DisplayInfo, /// このフィールドの説明(衛星運用者向け) pub description: String, /// このフィールドの説明(衛星開発者向け) @@ -199,6 +202,13 @@ impl VariableType { } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] +pub struct DisplayInfo { + pub label: String, + pub unit: String, + pub format: String, +} + /// コメント行 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Comment { From 163cfb0328230c702402c170ace351cdbd796e45 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Kazuhiro Date: Mon, 15 Jan 2024 11:58:30 +0900 Subject: [PATCH 2/2] tlmcmddb: Add comments for display info --- tlmcmddb/src/tlm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tlmcmddb/src/tlm.rs b/tlmcmddb/src/tlm.rs index 7a10c0c..43edc41 100644 --- a/tlmcmddb/src/tlm.rs +++ b/tlmcmddb/src/tlm.rs @@ -202,10 +202,15 @@ impl VariableType { } } +/// GS SW などでテレメトリを表示するときの情報 +/// 各フィールドの具体的な解釈と利用方法は GS SW に依存する #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] pub struct DisplayInfo { + /// 表示名 pub label: String, + /// 単位 pub unit: String, + /// フォーマットの指定 pub format: String, }