dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.8 KiB

import os
Import('env', 'arch', 'real_arch', 'common', 'messaging', 'gpucommon', 'visionipc', 'cereal')
qt_env = None
if arch in ["x86_64", "Darwin", "larch64"]:
qt_env = env.Clone()
if arch == "Darwin":
qt_env['QTDIR'] = "/usr/local/opt/qt"
QT_BASE = "/usr/local/opt/qt/"
qt_dirs = [
QT_BASE + "include/",
QT_BASE + "include/QtWidgets",
QT_BASE + "include/QtGui",
QT_BASE + "include/QtCore",
QT_BASE + "include/QtDBus",
QT_BASE + "include/QtMultimedia",
]
qt_env["LINKFLAGS"] += ["-F" + QT_BASE + "lib"]
else:
qt_env['QTDIR'] = "/usr"
qt_dirs = [
f"/usr/include/{real_arch}-linux-gnu/qt5",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtWidgets",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtCore",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtDBus",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtMultimedia",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.5.1/QtGui",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.12.8/QtGui",
]
qt_env.Tool('qt')
qt_env['CPPPATH'] += qt_dirs
qt_flags = [
"-D_REENTRANT",
"-DQT_NO_DEBUG",
"-DQT_WIDGETS_LIB",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB"
]
qt_env['CXXFLAGS'] += qt_flags
5 years ago
src = ['ui.cc', 'paint.cc', 'sidebar.cc', '#phonelibs/nanovg/nanovg.c']
libs = [common, 'zmq', 'capnp', 'kj', 'm', cereal, messaging, gpucommon, visionipc]
5 years ago
if qt_env is None:
libs += ['EGL', 'GLESv3', 'gnustl_shared', 'log', 'utils', 'gui', 'hardware',
'ui', 'CB', 'gsl', 'adreno_utils', 'OpenSLES', 'cutils', 'uuid', 'OpenCL']
linkflags = ['-Wl,-rpath=/system/lib64,-rpath=/system/comma/usr/lib']
src += ["android/ui.cc", "android/sl_sound.cc"]
env.Program('_ui', src,
LINKFLAGS=linkflags,
LIBS=libs)
5 years ago
else:
qt_libs = ["pthread"]
qt_modules = ["Widgets", "Gui", "Core", "DBus", "Multimedia"]
if arch == "larch64":
qt_libs += ["GLESv2", "wayland-client"]
elif arch != "Darwin":
qt_libs += ["GL"]
if arch == "Darwin":
qt_env["FRAMEWORKS"] += [f"Qt{m}" for m in qt_modules] + ["OpenGL"]
else:
qt_libs += [f"Qt5{m}" for m in qt_modules]
QT UI: Wifi chooser (#2062) * qt wifi Squashed commit of the following: commit bec029c7b906c1df5324a8dbb0a58b8980c313ab Author: grekiki <gregor1234567890@gmail.com> Date: Mon Nov 2 19:31:30 2020 +0100 try to collect security type commit e1e4d97f48a293392d33fe607936bbe94415c846 Author: grekiki <gregor1234567890@gmail.com> Date: Mon Nov 2 16:06:55 2020 +0100 add a function for refresh commit 52bd7d0937040bd1d5c582f324fdb60f33677014 Author: grekiki <gregor1234567890@gmail.com> Date: Fri Oct 30 11:14:23 2020 +0100 allow compilation commit 1b91e1057cca564d6b021a579d97940a8f2b9328 Author: Gregor Kikelj <gregor1234567890@gmail.com> Date: Wed Oct 21 14:12:05 2020 +0200 dont build keyboard commit cc8bad2ddd668d1397a9003a518699c3f706cca8 Author: Gregor Kikelj <gregor1234567890@gmail.com> Date: Tue Oct 20 18:22:07 2020 +0200 kind of works commit ce3a9b6d96a1985ba5b9a2f17c15530cb8f93ca8 Author: Willem Melching <willem.melching@gmail.com> Date: Mon Oct 19 11:22:55 2020 +0200 remove button and text field commit 2db3d11bdb8e69098c34c04a1341ea707ce1ed6a Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 15:31:26 2020 +0200 try lineedit commit d045c302dcec612c8d2ff14ba256af06c7df9ebb Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 15:01:18 2020 +0200 add dialog test button commit 21fa63e33b12b0bcdad441e778b2cf6c42b113e4 Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 12:36:10 2020 +0200 Only show one if both 2.4 and 5 Ghz found commit dfb9ca4173adc05264663a3658298899eea2c619 Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 12:24:16 2020 +0200 Sort networks by strength commit e57fe68f7972f955fc4da7054af676df8581b003 Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:59:39 2020 +0200 Handle currently connected AP commit a5e80e122176f39a9bccfb8056b0886d210fdf24 Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:38:18 2020 +0200 Add todo commit 98a1bc6e7a1f38b0ff7cb810b7d63a133552dfcc Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:37:35 2020 +0200 Implement scan method commit 9a774a509b1665371d9fd51b40550ad2388d58bc Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:29:03 2020 +0200 show list of wifi networks * add to settings * no wifi on pc * refactor get_property * refactor WiFi, split between UI and network manager stuff * renaming * refresh works * refactor * forgot to git add * connecting works again * print connection error on weird networks * extract adapter path * found networks * Deleting existing connections to SSID we are trying to connect to * have paths of active connections * mvp * fix review * qt wifi Squashed commit of the following: commit bec029c7b906c1df5324a8dbb0a58b8980c313ab Author: grekiki <gregor1234567890@gmail.com> Date: Mon Nov 2 19:31:30 2020 +0100 try to collect security type commit e1e4d97f48a293392d33fe607936bbe94415c846 Author: grekiki <gregor1234567890@gmail.com> Date: Mon Nov 2 16:06:55 2020 +0100 add a function for refresh commit 52bd7d0937040bd1d5c582f324fdb60f33677014 Author: grekiki <gregor1234567890@gmail.com> Date: Fri Oct 30 11:14:23 2020 +0100 allow compilation commit 1b91e1057cca564d6b021a579d97940a8f2b9328 Author: Gregor Kikelj <gregor1234567890@gmail.com> Date: Wed Oct 21 14:12:05 2020 +0200 dont build keyboard commit cc8bad2ddd668d1397a9003a518699c3f706cca8 Author: Gregor Kikelj <gregor1234567890@gmail.com> Date: Tue Oct 20 18:22:07 2020 +0200 kind of works commit ce3a9b6d96a1985ba5b9a2f17c15530cb8f93ca8 Author: Willem Melching <willem.melching@gmail.com> Date: Mon Oct 19 11:22:55 2020 +0200 remove button and text field commit 2db3d11bdb8e69098c34c04a1341ea707ce1ed6a Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 15:31:26 2020 +0200 try lineedit commit d045c302dcec612c8d2ff14ba256af06c7df9ebb Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 15:01:18 2020 +0200 add dialog test button commit 21fa63e33b12b0bcdad441e778b2cf6c42b113e4 Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 12:36:10 2020 +0200 Only show one if both 2.4 and 5 Ghz found commit dfb9ca4173adc05264663a3658298899eea2c619 Author: Willem Melching <willem.melching@gmail.com> Date: Mon Aug 24 12:24:16 2020 +0200 Sort networks by strength commit e57fe68f7972f955fc4da7054af676df8581b003 Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:59:39 2020 +0200 Handle currently connected AP commit a5e80e122176f39a9bccfb8056b0886d210fdf24 Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:38:18 2020 +0200 Add todo commit 98a1bc6e7a1f38b0ff7cb810b7d63a133552dfcc Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:37:35 2020 +0200 Implement scan method commit 9a774a509b1665371d9fd51b40550ad2388d58bc Author: Willem Melching <willem.melching@gmail.com> Date: Sun Aug 23 13:29:03 2020 +0200 show list of wifi networks * add to settings * no wifi on pc * refactor get_property * refactor WiFi, split between UI and network manager stuff * renaming * refresh works * refactor * forgot to git add * connecting works again * print connection error on weird networks * extract adapter path * found networks * Deleting existing connections to SSID we are trying to connect to * have paths of active connections * mvp * fix review * fix bugs * fix text color * colors * wider button * show connected network first * fix sorting * remove hack * sorting * auto refresh * only refresh when widget is visible * scan once on startup * dont open dialog on qcom2 Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Comma Device <device@comma.ai> Co-authored-by: grekiki <gregor1234567890@gmail.com>
5 years ago
qt_src = ["qt/ui.cc", "qt/window.cc", "qt/qt_sound.cc", "qt/offroad/settings.cc", "qt/offroad/onboarding.cc", "qt/offroad/wifi.cc", "qt/offroad/wifiManager.cc"] + src
qt_env.Program("_ui", qt_src, LIBS=qt_libs + libs)
# spinner and text window
qt_env.Program("qt/text", ["qt/text.cc"], LIBS=qt_libs + libs)
qt_env.Program("qt/spinner", ["qt/spinner.cc"], LIBS=qt_libs + libs)
# setup and installer
if "BUILD_SETUP" in os.environ:
qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc"], LIBS=qt_libs + libs + ['curl'])
qt_env.Program("qt/setup/installer", ["qt/setup/installer.cc"], LIBS=qt_libs + libs)