Skip to content

Commit

Permalink
Merge pull request #41 from arkedge/tlmcmddb-model-v3
Browse files Browse the repository at this point in the history
モデルにDisplayInfoを追加する
  • Loading branch information
kobkaz authored Jan 15, 2024
2 parents 25edae5 + 163cfb0 commit 69ba71c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions tlmcmddb-csv/src/tlm/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ impl TryFrom<Line> for model::Field {
extraction_info,
conversion_info: conversion_info.try_into()?,
description: unescape(&line.description),
display_info: Default::default(),
note: unescape(&line.note),
})
}
Expand Down
15 changes: 15 additions & 0 deletions tlmcmddb/src/tlm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
/// このフィールドの説明(衛星開発者向け)
Expand Down Expand Up @@ -199,6 +202,18 @@ 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,
}

/// コメント行
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Comment {
Expand Down

0 comments on commit 69ba71c

Please sign in to comment.