Преглед на файлове

Merge branch 'master' of https://gowone.dy.takin.cc/liyuezong/SmartPDCode

liyi преди 1 година
родител
ревизия
28df74e0e1
променени са 3 файла, в които са добавени 28 реда и са изтрити 5 реда
  1. 5 4
      pro/src/app.c
  2. 20 1
      pro/src/cascade.c
  3. 3 0
      pro/src/language_hashmap.c

+ 5 - 4
pro/src/app.c

@@ -1117,10 +1117,11 @@ static void* power_thread(void* arg)
                         }
                         _powerDsManageTemp->ds_is_triggered = 1;
                         dev_update_power_ds(__globalDeviceManage.db, _globalPowerMangerTemp->product_id, _globalPowerMangerTemp->product_ch_id, _powerDsManageTemp);
-                       
-                        char strLog[200];
-                         sprintf(strLog, "CH%d", _globalPowerMangerTemp->product_ch_id);
-                        dev_Alarm_Run_message(_globalDeviceManager,strLog,"scheduled task triggered!");
+
+                        char strLog[200], strLog1[200];
+                        sprintf(strLog, "%s", language_Timing_install[0]);
+                        sprintf(strLog1, "CH%d scheduled task triggered!", _globalPowerMangerTemp->product_ch_id);
+                        dev_Alarm_Run_message(_globalDeviceManager, strLog, strLog1);
                     }
                 }                
             }

+ 20 - 1
pro/src/cascade.c

@@ -1372,12 +1372,23 @@ static int power_update(cascade_handle_t *cas)
         }
     }
 
+
+    
+
     if (!list_empty(&dm2->_globalPowerManger.list))
     {
         cnt = 0;
         list_for_each_entry(tmp, &dm2->_globalPowerManger.list, list)
         {
             tmp->_PowerInfo = info->ch[cnt].chinfo;
+            tmp->product_ch_id = info->ch[cnt].product_ch_id;               // 通道号
+            tmp->product_ch_addr = info->ch[cnt].product_ch_addr;           // 通道号实际地址
+            tmp->product_ch_type = info->ch[cnt].product_ch_type;           // 通道类型
+            tmp->product_ch_status = info->ch[cnt].product_ch_status;       // 通道状态
+            tmp->product_ch_NF_status = info->ch[cnt].product_ch_NF_status; // 通道零线状态(三相)
+            tmp->product_ch_start_delay = info->ch[cnt].start_delay;        // 通道延时
+            tmp->product_ch_stop_delay = info->ch[cnt].stop_delay;          // 通道延时
+
             if (tmp->product_ch_type == TREE_AC_TYPE || tmp->product_ch_type == DOUBLE_AC_TYPE || info->prod.product_pwr_type == SmartPDU_Tree_AC_One_B)
             {
                 if (list_empty(&tmp->list_Tree_AC))
@@ -1388,7 +1399,15 @@ static int power_update(cascade_handle_t *cas)
                 int cnt2 = 0;
                 list_for_each_entry(tmp3, &tmp->list_Tree_AC, list_Tree_AC)
                 {
-                    tmp3->_PowerInfo = info->ch[cnt].pinfo[cnt2++].power;
+                    if (cnt2 >= 0 && cnt2 < 3)
+                    {
+                        tmp3->_PowerInfo = info->ch[cnt].pinfo[cnt2].power;
+                        tmp3->product_ph_id = info->ch[cnt].pinfo[cnt2].phase.product_ph_id;                     // 产品通道号
+                        tmp3->product_ph_type = info->ch[cnt].pinfo[cnt2].phase.product_ph_type;                 // 0:A相 1:B相 2:C相
+                        tmp3->product_ph_outputType = info->ch[cnt].pinfo[cnt2].phase.product_ph_outputType;     // 三相控制方式1,三项2单项
+                        tmp3->product_ph_outputStatus = info->ch[cnt].pinfo[cnt2].phase.product_ph_outputStatus; // 该相是否输出,1输出2不输出
+                    }
+                    cnt2++;
                 }
             }
             cnt++;

+ 3 - 0
pro/src/language_hashmap.c

@@ -277,6 +277,9 @@ retry:
     r = insert_Newhash(table,(const char*)language_sensor_leak[0], language_sensor_leak, nMaxSize);
     if(r==HASH_REPEAT) goto repeat; else if(r<HASH_REPEAT) goto failed;
 
+    r = insert_Newhash(table,(const char*)language_Timing_install[0],language_Timing_install,nMaxSize);
+    if(r==HASH_REPEAT) goto repeat; else if(r<HASH_REPEAT) goto failed;
+
     dm->alarmTab = table;
 
     log_d("___ hash table init OK, table size: %d\n", table->size);