Browse Source

1、添加电压修正,低于1V则修正为0

guohui 1 year ago
parent
commit
e0f201252e
3 changed files with 12 additions and 3 deletions
  1. 2 2
      pro/config/cfg.h
  2. 1 1
      pro/src/app.c
  3. 9 0
      pro/src/switch_ctrl.c

+ 2 - 2
pro/config/cfg.h

@@ -167,7 +167,7 @@
 
     #define PROD_POWER_TYPE                     5
 #elif defined PRJ_INSPUR_DC_I_DC_O
-    #define LANGUAGE                            0           //english
+    #define LANGUAGE                            0           //chinese
     #define SMPLE_TIME                          30          //ms
     #define SAVE_TIME                           60000       //ms
     #define CASCADE_CNT                         0
@@ -177,7 +177,7 @@
 
     #define PROD_POWER_TYPE                     1
 #elif defined PRJ_SG_I3_O3
-    #define LANGUAGE                            0           //english
+    #define LANGUAGE                            0           //chinese
     #define SMPLE_TIME                          30          //ms
     #define SAVE_TIME                           60000       //ms
     #define CASCADE_CNT                         0

+ 1 - 1
pro/src/app.c

@@ -2608,7 +2608,7 @@ int app_init(void)
     websocket_init();
     appweb_init();
 
-    //Cellular_init();
+    Cellular_init();
     wifi_init();
 
     upg_init();

+ 9 - 0
pro/src/switch_ctrl.c

@@ -147,9 +147,14 @@ int g_switch_get_ac_single_s_all_cur_info(void* manger,int saddr,int nNumb,Power
         // 解电压数据
         val = (data_temp[1 + Index] << 16) | data_temp[0 + Index];
         _power[i].voltage = val / 1000.0;
+        if(_power[i].voltage>0 && _power[i].voltage<=1.0f) {
+            _power[i].voltage = 0;
+        }
+
         // 解电流数据
         val = (data_temp[3 + Index] << 16) | data_temp[2 + Index];
         _power[i].current = val / 1000.0;
+
         // 解功率数据
         val = (data_temp[5 + Index] << 16) | data_temp[4 + Index];
         _power[i].power = val / 1000.0;
@@ -1795,6 +1800,10 @@ int g_switch_get_t_ac_all_out_info(void* manger,int saddr,int nNumb,PowerInfo* _
         // 解电压数据
         float value = (data_temp[1+Index] << 16) + data_temp[0+Index];
         _power[i].voltage = value / 1000.0;
+        if(_power[i].voltage>0 && _power[i].voltage<=1.0f) {
+            _power[i].voltage = 0;
+        }
+
         // 解电流数据
         value = (data_temp[3+Index] << 16) + data_temp[2+Index];
         _power[i].current = value / 1000.0;