add vui display
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>
Fri, 14 Jun 2019 05:24:31 +0000 (14:24 +0900)
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>
Fri, 14 Jun 2019 05:24:31 +0000 (14:24 +0900)
homescreen/qml/main.qml
homescreen/src/homescreenvoice.cpp
homescreen/src/homescreenvoice.h

index de833a9..a0ff4f4 100644 (file)
@@ -243,6 +243,15 @@ Window {
         }
     }
 
+    Connections {
+        target: homescreenVoice
+        onShowInformation: {
+            bottomText.text = info
+            bottomInformation.visible = true
+            informationTimer.restart()
+        }
+    }
+
        Timer {
         id:notificationTimer
         interval: 3000
index 4a376e1..f56625e 100644 (file)
@@ -206,17 +206,19 @@ void HomescreenVoice::on_event(void *closure, const char *event, struct afb_wsj1
         return;
     }
 
-    const char* corestatus = json_object_get_string(json_state);
+    const char* info = json_object_get_string(json_state);
 
-    if (strcasecmp(corestatus, HomescreenVoice::state_lists[0].c_str()) == 0) {
+    if (strcasecmp(info, HomescreenVoice::state_lists[0].c_str()) == 0) {
         emit statusChanged(true);
     }
-    else if ((strcasecmp(corestatus, HomescreenVoice::state_lists[1].c_str()) == 0)||
-             (strcasecmp(corestatus, HomescreenVoice::state_lists[2].c_str()) == 0)||
-             (strcasecmp(corestatus, HomescreenVoice::state_lists[3].c_str()) == 0)||
-             (strcasecmp(corestatus, HomescreenVoice::state_lists[4].c_str()) == 0)){
+    else if ((strcasecmp(info, HomescreenVoice::state_lists[1].c_str()) == 0)||
+             (strcasecmp(info, HomescreenVoice::state_lists[2].c_str()) == 0)||
+             (strcasecmp(info, HomescreenVoice::state_lists[3].c_str()) == 0)||
+             (strcasecmp(info, HomescreenVoice::state_lists[4].c_str()) == 0)){
         emit statusChanged(false);
     }
+
+    emit showInformation(QString(QLatin1String(info)));
 }
 
 /**
index 6a4f7e5..011280c 100644 (file)
@@ -47,6 +47,7 @@ public:
     Q_INVOKABLE int startListening(void);
 signals:
     void statusChanged(bool status);
+    void showInformation(QString info);
 
 private:
     int initialize_websocket(void);