Add day/night by gpio / gui fixes / lux values to gui / video stop by go back

This commit is contained in:
hawkeyexp 2018-11-30 12:30:49 +01:00
parent 3621a20cda
commit c30bdeb20b
7 changed files with 4723 additions and 96 deletions

View File

@ -159,6 +159,12 @@ void VideoService::onVideoFocusRequest(const aasdk::proto::messages::VideoFocusR
this->sendVideoFocusIndication();
channel_->receive(this->shared_from_this());
// stop video service on go back to openauto
if (request.focus_mode() == 2) {
OPENAUTO_LOG(info) << "[VideoService] Stop video service...";
VideoService::stop();
}
}
void VideoService::sendVideoFocusIndication()

View File

@ -175,6 +175,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
// by default hide bluetooth button on init
ui_->pushButtonBluetooth->hide();
// by default hide bluetooth button on init
ui_->pushButtonAndroidAuto->hide();
// by default hide media player
ui_->mediaWidget->hide();
ui_->pushButtonUSB->hide();
@ -1568,11 +1571,12 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
// clock viibility by settings
if (!this->configuration_->showClock()) {
ui_->Digital_clock->hide();
ui_->oldmenuDummy->show();
ui_->bigClock->hide();
this->NoClock = true;
} else {
this->NoClock = false;
if (this->UseBigClock) {
if (this->UseBigClock && ui_->oldmenuWidget->isVisible() == true) {
ui_->oldmenuDummy->hide();
ui_->bigClock->show();
if (oldGUIStyle) {
@ -1603,4 +1607,23 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
if (QString::number(this->configuration_->getAlphaTrans()) != QString::number(ui_->horizontalSliderAlpha->value())) {
ui_->horizontalSliderAlpha->setValue(static_cast<int>(this->configuration_->getAlphaTrans()));
}
// read value from tsl2561
QFileInfo lightsensorFile("/tmp/tsl2561");
if (lightsensorFile.exists()) {
QFile paramFile("/tmp/tsl2561");
paramFile.open(QIODevice::ReadOnly);
QTextStream data(&paramFile);
QStringList value = data.readAll().split("\n");
paramFile.close();
if (ui_->label_left->isVisible() == false) {
ui_->label_left->show();
}
ui_->label_left->setText("Lux: " + value[0]);
} else {
if (ui_->label_left->isVisible() == true) {
ui_->label_left->hide();
ui_->label_left->setText("");
}
}
}

View File

@ -272,6 +272,8 @@ void SettingsWindow::onSave()
params.append("#");
params.append( std::string(ui_->comboBoxLS->currentText().split(" ")[0].toStdString()) );
params.append("#");
params.append( std::string(ui_->comboBoxDayNight->currentText().toStdString()) );
params.append("#");
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
@ -725,6 +727,7 @@ void SettingsWindow::loadSystemValues()
} else {
ui_->comboBoxLS->setCurrentIndex(0);
}
ui_->comboBoxDayNight->setCurrentText(getparams[41]);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -121,6 +121,41 @@ color: rgb(255, 255, 255);</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_left">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(211, 215, 207);</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Header_Label">
<property name="sizePolicy">
@ -150,6 +185,44 @@ color: rgb(255, 255, 255);</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_right">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(211, 215, 207);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="devlabel_left">
<property name="font">
@ -442,61 +515,45 @@ outline: none;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="Digital_clock">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);
<item>
<widget class="QLabel" name="Digital_clock">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>12:00:00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</property>
<property name="text">
<string>12:00:00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
@ -556,6 +613,34 @@ color: rgb(255, 255, 255);</string>
</property>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="Layout_Sliderselect">
<item>
<widget class="QPushButton" name="pushButtonAndroidAuto">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(14, 8, 137, 0.5);
color: rgb(255, 255, 255);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;
</string>
</property>
<property name="text">
<string>Android
Auto</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDay">
<property name="sizePolicy">

View File

@ -408,47 +408,6 @@ outline: none;
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBoxMediaPlayer">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Media player defaults</string>
</property>
<layout class="QFormLayout" name="formLayout_5">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxAutoPlay">
<property name="text">
<string>auto play</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_AutoPlay">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Auto playback last played song on startup if available</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxAlpha">
<property name="sizePolicy">
@ -521,6 +480,47 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxMediaPlayer">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Media player defaults</string>
</property>
<layout class="QFormLayout" name="formLayout_5">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxAutoPlay">
<property name="text">
<string>auto play</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_AutoPlay">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Auto playback last played song on startup if available</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="autofill_space_tab1">
<property name="sizePolicy">
@ -4922,6 +4922,255 @@ subcontrol-position: center left;
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="daynightpin">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="text">
<string>DayNight-Pin</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxDayNight">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QScrollBar {
width: 40px;
background-color: rgba(85, 87, 83, 0.7);
}</string>
</property>
<item>
<property name="text">
<string>- - -</string>
</property>
</item>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>9</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
</property>
</item>
<item>
<property name="text">
<string>11</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
</property>
</item>
<item>
<property name="text">
<string>13</string>
</property>
</item>
<item>
<property name="text">
<string>14</string>
</property>
</item>
<item>
<property name="text">
<string>15</string>
</property>
</item>
<item>
<property name="text">
<string>16</string>
</property>
</item>
<item>
<property name="text">
<string>17</string>
</property>
</item>
<item>
<property name="text">
<string>18</string>
</property>
</item>
<item>
<property name="text">
<string>19</string>
</property>
</item>
<item>
<property name="text">
<string>20</string>
</property>
</item>
<item>
<property name="text">
<string>21</string>
</property>
</item>
<item>
<property name="text">
<string>22</string>
</property>
</item>
<item>
<property name="text">
<string>23</string>
</property>
</item>
<item>
<property name="text">
<string>24</string>
</property>
</item>
<item>
<property name="text">
<string>25</string>
</property>
</item>
<item>
<property name="text">
<string>26</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="text">
<string>Unused</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QScrollBar {
width: 40px;
background-color: rgba(85, 87, 83, 0.7);
}</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>

View File

@ -229,6 +229,14 @@ int main(int argc, char* argv[])
app->start(std::move(socket));
});
//QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAAStart, [&qApplication]() {
// OPENAUTO_LOG(info) << "[CS] Manual start android auto entity.";
//});
//QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAAStop, [&qApplication]() {
// OPENAUTO_LOG(info) << "[CS] Manual stop android auto entity.";
//});
app->waitForUSBDevice();
auto result = qApplication.exec();