[TBT][Sensor][NonACR][TNEXT-2915,Added new testcasefor pedometer sensor] 57/145857/2
authornibha.sharma <nibha.sharma@samsung.com>
Thu, 24 Aug 2017 05:49:08 +0000 (11:19 +0530)
committerNibha Sharma <nibha.sharma@samsung.com>
Thu, 24 Aug 2017 07:36:23 +0000 (07:36 +0000)
Change-Id: I448e8a3f1ce1ad0b14143e1710479965d9e2263b
Signed-off-by: nibha.sharma <nibha.sharma@samsung.com>
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk
tbtcoreapp/inc/model/tbt-info.h
tbtcoreapp/inc/utils/app_module_config.h
tbtcoreapp/src/model/tbt-list.c
tbtcoreapp/src/view/tbt-genlist-view.c
tbtcoreapp/src/view/tbt-sensor-view.c
tbtcoreapp/tizen-manifest.xml

index 8df5955cbe0a101a6877c0a8b66f9829bff5ea39..bf70cba02e9d043c9ff49185f16c88990078d193 100755 (executable)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index f61524ab92541a654f0d0a37fdc2e88480253494..d8584f17ab404f6d659985d0f94490e2b3ac1540 100755 (executable)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ
index 46dc41863e005e99c35a2631f47b5413c01a77e3..1e8ec86ec7a44159cda49fa86836ac5b2cde74ea 100644 (file)
@@ -139,6 +139,7 @@ typedef enum {
     TBT_APP_SENSOR_ULTRA_VIOLET,
     TBT_APP_SENSOR_MAGNATOMETER,
     TBT_APP_SENSOR_PRESSURE,
+    TBT_APP_SENSOR_PEDOMETER,
 
 
     TBT_APP_ANIMATION_FADE,
index 225b299b76c63751a9bbe5c5f51475c38870623f..378edf4311598334b88782fce5851deeec75d995 100644 (file)
 #define TBT_MODULE_APP_SENSOR_ULTRA_VIOLET
 #define TBT_MODULE_APP_SENSOR_PRESSURE
 #define TBT_MODULE_APP_SENSOR_MAGNATOMETER
+#define TBT_MODULE_APP_SENSOR_PEDOMETER
 
 #define TBT_MODULE_ANIMATION
 #define TBT_MODULE_APP_ANIMATION_FADE
index 40c85a5b7ed952ce18d850507f915542c1c4de12..59f4efcdc6277bcabe0f5ebbb2d05061c71cf8c9 100644 (file)
@@ -1400,6 +1400,25 @@ static tbt_info tbtapps[] =
                        .features_required = {FEATURE_SENSOR_MAGNETOMETER}
                },
        #endif
+
+       #ifdef TBT_MODULE_APP_SENSOR_PEDOMETER
+
+               //Pedometer
+               {
+                       .name = "Pedometer",
+                       .parent = "Sensor",
+                       .apptype = TBT_APP_SENSOR_PEDOMETER,
+                       .icon_name = "dummy",
+                       .info = "1. Walk with the device about 10 steps or shake the device up and down.<br/>"
+                                       "2. Pedometer state will be updated accordingly",
+                       .result = -1,
+                       .sensor_response_interval = 100,
+                       .sensortype = SENSOR_HUMAN_PEDOMETER,
+                       .units = SENSOR_UNIT_METRE_PER_SECOND_SQUARED,
+                       .required_features_count = 1,
+                       .features_required = {FEATURE_SENSOR_PEDOMETER}
+               },
+       #endif
 #endif
 
 #ifdef TBT_MODULE_ANIMATION
@@ -2337,7 +2356,7 @@ static tbt_info tbtapps[] =
        #endif
 #endif
 
-#ifdef TBT_MODULE_D2D
+/*#ifdef TBT_MODULE_D2D
        #ifdef TBT_MODULE_APP_D2D_CLIENT
 
                //NSD DNSSD
@@ -2371,7 +2390,7 @@ static tbt_info tbtapps[] =
                        .features_required = { FEATURE_NETWORK_WIFI }
                },
        #endif
-#endif
+#endif*/
 #ifdef TBT_MODULE_TTS
        #ifdef TBT_MODULE_APP_TTS
                {
@@ -2619,7 +2638,7 @@ void tbt_list_init()
     {
         info->result = 0;
                #ifdef TBT_MODULE_SENSOR
-        if(info->apptype == TBT_APP_SENSOR_ACCELEROMETER || info->apptype == TBT_APP_SENSOR_GYROSCOPE || info->apptype == TBT_APP_SENSOR_PROXIMITY || info->apptype == TBT_APP_SENSOR_MAGNATOMETER || info->apptype == TBT_APP_SENSOR_LIGHT || info->apptype == TBT_APP_SENSOR_PRESSURE || info->apptype == TBT_APP_SENSOR_ULTRA_VIOLET)
+        if(info->apptype == TBT_APP_SENSOR_ACCELEROMETER || info->apptype == TBT_APP_SENSOR_GYROSCOPE || info->apptype == TBT_APP_SENSOR_PROXIMITY || info->apptype == TBT_APP_SENSOR_MAGNATOMETER || info->apptype == TBT_APP_SENSOR_LIGHT || info->apptype == TBT_APP_SENSOR_PRESSURE || info->apptype == TBT_APP_SENSOR_ULTRA_VIOLET || info->apptype == TBT_APP_SENSOR_PEDOMETER)
        {
                float resolution = 1.0;
                int ret;
index 66ce6573013f23c75bb22a39d794faae432a611c..dc6542cf08facb8d8fcf69405aeb4ffd9745b9b8 100644 (file)
@@ -584,6 +584,10 @@ static bool is_sensor_supported(tbt_info *info)
        {
                type= SENSOR_ULTRAVIOLET;
        }
+       else if(info->apptype == TBT_APP_SENSOR_PEDOMETER)
+       {
+               type= SENSOR_HUMAN_PEDOMETER;
+       }
        int ret = sensor_is_supported(type, &supported);
        RETVM_IF(SENSOR_ERROR_NONE!=ret, false,"sensor_is_supported failed");
 
@@ -988,6 +992,10 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void
                        case TBT_APP_SENSOR_PRESSURE:
                                sensor_view_add(view->navi, info, it);
                                break;
+
+                       case TBT_APP_SENSOR_PEDOMETER:
+                               sensor_view_add(view->navi, info, it);
+                               break;
                #endif
 
                #ifdef TBT_MODULE_ANIMATION
@@ -1220,14 +1228,14 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void
                                contacts_view_add(view->navi, info, it);
                                break;
                #endif
-               #ifdef TBT_MODULE_D2D
+               /*#ifdef TBT_MODULE_D2D
                        case TBT_APP_D2D_CLIENT:
                                d2d_view_add(view->navi, info, it);
                                break;
                        case TBT_APP_D2D_SERVER:
                                d2d_view_add(view->navi, info, it);
                                break;
-               #endif
+               #endif*/
 
                #ifdef TBT_MODULE_TTS
                        case TBT_APP_TTS:
index 0117fcfe3b76ed9e0524bfb363ad96f5205b80ca..a56570fc8eec19ce36dbce9cdd0ed65deeaac857 100644 (file)
@@ -127,6 +127,8 @@ struct _sensor_view
        Evas_Object *ultraviolet_image;
        Evas_Object *ultraviolet_label;
 
+       Evas_Object *pedometer_label;
+
        Evas_Object *fork_x;
        Evas_Object *fork_y;
        Evas_Object *fork_z;
@@ -366,6 +368,11 @@ sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I
                tbt_info->layout_group = "5_part_cnt_cnt_cnt_cnt_btn";
                tbt_info->layout_file = get_edje_path("5_part_cnt__cnt__cnt__cnt_btn.edj");
        }
+       else if(tbt_info->apptype == TBT_APP_SENSOR_PEDOMETER)
+       {
+               tbt_info->layout_group = "3_part_cnt_txt_btn";
+               tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj");
+       }
        else
        {
                tbt_info->layout_group = "4_part_cnt_cnt_btn_btn";
@@ -579,6 +586,14 @@ sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I
                elm_object_part_content_set(this->view->layout, "1cnt_2cnt_3cnt", label);
 
        }
+       else if(this->sensor_info->apptype == TBT_APP_SENSOR_PEDOMETER)
+       {
+               get_screen_resolution(this);
+
+               this->pedometer_label = ui_utils_label_add(this->view->layout, "");
+               elm_object_part_content_set(this->view->layout, "1cnt_2txt", this->pedometer_label);
+               sensor_get_default_sensor(SENSOR_HUMAN_PEDOMETER, &this->sensor_info->sensor);
+       }
 
        this->glview = gles_cube_view_init(this);
        if(this->glview == NULL)
@@ -868,6 +883,23 @@ static void genlist_sensor_value_items_update(sensor_view *view, float *values)
       rotate_image(view->fork_y, y);
       rotate_image(view->fork_z, z);
        }
+       else if(view->sensor_info->apptype == TBT_APP_SENSOR_PEDOMETER)
+       {
+               DBG("Distance: %f %f %f %f %f %f %f", values[0], values[1], values[2],values[3],values[4],values[5],values[6],values[7]);
+
+               if(values[6] == 0.0f)
+               {
+                       ui_utils_label_set_text(view->pedometer_label, "SENSOR_PEDOMETER_STATE_STOP", "left");
+               }
+               else if(values[6] ==3.0f || values[6] == 3.7f)
+               {
+                       ui_utils_label_set_text(view->pedometer_label, "SENSOR_PEDOMETER_STATE_RUN", "left");
+               }
+               else if(values[6] == 1.5f || values[6] == 2.0f)
+               {
+                       ui_utils_label_set_text(view->pedometer_label, "SENSOR_PEDOMETER_STATE_WALK", "left");
+               }
+       }
 }
 
 
@@ -1578,6 +1610,10 @@ static bool is_sensor_supported(sensor_view *view)
        {
                type= SENSOR_ULTRAVIOLET;
        }
+       else if(view->view->tbt_info->apptype == TBT_APP_SENSOR_PEDOMETER)
+       {
+               type= SENSOR_HUMAN_PEDOMETER;
+       }
        int ret = sensor_is_supported(type, &supported);
        RETVM_IF(SENSOR_ERROR_NONE!=ret, false,"sensor_is_supported failed: %s",get_sensor_error(ret));
 
index a17a4578bc7111dfb96bd11409d69fd4bbf3d4c2..33c38b2a3100f86cd7024f51c6a21b4139c7cf97 100644 (file)
@@ -29,5 +29,6 @@
         <privilege>http://tizen.org/privilege/callhistory.write</privilege>
         <privilege>http://tizen.org/privilege/volume.set</privilege>
         <privilege>http://tizen.org/privilege/contact.read</privilege>
+               <privilege>http://tizen.org/privilege/healthinfo</privilege>
     </privileges>
 </manifest>