| | |
| | | m_pTerminalDisplayDlg = nullptr; |
| | | m_pObserver = nullptr; |
| | | m_pPanelMaster = nullptr; |
| | | m_pPanelProduction = nullptr; |
| | | m_pPanelEquipment = nullptr; |
| | | m_pPanelAttributes = nullptr; |
| | | m_pPageGraph1 = nullptr; |
| | |
| | | |
| | | if (STATE::NOT_CONNECTED == state) { |
| | | m_pMyStatusbar->setCimBtnText("Disconnected"); |
| | | //m_labelPassiveState.setBackground(DISCONNECTED_BACKGROUND); |
| | | //m_labelPassiveState.setForeground(DISCONNECTED_FOREGROUND, TRUE); |
| | | m_pMyStatusbar->setCimBtnColors( |
| | | CIM_STATUS_BK_DISCONNECTED, CIM_STATUS_BK_DISCONNECTED, RGB(0, 0, 0)); |
| | | } |
| | | else if (STATE::NOT_SELECTED == state) { |
| | | m_pMyStatusbar->setCimBtnText("Not Selected"); |
| | | //m_labelPassiveState.setBackground(NOT_SELECTED_BACKGROUND); |
| | | //m_labelPassiveState.setForeground(NOT_SELECTED_FOREGROUND, TRUE); |
| | | m_pMyStatusbar->setCimBtnColors( |
| | | CIM_STATUS_BK_DISCONNECTED, CIM_STATUS_BK_DISCONNECTED, RGB(0, 0, 0)); |
| | | } |
| | | else if (STATE::SELECTED == state) { |
| | | m_pMyStatusbar->setCimBtnText("Selected"); |
| | | //m_labelPassiveState.setBackground(SELECTED_BACKGROUND); |
| | | //m_labelPassiveState.setForeground(SELECTED_FOREGROUND, TRUE); |
| | | m_pMyStatusbar->setCimBtnColors( |
| | | CIM_STATUS_BK_SELECTED, CIM_STATUS_BK_SELECTED, RGB(0, 0, 0)); |
| | | } |
| | | } |
| | | pAny->release(); |
| | |
| | | |
| | | // model init |
| | | theApp.m_model.init(); |
| | | SetTimer(TIMER_ID_LOGIN, 1000, nullptr); |
| | | SetTimer(TIMER_ID_LOGIN, 1500, nullptr); |
| | | |
| | | // 菜单 |
| | | CMenu menu; |
| | |
| | | m_pTab->SetBkgndColor(RGB(222, 222, 222)); |
| | | ShowChildPage(0); |
| | | |
| | | // 读取面板宽 |
| | | CString strIniFile; |
| | | strIniFile.Format(_T("%s\\%s.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir, (LPTSTR)(LPCTSTR)theApp.m_strAppFile); |
| | | int nPanelWidth = GetPrivateProfileInt(_T("App"), _T("MasterPanelWidth"), |
| | | int((double)GetSystemMetrics(SM_CXSCREEN) * 0.25), (LPTSTR)(LPCTSTR)strIniFile); |
| | | |
| | | m_pPanelMaster = new CPanelMaster(); |
| | | m_pPanelMaster->setPanelWidth(nPanelWidth); |
| | | m_pPanelMaster->Create(IDD_PANEL_MASTER, this); |
| | | m_pPanelMaster->ShowWindow(SW_SHOW); |
| | | m_pPanelProduction = new CPanelProduction(); |
| | | m_pPanelProduction->setPanelWidth(nPanelWidth); |
| | | m_pPanelProduction->Create(IDD_PANEL_PRODUCTION, this); |
| | | m_pPanelProduction->ShowWindow(SW_SHOW); |
| | | m_pPanelEquipment = new CPanelEquipment(); |
| | | m_pPanelEquipment->Create(IDD_PANEL_EQUIPMENT, this); |
| | | m_pPanelAttributes = new CPanelAttributes(); |
| | |
| | | m_pPanelMaster = nullptr; |
| | | } |
| | | |
| | | if (m_pPanelProduction != nullptr) { |
| | | m_pPanelProduction->DestroyWindow(); |
| | | delete m_pPanelProduction; |
| | | m_pPanelProduction = nullptr; |
| | | } |
| | | |
| | | if (m_pPanelEquipment != nullptr) { |
| | | m_pPanelEquipment->DestroyWindow(); |
| | | delete m_pPanelEquipment; |
| | |
| | | |
| | | |
| | | int nPanelWidth = 0; |
| | | if (m_pPanelMaster != nullptr) { |
| | | if (m_pPanelMaster != nullptr && ::IsWindow(m_pPanelMaster->GetSafeHwnd()) |
| | | && m_pPanelMaster->IsWindowVisible()) { |
| | | nPanelWidth = m_pPanelMaster->getPanelWidth(); |
| | | m_pPanelMaster->MoveWindow(x, y, nPanelWidth, y2 - y); |
| | | x += nPanelWidth; |
| | | } |
| | | |
| | | if (m_pPanelProduction != nullptr && m_pPanelProduction->IsWindowVisible()) { |
| | | nPanelWidth = m_pPanelProduction->getPanelWidth(); |
| | | m_pPanelProduction->MoveWindow(x, y, nPanelWidth, y2 - y); |
| | | x += nPanelWidth; |
| | | } |
| | | |
| | |
| | | LRESULT CServoDlg::OnPanelResize(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | int width = (int)wParam; |
| | | // m_pPanel->SetPanelWidth(width); |
| | | |
| | | if (m_pPanelMaster != nullptr) { |
| | | m_pPanelMaster->setPanelWidth(width); |
| | | } |
| | | if (m_pPanelProduction != nullptr) { |
| | | m_pPanelProduction->setPanelWidth(width); |
| | | } |
| | | |
| | | CString strIniFile, strValue; |
| | | strIniFile.Format(_T("%s\\%s.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir, (LPTSTR)(LPCTSTR)theApp.m_strAppFile); |
| | | strValue.Format(_T("%d"), width); |
| | | WritePrivateProfileString(_T("App"), _T("MasterPanelWidth"), |
| | | (LPTSTR)(LPCTSTR)strValue, (LPTSTR)(LPCTSTR)strIniFile); |
| | | |
| | | Resize(); |
| | | |
| | | return 0; |
| | |
| | | } |
| | | |
| | | return strText; |
| | | } |
| | | } |