1.Equipment在面板中显示机器信息(Alive, Name, CIM State, Upstream, Downstream等)
| | |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CEFEM::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | } |
| | |
| | | virtual void term(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | }; |
| | | } |
| | | |
| | |
| | | return m_station; |
| | | } |
| | | |
| | | void CEquipment::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | attrubutes.clear(); |
| | | attrubutes.addAttribute(new CAttribute("Network", |
| | | std::to_string(m_station.nNetNo).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("Station", |
| | | std::to_string(m_station.nStNo).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("ID", |
| | | std::to_string(m_nID).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("Name", |
| | | m_strName.c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("Description", |
| | | m_strDescription.c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("Alive", |
| | | this->isAlive() ? _T("TRUE") : _T("FALSE"), "")); |
| | | attrubutes.addAttribute(new CAttribute("CIM State", |
| | | m_bCimState ? _T("ON") : _T("OFF"), "")); |
| | | attrubutes.addAttribute(new CAttribute("Upstream", |
| | | m_bUpstreamInline ? _T("Inline") : _T("Offline"), "")); |
| | | attrubutes.addAttribute(new CAttribute("Downstream", |
| | | m_bDownstreamInline ? _T("Inline") : _T("Offline"), "")); |
| | | attrubutes.addAttribute(new CAttribute("Local Alarm", |
| | | m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), "")); |
| | | attrubutes.addAttribute(new CAttribute("Auto Recipe Change", |
| | | m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), "")); |
| | | char szTemp[256]; |
| | | for (int i = 0; i < VCR_MAX; i++) { |
| | | sprintf_s(szTemp, 256, "VCR-%d", i + 1); |
| | | attrubutes.addAttribute(new CAttribute(szTemp, |
| | | m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "")); |
| | | } |
| | | } |
| | | |
| | | void CEquipment::setReadBitBlock(unsigned int start, unsigned int end) |
| | | { |
| | | m_blockReadBit.type = (unsigned int)DeviceType::B; |
| | |
| | | std::string& getDescription(); |
| | | void setStation(int network, int station); |
| | | const StationIdentifier& getStation(); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | void setReadBitBlock(unsigned int start, unsigned int end); |
| | | MemoryBlock& getReadBitBlock(); |
| | | void setWriteBitBlock(unsigned int start, unsigned int end); |
| | |
| | | void CPanelEquipment::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | DDX_Control(pDX, IDC_MFCPROPERTYGRID1, m_gridCtrl); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | if (::IsWindow(m_hWnd)) { |
| | | SetDlgItemText(IDC_LABEL_TITLE, m_pEquipment->getName().c_str()); |
| | | } |
| | | } |
| | | |
| | | void CPanelEquipment::loadDataFromEquipment(SERVO::CEquipment* pEquipment) |
| | | { |
| | | m_pEquipment = pEquipment; |
| | | ASSERT(m_pEquipment); |
| | | |
| | | |
| | | // 先清空所有 |
| | | m_gridCtrl.RemoveAll(); |
| | | |
| | | |
| | | // 加载数据 |
| | | SetDlgItemText(IDC_LABEL_TITLE, pEquipment->getName().c_str()); |
| | | SERVO::CAttributeVector attrubutes; |
| | | pEquipment->getAttributeVector(attrubutes); |
| | | unsigned int nSize = attrubutes.size(); |
| | | for (unsigned int i = 0; i < nSize; i++) { |
| | | SERVO::CAttribute* pAttribute = attrubutes.getAttribute(i); |
| | | CMFCPropertyGridProperty* pProperty = new CMFCPropertyGridProperty( |
| | | pAttribute->getName().c_str(), |
| | | pAttribute->getValue().c_str(), |
| | | pAttribute->getDescription().c_str()); |
| | | pProperty->AllowEdit(FALSE); |
| | | m_gridCtrl.AddProperty(pProperty); |
| | | } |
| | | } |
| | | |
| | |
| | | pItem->MoveWindow(5, y, x2 - 5, rcItem.Height()); |
| | | y += rcItem.Height(); |
| | | y += 8; |
| | | |
| | | GetDlgItem(IDC_MFCPROPERTYGRID1)->MoveWindow(5, y, rcClient.Width() - 13, rcClient.Height() - 3 - y); |
| | | } |
| | | |
| | | #define EQUIPMENT_PANEL_MIN_WIDTH 88 |
| | |
| | | virtual ~CPanelEquipment(); |
| | | int getPanelWidth(); |
| | | void SetEquipment(SERVO::CEquipment* pEquipment); |
| | | void loadDataFromEquipment(SERVO::CEquipment* pEquipment); |
| | | |
| | | private: |
| | | COLORREF m_crBkgnd; |
| | | HBRUSH m_hbrBkgnd; |
| | | int m_nPanelWidth; |
| | | CMFCPropertyGridCtrl m_gridCtrl; |
| | | CBlButton m_btnClose; |
| | | SERVO::CEquipment* m_pEquipment; |
| | | |
| | |
| | | ASSERT(pEquipment); |
| | | ASSERT(m_pPanelEquipment); |
| | | ASSERT(m_pPanelAttributes); |
| | | m_pPanelEquipment->SetEquipment(pEquipment); |
| | | m_pPanelEquipment->loadDataFromEquipment(pEquipment); |
| | | m_pPanelAttributes->ShowWindow(SW_HIDE); |
| | | if (!m_pPanelEquipment->IsWindowVisible()) { |
| | | m_pPanelEquipment->ShowWindow(SW_SHOW); |