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

View File

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

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>862</width> <width>862</width>
<height>1301</height> <height>1419</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -1621,6 +1621,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1649,6 +1661,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1677,6 +1701,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1705,6 +1741,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1733,6 +1781,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1761,6 +1821,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1813,6 +1885,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1841,6 +1925,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1869,6 +1965,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -1948,59 +2056,207 @@ outline: none;</string>
<number>10</number> <number>10</number>
</property> </property>
<item> <item>
<widget class="QPushButton" name="pushButtonAndroidAuto2"> <widget class="QWidget" name="AAUSBWidget2" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="styleSheet"> <layout class="QVBoxLayout" name="verticalLayout_11">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <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">
<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="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset>
<normalon>:/aausb-hot.png</normalon> <normalon>:/aausb-hot.png</normalon>
</iconset> </iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>50</width> <width>50</width>
<height>50</height> <height>50</height>
</size> </size>
</property> </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> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonWifi2"> <widget class="QWidget" name="AAWIFIWidget2" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="styleSheet"> <layout class="QVBoxLayout" name="verticalLayout_12">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <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">
<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="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset>
<normalon>:/aawifi-hot.png</normalon> <normalon>:/aawifi-hot.png</normalon>
</iconset> </iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>50</width> <width>50</width>
<height>50</height> <height>50</height>
</size> </size>
</property> </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> </widget>
</item> </item>
<item> <item>
@ -2011,6 +2267,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -2039,6 +2307,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -2067,6 +2347,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -2095,6 +2387,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>
@ -2123,6 +2427,18 @@ outline: none;</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5); <string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string> outline: none;</string>