Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSL側で使うバージョン #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 2 additions & 12 deletions GenerateC2ACode.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,8 @@
import my_mod.tlm_def
import my_mod.tlm_buffer


# import pprint
# import os.path
# import msvcrt # Enter不要な入力用
# import subprocess


# 環境変数
DEBUG = 0
# 0 : Release
# 1 : all
SETTING_FILE_PATH = "settings.json"
# 必要に応じてここを変える
SETTING_FILE_PATH = "../tlm_cmd_gen_config.json"


def main():
Expand Down
20 changes: 20 additions & 0 deletions my_mod/tlm_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
# from collections import OrderedDict
# import pprint

INVALID_START_CHARS = [
str(0),
str(1),
str(2),
str(3),
str(4),
str(5),
str(6),
str(7),
str(8),
str(9),
]


def GenerateTlmBuffer(settings, other_obc_dbs):
DATA_START_ROW = 8
Expand Down Expand Up @@ -259,6 +272,9 @@ def GenerateTlmBuffer(settings, other_obc_dbs):

# name_tree = name.lower().split(".")[2:] # OBC名.テレメ名.HOGE.FUGA を想定
name_tree = name.lower().split(".")
for idx, item in enumerate(name_tree):
if item[0] in INVALID_START_CHARS:
name_tree[idx] = "_" + item
name_path = ".".join(name_tree)
var_name = driver_name + "->tlm_data." + tlm_name_lower + "." + name_path
if is_compression:
Expand Down Expand Up @@ -493,13 +509,17 @@ def _(dict, path_list, val, sep):
return 1 # err
if len(path_list) == 1:
key = path_list[0]
if key[0] in INVALID_START_CHARS:
key = "_" + key
if key in dict:
return 1 # 上書きエラー
else:
dict[key] = val
return 0
else:
key = path_list[0]
if key[0] in INVALID_START_CHARS:
key = "_" + key
if key not in dict:
dict[key] = {}
return _(dict[key], path_list[1:], val, sep)
Expand Down
40 changes: 0 additions & 40 deletions settings.json

This file was deleted.