Просмотр исходного кода

Merge branch 'master' of http://jiecheng2024.tpddns.cn:3000/liyuezong/SmartPDCode

guohui лет назад: 2
Родитель
Сommit
cb0c580c0b
2 измененных файлов с 8 добавлено и 3 удалено
  1. 7 3
      pro/src/app.c
  2. 1 0
      pro/src/common.h

+ 7 - 3
pro/src/app.c

@@ -775,9 +775,13 @@ void* power_thread(void* arg)
         if(__globalDeviceManage._globalDevInfo.product_pwr_type == SmartPDU_AC
         if(__globalDeviceManage._globalDevInfo.product_pwr_type == SmartPDU_AC
          || __globalDeviceManage._globalDevInfo.product_pwr_type == SmartPDU_DC)
          || __globalDeviceManage._globalDevInfo.product_pwr_type == SmartPDU_DC)
         {
         {
-            __globalDeviceManage.single_mmap->total_current = _globalTotalPowerInfo._power_info.current;
-            __globalDeviceManage.single_mmap->total_power = _globalTotalPowerInfo._power_info.power;
-            __globalDeviceManage.single_mmap->total_valtage = _globalTotalPowerInfo._power_info.voltage;
+            __globalDeviceManage.single_mmap->total_current = _globalTotalPowerInfo._power_info.current*1000;
+            __globalDeviceManage.single_mmap->total_power = _globalTotalPowerInfo._power_info.power*1000;
+            __globalDeviceManage.single_mmap->total_valtage = _globalTotalPowerInfo._power_info.voltage*1000;
+            __globalDeviceManage.single_mmap->total_consumer = _globalTotalPowerInfo._power_info.consumption * 1000;
+            // printf("total_valtage = %d  consumer = %d power = %d\n",__globalDeviceManage.single_mmap->total_valtage,
+            //         __globalDeviceManage.single_mmap->total_current
+            //         ,__globalDeviceManage.single_mmap->total_power);
             __globalDeviceManage.single_mmap->dev_chn = __globalDeviceManage._globalDevInfo.product_pwr_type << 8 | _chn;
             __globalDeviceManage.single_mmap->dev_chn = __globalDeviceManage._globalDevInfo.product_pwr_type << 8 | _chn;
 
 
         }
         }

+ 1 - 0
pro/src/common.h

@@ -740,6 +740,7 @@ typedef struct cascade_single_mmap{
     uint32_t total_valtage;
     uint32_t total_valtage;
     uint32_t total_current;
     uint32_t total_current;
     uint32_t total_power;
     uint32_t total_power;
+    uint32_t total_consumer;
     //temp_hum_t total_temp;
     //temp_hum_t total_temp;
     uint16_t temperature;
     uint16_t temperature;
     uint16_t humidity;
     uint16_t humidity;