Commit 2f77c213 authored by William Gaylord's avatar William Gaylord

Add Observation Data to Pre and Post Script Calls

parent 2dab50b2
Pipeline #25956740 passed with stage
in 2 minutes and 28 seconds
......@@ -23,7 +23,6 @@ class Observer(object):
_gnu_proc = None
_post_exec_script = settings.SATNOGS_POST_OBSERVATION_SCRIPT
# Variables from settings
# Mainly present so we can support multiple ground stations from the client
......@@ -125,7 +124,13 @@ class Observer(object):
"""Starts threads for rotcrl and rigctl."""
if settings.SATNOGS_PRE_OBSERVATION_SCRIPT is not None:
LOGGER.info('Executing pre-observation script.')
os.system(settings.SATNOGS_PRE_OBSERVATION_SCRIPT)
pre_script = settings.SATNOGS_PRE_OBSERVATION_SCRIPT
pre_script = pre_script.replace("{{FREQ}}", str(self.frequency))
pre_script = pre_script.replace("{{TLE}}", json.dumps(self.tle))
pre_script = pre_script.replace("{{ID}}", str(self.observation_id))
pre_script = pre_script.replace("{{BAUD}}", str(self.baud))
pre_script = pre_script.replace("{{SCRIPT_NAME}}", self.script_name)
os.system(pre_script)
# if it is APT we want to save with a prefix until the observation
# is complete, then rename.
......@@ -216,8 +221,14 @@ class Observer(object):
sleep(30)
LOGGER.info('Observation Finished')
LOGGER.info('Executing post-observation script.')
if self._post_exec_script is not None:
os.system(self._post_exec_script)
if settings.SATNOGS_POST_OBSERVATION_SCRIPT is not None:
post_script = settings.SATNOGS_POST_OBSERVATION_SCRIPT
post_script = post_script.replace("{{FREQ}}", str(self.frequency))
post_script = post_script.replace("{{TLE}}", json.dumps(self.tle))
post_script = post_script.replace("{{ID}}", str(self.observation_id))
post_script = post_script.replace("{{BAUD}}", str(self.baud))
post_script = post_script.replace("{{SCRIPT_NAME}}", self.script_name)
os.system(post_script)
def rename_ogg_file(self):
if os.path.isfile(self.observation_raw_file):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment