Skip to content

Commit

Permalink
添加性能监控界面
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbb666 committed Oct 11, 2023
1 parent c90d2cb commit 43828f0
Show file tree
Hide file tree
Showing 290 changed files with 18,701 additions and 9,205 deletions.
17 changes: 14 additions & 3 deletions fimeware/hmi-board-win32/.config
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ CONFIG_RT_LWIP_USING_PING=y
CONFIG_PKG_USING_KAWAII_MQTT=y
CONFIG_PKG_KAWAII_MQTT_PATH="/packages/iot/kawaii-mqtt"
# CONFIG_KAWAII_MQTT_NETWORK_TYPE_TLS is not set
# CONFIG_KAWAII_MQTT_NETSOCKET_USE_SAL is not set
CONFIG_KAWAII_MQTT_NETSOCKET_USE_SAL=y
CONFIG_KAWAII_MQTT_LOG_IS_SALOF=y
CONFIG_SALOF_USING_LOG=y
CONFIG_SALOF_USING_SALOF=y
Expand Down Expand Up @@ -563,7 +563,14 @@ CONFIG_PKG_NETUTILS_VER_NUM=0x10303
#
# JSON: JavaScript Object Notation, a lightweight data-interchange format
#
# CONFIG_PKG_USING_CJSON is not set
CONFIG_PKG_USING_CJSON=y
CONFIG_PKG_CJSON_PATH="/packages/language/JSON/cJSON"
CONFIG_PKG_USING_CJSON_V1715=y
# CONFIG_PKG_USING_CJSON_V1714 is not set
# CONFIG_PKG_USING_CJSON_V159 is not set
# CONFIG_PKG_USING_CJSON_V102 is not set
# CONFIG_PKG_USING_CJSON_LATEST_VERSION is not set
CONFIG_PKG_CJSON_VER="v1.7.15"
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
# CONFIG_PKG_USING_RAPIDJSON is not set
Expand Down Expand Up @@ -673,7 +680,11 @@ CONFIG_PKG_WAVPLAYER_VER="latest"
# CONFIG_PKG_USING_URLENCODE is not set
# CONFIG_PKG_USING_UMCN is not set
# CONFIG_PKG_USING_LWRB2RTT is not set
# CONFIG_PKG_USING_CPU_USAGE is not set
CONFIG_PKG_USING_CPU_USAGE=y
CONFIG_PKG_CPU_USAGE_PATH="/packages/tools/cpu_usage"
CONFIG_PKG_USING_CPU_USAGE_V100=y
# CONFIG_PKG_USING_CPU_USAGE_LATEST_VERSION is not set
CONFIG_PKG_CPU_USAGE_VER="v1.0.0"
# CONFIG_PKG_USING_GBK2UTF8 is not set
# CONFIG_PKG_USING_VCONSOLE is not set
# CONFIG_PKG_USING_KDB is not set
Expand Down
14 changes: 9 additions & 5 deletions fimeware/hmi-board-win32/.config.old
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ CONFIG_RT_LWIP_USING_PING=y
CONFIG_PKG_USING_KAWAII_MQTT=y
CONFIG_PKG_KAWAII_MQTT_PATH="/packages/iot/kawaii-mqtt"
# CONFIG_KAWAII_MQTT_NETWORK_TYPE_TLS is not set
# CONFIG_KAWAII_MQTT_NETSOCKET_USE_SAL is not set
CONFIG_KAWAII_MQTT_NETSOCKET_USE_SAL=y
CONFIG_KAWAII_MQTT_LOG_IS_SALOF=y
CONFIG_SALOF_USING_LOG=y
CONFIG_SALOF_USING_SALOF=y
Expand Down Expand Up @@ -433,9 +433,9 @@ CONFIG_KAWAII_MQTT_RECONNECT_DEFAULT_DURATION=1000
# CONFIG_PKG_USING_KAWAII_MQTT_TEST is not set
# CONFIG_PKG_USING_KAWAII_MQTT_V100 is not set
# CONFIG_PKG_USING_KAWAII_MQTT_V102 is not set
# CONFIG_PKG_USING_KAWAII_MQTT_V110 is not set
CONFIG_PKG_USING_KAWAII_MQTT_LATEST_VERSION=y
CONFIG_PKG_KAWAII_MQTT_VER="latest"
CONFIG_PKG_USING_KAWAII_MQTT_V110=y
# CONFIG_PKG_USING_KAWAII_MQTT_LATEST_VERSION is not set
CONFIG_PKG_KAWAII_MQTT_VER="v1.1.0"
# CONFIG_PKG_USING_BC28_MQTT is not set
# CONFIG_PKG_USING_WEBTERMINAL is not set
# CONFIG_PKG_USING_FREEMODBUS is not set
Expand Down Expand Up @@ -673,7 +673,11 @@ CONFIG_PKG_WAVPLAYER_VER="latest"
# CONFIG_PKG_USING_URLENCODE is not set
# CONFIG_PKG_USING_UMCN is not set
# CONFIG_PKG_USING_LWRB2RTT is not set
# CONFIG_PKG_USING_CPU_USAGE is not set
CONFIG_PKG_USING_CPU_USAGE=y
CONFIG_PKG_CPU_USAGE_PATH="/packages/tools/cpu_usage"
CONFIG_PKG_USING_CPU_USAGE_V100=y
# CONFIG_PKG_USING_CPU_USAGE_LATEST_VERSION is not set
CONFIG_PKG_CPU_USAGE_VER="v1.0.0"
# CONFIG_PKG_USING_GBK2UTF8 is not set
# CONFIG_PKG_USING_VCONSOLE is not set
# CONFIG_PKG_USING_KDB is not set
Expand Down
18,502 changes: 10,878 additions & 7,624 deletions fimeware/hmi-board-win32/JLinkLog.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SET(SOURCES components/ui_comp_button.c
ui_helpers.c
images/ui_img_ok_small_png.c
images/ui_img_no_signal_png.c
images/ui_img_ok_big_png.c
images/ui_img_no_conn_png.c
images/ui_img_btn1_png.c
images/ui_img_btn1_press_png.c
images/ui_img_roller_bg_png.c
Expand Down Expand Up @@ -57,6 +57,7 @@ SET(SOURCES components/ui_comp_button.c
images/ui_img_file_25x25_png.c
images/ui_img_line_png.c
images/ui_img_link_png.c
images/ui_img_ok_big_png.c
images/ui_img_position_png.c
images/ui_img_talk_png.c
images/ui_img_wifi_png.c
Expand Down
3 changes: 2 additions & 1 deletion fimeware/hmi-board-win32/board/lvgl/demo/win32/filelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ components/ui_comp_hook.c
ui_helpers.c
images/ui_img_ok_small_png.c
images/ui_img_no_signal_png.c
images/ui_img_ok_big_png.c
images/ui_img_no_conn_png.c
images/ui_img_btn1_png.c
images/ui_img_btn1_press_png.c
images/ui_img_roller_bg_png.c
Expand Down Expand Up @@ -57,6 +57,7 @@ images/ui_img_clash_png.c
images/ui_img_file_25x25_png.c
images/ui_img_line_png.c
images/ui_img_link_png.c
images/ui_img_ok_big_png.c
images/ui_img_position_png.c
images/ui_img_talk_png.c
images/ui_img_wifi_png.c
Expand Down

Large diffs are not rendered by default.

291 changes: 182 additions & 109 deletions fimeware/hmi-board-win32/board/lvgl/demo/win32/screens/ui_main.c

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,26 @@ lv_obj_set_style_bg_color(ui_ok_group, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV
lv_obj_set_style_bg_opa(ui_ok_group, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui_ok_group, 0, LV_PART_MAIN| LV_STATE_DEFAULT);

ui_image_ok_big1 = lv_img_create(ui_ok_group);
lv_img_set_src(ui_image_ok_big1, &ui_img_ok_big_png);
lv_obj_set_width( ui_image_ok_big1, LV_SIZE_CONTENT); /// 1
lv_obj_set_height( ui_image_ok_big1, LV_SIZE_CONTENT); /// 1
lv_obj_set_align( ui_image_ok_big1, LV_ALIGN_CENTER );
lv_obj_add_flag( ui_image_ok_big1, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
lv_obj_clear_flag( ui_image_ok_big1, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
ui_mqtt_Spinner = lv_spinner_create(ui_ok_group,1000,90);
lv_obj_set_width( ui_mqtt_Spinner, 100);
lv_obj_set_height( ui_mqtt_Spinner, 100);
lv_obj_set_align( ui_mqtt_Spinner, LV_ALIGN_CENTER );
lv_obj_clear_flag( ui_mqtt_Spinner, LV_OBJ_FLAG_CLICKABLE ); /// Flags
lv_obj_set_style_arc_color(ui_mqtt_Spinner, lv_color_hex(0x8F8FFF), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_arc_opa(ui_mqtt_Spinner, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_arc_width(ui_mqtt_Spinner, 5, LV_PART_MAIN| LV_STATE_DEFAULT);

lv_obj_set_style_arc_color(ui_mqtt_Spinner, lv_color_hex(0xFFFFFF), LV_PART_INDICATOR | LV_STATE_DEFAULT );
lv_obj_set_style_arc_opa(ui_mqtt_Spinner, 255, LV_PART_INDICATOR| LV_STATE_DEFAULT);
lv_obj_set_style_arc_width(ui_mqtt_Spinner, 5, LV_PART_INDICATOR| LV_STATE_DEFAULT);

ui_mqtt_image = lv_img_create(ui_ok_group);
lv_img_set_src(ui_mqtt_image, &ui_img_no_conn_png);
lv_obj_set_width( ui_mqtt_image, LV_SIZE_CONTENT); /// 1
lv_obj_set_height( ui_mqtt_image, LV_SIZE_CONTENT); /// 1
lv_obj_set_align( ui_mqtt_image, LV_ALIGN_CENTER );
lv_obj_add_flag( ui_mqtt_image, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
lv_obj_clear_flag( ui_mqtt_image, LV_OBJ_FLAG_SCROLLABLE ); /// Flags

ui_Button = ui_Button_create(ui_ok_group);
lv_obj_set_x( ui_Button, 0 );
Expand All @@ -121,7 +134,6 @@ lv_obj_set_height( ui_info_text, LV_SIZE_CONTENT); /// 32
lv_obj_set_x( ui_info_text, 0 );
lv_obj_set_y( ui_info_text, 17 );
lv_obj_set_align( ui_info_text, LV_ALIGN_TOP_MID );
lv_textarea_set_placeholder_text(ui_info_text,"Input text area...");
lv_textarea_set_one_line(ui_info_text,true);
lv_obj_clear_flag( ui_info_text, LV_OBJ_FLAG_CLICKABLE ); /// Flags
lv_obj_set_style_text_color(ui_info_text, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_DEFAULT );
Expand Down Expand Up @@ -184,6 +196,20 @@ lv_obj_set_style_border_width(ui_clintid_text, 0, LV_PART_MAIN| LV_STATE_DEFAULT



ui_clint_addr_text = lv_textarea_create(ui_mqtt_panel);
lv_obj_set_width( ui_clint_addr_text, 209);
lv_obj_set_height( ui_clint_addr_text, LV_SIZE_CONTENT); /// 30
lv_textarea_set_text(ui_clint_addr_text,"broker.emqx.io");
lv_textarea_set_placeholder_text(ui_clint_addr_text,"Clint addr");
lv_textarea_set_one_line(ui_clint_addr_text,true);
lv_obj_set_style_text_color(ui_clint_addr_text, lv_color_hex(0x789DFF), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_text_opa(ui_clint_addr_text, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_clint_addr_text, lv_color_hex(0x454545), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_bg_opa(ui_clint_addr_text, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui_clint_addr_text, 0, LV_PART_MAIN| LV_STATE_DEFAULT);



ui_username_text = lv_textarea_create(ui_mqtt_panel);
lv_obj_set_width( ui_username_text, 209);
lv_obj_set_height( ui_username_text, LV_SIZE_CONTENT); /// 30
Expand Down Expand Up @@ -246,6 +272,7 @@ lv_obj_add_event_cb(ui_Button, ui_event_Button_Button, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_subscript_text, ui_event_subscript_text, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_puliish_text, ui_event_puliish_text, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_clintid_text, ui_event_clintid_text, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_clint_addr_text, ui_event_clint_addr_text, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_username_text, ui_event_username_text, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_password_text, ui_event_password_text, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_port_text, ui_event_port_text, LV_EVENT_ALL, NULL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ lv_obj_set_style_bg_opa(ui_Network_panel, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui_Network_panel, 0, LV_PART_MAIN| LV_STATE_DEFAULT);

ui_wifi_input_panel = lv_obj_create(ui_setup);
lv_obj_set_width( ui_wifi_input_panel, 190);
lv_obj_set_width( ui_wifi_input_panel, 215);
lv_obj_set_height( ui_wifi_input_panel, 90);
lv_obj_set_x( ui_wifi_input_panel, 0 );
lv_obj_set_y( ui_wifi_input_panel, -40 );
lv_obj_set_align( ui_wifi_input_panel, LV_ALIGN_CENTER );
lv_obj_add_flag( ui_wifi_input_panel, LV_OBJ_FLAG_HIDDEN ); /// Flags
lv_obj_clear_flag( ui_wifi_input_panel, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
lv_obj_set_style_bg_color(ui_wifi_input_panel, lv_color_hex(0x4A4A4A), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_bg_opa(ui_wifi_input_panel, 250, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_wifi_input_panel, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui_wifi_input_panel, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_wifi_input_panel, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_PRESSED );
lv_obj_set_style_bg_opa(ui_wifi_input_panel, 255, LV_PART_MAIN| LV_STATE_PRESSED);
Expand Down Expand Up @@ -171,7 +171,7 @@ lv_obj_set_style_bg_opa(ui_wifiTextArea, 255, LV_PART_CURSOR| LV_STATE_DEFAULT);
ui_cancel_btn = lv_btn_create(ui_wifi_input_panel);
lv_obj_set_width( ui_cancel_btn, 63);
lv_obj_set_height( ui_cancel_btn, 22);
lv_obj_set_x( ui_cancel_btn, 5 );
lv_obj_set_x( ui_cancel_btn, 15 );
lv_obj_set_y( ui_cancel_btn, 0 );
lv_obj_set_align( ui_cancel_btn, LV_ALIGN_BOTTOM_LEFT );
lv_obj_add_flag( ui_cancel_btn, LV_OBJ_FLAG_SCROLL_ON_FOCUS ); /// Flags
Expand All @@ -192,7 +192,7 @@ lv_obj_set_style_text_font(ui_Label12, &lv_font_montserrat_12, LV_PART_MAIN| LV_
ui_cancel_btn1 = lv_btn_create(ui_wifi_input_panel);
lv_obj_set_width( ui_cancel_btn1, 63);
lv_obj_set_height( ui_cancel_btn1, 22);
lv_obj_set_x( ui_cancel_btn1, -5 );
lv_obj_set_x( ui_cancel_btn1, -15 );
lv_obj_set_y( ui_cancel_btn1, 0 );
lv_obj_set_align( ui_cancel_btn1, LV_ALIGN_BOTTOM_RIGHT );
lv_obj_add_flag( ui_cancel_btn1, LV_OBJ_FLAG_SCROLL_ON_FOCUS ); /// Flags
Expand Down
45 changes: 26 additions & 19 deletions fimeware/hmi-board-win32/board/lvgl/demo/win32/screens/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ static wifi_info Info;
wifi_info_t Wifi_InfoS[20];
int wifi_index = 0;

void extract_numbers(const char *input_str, char *output_str, int output_str_length)
{
int output_index = 0;

for (int i = 0; input_str[i] != '\0'; i++) {
if (isdigit(input_str[i])) {
output_str[output_index] = input_str[i];
output_index++;

if (output_index >= output_str_length - 1) {
break;
}
}
}

output_str[output_index] = '\0';
}

void PageDelay(uint32_t ms)
{
uint32_t lastTime = lv_tick_get();
Expand All @@ -37,8 +55,8 @@ static rt_err_t wifi_scan_result_cache(struct rt_wlan_info *info)
{
rt_err_t err = RT_EOK;
if ((info == RT_NULL) || (info->ssid.len == 0)) return -RT_EINVAL;
LOG_D("ssid:%s len:%d mac:%02x:%02x:%02x:%02x:%02x:%02x", info->ssid.val, info->ssid.len,
info->bssid[0], info->bssid[1], info->bssid[2], info->bssid[3], info->bssid[4], info->bssid[5]);
// LOG_D("ssid:%s len:%d mac:%02x:%02x:%02x:%02x:%02x:%02x", info->ssid.val, info->ssid.len,
// info->bssid[0], info->bssid[1], info->bssid[2], info->bssid[3], info->bssid[4], info->bssid[5]);
return err;
}

Expand Down Expand Up @@ -68,7 +86,7 @@ static void wifi_scan_thread_entry(void *parameter)
struct rt_wlan_info *info = RT_NULL;
int ret = 0;
int i = 0;

while (rt_wlan_get_mode(RT_WLAN_DEVICE_STA_NAME) != RT_WLAN_STATION)
{
rt_thread_mdelay(200);
Expand All @@ -87,7 +105,7 @@ static void wifi_scan_thread_entry(void *parameter)
LOG_E("Scan with info error:%d!\n", ret);
return;
}
wifi_show_ui();
wifi_show_ui(ui_Network_panel);
}

int WiFi_Scan(void)
Expand Down Expand Up @@ -214,20 +232,20 @@ void wifi_event_handler(lv_event_t *e)
break;
}
}
//lv_label_set_text(ui_wifiTextArea, s);
lv_textarea_set_placeholder_text(ui_wifiTextArea, ssid);
_ui_opacity_set(ui_wifi_input_panel, 0);
_ui_flag_modify(ui_wifi_input_panel, LV_OBJ_FLAG_HIDDEN, _UI_MODIFY_FLAG_REMOVE);
fadein_Animation(ui_wifi_input_panel, 0);
}
}

void wifi_show_ui(void)
void wifi_show_ui(lv_obj_t *obj)
{
uint16_t i = 0, ops_y = 0, duration = 0;

if (rt_wlan_is_connected() == RT_TRUE)
{
wifiname_list_btn = lv_list_add_btn(ui_Network_panel, RT_NULL, Wifi_InfoS[wifi_index].ssid);
wifiname_list_btn = lv_list_add_btn(obj, RT_NULL, Wifi_InfoS[wifi_index].ssid);
lv_obj_set_size(wifiname_list_btn, 250, 25);
lv_obj_align(wifiname_list_btn, LV_ALIGN_TOP_MID, 0, ops_y);
lv_obj_clear_flag(wifiname_list_btn, LV_OBJ_FLAG_SCROLLABLE); /// Flags
Expand Down Expand Up @@ -257,7 +275,7 @@ void wifi_show_ui(void)
{
for (i = 0, duration = 100, ops_y = 0; i < 8; i++, duration += 100, ops_y += 30)
{
wifiname_list_btn = lv_list_add_btn(ui_Network_panel, RT_NULL, Wifi_InfoS[i].ssid);
wifiname_list_btn = lv_list_add_btn(obj, RT_NULL, Wifi_InfoS[i].ssid);
lv_obj_set_size(wifiname_list_btn, 250, 25);
lv_obj_align(wifiname_list_btn, LV_ALIGN_TOP_MID, 0, ops_y);
lv_obj_clear_flag(wifiname_list_btn, LV_OBJ_FLAG_SCROLLABLE); /// Flags
Expand Down Expand Up @@ -317,14 +335,3 @@ void palyer_list_clear(player_t p)
}
}
}

void play_video(const char *video_name)
{
// palyer_list_clear(&v_player);
// player_control(&v_player, PLAYER_CMD_INIT, (char *)video_name);
}

void exit_play_video(void)
{
// player_control(&v_player, PLAYER_CMD_DELETE, RT_NULL);
}
13 changes: 12 additions & 1 deletion fimeware/hmi-board-win32/board/lvgl/demo/win32/screens/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <rtthread.h>
#include <rtdevice.h>
#include <ctype.h>

#include "player.h"
#include "wlan_mgnt.h"
Expand All @@ -11,6 +12,9 @@

#define __Sizeof(arr) (sizeof(arr)/sizeof(arr[0]))

#define __Map(x, in_min, in_max, out_min, out_max) \
(((x) - (in_min)) * ((out_max) - (out_min)) / ((in_max) - (in_min)) + (out_min))

typedef struct wifi_info
{
char ssid[24];
Expand All @@ -22,18 +26,25 @@ extern struct player v_player;
extern int wifi_index;
extern uint8_t *v_pbuffer;

extern char *alarm_temp_data;
extern char *alarm_humi_data;

void PageDelay(uint32_t ms);
void extract_numbers(const char *input_str, char *output_str, int output_str_length);
int WiFi_Scan(void);
void backlight_setvalue(int value);
void play_video(const char *video_name);
void exit_play_video(void);
void wifi_show_ui(void);
void wifi_show_ui(lv_obj_t *obj);
int WiFi_Join(const char *ssid, const char *password);
void scalewin_Animation2(lv_obj_t *TargetObject, int delay, int direction);

extern lv_obj_t *wifiname_list_btn;
extern lv_obj_t *ui_wifi_icon;

extern void ui_acquire(void);
extern void ui_release(void);

LV_IMG_DECLARE(ui_img_wifi_png); // assets\wifi.png

#endif
Loading

0 comments on commit 43828f0

Please sign in to comment.