Send 2nd depth grid information after 1st depth grid 91/281791/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Wed, 21 Sep 2022 11:04:26 +0000 (20:04 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Thu, 22 Sep 2022 03:12:19 +0000 (12:12 +0900)
Change-Id: I1c46354a337a554db864dd4e30e22b2d57a44c0b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/mmimgr/iu/VoiceTouchEngine.cpp
src/mmimgr/iu/VoiceTouchEngine.h

index 8931d60..cf79b4e 100644 (file)
@@ -279,13 +279,16 @@ Eina_Bool VoiceTouchEngine::findCommandCallback(void *data)
        }
 
        if (engine->__currentMode == VOICE_TOUCH_MODE_GRID && engine->__currentGridInfo.currentStep == 0) {
-               _I("[VoiceTouchEngine] Grid first step. Skip modality request");
+               _I("[VoiceTouchEngine] Grid first step. Skip modality request and send 2nd step grid");
+               engine->updateCurrentGridInfo(*command);
+               engine->__makeClickableItemResultTimer = ecore_timer_add(0.0, makeClickableItemResultCallback, data);
                return ECORE_CALLBACK_CANCEL;
        }
 
        _I("[VoiceTouchEngine] Command. object ID(%s)", command->objectId.c_str());
        engine->makeTouchModality(*command, timestamp);
        engine->invokeOutputModalityCallback(&engine->__touchModality);
+       engine->resetCurrentGridInfo();
 
        return ECORE_CALLBACK_CANCEL;
 }
@@ -340,6 +343,15 @@ void VoiceTouchEngine::resetCurrentGridInfo()
        __currentGridInfo.height = __displayHeight;
 }
 
+void VoiceTouchEngine::updateCurrentGridInfo(const ClickableItem &item)
+{
+       __currentGridInfo.currentStep++;
+       __currentGridInfo.coordX = item.coordX;
+       __currentGridInfo.coordY = item.coordY;
+       __currentGridInfo.width = item.width;
+       __currentGridInfo.height = item.height;
+}
+
 void VoiceTouchEngine::makeClickableItemInfo(int timestamp, JsonProvider &provider)
 {
        _I("[VoiceTouchEngine] Make clickable object list output. timestamp(%d), Current mode(%d)", timestamp, __currentMode);
@@ -426,22 +438,6 @@ void VoiceTouchEngine::updateCommands()
 void VoiceTouchEngine::makeTouchModality(const ClickableItem &item, int timestamp)
 {
        _I("[VoiceTouchEngine] Make clicked object output. timestamp(%d). item(%s)", timestamp, item.objectId.c_str());
-       if (__currentMode != VOICE_TOUCH_MODE_GRID) {
-               _D("[VoiceTouchEngine] Not grid mode.");
-               setTouchModality(item, timestamp);
-               return;
-       }
-
-       if (__currentGridInfo.currentStep == 0) {
-               __currentGridInfo.currentStep++;
-               __currentGridInfo.coordX = item.coordX;
-               __currentGridInfo.coordY = item.coordY;
-               __currentGridInfo.width = item.width;
-               __currentGridInfo.height = item.height;
-               return;
-       }
-
-       resetCurrentGridInfo();
        setTouchModality(item, timestamp);
 }
 
index e9049bc..c32a68a 100644 (file)
@@ -95,6 +95,7 @@ private:
        void setTouchModality(const ClickableItem &item, int timestamp);
 
        void resetCurrentGridInfo();
+       void updateCurrentGridInfo(const ClickableItem &item);
 
        void invokeOutputResultCallback(std::string outputResult);
        void invokeOutputModalityCallback(void* outputModality);