diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 4c8ae114..fe5fcd52 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -29,6 +29,7 @@ lestarch LGTM lgtm Linux +localhost Prm prm Serializables @@ -36,3 +37,4 @@ serializables timezone Tlm tlm +webbrowser diff --git a/src/fprime/fpp/visualize.py b/src/fprime/fpp/visualize.py index a1c092fc..67868f39 100644 --- a/src/fprime/fpp/visualize.py +++ b/src/fprime/fpp/visualize.py @@ -6,6 +6,7 @@ import shutil import subprocess import tempfile +import webbrowser from pathlib import Path from typing import Callable, Dict, List, Tuple @@ -75,8 +76,11 @@ def run_fprime_visualize( ["--directory", str(xml_cache)], ), ) + project_xml = xml_cache / f"{Path(build.cmake_root).name}TopologyAppAi.xml" topology_match = list(xml_cache.glob("*TopologyAppAi.xml")) - if len(topology_match) == 1: + if project_xml.exists(): + topology_xml = project_xml + elif len(topology_match) == 1: topology_xml = topology_match[0] else: raise Exception( @@ -126,6 +130,7 @@ def run_fprime_visualize( config = {"SOURCE_DIRS": [str(viz_cache.resolve())]} app = construct_app(config) try: + webbrowser.open(f"http://localhost:{parsed.gui_port}") app.run(port=parsed.gui_port) except KeyboardInterrupt: print("[INFO] CTRL-C received. Exiting.")