|
|
@@ -166,48 +166,24 @@ static int get_ac_info(int nCh, int nType, PowerInfo *info)
|
|
|
|
|
|
return -1;
|
|
|
}
|
|
|
-static int slave_get_all_data(cascade_handle_t *cas)
|
|
|
-{
|
|
|
- GlobalPowerManger *tmp=NULL;
|
|
|
- GlobalDeviceManager *dm=get_dm();
|
|
|
|
|
|
- cas->allInfo.type = dm->_global_device_info->product_pwr_type;
|
|
|
- if (dm->_global_device_info->product_pwr_type == SmartPDU_Tree_AC_Tree ||
|
|
|
- dm->_global_device_info->product_pwr_type == SmartPDU_Tree_AC_One)
|
|
|
- {
|
|
|
- get_ac_info(0, 0, &cas->allInfo.info[0]);
|
|
|
- get_ac_info(0, 1, &cas->allInfo.info[1]);
|
|
|
- get_ac_info(0, 2, &cas->allInfo.info[2]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dev_search_latest_power_info(dm->db, dm->_global_device_info->product_id, 0, &cas->allInfo.info[0]);
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
static int slave_get_ch_data(cascade_handle_t *cas)
|
|
|
{
|
|
|
GlobalDeviceManager *dm=get_dm();
|
|
|
GlobalPowerManger *tmp=NULL;
|
|
|
- PowerInfo *info=cas->chInfo.info;
|
|
|
+ power_info_t *power=cas->chInfo.power;
|
|
|
|
|
|
cas->chInfo.cnt=0;
|
|
|
list_for_each_entry(tmp, &dm->_globalPowerManger.list, list)
|
|
|
{
|
|
|
if(tmp) {
|
|
|
- cas->chInfo.channelinfo[cas->chInfo.cnt].info = tmp->_PowerInfo;
|
|
|
-
|
|
|
+ power[cas->chInfo.cnt].pwrinfo = tmp->_PowerInfo;
|
|
|
+ power[cas->chInfo.cnt].start_delay = tmp->product_ch_start_delay;
|
|
|
+ power[cas->chInfo.cnt].stop_delay = tmp->product_ch_stop_delay;
|
|
|
cas->chInfo.cnt++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#if 0
|
|
|
- LOGD("_____ slave, info[0].status: %d\n", info[0].status);
|
|
|
- LOGD("_____ slave, info[1].status: %d\n", info[1].status);
|
|
|
- LOGD("_____ slave, info[2].status: %d\n", info[2].status);
|
|
|
-#endif
|
|
|
-
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -729,7 +705,7 @@ static int power_all_update(cascade_handle_t *cas)
|
|
|
GlobalPowerManger *tmp=NULL;
|
|
|
GlobalDeviceManager *dm2=get_dm2();
|
|
|
int type=cas->allInfo.type;
|
|
|
- PowerInfo *info=cas->allInfo.info;
|
|
|
+ //power_info_t *power=cas->chInfo.power;
|
|
|
|
|
|
if(list_empty(&dm2->_globalPowerManger.list)) {
|
|
|
return -1;
|
|
|
@@ -750,21 +726,17 @@ static int power_ch_update(cascade_handle_t *cas)
|
|
|
int cnt=0;
|
|
|
GlobalPowerManger *tmp=NULL;
|
|
|
GlobalDeviceManager *dm2=get_dm2();
|
|
|
- PowerInfo *info=cas->chInfo.info;
|
|
|
+ power_info_t *power=cas->chInfo.power;
|
|
|
|
|
|
if(cas->chInfo.cnt==0 || list_empty(&dm2->_globalPowerManger.list)) {
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
-#if 0
|
|
|
- LOGD("_____ master, info[0].status: %d\n", info[0].status);
|
|
|
- LOGD("_____ master, info[1].status: %d\n", info[1].status);
|
|
|
- LOGD("_____ master, info[2].status: %d\n", info[2].status);
|
|
|
-#endif
|
|
|
-
|
|
|
list_for_each_entry(tmp, &dm2->_globalPowerManger.list, list)
|
|
|
{
|
|
|
- tmp->_PowerInfo = info[cnt];
|
|
|
+ tmp->_PowerInfo = power[cnt].pwrinfo;
|
|
|
+ tmp->product_ch_start_delay = power[cnt].start_delay;
|
|
|
+ tmp->product_ch_stop_delay = power[cnt].stop_delay;
|
|
|
cnt++;
|
|
|
}
|
|
|
|