Beispiel #1
0
void PageDetail::InitJun(HTREEITEM hitem)
{
	CString strSubText; //节点名称
	CString strMainText;//节点类型名称
	CString strName;
    CString strType;
	int nNum = 0;
	int nKey;
	int nID;
	HTREEITEM hMainItem = NULL;
    HTREEITEM hSubItem = NULL;
	Component *pTemp = NULL;
	for(int i=1; i< 30; i++)
	{
		nNum = 0;
		IteratorPtr<Component> iteratorPtr(m_pCompManager->CreatJunIterator());
		hMainItem = m_tree.InsertItem(strMainText,hitem);
		for(iteratorPtr->Fist();!iteratorPtr->IsDone();iteratorPtr->Next())
		{
			pTemp = &iteratorPtr->CurrentItem();
			if(i == pTemp->GetID())
			{
				nKey = iteratorPtr->CurrentKey();
				nID = pTemp->GetKey();
				strName = pTemp->GetName(m_pScenario);
				strSubText.Format(_T("J%d(%s)"),nID,strName);
				hSubItem = m_tree.InsertItem(strSubText,hMainItem);
				m_tree.SetItemData(hSubItem,nKey);
				strType = pTemp->GetTypeName();
				nNum++;
			}
		}
		if(nNum != 0)
		{
			strMainText.Format(_T("%s(%d)"),strType,nNum);
			m_tree.SetItemText(hMainItem,strMainText);
			m_tree.SetItemData(hMainItem,2);
		}
		else
		{
			m_tree.DeleteItem(hMainItem);
		}
	}
}
Beispiel #2
0
void PageDetail::InitPipe(HTREEITEM hitem)
{
	CString strText;
	CString strName;
	int nKey;
	int nID;
	HTREEITEM hsubItem = NULL;
	Component *pTemp = NULL;
	IteratorPtr<Component> iteratorPtr(m_pCompManager->CreatPipeIterator());
	for(iteratorPtr->Fist();!iteratorPtr->IsDone();iteratorPtr->Next())
	{
		pTemp = &iteratorPtr->CurrentItem();
		nKey = iteratorPtr->CurrentKey();
		nID = pTemp->GetKey();
		strName = pTemp->GetName(m_pScenario);
		strText.Format(_T("P%d(%s)"),nID,strName);
		hsubItem = m_tree.InsertItem(strText,hitem);
		m_tree.SetItemData(hsubItem,nKey);
	}
}
Component::Component( Component& c){
    this->id = c.GetID();
    this->type = c.GetType();
    this->name = c.GetName();
}
Beispiel #4
0
	Component *ComponentManager::CreateComponent(const std::string &componentName)
	{
		Component *component = componentFactory.Create(componentName);

		if (component != NULL)
			Application::GetSingleton().GetLogManager().GetLog("ProtoZed").Info("Created component \""+component->GetName()+"\"");
		else
			Application::GetSingleton().GetLogManager().GetLog("ProtoZed").Error("Tried to create component \""+componentName+"\", but it does not exist");

		return component;
	}