Merge branch 'liuyang' into clh
# Conflicts:
# SourceCode/Bond/Servo/Servo.vcxproj
# SourceCode/Bond/Servo/Servo.vcxproj.filters
| | |
| | | std::string cell; |
| | | AlarmInfo alarm; |
| | | |
| | | std::getline(ss, cell, ','); |
| | | std::getline(ss, alarm.strUnitID, ','); |
| | | std::getline(ss, alarm.strUnitNo, ','); |
| | | std::getline(ss, cell, ','); |
| | | alarm.nAlarmLevel = std::stoi(cell); |
| | | std::getline(ss, cell, ','); |
| | | alarm.nAlarmCode = std::stoi(cell); |
| | | std::getline(ss, cell, ','); |
| | | alarm.nAlarmID = std::stoi(cell); |
| | | std::getline(ss, alarm.strAlarmText, ','); |
| | | std::getline(ss, alarm.strDescription, ','); |
| | | try { |
| | | // éåæ®µè§£æå¹¶éªè¯ |
| | | if (!std::getline(ss, cell, ',')) throw std::runtime_error("Missing field: No"); |
| | | if (!std::getline(ss, alarm.strUnitID, ',')) throw std::runtime_error("Missing field: UnitID"); |
| | | if (!std::getline(ss, alarm.strUnitNo, ',')) throw std::runtime_error("Missing field: UnitNo"); |
| | | if (!std::getline(ss, cell, ',')) throw std::runtime_error("Missing field: AlarmLevel"); |
| | | alarm.nAlarmLevel = std::stoi(cell); |
| | | if (!std::getline(ss, cell, ',')) throw std::runtime_error("Missing field: AlarmCode"); |
| | | alarm.nAlarmCode = std::stoi(cell); |
| | | if (!std::getline(ss, cell, ',')) throw std::runtime_error("Missing field: AlarmID"); |
| | | alarm.nAlarmID = std::stoi(cell); |
| | | if (!std::getline(ss, alarm.strAlarmText, ',')) throw std::runtime_error("Missing field: AlarmText"); |
| | | if (!std::getline(ss, alarm.strDescription, ',')) throw std::runtime_error("Missing field: Description"); |
| | | |
| | | if (m_mapAlarm.find(alarm.nAlarmID) == m_mapAlarm.end()) { |
| | | m_mapAlarm[alarm.nAlarmID] = alarm; |
| | | // æ£æ¥æ¯å¦éå¤ |
| | | if (m_mapAlarm.find(alarm.nAlarmID) == m_mapAlarm.end()) { |
| | | m_mapAlarm[alarm.nAlarmID] = alarm; |
| | | } |
| | | else { |
| | | std::cerr << "Duplicate AlarmID: " << alarm.nAlarmID << std::endl; |
| | | } |
| | | } |
| | | else { |
| | | std::cerr << "Duplicate AlarmID: " << alarm.nAlarmID << std::endl; |
| | | catch (const std::exception& e) { |
| | | // æè·å¹¶è®°å½è§£æé误 |
| | | std::cerr << "Error parsing line: " << line << " - " << e.what() << std::endl; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | int CMaster::readCache() |
| | | { |
| | | CFile file; |
| | | if (!file.Open(m_strFilepath.c_str(), CFile::modeRead)) { |
| | | return -1; |
| | | } |
| | | try { |
| | | CFile file; |
| | | if (!file.Open(m_strFilepath.c_str(), CFile::modeRead)) { |
| | | return -1; |
| | | } |
| | | |
| | | CArchive ar(&file, CArchive::load); |
| | | serialize(ar); |
| | | ar.Close(); |
| | | file.Close(); |
| | | CArchive ar(&file, CArchive::load); |
| | | serialize(ar); |
| | | ar.Close(); |
| | | file.Close(); |
| | | } |
| | | catch (CFileException* e) { |
| | | TCHAR szErr[512]; |
| | | e->GetErrorMessage(szErr, 512); |
| | | AfxMessageBox(szErr); |
| | | e->Delete(); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // CPageRecipe.cpp: å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "Servo.h" |
| | | #include "afxdialogex.h" |
| | | #include "PageRecipe.h" |
| | | #include "SECSRuntimeManager.h" |
| | | |
| | | |
| | | // CPageRecipe å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CPageRecipe, CDialogEx) |
| | | |
| | | CPageRecipe::CPageRecipe(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_PAGE_RECIPE, pParent) |
| | | { |
| | | |
| | | } |
| | | |
| | | CPageRecipe::~CPageRecipe() |
| | | { |
| | | } |
| | | |
| | | void CPageRecipe::FillDataToListCtrl(const std::vector<std::string>& vecData) { |
| | | CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST_PPID); |
| | | if (pListCtrl == nullptr || pListCtrl->m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | // æ¸
空å½åCListCtrlä¸çææé¡¹ |
| | | pListCtrl->DeleteAllItems(); |
| | | |
| | | // éåæ°æ®å¹¶æå
¥å°CListCtrlä¸ |
| | | for (int i = 0; i < static_cast<int>(vecData.size()); ++i) { |
| | | // æå
¥è¡ |
| | | pListCtrl->InsertItem(i, _T("")); |
| | | |
| | | // 设置 Recipe Noï¼ç¬¬1åï¼ |
| | | CString strRecipeNo; |
| | | strRecipeNo.Format(_T("%d"), i); |
| | | pListCtrl->SetItemText(i, 1, strRecipeNo); |
| | | |
| | | // 设置 PPIDï¼ç¬¬2åï¼ |
| | | CString strPPID = CA2T(vecData[i].c_str()); |
| | | if (strPPID.CompareNoCase(_T("NULL")) == 0) { |
| | | strPPID.Empty(); |
| | | } |
| | | pListCtrl->SetItemText(i, 2, strPPID); |
| | | } |
| | | |
| | | // è·ååæ° |
| | | int nColCount = pListCtrl->GetHeaderCtrl()->GetItemCount(); |
| | | pListCtrl->SetColumnWidth(nColCount - 1, LVSCW_AUTOSIZE_USEHEADER); |
| | | } |
| | | |
| | | void CPageRecipe::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | DDX_Control(pDX, IDC_LIST_PPID, m_listPPID); |
| | | DDX_Control(pDX, IDC_EDIT_PPID, m_editPPID); |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CPageRecipe, CDialogEx) |
| | | ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CPageRecipe::OnBnClickedButtonSearch) |
| | | ON_BN_CLICKED(IDC_BUTTON_MODIFY, &CPageRecipe::OnBnClickedButtonModify) |
| | | ON_BN_CLICKED(IDC_BUTTON_DELETE, &CPageRecipe::OnBnClickedButtonDelete) |
| | | ON_BN_CLICKED(IDC_BUTTON_DELETE_ALL, &CPageRecipe::OnBnClickedButtonDeleteAll) |
| | | ON_BN_CLICKED(IDC_BUTTON_SAVE, &CPageRecipe::OnBnClickedButtonSave) |
| | | ON_BN_CLICKED(IDC_BUTTON_REFRESH, &CPageRecipe::OnBnClickedButtonRefresh) |
| | | ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST_PPID, &CPageRecipe::OnLvnItemChangedListPPID) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CPageRecipe æ¶æ¯å¤çç¨åº |
| | | |
| | | BOOL CPageRecipe::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST_PPID); |
| | | DWORD dwStyle = pListCtrl->GetExtendedStyle(); |
| | | dwStyle |= LVS_EX_FULLROWSELECT; |
| | | dwStyle |= LVS_EX_GRIDLINES; |
| | | pListCtrl->SetExtendedStyle(dwStyle); |
| | | |
| | | HIMAGELIST imageList = ImageList_Create(24, 24, ILC_COLOR24, 1, 1); |
| | | ListView_SetImageList(pListCtrl->GetSafeHwnd(), imageList, LVSIL_SMALL); |
| | | pListCtrl->InsertColumn(0, _T(""), LVCFMT_RIGHT, 0); |
| | | pListCtrl->InsertColumn(1, _T("Recipe No"), LVCFMT_LEFT, 100); |
| | | pListCtrl->InsertColumn(2, _T("PPID"), LVCFMT_LEFT, 100); |
| | | pListCtrl->SetColumnWidth(2, LVSCW_AUTOSIZE_USEHEADER); |
| | | |
| | | // è·åæææ°æ® |
| | | auto vecData = SECSRuntimeManager::getInstance().getAllPPID(); |
| | | FillDataToListCtrl(vecData); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonSearch() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | CString strInput; |
| | | m_editPPID.GetWindowText(strInput); |
| | | |
| | | int nCount = m_listPPID.GetItemCount(); |
| | | for (int i = 0; i < nCount; ++i) { |
| | | CString strItemText = m_listPPID.GetItemText(i, 2); // 第2å为PPID |
| | | if (strItemText == strInput) { |
| | | m_listPPID.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED); |
| | | m_listPPID.EnsureVisible(i, FALSE); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonModify() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | POSITION pos = m_listPPID.GetFirstSelectedItemPosition(); |
| | | if (!pos) return; |
| | | |
| | | int nSel = m_listPPID.GetNextSelectedItem(pos); |
| | | |
| | | CString strNewPPID; |
| | | m_editPPID.GetWindowText(strNewPPID); |
| | | m_listPPID.SetItemText(nSel, 2, strNewPPID); |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonDelete() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | POSITION pos = m_listPPID.GetFirstSelectedItemPosition(); |
| | | if (!pos) return; |
| | | |
| | | int nSel = m_listPPID.GetNextSelectedItem(pos); |
| | | m_listPPID.SetItemText(nSel, 2, _T("")); |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonDeleteAll() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | int nCount = m_listPPID.GetItemCount(); |
| | | for (int i = 0; i < nCount; ++i) { |
| | | m_listPPID.SetItemText(i, 2, _T("")); |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonSave() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | std::vector<std::string> vecPPID; |
| | | int nCount = m_listPPID.GetItemCount(); |
| | | for (int i = 0; i < nCount; ++i) { |
| | | CString str = m_listPPID.GetItemText(i, 2); |
| | | vecPPID.emplace_back(CT2A(str)); |
| | | } |
| | | SECSRuntimeManager::getInstance().setAllPPID(vecPPID); |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonRefresh() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | auto vecData = SECSRuntimeManager::getInstance().getAllPPID(); |
| | | FillDataToListCtrl(vecData); |
| | | } |
| | | |
| | | void CPageRecipe::OnLvnItemChangedListPPID(NMHDR* pNMHDR, LRESULT* pResult) |
| | | { |
| | | LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); |
| | | *pResult = 0; |
| | | |
| | | if ((pNMLV->uChanged & LVIF_STATE) && |
| | | (pNMLV->uNewState & LVIS_SELECTED)) { |
| | | |
| | | int nItem = pNMLV->iItem; |
| | | CString strPPID = m_listPPID.GetItemText(nItem, 2); |
| | | m_editPPID.SetWindowText(strPPID); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include "afxdialogex.h" |
| | | //#include "ListCtrlEx.h" |
| | | |
| | | |
| | | // CPageRecipe å¯¹è¯æ¡ |
| | | |
| | | class CPageRecipe : public CDialogEx |
| | | { |
| | | DECLARE_DYNAMIC(CPageRecipe) |
| | | |
| | | public: |
| | | CPageRecipe(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CPageRecipe(); |
| | | |
| | | private: |
| | | void FillDataToListCtrl(const std::vector<std::string>& vecData); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_PAGE_RECIPE }; |
| | | #endif |
| | | |
| | | protected: |
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV æ¯æ |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg void OnBnClickedButtonSearch(); |
| | | afx_msg void OnBnClickedButtonModify(); |
| | | afx_msg void OnBnClickedButtonDelete(); |
| | | afx_msg void OnBnClickedButtonDeleteAll(); |
| | | afx_msg void OnBnClickedButtonSave(); |
| | | afx_msg void OnBnClickedButtonRefresh(); |
| | | afx_msg void OnLvnItemChangedListPPID(NMHDR* pNMHDR, LRESULT* pResult); |
| | | DECLARE_MESSAGE_MAP() |
| | | |
| | | private: |
| | | CListCtrl m_listPPID; |
| | | CEdit m_editPPID; |
| | | }; |
| | |
| | | // å建 EqpPPID 表 |
| | | std::string createTableSQL = |
| | | "CREATE TABLE IF NOT EXISTS EqpPPID (" |
| | | "BitNo INTEGER PRIMARY KEY AUTOINCREMENT, " |
| | | "PPID INTEGER NULL);"; |
| | | "RecipeNo INTEGER PRIMARY KEY, " |
| | | "PPID TEXT NULL);"; |
| | | if (!m_pDB->executeQuery(createTableSQL)) { |
| | | throw std::runtime_error("Failed to create EqpPPID table."); |
| | | } |
| | |
| | | if (nCount == 0) { |
| | | // æå
¥åå§æ°æ®ï¼512 è¡ï¼ |
| | | for (int nBitNo = 0; nBitNo < 512; ++nBitNo) { |
| | | std::string insertSQL = "INSERT INTO EqpPPID (BitNo) VALUES (" + std::to_string(nBitNo) + ");"; |
| | | std::string insertSQL = "INSERT INTO EqpPPID (RecipeNo) VALUES (" + std::to_string(nBitNo) + ");"; |
| | | if (!m_pDB->executeQuery(insertSQL)) { |
| | | throw std::runtime_error("Failed to insert data into EqpPPID table."); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | std::vector<std::string> SECSRuntimeManager::getAllPPID() { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) { |
| | | return {}; |
| | | } |
| | | |
| | | std::string querySQL = "SELECT PPID FROM EqpPPID;"; |
| | | auto rows = m_pDB->fetchResults(querySQL); |
| | | |
| | | std::vector<std::string> vecResult; |
| | | for (const auto& row : rows) { |
| | | vecResult.push_back(row[0]); |
| | | } |
| | | return vecResult; |
| | | } |
| | | |
| | | void SECSRuntimeManager::setAllPPID(const std::vector<std::string>& vecPPIDList) { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) return; |
| | | |
| | | // å¼å¯äºå¡ |
| | | m_pDB->executeQuery("BEGIN TRANSACTION;"); |
| | | |
| | | for (size_t i = 0; i < vecPPIDList.size(); ++i) { |
| | | std::string safePPID = vecPPIDList[i]; |
| | | size_t pos = 0; |
| | | while ((pos = safePPID.find('\'', pos)) != std::string::npos) { |
| | | safePPID.insert(pos, 1, '\''); |
| | | pos += 2; |
| | | } |
| | | std::string sql = "UPDATE EqpPPID SET PPID = '" + safePPID + "' WHERE RecipeNo = " + std::to_string(i) + ";"; |
| | | m_pDB->executeQuery(sql); |
| | | } |
| | | |
| | | // æäº¤äºå¡ |
| | | m_pDB->executeQuery("COMMIT;"); |
| | | } |
| | | |
| | | bool SECSRuntimeManager::updatePPIDForRecipe(int nRecipeNo, const std::string& strPPID) { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) { |
| | | return false; |
| | | } |
| | | |
| | | // 转ä¹åå¼å·ï¼é²æ¢ SQL 注å
¥ |
| | | std::string safePPID = strPPID; |
| | | size_t pos = 0; |
| | | while ((pos = safePPID.find('\'', pos)) != std::string::npos) { |
| | | safePPID.insert(pos, 1, '\''); |
| | | pos += 2; |
| | | } |
| | | |
| | | std::string updateSQL = "UPDATE EqpPPID SET PPID = '" + safePPID + "' WHERE RecipeNo = " + std::to_string(nRecipeNo) + ";"; |
| | | return m_pDB->executeQuery(updateSQL); |
| | | } |
| | | |
| | | std::string SECSRuntimeManager::getPPIDForRecipe(int nRecipeNo) { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) { |
| | | return ""; |
| | | } |
| | | |
| | | std::string querySQL = "SELECT PPID FROM EqpPPID WHERE RecipeNo = " + std::to_string(nRecipeNo) + ";"; |
| | | std::vector<std::vector<std::string>> results = m_pDB->fetchResults(querySQL); |
| | | if (!results.empty() && !results[0].empty()) { |
| | | return results[0][0]; |
| | | } |
| | | |
| | | return ""; |
| | | } |
| | | |
| | | int SECSRuntimeManager::getRecipeForPPID(std::string strPPID) { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) { |
| | | return -1; |
| | | } |
| | | |
| | | std::string querySQL = "SELECT RecipeNo FROM EqpPPID WHERE PPID = '" + strPPID + "';"; |
| | | std::vector<std::vector<std::string>> results = m_pDB->fetchResults(querySQL); |
| | | if (!results.empty() && !results[0].empty()) { |
| | | return std::stoi(results[0][0]); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | bool SECSRuntimeManager::deletePPIDForRecipe(int nRecipeNo) { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) { |
| | | return false; |
| | | } |
| | | |
| | | std::string deleteSQL = "UPDATE EqpPPID SET PPID = NULL WHERE RecipeNo = " + std::to_string(nRecipeNo) + ";"; |
| | | return m_pDB->executeQuery(deleteSQL); |
| | | } |
| | | |
| | | bool SECSRuntimeManager::deletePPIDForAllRecipes() { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | | if (m_pDB == nullptr) { |
| | | return false; |
| | | } |
| | | |
| | | std::string deleteSQL = "UPDATE EqpPPID SET PPID = NULL WHERE RecipeNo BETWEEN 0 AND 511;"; |
| | | return m_pDB->executeQuery(deleteSQL); |
| | | } |
| | | |
| | | // åå§å RPTID 表 |
| | | void SECSRuntimeManager::initRPTIDTable() { |
| | | std::lock_guard<std::mutex> lock(m_mutex); |
| | |
| | | */ |
| | | void initPPIDTable(); |
| | | |
| | | std::vector<std::string> getAllPPID(); |
| | | |
| | | void setAllPPID(const std::vector<std::string>& vecPPIDList); |
| | | |
| | | bool updatePPIDForRecipe(int nRecipeNo, const std::string& strPPID); |
| | | |
| | | std::string getPPIDForRecipe(int nRecipeNo); |
| | | |
| | | int getRecipeForPPID(std::string strPPID); |
| | | |
| | | bool deletePPIDForRecipe(int nRecipeNo); |
| | | |
| | | bool deletePPIDForAllRecipes(); |
| | | |
| | | /** |
| | | * åå§å RPTID 表 |
| | | */ |
| | |
| | | |
| | | |
| | | // åå§åç产履å管çå¨ |
| | | try { |
| | | if (!ProductionLogManager::getInstance().initProductionTable()) { |
| | | AfxMessageBox("åå§åç产履å管çå¨å¤±è´¥ï¼"); |
| | | return FALSE; |
| | | } |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("åå§åç产履å管çå¨å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | // åå§åSECSè¿è¡è®¾ç½®ç®¡çåº |
| | | //try { |
| | | // if (!SECSRuntimeManager::getInstance().initRuntimeSetting()) { |
| | | // AfxMessageBox("åå§åSECSè¿è¡è®¾ç½®å¤±è´¥ï¼"); |
| | | // if (!ProductionLogManager::getInstance().initProductionTable()) { |
| | | // AfxMessageBox("åå§åç产履å管çå¨å¤±è´¥ï¼"); |
| | | // return FALSE; |
| | | // } |
| | | //} |
| | | //catch (const std::exception& ex) { |
| | | // CString errorMsg; |
| | | // errorMsg.Format(_T("åå§åSECSè¿è¡è®¾ç½®å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | // errorMsg.Format(_T("åå§åç产履å管çå¨å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | // AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | // return FALSE; |
| | | //} |
| | | |
| | | |
| | | // åå§åSECSè¿è¡è®¾ç½®ç®¡çåº |
| | | try { |
| | | if (!SECSRuntimeManager::getInstance().initRuntimeSetting()) { |
| | | AfxMessageBox("åå§åSECSè¿è¡è®¾ç½®å¤±è´¥ï¼"); |
| | | return FALSE; |
| | | } |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("åå§åSECSè¿è¡è®¾ç½®å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | CServoDlg dlg; |
| | | m_pMainWnd = &dlg; |
| | | INT_PTR nResponse = dlg.DoModal(); |
| | |
| | | <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| | | </ResourceCompile> |
| | | <PostBuildEvent> |
| | | <Command>copy "$(TargetDir)$(ProjectName).exe" "\\DESKTOP-IODBVIQ\Servo\Debug\$(ProjectName).exe"</Command> |
| | | <Command>if exist "\\DESKTOP-IODBVIQ\Servo\Debug\" ( |
| | | xcopy /Y /D "$(OutDir)*.exe" "\\DESKTOP-IODBVIQ\Servo\Debug\" |
| | | xcopy /Y /D "$(OutDir)*.pdb" "\\DESKTOP-IODBVIQ\Servo\Debug\" |
| | | )</Command> |
| | | </PostBuildEvent> |
| | | </ItemDefinitionGroup> |
| | | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
| | |
| | | <Text Include="ReadMe.txt" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClInclude Include="PageRecipe.h" /> |
| | | <ClInclude Include="CDoubleGlass.h" /> |
| | | <ClInclude Include="CProcessData.h" /> |
| | | <ClInclude Include="PageAlarm.h" /> |
| | |
| | | <ClInclude Include="VerticalLine.h" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClCompile Include="PageRecipe.cpp" /> |
| | | <ClCompile Include="CDoubleGlass.cpp" /> |
| | | <ClCompile Include="CProcessData.cpp" /> |
| | | <ClCompile Include="PageAlarm.cpp" /> |
| | |
| | | <ClCompile Include="CArm.cpp" /> |
| | | <ClCompile Include="CArmTray.cpp" /> |
| | | <ClCompile Include="ProductionLogManager.cpp" /> |
| | | <ClCompile Include="PageRecipe.cpp" /> |
| | | <ClCompile Include="CDoubleGlass.cpp" /> |
| | | <ClCompile Include="CProcessData.cpp" /> |
| | | </ItemGroup> |
| | |
| | | <ClInclude Include="CArm.h" /> |
| | | <ClInclude Include="CArmTray.h" /> |
| | | <ClInclude Include="ProductionLogManager.h" /> |
| | | <ClInclude Include="PageRecipe.h" /> |
| | | <ClInclude Include="CDoubleGlass.h" /> |
| | | <ClInclude Include="CProcessData.h" /> |
| | | </ItemGroup> |
| | |
| | | // CServoDlg å¯¹è¯æ¡ |
| | | |
| | | |
| | | |
| | | CServoDlg::CServoDlg(CWnd* pParent /*=NULL*/) |
| | | : CDialogEx(IDD_SERVO_DIALOG, pParent) |
| | | { |
| | |
| | | m_pPageGraph2 = nullptr; |
| | | m_pPageAlarm = nullptr; |
| | | m_pPageLog = nullptr; |
| | | m_pPageRecipe = nullptr; |
| | | } |
| | | |
| | | void CServoDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | DDX_Control(pDX, IDC_BUTTON_LOG, m_btnLog); |
| | | DDX_Control(pDX, IDC_BUTTON_ALARM, m_btnAlarm); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CServoDlg, CDialogEx) |
| | |
| | | m_pPageGraph1->Create(IDD_PAGE_GRAPH1, this); |
| | | m_pPageGraph2 = new CPageGraph2(); |
| | | m_pPageGraph2->Create(IDD_PAGE_GRAPH2, this); |
| | | m_pPageRecipe = new CPageRecipe(); |
| | | m_pPageRecipe->Create(IDD_PAGE_RECIPE, this); |
| | | m_pPageAlarm = new CPageAlarm(); |
| | | m_pPageAlarm->Create(IDD_DIALOG_ALARM, this); |
| | | m_pPageLog = new CPageLog(); |
| | |
| | | m_pTab->SetItemMarginLeft(18); |
| | | m_pTab->AddItem("״̬ͼ", FALSE); |
| | | m_pTab->AddItem("è¿æ¥å¾", TRUE); |
| | | m_pTab->AddItem("é
æ¹", TRUE); |
| | | m_pTab->AddItem("æ¥è¦", TRUE); |
| | | m_pTab->AddItem("æ¥å¿", TRUE); |
| | | m_pTab->SetCurSel(0); |
| | |
| | | m_pPageGraph2 = nullptr; |
| | | } |
| | | |
| | | if (m_pPageRecipe != nullptr) { |
| | | m_pPageRecipe->DestroyWindow(); |
| | | delete m_pPageRecipe; |
| | | m_pPageRecipe = nullptr; |
| | | } |
| | | |
| | | if (m_pPageAlarm != nullptr) { |
| | | m_pPageAlarm->DestroyWindow(); |
| | | delete m_pPageAlarm; |
| | |
| | | if (GetDlgItem(IDC_TAB1) == nullptr) return; |
| | | if (m_pPageGraph1 == nullptr) return; |
| | | if (m_pPageGraph2 == nullptr) return; |
| | | if (m_pPageRecipe == nullptr) return; |
| | | if (m_pPageAlarm == nullptr) return; |
| | | if (m_pPageLog == nullptr) return; |
| | | |
| | |
| | | |
| | | m_pPageGraph1->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageGraph2->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageRecipe->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageAlarm->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageLog->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | } |
| | |
| | | |
| | | void CServoDlg::ShowChildPage(int index) |
| | | { |
| | | ASSERT(0 <= index && index < 4); |
| | | static CWnd* pPages[] = { m_pPageGraph1, m_pPageGraph2, m_pPageAlarm, m_pPageLog }; |
| | | for (int i = 0; i < 4; i++) { |
| | | ASSERT(0 <= index && index < 5); |
| | | static CWnd* pPages[] = { m_pPageGraph1, m_pPageGraph2, m_pPageRecipe, m_pPageAlarm, m_pPageLog }; |
| | | for (int i = 0; i < 5; i++) { |
| | | pPages[i]->ShowWindow(i == index ? SW_SHOW : SW_HIDE); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | #include "BlButton.h" |
| | | #include "PageLog.h" |
| | | #include "PageAlarm.h" |
| | | #include "PageRecipe.h" |
| | | #include "TerminalDisplayDlg.h" |
| | | #include "CPanelMaster.h" |
| | | #include "CPanelEquipment.h" |
| | |
| | | CTerminalDisplayDlg* m_pTerminalDisplayDlg; |
| | | CPageGraph1* m_pPageGraph1; |
| | | CPageGraph2* m_pPageGraph2; |
| | | CPageRecipe* m_pPageRecipe; |
| | | CPageAlarm* m_pPageAlarm; |
| | | CPageLog* m_pPageLog; |
| | | |
| | |
| | | HICON m_hIcon; |
| | | COLORREF m_crBkgnd; |
| | | HBRUSH m_hbrBkgnd; |
| | | CBlButton m_btnLog; |
| | | CBlButton m_btnAlarm; |
| | | CPanelMaster* m_pPanelMaster; |
| | | CPanelEquipment* m_pPanelEquipment; |
| | | CPanelAttributes* m_pPanelAttributes; |