Skip to content

Commit b46024d

Browse files
committed
ENH: fixed new constellation version + added trigger metric
1 parent 654db32 commit b46024d

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

pymosa/constellation_pymosa/__init__py

Whitespace-only changes.

pymosa/constellation_pymosa/__main__.py

Whitespace-only changes.

pymosa/constellation_pymosa/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def main(args=None):
66
parser = SatelliteArgumentParser()
77
args = vars(parser.parse_args(args))
8-
setup_cli_logging(args.pop("log_level"))
8+
setup_cli_logging(args.pop("level"))
99
s = Pymosa(**args)
1010
s.run_satellite()
1111

pymosa/constellation_pymosa/pymosa_satellite.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from constellation.core.configuration import Configuration
22
from constellation.core.satellite import Satellite
33
import time
4-
from constellation.core.commandmanager import cscp_requestable
5-
from constellation.core.cscp import CSCPMessage
64
from constellation.core.cmdp import MetricsType
5+
from constellation.core.fsm import SatelliteState
6+
from constellation.core.monitoring import schedule_metric
77
import os
88
import yaml
99
import pymosa
@@ -12,7 +12,7 @@
1212
from pymosa.m26_raw_data import save_configuration_dict
1313
from time import sleep, strftime, time
1414
from tqdm import tqdm
15-
15+
from typing import Any
1616

1717
class Pymosa(Satellite):
1818
def __init__(self, *args, **kwargs):
@@ -117,5 +117,11 @@ def _pre_run(self):
117117
self.fh.setFormatter(logging.Formatter(FORMAT))
118118
self.logger = logging.getLogger()
119119
self.logger.addHandler(self.fh)
120+
self.telescope.dut['TLU']['TRIGGER_COUNTER'] = 0
120121

121-
122+
@schedule_metric("", MetricsType.LAST_VALUE, 1)
123+
def trigger_number(self) -> Any:
124+
if self.fsm.current_state_value == SatelliteState.RUN:
125+
return self.telescope.dut['TLU']['TRIGGER_COUNTER']
126+
else:
127+
return None

0 commit comments

Comments
 (0)