From 805031420daf14b96e9a08a1955a35494d982270 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Thu, 11 Jun 2015 14:39:10 +0200 Subject: Add print-tune menu Signed-off-by: Olliver Schinagl --- src/eulogium.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 4 deletions(-) diff --git a/src/eulogium.c b/src/eulogium.c index 6442d45..b70ac56 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -64,6 +64,7 @@ static void _but_settings_language_cb(void *data, Evas_Object *obj EINA_UNUSED, static void _but_settings_hotend_1_offset_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); static void _but_settings_hotend_2_offset_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); static void _but_material_customize_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); +static void _but_print_tune_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); /* Buttons */ static struct button_def but_return = { @@ -96,10 +97,10 @@ static struct button_def but_print_abort = { .data = NULL, }; -static struct button_def but_print_progress_tune = { +static struct button_def but_print_tune = { .text = "TUNE", .cb = { - .func = NULL, + .func = &_but_print_tune_cb, .data = NULL, .info = "tune progress button pressed", }, @@ -1098,6 +1099,105 @@ static struct menu_def menu_material_customize = { .data = NULL, }; +static struct menu_def menu_print_tune = { + .title = "TUNE", + .type = LIST_MENU, + .entry = { + { + .icon = "user-home", + .label = "Return", + .end = NULL, + .footer = "Return to print", + .footer_alt = NULL, + .func = &_cb_content_prev_set, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Network info", + .end = NULL, + .footer = "IP: ", + .footer_alt = NULL, + .func = &_but_settings_network_cb, /* maybe we want to open the network menu actually */ + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Speed", + .end = NULL, + .footer = "100 %", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Hotend temperature", + .end = NULL, + .footer = "210 °C", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Buildplate temperature", + .end = NULL, + .footer = "60 °C", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Fan speed", + .end = NULL, + .footer = "100 %", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Material flow", + .end = NULL, + .footer = "100 %", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Retraction hotend", + .end = NULL, + .footer = "Up", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "LED Brightness", + .end = NULL, + .footer = "100 %", + .footer_alt = NULL, + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { + .icon = NULL, + .label = "Material/Nozzle", + .end = NULL, + .footer = "PLA | PVA", + .footer_alt = "RVS | Bronze", + .func = NULL, + .toggle_timer = NULL, + .data = NULL, + }, { NULL }, /* sentinel */ + }, + .data = NULL, +}; + #if 0 menu template; TODO make nice macro for entries static struct menu_def menu_ = { @@ -1503,6 +1603,19 @@ static void _but_material_customize_cb(void *data, Evas_Object *object EINA_UNUS elm_naviframe_item_simple_push(eulogium->navi, content); } +static void _but_print_tune_cb(void *data, Evas_Object *object EINA_UNUSED, void *event_info EINA_UNUSED) +{ + struct eulogium_data *eulogium = data; + Evas_Object *content; + + printf("Button print tune pressed\n"); + + content = menu_widget_list(eulogium, eulogium->navi, &menu_print_tune); + if (!content) + return; + elm_naviframe_item_simple_push(eulogium->navi, content); +} + static void _but_change_material_1_cb(void *data, Evas_Object *object EINA_UNUSED, void *event_info EINA_UNUSED) { struct eulogium_data *eulogium = data; @@ -1964,7 +2077,7 @@ Evas_Object *eulogium_print_progress(struct eulogium_data *eulogium) evas_object_show(eulogium->progress); elm_box_pack_end(_top, eulogium->progress); - _bottom = eulogium_dual_button_add(eulogium->navi, &but_print_progress_tune, &but_print_abort_confirm); + _bottom = eulogium_dual_button_add(eulogium->navi, &but_print_tune, &but_print_abort_confirm); evas_object_show(_bottom); return eulogium_split_screen(eulogium->navi, _top, _bottom); @@ -2662,7 +2775,7 @@ static void eulogium_setup(struct eulogium_data *eulogium) eulogium_button_cb_data_set(&but_return, eulogium); eulogium_button_cb_data_set(&but_print_abort_confirm, eulogium); eulogium_button_cb_data_set(&but_print_abort, eulogium); - eulogium_button_cb_data_set(&but_print_progress_tune, eulogium); + eulogium_button_cb_data_set(&but_print_tune, eulogium); eulogium_button_cb_data_set(&but_main_print, eulogium); eulogium_button_cb_data_set(&but_print_ignore, eulogium); eulogium_button_cb_data_set(&but_print_local, eulogium); -- cgit v0.12