Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
367 commits
Select commit Hold shift + click to select a range
c411607
Update customGUI.h
Sage-A Apr 20, 2025
2c4b457
Update customGUI.cc
Sage-A Apr 20, 2025
2434e32
Update customGUI.cc
Sage-A Apr 20, 2025
2b3cdaf
Update customGUI.cc
Sage-A Apr 20, 2025
9e33b19
Update customGUI.cc
Sage-A Apr 20, 2025
6b906f1
Update customGUI.cc
Sage-A Apr 20, 2025
48f1866
Add files via upload
Sage-A Apr 20, 2025
bfa3bc3
Update customGUI.cc
Sage-A Apr 20, 2025
9678674
Update customGUI.cc
Sage-A Apr 20, 2025
50217bf
Update customGUI.h
Sage-A Apr 20, 2025
b921937
Update customGUI.cc
Sage-A Apr 20, 2025
2155fd3
Update customGUI.cc
Sage-A Apr 20, 2025
64183c2
Update customGUI.cc
Sage-A Apr 20, 2025
e2ba04e
Update customGUI.cc
Sage-A Apr 20, 2025
0933d8f
Delete selfdrive/assets/images/arrow.png
Sage-A Apr 20, 2025
942212c
Add files via upload
Sage-A Apr 20, 2025
b4f52e4
Update customGUI.cc
Sage-A Apr 20, 2025
78b7fcb
Update customGUI.cc
Sage-A Apr 20, 2025
99f791e
Update customGUI.cc
Sage-A Apr 20, 2025
4535e86
Update customGUI.cc
Sage-A Apr 20, 2025
263d516
Update customGUI.cc
Sage-A Apr 20, 2025
ab303ae
Update customGUI.cc
Sage-A Apr 20, 2025
152d3b3
Update customGUI.cc
Sage-A Apr 20, 2025
aceaa39
Update customGUI.cc
Sage-A Apr 20, 2025
082e85d
Update customGUI.cc
Sage-A Apr 20, 2025
06c4e4c
Update customGUI.h
Sage-A Apr 20, 2025
0ef2ebe
Update customGUI.cc
Sage-A Apr 20, 2025
af78cd3
Update customGUI.cc
Sage-A Apr 20, 2025
911b099
Update customGUI.cc
Sage-A Apr 20, 2025
f6a5175
Update customGUI.cc
Sage-A Apr 20, 2025
da4989b
Update customGUI.cc
Sage-A Apr 20, 2025
33325ed
Update customGUI.cc
Sage-A Apr 20, 2025
5587938
Update customGUI.h
Sage-A Apr 20, 2025
bc8b17f
Add files via upload
Sage-A Apr 20, 2025
a709279
Update customGUI.cc
Sage-A Apr 20, 2025
dc2f21b
Update customGUI.cc
Sage-A Apr 20, 2025
748ed6e
Update customGUI.cc
Sage-A Apr 20, 2025
3633fa2
Update customGUI.cc
Sage-A Apr 20, 2025
68fae80
Update customGUI.h
Sage-A Apr 20, 2025
5648a21
Update customGUI.h
Sage-A Apr 20, 2025
7f96900
Update customGUI.h
Sage-A Apr 20, 2025
d97c465
Update customGUI.h
Sage-A Apr 20, 2025
786e496
Update customGUI.cc
Sage-A Apr 20, 2025
037fda0
Update customGUI.h
Sage-A Apr 20, 2025
41a713e
Update customGUI.cc
Sage-A Apr 20, 2025
bf48905
Update customGUI.cc
Sage-A Apr 20, 2025
3e013a9
Update customGUI.cc
Sage-A Apr 20, 2025
0d31ddf
Update customGUI.h
Sage-A Apr 22, 2025
e140a0c
Update customGUI.cc
Sage-A Apr 22, 2025
ce2c8f4
Update customGUI.h
Sage-A Apr 22, 2025
00a4aac
Update customGUI.h
Sage-A Apr 22, 2025
e6f75a9
Update customGUI.cc
Sage-A Apr 22, 2025
1405549
Update customGUI.cc
Sage-A Apr 22, 2025
1687553
Update customGUI.cc
Sage-A Apr 22, 2025
9914197
Update customGUI.cc
Sage-A Apr 22, 2025
03ac58f
Update customGUI.cc
Sage-A Apr 22, 2025
ba699f4
Update customGUI.cc
Sage-A Apr 22, 2025
238daea
Update customGUI.cc
Sage-A Apr 22, 2025
7de1a9e
Update customGUI.h
Sage-A Apr 22, 2025
c186d0c
Update customGUI.cc
Sage-A Apr 22, 2025
22a78a4
Update customGUI.cc
Sage-A Apr 22, 2025
8955431
Update customGUI.cc
Sage-A Apr 22, 2025
45e38d2
Update customGUI.h
Sage-A Apr 22, 2025
103cf55
Update customGUI.h
Sage-A Apr 22, 2025
8d218f4
Update customGUI.cc
Sage-A Apr 22, 2025
26165b6
Update customGUI.cc
Sage-A Apr 22, 2025
923d756
Update customGUI.h
Sage-A Apr 22, 2025
ea40844
Update customGUI.cc
Sage-A Apr 22, 2025
5df40d3
Update customGUI.cc
Sage-A Apr 22, 2025
8123e79
Update customGUI.cc
Sage-A Apr 22, 2025
85dd454
Update customGUI.cc
Sage-A Apr 22, 2025
ead6c3c
Update customGUI.cc
Sage-A Apr 22, 2025
26a1cb5
Update customGUI.cc
Sage-A Apr 22, 2025
fd7aec2
Update customGUI.h
Sage-A Apr 22, 2025
bd3739b
Update customGUI.h
Sage-A Apr 22, 2025
123fb54
Update customGUI.cc
Sage-A Apr 22, 2025
da9be46
Update customGUI.cc
Sage-A Apr 22, 2025
a7c74d2
Update customGUI.cc
Sage-A Apr 22, 2025
b042115
Update customGUI.cc
Sage-A Apr 22, 2025
5c483aa
Update customGUI.cc
Sage-A Apr 22, 2025
a168b03
Update customGUI.cc
Sage-A Apr 22, 2025
7babfd5
Update customGUI.cc
Sage-A Apr 22, 2025
4c2326d
Update customGUI.cc
Sage-A Apr 22, 2025
2805ff9
Update customGUI.cc
Sage-A Apr 22, 2025
dccc857
Update customGUI.cc
Sage-A Apr 22, 2025
5d02c18
Update customGUI.cc
Sage-A Apr 22, 2025
49fc8e4
Update customGUI.cc
Sage-A Apr 22, 2025
290f116
Update customGUI.cc
Sage-A Apr 22, 2025
4d77b4e
Update customGUI.h
Sage-A Apr 23, 2025
4087e77
Update customGUI.cc
Sage-A Apr 23, 2025
0a1c784
Update customGUI.h
Sage-A Apr 23, 2025
2c8b5a2
Update customGUI.cc
Sage-A Apr 23, 2025
5800362
Update customGUI.cc
Sage-A Apr 23, 2025
14483dd
Update customGUI.cc
Sage-A Apr 23, 2025
e9f72cf
Update customGUI.h
Sage-A Apr 23, 2025
4aed645
Update customGUI.cc
Sage-A Apr 23, 2025
2bfcd61
Update customGUI.cc
Sage-A Apr 23, 2025
1e0eb22
Update customGUI.cc
Sage-A Apr 23, 2025
aeb5caa
Update customGUI.cc
Sage-A Apr 23, 2025
a6bcab2
Update customGUI.h
Sage-A Apr 23, 2025
63e716e
Update customGUI.cc
Sage-A Apr 23, 2025
97df816
Update customGUI.h
Sage-A Apr 23, 2025
2c6026a
Update customGUI.h
Sage-A Apr 23, 2025
21f4f41
Create acceleration.h
Sage-A Apr 24, 2025
02c96d3
Update acceleration.h
Sage-A Apr 24, 2025
1f5a66c
Create acceleration.cc
Sage-A Apr 24, 2025
a7fcfc1
Update acceleration.cc
Sage-A Apr 24, 2025
f7d3b7b
Update customGUI.h
Sage-A Apr 24, 2025
4efe8b4
Update customGUI.cc
Sage-A Apr 24, 2025
8d52745
Update acceleration.h
Sage-A Apr 24, 2025
9208e13
Update acceleration.cc
Sage-A Apr 24, 2025
121a443
Update customGUI.h
Sage-A Apr 24, 2025
f911c2b
Update customGUI.cc
Sage-A Apr 24, 2025
51ecd9d
Create SteeringW.h
Sage-A Apr 24, 2025
aa925ff
Rename SteeringW.h to steering.h
Sage-A Apr 24, 2025
71f60fd
Create steering.cc
Sage-A Apr 24, 2025
18fd677
Update SConscript
Sage-A Apr 24, 2025
9fb08e4
Update acceleration.h
Sage-A Apr 24, 2025
97e8e30
Update acceleration.cc
Sage-A Apr 24, 2025
407ea97
Update acceleration.h
Sage-A Apr 24, 2025
11e6961
Update acceleration.cc
Sage-A Apr 24, 2025
1e6f5e5
Update steering.h
Sage-A Apr 25, 2025
ad7b9ea
Update steering.h
Sage-A Apr 25, 2025
2af4892
Update customGUI.h
Sage-A Apr 25, 2025
0334c11
Update customGUI.cc
Sage-A Apr 25, 2025
731d5df
Update steering.cc
Sage-A Apr 25, 2025
a9a45d6
Update SConscript
Sage-A Apr 25, 2025
80bad44
Create status.h
Sage-A Apr 25, 2025
73705ae
Create status.cc
Sage-A Apr 25, 2025
f258a33
Update steering.cc
Sage-A Apr 25, 2025
eb93d9d
Update customGUI.h
Sage-A Apr 25, 2025
ceb8039
Update status.h
Sage-A Apr 25, 2025
46db918
Update status.cc
Sage-A Apr 26, 2025
4c96efd
Update customGUI.cc
Sage-A Apr 26, 2025
f97486f
Update steering.cc
Sage-A Apr 26, 2025
d489069
Update SConscript
Sage-A Apr 26, 2025
99a194b
Update status.cc
Sage-A Apr 26, 2025
44fde0c
Update status.h
Sage-A Apr 26, 2025
0114438
Update status.cc
Sage-A Apr 26, 2025
3094552
Update status.h
Sage-A Apr 26, 2025
26635bb
Update status.h
Sage-A Apr 26, 2025
899799e
Update status.h
Sage-A Apr 26, 2025
c995966
Update status.cc
Sage-A Apr 26, 2025
1a2e2d3
Update status.cc
Sage-A Apr 26, 2025
10712ac
Update customGUI.h
Sage-A Apr 26, 2025
c05979f
Update customGUI.cc
Sage-A Apr 26, 2025
28f61b3
Update status.cc
Sage-A Apr 26, 2025
f44592a
Update status.h
Sage-A Apr 26, 2025
31d6931
Update customGUI.cc
Sage-A Apr 26, 2025
8759a05
Update customGUI.cc
Sage-A Apr 26, 2025
f136750
Update status.h
Sage-A Apr 26, 2025
619fa32
Update status.h
Sage-A Apr 26, 2025
b90ca99
Update status.cc
Sage-A Apr 26, 2025
ea6c9dd
Update status.h
Sage-A Apr 26, 2025
4794926
Update customGUI.cc
Sage-A Apr 26, 2025
d0163cc
Update status.cc
Sage-A Apr 26, 2025
b831df1
Update status.cc
Sage-A Apr 26, 2025
bed9d52
Update status.cc
Sage-A Apr 26, 2025
9424ba9
Update status.h
Sage-A Apr 26, 2025
5efa4a6
Update status.cc
Sage-A Apr 26, 2025
499db77
Update status.cc
Sage-A Apr 26, 2025
dcd98b6
Update customGUI.cc
Sage-A Apr 26, 2025
95ad06b
Update status.h
Sage-A Apr 26, 2025
5b198ef
Update status.cc
Sage-A Apr 26, 2025
0581d6b
Update customGUI.cc
Sage-A Apr 26, 2025
e4f5bdb
Update status.h
Sage-A Apr 26, 2025
2cba3e4
Update status.cc
Sage-A Apr 26, 2025
1fa07cc
Update customGUI.cc
Sage-A Apr 26, 2025
3092fc1
Update customGUI.h
Sage-A Apr 26, 2025
17b81b3
Update status.h
Sage-A Apr 26, 2025
2d1314e
Update status.cc
Sage-A Apr 26, 2025
f52b943
Update status.cc
Sage-A Apr 26, 2025
24975b2
Update customGUI.cc
Sage-A Apr 26, 2025
b1157c7
Add files via upload
Sage-A Apr 27, 2025
d0b6479
Update status.h
Sage-A Apr 27, 2025
286b0e1
Update status.cc
Sage-A Apr 27, 2025
336ede6
Update customGUI.cc
Sage-A Apr 27, 2025
4e72e41
Update status.cc
Sage-A Apr 27, 2025
2342097
Update status.cc
Sage-A Apr 27, 2025
239c665
Update status.cc
Sage-A Apr 27, 2025
e1d2126
Update customGUI.cc
Sage-A Apr 27, 2025
a3893c8
Update status.cc
Sage-A Apr 27, 2025
379d82d
Update status.cc
Sage-A Apr 27, 2025
69b1bf8
Update status.cc
Sage-A Apr 27, 2025
3cbff67
Update status.cc
Sage-A Apr 27, 2025
2387145
Update customGUI.cc
Sage-A Apr 27, 2025
9ce1610
Update status.h
Sage-A Apr 27, 2025
e41e115
Update status.cc
Sage-A Apr 27, 2025
2799dda
Update status.cc
Sage-A Apr 27, 2025
0796f5f
Update status.cc
Sage-A Apr 27, 2025
242e38d
Update status.cc
Sage-A Apr 27, 2025
0e6cf64
Update status.cc
Sage-A Apr 27, 2025
9e3b33e
Update status.h
Sage-A Apr 27, 2025
2ee31a1
Update status.cc
Sage-A Apr 27, 2025
e376d35
Update status.cc
Sage-A Apr 27, 2025
9292a3b
Update status.cc
Sage-A Apr 27, 2025
47c8cef
Update status.cc
Sage-A Apr 27, 2025
6831f1f
Update status.cc
Sage-A Apr 27, 2025
0853c5d
Update status.cc
Sage-A Apr 27, 2025
b3798e3
Update status.cc
Sage-A Apr 27, 2025
d616b6e
Update status.cc
Sage-A Apr 27, 2025
87b215c
Update status.cc
Sage-A Apr 27, 2025
7d42ffd
Update status.cc
Sage-A Apr 27, 2025
97f75e6
Add files via upload
Sage-A Apr 27, 2025
62f52e6
Update status.h
Sage-A Apr 27, 2025
1575051
Update customGUI.cc
Sage-A Apr 27, 2025
215478f
Update status.cc
Sage-A Apr 27, 2025
2596f0b
Update status.cc
Sage-A Apr 27, 2025
b04327d
Update status.cc
Sage-A Apr 27, 2025
0ae9b98
Update status.cc
Sage-A Apr 27, 2025
4115821
Update status.cc
Sage-A Apr 27, 2025
177028e
Update status.cc
Sage-A Apr 27, 2025
a79ad36
Update status.cc
Sage-A Apr 27, 2025
f194293
Update status.cc
Sage-A Apr 27, 2025
d5908e7
Update customGUI.cc
Sage-A Apr 27, 2025
24ec858
Update status.h
Sage-A Apr 27, 2025
f7d4a2e
Update status.h
Sage-A Apr 27, 2025
b146f59
Update status.cc
Sage-A Apr 27, 2025
7ec5648
Update acceleration.cc
Sage-A Apr 27, 2025
8edb047
Update status.cc
Sage-A Apr 27, 2025
25f7bf7
Update steering.cc
Sage-A Apr 27, 2025
52d717c
Update status.h
Sage-A Apr 27, 2025
a14e2e8
Update status.cc
Sage-A Apr 27, 2025
3f44196
Update status.h
Sage-A Apr 27, 2025
1f9ddca
Update steering.cc
Sage-A Apr 27, 2025
c20f6c5
Update acceleration.cc
Sage-A Apr 27, 2025
b6693bd
Update status.cc
Sage-A Apr 27, 2025
c932d10
Update steering.cc
Sage-A Apr 27, 2025
0e07968
Update steering.cc
Sage-A Apr 27, 2025
08373f2
Update customGUI.cc
Sage-A Apr 27, 2025
2094820
Update steering.cc
Sage-A Apr 27, 2025
3730288
Update status.cc
Sage-A Apr 27, 2025
efd51ef
Update steering.cc
Sage-A Apr 27, 2025
960c75f
Update status.cc
Sage-A Apr 27, 2025
5fbbd7a
Update customGUI.cc
Sage-A Apr 27, 2025
ab8845b
Update customGUI.cc
Sage-A Apr 27, 2025
b8c4151
Update customGUI.cc
Sage-A Apr 27, 2025
80b6ea1
Update steering.cc
Sage-A Apr 27, 2025
d3550f9
Update customGUI.cc
Sage-A Apr 27, 2025
f6360b3
Update status.cc
Sage-A Apr 27, 2025
c360ab2
Update controls.cc
Sage-A Apr 27, 2025
c7eda94
Update settings.cc
Sage-A Apr 27, 2025
0f3f3ca
Update customGUI.h
Sage-A Apr 27, 2025
72360cf
Update customGUI.cc
Sage-A Apr 27, 2025
8cf1d2d
Update steering.h
Sage-A Apr 27, 2025
8ca5ca0
Update steering.cc
Sage-A Apr 27, 2025
f62a8eb
Update status.h
Sage-A Apr 27, 2025
094bc74
Update status.cc
Sage-A Apr 27, 2025
65a641a
Update acceleration.h
Sage-A Apr 27, 2025
ba78045
Update acceleration.cc
Sage-A Apr 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added selfdrive/assets/icons/blinkL_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/blinkL_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/blinkR_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/blinkR_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/indicatorC_alert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/indicatorC_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/indicatorC_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/indicatorC_warn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/indicator_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added selfdrive/assets/icons/indicator_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions selfdrive/assets/images/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions selfdrive/ui/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ Export('widgets')
qt_libs = [widgets, qt_util] + base_libs

qt_src = ["main.cc", "ui.cc", "qt/sidebar.cc", "qt/body.cc",
"qt/window.cc", "qt/home.cc", "qt/offroad/settings.cc",
"qt/window.cc", "qt/home.cc", "qt/offroad/settings.cc", "qt/offroad/customGUI.cc",
"qt/offroad/software_settings.cc", "qt/offroad/developer_panel.cc", "qt/offroad/onboarding.cc",
"qt/offroad/driverview.cc", "qt/offroad/experimental_mode.cc",
"qt/onroad/onroad_home.cc", "qt/onroad/annotated_camera.cc", "qt/onroad/model.cc",
"qt/onroad/buttons.cc", "qt/onroad/alerts.cc", "qt/onroad/driver_monitoring.cc", "qt/onroad/hud.cc"]
"qt/onroad/buttons.cc", "qt/onroad/alerts.cc", "qt/onroad/driver_monitoring.cc", "qt/onroad/hud.cc",
"qt/offroad/custom_widgets/acceleration.cc", "qt/offroad/custom_widgets/steering.cc", "qt/offroad/custom_widgets/status.cc"]

# build translation files
with open(File("translations/languages.json").abspath) as f:
Expand Down
170 changes: 170 additions & 0 deletions selfdrive/ui/qt/offroad/customGUI.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
#include <cassert>
#include <cmath>
#include <string>
#include <tuple>
#include <vector>

#include <QDebug>

#include "common/watchdog.h"
#include "common/util.h"
#include "selfdrive/ui/qt/network/networking.h"
#include "selfdrive/ui/qt/offroad/settings.h"
#include "selfdrive/ui/qt/qt_window.h"
#include "selfdrive/ui/qt/widgets/prime.h"
#include "selfdrive/ui/qt/widgets/scrollview.h"
#include "selfdrive/ui/qt/offroad/developer_panel.h"
#include "selfdrive/ui/qt/offroad/customGUI.h"
#include "cereal/gen/cpp/car.capnp.h"

// Bring custom window to the front
void CustomWindow::showEvent(QShowEvent *event) {
setCurrentPanel(0);
}

void CustomWindow::setCurrentPanel(int index, const QString &param) {}

CustomWindow::CustomWindow(QWidget *parent) : QFrame(parent) {
// Connect custom GUI update to parent uiState update function
QObject::connect(uiState(), &UIState::uiUpdate, this, &CustomWindow::updateState);

// Close btn returns to settings page
QPushButton *close_btn = new QPushButton(tr("×"));
close_btn->setStyleSheet(R"(
QPushButton {
font-size: 140px;
padding-bottom: 20px;
border-radius: 75px;
background-color: #555555;
font-weight: 400;
}
QPushButton:pressed {
background-color: #3B3B3B;
}
)");
close_btn->setFixedSize(150, 150);

// Status control buttons to hide/show indicator groups
QPushButton *blink_btn = new QPushButton(tr("Blinker"));
blink_btn->setStyleSheet(R"(
QPushButton {
font-size: 25px;
padding-bottom: 20px;
border-radius: 25px;
background-color: #555555;
}
QPushButton:pressed {
background-color: #3B3B3B;
}
)");
blink_btn->setFixedSize(125, 125);

QPushButton *car_btn = new QPushButton(tr("Car"));
car_btn->setStyleSheet(R"(
QPushButton {
font-size: 30px;
padding-bottom: 20px;
border-radius: 25px;
background-color: #555555;
}
QPushButton:pressed {
background-color: #3B3B3B;
}
)");
car_btn->setFixedSize(125, 125);

QPushButton *steer_btn = new QPushButton(tr("Steer"));
steer_btn->setStyleSheet(R"(
QPushButton {
font-size: 30px;
padding-bottom: 20px;
border-radius: 25px;
background-color: #555555;
}
QPushButton:pressed {
background-color: #3B3B3B;
}
)");
steer_btn->setFixedSize(125, 125);

QPushButton *drive_btn = new QPushButton(tr("Drive"));
drive_btn->setStyleSheet(R"(
QPushButton {
font-size: 30px;
padding-bottom: 20px;
border-radius: 25px;
background-color: #555555;
}
QPushButton:pressed {
background-color: #3B3B3B;
}
)");
drive_btn->setFixedSize(125, 125);

// main settings layout, sidebar + main panel
QHBoxLayout *main_layout = new QHBoxLayout(this);
main_layout->setSpacing(40);
QVBoxLayout *sidebar = new QVBoxLayout();
QVBoxLayout *primary = new QVBoxLayout();
QVBoxLayout *speed_bar = new QVBoxLayout();

sidebar->addWidget(close_btn);
sidebar->addWidget(blink_btn);
sidebar->addWidget(car_btn);
sidebar->addWidget(steer_btn);
sidebar->addWidget(drive_btn);

ss = new SteeringSlider(this);
lW = new BlinkerStatus(this);

carStat = new CarStatus(this);
steerStat = new SteerStatus(this);
driveStat = new DriveStatus(this);

primary->addWidget(lW);
primary->addWidget(carStat);
primary->addWidget(steerStat);
primary->addWidget(driveStat);
primary->addWidget(ss);

accW = new AccelerationW(this);
spW = new SpeedStatus(this, 0);
speed_bar->addWidget(spW);
speed_bar->addWidget(accW);

// Connect buttons to visibility functions + settings close
QObject::connect(blink_btn, &QPushButton::clicked, [&](){
lW->setVisible(!lW->isVisible());
});
QObject::connect(steer_btn, &QPushButton::clicked, [&](){
steerStat->setVisible(!steerStat->isVisible());
});
QObject::connect(car_btn, &QPushButton::clicked, [&](){
carStat->setVisible(!carStat->isVisible());
});
QObject::connect(drive_btn, &QPushButton::clicked, [&](){
driveStat->setVisible(!driveStat->isVisible());
});
QObject::connect(close_btn, &QPushButton::clicked, this, &CustomWindow::closeCustom);
main_layout->addLayout(sidebar);
main_layout->addLayout(primary);
main_layout->addLayout(speed_bar);
setStyleSheet(R"(
CustomWindow {
background-color: black;
}
)");
}

// Update contents of custom window
// Inherits from ui
void CustomWindow::updateState(const UIState &s) {
const SubMaster &sm = *(s.sm);
lW->update(sm);
spW->update(sm);
carStat->update(sm);
steerStat->update(sm);
driveStat->update(sm);
}


46 changes: 46 additions & 0 deletions selfdrive/ui/qt/offroad/customGUI.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#pragma once

#include <map>
#include <string>

#include <QButtonGroup>
#include <QFrame>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <QWidget>
#include <QSpinBox>
#include <QPixmap>

#include "selfdrive/ui/ui.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/widgets/controls.h"
#include "selfdrive/ui/qt/offroad/custom_widgets/acceleration.h"
#include "selfdrive/ui/qt/offroad/custom_widgets/steering.h"
#include "selfdrive/ui/qt/offroad/custom_widgets/status.h"

// ********** custom window **********
class CustomWindow : public QFrame {
Q_OBJECT

public:
explicit CustomWindow(QWidget *parent = 0);
void setCurrentPanel(int index, const QString &param = "");
void updateState(const UIState &s);

protected:
void showEvent(QShowEvent *event) override;

signals:
void closeCustom();

private:
// All widgets present in custom window
SteeringSlider *ss;
BlinkerStatus *lW;
AccelerationW *accW;
SpeedStatus *spW;
SteerStatus *steerStat;
DriveStatus *driveStat;
CarStatus *carStat;
};
57 changes: 57 additions & 0 deletions selfdrive/ui/qt/offroad/custom_widgets/acceleration.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <cassert>
#include <cmath>
#include <string>
#include <tuple>
#include <vector>

#include <QDebug>

#include "common/watchdog.h"
#include "common/util.h"
#include "selfdrive/ui/qt/network/networking.h"
#include "selfdrive/ui/qt/offroad/settings.h"
#include "selfdrive/ui/qt/qt_window.h"
#include "selfdrive/ui/qt/widgets/prime.h"
#include "selfdrive/ui/qt/widgets/scrollview.h"
#include "selfdrive/ui/qt/offroad/developer_panel.h"
#include "selfdrive/ui/qt/offroad/customGUI.h"
#include "cereal/gen/cpp/car.capnp.h"
#include "selfdrive/ui/qt/offroad/custom_widgets/acceleration.h"

AccelerationW::AccelerationW(QWidget* parent) : QWidget(parent) {
// Create title and control buttons
QVBoxLayout *main = new QVBoxLayout(this);
QLabel *title2 = new QLabel("Acceleration");
title2->setStyleSheet(R"(
QLabel {
font-size: 40px;
font-weight: bold;
color: #a9a9a9;
}
)");

QPushButton *incBtn = new QPushButton(tr("^"));
incBtn->setFixedSize(200, 350);

QPushButton *decBtn = new QPushButton(tr("V"));
decBtn->setFixedSize(200, 350);

// Add widgets to layout
main->addWidget(title2);
main->addWidget(incBtn);
main->addWidget(decBtn);

setStyleSheet(R"(
QPushButton {
font-size: 140px;
padding-bottom: 20px;
background-color: #DDDDDD;
font-weight: 400;
}
QPushButton:pressed {
background-color: #3B3B3B;
}
)");

main->setAlignment(Qt::AlignRight);
}
23 changes: 23 additions & 0 deletions selfdrive/ui/qt/offroad/custom_widgets/acceleration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include <map>
#include <string>

#include <QButtonGroup>
#include <QFrame>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <QWidget>
#include <QSpinBox>
#include <QPixmap>

#include "selfdrive/ui/ui.h"
#include "selfdrive/ui/qt/util.h"

// Creates gas / brake controls
class AccelerationW : public QWidget {
Q_OBJECT
public:
explicit AccelerationW(QWidget *parent);
};
Loading
Loading