From: nibha.sharma Date: Thu, 24 Aug 2017 05:48:59 +0000 (+0530) Subject: [TBT][Sensor][NonACR][TNEXT-2915,Added new testcasefor pedometer sensor] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cfe325fc7d9f5f67a1f2bec8c1b952411b9ec87;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][Sensor][NonACR][TNEXT-2915,Added new testcasefor pedometer sensor] Change-Id: I6cf8cea970e38f550324d9da211c9962db3abb73 Signed-off-by: nibha.sharma --- diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 0e09fe5..994b44c 100755 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 diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk index 223e461..f054dea 100755 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 diff --git a/tbtcoreapp/inc/model/tbt-info.h b/tbtcoreapp/inc/model/tbt-info.h index a34d425..3c2d050 100755 --- a/tbtcoreapp/inc/model/tbt-info.h +++ b/tbtcoreapp/inc/model/tbt-info.h @@ -135,6 +135,7 @@ typedef enum { TBT_APP_SENSOR_ULTRA_VIOLET, TBT_APP_SENSOR_MAGNATOMETER, TBT_APP_SENSOR_PRESSURE, + TBT_APP_SENSOR_PEDOMETER, TBT_APP_ANIMATION_FADE, diff --git a/tbtcoreapp/inc/utils/app_module_config.h b/tbtcoreapp/inc/utils/app_module_config.h index 2f2d3b7..7f0339f 100755 --- a/tbtcoreapp/inc/utils/app_module_config.h +++ b/tbtcoreapp/inc/utils/app_module_config.h @@ -119,6 +119,7 @@ #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 diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c index df4b91d..9be34a0 100755 --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -1383,6 +1383,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.
" + "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 @@ -2891,7 +2910,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; diff --git a/tbtcoreapp/src/view/tbt-genlist-view.c b/tbtcoreapp/src/view/tbt-genlist-view.c index 6af4177..79b4943 100755 --- a/tbtcoreapp/src/view/tbt-genlist-view.c +++ b/tbtcoreapp/src/view/tbt-genlist-view.c @@ -881,6 +881,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 diff --git a/tbtcoreapp/src/view/tbt-sensor-view.c b/tbtcoreapp/src/view/tbt-sensor-view.c index 33fbb5d..0dce35f 100644 --- a/tbtcoreapp/src/view/tbt-sensor-view.c +++ b/tbtcoreapp/src/view/tbt-sensor-view.c @@ -136,6 +136,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; @@ -373,6 +375,11 @@ sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I tbt_info->layout_group = "magnatometer_sensor_viewer"; tbt_info->layout_file = get_edje_path("sensor_viewer.edj"); } + else if(tbt_info->apptype == TBT_APP_SENSOR_PEDOMETER) + { + tbt_info->layout_group = "ultra_violet_sensor_viewer"; + tbt_info->layout_file = get_edje_path("sensor_viewer.edj"); + } else { tbt_info->layout_group = "sensor_viewer"; @@ -546,6 +553,14 @@ sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I elm_object_part_content_set(this->view->layout, "image_view3", 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, "text_view", 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) @@ -806,6 +821,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"); + } + } } @@ -1518,6 +1550,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)); diff --git a/tbtcoreapp/tizen-manifest.xml b/tbtcoreapp/tizen-manifest.xml index 31cca49..bc1dd06 100644 --- a/tbtcoreapp/tizen-manifest.xml +++ b/tbtcoreapp/tizen-manifest.xml @@ -6,6 +6,7 @@ tbtcoreapp.png + http://tizen.org/privilege/healthinfo http://tizen.org/privilege/contact.read http://tizen.org/privilege/datasharing http://tizen.org/privilege/packagemanager.info