| | |
| | | // 遍历数据并插入到CListCtrl中 |
| | | for (int i = 0; i < static_cast<int>(vecRecipe.size()); ++i) { |
| | | const RecipeInfo& recipe = vecRecipe[i]; |
| | | if (recipe.vecDeviceList.empty() || recipe.vecDeviceList.size() > 6){ |
| | | continue; |
| | | } |
| | | |
| | | m_listPPID.InsertItem(i, _T("")); // 第0列空白 |
| | | |
| | | CString strNo; |
| | | strNo.Format(_T("%d"), i + 1); |
| | | m_listPPID.SetItemText(i, 1, strNo); |
| | | |
| | | m_listPPID.SetItemText(i, 2, CA2T(recipe.strPPID.c_str())); |
| | | m_listPPID.SetItemText(i, 3, CA2T(recipe.strDescription.c_str())); |
| | | m_listPPID.SetItemText(i, 4, CA2T(recipe.strCreateTime.c_str())); |
| | | |
| | | for (int j = 0; j < recipe.vecDeviceList.size(); j++){ |
| | | CString str; |
| | | str.Format(_T("%d"), recipe.vecDeviceList.at(j).nRecipeID); |
| | | m_listPPID.SetItemText(i, j + 3, str); |
| | | } |
| | | |
| | | m_listPPID.SetItemText(i, 9, CA2T(recipe.strCreateTime.c_str())); |
| | | m_listPPID.SetItemText(i, 10, CA2T(recipe.strDescription.c_str())); |
| | | } |
| | | |
| | | // 获取列数 |
| | |
| | | // 读出列宽 |
| | | CString strIniFile, strItem; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir); |
| | | int width[8] = { 0, 80, 180, 80, 80, 100, 80, 180 }; |
| | | for (int i = 0; i < 8; i++) { |
| | | int width[12] = { 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 180 }; |
| | | for (int i = 0; i < 12; i++) { |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | width[i] = GetPrivateProfileInt("PageRecipeListCtrl", strItem, width[i], strIniFile); |
| | | } |
| | | |
| | | |
| | | // TODO: 在此添加额外的初始化 |
| | | CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST_PPID); |
| | |
| | | pListCtrl->InsertColumn(0, _T(""), LVCFMT_RIGHT, 0); // 隐藏列 |
| | | pListCtrl->InsertColumn(1, _T("No."), LVCFMT_LEFT, width[1]); |
| | | pListCtrl->InsertColumn(2, _T("PPID/Recipe ID"), LVCFMT_LEFT, width[2]); |
| | | pListCtrl->InsertColumn(3, _T("描述"), LVCFMT_LEFT, width[3]); |
| | | pListCtrl->InsertColumn(4, _T("创建时间"), LVCFMT_LEFT, width[4]); |
| | | pListCtrl->SetColumnWidth(4, LVSCW_AUTOSIZE_USEHEADER); |
| | | |
| | | pListCtrl->InsertColumn(3, _T("EFEM"), LVCFMT_LEFT, width[3]); |
| | | pListCtrl->InsertColumn(4, _T("Bonder1"), LVCFMT_LEFT, width[4]); |
| | | pListCtrl->InsertColumn(5, _T("Bonder2"), LVCFMT_LEFT, width[5]); |
| | | pListCtrl->InsertColumn(6, _T("真空烘烤"), LVCFMT_LEFT, width[6]); |
| | | pListCtrl->InsertColumn(7, _T("后烘冷却"), LVCFMT_LEFT, width[7]); |
| | | pListCtrl->InsertColumn(8, _T("精度检查"), LVCFMT_LEFT, width[8]); |
| | | pListCtrl->InsertColumn(9, _T("创建时间"), LVCFMT_LEFT, width[9]); |
| | | pListCtrl->InsertColumn(10, _T("描述"), LVCFMT_LEFT, width[10]); |
| | | pListCtrl->SetColumnWidth(10, LVSCW_AUTOSIZE_USEHEADER); |
| | | |
| | | // 获取所有数据 |
| | | auto vecData = RecipeManager::getInstance().getAllRecipes(); |