[CS] Add color to the label and fix status
authorJihoon Lee <jhoon.it.lee@samsung.com>
Tue, 6 Oct 2020 11:47:42 +0000 (20:47 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 7 Oct 2020 03:14:38 +0000 (12:14 +0900)
**Changes proposed in this PR:**
- Add color to the result label
- Fix retun status for void functions

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Applications/Tizen_native/CustomShortcut/src/data.c
Applications/Tizen_native/CustomShortcut/src/view.c

index 6236914..8f0d4af 100644 (file)
@@ -605,7 +605,7 @@ static void on_inference_end_(ml_tensors_data_h data,
 
   /// SMILE: 0 1
   /// FROWN: 1 0
-  LOG_D("label: %lf %lf", raw_data[0], raw_data[1]);
+  LOG_D("\033[33mlabel: %lf %lf\033[36m", raw_data[0], raw_data[1]);
   ad->label = raw_data[0] < raw_data[1] ? LABEL_SMILE : LABEL_FROWN;
 
 RESUME:
index cf1598d..098edcd 100644 (file)
@@ -242,10 +242,14 @@ void view_set_canvas_clean(appdata_s *ad) {
   int status = util_get_emoji(ad->label, &emoji);
   if (status != APP_ERROR_NONE) {
     LOG_E("getting emoji failed %d", status);
-    return status;
+    return;
   }
 
-  sprintf(buf, "draw for %s [%d/%d]", emoji, ad->tries + 1, MAX_TRIES);
+  if (ad->mode == MODE_INFER) {
+    sprintf(buf, "draw for %s", emoji);
+  } else if (ad->mode == MODE_TRAIN) {
+    sprintf(buf, "draw for %s [%d/%d]", emoji, ad->tries + 1, MAX_TRIES);
+  }
   elm_object_part_text_set(ad->layout, "draw/title", buf);
   elm_object_part_text_set(ad->layout, "draw/label", emoji);
 
@@ -387,14 +391,14 @@ void view_update_guess(void *data) {
   int status = util_get_emoji(ad->label, &emoji);
   if (status != APP_ERROR_NONE) {
     LOG_E("error getting emoji, reason: %d", status);
-    return status;
+    return;
   }
 
-  LOG_E("%s", emoji);
+  LOG_I("\033[33m%s\033[36m", emoji);
   elm_object_part_text_set(ad->layout, "test_result/title",
                            "guess successfully done");
   elm_object_part_text_set(ad->layout, "test_result/label", emoji);
   free(emoji);
 
-  return status;
+  return;
 }