Browse Source

8位转仓

zhunk 1 year ago
parent
commit
93ab9641aa

+ 30 - 0
Application_CBD/applications/hmi.c

@@ -1227,6 +1227,36 @@ static void HMI_Decode(void)
 
 
         }
         }
     }
     }
+    //中端款
+    else if (strstr(rx_buffer,"SwversionV43")!=NULL) {
+        device_status.dtype = 3;
+        if(device_status.version_type != 43)
+        {
+            device_status.version_type = 43;
+            sprintf(device_status.driver, "%s",VERSION_HK_2000W);
+            ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
+            ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
+            MA_save();
+        }
+        else {
+
+        }
+    }
+    //低端款
+    else if (strstr(rx_buffer,"SwversionV42")!=NULL) {
+        device_status.dtype = 3;
+        if(device_status.version_type != 42)
+        {
+            device_status.version_type = 42;
+            sprintf(device_status.driver, "%s",VERSION_HK_2000W);
+            ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
+            ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
+            MA_save();
+        }
+        else {
+
+        }
+    }
     //4.0
     //4.0
     else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
         device_status.dtype = 3;
         device_status.dtype = 3;

+ 9 - 9
Application_cbd_apm32f1/applications/control.c

@@ -748,9 +748,7 @@ void turnzp(void)
         rt_thread_delay(20);
         rt_thread_delay(20);
         while(rt_pin_read(CLEAR_R_LIMIT)==0)
         while(rt_pin_read(CLEAR_R_LIMIT)==0)
         {
         {
-//            rt_pin_write(CLEAR_R,ON);
-//            rt_pin_write(CLEAR_L,OFF);
-            Motor_Juandai(ON);
+            ctr_Collect_Fan(ON);
             rt_thread_delay(50);
             rt_thread_delay(50);
             turn_timeout++;
             turn_timeout++;
             if(turn_timeout==600)
             if(turn_timeout==600)
@@ -771,7 +769,7 @@ void turnzp(void)
         {
         {
 //            rt_pin_write(CLEAR_R,ON);
 //            rt_pin_write(CLEAR_R,ON);
 //            rt_pin_write(CLEAR_L,OFF);
 //            rt_pin_write(CLEAR_L,OFF);
-            Motor_Juandai(ON);
+            ctr_Collect_Fan(ON);
             rt_thread_delay(50);
             rt_thread_delay(50);
             turn_timeout++;
             turn_timeout++;
             if(turn_timeout==600)
             if(turn_timeout==600)
@@ -793,19 +791,16 @@ void turnzp(void)
         {
         {
 //            rt_pin_write(CLEAR_R,OFF);
 //            rt_pin_write(CLEAR_R,OFF);
 //            rt_pin_write(CLEAR_L,OFF);
 //            rt_pin_write(CLEAR_L,OFF);
-            Motor_Juandai(OFF);
+            ctr_Collect_Fan(OFF);
             break;
             break;
         }
         }
         else {
         else {
             break;
             break;
         }
         }
     }
     }
-    Motor_Juandai(OFF);
-//    rt_pin_write(CLEAR_R,OFF);
-//    rt_pin_write(CLEAR_L,OFF);
+    ctr_Collect_Fan(OFF);
     turn_timeout = 0;
     turn_timeout = 0;
     HMI_WRITE("cangWei.rotateFlag.val=%d",0);
     HMI_WRITE("cangWei.rotateFlag.val=%d",0);
-    HMI_WRITE("sysTest.switchClear.val=%d",0);
     rt_thread_delay(1000);
     rt_thread_delay(1000);
 }
 }
 //清扫-常闭型限位开关
 //清扫-常闭型限位开关
@@ -2126,6 +2121,11 @@ static void Control_Clear_thread_entry(void *parameter)
             }
             }
 
 
         }
         }
+        if(device_status.clear_status==2)
+        {
+            turnzp();
+            device_status.clear_status = 0;
+        }
         rt_thread_delay(100);
         rt_thread_delay(100);
     }
     }
 }
 }

+ 3 - 4
Application_cbd_apm32f1/applications/control.h

@@ -37,12 +37,11 @@
     #define VERSION_HK_2000W    "1.3led.40(2000W)"       //水稻
     #define VERSION_HK_2000W    "1.3led.40(2000W)"       //水稻
 #else
 #else
     #define VERSION_HK          "2.5.41(HK)"            //4.0海康-1200W
     #define VERSION_HK          "2.5.41(HK)"            //4.0海康-1200W
-    #define VERSION_HK_2000W    "2.28.4(2000W)"         //4.0水稻
+    #define VERSION_HK_2000W    "2.29.4(2000W)"         //4.0水稻
 #endif
 #endif
 
 
-#define VERSION_ZP          "1.45.1(ZP)"            //1.0转盘
-#define VERSION_GK          "1.41.1(GK)"            //1.0高空
-#define VERSION_V5          "2.0.5(HK)"             //5.0
+#define VERSION_ZP          "2.29.1(ZP)"            //1.0转盘
+#define VERSION_GK          "2.29.1(GK)"            //1.0高空
 
 
 extern rt_event_t event_485_play;
 extern rt_event_t event_485_play;
 
 

+ 0 - 36
Application_cbd_apm32f1/applications/dtu_uart2.c

@@ -977,42 +977,6 @@ char * makeJson()
     else if (device_status.version_type==11) {
     else if (device_status.version_type==11) {
         rt_sprintf(device_status.driver,"%s-%s",VERSION_GK,device_status.driver_4g);
         rt_sprintf(device_status.driver,"%s-%s",VERSION_GK,device_status.driver_4g);
     }
     }
-    else if (device_status.version_type==5) {
-        rt_sprintf(device_status.driver,"%s-%s",VERSION_V5,device_status.driver_4g);
-        cJSON_AddStringToObject(pJsonRoot, "DEVICE_SERIAL_NUMBER", device_status.imei);
-        cJSON_AddStringToObject(pJsonRoot, "VERSION", device_status.driver);
-        cJSON_AddStringToObject(pJsonRoot, "SIGNAL", device_status.csq);
-        cJSON_AddStringToObject(pJsonRoot, "SIM", device_status.iccid);
-        static char iso8601_time[32];  // 确保缓冲区足够大以容纳时间字符串
-        get_iso8601_utc_time(iso8601_time, sizeof(iso8601_time),24);
-        cJSON_AddStringToObject(pJsonRoot, "UPDATE_DATE", iso8601_time);
-        cJSON_AddStringToObject(pJsonRoot, "STATUS", "STATUS_ONLINE");
-        cJSON_AddStringToObject(pJsonRoot, "STATUS_DESCRIPTION","设备运行正常");
-        cJSON_AddStringToObject(pJsonRoot, "LOCATION","113.0,34.0");
-        static char iso8601_time_s[32];  // 确保缓冲区足够大以容纳时间字符串
-        get_iso8601_utc_time(iso8601_time_s, sizeof(iso8601_time_s),device_status.startBar);
-        cJSON_AddStringToObject(pJsonRoot, "START_TIME",iso8601_time_s);
-        get_iso8601_utc_time(iso8601_time_s, sizeof(iso8601_time_s),device_status.stopBar);
-        cJSON_AddStringToObject(pJsonRoot, "END_TIME",iso8601_time_s);
-
-        cJSON_AddNumberToObject(pJsonRoot, "CONTRIL", !device_status.timeSwitch);
-        cJSON_AddNumberToObject(pJsonRoot, "TT", device_status.sunBar);
-        cJSON_AddNumberToObject(pJsonRoot, "WS", device_status.work_status);
-        cJSON_AddNumberToObject(pJsonRoot, "TPS", device_status.tpl);
-        cJSON_AddNumberToObject(pJsonRoot, "RPS", device_status.rain_status);
-        cJSON_AddNumberToObject(pJsonRoot, "LPS", device_status.sun_status);
-        cJSON_AddNumberToObject(pJsonRoot, "TEMPERATURE", 20.2);
-        cJSON_AddNumberToObject(pJsonRoot, "HUMIDITY", 60.2);
-        char *p = cJSON_PrintUnformatted(pJsonRoot);
-        if(NULL == p)
-        {
-            cJSON_Delete(pJsonRoot);
-            rt_kprintf("cJSON_Delete NULL!!!\n");
-            return NULL;
-        }
-        cJSON_Delete(pJsonRoot);
-        return p;
-    }
 
 
 
 
     cJSON * pSubJson = NULL;
     cJSON * pSubJson = NULL;

+ 38 - 31
Application_cbd_apm32f1/applications/hmi.c

@@ -509,22 +509,14 @@ static void HMI_Decode(void)
         LOG_I("停止一键测试!!!");
         LOG_I("停止一键测试!!!");
         device_status.auto_test_sw=0;
         device_status.auto_test_sw=0;
     }
     }
+    else if (strstr(rx_buffer,"turnzp")!=NULL) {
+        LOG_W("转仓!");
+        device_status.clear_status=2;
+    }
     //清扫
     //清扫
     else if (strstr(rx_buffer,"clear")!=NULL) {
     else if (strstr(rx_buffer,"clear")!=NULL) {
-        rt_kprintf("\n清扫!\n");
-        if(device_status.version_type==4||device_status.version_type==41)
-        {
-            device_status.clear_status=1;
-        }
-        else if (device_status.version_type==1) {
-            turnzp();
-        }
-        else if (device_status.version_type==6) {
-            ctr_JD_Clear(ON);
-        }
-        else if (device_status.version_type==5) {
-
-        }
+        LOG_W("清扫!");
+        device_status.clear_status=1;
     }
     }
     //震动
     //震动
     else if (strstr(rx_buffer,"putTest.switchShake=1")!=NULL) {
     else if (strstr(rx_buffer,"putTest.switchShake=1")!=NULL) {
@@ -1151,6 +1143,38 @@ static void HMI_Decode(void)
 
 
         }
         }
     }
     }
+    //中端款
+    else if (strstr(rx_buffer,"SwversionV43")!=NULL) {
+        device_status.dtype = 3;
+        if(device_status.version_type != 43)
+        {
+            device_status.dtype = 3;
+            device_status.version_type = 43;
+            sprintf(device_status.driver, "%s",VERSION_HK);
+            ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
+            ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
+            MA_save();
+        }
+        else {
+
+        }
+    }
+    //低端款
+    else if (strstr(rx_buffer,"SwversionV42")!=NULL) {
+        device_status.dtype = 3;
+        if(device_status.version_type != 42)
+        {
+            device_status.dtype = 3;
+            device_status.version_type = 42;
+            sprintf(device_status.driver, "%s",VERSION_HK);
+            ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
+            ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
+            MA_save();
+        }
+        else {
+
+        }
+    }
     //4.0
     //4.0
     else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
         device_status.dtype = 3;
         device_status.dtype = 3;
@@ -1161,7 +1185,6 @@ static void HMI_Decode(void)
             sprintf(device_status.driver, "%s",VERSION_HK);
             sprintf(device_status.driver, "%s",VERSION_HK);
             ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
             ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
-            DTU_Write("SwversionV41");
             MA_save();
             MA_save();
         }
         }
         else {
         else {
@@ -1177,25 +1200,12 @@ static void HMI_Decode(void)
             sprintf(device_status.driver, "%s",VERSION_HK_2000W);
             sprintf(device_status.driver, "%s",VERSION_HK_2000W);
             ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
             ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
-            DTU_Write("SwversionV4");
             MA_save();
             MA_save();
         }
         }
         else {
         else {
 
 
         }
         }
     }
     }
-    //5.0测报灯
-    else if (strstr(rx_buffer,"SwversionV5")!=NULL) {
-        device_status.dtype = 3;
-        if(device_status.version_type!=5)
-        {
-            device_status.version_type = 5;
-            sprintf(device_status.driver, "%s",VERSION_V5);
-            ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
-            ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
-            MA_save();
-        }
-    }
 
 
     else if (strstr(rx_buffer,"putTest.switchFAN_PU=1")!=NULL) {
     else if (strstr(rx_buffer,"putTest.switchFAN_PU=1")!=NULL) {
         ctr_Fan_PUT(ON);
         ctr_Fan_PUT(ON);
@@ -1801,9 +1811,6 @@ void Check_ParamConfig(void)
         else if (device_status.version_type==41) {
         else if (device_status.version_type==41) {
             rt_sprintf(device_status.driver, "%s",VERSION_HK);
             rt_sprintf(device_status.driver, "%s",VERSION_HK);
         }
         }
-        else if (device_status.version_type==5) {
-            rt_sprintf(device_status.driver, "%s",VERSION_V5);
-        }
         /*定制三色光源*/
         /*定制三色光源*/
         #if LAMP_EN == 1
         #if LAMP_EN == 1
             if(device_status.sunBar%3!=0)
             if(device_status.sunBar%3!=0)

+ 10 - 0
Application_cbd_apm32f1/packages/syswatch-latest/src/syswatch.c

@@ -25,6 +25,9 @@
 #endif
 #endif
 #include <rtdbg.h>
 #include <rtdbg.h>
 
 
+//设备状态表结构体
+Device_Status_typedef device_status;
+
 typedef struct{
 typedef struct{
     rt_bool_t init_ok;
     rt_bool_t init_ok;
     rt_uint16_t sec_cnt;//time counter
     rt_uint16_t sec_cnt;//time counter
@@ -401,6 +404,13 @@ static void syswatch_thread_entry(void *parameter)
             ctr_cangmen_up(OPEN);
             ctr_cangmen_up(OPEN);
             #endif
             #endif
         }
         }
+        if((alarm_new.tm_hour)==8&&(alarm_new.tm_min==00)&&(alarm_new.tm_sec==0))
+        {
+            LOG_W("定制8:00执行转仓!");
+            device_status.clear_status = 2;
+        }
+
+
 #if DINGZHI_0722 == 1
 #if DINGZHI_0722 == 1
         if((alarm_new.tm_hour)==12&&(alarm_new.tm_min==20)&&(alarm_new.tm_sec==12))
         if((alarm_new.tm_hour)==12&&(alarm_new.tm_min==20)&&(alarm_new.tm_sec==12))
         {
         {

+ 2 - 0
Application_cbd_apm32f1/readme.md

@@ -1,3 +1,5 @@
+#define VERSION_HK_2000W    "2.29.4(2000W)"         //4.0水稻 
+	中端款定制8位转仓;
 #define VERSION_HK_2000W    "2.28.4(2000W)"         //4.0水稻 
 #define VERSION_HK_2000W    "2.28.4(2000W)"         //4.0水稻 
 	1. 修复在备用电池安装的情况下断电再重启,控制板串口发送数据异常;
 	1. 修复在备用电池安装的情况下断电再重启,控制板串口发送数据异常;
 	2. 雨控处理逻辑调整:
 	2. 雨控处理逻辑调整: