Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SRC OBDH TMTC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robin Mueller
SRC OBDH TMTC
Commits
8fac0d28
Commit
8fac0d28
authored
4 years ago
by
Robin Mueller
Browse files
Options
Downloads
Patches
Plain Diff
user code added
parent
09f595f9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/obsw_user_code.py
+45
-0
45 additions, 0 deletions
config/obsw_user_code.py
with
45 additions
and
0 deletions
config/obsw_user_code.py
0 → 100644
+
45
−
0
View file @
8fac0d28
"""
User defined code can be added here.
"""
from
typing
import
Union
,
Tuple
from
tmtc_core.tc.obsw_pus_tc_base
import
PusTcInfo
from
enum
import
Enum
# Yeah, I did not have a better idea yet..
class
Developer
(
Enum
):
Robin
=
0
Developer
=
Developer
.
Robin
def
command_preparation_hook
()
->
Tuple
[
bytearray
,
Union
[
None
,
PusTcInfo
]]:
"""
Can be used to pack user-defined commands.
"""
if
Developer
==
Developer
.
Robin
:
return
prepare_robins_commands
()
def
global_setup_hook
():
"""
Can be used to alter the global variables in a custom defined way.
For example, device specific com ports or ethernet ports can be set here.
The global variables in the config.obsw_config file can be edited here
by using the handle.
For example: config.obsw_config.G_ETHERNET_SEND_ADDRESS = new_send_address
"""
if
Developer
==
Developer
.
Robin
:
global_setup_hook_robin
()
def
prepare_robins_commands
():
from
tmtc_core.tc.obsw_pus_tc_base
import
PusTelecommand
command
=
PusTelecommand
(
service
=
17
,
subservice
=
1
,
ssc
=
20
)
return
command
.
pack_command_tuple
()
def
global_setup_hook_robin
():
import
config.obsw_config
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment