From b9713395ad8a613024b973c54c1ee7629a05008c Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Tue, 27 Feb 2024 09:54:14 -0800 Subject: [PATCH 1/8] Update Yamcs version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 30e0de3..4b131da 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Update this to the latest Yamcs release. Check https://mvnrepository.com/artifact/org.yamcs/yamcs-core --> - 5.8.5 + 5.8.8 From 8de2cc2231b01f51eceed24c7fcab72d506de5c6 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Tue, 27 Feb 2024 09:54:31 -0800 Subject: [PATCH 2/8] Increase playback rate --- simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulator.py b/simulator.py index c940c54..e7d5026 100644 --- a/simulator.py +++ b/simulator.py @@ -23,7 +23,7 @@ def send_tm(simulator): tm_socket.sendto(packet, ('127.0.0.1', 10015)) simulator.tm_counter += 1 - sleep(1) + sleep(0.1) def receive_tc(simulator): From 5d81974a11869e21302ad1327bfaa330c71adc09 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Tue, 27 Feb 2024 19:38:02 -0800 Subject: [PATCH 3/8] Added the ability to specify the playback rate --- simulator.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/simulator.py b/simulator.py index e7d5026..43006db 100644 --- a/simulator.py +++ b/simulator.py @@ -5,7 +5,7 @@ from struct import unpack_from from threading import Thread from time import sleep - +from argparse import ArgumentParser def send_tm(simulator): tm_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) @@ -23,7 +23,7 @@ def send_tm(simulator): tm_socket.sendto(packet, ('127.0.0.1', 10015)) simulator.tm_counter += 1 - sleep(0.1) + sleep(1 / simulator.rate) def receive_tc(simulator): @@ -37,12 +37,13 @@ def receive_tc(simulator): class Simulator(): - def __init__(self): + def __init__(self, rate): self.tm_counter = 0 self.tc_counter = 0 self.tm_thread = None self.tc_thread = None self.last_tc = None + self.rate = rate def start(self): self.tm_thread = Thread(target=send_tm, args=(self,)) @@ -61,7 +62,14 @@ def print_status(self): if __name__ == '__main__': - simulator = Simulator() + parser = ArgumentParser() + parser.add_argument("-r", "--rate", + dest="rate", + default=1, + type=int, + help="Playback rate. 1 = 1Hz, 10 = 10Hz, etc.") + args = parser.parse_args() + simulator = Simulator(args.rate) simulator.start() try: From b8ee44641b4af084fe4330907d93249c60f9ef59 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Wed, 28 Feb 2024 08:57:22 -0800 Subject: [PATCH 4/8] Print out playback rate --- simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulator.py b/simulator.py index 43006db..e4d5275 100644 --- a/simulator.py +++ b/simulator.py @@ -71,7 +71,7 @@ def print_status(self): args = parser.parse_args() simulator = Simulator(args.rate) simulator.start() - + sys.stdout.write('Using playback rate of ' + str(args.rate) + 'Hz \r\n'); try: prev_status = None while True: From 78c2a7bfa4a66c3751d9f292e9a086684fb619fb Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Thu, 29 Feb 2024 13:18:42 -0800 Subject: [PATCH 5/8] Optionally provide a playback rate --- docker/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Makefile b/docker/Makefile index 52ec546..e4bbf3e 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -17,7 +17,8 @@ yamcs-down: ## bring down yamcs system yamcs-simulator: yamcs-up ## run yamcs simulator @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ - cd .. && $(PYTHON) ./simulator.py + export SIMULATOR_PLAYBACK_RATE="${SIMULATOR_PLAYBACK_RATE}:-1" + cd .. && $(PYTHON) ./simulator.py --rate=$SIMULATOR_PLAYBACK_RATE yamcs-shell: ## shell into yamcs container docker-compose up -d && docker run -it yamcs "bash" From d214800ed704e52569478370300daa42b446b061 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Thu, 29 Feb 2024 15:10:58 -0800 Subject: [PATCH 6/8] Add target for 10Hz playback --- docker/Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index e4bbf3e..604beca 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -8,7 +8,10 @@ endif all: ## run all, yamcs-up (yamcs-down) and yamcs-simulator $(MAKE) yamcs-simulator - + +all-10hz: + $(MAKE) yamcs-simulator-10hz + yamcs-up: | yamcs-down ## bring up yamcs system docker-compose up -d @@ -18,7 +21,13 @@ yamcs-down: ## bring down yamcs system yamcs-simulator: yamcs-up ## run yamcs simulator @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ export SIMULATOR_PLAYBACK_RATE="${SIMULATOR_PLAYBACK_RATE}:-1" - cd .. && $(PYTHON) ./simulator.py --rate=$SIMULATOR_PLAYBACK_RATE + cd .. && $(PYTHON) ./simulator.py + +yamcs-simulator-10-hz: yamcs-up ## run yamcs simulator + @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ + export SIMULATOR_PLAYBACK_RATE="${SIMULATOR_PLAYBACK_RATE}:-1" + cd .. && $(PYTHON) ./simulator.py --rate=10 + yamcs-shell: ## shell into yamcs container docker-compose up -d && docker run -it yamcs "bash" From f5a15366395d82da37795fbcb60ffcf9cb4a579d Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Thu, 29 Feb 2024 15:18:53 -0800 Subject: [PATCH 7/8] Corrected makefile error --- docker/Makefile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 604beca..34ec5f1 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -10,7 +10,7 @@ all: ## run all, yamcs-up (yamcs-down) and yamcs-simulator $(MAKE) yamcs-simulator all-10hz: - $(MAKE) yamcs-simulator-10hz + $(MAKE) yamcs-simulator-10hz yamcs-up: | yamcs-down ## bring up yamcs system docker-compose up -d @@ -20,14 +20,11 @@ yamcs-down: ## bring down yamcs system yamcs-simulator: yamcs-up ## run yamcs simulator @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ - export SIMULATOR_PLAYBACK_RATE="${SIMULATOR_PLAYBACK_RATE}:-1" cd .. && $(PYTHON) ./simulator.py -yamcs-simulator-10-hz: yamcs-up ## run yamcs simulator - @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ - export SIMULATOR_PLAYBACK_RATE="${SIMULATOR_PLAYBACK_RATE}:-1" - cd .. && $(PYTHON) ./simulator.py --rate=10 - +yamcs-simulator-10hz: yamcs-up ## run yamcs simulator + @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ + cd .. && $(PYTHON) ./simulator.py --rate=10 yamcs-shell: ## shell into yamcs container docker-compose up -d && docker run -it yamcs "bash" From 7b4dc1bdb45d409523db10e432278d3adb02abe3 Mon Sep 17 00:00:00 2001 From: "Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC]" Date: Wed, 7 Aug 2024 15:21:05 -0700 Subject: [PATCH 8/8] fix: update Makefile --- docker/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/Makefile b/docker/Makefile index 9c47079..737c814 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -15,10 +15,12 @@ define print_message @printf "\033[$(1)m$(2)\033[0m\n" endef -.PHONY: all clean yamcs-up yamcs-down yamcs-simulator yamcs-shell help +.PHONY: all all-10hz clean yamcs-up yamcs-down yamcs-simulator yamcs-simulator-10hz yamcs-shell help all: clean yamcs-simulator ## run all: clean, yamcs-up (yamcs-down) and yamcs-simulator +all-10hz: clean yamcs-simulator-10hz ## run all: clean, yamcs-up (yamcs-down) and yamcs-simulator + yamcs-up: | yamcs-down ## bring up yamcs system docker compose up -d @@ -30,6 +32,10 @@ yamcs-simulator: yamcs-up ## run yamcs simulator $(call print_message,36,Connect via http://localhost:8090/ system may take about 50 seconds to startup) cd .. && $(PYTHON) ./simulator.py +yamcs-simulator-10hz: yamcs-up ## run yamcs simulator at 10hz + $(call print_message,36,Connect via http://localhost:8090/ system may take about 50 seconds to startup) + cd .. && $(PYTHON) ./simulator.py --rate=10 + yamcs-shell: ## shell into yamcs container docker compose up -d && docker compose exec yamcs bash