Browse Source

增加云端指令实现

lijian 2 days ago
parent
commit
7abfef1037

+ 28 - 12
main/actions.c

@@ -150,8 +150,9 @@ void on_set_inner_addr(uint8_t num) {
     save_inner_addr(addr);
 }
 
-void on_ac_page_set_power(lv_event_t * e, uint8_t power) {
-
+void on_ac_page_set_power(lv_event_t *e, uint8_t power) {
+    hp_controller.power = power;
+    heatpump_set_power(true);
 }
 
 void on_set_beep_on_off(lv_event_t *e) {
@@ -233,25 +234,32 @@ void on_reset_wifi(lv_event_t *e) {
     yx_data_clear(NVS_PASSWORD_KEY);
     esp_restart();
 }
-void on_set_mode(lv_event_t* e, uint8_t mode) {
+
+void on_set_mode(lv_event_t *e, uint8_t mode) {
     ESP_LOGI(TAG, "on_set_mode:%d", mode);
-    if(mode == 1) {
+    hp_controller.mode = mode;
+    heatpump_set_mode(mode);
+    if (mode == 1) {
         lvgl_port_lock(0);
         lv_label_set_text_static(guider_ui.screen_lab_mode, "制冷");
+        lv_obj_set_style_arc_color(guider_ui.screen_arc_temp, lv_color_hex(0x00d9ff),
+                                   LV_PART_INDICATOR | LV_STATE_DEFAULT);
         lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", hp_controller.cool_set_temp);
         lv_obj_add_state(guider_ui.screen_ib_cool, LV_STATE_CHECKED);
         lv_obj_remove_state(guider_ui.screen_ib_heat, LV_STATE_CHECKED);
-        lv_arc_set_range(guider_ui.screen_arc_temp, 7,22);
-        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp);
+        lv_arc_set_range(guider_ui.screen_arc_temp, 7 * 2, 22 * 2);
+        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp * 2);
         lvgl_port_unlock();
-    } else if(mode ==2) {
+    } else if (mode == 2) {
         lvgl_port_lock(0);
+        lv_obj_set_style_arc_color(guider_ui.screen_arc_temp, lv_color_hex(0xfa890a),
+                                   LV_PART_INDICATOR | LV_STATE_DEFAULT);
         lv_label_set_text_static(guider_ui.screen_lab_mode, "制热");
         lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", hp_controller.heat_set_temp);
         lv_obj_remove_state(guider_ui.screen_ib_cool, LV_STATE_CHECKED);
         lv_obj_add_state(guider_ui.screen_ib_heat, LV_STATE_CHECKED);
-        lv_arc_set_range(guider_ui.screen_arc_temp, 30,60);
-        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.heat_set_temp);
+        lv_arc_set_range(guider_ui.screen_arc_temp, 30 * 2, 60 * 2);
+        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.heat_set_temp * 2);
         lvgl_port_unlock();
     }
 }
@@ -260,13 +268,21 @@ void on_arc_temp_value_changed(lv_event_t *e) {
     lv_obj_t *arc = lv_event_get_current_target(e);
     int32_t value = lv_arc_get_value(arc);
     lvgl_port_lock(0);
-    lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", (uint16_t) value);
+    lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", (uint16_t) value / 2);
     lvgl_port_unlock();
 }
 
 void on_arc_temp_released(lv_event_t *e) {
     lv_obj_t *arc = lv_event_get_current_target(e);
     int32_t value = lv_arc_get_value(arc);
-    //ac_status.set_temp = (uint16_t) value;
-    //ac_set_temp(true);
+    if (hp_controller.mode == MODE_COOL) hp_controller.cool_set_temp = value / 2;
+    if (hp_controller.mode == MODE_HEAT) hp_controller.heat_set_temp = value / 2;
+    heatpump_set_temp(value / 2);
+}
+
+void on_screen_gesture_bottom(lv_event_t *e) {
+    lv_obj_t *c_obj = lv_event_get_current_target_obj(e);
+    lv_obj_t *obj = lv_event_get_target_obj(e);
+    if(c_obj == guider_ui.screen_arc_temp)return;
+    ui_load_scr_animation(&guider_ui, &guider_ui.SettingPage, guider_ui.SettingPage_del, &guider_ui.screen_del, setup_scr_SettingPage, LV_SCR_LOAD_ANIM_MOVE_BOTTOM, 100, 0, false, false);
 }

+ 5 - 0
main/actions.h

@@ -129,4 +129,9 @@ void on_arc_temp_value_changed(lv_event_t *e);
  * @param e
  */
 void on_arc_temp_released(lv_event_t *e);
+/**
+ * 主界面-从屏幕边缘滑动事件
+ * @param e
+ */
+void on_screen_gesture_bottom(lv_event_t *e);
 #endif //WIRE_CONTROLLER_ACTIONS_H

+ 305 - 0
main/app/heatpump_controller.c

@@ -5,8 +5,267 @@
  * Copyright: Copyright (©) 2025 永续绿建. All rights reserved.
  */
 #include "heatpump_controller.h"
+#include "system/miscellaneous_interface.h"
+#include "freertos/FreeRTOS.h"
+#include <freertos/task.h>
+#include <cJSON.h>
+#include <esp_log.h>
+#include "freertos/semphr.h"
+#include "sht30.h"
+#include "gateway/access.h"
+#include "sub_device/command.h"
+#include "lvgl_port.h"
+#include "modbus_master.h"
 
 hp_controller_t hp_controller = {0};
+static SemaphoreHandle_t report_task_sem; // 上报任务信号量,用于实现操作完成上立即上报当前状态
+static TaskHandle_t cloud_report_handle;
+static const char *TAG = "hp_controller";
+static TaskHandle_t report_trigger_handle;
+static TaskHandle_t status_task_handle;
+
+
+void set_bit(uint16_t *num, uint8_t bit, bool value) {
+    if (bit > 15) return;
+
+    if (value) {
+        *num |= (1 << bit);
+    } else {
+        *num &= ~(1 << bit);
+    }
+}
+
+bool get_bit(uint16_t num, uint8_t bit) {
+    if (bit > 15) return false;
+    return (num >> bit) & 1;
+}
+
+esp_err_t set_relay_status(uint8_t no, uint8_t value) {
+    esp_err_t err = ESP_OK;
+    set_bit(&hp_controller.relay_status, no, value);
+    nvs_set_uint16(hp_controller.relay_status, NVS_RELEY_STATUS_KEY);
+    if (cloud_connected) {
+        xSemaphoreGive(report_task_sem);
+    }
+    return err;
+}
+
+static void update_power_ui(bool on_off) {
+    // 同步更新 UI
+    if (guider_ui.screen) {
+        lvgl_port_lock(-1);
+        //lv_obj_set_state(guider_ui.screen_ib_power, LV_IMAGEBUTTON_STATE_CHECKED_RELEASED, on_off);
+        if (on_off) {
+            lv_obj_remove_flag(guider_ui.screen_cont_power_on, LV_OBJ_FLAG_HIDDEN);
+            lv_obj_add_flag(guider_ui.screen_cont_power_off, LV_OBJ_FLAG_HIDDEN);
+        } else {
+            lv_obj_remove_flag(guider_ui.screen_cont_power_off, LV_OBJ_FLAG_HIDDEN);
+            lv_obj_add_flag(guider_ui.screen_cont_power_on, LV_OBJ_FLAG_HIDDEN);
+        }
+
+        lvgl_port_unlock();
+    }
+}
+
+
+/******************************************云端指令开始*************************************************************/
+// 云端指令:设置电源开关
+static void cloud_set_power(char *params) {
+    cJSON *data = cJSON_Parse(params);
+    if (data != NULL) {
+        cJSON *value = cJSON_GetObjectItemCaseSensitive(data, "value");
+        hp_controller.power = value->valueint;
+        heatpump_set_power(true);
+        update_power_ui(hp_controller.power);
+        cJSON_Delete(data);
+    }
+}
+
+// 云端指令:设置模式
+static void cloud_set_mode(char *params) {
+    cJSON *data = cJSON_Parse(params);
+    if (data != NULL) {
+        cJSON *value = cJSON_GetObjectItemCaseSensitive(data, "value");
+        hp_controller.mode = value->valueint;
+        if (guider_ui.screen) {
+            if (hp_controller.mode == 1) {
+                lvgl_port_lock(0);
+                lv_label_set_text_static(guider_ui.screen_lab_mode, "制冷");
+                lv_obj_set_style_arc_color(guider_ui.screen_arc_temp, lv_color_hex(0x00d9ff),
+                                           LV_PART_INDICATOR | LV_STATE_DEFAULT);
+                lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", hp_controller.cool_set_temp);
+                lv_obj_add_state(guider_ui.screen_ib_cool, LV_STATE_CHECKED);
+                lv_obj_remove_state(guider_ui.screen_ib_heat, LV_STATE_CHECKED);
+                lv_arc_set_range(guider_ui.screen_arc_temp, 7 * 2, 22 * 2);
+                lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp * 2);
+                lvgl_port_unlock();
+            } else if (hp_controller.mode == 2) {
+                lvgl_port_lock(0);
+                lv_obj_set_style_arc_color(guider_ui.screen_arc_temp, lv_color_hex(0xfa890a),
+                                           LV_PART_INDICATOR | LV_STATE_DEFAULT);
+                lv_label_set_text_static(guider_ui.screen_lab_mode, "制热");
+                lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", hp_controller.heat_set_temp);
+                lv_obj_remove_state(guider_ui.screen_ib_cool, LV_STATE_CHECKED);
+                lv_obj_add_state(guider_ui.screen_ib_heat, LV_STATE_CHECKED);
+                lv_arc_set_range(guider_ui.screen_arc_temp, 30 * 2, 60 * 2);
+                lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.heat_set_temp * 2);
+                lvgl_port_unlock();
+            }
+        }
+        heatpump_set_mode(hp_controller.mode);
+        cJSON_Delete(data);
+    }
+}
+
+// 云端指令:设置水温
+static void cloud_set_water_temp(char *params) {
+    cJSON *data = cJSON_Parse(params);
+    if (data != NULL) {
+        cJSON *value = cJSON_GetObjectItemCaseSensitive(data, "value");
+        heatpump_set_temp(value->valueint);
+        // 更新UI
+        if (guider_ui.screen) {
+            lvgl_port_lock(0);
+            lv_label_set_text_fmt(guider_ui.screen_lab_ac_temp, "%d", value->valueint);
+            lv_arc_set_value(guider_ui.screen_arc_temp, value->valueint);
+            lvgl_port_unlock();
+        }
+        cJSON_Delete(data);
+    }
+}
+
+// 云端指令 :设置分集水器某一路开关
+static void cloud_set_IO(char *params) {
+    cJSON *data = cJSON_Parse(params);
+    if (data != NULL) {
+        cJSON *value = cJSON_GetObjectItemCaseSensitive(data, "value");
+        cJSON *no = cJSON_GetObjectItemCaseSensitive(data, "no");
+        set_relay_status(no->valueint - 1, value->valueint); // 要减1
+        cJSON_Delete(data);
+    }
+}
+
+// 云端指令:联动开关
+static void cloud_set_link(char *params) {
+    cJSON *data = cJSON_Parse(params);
+    if (data != NULL) {
+        cJSON *value = cJSON_GetObjectItemCaseSensitive(data, "value");
+        hp_controller.linkage = value->valueint;
+        heatpump_set_linkage();
+        cJSON_Delete(data);
+    }
+}
+
+/******************************************云端指令END*************************************************************/
+
+static void register_sparrow_commands() {
+    sparrow_command set_power_cmd = {
+            .name = "setPower",
+            .unpack = &cloud_set_power
+    };
+    register_sparrow_command(set_power_cmd);
+
+    // setMode
+    sparrow_command set_mode_cmd = {
+            .name = "setMode",
+            .unpack = &cloud_set_mode
+    };
+    register_sparrow_command(set_mode_cmd);
+    // setWaterTemp
+    sparrow_command set_water_temp = {
+            .name = "setWaterTemp",
+            .unpack = &cloud_set_water_temp
+    };
+    register_sparrow_command(set_water_temp);
+    // setIO
+    sparrow_command set_io = {
+            .name = "setIO",
+            .unpack = &cloud_set_IO
+    };
+    register_sparrow_command(set_io);
+    // setLinkage
+    sparrow_command set_link = {
+            .name = "setLinkage",
+            .unpack = &cloud_set_link
+    };
+    register_sparrow_command(set_link);
+}
+
+_Noreturn static void report_trigger_task(void *arg) {
+    for (;;) {
+        if (cloud_connected) {
+            xSemaphoreGive(report_task_sem);
+        }
+        vTaskDelay(pdTICKS_TO_MS(system_setting.report_data_duration * 1000));
+    }
+}
+
+/**
+ * 状态同步任务
+ * @param arg
+ */
+_Noreturn static void status_sync_task(void *arg) {
+    esp_err_t err = ESP_OK;
+    for (;;) {
+//        mm_set_param(CID_HP_POWER, &hp_controller.power);
+//        mm_set_param(CID_HP_SET_MODE, &hp_controller.mode);
+//        if (hp_controller.mode == MODE_COOL) mm_set_param(CID_HP_COOL_SET_TEMP, &hp_controller.cool_set_temp);
+//        if (hp_controller.mode == MODE_HEAT) mm_set_param(CID_HP_HEAT_SET_TEMP, &hp_controller.heat_set_temp);
+//        mm_get_param(CID_HP_OUTDOOR_TEMP, &hp_controller.outdoor_temp);
+//        mm_get_param(CID_HP_OUT_WATER_TEMP, &hp_controller.out_water_temp);
+//        mm_get_param(CID_HP_IN_WATER_TEMP, &hp_controller.in_water_temp);
+        uint8_t status = get_bit(hp_controller.relay_status, 0);
+        mm_set_param(CID_RELAY_1_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 1);
+        mm_set_param(CID_RELAY_2_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 2);
+        mm_set_param(CID_RELAY_3_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 3);
+        mm_set_param(CID_RELAY_4_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 4);
+        mm_set_param(CID_RELAY_5_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 5);
+        mm_set_param(CID_RELAY_6_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 6);
+        mm_set_param(CID_RELAY_7_STATUS, &status);
+        status = get_bit(hp_controller.relay_status, 7);
+        mm_set_param(CID_RELAY_8_STATUS, &status);
+        vTaskDelay(5000 / portTICK_PERIOD_MS);
+    }
+}
+
+/**
+ * 云端上报任务
+ * @param arg
+ */
+_Noreturn static void cloud_report_task(void *arg) {
+    for (;;) {
+        if (xSemaphoreTake(report_task_sem, portMAX_DELAY) == pdTRUE) {
+            ESP_LOGD(TAG, "cloud report");
+            cJSON *data = cJSON_CreateObject();
+            cJSON_AddNumberToObject(data, "power", hp_controller.power);
+            cJSON_AddNumberToObject(data, "cool_set_water_temp", hp_controller.cool_set_temp);
+            cJSON_AddNumberToObject(data, "heat_set_water_temp", hp_controller.heat_set_temp);
+            cJSON_AddNumberToObject(data, "mode", hp_controller.mode);
+            cJSON_AddNumberToObject(data, "temperature", (int) sht30Data.temperature);
+            cJSON_AddNumberToObject(data, "humidity", (int) sht30Data.humidity);
+            cJSON_AddNumberToObject(data, "outdoor_temp", hp_controller.outdoor_temp);
+            cJSON_AddNumberToObject(data, "out_water_temp", hp_controller.out_water_temp);
+            cJSON_AddNumberToObject(data, "in_water_temp", hp_controller.in_water_temp);
+            cJSON_AddNumberToObject(data, "fjsq_exist", hp_controller.fjsq_exist);
+            cJSON_AddNumberToObject(data, "fjsq_status", hp_controller.relay_status);
+
+            cJSON *root = cJSON_CreateObject();
+            cJSON_AddStringToObject(root, "cmd", "status");
+            cJSON_AddItemToObject(root, "params", data);
+            publish_message_t msg = {
+                    .topic = "status",
+                    .data = root,
+            };
+            sparrow_publish_status(msg);
+        }
+    }
+}
 
 void heatpump_controller_init(system_setting_t *setting) {
     hp_controller.mode = setting->hp_mode;
@@ -14,4 +273,50 @@ void heatpump_controller_init(system_setting_t *setting) {
     hp_controller.cool_set_temp = setting->hp_cool_set_temp;
     hp_controller.heat_set_temp = setting->hp_heat_set_temp;
     hp_controller.relay_status = setting->reley_status;
+    hp_controller.linkage = setting->allow_linkage;
+    register_sparrow_commands();
+    report_task_sem = xSemaphoreCreateBinary();
+    // 启动状态同步任务
+    xTaskCreate(status_sync_task, "status_sync_task", 4 * 1024, NULL, 5, &status_task_handle);
+    // 启动云端上报任务,受信号量控制,无信号时任务不作操作,只有本地有操作或定时上报任务触发时才会上报。
+    xTaskCreate(cloud_report_task, "report_task", 6 * 1024, NULL, 5, &cloud_report_handle);
+    // 启动云端上报任务
+    xTaskCreate(report_trigger_task, "trigger_task", 2 * 1024, NULL, 5, &report_trigger_handle);
+}
+
+
+esp_err_t heatpump_set_power(bool saved) {
+    esp_err_t err = ESP_OK;
+    if (saved)
+        nvs_set_uint16(hp_controller.power, NVS_HP_POWER_KEY);
+
+    if (cloud_connected) {
+        xSemaphoreGive(report_task_sem);
+    }
+    return err;
+}
+
+esp_err_t heatpump_set_mode(uint8_t mode) {
+    esp_err_t err = ESP_OK;
+    nvs_set_uint16(hp_controller.mode, NVS_HP_MODE_KEY);
+    if (cloud_connected) {
+        xSemaphoreGive(report_task_sem);
+    }
+    return err;
+}
+
+esp_err_t heatpump_set_temp(uint16_t temp) {
+    esp_err_t err = ESP_OK;
+    if (hp_controller.mode == MODE_COOL)nvs_set_uint16(hp_controller.cool_set_temp, NVS_HP_COOL_SET_TEMP_KEY);
+    if (hp_controller.mode == MODE_HEAT)nvs_set_uint16(hp_controller.heat_set_temp, NVS_HP_HEAT_SET_TEMP_KEY);
+    if (cloud_connected) {
+        xSemaphoreGive(report_task_sem);
+    }
+    return err;
+}
+
+esp_err_t heatpump_set_linkage() {
+    esp_err_t err = ESP_OK;
+    nvs_set_uint16(hp_controller.linkage, NVS_ALLOW_LINKAGE_KEY);
+    return err;
 }

+ 43 - 3
main/app/include/heatpump_controller.h

@@ -6,23 +6,63 @@
  */
 #ifndef WJ_WIRE_CONTROLLER_HEATPUMP_CONTROLLER_H
 #define WJ_WIRE_CONTROLLER_HEATPUMP_CONTROLLER_H
+
+#include <esp_err.h>
 #include "main.h"
 
 typedef struct {
-    uint8_t power;
-    uint8_t mode;
+    uint16_t power;
+    uint16_t mode;
     uint16_t heat_set_temp;
     uint16_t cool_set_temp;
     uint16_t outdoor_temp;
     uint16_t in_water_temp;
     uint16_t out_water_temp;
     uint16_t relay_status;
+    // 分集水器是否存在
+    uint16_t fjsq_exist;
+    uint16_t linkage; // 内外机是否联动
 
 } hp_controller_t;
 
 extern hp_controller_t hp_controller;
+
 /**
  * 热泵控制器初始化
  */
-void heatpump_controller_init(system_setting_t* setting);
+void heatpump_controller_init(system_setting_t *setting);
+
+/**
+ * 设置电源
+ * @param saved
+ * @return
+ */
+esp_err_t heatpump_set_power(bool saved);
+
+/**
+ * 设置模式
+ * @param mode
+ * @return
+ */
+esp_err_t heatpump_set_mode(uint8_t mode);
+
+/**
+ * 设置温度
+ * @param temp
+ * @return
+ */
+esp_err_t heatpump_set_temp(uint16_t temp);
+
+/**
+ * 设置分集水器某一路的开或关
+ * @param no
+ * @param value
+ * @return
+ */
+esp_err_t set_relay_status(uint8_t no, uint8_t value);
+/**
+ * 设置内外机联动
+ * @return
+ */
+esp_err_t heatpump_set_linkage();
 #endif //WJ_WIRE_CONTROLLER_HEATPUMP_CONTROLLER_H

+ 1 - 1
main/app/include/modbus_master.h

@@ -57,7 +57,7 @@ enum {
 void modbus_master_init();
 
 esp_err_t mm_set_param(uint16_t cid, uint8_t *value);
-
+esp_err_t mm_get_param(uint16_t cid, uint8_t *value);
 /**
  * 发送 modbus 请求
  * @param request

+ 2 - 0
main/app/include/setting.h

@@ -34,6 +34,7 @@
 #define NVS_HP_HEAT_SET_TEMP_KEY "hp_h_temp"
 #define NVS_RELEY_STATUS_KEY "relay"
 #define NVS_FJSQ_SLAVE_ADDR "fjsq_addr"
+#define NVS_ALLOW_LINKAGE_KEY "linkage"
 
 /**
  * 定义五恒模块的类型
@@ -68,6 +69,7 @@ typedef struct {
     uint16_t hp_heat_set_temp; // 制热水温设定
     uint16_t reley_status; // 分集水器1-8路状态
     uint16_t fjsq_slave_addr;// 集控盒通讯地址
+    uint8_t allow_linkage;// 内机外是否联动
 } system_setting_t;
 
 /**

+ 7 - 0
main/app/setting.c

@@ -29,6 +29,7 @@ void read_system_setting(system_setting_t *setting) {
     uint16_t *hp_cool_set_temp = nvs_get_uint16(NVS_HP_COOL_SET_TEMP_KEY);
     uint16_t *hp_heat_set_temp = nvs_get_uint16(NVS_HP_HEAT_SET_TEMP_KEY);
     uint16_t *relay_status = nvs_get_uint16(NVS_RELEY_STATUS_KEY);
+    uint16_t *linkage = nvs_get_uint16(NVS_ALLOW_LINKAGE_KEY);
 
     if (hp_power == NULL) {
         nvs_set_uint16(1, NVS_HP_POWER_KEY);
@@ -36,6 +37,12 @@ void read_system_setting(system_setting_t *setting) {
     } else {
         setting->hp_power = *hp_power;
     }
+    if (linkage == NULL) {
+        nvs_set_uint16(1, NVS_ALLOW_LINKAGE_KEY);
+        setting->allow_linkage = 0;
+    } else {
+        setting->allow_linkage = *linkage;
+    }
     if (hp_mode == NULL) {
         nvs_set_uint16(MODE_COOL, NVS_HP_MODE_KEY);
         setting->hp_mode = MODE_COOL;

+ 0 - 1
main/app/sht30.c

@@ -175,7 +175,6 @@ void ui_wifi_lab_refresh() {
     int rssi = 0;
     if (get_wifi_status()) {
         esp_err_t ret = esp_wifi_sta_get_rssi(&rssi);
-        ESP_LOGE(TAG, "RSSI:%d", rssi);
         if (ret == ESP_OK) {
             lvgl_port_lock(-1);
             if (rssi >= -50) {

+ 1 - 1
main/app/time_sync.c

@@ -69,5 +69,5 @@ static void timer_Task(void *pvParameter)
 
 void time_sync_start(void)
 {
-    xTaskCreate(timer_Task,   "timer_Task",    1024 * 2,NULL, 5, NULL);
+    xTaskCreate(timer_Task,   "timer_Task",    1024 * 4,NULL, 5, NULL);
 }

+ 6 - 6
main/main.c

@@ -72,12 +72,12 @@ void on_wifi_connected(void) {
 
 
 _Noreturn void app_main(void) {
-//    esp_log_level_set("*", ESP_LOG_ERROR);
-//    esp_log_level_set("wifi-setting", ESP_LOG_DEBUG);
-//    esp_log_level_set("ac_controller", ESP_LOG_DEBUG);
-//    esp_log_level_set("mqtt_client", ESP_LOG_DEBUG);
-//    esp_log_level_set("UI", ESP_LOG_DEBUG);
-//    esp_log_level_set("system_setting", ESP_LOG_DEBUG);
+    esp_log_level_set("*", ESP_LOG_ERROR);
+    esp_log_level_set("wifi-setting", ESP_LOG_DEBUG);
+    esp_log_level_set("MODBUS_MASTER", ESP_LOG_DEBUG);
+    esp_log_level_set("hp_controller", ESP_LOG_DEBUG);
+    esp_log_level_set("UI", ESP_LOG_DEBUG);
+    esp_log_level_set("system_setting", ESP_LOG_DEBUG);
     // 初始化NVS
     esp_err_t err = nvs_flash_init(); //nvs初始化
     if (err == ESP_ERR_NVS_NO_FREE_PAGES) {

+ 6 - 2
main/ui/generated/events_init.c

@@ -19,7 +19,7 @@
 #include "actions.h"
 #include "actions.h"
 
-static void screen_item_event_handler (lv_event_t *e)
+static void screen_event_handler (lv_event_t *e)
 {
     lv_event_code_t code = lv_event_get_code(e);
     switch (code) {
@@ -30,6 +30,7 @@ static void screen_item_event_handler (lv_event_t *e)
         case LV_DIR_BOTTOM:
         {
             lv_indev_wait_release(lv_indev_active());
+            on_screen_gesture_bottom(e);
             break;
         }
         default:
@@ -42,6 +43,8 @@ static void screen_item_event_handler (lv_event_t *e)
     }
 }
 
+
+
 static void screen_arc_temp_event_handler (lv_event_t *e)
 {
     lv_event_code_t code = lv_event_get_code(e);
@@ -127,7 +130,8 @@ static void screen_imgbtn_1_event_handler (lv_event_t *e)
 
 void events_init_screen (lv_ui *ui)
 {
-    lv_obj_add_event_cb(ui->screen_item, screen_item_event_handler, LV_EVENT_ALL, ui);
+    lv_obj_add_event_cb(ui->screen, screen_event_handler, LV_EVENT_ALL, ui);
+  //  lv_obj_add_event_cb(ui->screen_item-1, screen_item-1_event_handler, LV_EVENT_ALL, ui);
     lv_obj_add_event_cb(ui->screen_arc_temp, screen_arc_temp_event_handler, LV_EVENT_ALL, ui);
     lv_obj_add_event_cb(ui->screen_ib_power, screen_ib_power_event_handler, LV_EVENT_ALL, ui);
     lv_obj_add_event_cb(ui->screen_ib_heat, screen_ib_heat_event_handler, LV_EVENT_ALL, ui);

+ 0 - 1
main/ui/generated/gui_guider.h

@@ -47,7 +47,6 @@ typedef struct
 	lv_obj_t *screen_lab_icon_err;
 	lv_obj_t *screen_img_wifi;
 	lv_obj_t *screen_lab_icon_cloud;
-	lv_obj_t *screen_item;
 	lv_obj_t *screen_lab_mode;
 	lv_obj_t *WaterValvePage;
 	bool WaterValvePage_del;

+ 2 - 2
main/ui/generated/setup_scr_SettingPage.c

@@ -430,14 +430,14 @@ void setup_scr_SettingPage(lv_ui *ui)
     lv_obj_set_style_arc_width(ui->SettingPage_sp_wifi_scan, 7, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_opa(ui->SettingPage_sp_wifi_scan, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_color(ui->SettingPage_sp_wifi_scan, lv_color_hex(0xd5d6de), LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, false, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, true, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_shadow_width(ui->SettingPage_sp_wifi_scan, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write style for SettingPage_sp_wifi_scan, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
     lv_obj_set_style_arc_width(ui->SettingPage_sp_wifi_scan, 7, LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_opa(ui->SettingPage_sp_wifi_scan, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_color(ui->SettingPage_sp_wifi_scan, lv_color_hex(0xffd400), LV_PART_INDICATOR|LV_STATE_DEFAULT);
-    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, false, LV_PART_INDICATOR|LV_STATE_DEFAULT);
+    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, true, LV_PART_INDICATOR|LV_STATE_DEFAULT);
 
     //Write codes SettingPage_btn_5
     ui->SettingPage_btn_5 = lv_button_create(ui->SettingPage_tabview_1_tab_1);

+ 21 - 43
main/ui/generated/setup_scr_screen.c

@@ -43,9 +43,9 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_set_style_radius(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_bg_opa(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_top(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_bottom(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_left(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_right(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_shadow_width(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write codes screen_arc_temp
@@ -53,9 +53,9 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_set_pos(ui->screen_arc_temp, 73, 51);
     lv_obj_set_size(ui->screen_arc_temp, 340, 340);
     lv_arc_set_mode(ui->screen_arc_temp, LV_ARC_MODE_NORMAL);
-    lv_arc_set_range(ui->screen_arc_temp, 0, 50);
+    lv_arc_set_range(ui->screen_arc_temp, 7, 60);
     lv_arc_set_bg_angles(ui->screen_arc_temp, 150, 30);
-    lv_arc_set_value(ui->screen_arc_temp, 26);
+    lv_arc_set_value(ui->screen_arc_temp, 12);
     lv_arc_set_rotation(ui->screen_arc_temp, 0);
 
     //Write style for screen_arc_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -75,7 +75,7 @@ void setup_scr_screen(lv_ui *ui)
     //Write style for screen_arc_temp, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
     lv_obj_set_style_arc_width(ui->screen_arc_temp, 20, LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_opa(ui->screen_arc_temp, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
-    lv_obj_set_style_arc_color(ui->screen_arc_temp, lv_color_hex(0x00d9ff), LV_PART_INDICATOR|LV_STATE_DEFAULT);
+    lv_obj_set_style_arc_color(ui->screen_arc_temp, lv_color_hex(0x2FCADA), LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_rounded(ui->screen_arc_temp, true, LV_PART_INDICATOR|LV_STATE_DEFAULT);
 
     //Write style for screen_arc_temp, Part: LV_PART_KNOB, State: LV_STATE_DEFAULT.
@@ -84,7 +84,7 @@ void setup_scr_screen(lv_ui *ui)
 
     //Write style for screen_arc_temp, Part: LV_PART_KNOB, State: LV_STATE_FOCUSED.
     lv_obj_set_style_bg_opa(ui->screen_arc_temp, 255, LV_PART_KNOB|LV_STATE_FOCUSED);
-    lv_obj_set_style_bg_color(ui->screen_arc_temp, lv_color_hex(0x2195f6), LV_PART_KNOB|LV_STATE_FOCUSED);
+    lv_obj_set_style_bg_color(ui->screen_arc_temp, lv_color_hex(0x2F92DA), LV_PART_KNOB|LV_STATE_FOCUSED);
     lv_obj_set_style_bg_grad_dir(ui->screen_arc_temp, LV_GRAD_DIR_NONE, LV_PART_KNOB|LV_STATE_FOCUSED);
     lv_obj_set_style_pad_all(ui->screen_arc_temp, 5, LV_PART_KNOB|LV_STATE_FOCUSED);
 
@@ -165,9 +165,9 @@ void setup_scr_screen(lv_ui *ui)
 
     //Write codes screen_lab_temp_low
     ui->screen_lab_temp_low = lv_label_create(ui->screen_cont_power_on);
-    lv_obj_set_pos(ui->screen_lab_temp_low, 81, 328);
+    lv_obj_set_pos(ui->screen_lab_temp_low, 81, 322);
     lv_obj_set_size(ui->screen_lab_temp_low, 71, 20);
-    lv_label_set_text(ui->screen_lab_temp_low, "0°C");
+    lv_label_set_text(ui->screen_lab_temp_low, "7°C");
     lv_label_set_long_mode(ui->screen_lab_temp_low, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_temp_low, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -188,9 +188,9 @@ void setup_scr_screen(lv_ui *ui)
 
     //Write codes screen_lab_temp_high
     ui->screen_lab_temp_high = lv_label_create(ui->screen_cont_power_on);
-    lv_obj_set_pos(ui->screen_lab_temp_high, 320, 328);
+    lv_obj_set_pos(ui->screen_lab_temp_high, 320, 322);
     lv_obj_set_size(ui->screen_lab_temp_high, 71, 20);
-    lv_label_set_text(ui->screen_lab_temp_high, "50°C");
+    lv_label_set_text(ui->screen_lab_temp_high, "22°C");
     lv_label_set_long_mode(ui->screen_lab_temp_high, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_temp_high, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -259,7 +259,7 @@ void setup_scr_screen(lv_ui *ui)
     ui->screen_lab_ac_temp = lv_label_create(ui->screen_cont_power_on);
     lv_obj_set_pos(ui->screen_lab_ac_temp, 165, 209);
     lv_obj_set_size(ui->screen_lab_ac_temp, 132, 72);
-    lv_label_set_text(ui->screen_lab_ac_temp, "26");
+    lv_label_set_text(ui->screen_lab_ac_temp, "12");
     lv_label_set_long_mode(ui->screen_lab_ac_temp, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_ac_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -414,9 +414,9 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_set_style_radius(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_bg_opa(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_top(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_bottom(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_left(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_right(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_shadow_width(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write codes screen_lab_env_hum_2
@@ -599,42 +599,20 @@ void setup_scr_screen(lv_ui *ui)
     lv_label_set_long_mode(ui->screen_lab_icon_cloud, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_icon_cloud, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
-    lv_obj_set_style_bg_opa(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_border_width(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_radius(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_shadow_width(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_top(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_bottom(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_left(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_color(ui->screen_lab_icon_cloud, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(ui->screen_lab_icon_cloud, &lv_font_iconfont_25, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_opa(ui->screen_lab_icon_cloud, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_letter_space(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_line_space(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_align(ui->screen_lab_icon_cloud, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
-
-    //Write codes screen_item
-    ui->screen_item = lv_obj_create(ui->screen);
-    lv_obj_set_pos(ui->screen_item, 225, 352);
-    lv_obj_set_size(ui->screen_item, 29, 26);
-    lv_obj_set_scrollbar_mode(ui->screen_item, LV_SCROLLBAR_MODE_OFF);
-    lv_obj_add_flag(ui->screen_item, LV_OBJ_FLAG_HIDDEN);
-
-    //Write style for screen_item, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
-    lv_obj_set_style_bg_opa(ui->screen_item, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_bg_color(ui->screen_item, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_bg_grad_dir(ui->screen_item, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_width(ui->screen_item, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_opa(ui->screen_item, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_color(ui->screen_item, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_side(ui->screen_item, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_radius(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_shadow_width(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_top(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_bottom(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_left(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_top(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_right(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_bottom(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_left(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_width(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write codes screen_lab_mode
     ui->screen_lab_mode = lv_label_create(ui->screen);
@@ -663,16 +641,16 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_add_flag(ui->screen_arc_temp, LV_OBJ_FLAG_ADV_HITTEST);
     lv_obj_set_ext_click_area(ui->screen_arc_temp, 40);
     if(hp_controller.mode == MODE_COOL) {
-        lv_arc_set_range(ui->screen_arc_temp, 7,22);
+        lv_arc_set_range(ui->screen_arc_temp, 7*2,22*2);
         lv_label_set_text_fmt(ui->screen_lab_ac_temp, "%d", hp_controller.cool_set_temp);
-        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp);
+        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp * 2);
         lv_label_set_text_static(ui->screen_lab_mode, "制冷");
         lv_label_set_text_static(ui->screen_lab_temp_low, "7°C");
         lv_label_set_text_static(ui->screen_lab_temp_high, "22°C");
         lv_obj_add_state(ui->screen_ib_cool, LV_STATE_CHECKED);
     } else if(hp_controller.mode == MODE_HEAT) {
-        lv_arc_set_range(ui->screen_arc_temp, 30,60);
-        lv_arc_set_value(ui->screen_arc_temp, hp_controller.heat_set_temp);
+        lv_arc_set_range(ui->screen_arc_temp, 30*2,60*2);
+        lv_arc_set_value(ui->screen_arc_temp, hp_controller.heat_set_temp * 2);
         lv_label_set_text_fmt(ui->screen_lab_ac_temp, "%d", hp_controller.heat_set_temp);
         lv_label_set_text_static(ui->screen_lab_mode, "制热");
         lv_label_set_text_static(ui->screen_lab_temp_low, "30°C");

+ 4 - 2
main/ui/generated/widgets_init.c

@@ -33,11 +33,13 @@ __attribute__((unused)) void ta_event_cb (lv_event_t *e) {
             lv_keyboard_set_textarea(kb, ta);
             lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN);
         }
-    }
-    else if(code == LV_EVENT_READY) {
+    } else if(code == LV_EVENT_READY) {
         lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
         lv_obj_remove_state(ta, LV_STATE_FOCUSED);
         lv_indev_reset(NULL, ta);
+    } else if(code == LV_EVENT_DEFOCUSED) {
+        lv_keyboard_set_textarea(kb, NULL);
+        lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
     }
 #endif
 }

+ 24 - 14
readme.md

@@ -13,17 +13,23 @@ _线控器向云端上报的自己的运行状态_
 {
   "action": "devSend",
   "msgId": 0,
-  "deviceCode": "84FCE66AA534",
+  "deviceCode": "30EDA0AD0D34",
   "subDeviceId": "",
-  "timestamp": 1747633694000,
+  "timestamp": 1757471161000,
   "data": {
     "cmd": "status",
     "params": {
       "power": 1,
-      "set_water_temp": 25,
-      "mode": 1,
+      "cool_set_water_temp": 18,
+      "heat_set_water_temp": 50,
+      "mode": 2,
+      "temperature": 27,
+      "humidity": 48,
+      "outdoor_temp": 0,
+      "out_water_temp": 0,
+      "in_water_temp": 0,
       "fjsq_exist": 0,
-      "fjsq_status": 8
+      "fjsq_status": 255
     }
   }
 }
@@ -31,15 +37,19 @@ _线控器向云端上报的自己的运行状态_
 
 * 参数说明:
 
-| 字段             | 读写类型 | 类型  | 说明                                                  |
-|----------------|------|-----|-----------------------------------------------------|
-| power          | W/R  | int | 电源状态(0:关,1:开)                                       |
-| set_water_temp | W/R  | int | 设定水温                                                |
-| mode           | R    | int | 模式(1:制冷2:制热)                                        |
-| fjsq_exist     | R    | int | 是否存在分集水器,1:存在,0:不存在                                 |
-| fjsq_status    | R    | int | 分集水器状态,1-8个bit表示分集水器的运行状态,如0011 0011表示1,2,5,6路为开启状态 |
-
-
+| 字段                  | 读写类型 | 类型  | 说明                                                  |
+|---------------------|------|-----|-----------------------------------------------------|
+| power               | W/R  | int | 电源状态(0:关,1:开)                                       |
+| cool_set_water_temp | W/R  | int | 制冷设定水温                                              |
+| heat_set_water_temp | W/R  | int | 制热设定水温                                              |
+| outdoor_temp        | R    | int | 室外温度                                                |
+| out_water_temp      | R    | int | 出水水温                                                |
+| temperature         | R    | int | 室内温度                                                |
+| humidity            | R    | int | 室内湿度                                                |
+| in_water_temp       | R    | int | 进水水温                                                |
+| mode                | W/R  | int | 模式(1:制冷2:制热)                                        |
+| fjsq_exist          | R    | int | 是否存在分集水器,1:存在,0:不存在                                 |
+| fjsq_status         | W/R  | int | 分集水器状态,1-8个bit表示分集水器的运行状态,如0011 0011表示1,2,5,6路为开启状态 |
 
 #### 1.2 电源开关
 

File diff suppressed because it is too large
+ 242 - 165
wj-wire-controller-ui/fp-wire-controller.guiguider


+ 7 - 3
wj-wire-controller-ui/generated/events_init.c

@@ -13,13 +13,13 @@
 
 #if LV_USE_GUIDER_SIMULATOR && LV_USE_FREEMASTER
 #include "freemaster_client.h"
-#endif
+#endifa
 
 #include "custom.h"
 #include "actions.h"
 #include "actions.h"
 
-static void screen_item_event_handler (lv_event_t *e)
+static void screen_event_handler (lv_event_t *e)
 {
     lv_event_code_t code = lv_event_get_code(e);
     switch (code) {
@@ -30,6 +30,7 @@ static void screen_item_event_handler (lv_event_t *e)
         case LV_DIR_BOTTOM:
         {
             lv_indev_wait_release(lv_indev_active());
+            on_screen_gesture_bottom(e);
             break;
         }
         default:
@@ -42,6 +43,8 @@ static void screen_item_event_handler (lv_event_t *e)
     }
 }
 
+
+
 static void screen_arc_temp_event_handler (lv_event_t *e)
 {
     lv_event_code_t code = lv_event_get_code(e);
@@ -127,7 +130,8 @@ static void screen_imgbtn_1_event_handler (lv_event_t *e)
 
 void events_init_screen (lv_ui *ui)
 {
-    lv_obj_add_event_cb(ui->screen_item, screen_item_event_handler, LV_EVENT_ALL, ui);
+    lv_obj_add_event_cb(ui->screen, screen_event_handler, LV_EVENT_ALL, ui);
+  //  lv_obj_add_event_cb(ui->screen_item-1, screen_item-1_event_handler, LV_EVENT_ALL, ui);
     lv_obj_add_event_cb(ui->screen_arc_temp, screen_arc_temp_event_handler, LV_EVENT_ALL, ui);
     lv_obj_add_event_cb(ui->screen_ib_power, screen_ib_power_event_handler, LV_EVENT_ALL, ui);
     lv_obj_add_event_cb(ui->screen_ib_heat, screen_ib_heat_event_handler, LV_EVENT_ALL, ui);

+ 0 - 1
wj-wire-controller-ui/generated/gui_guider.h

@@ -47,7 +47,6 @@ typedef struct
 	lv_obj_t *screen_lab_icon_err;
 	lv_obj_t *screen_img_wifi;
 	lv_obj_t *screen_lab_icon_cloud;
-	lv_obj_t *screen_item;
 	lv_obj_t *screen_lab_mode;
 	lv_obj_t *WaterValvePage;
 	bool WaterValvePage_del;

+ 2 - 2
wj-wire-controller-ui/generated/setup_scr_SettingPage.c

@@ -430,14 +430,14 @@ void setup_scr_SettingPage(lv_ui *ui)
     lv_obj_set_style_arc_width(ui->SettingPage_sp_wifi_scan, 7, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_opa(ui->SettingPage_sp_wifi_scan, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_color(ui->SettingPage_sp_wifi_scan, lv_color_hex(0xd5d6de), LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, false, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, true, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_shadow_width(ui->SettingPage_sp_wifi_scan, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write style for SettingPage_sp_wifi_scan, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
     lv_obj_set_style_arc_width(ui->SettingPage_sp_wifi_scan, 7, LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_opa(ui->SettingPage_sp_wifi_scan, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_color(ui->SettingPage_sp_wifi_scan, lv_color_hex(0xffd400), LV_PART_INDICATOR|LV_STATE_DEFAULT);
-    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, false, LV_PART_INDICATOR|LV_STATE_DEFAULT);
+    lv_obj_set_style_arc_rounded(ui->SettingPage_sp_wifi_scan, true, LV_PART_INDICATOR|LV_STATE_DEFAULT);
 
     //Write codes SettingPage_btn_5
     ui->SettingPage_btn_5 = lv_button_create(ui->SettingPage_tabview_1_tab_1);

+ 21 - 43
wj-wire-controller-ui/generated/setup_scr_screen.c

@@ -43,9 +43,9 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_set_style_radius(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_bg_opa(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_top(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_bottom(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_left(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_right(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_shadow_width(ui->screen_cont_power_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write codes screen_arc_temp
@@ -53,9 +53,9 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_set_pos(ui->screen_arc_temp, 73, 51);
     lv_obj_set_size(ui->screen_arc_temp, 340, 340);
     lv_arc_set_mode(ui->screen_arc_temp, LV_ARC_MODE_NORMAL);
-    lv_arc_set_range(ui->screen_arc_temp, 0, 50);
+    lv_arc_set_range(ui->screen_arc_temp, 7, 60);
     lv_arc_set_bg_angles(ui->screen_arc_temp, 150, 30);
-    lv_arc_set_value(ui->screen_arc_temp, 26);
+    lv_arc_set_value(ui->screen_arc_temp, 12);
     lv_arc_set_rotation(ui->screen_arc_temp, 0);
 
     //Write style for screen_arc_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -75,7 +75,7 @@ void setup_scr_screen(lv_ui *ui)
     //Write style for screen_arc_temp, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
     lv_obj_set_style_arc_width(ui->screen_arc_temp, 20, LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_opa(ui->screen_arc_temp, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
-    lv_obj_set_style_arc_color(ui->screen_arc_temp, lv_color_hex(0x00d9ff), LV_PART_INDICATOR|LV_STATE_DEFAULT);
+    lv_obj_set_style_arc_color(ui->screen_arc_temp, lv_color_hex(0x2FCADA), LV_PART_INDICATOR|LV_STATE_DEFAULT);
     lv_obj_set_style_arc_rounded(ui->screen_arc_temp, true, LV_PART_INDICATOR|LV_STATE_DEFAULT);
 
     //Write style for screen_arc_temp, Part: LV_PART_KNOB, State: LV_STATE_DEFAULT.
@@ -84,7 +84,7 @@ void setup_scr_screen(lv_ui *ui)
 
     //Write style for screen_arc_temp, Part: LV_PART_KNOB, State: LV_STATE_FOCUSED.
     lv_obj_set_style_bg_opa(ui->screen_arc_temp, 255, LV_PART_KNOB|LV_STATE_FOCUSED);
-    lv_obj_set_style_bg_color(ui->screen_arc_temp, lv_color_hex(0x2195f6), LV_PART_KNOB|LV_STATE_FOCUSED);
+    lv_obj_set_style_bg_color(ui->screen_arc_temp, lv_color_hex(0x2F92DA), LV_PART_KNOB|LV_STATE_FOCUSED);
     lv_obj_set_style_bg_grad_dir(ui->screen_arc_temp, LV_GRAD_DIR_NONE, LV_PART_KNOB|LV_STATE_FOCUSED);
     lv_obj_set_style_pad_all(ui->screen_arc_temp, 5, LV_PART_KNOB|LV_STATE_FOCUSED);
 
@@ -165,9 +165,9 @@ void setup_scr_screen(lv_ui *ui)
 
     //Write codes screen_lab_temp_low
     ui->screen_lab_temp_low = lv_label_create(ui->screen_cont_power_on);
-    lv_obj_set_pos(ui->screen_lab_temp_low, 81, 328);
+    lv_obj_set_pos(ui->screen_lab_temp_low, 81, 322);
     lv_obj_set_size(ui->screen_lab_temp_low, 71, 20);
-    lv_label_set_text(ui->screen_lab_temp_low, "0°C");
+    lv_label_set_text(ui->screen_lab_temp_low, "7°C");
     lv_label_set_long_mode(ui->screen_lab_temp_low, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_temp_low, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -188,9 +188,9 @@ void setup_scr_screen(lv_ui *ui)
 
     //Write codes screen_lab_temp_high
     ui->screen_lab_temp_high = lv_label_create(ui->screen_cont_power_on);
-    lv_obj_set_pos(ui->screen_lab_temp_high, 320, 328);
+    lv_obj_set_pos(ui->screen_lab_temp_high, 320, 322);
     lv_obj_set_size(ui->screen_lab_temp_high, 71, 20);
-    lv_label_set_text(ui->screen_lab_temp_high, "50°C");
+    lv_label_set_text(ui->screen_lab_temp_high, "22°C");
     lv_label_set_long_mode(ui->screen_lab_temp_high, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_temp_high, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -259,7 +259,7 @@ void setup_scr_screen(lv_ui *ui)
     ui->screen_lab_ac_temp = lv_label_create(ui->screen_cont_power_on);
     lv_obj_set_pos(ui->screen_lab_ac_temp, 165, 209);
     lv_obj_set_size(ui->screen_lab_ac_temp, 132, 72);
-    lv_label_set_text(ui->screen_lab_ac_temp, "26");
+    lv_label_set_text(ui->screen_lab_ac_temp, "12");
     lv_label_set_long_mode(ui->screen_lab_ac_temp, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_ac_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -414,9 +414,9 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_set_style_radius(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_bg_opa(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_top(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_bottom(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_pad_left(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_right(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_shadow_width(ui->screen_cont_power_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write codes screen_lab_env_hum_2
@@ -599,42 +599,20 @@ void setup_scr_screen(lv_ui *ui)
     lv_label_set_long_mode(ui->screen_lab_icon_cloud, LV_LABEL_LONG_WRAP);
 
     //Write style for screen_lab_icon_cloud, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
-    lv_obj_set_style_bg_opa(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_border_width(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_radius(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_shadow_width(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_top(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_bottom(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_left(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_color(ui->screen_lab_icon_cloud, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(ui->screen_lab_icon_cloud, &lv_font_iconfont_25, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_opa(ui->screen_lab_icon_cloud, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_letter_space(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_line_space(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
     lv_obj_set_style_text_align(ui->screen_lab_icon_cloud, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
-
-    //Write codes screen_item
-    ui->screen_item = lv_obj_create(ui->screen);
-    lv_obj_set_pos(ui->screen_item, 225, 352);
-    lv_obj_set_size(ui->screen_item, 29, 26);
-    lv_obj_set_scrollbar_mode(ui->screen_item, LV_SCROLLBAR_MODE_OFF);
-    lv_obj_add_flag(ui->screen_item, LV_OBJ_FLAG_HIDDEN);
-
-    //Write style for screen_item, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
-    lv_obj_set_style_bg_opa(ui->screen_item, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_bg_color(ui->screen_item, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_bg_grad_dir(ui->screen_item, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_width(ui->screen_item, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_opa(ui->screen_item, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_color(ui->screen_item, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_border_side(ui->screen_item, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_radius(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_shadow_width(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_top(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_bottom(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_left(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
-    lv_obj_set_style_pad_right(ui->screen_item, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_top(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_right(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_bottom(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_left(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_width(ui->screen_lab_icon_cloud, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
 
     //Write codes screen_lab_mode
     ui->screen_lab_mode = lv_label_create(ui->screen);
@@ -663,16 +641,16 @@ void setup_scr_screen(lv_ui *ui)
     lv_obj_add_flag(ui->screen_arc_temp, LV_OBJ_FLAG_ADV_HITTEST);
     lv_obj_set_ext_click_area(ui->screen_arc_temp, 40);
     if(hp_controller.mode == MODE_COOL) {
-        lv_arc_set_range(ui->screen_arc_temp, 7,22);
+        lv_arc_set_range(ui->screen_arc_temp, 7*2,22*2);
         lv_label_set_text_fmt(ui->screen_lab_ac_temp, "%d", hp_controller.cool_set_temp);
-        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp);
+        lv_arc_set_value(guider_ui.screen_arc_temp, hp_controller.cool_set_temp * 2);
         lv_label_set_text_static(ui->screen_lab_mode, "制冷");
         lv_label_set_text_static(ui->screen_lab_temp_low, "7°C");
         lv_label_set_text_static(ui->screen_lab_temp_high, "22°C");
         lv_obj_add_state(ui->screen_ib_cool, LV_STATE_CHECKED);
     } else if(hp_controller.mode == MODE_HEAT) {
-        lv_arc_set_range(ui->screen_arc_temp, 30,60);
-        lv_arc_set_value(ui->screen_arc_temp, hp_controller.heat_set_temp);
+        lv_arc_set_range(ui->screen_arc_temp, 30*2,60*2);
+        lv_arc_set_value(ui->screen_arc_temp, hp_controller.heat_set_temp * 2);
         lv_label_set_text_fmt(ui->screen_lab_ac_temp, "%d", hp_controller.heat_set_temp);
         lv_label_set_text_static(ui->screen_lab_mode, "制热");
         lv_label_set_text_static(ui->screen_lab_temp_low, "30°C");

+ 4 - 2
wj-wire-controller-ui/generated/widgets_init.c

@@ -33,11 +33,13 @@ __attribute__((unused)) void ta_event_cb (lv_event_t *e) {
             lv_keyboard_set_textarea(kb, ta);
             lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN);
         }
-    }
-    else if(code == LV_EVENT_READY) {
+    } else if(code == LV_EVENT_READY) {
         lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
         lv_obj_remove_state(ta, LV_STATE_FOCUSED);
         lv_indev_reset(NULL, ta);
+    } else if(code == LV_EVENT_DEFOCUSED) {
+        lv_keyboard_set_textarea(kb, NULL);
+        lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
     }
 #endif
 }

BIN
wj-wire-controller-ui/lib/native/libdecoder.a


BIN
wj-wire-controller-ui/lib/native/libopenh264.a


BIN
wj-wire-controller-ui/lib/native/librlottie.a


BIN
wj-wire-controller-ui_bak.zip


Some files were not shown because too many files changed in this diff