mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-27 17:42:04 +08:00
ui replay: use openpilot prefix (#37185)
* fix: use openpilot prefix * fix ui_state import * comment
This commit is contained in:
@@ -13,9 +13,9 @@ if "RECORD_OUTPUT" not in os.environ:
|
||||
os.environ["RECORD_OUTPUT"] = os.path.join(DIFF_OUT_DIR, os.environ["RECORD_OUTPUT"])
|
||||
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.common.prefix import OpenpilotPrefix
|
||||
from openpilot.system.version import terms_version, training_version
|
||||
from openpilot.system.ui.lib.application import gui_app, MousePos, MouseEvent
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
|
||||
FPS = 60
|
||||
HEADLESS = os.getenv("WINDOWED", "0") == "1"
|
||||
@@ -78,6 +78,9 @@ def handle_event(event: DummyEvent):
|
||||
|
||||
|
||||
def run_replay():
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state # import here for correct param setup (e.g. training guide)
|
||||
from openpilot.selfdrive.ui.mici.layouts.main import MiciMainLayout # import here for coverage
|
||||
|
||||
setup_state()
|
||||
os.makedirs(DIFF_OUT_DIR, exist_ok=True)
|
||||
|
||||
@@ -85,7 +88,6 @@ def run_replay():
|
||||
rl.set_config_flags(rl.FLAG_WINDOW_HIDDEN)
|
||||
gui_app.init_window("ui diff test", fps=FPS)
|
||||
|
||||
from openpilot.selfdrive.ui.mici.layouts.main import MiciMainLayout # import here for coverage
|
||||
|
||||
main_layout = MiciMainLayout()
|
||||
main_layout.set_rect(rl.Rectangle(0, 0, gui_app.width, gui_app.height))
|
||||
@@ -119,13 +121,14 @@ def run_replay():
|
||||
|
||||
|
||||
def main():
|
||||
cov = coverage.coverage(source=['openpilot.selfdrive.ui.mici'])
|
||||
with cov.collect():
|
||||
run_replay()
|
||||
cov.save()
|
||||
cov.report()
|
||||
cov.html_report(directory=os.path.join(DIFF_OUT_DIR, 'htmlcov'))
|
||||
print("HTML report: htmlcov/index.html")
|
||||
with OpenpilotPrefix():
|
||||
cov = coverage.coverage(source=['openpilot.selfdrive.ui.mici'])
|
||||
with cov.collect():
|
||||
run_replay()
|
||||
cov.save()
|
||||
cov.report()
|
||||
cov.html_report(directory=os.path.join(DIFF_OUT_DIR, 'htmlcov'))
|
||||
print("HTML report: htmlcov/index.html")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user