void DuiLib::CHubItemEditGrid::Save()
{
	//保存HUB编辑
	int nPinIndex = 0;
	int nCurSel = -1;
	CComboUI* pCombo = NULL;
	int nICPinNum = m_stHubPinData.use_dat_pin_count;
	for (size_t i = 0; i < m_vtHubItemSwitchAddrCmb.size(); i++)
	{
		pCombo = m_vtHubItemSwitchAddrCmb[i];
		if (pCombo == NULL) continue;

#if 0 
		nCurSel = pCombo->GetCurSel();
		int nKey = nCurSel + (pCombo->GetTag() / nICPinNum) * nICPinNum;
		MAP_INDEX_PINTAB::iterator itMFind = m_mapPinTab.find(nKey);
		if (itMFind != m_mapPinTab.end())
		{
			int nICIndex = (pCombo->GetTag() / nICPinNum);
			if (nICIndex < m_stHubPinData._count)
			{
				int nCurIndex = (pCombo->GetTag() % nICPinNum);
				if (nCurIndex < PIN_NUM)
				{
					m_stHubPinData.pin[nICIndex].dat_pin_tab[nCurIndex] = itMFind->second;
				}
				ELSE_ASSERT
			}
			ELSE_ASSERT
		}
		ELSE_ASSERT
#else
		nCurSel = pCombo->GetCurSel();
		CControlUI* pItem = pCombo->GetItemAt(pCombo->GetCurSel());
		int nVal = -1;
		if (pItem)
		{
			nVal = _ttoi(pItem->GetText().GetData());
		}
		if (nVal != -1)
		{
			int nICIndex = (pCombo->GetTag() / nICPinNum);
			if (nICIndex < m_stHubPinData._count)
			{
				int nCurIndex = (pCombo->GetTag() % nICPinNum);
				if (nCurIndex < CA_BoxHelper::GetPinNum())
				{
					m_stHubPinData.pin[nICIndex].dat_pin_tab[nCurIndex] = nVal;
				}
				ELSE_ASSERT
			}
			ELSE_ASSERT
		}	
		ELSE_ASSERT
#endif
	}

	MC_BOX_DATAINST().set_hub_pin_data(&m_stHubPinData); 
}
