Emergency stop page removed 96/184396/4
authorMichal Skorupinski <m.skorupinsk@samsung.com>
Tue, 17 Jul 2018 17:52:29 +0000 (19:52 +0200)
committerMichal Skorupinski <m.skorupinsk@samsung.com>
Wed, 18 Jul 2018 15:05:33 +0000 (17:05 +0200)
Change-Id: I6345b0afbdaccf07cc99315af901693a130600cd
Signed-off-by: Michal Skorupinski <m.skorupinsk@samsung.com>
12 files changed:
edje/images/stop.png [deleted file]
edje/images/stop_button.png [new file with mode: 0644]
inc/controller/controller_emergency_stop.h [deleted file]
inc/view/view_emergency_stop.h [deleted file]
inc/view_manager/view_factory.h
res/edje/emergency_stop.edc [deleted file]
res/edje/racing.edc
src/controller/controller_emergency_stop.c [deleted file]
src/controller/controller_racing.c
src/view/view_emergency_stop.c [deleted file]
src/view/view_racing.c
src/view_manager/view_factory.c

diff --git a/edje/images/stop.png b/edje/images/stop.png
deleted file mode 100644 (file)
index 4a86084..0000000
Binary files a/edje/images/stop.png and /dev/null differ
diff --git a/edje/images/stop_button.png b/edje/images/stop_button.png
new file mode 100644 (file)
index 0000000..2b2718f
Binary files /dev/null and b/edje/images/stop_button.png differ
diff --git a/inc/controller/controller_emergency_stop.h b/inc/controller/controller_emergency_stop.h
deleted file mode 100644 (file)
index 69de7c4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Flora License, Version 1.1 (the License);
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://floralicense.org/license/
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an AS IS BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-#ifndef CONTROLLER_CONTROLLER_EMERGENCY_STOP_H_
-#define CONTROLLER_CONTROLLER_EMERGENCY_STOP_H_
-
-#include "controller/controller_base.h"
-
-void controller_emergency_stop_init(t_view_update_cb view_update_cb);
-void controller_emergency_stop_destroy(void);
-void controller_emergency_stop_back(void);
-void controller_emergency_stop_next();
-
-#endif /* CONTROLLER_CONTROLLER_EMERGENCY_STOP_H_ */
diff --git a/inc/view/view_emergency_stop.h b/inc/view/view_emergency_stop.h
deleted file mode 100644 (file)
index 015c45a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Flora License, Version 1.1 (the License);
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://floralicense.org/license/
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an AS IS BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-#ifndef VIEW_VIEW_EMERGENCY_STOP_H_
-#define VIEW_VIEW_EMERGENCY_STOP_H_
-
-s_view_base *view_emergency_stop_init(Evas_Object *parent);
-
-#endif /* VIEW_VIEW_EMERGENCY_STOP_H_ */
index 06a3327..29e36a9 100644 (file)
@@ -26,7 +26,6 @@ typedef enum _e_view_id {
        VIEW_NAME_INPUT,
        VIEW_HELP,
        VIEW_RACING,
-       VIEW_EMERGENCY_STOP,
        VIEW_RESET,
        VIEW_NETWORK_FAILURE,
 } view_id;
diff --git a/res/edje/emergency_stop.edc b/res/edje/emergency_stop.edc
deleted file mode 100644 (file)
index a9ff7aa..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-collections {
-   base_scale: 1.0;
-   group { "main";
-      images {
-         image: "racing_bg.png" COMP;
-         image: "stop.png" COMP;
-
-      }
-      parts {
-         image { "bg";
-            desc { "default";
-               rel1.relative: 0.0 0.0;
-               rel2.relative: 1.0 1.0;
-               image.normal: "racing_bg.png";
-               aspect: 1 1;
-               aspect_preference: BOTH;
-            }
-         }
-         image { "stop";
-            scale: 1;
-            desc { "default";
-               rel1.relative: 0.2638 0.2638;
-               rel2.relative: 0.7361 0.7361;
-               image.normal: "stop.png";
-               align: 0.5 0.5;
-            }
-            desc { "pressed";
-               inherit: "default";
-               rel1.relative: 0.0833 0.0833;
-               rel2.relative: 0.9166 0.9166;
-            }
-         }
-         text { "text";
-            scale: 1;
-            effect: SOFT_OUTLINE;
-            repeat_events: 1;
-            desc { "default";
-               color: 248 238 204 255;
-               color2: 248 238 204 128;
-               visible: 1;
-               text {
-                  size: 36;
-                  font: "SamsungOne";
-                  text: "STOP";
-                  align: 0.5 0.5;
-                  min: 0 0;
-               }
-               align: 0.5 0.5;
-               rel1.relative: 0.00 0.00;
-               rel2.relative: 1.00 1.00;
-            }
-         }
-      }
-      programs {
-         program {
-            signal: "mouse,down,*";
-            source: "stop";
-
-            sequence {
-               action: STATE_SET "pressed";
-               target: "stop";
-               transition: LINEAR 2.0;
-
-               action:  SIGNAL_EMIT "pressed" "";
-            };
-         }
-         program {
-            signal: "mouse,up,*";
-            source: "stop";
-
-            sequence {
-               action: STATE_SET "default";
-               target: "stop";
-
-               action: SIGNAL_EMIT "released" "";
-            }
-         }
-      }
-   }
-}
index 08dd74c..efbc4fb 100644 (file)
@@ -3,6 +3,7 @@ collections {
    group { "main";
       images {
          image: "racing_bg.png" COMP;
+         image: "stop_button.png" COMP;
       }
       parts {
          image { "bg";
@@ -14,12 +15,86 @@ collections {
                aspect_preference: BOTH;
             }
          }
+         image { "stop";
+            scale: 1;
+            desc { "default";
+               visible: 0;
+               image.normal: "stop_button.png";
+               rel1.relative: 0.2638 0.2638;
+               rel2.relative: 0.7361 0.7361;
+               align: 0.5 0.5;
+            }
+            desc { "released";
+               inherit: "default";
+               visible: 1;
+            }
+            desc { "pressed";
+               inherit: "released";
+               rel1.relative: 0.0833 0.0833;
+               rel2.relative: 0.9166 0.9166;
+            }
+         }
+         text { "stop_text";
+            scale: 1;
+            effect: SOFT_OUTLINE;
+            repeat_events: 1;
+            desc { "default";
+               color: 248 238 204 255;
+               color2: 248 238 204 128;
+               visible: 0;
+               text {
+                  size: 36;
+                  font: "SamsungOne";
+                  text: "STOP";
+                  align: 0.5 0.5;
+                  min: 0 0;
+               }
+               align: 0.5 0.5;
+               rel1.relative: 0.00 0.00;
+               rel2.relative: 1.00 1.00;
+            }
+            desc { "released";
+               inherit: "default";
+               visible: 1;
+            }
+         }
       }
       programs {
          program {
             signal: "mouse,clicked,*";
             source: "bg";
-            action: SIGNAL_EMIT "clicked" "";
+            sequence {
+               action: SIGNAL_EMIT "bg_clicked" "";
+
+               action: STATE_SET "released";
+               target: "stop";
+               target: "stop_text";
+            }
+
+         }
+         program {
+            signal: "mouse,down,*";
+            source: "stop";
+
+            sequence {
+               action: STATE_SET "pressed";
+               target: "stop";
+               transition: LINEAR 2.0;
+
+               action:  SIGNAL_EMIT "stop_pressed" "";
+            };
+         }
+         program {
+            signal: "mouse,up,*";
+            source: "stop";
+
+            sequence {
+               action: STATE_SET "default";
+               target: "stop";
+               target: "stop_text";
+
+               action: SIGNAL_EMIT "stop_released" "";               
+            }
          }
       }
    }
diff --git a/src/controller/controller_emergency_stop.c b/src/controller/controller_emergency_stop.c
deleted file mode 100644 (file)
index 4c30335..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Flora License, Version 1.1 (the License);
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://floralicense.org/license/
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an AS IS BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-
-#include "gear-racing-controller.h"
-#include "model/model_cloud_connection.h"
-#include "controller/controller_emergency_stop.h"
-#include "view_manager/view_manager.h"
-
-static s_controller s_info = {  0, };
-
-void controller_emergency_stop_destroy(void)
-{
-       model_cloud_connection_unsubscirbe_event();
-}
-
-static void _connected_cb(s_model_cloud_connection_cb_data *model_data)
-{
-       view_manager_set_view(VIEW_RESET);
-}
-
-void controller_emergency_stop_init(t_view_update_cb view_update_cb)
-{
-       s_info.view_update_cb = view_update_cb;
-       model_cloud_connection_subscribe_event(_connected_cb);
-}
-
-void controller_emergency_stop_back(void)
-{
-       controller_emergency_stop_destroy();
-       view_manager_set_view(VIEW_RACING);
-}
-
-void controller_emergency_stop_next()
-{
-       model_cloud_connection_connect();
-}
-
index 502fdab..ae6896d 100644 (file)
@@ -35,7 +35,7 @@ void controller_racing_destroy(void)
 
 static void _model_connected_cb(s_model_cloud_connection_cb_data *model_data)
 {
-       view_manager_set_view(VIEW_EMERGENCY_STOP);
+       view_manager_set_view(VIEW_RESET);
 }
 
 static void _sensors_cb(s_model_sensors_cb_data *model_data)
diff --git a/src/view/view_emergency_stop.c b/src/view/view_emergency_stop.c
deleted file mode 100644 (file)
index 57256da..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Flora License, Version 1.1 (the License);
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://floralicense.org/license/
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an AS IS BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-#include "view/view_base.h"
-#include "view/view_emergency_stop.h"
-#include "view_manager/view_manager.h"
-#include "controller/controller_emergency_stop.h"
-
-typedef struct _s_view_emergency_stop {
-       s_view_base view_base;
-
-       bool stop_pressed;
-} s_view_emergency_stop;
-
-static s_view_emergency_stop s_info = { {0,}, };
-
-void _longpress_ok(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
-       s_info.stop_pressed = true;
-       controller_emergency_stop_next();
-}
-
-void _logpress_up(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
-       if (!s_info.stop_pressed) {
-               }
-
-       s_info.stop_pressed = false;
-}
-
-static void _view_emergency_stop_create_gui(Evas_Object *parent)
-{
-       s_info.view_base.view = view_base_create_layout(parent, "edje/emergency_stop.edj", GRP_MAIN);
-       elm_layout_text_set(s_info.view_base.view, "txt_title", "Emergency Stop");
-
-       elm_layout_signal_callback_add(s_info.view_base.view, "pressed", "", _longpress_ok, NULL);
-       elm_layout_signal_callback_add(s_info.view_base.view, "released", "", _logpress_up, NULL);
-}
-
-static void _show_cb(void)
-{
-       //TODO: on show stuff
-}
-
-static void _hide_cb(void)
-{
-       controller_emergency_stop_destroy();
-}
-
-s_view_base *view_emergency_stop_init(Evas_Object *parent)
-{
-       s_info.view_base.show_cb = _show_cb;
-       s_info.view_base.hide_cb = _hide_cb;
-
-       controller_emergency_stop_init(NULL);
-       _view_emergency_stop_create_gui(parent);
-
-       return &s_info.view_base;
-}
index f116b91..e709cc8 100644 (file)
@@ -30,6 +30,8 @@ typedef struct _s_view_racing {
        float dir_max_angle;
        float vel_min_angle;
        float vel_max_angle;
+
+       bool stop_pressed;
 } s_view_racing;
 
 static s_view_racing s_info = {
@@ -102,9 +104,21 @@ static void _controller_cb(void *data)
 
 void _racing_screen_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
 {
+       evas_object_hide(s_info.velocity);
+       evas_object_hide(s_info.direction);
+}
+
+void _stop_longpress_down(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
        controller_racing_next();
 }
 
+void _stop_logpress_up(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       evas_object_show(s_info.velocity);
+       evas_object_show(s_info.direction);
+}
+
 static void _view_racing_create_gui(Evas_Object *parent)
 {
        s_info.view_base.view = view_base_create_layout(parent, "edje/racing.edj", GRP_MAIN);
@@ -121,7 +135,10 @@ static void _view_racing_create_gui(Evas_Object *parent)
                        "images/circle.png", HORIZONTAL_ALIGN_CENTER, VERTICAL_ALIGN_TOP);
 
        evas_object_event_callback_add(s_info.view_base.view, EVAS_CALLBACK_DEL, _view_destroyed_cb, NULL);
-       elm_layout_signal_callback_add(s_info.view_base.view, "clicked", "", _racing_screen_clicked_cb, NULL);
+       elm_layout_signal_callback_add(s_info.view_base.view, "bg_clicked", "", _racing_screen_clicked_cb, NULL);
+
+       elm_layout_signal_callback_add(s_info.view_base.view, "stop_pressed", "", _stop_longpress_down, NULL);
+       elm_layout_signal_callback_add(s_info.view_base.view, "stop_released", "", _stop_logpress_up, NULL);
 }
 
 static void _show_cb(void)
@@ -132,8 +149,8 @@ static void _show_cb(void)
 
 static void _hide_cb(void)
 {
-       evas_object_hide(s_info.velocity);
-       evas_object_hide(s_info.direction);
+       evas_object_del(s_info.velocity);
+       evas_object_del(s_info.direction);
        controller_racing_destroy();
 }
 
index d2f88cf..693aa09 100644 (file)
@@ -18,7 +18,6 @@
 #include "view/view_connect_to_car.h"
 #include "view/view_car_selection.h"
 #include "view/view_connection_successed.h"
-#include "view/view_emergency_stop.h"
 #include "view/view_help.h"
 #include "view/view_name_input.h"
 #include "view/view_network_failure.h"
@@ -49,9 +48,6 @@ s_view_base *view_factory_create_view(Evas_Object *parent, Eext_Circle_Surface *
                case VIEW_RACING:
                        view = view_racing_init(parent);
                        break;
-               case VIEW_EMERGENCY_STOP:
-                       view = view_emergency_stop_init(parent);
-                       break;
                case VIEW_RESET:
                        view = view_reset_init(parent);
                        break;