Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricting visualization to current project if possible #176

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ lestarch
LGTM
lgtm
Linux
localhost
Prm
prm
Serializables
serializables
timezone
Tlm
tlm
webbrowser
7 changes: 6 additions & 1 deletion src/fprime/fpp/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import shutil
import subprocess
import tempfile
import webbrowser
from pathlib import Path
from typing import Callable, Dict, List, Tuple

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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}")
LeStarch marked this conversation as resolved.
Show resolved Hide resolved
app.run(port=parsed.gui_port)
except KeyboardInterrupt:
print("[INFO] CTRL-C received. Exiting.")
Expand Down
Loading