mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
41
SConstruct
41
SConstruct
@@ -186,45 +186,6 @@ env = Environment(
|
||||
]
|
||||
)
|
||||
|
||||
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",
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
if os.environ.get('SCONS_CACHE'):
|
||||
cache_dir = '/tmp/scons_cache'
|
||||
|
||||
@@ -263,7 +224,7 @@ def abspath(x):
|
||||
|
||||
# still needed for apks
|
||||
zmq = 'zmq'
|
||||
Export('env', 'qt_env', 'arch', 'zmq', 'SHARED', 'USE_WEBCAM', 'QCOM_REPLAY')
|
||||
Export('env', 'arch', 'real_arch', 'zmq', 'SHARED', 'USE_WEBCAM', 'QCOM_REPLAY')
|
||||
|
||||
# cereal and messaging are shared with the system
|
||||
SConscript(['cereal/SConscript'])
|
||||
|
||||
@@ -1,4 +1,45 @@
|
||||
Import('env', 'qt_env', 'arch', 'common', 'messaging', 'gpucommon', 'visionipc', 'cereal')
|
||||
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",
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
src = ['ui.cc', 'paint.cc', 'sidebar.cc', '#phonelibs/nanovg/nanovg.c']
|
||||
libs = [common, 'zmq', 'capnp', 'kj', 'm', cereal, messaging, gpucommon, visionipc]
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QGuiApplication>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QStackedLayout>
|
||||
@@ -11,8 +9,7 @@
|
||||
#include "qt/qt_sound.hpp"
|
||||
#include "ui/ui.hpp"
|
||||
|
||||
class MainWindow : public QWidget
|
||||
{
|
||||
class MainWindow : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -33,8 +30,8 @@ const int vwp_w = 2160;
|
||||
const int vwp_w = 1920;
|
||||
#endif
|
||||
const int vwp_h = 1080;
|
||||
class GLWindow : public QOpenGLWidget, protected QOpenGLFunctions
|
||||
{
|
||||
|
||||
class GLWindow : public QOpenGLWidget, protected QOpenGLFunctions {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -48,7 +45,6 @@ protected:
|
||||
void resizeGL(int w, int h) override;
|
||||
void paintGL() override;
|
||||
|
||||
|
||||
private:
|
||||
QTimer * timer;
|
||||
QTimer * backlight_timer;
|
||||
@@ -57,7 +53,8 @@ private:
|
||||
QtSound sound;
|
||||
|
||||
bool onroad = true;
|
||||
QLabel * label = NULL;
|
||||
|
||||
// TODO: this shouldn't be here
|
||||
float brightness_b = 0;
|
||||
float brightness_m = 0;
|
||||
float smooth_brightness = 0;
|
||||
|
||||
Reference in New Issue
Block a user