Skip to content

Commit a4fcd91

Browse files
committed
update the GUI
1 parent 5c91f0b commit a4fcd91

14 files changed

Lines changed: 1615 additions & 149 deletions

File tree

PyMieSim/__main__.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
"""Entry point for launching the PyMieSim experiment dashboard."""
22

3+
import argparse
4+
import logging
5+
36
from PyMieSim.gui.interface import OpticalSetupGUI
47

8+
9+
def _build_argument_parser() -> argparse.ArgumentParser:
10+
"""Create the CLI parser for the dashboard launcher."""
11+
parser = argparse.ArgumentParser(description="Launch the PyMieSim experiment dashboard.")
12+
parser.add_argument("--host", default="127.0.0.1", help="Host interface for the Dash server.")
13+
parser.add_argument("--port", default="8050", help="Port for the Dash server.")
14+
parser.add_argument("--debug", action="store_true", help="Enable Dash debug mode and verbose debug logging.")
15+
parser.add_argument(
16+
"--no-browser",
17+
action="store_true",
18+
help="Start the server without opening a browser window.",
19+
)
20+
return parser
21+
522
if __name__ == "__main__":
23+
args = _build_argument_parser().parse_args()
24+
25+
logging.basicConfig(
26+
level=logging.DEBUG if args.debug else logging.INFO,
27+
format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
28+
)
629
_gui = OpticalSetupGUI()
7-
_gui.run(host="127.0.0.1", port="8050", open_browser=True)
30+
_gui.run(
31+
host=args.host,
32+
port=args.port,
33+
open_browser=not args.no_browser,
34+
debug=args.debug,
35+
)

0 commit comments

Comments
 (0)