From 2153aa28420b813fe91b28a4aecf771ade6dd69f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Jul 2023 11:30:43 +0200 Subject: [PATCH 1/4] prep v5.2.0 --- CHANGELOG.md | 2 ++ eive_tmtc/__init__.py | 4 ++-- eive_tmtc/pus_tc/system/proc.py | 1 - eive_tmtc/pus_tm/tm_tcp_server.py | 3 --- eive_tmtc/tmtc/acs/gyros.py | 2 +- eive_tmtc/tmtc/acs/mgms.py | 2 +- eive_tmtc/tmtc/acs/reaction_wheels.py | 1 - eive_tmtc/tmtc/payload/ploc_supervisor.py | 1 - eive_tmtc/tmtc/tcs/tm.py | 2 +- 9 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df9fb14..b0e5d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ list yields a list of all related PRs for each release. # [unreleased] +# [v5.2.0] 2023-07-13 + ## Added - New TCS controller events diff --git a/eive_tmtc/__init__.py b/eive_tmtc/__init__.py index 4682dd5..c6c2029 100644 --- a/eive_tmtc/__init__.py +++ b/eive_tmtc/__init__.py @@ -1,11 +1,11 @@ -__version__ = "5.1.0" +__version__ = "5.2.0" import logging from pathlib import Path SW_NAME = "eive-tmtc" VERSION_MAJOR = 5 -VERSION_MINOR = 1 +VERSION_MINOR = 2 VERSION_REVISION = 0 EIVE_TMTC_ROOT = Path(__file__).parent diff --git a/eive_tmtc/pus_tc/system/proc.py b/eive_tmtc/pus_tc/system/proc.py index 54ab761..8a80b1c 100644 --- a/eive_tmtc/pus_tc/system/proc.py +++ b/eive_tmtc/pus_tc/system/proc.py @@ -765,7 +765,6 @@ def gen_disable_listen_to_hk_for_x_seconds( def activate_mgts_alternately( q: DefaultPusQueueHelper, ): - q.add_pus_tc( pack_dipole_command( object_id=oids.IMTQ_HANDLER_ID, diff --git a/eive_tmtc/pus_tm/tm_tcp_server.py b/eive_tmtc/pus_tm/tm_tcp_server.py index 2d9b7d8..facc4f8 100644 --- a/eive_tmtc/pus_tm/tm_tcp_server.py +++ b/eive_tmtc/pus_tm/tm_tcp_server.py @@ -12,7 +12,6 @@ _LOGGER = logging.getLogger(__name__) class TmTcpServer: def __init__(self, ip_address: str, port: int): - self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.server_socket.bind((ip_address, port)) @@ -46,7 +45,6 @@ class TmTcpServer: self.client_connection.setblocking(False) print("Client connected") except IOError: - return data_json_bytes = json.dumps(dictionary).encode() @@ -65,7 +63,6 @@ class TmTcpServer: self.client_connection = None def report_raw_hk_data(self, object_id: ObjectIdU32, set_id: int, hk_data: bytes): - data_dict = { "type": "TM", "tmType": "Raw HK", diff --git a/eive_tmtc/tmtc/acs/gyros.py b/eive_tmtc/tmtc/acs/gyros.py index a713516..e9c6c6f 100644 --- a/eive_tmtc/tmtc/acs/gyros.py +++ b/eive_tmtc/tmtc/acs/gyros.py @@ -61,7 +61,7 @@ GYR_SEL_DICT = { def handle_gyr_cmd(q: DefaultPusQueueHelper, op_code: str): print("Please select the Gyro Device") - for (k, v) in GYR_SEL_DICT.items(): + for k, v in GYR_SEL_DICT.items(): print(f"{k}: {v[0]}") sel_idx = int(input("Select gyro device by index: ")) gyr_info = GYR_SEL_DICT[GyrSel(sel_idx)] diff --git a/eive_tmtc/tmtc/acs/mgms.py b/eive_tmtc/tmtc/acs/mgms.py index dbe633c..3450ef9 100644 --- a/eive_tmtc/tmtc/acs/mgms.py +++ b/eive_tmtc/tmtc/acs/mgms.py @@ -49,7 +49,7 @@ MGM_SEL_DICT = { def handle_mgm_cmd(q: DefaultPusQueueHelper, op_code: str): print("Please select the MGM Device") - for (k, v) in MGM_SEL_DICT.items(): + for k, v in MGM_SEL_DICT.items(): print(f"{k}: {v[0]}") sel_idx = int(input("Select MGM device by index: ")) mgm_info = MGM_SEL_DICT[MgmSel(sel_idx)] diff --git a/eive_tmtc/tmtc/acs/reaction_wheels.py b/eive_tmtc/tmtc/acs/reaction_wheels.py index 52cfaf4..0950627 100644 --- a/eive_tmtc/tmtc/acs/reaction_wheels.py +++ b/eive_tmtc/tmtc/acs/reaction_wheels.py @@ -290,7 +290,6 @@ def pack_set_speed_command( def handle_rw_hk_data( pw: PrintWrapper, object_id: ObjectIdU32, set_id: int, hk_data: bytes ): - current_idx = 0 if set_id == RwSetId.STATUS_SET_ID: pw.dlog( diff --git a/eive_tmtc/tmtc/payload/ploc_supervisor.py b/eive_tmtc/tmtc/payload/ploc_supervisor.py index ac17aef..b696ecf 100644 --- a/eive_tmtc/tmtc/payload/ploc_supervisor.py +++ b/eive_tmtc/tmtc/payload/ploc_supervisor.py @@ -172,7 +172,6 @@ class Info(str, enum.Enum): @tmtc_definitions_provider def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper): - oce = OpCodeEntry() oce.add(OpCodes.OFF, Info.OFF) oce.add(OpCodes.ON, Info.ON) diff --git a/eive_tmtc/tmtc/tcs/tm.py b/eive_tmtc/tmtc/tcs/tm.py index 985969c..3d0e95e 100644 --- a/eive_tmtc/tmtc/tcs/tm.py +++ b/eive_tmtc/tmtc/tcs/tm.py @@ -54,7 +54,7 @@ class TcsCtrlComponentInfo: end_time: datetime.datetime -def handle_thermal_controller_hk_data( +def handle_thermal_controller_hk_data( # noqa C901: complexity is okay. object_id: ObjectIdU32, pw: PrintWrapper, set_id: int, hk_data: bytes ): # need a better solutuon for this is this is used again.. From 2fd1a46e66b4dc8b0bbe3f031596e7bb44162e24 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Jul 2023 11:46:38 +0200 Subject: [PATCH 2/4] bump tmtccmd to v5.0.0 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a93048c..e3d3429 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,9 +29,9 @@ classifiers = [ "Topic :: Scientific/Engineering" ] dependencies = [ - # "tmtccmd ~= 5.0.0rc0", + "tmtccmd ~= 5.0", "python-dateutil ~= 2.8", - "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@1b110d321ef85#egg=tmtccmd" + # "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@1b110d321ef85#egg=tmtccmd" ] [project.urls] From df6aa80169dfad6c32ab4762dbefa069ab52f241 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Jul 2023 11:47:47 +0200 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0e5d68..42de761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ list yields a list of all related PRs for each release. # [v5.2.0] 2023-07-13 +- `tmtccmd` v5.0.0 + ## Added - New TCS controller events From 62bd5356220bab1ce9f3ddaa7aaf75963b8bd596 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Jul 2023 14:49:03 +0200 Subject: [PATCH 4/4] time conversion bugfix --- eive_tmtc/tmtc/acs/star_tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eive_tmtc/tmtc/acs/star_tracker.py b/eive_tmtc/tmtc/acs/star_tracker.py index b45738d..c05f0bf 100644 --- a/eive_tmtc/tmtc/acs/star_tracker.py +++ b/eive_tmtc/tmtc/acs/star_tracker.py @@ -724,7 +724,7 @@ def unpack_time_hk(hk_data: bytes, current_idx: int, pw: PrintWrapper) -> int: ticks_time_fmt, hk_data[current_idx : current_idx + fmt_len] ) unix_as_dt = datetime.datetime.fromtimestamp( - int(round(unix_time / 10e6)), tz=datetime.timezone.utc + int(round(unix_time / 1e6)), tz=datetime.timezone.utc ) pw.dlog(f"Ticks: {ticks} | UNIX time: {unix_time}") pw.dlog(f"UNIX as datetime: {unix_as_dt}")