Now screen freezed on "Start Screen" until connecting to wifi is done.
This commit is contained in:
@@ -47,7 +47,7 @@ static void event_handler_cb_vote_session_question_name(lv_event_t *e) {
|
||||
}
|
||||
}
|
||||
|
||||
static void event_handler_cb_vote_results_obj8(lv_event_t *e) {
|
||||
static void event_handler_cb_vote_results_obj9(lv_event_t *e) {
|
||||
lv_event_code_t event = lv_event_get_code(e);
|
||||
if (event == LV_EVENT_VALUE_CHANGED) {
|
||||
lv_obj_t *ta = lv_event_get_target(e);
|
||||
@@ -58,7 +58,7 @@ static void event_handler_cb_vote_results_obj8(lv_event_t *e) {
|
||||
}
|
||||
}
|
||||
|
||||
static void event_handler_cb_ibvs_processor_obj10(lv_event_t *e) {
|
||||
static void event_handler_cb_ibvs_processor_obj11(lv_event_t *e) {
|
||||
lv_event_code_t event = lv_event_get_code(e);
|
||||
if (event == LV_EVENT_VALUE_CHANGED) {
|
||||
lv_obj_t *ta = lv_event_get_target(e);
|
||||
@@ -85,6 +85,14 @@ void create_screen_start() {
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_image_set_src(obj, &img_logo);
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_spinner_create(parent_obj);
|
||||
objects.obj0 = obj;
|
||||
lv_obj_set_pos(obj, 0, 196);
|
||||
lv_obj_set_size(obj, 50, 44);
|
||||
lv_spinner_set_anim_params(obj, 1000, 60);
|
||||
lv_obj_set_style_arc_color(obj, lv_color_hex(0xff104905), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
tick_screen_start();
|
||||
@@ -125,7 +133,7 @@ void create_screen_configurations() {
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj0 = obj;
|
||||
objects.obj1 = obj;
|
||||
lv_obj_set_pos(obj, 0, 120);
|
||||
lv_obj_set_size(obj, 320, 75);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff1c52db), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -172,7 +180,7 @@ void create_screen_vote_wait() {
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj1 = obj;
|
||||
objects.obj2 = obj;
|
||||
lv_obj_set_pos(obj, 1, 120);
|
||||
lv_obj_set_size(obj, 319, 35);
|
||||
lv_label_set_long_mode(obj, LV_LABEL_LONG_SCROLL);
|
||||
@@ -254,7 +262,7 @@ void create_screen_vote_session() {
|
||||
objects.picture = obj;
|
||||
lv_obj_set_pos(obj, 190, 85);
|
||||
lv_obj_set_size(obj, 130, 150);
|
||||
lv_image_set_src(obj, &img_john_does_2);
|
||||
lv_image_set_src(obj, &img_john_doe_1);
|
||||
}
|
||||
{
|
||||
// item1
|
||||
@@ -267,7 +275,7 @@ void create_screen_vote_session() {
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj2 = obj;
|
||||
objects.obj3 = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -286,7 +294,7 @@ void create_screen_vote_session() {
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj3 = obj;
|
||||
objects.obj4 = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -305,7 +313,7 @@ void create_screen_vote_session() {
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj4 = obj;
|
||||
objects.obj5 = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -324,7 +332,7 @@ void create_screen_vote_session() {
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj5 = obj;
|
||||
objects.obj6 = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -343,7 +351,7 @@ void create_screen_vote_session() {
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj6 = obj;
|
||||
objects.obj7 = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -389,15 +397,6 @@ void tick_screen_vote_session() {
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_ui_item1();
|
||||
const char *cur_val = lv_label_get_text(objects.obj2);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj2;
|
||||
lv_label_set_text(objects.obj2, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_ui_item2();
|
||||
const char *cur_val = lv_label_get_text(objects.obj3);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj3;
|
||||
@@ -406,7 +405,7 @@ void tick_screen_vote_session() {
|
||||
}
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_ui_item3();
|
||||
const char *new_val = get_var_ui_item2();
|
||||
const char *cur_val = lv_label_get_text(objects.obj4);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj4;
|
||||
@@ -415,7 +414,7 @@ void tick_screen_vote_session() {
|
||||
}
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_ui_item4();
|
||||
const char *new_val = get_var_ui_item3();
|
||||
const char *cur_val = lv_label_get_text(objects.obj5);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj5;
|
||||
@@ -424,7 +423,7 @@ void tick_screen_vote_session() {
|
||||
}
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_ui_item5();
|
||||
const char *new_val = get_var_ui_item4();
|
||||
const char *cur_val = lv_label_get_text(objects.obj6);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj6;
|
||||
@@ -432,6 +431,15 @@ void tick_screen_vote_session() {
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_ui_item5();
|
||||
const char *cur_val = lv_label_get_text(objects.obj7);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj7;
|
||||
lv_label_set_text(objects.obj7, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void create_screen_vote_wait_results() {
|
||||
@@ -466,7 +474,7 @@ void create_screen_vote_wait_results() {
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj7 = obj;
|
||||
objects.obj8 = obj;
|
||||
lv_obj_set_pos(obj, 1, 120);
|
||||
lv_obj_set_size(obj, 319, 35);
|
||||
lv_label_set_long_mode(obj, LV_LABEL_LONG_SCROLL);
|
||||
@@ -492,13 +500,13 @@ void create_screen_vote_results() {
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_textarea_create(parent_obj);
|
||||
objects.obj8 = obj;
|
||||
objects.obj9 = obj;
|
||||
lv_obj_set_pos(obj, 10, 71);
|
||||
lv_obj_set_size(obj, 300, 135);
|
||||
lv_textarea_set_max_length(obj, 128);
|
||||
lv_textarea_set_one_line(obj, false);
|
||||
lv_textarea_set_password_mode(obj, false);
|
||||
lv_obj_add_event_cb(obj, event_handler_cb_vote_results_obj8, LV_EVENT_ALL, 0);
|
||||
lv_obj_add_event_cb(obj, event_handler_cb_vote_results_obj9, LV_EVENT_ALL, 0);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_38, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff212121), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffe480ba), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -526,11 +534,11 @@ void create_screen_vote_results() {
|
||||
void tick_screen_vote_results() {
|
||||
{
|
||||
const char *new_val = get_var_ui_winner();
|
||||
const char *cur_val = lv_textarea_get_text(objects.obj8);
|
||||
uint32_t max_length = lv_textarea_get_max_length(objects.obj8);
|
||||
const char *cur_val = lv_textarea_get_text(objects.obj9);
|
||||
uint32_t max_length = lv_textarea_get_max_length(objects.obj9);
|
||||
if (strncmp(new_val, cur_val, max_length) != 0) {
|
||||
tick_value_change_obj = objects.obj8;
|
||||
lv_textarea_set_text(objects.obj8, new_val);
|
||||
tick_value_change_obj = objects.obj9;
|
||||
lv_textarea_set_text(objects.obj9, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
@@ -578,7 +586,7 @@ void create_screen_ibvs_mode() {
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_textarea_create(parent_obj);
|
||||
objects.obj9 = obj;
|
||||
objects.obj10 = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, 320, 93);
|
||||
lv_textarea_set_max_length(obj, 128);
|
||||
@@ -628,13 +636,13 @@ void create_screen_ibvs_processor() {
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_textarea_create(parent_obj);
|
||||
objects.obj10 = obj;
|
||||
objects.obj11 = obj;
|
||||
lv_obj_set_pos(obj, 10, 180);
|
||||
lv_obj_set_size(obj, 180, 50);
|
||||
lv_textarea_set_max_length(obj, 128);
|
||||
lv_textarea_set_one_line(obj, false);
|
||||
lv_textarea_set_password_mode(obj, false);
|
||||
lv_obj_add_event_cb(obj, event_handler_cb_ibvs_processor_obj10, LV_EVENT_ALL, 0);
|
||||
lv_obj_add_event_cb(obj, event_handler_cb_ibvs_processor_obj11, LV_EVENT_ALL, 0);
|
||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_24, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -658,11 +666,11 @@ void create_screen_ibvs_processor() {
|
||||
void tick_screen_ibvs_processor() {
|
||||
{
|
||||
const char *new_val = get_var_ui_ip();
|
||||
const char *cur_val = lv_textarea_get_text(objects.obj10);
|
||||
uint32_t max_length = lv_textarea_get_max_length(objects.obj10);
|
||||
const char *cur_val = lv_textarea_get_text(objects.obj11);
|
||||
uint32_t max_length = lv_textarea_get_max_length(objects.obj11);
|
||||
if (strncmp(new_val, cur_val, max_length) != 0) {
|
||||
tick_value_change_obj = objects.obj10;
|
||||
lv_textarea_set_text(objects.obj10, new_val);
|
||||
tick_value_change_obj = objects.obj11;
|
||||
lv_textarea_set_text(objects.obj11, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user