Merge pull request 'Prepare v5.5.0' (#235) from prep_next_release into main
All checks were successful
EIVE/-/pipeline/head This commit looks good

Reviewed-on: #235
This commit is contained in:
Robin Müller 2023-09-12 13:06:18 +02:00
commit d23cc6834a
6 changed files with 79 additions and 61 deletions

View File

@ -10,6 +10,12 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
# [v5.5.0] 2023-09-12
- Version is not specfied dynamically anymore and can be updated in `pyproject.toml`
- New events and returnvalues
- Bump `tmtccmd` to v6.0.0rc0
# [v5.4.3] 2023-08-15 # [v5.4.3] 2023-08-15
## Added ## Added

View File

@ -1,13 +1,6 @@
__version__ = "5.4.3"
import logging import logging
from pathlib import Path from pathlib import Path
SW_NAME = "eive-tmtc"
VERSION_MAJOR = 5
VERSION_MINOR = 4
VERSION_REVISION = 3
EIVE_TMTC_ROOT = Path(__file__).parent EIVE_TMTC_ROOT = Path(__file__).parent
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent PACKAGE_ROOT = EIVE_TMTC_ROOT.parent

View File

@ -72,7 +72,9 @@ def add_gps_cmds(defs: TmtcDefinitionWrapper):
) )
def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str): def pack_gps_command( # noqa: C901
object_id: bytes, q: DefaultPusQueueHelper, op_code: str
): # noqa: C901:
if op_code in OpCode.RESET_GNSS: if op_code in OpCode.RESET_GNSS:
# TODO: This needs to be re-implemented # TODO: This needs to be re-implemented
_LOGGER.warning("Reset pin handling needs to be re-implemented") _LOGGER.warning("Reset pin handling needs to be re-implemented")
@ -82,34 +84,52 @@ def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
raise ValueError("invalid interval") raise ValueError("invalid interval")
q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}") q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}")
cmds = create_enable_periodic_hk_command_with_interval( cmds = create_enable_periodic_hk_command_with_interval(
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK), interval_seconds=interval diag=False,
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK),
interval_seconds=interval,
) )
for cmd in cmds: for cmd in cmds:
q.add_pus_tc(cmd) q.add_pus_tc(cmd)
if op_code in OpCode.DISABLE_CORE_HK: if op_code in OpCode.DISABLE_CORE_HK:
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}") q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
q.add_pus_tc(create_disable_periodic_hk_command(diag=False, sid=make_sid(object_id=object_id, q.add_pus_tc(
set_id=SetId.CORE_HK))) create_disable_periodic_hk_command(
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)
)
)
if op_code in OpCode.REQ_CORE_HK: if op_code in OpCode.REQ_CORE_HK:
q.add_log_cmd(f"GPS: {Info.REQ_CORE_HK}") q.add_log_cmd(f"GPS: {Info.REQ_CORE_HK}")
q.add_pus_tc(create_request_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK))) q.add_pus_tc(
create_request_one_hk_command(
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)
)
)
if op_code in OpCode.ENABLE_SKYVIEW_HK: if op_code in OpCode.ENABLE_SKYVIEW_HK:
interval = float(input("Please specify interval in floating point seconds: ")) interval = float(input("Please specify interval in floating point seconds: "))
if interval <= 0: if interval <= 0:
raise ValueError("invalid interval") raise ValueError("invalid interval")
q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}") q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}")
cmds = create_enable_periodic_hk_command_with_interval( cmds = create_enable_periodic_hk_command_with_interval(
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK), interval_seconds=interval diag=False,
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK),
interval_seconds=interval,
) )
for cmd in cmds: for cmd in cmds:
q.add_pus_tc(cmd) q.add_pus_tc(cmd)
if op_code in OpCode.DISABLE_SKYVIEW_HK: if op_code in OpCode.DISABLE_SKYVIEW_HK:
q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}") q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}")
q.add_pus_tc(create_disable_periodic_hk_command(diag=False, sid=make_sid(object_id=object_id, q.add_pus_tc(
set_id=SetId.SKYVIEW_HK))) create_disable_periodic_hk_command(
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
)
)
if op_code in OpCode.REQ_SKYVIEW_HK: if op_code in OpCode.REQ_SKYVIEW_HK:
q.add_log_cmd(f"GPS: {Info.REQ_SKYVIEW_HK}") q.add_log_cmd(f"GPS: {Info.REQ_SKYVIEW_HK}")
q.add_pus_tc(create_request_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK))) q.add_pus_tc(
create_request_one_hk_command(
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
)
)
if op_code in OpCode.ON: if op_code in OpCode.ON:
q.add_log_cmd(f"GPS: {Info.ON}") q.add_log_cmd(f"GPS: {Info.ON}")
q.add_pus_tc(create_mode_command(object_id, Mode.ON, 0)) q.add_pus_tc(create_mode_command(object_id, Mode.ON, 0))
@ -133,7 +153,7 @@ def handle_gps_data(
def handle_core_data(pw: PrintWrapper, hk_data: bytes): def handle_core_data(pw: PrintWrapper, hk_data: bytes):
if len(hk_data) < 4*8+4+2+8: if len(hk_data) < 4 * 8 + 4 + 2 + 8:
pw.dlog( pw.dlog(
f"GPS Core dataset with size {len(hk_data)} does not have expected size" f"GPS Core dataset with size {len(hk_data)} does not have expected size"
f" of {4*8+4+2+8} bytes" f" of {4*8+4+2+8} bytes"
@ -179,7 +199,7 @@ def handle_core_data(pw: PrintWrapper, hk_data: bytes):
def handle_skyview_data(pw: PrintWrapper, hk_data: bytes): def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
data_length = 8+GpsInfo.MAX_SATELLITES*(8+3*2+1) data_length = 8 + GpsInfo.MAX_SATELLITES * (8 + 3 * 2 + 1)
if len(hk_data) < data_length: if len(hk_data) < data_length:
pw.dlog( pw.dlog(
f"GPS Skyview dataset with size {len(hk_data)} does not have expected size" f"GPS Skyview dataset with size {len(hk_data)} does not have expected size"
@ -195,24 +215,46 @@ def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
inc_len_int16 = struct.calcsize(fmt_str_int16) inc_len_int16 = struct.calcsize(fmt_str_int16)
inc_len_double = struct.calcsize(fmt_str_double) inc_len_double = struct.calcsize(fmt_str_double)
inc_len_uint8 = struct.calcsize(fmt_str_uint8) inc_len_uint8 = struct.calcsize(fmt_str_uint8)
unix = struct.unpack(fmt_str_unix, hk_data[current_idx: current_idx + inc_len_unix])[0] unix = struct.unpack(
fmt_str_unix, hk_data[current_idx : current_idx + inc_len_unix]
)[0]
current_idx += inc_len_unix current_idx += inc_len_unix
prn_id = struct.unpack(fmt_str_int16, hk_data[current_idx: current_idx + inc_len_int16]) prn_id = struct.unpack(
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
)
current_idx += inc_len_int16 current_idx += inc_len_int16
azimuth = struct.unpack(fmt_str_int16, hk_data[current_idx: current_idx + inc_len_int16]) azimuth = struct.unpack(
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
)
current_idx += inc_len_int16 current_idx += inc_len_int16
elevation = struct.unpack(fmt_str_int16, hk_data[current_idx: current_idx + inc_len_int16]) elevation = struct.unpack(
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
)
current_idx += inc_len_int16 current_idx += inc_len_int16
signal_to_noise = struct.unpack(fmt_str_double, hk_data[current_idx: current_idx + inc_len_double]) signal_to_noise = struct.unpack(
fmt_str_double, hk_data[current_idx : current_idx + inc_len_double]
)
current_idx += inc_len_double current_idx += inc_len_double
used = struct.unpack(fmt_str_uint8, hk_data[current_idx: current_idx + inc_len_uint8]) used = struct.unpack(
fmt_str_uint8, hk_data[current_idx : current_idx + inc_len_uint8]
)
current_idx += inc_len_uint8 current_idx += inc_len_uint8
pw.dlog(f"Skyview Time: {unix} unix-sec") pw.dlog(f"Skyview Time: {unix} unix-sec")
pw.dlog("{:<8} {:<8} {:<8} {:<8} {:<8}".format('PRN_ID', 'AZ [°]', 'EL [°]', 'S2N [dBW]', 'USED')) pw.dlog(
"{:<8} {:<8} {:<8} {:<8} {:<8}".format(
"PRN_ID", "AZ [°]", "EL [°]", "S2N [dBW]", "USED"
)
)
for idx in range(GpsInfo.MAX_SATELLITES): for idx in range(GpsInfo.MAX_SATELLITES):
pw.dlog("{:<8} {:<8} {:<8} {:<8} {:<8}".format(prn_id[idx], azimuth[idx], elevation[idx], signal_to_noise[idx], pw.dlog(
used[idx])) "{:<8} {:<8} {:<8} {:<8} {:<8}".format(
prn_id[idx],
azimuth[idx],
elevation[idx],
signal_to_noise[idx],
used[idx],
)
)
FsfwTmTcPrinter.get_validity_buffer( FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=6 validity_buffer=hk_data[current_idx:], num_vars=6
) )

View File

@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "eive-tmtc" name = "eive-tmtc"
description = "TMTC Commander EIVE" description = "TMTC Commander EIVE"
readme = "README.md" readme = "README.md"
dynamic = ["version"] version = "5.5.0"
requires-python = ">=3.10" requires-python = ">=3.10"
license = {text = "Apache-2.0"} license = {text = "Apache-2.0"}
authors = [ authors = [
@ -29,9 +29,8 @@ classifiers = [
"Topic :: Scientific/Engineering" "Topic :: Scientific/Engineering"
] ]
dependencies = [ dependencies = [
"tmtccmd ~= 5.0", "tmtccmd == 6.0.0rc0",
"python-dateutil ~= 2.8", "python-dateutil ~= 2.8",
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@1b110d321ef85#egg=tmtccmd"
] ]
[project.urls] [project.urls]
@ -40,9 +39,6 @@ dependencies = [
[tool.setuptools] [tool.setuptools]
include-package-data = true include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "eive_tmtc.__version__"}
# Auto-Discovery is problematic for some reason, so use custom-discovery # Auto-Discovery is problematic for some reason, so use custom-discovery
[tool.setuptools.packages] [tool.setuptools.packages]
find = {} find = {}

View File

@ -3,7 +3,7 @@ Checklist for new releases
# Pre-Release # Pre-Release
1. Bump version inside the `eive_tmtc/__init__.py` file. 1. Bump version inside the `pyproject.toml` file.
2. Update `CHANGELOG.md`: Convert `unreleased` section into version section 2. Update `CHANGELOG.md`: Convert `unreleased` section into version section
with date and new `unreleased`section. with date and new `unreleased`section.
3. Run auto-formatter with `black .` 3. Run auto-formatter with `black .`

View File

@ -2,10 +2,11 @@
import logging import logging
import sys import sys
import time import time
import traceback
from pathlib import Path from pathlib import Path
from typing import cast from typing import cast
from spacepackets.ecss import PusVerificator
from spacepackets.version import get_version as get_sp_version
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
from spacepackets.cfdp import ( from spacepackets.cfdp import (
ConditionCode, ConditionCode,
@ -16,6 +17,8 @@ from spacepackets.cfdp import (
PduFactory, PduFactory,
PduType, PduType,
) )
import tmtccmd
from tmtccmd.logging import add_colorlog_console_logger from tmtccmd.logging import add_colorlog_console_logger
from tmtccmd.cfdp import CfdpUserBase, TransactionId from tmtccmd.cfdp import CfdpUserBase, TransactionId
from tmtccmd.cfdp.defs import CfdpRequestType from tmtccmd.cfdp.defs import CfdpRequestType
@ -32,28 +35,6 @@ from tmtccmd.cfdp.user import (
FileSegmentRecvdParams, FileSegmentRecvdParams,
) )
from tmtccmd.tc.handler import SendCbParams from tmtccmd.tc.handler import SendCbParams
try:
import spacepackets
except ImportError as error:
print(error)
print("Python spacepackets module could not be imported")
print(
'Install with "cd spacepackets && python3 -m pip intall -e ." for interative installation'
)
sys.exit(1)
try:
import tmtccmd
except ImportError:
run_tmtc_commander = None
initialize_tmtc_commander = None
tb = traceback.format_exc()
print(tb)
print("Python tmtccmd submodule could not be imported")
sys.exit(1)
from spacepackets.ecss import PusVerificator
from tmtccmd import TcHandlerBase, BackendBase from tmtccmd import TcHandlerBase, BackendBase
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
@ -86,7 +67,7 @@ from tmtccmd.config.args import (
ProcedureParamsWrapper, ProcedureParamsWrapper,
) )
from eive_tmtc import APP_LOGGER from eive_tmtc import APP_LOGGER
from eive_tmtc import __version__ from importlib.metadata import version
from eive_tmtc.config.definitions import ( from eive_tmtc.config.definitions import (
PUS_APID, PUS_APID,
CFDP_APID, CFDP_APID,
@ -449,8 +430,8 @@ def setup_backend(
def main(): # noqa C901: Complexity okay here. def main(): # noqa C901: Complexity okay here.
print(f"-- eive tmtc v{__version__} --") print(f"-- eive tmtc v{version('eive-tmtc')} --")
print(f"-- spacepackets v{spacepackets.__version__} --") print(f"-- spacepackets v{get_sp_version()} --")
add_colorlog_console_logger(_LOGGER) add_colorlog_console_logger(_LOGGER)
# TODO: -V CLI argument to enable this? # TODO: -V CLI argument to enable this?
_LOGGER.setLevel(_LOG_LEVEL) _LOGGER.setLevel(_LOG_LEVEL)