Sfoglia il codice sorgente

1、调整定时显示方式,仅显示一天的任务,增加任务触发情况显示;2、通道扫描改为每个控制板最大扫描次数2次

liyuezong 1 anno fa
parent
commit
047681869e

+ 10 - 1
pro/src/appweb_handle.c

@@ -4534,7 +4534,16 @@ static void serviceManagement(void *conn)
         */
         // 返回定时信息
         lock_s_hold(LOCK_ID_POWER_TIMER);
-        ack_str = service_ds_all_ack_to_json(_serviceManageRequestInfo._ds_info.channelDate,
+        if(_serviceManageRequestInfo._ds_info.channelDate)
+        {
+            strcpy(DS_QueryDate,_serviceManageRequestInfo._ds_info.channelDate);
+        }
+        else
+        {
+            strcpy(DS_QueryDate, "-1-1-1");
+        }
+
+        ack_str = service_ds_all_ack_to_json(DS_QueryDate,
                                         _serviceManageRequestInfo._ds_info.productChName,
                                         _serviceManageRequestInfo._ds_info.productChId,
                                         &__globalDeviceManage._globalPowerManger,0);

+ 2 - 0
pro/src/common.c

@@ -33,6 +33,8 @@ SNMPManager _globalSNMPManager;
 
 int SMS_SEND_COUNT = 0;
 
+char DS_QueryDate[32];
+
 void printf_global_device_info(GlobalDeviceInfo* _globalDeviceInfo)
 {
     log_d("******global device info********* ");

+ 2 - 0
pro/src/common.h

@@ -1379,6 +1379,8 @@ extern SNMPManager _globalSNMPManager;
 
 extern int SMS_SEND_COUNT;
 
+extern char DS_QueryDate[32];
+
 
 void initLogger(void);
 

+ 3 - 2
pro/src/json_handle.c

@@ -4932,7 +4932,7 @@ char* service_ds_all_ack_to_json(char* pDate,char* strName,char* strchID,GlobalP
         _powerDsManageTemp=NULL;
         list_for_each_entry(_powerDsManageTemp, &_globalPowerMangerTemp->list_DS,list)
         {
-            if (!(pDate == NULL || *pDate == '\0'))
+            if (!(pDate == NULL || *pDate == '\0' || strcmp(pDate, "-1-1-1") == 0))
             {
                 if (strcmp(_powerDsManageTemp->ds_date, pDate) != 0)
                 {
@@ -5604,6 +5604,7 @@ cJSON* json_to_service_manage(const char* str,_ServiceManageRequestInfo* _servic
         cJSON* cjson_ds_dateE = cJSON_GetObjectItem(cjson,"endDate"); 
         cJSON* cjson_ds_time = cJSON_GetObjectItem(cjson,"channelTime"); 
         cJSON* cjson_ds_sts = cJSON_GetObjectItem(cjson,"setStatus"); 
+        
         if(cjson_ds_ch_name!=NULL)
             _serviceManageRequestInfo->_ds_info.productChName = cjson_ds_ch_name->valuestring ;
         if(cjson_ds_ch_id!=NULL)
@@ -5622,7 +5623,7 @@ cJSON* json_to_service_manage(const char* str,_ServiceManageRequestInfo* _servic
         if (cjson_ds_time != NULL)
             _serviceManageRequestInfo->_ds_info.channelTime = cjson_ds_time->valuestring;
         if (cjson_ds_sts != NULL)
-            _serviceManageRequestInfo->_ds_info.setStatus = cjson_ds_sts->valuestring ;         
+            _serviceManageRequestInfo->_ds_info.setStatus = cjson_ds_sts->valuestring;
     }
     else if(strcmp(_serviceManageRequestInfo->type,"deleteDs")==0)
     {

+ 11 - 1
pro/src/switch_ctrl.c

@@ -2719,8 +2719,18 @@ int ResetChmData(int nCtrlType)
                                 &type,
                                 &nMaxChn,
                                 __globalDeviceManage._globalDevInfo.product.pwr_type);
+        if (ret != 0)
+        {
+            usleep(300000);
+            ret = g_switch_get_type(&__globalDeviceManage._globalRelaySampManger,
+                                    i,
+                                    &type,
+                                    &nMaxChn,
+                                    __globalDeviceManage._globalDevInfo.product.pwr_type);
+        }
+
         log_d("ret:%d saddr:%d type:%d ch_num:%d.\n", ret, i, type, nMaxChn);
-        // 有效地址记录
+        // 扫描2次,有效地址记录
 
         if (ret == 0)
         {

+ 1 - 1
pro/src/websocket_handle.c

@@ -294,7 +294,7 @@ static int ws_DS_update(ws_handle_t *h)
 {
     char *json;
     lock_s_hold(LOCK_ID_POWER_UPDATE);
-    json = service_ds_all_ack_to_json("","","0",&__globalDeviceManage._globalPowerManger, 1);
+    json = service_ds_all_ack_to_json(DS_QueryDate,"","0",&__globalDeviceManage._globalPowerManger, 1);
     lock_s_release(LOCK_ID_POWER_UPDATE);
     if (json)
     {