Merge pull request 'Run ui start in thread' (#9) from bugfix/ui-freezes-on-start into feature/webui-dev
Reviewed-on: #9
This commit is contained in:
commit
1dd84706a5
|
@ -141,7 +141,7 @@ class Robot:
|
||||||
with self.robot_ui:
|
with self.robot_ui:
|
||||||
ui.label(f"{self.robot_type} {self.sysid}").classes("text-2xl")
|
ui.label(f"{self.robot_type} {self.sysid}").classes("text-2xl")
|
||||||
ui.label(f"""Sysid: {self.sysid}""")
|
ui.label(f"""Sysid: {self.sysid}""")
|
||||||
ui.button("Start", on_click=self.start).classes("m-2")
|
ui.button("Start", on_click=self.async_start).classes("m-2")
|
||||||
ui.button("Stop", on_click=self.async_stop).classes("m-2")
|
ui.button("Stop", on_click=self.async_stop).classes("m-2")
|
||||||
self.video_button = EnableStreamingButton(sysid=self.sysid).classes(
|
self.video_button = EnableStreamingButton(sysid=self.sysid).classes(
|
||||||
"m-2"
|
"m-2"
|
||||||
|
@ -187,6 +187,9 @@ class Robot:
|
||||||
all=True, filters={"name": f"robot-sim-{self.robot_type}-{self.sysid}"}
|
all=True, filters={"name": f"robot-sim-{self.robot_type}-{self.sysid}"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def async_start(self):
|
||||||
|
return await run.io_bound(self.start)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
"""Starts the simulated drone with a given sysid,
|
"""Starts the simulated drone with a given sysid,
|
||||||
each drone must have it's own unique ID.
|
each drone must have it's own unique ID.
|
||||||
|
|
Loading…
Reference in New Issue