diff --git a/include/f1x/openauto/autoapp/UI/MainWindow.hpp b/include/f1x/openauto/autoapp/UI/MainWindow.hpp index 803ff9a..9aba662 100644 --- a/include/f1x/openauto/autoapp/UI/MainWindow.hpp +++ b/include/f1x/openauto/autoapp/UI/MainWindow.hpp @@ -80,7 +80,9 @@ private: Ui::MainWindow* ui_; bool brightnessSliderVisible = false; QString brightnessFilename = "/sys/class/backlight/rpi_backlight/brightness"; + QString brightnessFilenameAlt = "/tmp/custombrightness"; QFile *brightnessFile; + QFile *brightnessFileAlt; char brightness_str[5]; bool wifiButtonForce = false; diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index 622ea78..ec80381 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -300,6 +300,7 @@ void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderBrightness_value int n = snprintf(this->brightness_str, 4, "%d", value); this->brightnessFile = new QFile(this->brightnessFilename); + this->brightnessFileAlt = new QFile(this->brightnessFilenameAlt); if (this->brightnessFile->open(QIODevice::WriteOnly)) { this->brightness_str[n] = '\n'; @@ -307,6 +308,13 @@ void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderBrightness_value this->brightnessFile->write(this->brightness_str); this->brightnessFile->close(); } + if (this->brightnessFileAlt->open(QIODevice::WriteOnly)) { + this->brightness_str[n] = '\n'; + this->brightness_str[n+1] = '\0'; + this->brightnessFileAlt->write(this->brightness_str); + this->brightnessFileAlt->close(); + system("/usr/local/bin/autoapp_helper custombrightness &"); + } } void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight() diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index b6d7a09..8d9bae2 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -517,6 +517,13 @@ void SettingsWindow::loadSystemValues() } else { ui_->checkBoxDisableScreenOff->setChecked(false); } + + // set custom brightness command + if (getparams[26] == "1") { + ui_->checkBoxCustomBrightnessCommand->setChecked(true); + } else { + ui_->checkBoxCustomBrightnessCommand->setChecked(false); + } } } diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index 536a43a..2ef7527 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -2473,7 +2473,7 @@ subcontrol-position: center left; 0 - 180 + 160 616 81 @@ -2604,7 +2604,7 @@ subcontrol-position: center left; 0 - 290 + 250 300 61 @@ -2646,7 +2646,7 @@ subcontrol-position: center left; 2 - 410 + 420 612 23 @@ -2670,7 +2670,7 @@ subcontrol-position: center left; 80 - 406 + 416 31 31 @@ -2683,7 +2683,7 @@ subcontrol-position: center left; 320 - 290 + 250 296 61 @@ -2721,6 +2721,69 @@ subcontrol-position: center left; + + + + 0 + 320 + 616 + 91 + + + + Custom Brightness Command + + + + + 10 + 30 + 281 + 23 + + + + Custom Birghtness Command activated + + + true + + + + + + 30 + 56 + 21 + 31 + + + + <html><head/><body><p><img src=":/ico_info.png"/></p></body></html> + + + + + + 60 + 60 + 551 + 23 + + + + + true + + + + Just an information - not checkable! - Can be activated in crankshaft_env.sh! + + + true + + +