Compare commits

...

7 Commits

Author SHA1 Message Date
0aaf63215b Merge pull request 'prep next version' (#249) from prep_v5.10.0 into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #249
2023-10-27 12:33:28 +02:00
72460fdb49 date correction
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2023-10-27 12:30:52 +02:00
66c1895cd0 prep next version
All checks were successful
EIVE/-/pipeline/head This commit looks good
EIVE/-/pipeline/pr-main This commit looks good
2023-10-27 12:25:31 +02:00
4e56bd172e Merge pull request 'STR Extensions' (#244) from str-extensions into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #244
2023-10-27 12:24:07 +02:00
ff73746935 clear filter
Some checks are pending
EIVE/-/pipeline/pr-main Build started...
2023-10-27 12:22:52 +02:00
5821c60eb4 add contrast set
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2023-10-27 11:24:39 +02:00
2ca7bc5a70 histogram set working
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2023-10-27 10:36:51 +02:00
4 changed files with 65 additions and 75 deletions

View File

@@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
# [unreleased]
# [v5.10.0] 2023-10-27
- Added new STR commands to allow more debugging.
# [v5.9.0] 2023-10-24
## Added

View File

@@ -108,7 +108,7 @@ class OpCodes:
NORMAL = "nml"
OFF = "off"
PING = "ping"
ONE_SHOOT_HK = "one_shoot_hk"
ONE_SHOOT_HK = "one_shot_hk"
ENABLE_HK = "enable_hk"
DISABLE_HK = "disable_hk"
ADD_SECONDARY_TM_TO_NORMAL_MODE = "add_secondary_tm"
@@ -142,6 +142,7 @@ class SetId(enum.IntEnum):
TEMPERATURE = 25
SOLUTION = 24
HISTOGRAM = 28
CONTRAST = 29
CHECKSUM = 50
CAMERA = 67
LIMITS = 68
@@ -674,75 +675,50 @@ def pack_star_tracker_commands( # noqa C901
)
def request_dataset(q: DefaultPusQueueHelper, type: DataSetRequest):
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
for val in SetId:
print("{:<2}: {:<20}".format(val, val.name))
setId = int(input("Specify the dataset \n" ""))
match type:
set_id = int(input("Specify the dataset \n" ""))
if set_id in [SetId.SOLUTION, SetId.TEMPERATURE]:
is_diag = True
else:
is_diag = False
match req_type:
case DataSetRequest.ONESHOT:
if setId in [
SetId.SOLUTION,
SetId.TEMPERATURE,
]:
if is_diag:
q.add_pus_tc(
create_request_one_diag_command(make_sid(STAR_TRACKER_ID, setId))
)
elif setId in [
SetId.AUTO_BLOB,
SetId.MATCHED_CENTROIDS,
SetId.BLOB,
SetId.BLOBS,
SetId.CENTROID,
SetId.CENTROIDS,
]:
q.add_pus_tc(
create_request_one_hk_command(make_sid(STAR_TRACKER_ID, setId))
create_request_one_diag_command(make_sid(STAR_TRACKER_ID, set_id))
)
else:
print("Not Implemented Yet")
q.add_pus_tc(
create_request_one_hk_command(make_sid(STAR_TRACKER_ID, set_id))
)
case DataSetRequest.ENABLE:
interval = float(
input("Please specify interval in floating point seconds: ")
)
if setId in [SetId.SOLUTION]:
if is_diag:
cmd_tuple = enable_periodic_hk_command_with_interval(
True, make_sid(STAR_TRACKER_ID, setId), interval
True, make_sid(STAR_TRACKER_ID, set_id), interval
)
q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1])
elif setId in [
SetId.AUTO_BLOB,
SetId.MATCHED_CENTROIDS,
SetId.BLOB,
SetId.BLOBS,
SetId.CENTROID,
SetId.CENTROIDS,
]:
cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(STAR_TRACKER_ID, setId), interval
)
q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1])
else:
print("Not Implemented Yet")
cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(STAR_TRACKER_ID, set_id), interval
)
q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1])
case DataSetRequest.DISABLE:
if setId in [SetId.SOLUTION]:
if is_diag:
q.add_pus_tc(
disable_periodic_hk_command(True, make_sid(STAR_TRACKER_ID, setId))
)
elif setId in [
SetId.AUTO_BLOB,
SetId.MATCHED_CENTROIDS,
SetId.BLOB,
SetId.BLOBS,
SetId.CENTROID,
SetId.CENTROIDS,
]:
q.add_pus_tc(
disable_periodic_hk_command(False, make_sid(STAR_TRACKER_ID, setId))
disable_periodic_hk_command(True, make_sid(STAR_TRACKER_ID, set_id))
)
else:
print("Not Implemented Yet")
q.add_pus_tc(
disable_periodic_hk_command(
False, make_sid(STAR_TRACKER_ID, set_id)
)
)
def pack_read_command(object_id: bytes) -> bytearray:
@@ -826,6 +802,8 @@ def handle_str_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
handle_centroid_set(hk_data, pw)
elif set_id == SetId.CENTROIDS:
handle_centroids_set(hk_data, pw)
elif set_id == SetId.CONTRAST:
handle_contrast_set(hk_data, pw)
else:
_LOGGER.warning(f"HK parsing for Star Tracker set ID {set_id} unimplemented")
@@ -1075,13 +1053,14 @@ def handle_auto_blob_set(hk_data: bytes, pw: PrintWrapper):
threshold = struct.unpack(
fmt_threshold, hk_data[current_idx : current_idx + inc_len]
)[0]
pw.dlog(f"Threshold {threshold}")
current_idx += inc_len
assert current_idx == len(hk_data) - 1
pw.dlog(f"Threshold {threshold}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
def handle_histogram_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Histogram Set")
def handle_histo_or_contrast_set(name: str, hk_data: bytes, pw: PrintWrapper):
pw.dlog(f"Received {name} Set")
current_idx = unpack_time_hk(hk_data, 0, pw)
fmt_str = "!IIIIIIIII"
bins_list = []
@@ -1098,26 +1077,33 @@ def handle_histogram_set(hk_data: bytes, pw: PrintWrapper):
d_bins = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
bins_list.append(d_bins)
pw.dlog(
"{:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8}".format(
"Section", "Index", "0", "1", "2", "3", "4", "5", "6", "7", "8"
)
f"{name} Sections: A Upper Left | B Upper Right | C Lower Left | D Lower Right"
)
for idx in range(4):
name = "?"
pw.dlog("{:<12} {:<10} {:<10} {:<10} {:<10}".format("Range", "A", "B", "C", "D"))
for idx in range(9):
if idx == 0:
name = "A"
if idx == 1:
name = "B"
if idx == 2:
name = "C"
if idx == 3:
name = "D"
val_range = "0 (0-0)"
elif idx == 1:
val_range = "1 (1-1)"
else:
val_range = f"{idx} ({pow(2, idx - 1)}-{pow(2, idx) - 1})"
pw.dlog(
"{:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8} {:<8}".format(
name, idx, *bins_list[idx]
"{:<12} {:<10} {:<10} {:<10} {:<10}".format(
val_range,
bins_list[0][idx],
bins_list[1][idx],
bins_list[2][idx],
bins_list[3][idx],
)
)
pass
def handle_histogram_set(hk_data: bytes, pw: PrintWrapper):
handle_histo_or_contrast_set("Histogram", hk_data, pw)
def handle_contrast_set(hk_data: bytes, pw: PrintWrapper):
handle_histo_or_contrast_set("Contrast", hk_data, pw)
def handle_star_tracker_action_replies(

View File

@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "eive-tmtc"
description = "TMTC Commander EIVE"
readme = "README.md"
version = "5.9.0"
version = "5.10.0"
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
authors = [

View File

@@ -15,7 +15,6 @@ from spacepackets.cfdp import (
TransmissionMode,
)
from eive_tmtc.config.object_ids import STAR_TRACKER_ID
from eive_tmtc.pus_tc.tc_handler import TcHandler
from eive_tmtc.pus_tm.hk_handler import HkFilter
from tmtccmd.logging import add_colorlog_console_logger
@@ -26,7 +25,7 @@ from tmtccmd.cfdp.mib import (
RemoteEntityCfg,
)
from tmtccmd import BackendBase
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider, ObjectIdU32
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.logging.pus import (
@@ -79,7 +78,8 @@ class PusHandler(SpecificApidHandlerBase):
self.verif_wrapper = wrapper
self.raw_logger = raw_logger
self.hk_level = hk_level
self.hk_filter = HkFilter(object_ids=[ObjectIdU32(STAR_TRACKER_ID)], set_ids=[])
self.these_objs_hk_only = []
self.hk_filter = HkFilter(object_ids=self.these_objs_hk_only, set_ids=[])
def handle_tm(self, packet: bytes, _user_args: any):
# with open("tc.bin", "wb") as of: