Add tabs
This commit is contained in:
parent
f30740fe2d
commit
15110bd830
|
@ -25,6 +25,8 @@ services:
|
||||||
#- ${XDG_RUNTIME_DIR}/wayland-0:${XDG_RUNTIME_DIR}/wayland-0
|
#- ${XDG_RUNTIME_DIR}/wayland-0:${XDG_RUNTIME_DIR}/wayland-0
|
||||||
# Allow access to the host's GPU
|
# Allow access to the host's GPU
|
||||||
- /dev/dri:/dev/dri
|
- /dev/dri:/dev/dri
|
||||||
|
#Auto reload on code changes
|
||||||
|
- ./guiTools/spiri_sdk_guitools/:/app/spiri_sdk_guitools
|
||||||
devices:
|
devices:
|
||||||
# Provide access to GPU devices
|
# Provide access to GPU devices
|
||||||
- /dev/dri:/dev/dri
|
- /dev/dri:/dev/dri
|
||||||
|
|
|
@ -3,11 +3,11 @@ import subprocess
|
||||||
|
|
||||||
# Dictionary of applications: key is the button text, value is the command to execute
|
# Dictionary of applications: key is the button text, value is the command to execute
|
||||||
applications = {
|
applications = {
|
||||||
"Launch Terminal": ["qterminal"],
|
"Terminal": ["qterminal"],
|
||||||
"Launch rqt": ["rqt"],
|
"rqt": ["rqt"],
|
||||||
"Launch rviz2": ["rviz2"],
|
"rviz2": ["rviz2"],
|
||||||
"Launch Gazebo": ["/spawn_drones.sh"],
|
"Gazebo": ["/spawn_drones.sh"],
|
||||||
"Launch Gazebo Standalone": "gz sim -v4".split(),
|
"Gazebo Standalone": "gz sim -v4".split(),
|
||||||
# Add more applications here if needed
|
# Add more applications here if needed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,11 +19,21 @@ def launch_app(command):
|
||||||
print(f"{command[0]} not found. Make sure it's installed and accessible in the PATH.")
|
print(f"{command[0]} not found. Make sure it's installed and accessible in the PATH.")
|
||||||
|
|
||||||
# Create the NiceGUI interface
|
# Create the NiceGUI interface
|
||||||
ui.label("Spiri Robotics SDK").style('font-size: 20px; margin-bottom: 10px;')
|
ui.label("Spiri Robotics SDK").style('font-size: 40px; margin-bottom: 10px;').classes('w-full text-center')
|
||||||
|
|
||||||
|
|
||||||
|
with ui.tabs().classes('w-full') as tabs:
|
||||||
|
tab_tools = ui.tab('Tools')
|
||||||
|
tab_robots = ui.tab('Robots')
|
||||||
|
# two = ui.tab('Two')
|
||||||
|
with ui.tab_panels(tabs, value=tab_tools).classes():
|
||||||
|
with ui.tab_panel(tab_tools):
|
||||||
# Create and place buttons dynamically based on the dictionary
|
# Create and place buttons dynamically based on the dictionary
|
||||||
|
with ui.grid(columns=3):
|
||||||
for app_name, command in applications.items():
|
for app_name, command in applications.items():
|
||||||
ui.button(app_name, on_click=lambda cmd=command: launch_app(cmd)).style('width: 150px; height: 50px; margin: 5px;')
|
ui.button(app_name, on_click=lambda cmd=command: launch_app(cmd)).style('width: 150px; height: 50px; margin: 5px;')
|
||||||
|
with ui.tab_panel(tab_robots):
|
||||||
|
with ui.card().tight():
|
||||||
|
ui.label(f"Robots SysID")
|
||||||
# Start the NiceGUI application
|
# Start the NiceGUI application
|
||||||
ui.run(title="Spiri SDK Launcher", port=8923, dark=None)
|
ui.run(title="Spiri SDK Launcher", port=8923, dark=None)
|
||||||
|
|
Loading…
Reference in New Issue