|
|
@@ -1709,37 +1709,92 @@ static void* shm_thread(void *arg)
|
|
|
int nIndex=0;
|
|
|
if (nselect==0)
|
|
|
{
|
|
|
- //_globalDeviceManager->_globalPowerManger;
|
|
|
- _globalDeviceManager->g_shm_Data->fV = _globalDeviceManager->_globalPowerManger._PowerInfo.voltage;
|
|
|
- _globalDeviceManager->g_shm_Data->fA = _globalDeviceManager->_globalPowerManger._PowerInfo.current;
|
|
|
- _globalDeviceManager->g_shm_Data->fW = _globalDeviceManager->_globalPowerManger._PowerInfo.power;
|
|
|
- _globalDeviceManager->g_shm_Data->fF = _globalDeviceManager->_globalPowerManger._PowerInfo.factor;
|
|
|
- _globalDeviceManager->g_shm_Data->fS = _globalDeviceManager->_globalPowerManger._PowerInfo.consumption;
|
|
|
- _globalDeviceManager->g_shm_Data->nStatus = _globalDeviceManager->_globalPowerManger._PowerInfo.status;
|
|
|
- _globalDeviceManager->g_shm_Data->fT = _globalDeviceManager->g_modebus_read.temprature;
|
|
|
- _globalDeviceManager->g_shm_Data->fH = _globalDeviceManager->g_modebus_read.humidity;
|
|
|
+ //输入数据
|
|
|
+ int nselectPH = _globalDeviceManager->g_shm_Data->nSelectPh;
|
|
|
+ if ((__globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_Tree ||
|
|
|
+ __globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_One ||
|
|
|
+ __globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_One_B) &&
|
|
|
+ _globalDeviceManager->g_shm_Data->bT_ACType == 1 && nselectPH > 0)
|
|
|
+ {//三项输入数据
|
|
|
+ GlobalTreeACManager *_pTreeACPowerPhData = NULL;
|
|
|
+ int k = 0;
|
|
|
+ list_for_each_entry(_pTreeACPowerPhData, &_globalDeviceManager->_globalPowerManger.list_Tree_AC, list_Tree_AC)
|
|
|
+ {
|
|
|
+ k += 1;
|
|
|
+ if (nselectPH <= nIndex)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (_pTreeACPowerPhData)
|
|
|
+ {
|
|
|
+ _globalDeviceManager->g_shm_Data->fV = _pTreeACPowerPhData->_PowerInfo.voltage;
|
|
|
+ _globalDeviceManager->g_shm_Data->fA = _pTreeACPowerPhData->_PowerInfo.current;
|
|
|
+ _globalDeviceManager->g_shm_Data->fW = _pTreeACPowerPhData->_PowerInfo.power;
|
|
|
+ _globalDeviceManager->g_shm_Data->fF = _pTreeACPowerPhData->_PowerInfo.factor;
|
|
|
+ _globalDeviceManager->g_shm_Data->fS = _pTreeACPowerPhData->_PowerInfo.consumption;
|
|
|
+ _globalDeviceManager->g_shm_Data->nStatus = _pTreeACPowerPhData->_PowerInfo.status;
|
|
|
+ _globalDeviceManager->g_shm_Data->fT = _globalDeviceManager->g_modebus_read.temprature;
|
|
|
+ _globalDeviceManager->g_shm_Data->fH = _globalDeviceManager->g_modebus_read.humidity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //其他输入数据
|
|
|
+ _globalDeviceManager->g_shm_Data->fV = _globalDeviceManager->_globalPowerManger._PowerInfo.voltage;
|
|
|
+ _globalDeviceManager->g_shm_Data->fA = _globalDeviceManager->_globalPowerManger._PowerInfo.current;
|
|
|
+ _globalDeviceManager->g_shm_Data->fW = _globalDeviceManager->_globalPowerManger._PowerInfo.power;
|
|
|
+ _globalDeviceManager->g_shm_Data->fF = _globalDeviceManager->_globalPowerManger._PowerInfo.factor;
|
|
|
+ _globalDeviceManager->g_shm_Data->fS = _globalDeviceManager->_globalPowerManger._PowerInfo.consumption;
|
|
|
+ _globalDeviceManager->g_shm_Data->nStatus = _globalDeviceManager->_globalPowerManger._PowerInfo.status;
|
|
|
+ _globalDeviceManager->g_shm_Data->fT = _globalDeviceManager->g_modebus_read.temprature;
|
|
|
+ _globalDeviceManager->g_shm_Data->fH = _globalDeviceManager->g_modebus_read.humidity;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ int nselectPH = _globalDeviceManager->g_shm_Data->nSelectPh;
|
|
|
list_for_each_entry(_globalPowerMangerTemp, &_globalDeviceManager->_globalPowerManger.list, list)
|
|
|
{
|
|
|
nIndex += 1;
|
|
|
if (nselect <= nIndex)
|
|
|
break;
|
|
|
}
|
|
|
- // GlobalPowerInfo _globalPowerInfo;
|
|
|
- // memset(&_globalPowerInfo._power_info, 0, sizeof(PowerInfo));
|
|
|
- // memcpy(&_globalPowerInfo._power_info,
|
|
|
- // &_globalDeviceManager->pCtrlBoard[0]._PowerInfo[0],
|
|
|
- // sizeof(PowerInfo));
|
|
|
- _globalDeviceManager->g_shm_Data->fV = _globalPowerMangerTemp->_PowerInfo.voltage;
|
|
|
- _globalDeviceManager->g_shm_Data->fA = _globalPowerMangerTemp->_PowerInfo.current;
|
|
|
- _globalDeviceManager->g_shm_Data->fW = _globalPowerMangerTemp->_PowerInfo.power;
|
|
|
- _globalDeviceManager->g_shm_Data->fF = _globalPowerMangerTemp->_PowerInfo.factor;
|
|
|
- _globalDeviceManager->g_shm_Data->fS = _globalPowerMangerTemp->_PowerInfo.consumption;
|
|
|
- _globalDeviceManager->g_shm_Data->nStatus = _globalPowerMangerTemp->_PowerInfo.status;
|
|
|
- _globalDeviceManager->g_shm_Data->fT = _globalDeviceManager->g_modebus_read.temprature;
|
|
|
- _globalDeviceManager->g_shm_Data->fH = _globalDeviceManager->g_modebus_read.humidity;
|
|
|
+ if ((__globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_Tree||
|
|
|
+ __globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_One ||
|
|
|
+ __globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_One_B) &&
|
|
|
+ _globalDeviceManager->g_shm_Data->bT_ACType == 1&&nselectPH>0)
|
|
|
+ {
|
|
|
+ nIndex=0;
|
|
|
+ GlobalTreeACManager *_pTreeACPowerPhData = NULL;
|
|
|
+ int k = 0;
|
|
|
+ list_for_each_entry(_pTreeACPowerPhData, &_globalPowerMangerTemp->list_Tree_AC, list_Tree_AC)
|
|
|
+ {
|
|
|
+ k += 1;
|
|
|
+ if (nselectPH <= nIndex)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (_pTreeACPowerPhData)
|
|
|
+ {
|
|
|
+ _globalDeviceManager->g_shm_Data->fV = _pTreeACPowerPhData->_PowerInfo.voltage;
|
|
|
+ _globalDeviceManager->g_shm_Data->fA = _pTreeACPowerPhData->_PowerInfo.current;
|
|
|
+ _globalDeviceManager->g_shm_Data->fW = _pTreeACPowerPhData->_PowerInfo.power;
|
|
|
+ _globalDeviceManager->g_shm_Data->fF = _pTreeACPowerPhData->_PowerInfo.factor;
|
|
|
+ _globalDeviceManager->g_shm_Data->fS = _pTreeACPowerPhData->_PowerInfo.consumption;
|
|
|
+ _globalDeviceManager->g_shm_Data->nStatus = _pTreeACPowerPhData->_PowerInfo.status;
|
|
|
+ _globalDeviceManager->g_shm_Data->fT = _globalDeviceManager->g_modebus_read.temprature;
|
|
|
+ _globalDeviceManager->g_shm_Data->fH = _globalDeviceManager->g_modebus_read.humidity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _globalDeviceManager->g_shm_Data->fV = _globalPowerMangerTemp->_PowerInfo.voltage;
|
|
|
+ _globalDeviceManager->g_shm_Data->fA = _globalPowerMangerTemp->_PowerInfo.current;
|
|
|
+ _globalDeviceManager->g_shm_Data->fW = _globalPowerMangerTemp->_PowerInfo.power;
|
|
|
+ _globalDeviceManager->g_shm_Data->fF = _globalPowerMangerTemp->_PowerInfo.factor;
|
|
|
+ _globalDeviceManager->g_shm_Data->fS = _globalPowerMangerTemp->_PowerInfo.consumption;
|
|
|
+ _globalDeviceManager->g_shm_Data->nStatus = _globalPowerMangerTemp->_PowerInfo.status;
|
|
|
+ _globalDeviceManager->g_shm_Data->fT = _globalDeviceManager->g_modebus_read.temprature;
|
|
|
+ _globalDeviceManager->g_shm_Data->fH = _globalDeviceManager->g_modebus_read.humidity;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else if (_globalDeviceManager->g_shm_Data->bPDUSet == 0)
|
|
|
@@ -1749,8 +1804,19 @@ static void* shm_thread(void *arg)
|
|
|
{
|
|
|
nMaxCh+=1;
|
|
|
}
|
|
|
- _globalDeviceManager->g_shm_Data->nMaxCh = nMaxCh;
|
|
|
- _globalDeviceManager->g_shm_Data->bPDUSet = 1;
|
|
|
+ _globalDeviceManager->g_shm_Data->nMaxCh = nMaxCh;
|
|
|
+ if ((__globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_Tree||
|
|
|
+ __globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_One ||
|
|
|
+ __globalDeviceManage._globalDevInfo.product.pwr_type == SmartPDU_Tree_AC_One_B))
|
|
|
+ {
|
|
|
+ _globalDeviceManager->g_shm_Data->bT_ACType = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _globalDeviceManager->g_shm_Data->bT_ACType = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ _globalDeviceManager->g_shm_Data->bPDUSet = 1;
|
|
|
}
|
|
|
else
|
|
|
{ // 小于0 则主程序已析构退出重新等待加载
|