Compare commits
9 Commits
56d414d9fc
...
2c96b9ed4c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2c96b9ed4c | ||
c58e9e6ce2 | |||
![]() |
a408a3caec | ||
![]() |
ec27380f16 | ||
![]() |
fd01098345 | ||
![]() |
79d912fc80 | ||
![]() |
bd551984ad | ||
![]() |
e64913bb52 | ||
![]() |
9efb347aa2 |
4
.idea/runConfigurations/Star_Tracker.xml
generated
4
.idea/runConfigurations/Star_Tracker.xml
generated
@@ -6,9 +6,9 @@
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="C:\Users\EIVE_Reinraumrechner\EIVE-Software-Q7S\eive-obsw\tmtc\Scripts\python.exe" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
|
34
lint.py
34
lint.py
@@ -4,18 +4,36 @@ import sys
|
||||
|
||||
|
||||
def main():
|
||||
# Ignore folder created by venv
|
||||
exclude_dirs_flag = "--exclude bin,lib"
|
||||
exclude_dirs_flag = ""
|
||||
if not os.path.exists("setup.cfg"):
|
||||
exclude_dirs_flag = (
|
||||
"--exclude .git,__pycache__,docs/conf.py,old,build,dist,venv"
|
||||
)
|
||||
additional_flags_both_steps = "--count --statistics"
|
||||
additional_flags_first_step = "--select=E9,F63,F7,F82 --show-source"
|
||||
flake8_first_step_cmd = f"flake8 . {additional_flags_both_steps} {additional_flags_first_step} {exclude_dirs_flag}"
|
||||
python_exe = ""
|
||||
if os.name == "nt":
|
||||
python_exe = "py -m"
|
||||
flake8_first_step_cmd = (
|
||||
f"{python_exe} flake8 . {additional_flags_both_steps} "
|
||||
f"{additional_flags_first_step} {exclude_dirs_flag}"
|
||||
)
|
||||
status = os.system(flake8_first_step_cmd)
|
||||
if os.WEXITSTATUS(status) != 0:
|
||||
print("Flake8 linter errors")
|
||||
sys.exit(0)
|
||||
if os.name == "nt":
|
||||
if status != 0:
|
||||
print(f"Flake8 linter errors with status {status}")
|
||||
else:
|
||||
if os.WEXITSTATUS(status) != 0:
|
||||
print(f"Flake8 linter errors with status {status}")
|
||||
sys.exit(0)
|
||||
additional_flags_second_step = (
|
||||
'--exit-zero --max-complexity=10 --per-file-ignores="__init__.py:F401"'
|
||||
)
|
||||
if not os.path.exists("setup.cfg"):
|
||||
additional_flags_second_step += " --max-line-length=100"
|
||||
flake8_second_step_cmd = (
|
||||
f"flake8 . {additional_flags_both_steps} --exit-zero --max-complexity=10 "
|
||||
f"--max-line-length=127 {exclude_dirs_flag}"
|
||||
f"{python_exe} flake8 . {additional_flags_both_steps} {additional_flags_second_step}"
|
||||
f" {exclude_dirs_flag}"
|
||||
)
|
||||
os.system(flake8_second_step_cmd)
|
||||
|
||||
|
@@ -3,13 +3,20 @@ import enum
|
||||
from tmtccmd.config import QueueCommands
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
|
||||
from tmtccmd.tc.service_20_parameter import (
|
||||
pack_scalar_double_param_app_data,
|
||||
pack_fsfw_load_param_cmd
|
||||
)
|
||||
from tmtccmd.utility.logger import get_console_logger
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from config.object_ids import PL_PCDU_ID
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
class OpCodes:
|
||||
SWITCH_ADC_ON = ["0", "switch-adc-on"]
|
||||
SWITCH_ALL_ON = ["1", "switch-all-on"]
|
||||
UPDATE_DRO_TO_X8_WAIT = ["2", "dro-to-x8-wait"]
|
||||
|
||||
|
||||
class Submodes(enum.IntEnum):
|
||||
@@ -17,6 +24,10 @@ class Submodes(enum.IntEnum):
|
||||
ALL_ON = 1
|
||||
|
||||
|
||||
class ParamIds(enum.IntEnum):
|
||||
DRO_TO_X8_WAIT_TIME = 17
|
||||
|
||||
|
||||
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.SWITCH_ADC_ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module on"))
|
||||
@@ -36,3 +47,25 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.UPDATE_DRO_TO_X8_WAIT:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Updating DRO to X8 wait time"))
|
||||
while True:
|
||||
wait_time = input("Please enter DRO to X8 wait time in seconds, x to cancel")
|
||||
if wait_time.lower() == "x":
|
||||
return
|
||||
if not wait_time.isnumeric():
|
||||
LOGGER.warning("Invalid input")
|
||||
continue
|
||||
wait_time = float(wait_time)
|
||||
if wait_time <= 0:
|
||||
LOGGER.warning("Invalid input")
|
||||
else:
|
||||
break
|
||||
param_data = pack_scalar_double_param_app_data(
|
||||
object_id=PL_PCDU_ID,
|
||||
domain_id=0,
|
||||
unique_id=ParamIds.DRO_TO_X8_WAIT_TIME,
|
||||
parameter=wait_time
|
||||
)
|
||||
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
@@ -95,6 +95,9 @@ class FileDefs:
|
||||
)
|
||||
q7s_ground_config = "/mnt/sd0/startracker/json/ground-config.json"
|
||||
q7s_flight_config = "/mnt/sd0/startracker/flight-config.json"
|
||||
firmware2_1 = "/home/pi/arcsec/firmware/sagitta-2-1.bin"
|
||||
firmware22_1 = "/home/pi/arcsec/firmware/sagitta-22-1.bin"
|
||||
firmware_origin = "/home/pi/arcsec/firmware/sagitta-origin.bin"
|
||||
|
||||
|
||||
json_dict = {
|
||||
|
Submodule spacepackets updated: 8580a08e98...19e8a588fa
2
tmtccmd
2
tmtccmd
Submodule tmtccmd updated: f7bbf4bd9f...9af8340c02
Reference in New Issue
Block a user