aboutsummaryrefslogtreecommitdiffstats
path: root/HomeScreenSimulator
diff options
context:
space:
mode:
authorBocklage, Jens <Jens_Bocklage@mentor.com>2016-10-05 16:25:19 +0200
committerBocklage, Jens <Jens_Bocklage@mentor.com>2016-10-05 16:25:19 +0200
commitc32114eb2ccbe142d73c06a5992544d6eacb97d0 (patch)
tree4525461f495d7aeb37258ef95b5fea7484f9d085 /HomeScreenSimulator
parent5a040cf1e77872dd567f6ffba50ed79fc27d5822 (diff)
Implemented proximity interface.v0.3.1
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
Diffstat (limited to 'HomeScreenSimulator')
-rw-r--r--HomeScreenSimulator/README.md6
-rw-r--r--HomeScreenSimulator/resources/mainwindow.ui34
-rw-r--r--HomeScreenSimulator/src/main.cpp2
-rw-r--r--HomeScreenSimulator/src/mainwindow.cpp13
-rw-r--r--HomeScreenSimulator/src/mainwindow.h4
5 files changed, 57 insertions, 2 deletions
diff --git a/HomeScreenSimulator/README.md b/HomeScreenSimulator/README.md
index 2f4bd17..d040de9 100644
--- a/HomeScreenSimulator/README.md
+++ b/HomeScreenSimulator/README.md
@@ -9,6 +9,12 @@ https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen
AGL repo for bitbake recipe:
https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+v0.3.1
+10/05/2016
+
+#new features
+- implemented proximity
+
v0.3.0
09/30/2016
diff --git a/HomeScreenSimulator/resources/mainwindow.ui b/HomeScreenSimulator/resources/mainwindow.ui
index 1915a24..6c6e7d0 100644
--- a/HomeScreenSimulator/resources/mainwindow.ui
+++ b/HomeScreenSimulator/resources/mainwindow.ui
@@ -180,6 +180,40 @@
</widget>
</widget>
</widget>
+ <widget class="QWidget" name="tab_Proximity">
+ <attribute name="title">
+ <string>Proximity</string>
+ </attribute>
+ <widget class="QLabel" name="label_explanation">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>301</width>
+ <height>231</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Wikipedia:&lt;/p&gt;&lt;p&gt;A proximity sensor is a sensor able to detect the presence of nearby objects without any physical contact.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;This info can be used to detect the hand of the user that wants to use the touch screen. So the HMI can change its look to provide for example larger push buttons.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="checkBox_ObjectDetected">
+ <property name="geometry">
+ <rect>
+ <x>100</x>
+ <y>300</y>
+ <width>151</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>object detected</string>
+ </property>
+ </widget>
+ </widget>
<widget class="QWidget" name="tab_FutureFeatures">
<attribute name="title">
<string>Future features</string>
diff --git a/HomeScreenSimulator/src/main.cpp b/HomeScreenSimulator/src/main.cpp
index 00c7ac2..b81b6cb 100644
--- a/HomeScreenSimulator/src/main.cpp
+++ b/HomeScreenSimulator/src/main.cpp
@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
QCoreApplication::setApplicationName("HomeScreenSimulator");
- QCoreApplication::setApplicationVersion("0.3.0");
+ QCoreApplication::setApplicationVersion("0.3.1");
MainWindow w;
w.show();
diff --git a/HomeScreenSimulator/src/mainwindow.cpp b/HomeScreenSimulator/src/mainwindow.cpp
index d670154..743c854 100644
--- a/HomeScreenSimulator/src/mainwindow.cpp
+++ b/HomeScreenSimulator/src/mainwindow.cpp
@@ -22,7 +22,8 @@ MainWindow::MainWindow(QWidget *parent) :
mp_ui(new Ui::MainWindow),
mp_dBusDayNightModeAdapter(0),
mp_dBusStatusBarProxy(0),
- mp_dBusPopupProxy(0)
+ mp_dBusPopupProxy(0),
+ mp_dBusProximityProxy(0)
{
mp_ui->setupUi(this);
@@ -43,6 +44,10 @@ MainWindow::MainWindow(QWidget *parent) :
"/Popup",
QDBusConnection::sessionBus(),
0);
+ mp_dBusProximityProxy = new org::agl::proximity("org.agl.homescreen",
+ "/Proximity",
+ QDBusConnection::sessionBus(),
+ 0);
QSettings settings;
this->move(settings.value("homescreensimulator/pos").toPoint());
mp_ui->radioButton_DayMode->setChecked(settings.value("homescreensimulator/daymode", true).toBool()); // if nothing is stored, use "true"
@@ -56,6 +61,7 @@ MainWindow::~MainWindow()
settings.setValue("homescreensimulator/daymode", mp_ui->radioButton_DayMode->isChecked());
settings.setValue("homescreensimulator/nightmode", mp_ui->radioButton_NightMode->isChecked());
+ delete mp_dBusProximityProxy;
delete mp_dBusPopupProxy;
delete mp_dBusStatusBarProxy;
@@ -159,3 +165,8 @@ void MainWindow::on_pushButton_comboBoxExample_clicked()
choices.append("Item4");
mp_dBusPopupProxy->showPopupComboBox("Make your choice!", choices);
}
+
+void MainWindow::on_checkBox_ObjectDetected_clicked()
+{
+ mp_dBusProximityProxy->setObjectDetected(Qt::Checked == mp_ui->checkBox_ObjectDetected->checkState());
+}
diff --git a/HomeScreenSimulator/src/mainwindow.h b/HomeScreenSimulator/src/mainwindow.h
index dd412a3..702a338 100644
--- a/HomeScreenSimulator/src/mainwindow.h
+++ b/HomeScreenSimulator/src/mainwindow.h
@@ -23,6 +23,7 @@
#include "statusbar_proxy.h"
#include "popup_proxy.h"
+#include "proximity_proxy.h"
namespace Ui {
class MainWindow;
@@ -59,11 +60,14 @@ private slots:
void on_pushButton_comboBoxExample_clicked();
+ void on_checkBox_ObjectDetected_clicked();
+
private:
Ui::MainWindow *mp_ui;
DaynightmodeAdaptor *mp_dBusDayNightModeAdapter;
org::agl::statusbar *mp_dBusStatusBarProxy;
org::agl::popup *mp_dBusPopupProxy;
+ org::agl::proximity *mp_dBusProximityProxy;
};
#endif // MAINWINDOW_H