Bladeren bron

解决传感器历史数据及阈值导入控制板数量受限的bug

guohui 1 jaar geleden
bovenliggende
commit
21203440d7

File diff suppressed because it is too large
+ 1 - 1
cust_data/web/unique/css/chunk-64fb682e.2ab8fe17.css


File diff suppressed because it is too large
+ 1 - 1
cust_data/web/unique/index.html


File diff suppressed because it is too large
+ 1 - 1
cust_data/web/unique/js/app.8a5077eb.js


File diff suppressed because it is too large
+ 1 - 1
cust_data/web/unique/js/chunk-64fb682e.11b4d1ef.js


+ 2 - 2
pro/src/appweb_handle.c

@@ -2770,8 +2770,8 @@ static void sensorStatusMonitoring(void* conn)
                     
                     case SENSOR_TYPE_TEMP:
                     {
-                        _overSensorBackInfoTemp->temp_humi_sensor.ydata[0][_TempCount] = _globalSensorInfoTemp->val1;
-                        strcpy(_overSensorBackInfoTemp->temp_humi_sensor.xAxis[_TempCount], _globalSensorInfoTemp->samp_time);
+                        _overSensorBackInfoTemp->temp_sensor.ydata[_TempCount] = _globalSensorInfoTemp->val1;
+                        strcpy(_overSensorBackInfoTemp->temp_sensor.xAxis[_TempCount], _globalSensorInfoTemp->samp_time);
                     }
                     break;
 

+ 20 - 2
pro/src/json_handle.c

@@ -3238,8 +3238,7 @@ char* over_sensor_history_info_to_json(_OverSensorBackInfo* _over_all_sensor_bac
             cJSON* data = cJSON_CreateObject();
             cJSON* date_time_xAxis_array = cJSON_CreateArray();
             if(_temp->sensorType == SENSOR_TYPE_TEMP_HUMI||
-               _temp->sensorType == SENSOR_TYPE_TEMP_DOUBLE||
-               _temp->sensorType == SENSOR_TYPE_TEMP)
+               _temp->sensorType == SENSOR_TYPE_TEMP_DOUBLE)
             {
                 for(int i=0;i< TOTAL_COUNT;i++)
                 {  
@@ -3290,6 +3289,25 @@ char* over_sensor_history_info_to_json(_OverSensorBackInfo* _over_all_sensor_bac
                 //cJSON_AddArrayToObject(data,type_data_array);
                  cJSON_AddItemToObject(data,"typeData",type_data_array);
             }
+            else if(_temp->sensorType == SENSOR_TYPE_TEMP)
+            {
+                for(int i=0;i< TOTAL_COUNT;i++)
+                {  
+                    cJSON_AddStringToObject(date_time_xAxis_array,"",_temp->temp_sensor.xAxis[i]);
+                }
+                cJSON_AddItemToObject(data,"xAxis",date_time_xAxis_array);
+                cJSON_AddStringToObject(data,"sensorName",_temp->sensorName);
+                cJSON_AddNumberToObject(data,"sensorType",_temp->sensorType);
+                cJSON* type_data_array = cJSON_CreateArray();
+                cJSON* type_data = cJSON_CreateObject();
+                cJSON_AddStringToObject(type_data,"typeName",language_temperature[__globalDeviceManage._globalDevInfo.product.language]);
+                cJSON* ydate_gas_array = cJSON_CreateFloatArray(_temp->gas_sensor.ydata,TOTAL_COUNT);
+                cJSON_AddItemToObject(type_data,"ydata",ydate_gas_array);
+                cJSON_AddStringToObject(type_data,"type","0");
+                cJSON_AddItemToArray(type_data_array,type_data);
+                //cJSON_AddArrayToObject(data,type_data_array);
+                 cJSON_AddItemToObject(data,"typeData",type_data_array);
+            }
             else if(_temp->sensorType == SENSOR_TYPE_AIR_PRESS)
             {
                 for(int i=0;i< TOTAL_COUNT;i++)

+ 6 - 0
pro/src/json_handle.h

@@ -223,6 +223,11 @@ typedef struct
     char   xAxis[60][32]    ;//时间点
 }_Sensor_Gas_Icon;
 typedef struct
+{
+    float  ydata[60]        ;//气体值
+    char   xAxis[60][32]    ;//时间点
+}_Sensor_Temp_Icon;
+typedef struct
 {
     float  ydata[2][60]     ;//0:气流,1:气压;
     char   xAxis[60][32]    ;//时间点
@@ -276,6 +281,7 @@ typedef struct
     _Sensor_Temp_Humi_Icon  temp_humi_sensor;
     _Sensor_Gas_Icon        gas_sensor;
     _Sensor_Air_Press_Icon  air_press_sensor;
+    _Sensor_Temp_Icon       temp_sensor;
     struct list_head list;
 }_OverSensorBackInfo;
 

+ 2 - 1
pro/src/language_hashmap.c

@@ -126,7 +126,8 @@ void replace_sequences(char *str, HashTable *table) {
             {
                replacement=pEnty->value[__globalDeviceManage._globalDevInfo.product.language];  
             }
-            free(key); // 释放key占用的内存  
+            free(key); // 释放key占用的内存
+            
             if (replacement) {  
                 // 将替换值追加到输出字符串中  
                 strncat(output, replacement, MAX_LEN - output_len - 1);  

+ 2 - 5
pro/src/paras.c

@@ -13,9 +13,6 @@
 #include "sqlite_handle.h"
 
 
-//#define READ_INI
-
-
 #if 1
     #define LOGD            log_d
     #define LOGE            log_e
@@ -2504,7 +2501,7 @@ static int proc_power(char *path, int op, GlobalPowerManger *power, int flag)
 
             memset(tmp, 0, sizeof(GlobalPowerManger));
             for(x=0; x<2; x++) {
-                for(i=1; i<=dm->brdMax; i++) {+
+                for(i=1; i<=CH_MAX; i++) {
                     sprintf(token, "power:channel%d.addr",i);
                     r = ini_rw(dic, token, &tmp->product_saddr, sizeof(tmp->product_saddr), TYPE_INT, op, 1); if(r) break;
                     tmp->product_ch_id = i;
@@ -2797,7 +2794,7 @@ static int proc_power3(char *path, int op, GlobalTreeACManager *power, int flag)
 
             memset(tmp, 0, sizeof(GlobalTreeACManager));
             for(x=0; x<2; x++) {
-                for(i=1; i<=dm->brdMax*3; i++) {
+                for(i=1; i<=CH_MAX*3; i++) {
                     int channelID = i;
 
                     sprintf(token, "power3:channel%d.addr",i);