mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-09 07:13:51 +08:00
Update UI
This commit is contained in:
+1
-1
Submodule opendbc_repo updated: ad06564a6b...9fd36c6d66
@@ -30,10 +30,10 @@ VehiclePanel::VehiclePanel(QWidget *parent) : QFrame(parent) {
|
||||
platformSelector = new PlatformSelector();
|
||||
list->addItem(platformSelector);
|
||||
|
||||
// Use updateUI() on offroad transition.
|
||||
QObject::connect(uiState(), &UIState::offroadTransition, this, [=](bool offroad_transition) {
|
||||
offroad = offroad_transition;
|
||||
updateUI();
|
||||
updatePanel(offroad);
|
||||
updateCarToggles();
|
||||
});
|
||||
|
||||
ScrollViewSP *scroller = new ScrollViewSP(list, this);
|
||||
@@ -70,14 +70,10 @@ VehiclePanel::VehiclePanel(QWidget *parent) : QFrame(parent) {
|
||||
main_layout->addWidget(vehicleScreen);
|
||||
}
|
||||
|
||||
void VehiclePanel::updateUI() {
|
||||
updatePanel(offroad);
|
||||
updateCarToggles();
|
||||
}
|
||||
|
||||
void VehiclePanel::showEvent(QShowEvent *event) {
|
||||
QFrame::showEvent(event);
|
||||
updateUI();
|
||||
updatePanel(offroad);
|
||||
updateCarToggles();
|
||||
}
|
||||
|
||||
void VehiclePanel::updatePanel(bool _offroad) {
|
||||
|
||||
@@ -33,6 +33,5 @@ private:
|
||||
int hkg_state = 0;
|
||||
|
||||
private slots:
|
||||
void updateUI();
|
||||
void updateCarToggles();
|
||||
};
|
||||
|
||||
@@ -50,13 +50,12 @@ def setup_car_interface_sp(CP: structs.CarParams, CP_SP: structs.CarParamsSP, pa
|
||||
if params is None:
|
||||
params = Params()
|
||||
|
||||
if CP.brand == 'hyundai':
|
||||
tuning_option_str = params.get("HyundaiLongTune")
|
||||
if tuning_option_str is not None:
|
||||
tuning_option_str = tuning_option_str.strip()
|
||||
if tuning_option_str != "0":
|
||||
CP_SP.flags |= HyundaiFlagsSP.HKGLONGTUNING.value
|
||||
if params.get_bool("HyundaiSmootherBraking"):
|
||||
tuning_option_str = params.get("HyundaiLongTune")
|
||||
if tuning_option_str is not None:
|
||||
tuning_option_str = tuning_option_str.strip()
|
||||
if tuning_option_str != "0":
|
||||
CP_SP.flags |= HyundaiFlagsSP.HKGLONGTUNING.value
|
||||
if params.get_bool("HyundaiSmootherBraking"):
|
||||
CP_SP.flags |= HyundaiFlagsSP.HKGLONGTUNING_BRAKING.value
|
||||
|
||||
if CP.brand == 'hyundai':
|
||||
|
||||
Reference in New Issue
Block a user