+++ /dev/null
-/*
-* 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_ */
+++ /dev/null
-/*
-* 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_ */
VIEW_NAME_INPUT,
VIEW_HELP,
VIEW_RACING,
- VIEW_EMERGENCY_STOP,
VIEW_RESET,
VIEW_NETWORK_FAILURE,
} view_id;
+++ /dev/null
-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" "";
- }
- }
- }
- }
-}
group { "main";
images {
image: "racing_bg.png" COMP;
+ image: "stop_button.png" COMP;
}
parts {
image { "bg";
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" "";
+ }
}
}
}
+++ /dev/null
-/*
-* 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();
-}
-
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)
+++ /dev/null
-/*
-* 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;
-}
float dir_max_angle;
float vel_min_angle;
float vel_max_angle;
+
+ bool stop_pressed;
} s_view_racing;
static s_view_racing s_info = {
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);
"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)
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();
}
#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"
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;