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

GENERATE_TLM の依存を排除し,TG_GENERATE_MS_TLM を用いるようにする #34

Merged
merged 2 commits into from
May 24, 2023
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
6 changes: 3 additions & 3 deletions example/sample_test_initial_tl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_initial_tl():
assert ret == "SUC"

tlm_BL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_BL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_BL
)
assert tlm_BL["BL.CMD0_ID"] == c2a_enum.Cmd_CODE_BCT_ROTATE_BLOCK
assert tlm_BL["BL.CMD0_TI"] == 0
Expand All @@ -39,7 +39,7 @@ def test_add_bc():
)
assert ret == "SUC"
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.OBC_BCT_BLK_PTR"] == 300
assert tlm_HK["HK.OBC_BCT_CMD_PTR"] == 0
Expand All @@ -52,7 +52,7 @@ def test_add_bc():
c2a_enum.Tlm_CODE_HK,
)
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.OBC_BCT_BLK_PTR"] == 300
assert tlm_HK["HK.OBC_BCT_CMD_PTR"] == 1
Expand Down
6 changes: 4 additions & 2 deletions isslwings/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
from .operation import Operation


def generate_and_receive_tlm(ope: Operation, cmd_code_generate_tlm: int, tlm_code: int) -> dict:
def generate_and_receive_tlm(
ope: Operation, cmd_code_tg_generate_ms_tlm: int, tlm_code: int
) -> dict:
_, received_time_prev = ope.get_latest_tlm(tlm_code)

ope.send_rt_cmd(cmd_code_generate_tlm, (0x40, tlm_code, 1))
ope.send_rt_cmd(cmd_code_tg_generate_ms_tlm, (tlm_code,))

for _ in range(50):
time.sleep(0.2)
Expand Down