mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-09-30 19:33:49 +08:00
Qt driverview (#21063)
* CameraViewWidget
* continue
* cleanup
* mv DriverViewWindow to ui/qt/offroad
* write IsDriverViewEnabled in showEvent/hideEvnet
* sm.update(0) in onTimeout()
* CameraViewWidget
* use unique_ptr for vipc_client
* virtual draw
* fix viewport
* connected()->frameReceived()
* bg_colors use QColor
* fix draw
* rebase master
* whitespace
* apply reviews
* indent
* like onroad
continue
* white space
* continue
* show == false
* remove border
* use widget's size
* fix shadowed rect
* cleanup driverview
* fix transform
* remove video_rect
Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 9876723169
This commit is contained in:
+3
-7
@@ -203,7 +203,7 @@ static void update_state(UIState *s) {
|
||||
|
||||
scene.light_sensor = std::clamp<float>((1023.0 / max_lines) * (max_lines - camera_state.getIntegLines() * gain), 0.0, 1023.0);
|
||||
}
|
||||
scene.started = sm["deviceState"].getDeviceState().getStarted() || scene.driver_view;
|
||||
scene.started = sm["deviceState"].getDeviceState().getStarted();
|
||||
}
|
||||
|
||||
static void update_params(UIState *s) {
|
||||
@@ -251,7 +251,6 @@ static void update_status(UIState *s) {
|
||||
s->status = STATUS_DISENGAGED;
|
||||
s->scene.started_frame = s->sm->frame;
|
||||
|
||||
s->scene.is_rhd = Params().getBool("IsRHD");
|
||||
s->scene.end_to_end = Params().getBool("EndToEndToggle");
|
||||
s->wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false;
|
||||
|
||||
@@ -259,9 +258,7 @@ static void update_status(UIState *s) {
|
||||
ui_resize(s, s->fb_w, s->fb_h);
|
||||
|
||||
// Choose vision ipc client
|
||||
if (s->scene.driver_view) {
|
||||
s->vipc_client = s->vipc_client_front;
|
||||
} else if (s->wide_camera){
|
||||
if (s->wide_camera){
|
||||
s->vipc_client = s->vipc_client_wide;
|
||||
} else {
|
||||
s->vipc_client = s->vipc_client_rear;
|
||||
@@ -277,7 +274,7 @@ static void update_status(UIState *s) {
|
||||
QUIState::QUIState(QObject *parent) : QObject(parent) {
|
||||
ui_state.sm = std::make_unique<SubMaster, const std::initializer_list<const char *>>({
|
||||
"modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "liveLocationKalman",
|
||||
"pandaState", "carParams", "driverState", "driverMonitoringState", "sensorEvents", "carState", "ubloxGnss",
|
||||
"pandaState", "carParams", "driverMonitoringState", "sensorEvents", "carState", "ubloxGnss",
|
||||
"gpsLocationExternal", "roadCameraState",
|
||||
});
|
||||
|
||||
@@ -288,7 +285,6 @@ QUIState::QUIState(QObject *parent) : QObject(parent) {
|
||||
ui_state.wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false;
|
||||
|
||||
ui_state.vipc_client_rear = new VisionIpcClient("camerad", VISION_STREAM_RGB_BACK, true);
|
||||
ui_state.vipc_client_front = new VisionIpcClient("camerad", VISION_STREAM_RGB_FRONT, true);
|
||||
ui_state.vipc_client_wide = new VisionIpcClient("camerad", VISION_STREAM_RGB_WIDE, true);
|
||||
|
||||
ui_state.vipc_client = ui_state.vipc_client_rear;
|
||||
|
||||
Reference in New Issue
Block a user