Fixes / Merge changes from manvirrr

This commit is contained in:
hawkeyexp 2018-12-06 14:17:19 +01:00
parent fabcc84896
commit fe62796cc9
3 changed files with 384 additions and 54 deletions

View File

@ -36,6 +36,7 @@ public:
SensorService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger);
bool isNight = false;
bool previous = false;
bool stopPolling = false;
void start() override;
void stop() override;
@ -50,6 +51,7 @@ private:
void sendNightData();
bool is_file_exist(const char *filename);
void nightSensorPolling();
bool firstRun = true;
boost::asio::deadline_timer timer_;
boost::asio::io_service::strand strand_;

View File

@ -191,7 +191,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->SysinfoTopLeft->hide();
ui_->pushButtonWifiSetup->hide();
//ui_->pushButtonNoDevice->hide();
ui_->pushButtonAndroidAuto->hide();
ui_->pushButtonAndroidAuto2->hide();
@ -251,11 +250,11 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
// hide wifi if not forced
if (!this->wifiButtonForce) {
//ui_->pushButtonWifi->hide();
ui_->pushButtonWifi2->hide();
ui_->AAWIFIWidget->hide();
ui_->AAWIFIWidget2->hide();
} else {
ui_->AAUSBWidget->hide();
ui_->AAUSBWidget2->hide();
}
// set custom buttons if file enabled by trigger file
@ -1199,7 +1198,7 @@ void f1x::openauto::autoapp::ui::MainWindow::setTrigger()
void f1x::openauto::autoapp::ui::MainWindow::setRetryUSBConnect()
{
ui_->SysinfoTopLeft->setText("Trying USB reconnect ...");
ui_->SysinfoTopLeft->setText("Trying USB connect ...");
ui_->SysinfoTopLeft->show();
QTimer::singleShot(10000, this, SLOT(resetRetryUSBMessage()));
@ -1387,18 +1386,23 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
}
// check if phone is conencted to usb
if (std::ifstream("/tmp/android_device")) {
if (ui_->pushButtonAndroidAuto->isVisible() == false) {
ui_->pushButtonAndroidAuto->show();
ui_->pushButtonAndroidAuto2->show();
ui_->pushButtonNoDevice->hide();
}
if (ui_->pushButtonAndroidAuto2->isVisible() == false) {
ui_->pushButtonAndroidAuto2->show();
ui_->pushButtonNoDevice2->hide();
}
} else {
if (ui_->pushButtonAndroidAuto->isVisible() == true) {
ui_->pushButtonAndroidAuto->hide();
ui_->pushButtonAndroidAuto2->hide();
ui_->pushButtonNoDevice->show();
ui_->pushButtonAndroidAuto->hide();
}
if (ui_->pushButtonAndroidAuto2->isVisible() == true) {
ui_->pushButtonNoDevice2->show();
ui_->pushButtonAndroidAuto2->hide();
}
}
@ -1534,7 +1538,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
}
}
// check if sutdown is external triggered and init clean app exit
// check if shutdown is external triggered and init clean app exit
if (std::ifstream("/tmp/external_exit")) {
f1x::openauto::autoapp::ui::MainWindow::MainWindow::exit();
}
@ -1542,20 +1546,20 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
QFileInfo hotspotFile("/tmp/hotspot_active");
this->hotspotActive = hotspotFile.exists();
// hide wifi if not forced
// hide wifi if hotspot disabled
if (!this->hotspotActive) {
if ((ui_->AAWIFIWidget->isVisible() == true) || (ui_->pushButtonWifi2->isVisible() == true)){
//ui_->pushButtonWifi->hide();
if ((ui_->AAWIFIWidget->isVisible() == true) || (ui_->AAWIFIWidget2->isVisible() == true)){
ui_->AAWIFIWidget->hide();
ui_->pushButtonWifi2->hide();
ui_->AAWIFIWidget2->hide();
ui_->AAUSBWidget->show();
ui_->AAUSBWidget2->show();
}
} else {
if ((ui_->AAWIFIWidget->isVisible() == false) || (ui_->pushButtonWifi2->isVisible() == false)) {
//ui_->pushButtonWifi->show();
if ((ui_->AAWIFIWidget->isVisible() == false) || (ui_->AAWIFIWidget2->isVisible() == false)) {
ui_->AAWIFIWidget->show();
ui_->pushButtonWifi2->show();
ui_->AAWIFIWidget2->show();
ui_->AAUSBWidget->hide();
ui_->AAUSBWidget2->hide();
}
}
@ -1564,11 +1568,19 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
ui_->pushButtonWifi->show();
ui_->pushButtonNoWiFiDevice->hide();
}
if (ui_->pushButtonWifi2->isVisible() == false) {
ui_->pushButtonWifi2->show();
ui_->pushButtonNoWiFiDevice2->hide();
}
} else {
if (ui_->pushButtonWifi->isVisible() == true) {
ui_->pushButtonNoWiFiDevice->show();
ui_->pushButtonWifi->hide();
}
if (ui_->pushButtonWifi2->isVisible() == true) {
ui_->pushButtonNoWiFiDevice2->show();
ui_->pushButtonWifi2->hide();
}
}
// handle dummys in classic menu
@ -1576,7 +1588,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
if (ui_->pushButtonCameraShow2->isVisible() == true) {
button_count = button_count + 1;
}
if (ui_->pushButtonWifi2->isVisible() == true) {
if (ui_->AAWIFIWidget2->isVisible() == true) {
button_count = button_count + 1;
}
if (ui_->pushButtonDebug2->isVisible() == true) {

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>862</width>
<height>1301</height>
<height>1419</height>
</rect>
</property>
<property name="sizePolicy">
@ -1621,6 +1621,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1649,6 +1661,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1677,6 +1701,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1705,6 +1741,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1733,6 +1781,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1761,6 +1821,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1813,6 +1885,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1841,6 +1925,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1869,6 +1965,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1947,6 +2055,27 @@ outline: none;</string>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<widget class="QWidget" name="AAUSBWidget2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonAndroidAuto2">
<property name="sizePolicy">
@ -1955,6 +2084,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -1975,6 +2116,68 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNoDevice2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</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(136, 138, 133, 0.5);
color: rgb(255, 255, 255);
outline: none;</string>
</property>
<property name="text">
<string>No
USB
Device</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="AAWIFIWidget2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonWifi2">
<property name="sizePolicy">
@ -1983,6 +2186,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -2003,6 +2218,47 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNoWiFiDevice2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</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(136, 138, 133, 0.5);
color: rgb(255, 255, 255);
outline: none;</string>
</property>
<property name="text">
<string>No
WiFi
Device</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDay2">
<property name="sizePolicy">
@ -2011,6 +2267,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -2039,6 +2307,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -2067,6 +2347,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -2095,6 +2387,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
@ -2123,6 +2427,18 @@ outline: none;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>66</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>66</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>