Merge branch 'main' into meier/pdec-ad-frame-param-commands

This commit is contained in:
Jakob Meier 2023-02-23 15:24:36 +01:00
commit 446e38ed57
9 changed files with 137 additions and 75 deletions

17
.flake8 Normal file
View File

@ -0,0 +1,17 @@
[flake8]
max-line-length = 100
ignore = D203, W503
per-file-ignores =
*/__init__.py: F401
exclude =
.git,
__pycache__,
docs/conf.py,
old,
build,
dist,
venv
max-complexity = 10
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,

View File

@ -10,6 +10,29 @@ list yields a list of all related PRs for each release.
# [unreleased]
# [v2.15.1] 2023-02-23
- Actually use `tmtccmd` 4.1 in requirements.
- Remove `setup.cfg` completely
# [v2.15.0] 2023-02-23
tmtccmd version v4.1.1
## Changed
- Moved to `pyproject.toml` package file
## Fixed
- Correction in `tmtccmd` dependency, added missing function
# [v2.14.0] 2023-02-22
## Changed
- Generated CSV files for PDEC handler
# [v2.13.0] 2023-02-21
tmtccmd version 4.0.0

View File

@ -1,12 +1,12 @@
__version__ = "2.13.0"
__version__ = "2.15.1"
import logging
from pathlib import Path
SW_NAME = "eive-tmtc"
VERSION_MAJOR = 2
VERSION_MINOR = 13
VERSION_REVISION = 0
VERSION_MINOR = 15
VERSION_REVISION = 1
EIVE_TMTC_ROOT = Path(__file__).parent
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent

View File

@ -87,6 +87,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;No description;mission/acsDefs.h
11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;No description;mission/acsDefs.h
11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;No description;mission/acsDefs.h
11203;0x2bc3;MEKF_INVALID_INFO;INFO;No description;mission/acsDefs.h
11204;0x2bc4;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/devices/devicedefinitions/powerDefinitions.h
@ -145,8 +147,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h
12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h
12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h
12407;0x3077;POLL_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12408;0x3078;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12407;0x3077;TOO_MANY_IRQS;MEDIUM;Too many IRQs over the time window of one second. P1: Allowed TCs;linux/ipcore/PdecHandler.h
12408;0x3078;POLL_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
87 11200 0x2bc0 SAFE_RATE_VIOLATION MEDIUM No description mission/acsDefs.h
88 11201 0x2bc1 SAFE_RATE_RECOVERY MEDIUM No description mission/acsDefs.h
89 11202 0x2bc2 MULTIPLE_RW_INVALID HIGH No description mission/acsDefs.h
90 11203 0x2bc3 MEKF_INVALID_INFO INFO No description mission/acsDefs.h
91 11204 0x2bc4 MEKF_INVALID_MODE_VIOLATION HIGH No description mission/acsDefs.h
92 11300 0x2c24 SWITCH_CMD_SENT INFO Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
93 11301 0x2c25 SWITCH_HAS_CHANGED INFO Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
94 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM No description mission/devices/devicedefinitions/powerDefinitions.h
147 12404 0x3074 BIT_LOCK_PDEC INFO Bit lock detected (data valid) linux/ipcore/PdecHandler.h
148 12405 0x3075 LOST_CARRIER_LOCK_PDEC INFO Lost carrier lock linux/ipcore/PdecHandler.h
149 12406 0x3076 LOST_BIT_LOCK_PDEC INFO Lost bit lock linux/ipcore/PdecHandler.h
150 12407 0x3077 POLL_SYSCALL_ERROR_PDEC TOO_MANY_IRQS MEDIUM No description Too many IRQs over the time window of one second. P1: Allowed TCs linux/ipcore/PdecHandler.h
151 12408 0x3078 WRITE_SYSCALL_ERROR_PDEC POLL_SYSCALL_ERROR_PDEC MEDIUM No description linux/ipcore/PdecHandler.h
152 12409 0x3079 WRITE_SYSCALL_ERROR_PDEC MEDIUM No description linux/ipcore/PdecHandler.h
153 12500 0x30d4 IMAGE_UPLOAD_FAILED LOW Image upload failed linux/devices/startracker/StrHelper.h
154 12501 0x30d5 IMAGE_DOWNLOAD_FAILED LOW Image download failed linux/devices/startracker/StrHelper.h
155 12502 0x30d6 IMAGE_UPLOAD_SUCCESSFUL LOW Uploading image to star tracker was successfulop linux/devices/startracker/StrHelper.h

View File

@ -53,9 +53,13 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x6a01;ACSSAF_SafectrlMekfInputInvalid;No description;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h
0x6b01;ACSPTG_PtgctrlMekfInputInvalid;No description;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h
0x6c01;ACSDTB_DetumbleNoSensordata;No description;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h
0x6901;ACSKAL_KalmanNoGyrMeas;No description;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6902;ACSKAL_KalmanNoModel;No description;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6903;ACSKAL_KalmanInversionFailed;No description;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6902;ACSKAL_KalmanUninitialized;No description;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6903;ACSKAL_KalmanNoGyrData;No description;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6904;ACSKAL_KalmanNoModelVectors;No description;4;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6905;ACSKAL_KalmanNoSusMgmStrData;No description;5;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6906;ACSKAL_KalmanCovarianceInversionFailed;No description;6;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6907;ACSKAL_KalmanInitialized;No description;7;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6908;ACSKAL_KalmanRunning;No description;8;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
53 0x6a01 ACSSAF_SafectrlMekfInputInvalid No description 1 ACS_SAFE mission/controller/acs/control/SafeCtrl.h
54 0x6b01 ACSPTG_PtgctrlMekfInputInvalid No description 1 ACS_PTG mission/controller/acs/control/PtgCtrl.h
55 0x6c01 ACSDTB_DetumbleNoSensordata No description 1 ACS_DETUMBLE mission/controller/acs/control/Detumble.h
56 0x6901 0x6902 ACSKAL_KalmanNoGyrMeas ACSKAL_KalmanUninitialized No description 1 2 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
57 0x6902 0x6903 ACSKAL_KalmanNoModel ACSKAL_KalmanNoGyrData No description 2 3 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
58 0x6903 0x6904 ACSKAL_KalmanInversionFailed ACSKAL_KalmanNoModelVectors No description 3 4 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
59 0x6905 ACSKAL_KalmanNoSusMgmStrData No description 5 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
60 0x6906 ACSKAL_KalmanCovarianceInversionFailed No description 6 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
61 0x6907 ACSKAL_KalmanInitialized No description 7 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
62 0x6908 ACSKAL_KalmanRunning No description 8 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
63 0x4500 HSPI_OpeningFileFailed No description 0 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
64 0x4501 HSPI_FullDuplexTransferFailed No description 1 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
65 0x4502 HSPI_HalfDuplexTransferFailed No description 2 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h

View File

@ -6,8 +6,17 @@ from tmtccmd.tc import DefaultPusQueueHelper
import eive_tmtc.config.object_ids as obj_ids
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid
from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry, TmtcDefinitionWrapper
from eive_tmtc.config.object_ids import GYRO_0_ADIS_HANDLER_ID, GYRO_1_L3G_HANDLER_ID, GYRO_2_ADIS_HANDLER_ID, GYRO_3_L3G_HANDLER_ID
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
OpCodeEntry,
TmtcDefinitionWrapper,
)
from eive_tmtc.config.object_ids import (
GYRO_0_ADIS_HANDLER_ID,
GYRO_1_L3G_HANDLER_ID,
GYRO_2_ADIS_HANDLER_ID,
GYRO_3_L3G_HANDLER_ID,
)
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.pus_tm.defs import PrintWrapper
@ -64,9 +73,13 @@ def handle_gyr_cmd(q: DefaultPusQueueHelper, op_code: str):
if not is_adis:
raise ValueError("No config HK for L3 device")
q.add_log_cmd(f"Gyro {gyr_info[0]} CFG HK")
q.add_pus_tc(create_request_one_hk_command(make_sid(gyr_obj_id, AdisGyroSetId.CFG_HK)))
q.add_pus_tc(
create_request_one_hk_command(make_sid(gyr_obj_id, AdisGyroSetId.CFG_HK))
)
else:
logging.getLogger(__name__).warning(f"invalid op code {op_code} for gyro command")
logging.getLogger(__name__).warning(
f"invalid op code {op_code} for gyro command"
)
def handle_gyros_hk_data(
@ -95,9 +108,15 @@ def handle_adis_gyro_hk(
pw = PrintWrapper(printer)
fmt_str = "!ddddddf"
inc_len = struct.calcsize(fmt_str)
(ang_veloc_x, ang_veloc_y, ang_veloc_z, accel_x, accel_y, accel_z, temp) = struct.unpack(
fmt_str, hk_data[0 : 0 + inc_len]
)
(
ang_veloc_x,
ang_veloc_y,
ang_veloc_z,
accel_x,
accel_y,
accel_z,
temp,
) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len])
pw.dlog(f"Received ADIS1650X Gyro HK data from object {object_id}")
pw.dlog(
f"Angular Velocities (degrees per second): X {ang_veloc_x} | "
@ -110,9 +129,13 @@ def handle_adis_gyro_hk(
fmt_str = "!HBHHH"
inc_len = struct.calcsize(fmt_str)
print(len(hk_data))
(diag_stat_reg, filter_setting, range_mdl, msc_ctrl_reg, dec_rate_reg) = struct.unpack(
fmt_str, hk_data[0 : 0 + inc_len]
)
(
diag_stat_reg,
filter_setting,
range_mdl,
msc_ctrl_reg,
dec_rate_reg,
) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len])
pw.dlog(f"Diagnostic Status Register {diag_stat_reg:#018b}")
pw.dlog(f"Range MDL {range_mdl}")
pw.dlog(f"Filter Settings {filter_setting:#010b}")

View File

@ -21,9 +21,7 @@ from tmtccmd.tc.pus_20_fsfw_param import (
pack_scalar_u8_parameter_app_data,
)
from tmtccmd.pus.s20_fsfw_param_defs import (
create_scalar_u32_parameter
)
from tmtccmd.pus.s20_fsfw_param import create_scalar_u32_parameter
class ParameterId(enum.IntEnum):

48
pyproject.toml Normal file
View File

@ -0,0 +1,48 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "eive-tmtc"
description = "TMTC Commander EIVE"
readme = "README.md"
dynamic = ["version"]
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
authors = [
{name = "Robin Mueller", email = "muellerr@irs.uni-stuttgart.de"},
{name = "Jakob Meier", email = "meierj@irs.uni-stuttgart.de"},
]
keywords = ["eive", "space", "communication", "commanding"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Communications",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering"
]
dependencies = [
"tmtccmd ~= 4.1",
"python-dateutil ~= 2.8",
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@<gitRev>#egg=tmtccmd
]
[project.urls]
"Homepage" = "https://egit.irs.uni-stuttgart.de/eive/eive-tmtc"
[tool.setuptools]
include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "eive_tmtc.__version__"}
# Auto-Discovery is problematic for some reason, so use custom-discovery
[tool.setuptools.packages]
find = {}

View File

@ -1,54 +0,0 @@
[metadata]
name = eive-tmtc
description = TMTC Commander EIVE
version = attr: eive_tmtc.__version__
long_description = file: README.md
long_description_content_type = text/markdown
license = Apache-2.0
author = Robin Mueller, Jakob Meier
author_email = muellerr@irs.uni-stuttgart.de
platform = any
url = https://egit.irs.uni-stuttgart.de/eive/eive-tmtc
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Natural Language :: English
Operating System :: POSIX
Operating System :: Microsoft :: Windows
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Communications
Topic :: Software Development :: Libraries
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Scientific/Engineering
[options]
install_requires =
tmtccmd ~= 4.0
python-dateutil ~= 2.8
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@<gitRev>#egg=tmtccmd
packages = find:
python_requires = >=3.10
include_package_data = True
[options.extras_require]
mib =
[flake8]
max-line-length = 100
ignore = D203, W503
exclude =
.git,
__pycache__,
docs/conf.py,
old,
build,
dist,
venv
max-complexity = 10
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,