From 117226bfc4f703a380b51ea3f354d9f7cf9fe4cd Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 29 Aug 2023 22:45:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=20=D0=BE=D0=BA=D0=BD=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 8 +++++++ gui/app.js | 2 +- gui/index.html | 65 +++++++++++++++++++++++++++++++------------------- src/main.c | 3 ++- 4 files changed, 51 insertions(+), 27 deletions(-) diff --git a/build.sh b/build.sh index 77c3c55..bafd894 100755 --- a/build.sh +++ b/build.sh @@ -2,11 +2,19 @@ clear +STEPS=' 4' + +echo "[ 1/$STEPS] Cleaning..." rm dist/* &> /dev/null rm brakeconf &> /dev/null + +echo "[ 2/$STEPS] Build GUI..." python3 ./build_gui.py gui/index.html dist/index.html &> /dev/null xxd -i -n html_document dist/index.html > src/html.h # sed -i 's/unsigned char/const unsigned char/g' src/html.h + +echo "[ 3/$STEPS] Compile..." gcc -I./webui -o brakeconf src/device.c src/main.c src/ui.c webui/libwebui-2-static.a -lserialport -ljansson +echo "[ 4/$STEPS] Running..." ./brakeconf icanthink diff --git a/gui/app.js b/gui/app.js index 72ea3b7..2d9da03 100644 --- a/gui/app.js +++ b/gui/app.js @@ -1,6 +1,6 @@ 'use strict'; -const ENABLE_AUTO_CHECK_THEME = false; +const ENABLE_AUTO_CHECK_THEME = true; // Перечень кнопок переключения окон const enumWindowButtons = [ diff --git a/gui/index.html b/gui/index.html index f74fd09..bf0f798 100644 --- a/gui/index.html +++ b/gui/index.html @@ -186,7 +186,9 @@
- +

+ Порт для подключения +

- +

+ Переключатели зон +

- +

+ Отправить команду +

Команда @@ -269,40 +277,47 @@
- settings +
+ В разработке +
- FW update +
+ В разработке +
-
- -
- - -
+

+ Лог работы программы +

+ +
+ +
+

+ О программе +

Программа для настройки модуля торможения. diff --git a/src/main.c b/src/main.c index 9607026..5aa9393 100644 --- a/src/main.c +++ b/src/main.c @@ -11,7 +11,8 @@ struct sp_port *serial_port; int main(int argc, char const *argv[]) { int app_window = webui_new_window(); - html_document[html_document_len] = '\0'; + // html_document[html_document_len] = '\0'; + html_document[html_document_len + 1] = '\0'; if (argc > 1 && strcmp(argv[1], "icanthink") == 0) { }