From 3c4628905960bf3217f84f81f3c213bd15be695c Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Wed, 17 Jun 2015 08:16:02 +0200 Subject: [griffin.hmi] get procedures to compile this is a broken commit, procedures are broken and compiling is broken atm. This is a wip commit. Signed-off-by: Olliver Schinagl --- src/Makefile.am | 2 +- src/eulogium.c | 3 +-- src/eulogium.h | 17 +++--------- src/eulogium_procedures.c | 49 ----------------------------------- src/eulogium_procedures.h | 23 ----------------- src/print_data.h | 28 ++++++++++++++++++++ src/procedures.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++ src/procedures.h | 30 +++++++++++++++++++++ 8 files changed, 129 insertions(+), 89 deletions(-) delete mode 100644 src/eulogium_procedures.c delete mode 100644 src/eulogium_procedures.h create mode 100644 src/print_data.h create mode 100644 src/procedures.c create mode 100644 src/procedures.h diff --git a/src/Makefile.am b/src/Makefile.am index e60d34d..416d9be 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,7 +11,7 @@ AM_CPPFLAGS = -DPACKAGE_BIN_DIR=\"$(bindir)/\" \ -I$(top_srcdir)/src/ \ @EFL_CFLAGS@ -eulogium_SOURCES = eulogium.c eulogium_item_list.c +eulogium_SOURCES = eulogium.c eulogium_item_list.c procedures.c eulogium_LDADD = @EFL_LIBS@ localedir = $(datadir)/locale diff --git a/src/eulogium.c b/src/eulogium.c index 9fe4d2c..8ff47a2 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -16,9 +16,8 @@ #include "eulogium.h" #include "eulogium_item_list.h" #include "eulogium_private.h" -#include "eulogium_procedures.h" #include "gettext.h" - +#include "procedures.h" #define COPYRIGHT "Copyright © 2015 Olliver Schinagl and various contributors (see AUTHORS)." diff --git a/src/eulogium.h b/src/eulogium.h index 5ef8468..a90548f 100644 --- a/src/eulogium.h +++ b/src/eulogium.h @@ -3,12 +3,13 @@ #ifndef _EULOGIUM_H #define _EULOGIUM_H -#include +#include #include +#include #include -#include "eulogium_procedures.h" #include "eulogium_item_list.h" +#include "procedures.h" enum screen_type { NONE, @@ -56,18 +57,6 @@ struct printer_data { double bed_target_temp; }; -struct print_data { - uint_fast32_t time; - double progress; - char *file; - char *name; - Eina_Bool name_changed; - char *flags; - double material; - Eina_Bool block; - Eina_Bool block_active; -}; - enum proxy_idx { PRINTER, LED, diff --git a/src/eulogium_procedures.c b/src/eulogium_procedures.c deleted file mode 100644 index 99e7a6b..0000000 --- a/src/eulogium_procedures.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * eulogium_procedures, available procedures - * - * Copyright (c) 2015 Ultimaker B.V. - * Author: Olliver Schinagl - * - * SPDX-License-Identifier: AGPL-3.0+ - */ - -#include - -#include "eulogium_private.h" -#include "eulogium_procedures.h" - -#define _PROC_PRINT "PRINT" -#define _PROC_HEATUP_HOTEND "HEATUP_HOTEND" -#define _PROC_POST_PRINT "POST_PRINT" -#define _PROC_PRE_PRINT_SETUP "PRE_PRINT_SETUP" - -static struct procedure_data procedures[] = { - { - .key = _PROC_PRINT, - .keylen = sizeof(_PROC_PRINT), - .executable = EINA_FALSE, - .available = EINA_FALSE, - }, { - .key = _PROC_HEATUP_HOTEND, - .keylen = sizeof(_PROC_HEATUP_HOTEND), - .executable = EINA_FALSE, - .available = EINA_FALSE, - }, { - .key = _PROC_POST_PRINT, - .keylen = sizeof(_PROC_POST_PRINT), - .executable = EINA_FALSE, - .available = EINA_FALSE, - }, { - .key = _PROC_PRE_PRINT_SETUP, - .keylen = sizeof(_PROC_PRE_PRINT_SETUP), - .executable = EINA_FALSE, - .available = EINA_FALSE, - }, { - NULL /* sentinel */ - } -}; - -struct procedure_data *procedures_init(void) -{ - return procedures; -}; diff --git a/src/eulogium_procedures.h b/src/eulogium_procedures.h deleted file mode 100644 index 40a87a6..0000000 --- a/src/eulogium_procedures.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * eulogium_procedures, available procedures - * - * Copyright (c) 2015 Ultimaker B.V. - * Author: Olliver Schinagl - * - * SPDX-License-Identifier: AGPL-3.0+ - */ - -#ifndef _EULOGIUM_PROCEDURES_H -#define _EULOGIUM_PROCEDURES_H - -struct procedure_data { - char *key; - uint_fast16_t keylen; - Eina_Bool available; - Eina_Bool executable; - char *step; -}; - -struct procedure_data *procedures_init(void); - -#endif /* _EULOGIUM_PRIVATE_H */ diff --git a/src/print_data.h b/src/print_data.h new file mode 100644 index 0000000..b932819 --- /dev/null +++ b/src/print_data.h @@ -0,0 +1,28 @@ +/* + * function and data types for print information + * + * Copyright (c) 2015 Ultimaker B.V. + * Author: Olliver Schinagl + * + * SPDX-License-Identifier: AGPL-3.0+ + */ + +#ifndef _PRINT_DATA_H +#define _PRINT_DATA_H + +#include +#include + +struct print_data { + uint_fast32_t time; + double progress; + char *file; + char *name; + Eina_Bool name_changed; + char *flags; + double material; + Eina_Bool block; + Eina_Bool block_active; +}; + +#endif /* _PRINT_DATA_H */ diff --git a/src/procedures.c b/src/procedures.c new file mode 100644 index 0000000..cd05d0f --- /dev/null +++ b/src/procedures.c @@ -0,0 +1,66 @@ +/* + * eulogium_procedures, available procedures + * + * Copyright (c) 2015 Ultimaker B.V. + * Author: Olliver Schinagl + * + * SPDX-License-Identifier: AGPL-3.0+ + */ + +#include +#include +#include + +#include "procedures.h" + +#include "print_data.h" + +#define _PROC_PRINT "PRINT" +#define _PROC_HEATUP_HOTEND "HEATUP_HOTEND" +#define _PROC_POST_PRINT "POST_PRINT" +#define _PROC_PRE_PRINT_SETUP "PRE_PRINT_SETUP" + +static struct procedure_data procedures[] = { + { + .key = _PROC_PRINT, + .keylen = sizeof(_PROC_PRINT), + .executable = EINA_FALSE, + .available = EINA_FALSE, + }, { + .key = _PROC_HEATUP_HOTEND, + .keylen = sizeof(_PROC_HEATUP_HOTEND), + .executable = EINA_FALSE, + .available = EINA_FALSE, + }, { + .key = _PROC_POST_PRINT, + .keylen = sizeof(_PROC_POST_PRINT), + .executable = EINA_FALSE, + .available = EINA_FALSE, + }, { + .key = _PROC_PRE_PRINT_SETUP, + .keylen = sizeof(_PROC_PRE_PRINT_SETUP), + .executable = EINA_FALSE, + .available = EINA_FALSE, + }, { + NULL /* sentinel */ + } +}; + +struct procedure_data *procedures_init(void) +{ + return procedures; +}; + +void procedure_start_print(Eldbus_Proxy *proxy, struct print_data *print) +{ + Eldbus_Message *msg; + Eldbus_Message_Iter *iter, *array_itr; + + + print = NULL; + msg = eldbus_proxy_method_call_new(proxy, "startProcedure"); + iter = eldbus_message_iter_get(msg); + eldbus_message_iter_arguments_append(iter, "sa{sv}", "PRINT", array_itr); + eldbus_message_iter_container_new(iter, 'a', "{sv}"); + eldbus_message_iter_container_close(iter, array_itr); +} diff --git a/src/procedures.h b/src/procedures.h new file mode 100644 index 0000000..76e4adc --- /dev/null +++ b/src/procedures.h @@ -0,0 +1,30 @@ +/* + * eulogium_procedures, available procedures + * + * Copyright (c) 2015 Ultimaker B.V. + * Author: Olliver Schinagl + * + * SPDX-License-Identifier: AGPL-3.0+ + */ + +#ifndef _EULOGIUM_PROCEDURES_H +#define _EULOGIUM_PROCEDURES_H + +#include +#include +#include + +#include "print_data.h" + +struct procedure_data { + char *key; + uint_fast16_t keylen; + Eina_Bool available; + Eina_Bool executable; + char steps[]; +}; + +struct procedure_data *procedures_init(void); +void procedure_start_print(Eldbus_Proxy *proxy, struct print_data *print); + +#endif /* _EULOGIUM_PRIVATE_H */ -- cgit v0.12