| | |
| | | SourceCode/Bond/x64/Debug/Master.dat |
| | | SourceCode/Bond/x64/Debug/Config/signals.csv |
| | | SourceCode/Bond/x64/Debug/Config/robot_offset.ini |
| | | *.tlog |
| | | *.pch |
| | | SourceCode/Bond/EAPSimulator/x64/Debug/ |
| | |
| | | return pBuddy != nullptr; |
| | | } |
| | | |
| | | BOOL CBonder::hasG2Class() |
| | | { |
| | | CGlass* pGlass = (CGlass*)m_slot[0].getContext(); |
| | | return (pGlass != nullptr); |
| | | } |
| | | |
| | | int CBonder::onProcessData(CProcessData* pProcessData) |
| | | { |
| | | CEquipment::onProcessData(pProcessData); |
| | |
| | | void setIndex(unsigned int index); |
| | | unsigned int getIndex(); |
| | | BOOL hasBondClass(); |
| | | BOOL hasG2Class(); |
| | | |
| | | private: |
| | | unsigned int m_nIndex; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CCustomCheckBox.h" |
| | | |
| | | |
| | | CCustomCheckBox::CCustomCheckBox() |
| | | : m_bgColor(RGB(255, 255, 255)), m_textColor(RGB(0, 0, 0)) |
| | | { |
| | | m_brush.CreateSolidBrush(m_bgColor); |
| | | } |
| | | |
| | | CCustomCheckBox::~CCustomCheckBox() |
| | | { |
| | | |
| | | } |
| | | |
| | | void CCustomCheckBox::SetBackgroundColor(COLORREF color) |
| | | { |
| | | m_bgColor = color; |
| | | if (m_brush.GetSafeHandle()) |
| | | m_brush.DeleteObject(); |
| | | m_brush.CreateSolidBrush(m_bgColor); |
| | | Invalidate(); |
| | | } |
| | | |
| | | void CCustomCheckBox::SetTextColor(COLORREF color) |
| | | { |
| | | m_textColor = color; |
| | | Invalidate(); |
| | | } |
| | | |
| | | void CCustomCheckBox::SetNotifyHwnd(HWND hWnd) |
| | | { |
| | | m_hNotifyWnd = hWnd; |
| | | } |
| | | |
| | | void CCustomCheckBox::OnClicked() |
| | | { |
| | | BOOL bChecked = (GetCheck() == BST_CHECKED); |
| | | |
| | | // ä½ å¯ä»¥å®ä¹èªå·±çèªå®ä¹æ¶æ¯ |
| | | if (m_hNotifyWnd && ::IsWindow(m_hNotifyWnd)) { |
| | | ::PostMessage(m_hNotifyWnd, WM_CHECKBOX_STATE_CHANGED, GetDlgCtrlID(), bChecked); |
| | | } |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CCustomCheckBox, CButton) |
| | | ON_WM_CTLCOLOR_REFLECT() |
| | | ON_CONTROL_REFLECT(BN_CLICKED, &CCustomCheckBox::OnClicked) |
| | | END_MESSAGE_MAP() |
| | | |
| | | HBRUSH CCustomCheckBox::CtlColor(CDC* pDC, UINT /*nCtlColor*/) |
| | | { |
| | | pDC->SetBkMode(TRANSPARENT); |
| | | pDC->SetTextColor(m_textColor); |
| | | return (HBRUSH)m_brush.GetSafeHandle(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | |
| | | |
| | | #define WM_CHECKBOX_STATE_CHANGED WM_USER + 1003 |
| | | |
| | | class CCustomCheckBox : public CButton |
| | | { |
| | | public: |
| | | CCustomCheckBox(); |
| | | virtual ~CCustomCheckBox(); |
| | | |
| | | public: |
| | | void SetBackgroundColor(COLORREF color); |
| | | void SetTextColor(COLORREF color); |
| | | void SetNotifyHwnd(HWND hWnd); // è®¾ç½®æ¶æ¯æ¥æ¶çªå£ |
| | | |
| | | protected: |
| | | afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); |
| | | afx_msg void OnClicked(); |
| | | DECLARE_MESSAGE_MAP() |
| | | |
| | | private: |
| | | COLORREF m_bgColor; |
| | | COLORREF m_textColor; |
| | | CBrush m_brush; |
| | | HWND m_hNotifyWnd; |
| | | }; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | { |
| | | // master recipe list report |
| | | CEqReadStep* pStep = new CEqReadStep(0x6955, 255 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | /*CEqReadStep* pTmpStep = dynamic_cast<CEqReadStep*>((CEqReadStep*)pFrom);*/ |
| | | CEqReadStep* pTmpStep = (CEqReadStep*)pFrom; |
| | | short ret = MRLRC_OK; |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | ret = decodeRecipeListReport(pszData, size); |
| | | } |
| | | pTmpStep->setReturnCode(ret); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_MASTER_RECIPE_LIST); |
| | | pStep->setWriteSignalDev(0x4b); |
| | | pStep->setReturnDev(0x91d); |
| | | if (addStep(STEP_ID_MASTER_RECIPE_LIST_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨CEqReadStepæ¿æ¢CEqJobEventStep |
| | | { |
| | | // Received Job Report Upstream #1~9 |
| | |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | | if (!isSlotProcessed(i)) continue; |
| | | if (pGlass == nullptr) continue; |
| | | if (!pGlass->isScheduledForProcessing()) continue; |
| | | if(pGlass->getInspResult(m_nID, 0) == InspResult::Fail) continue; |
| | | int lsPath = m_slot[i].getLinkSignalPath(); |
| | | if(!m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_INLINE] |
| | |
| | | if (m_slot[i].isLock()) continue; |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | | if (pGlass == nullptr) continue; |
| | | if (!pGlass->isScheduledForProcessing()) continue; |
| | | if (pGlass->getInspResult(m_nID, 0) != InspResult::Fail) continue; |
| | | int lsPath = m_slot[i].getLinkSignalPath(); |
| | | if (!m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_INLINE] |
| | |
| | | typedef std::function<BOOL(void* pEiuipment, int port, CJobDataB* pJobDataB, short& putSlot)> ONPRESTOREDJOB; |
| | | typedef std::function<void(void* pEiuipment, PROCESS_STATE state)> ONPROCESSSTATE; |
| | | typedef std::function<void(void* pEiuipment, short scanMap, short downMap)> ONMAPMISMATCH; |
| | | typedef std::function<void(void* pEiuipment, short scanMap)> ONPORTINUSE; |
| | | typedef struct _EquipmentListener |
| | | { |
| | | ONALIVE onAlive; |
| | |
| | | ONPRESTOREDJOB onPreStoredJob; |
| | | ONPROCESSSTATE onProcessStateChanged; |
| | | ONMAPMISMATCH onMapMismatch; |
| | | ONPORTINUSE onPortInUse; |
| | | |
| | | } EquipmentListener; |
| | | |
| | | |
| | |
| | | m_pBuddy = nullptr; |
| | | m_nOriginPort = 0; |
| | | m_nOriginSlot = 0; |
| | | m_bScheduledForProcessing = FALSE; |
| | | } |
| | | |
| | | CGlass::~CGlass() |
| | |
| | | slot = m_nOriginSlot; |
| | | } |
| | | |
| | | BOOL CGlass::isScheduledForProcessing() |
| | | { |
| | | return m_bScheduledForProcessing; |
| | | } |
| | | |
| | | void CGlass::setScheduledForProcessing(BOOL bProcessing) |
| | | { |
| | | m_bScheduledForProcessing = bProcessing; |
| | | } |
| | | |
| | | CPath* CGlass::getPath() |
| | | { |
| | | return m_pPath; |
| | |
| | | WriteString(ar, m_strID); |
| | | ar << m_nOriginPort; |
| | | ar << m_nOriginSlot; |
| | | ar << m_bScheduledForProcessing; |
| | | ar << (ULONGLONG)m_pPath; |
| | | if (m_pPath != nullptr) { |
| | | m_pPath->serialize(ar); |
| | |
| | | ReadString(ar, m_strID); |
| | | ar >> m_nOriginPort; |
| | | ar >> m_nOriginSlot; |
| | | ar >> m_bScheduledForProcessing; |
| | | ar >> ullPath; |
| | | if (ullPath != 0) { |
| | | m_pPath = new CPath(); |
| | |
| | | std::string& getID(); |
| | | void setOriginPort(int port, int slot); |
| | | void getOrginPort(int& port, int& slot); |
| | | BOOL isScheduledForProcessing(); |
| | | void setScheduledForProcessing(BOOL bProcessing); |
| | | CPath* getPathWithEq(unsigned int nEqId, unsigned int nUnit); |
| | | CPath* getPath(); |
| | | void addPath(unsigned int nEqId, unsigned int nUnit); |
| | |
| | | std::string m_strBuddyId; |
| | | int m_nOriginPort; |
| | | int m_nOriginSlot; |
| | | BOOL m_bScheduledForProcessing; /* æ¯å¦å°å å·¥å¤ç */ |
| | | }; |
| | | } |
| | | |
| | |
| | | m_nProcessResonCode = 0; |
| | | m_nLastGlassFlag = 0; |
| | | m_nFirstGlassFlag = 0; |
| | | m_nQTime[3] = {0}; |
| | | m_nQTime[3] = { 0 }; |
| | | m_nQTimeOverFlag = 0; |
| | | m_nMasterRecipe = 0; |
| | | m_nRecipeIds[DEVICE_COUNT] = { 0 }; |
| | | m_nMode = 0; |
| | | m_nSlotUnitSelectFlag = 0; |
| | | m_nSourcePortNo = 0; |
| | | m_nSourceSlotNo = 0; |
| | | m_nTargetPortNo = 0; |
| | | m_nTargetSlotNo = 0; |
| | | m_nProductJudge = 0; |
| | | m_pRawData = nullptr; |
| | | m_pOwner = nullptr; |
| | | if (ENABLE_JOBDATAS_RAWDATA) { |
| | |
| | | m_nQTime[2] = pScr->m_nQTime[2]; |
| | | m_nQTimeOverFlag = pScr->m_nQTimeOverFlag; |
| | | m_nMasterRecipe = pScr->m_nMasterRecipe; |
| | | m_strProductRecipeId = pScr->m_strProductRecipeId; |
| | | m_strPCode = pScr->m_strPCode; |
| | | m_strUseType = pScr->m_strUseType; |
| | | memcpy(m_nRecipeIds, pScr->m_nRecipeIds, sizeof(m_nRecipeIds)); |
| | | m_strPanelMeasure = pScr->m_strPanelMeasure; |
| | | m_nMode = pScr->m_nMode; |
| | | m_nSlotUnitSelectFlag = pScr->m_nSlotUnitSelectFlag; |
| | |
| | | m_nSourceSlotNo = pScr->m_nSourceSlotNo; |
| | | m_nTargetPortNo = pScr->m_nTargetPortNo; |
| | | m_nTargetSlotNo = pScr->m_nTargetSlotNo; |
| | | m_nProductJudge = pScr->m_nProductJudge; |
| | | m_pOwner = pScr->m_pOwner; |
| | | } |
| | | |
| | |
| | | m_nQTime[2] = pScr->m_nQTime[2]; |
| | | m_nQTimeOverFlag = pScr->m_nQTimeOverFlag; |
| | | m_nMasterRecipe = pScr->m_nMasterRecipe; |
| | | m_strProductRecipeId = pScr->m_strProductRecipeId; |
| | | m_strPCode = pScr->m_strPCode; |
| | | m_strUseType = pScr->m_strUseType; |
| | | memcpy(m_nRecipeIds, pScr->m_nRecipeIds, sizeof(m_nRecipeIds)); |
| | | m_strPanelMeasure = pScr->m_strPanelMeasure; |
| | | m_nMode = pScr->m_nMode; |
| | | m_nSlotUnitSelectFlag = pScr->m_nSlotUnitSelectFlag; |
| | |
| | | m_nSourceSlotNo = pScr->m_nSourceSlotNo; |
| | | m_nTargetPortNo = pScr->m_nTargetPortNo; |
| | | m_nTargetSlotNo = pScr->m_nTargetSlotNo; |
| | | m_nProductJudge = pScr->m_nProductJudge; |
| | | m_pOwner = pScr->m_pOwner; |
| | | } |
| | | |
| | |
| | | m_nMasterRecipe = recipe; |
| | | } |
| | | |
| | | std::string& CJobDataS::getProductRecipeId() |
| | | short CJobDataS::getDeviceRecipeId(int nDeviceIndex) const |
| | | { |
| | | return m_strProductRecipeId; |
| | | if (nDeviceIndex < 0 || nDeviceIndex >= DEVICE_COUNT) { |
| | | return 0; |
| | | } |
| | | |
| | | return m_nRecipeIds[nDeviceIndex]; |
| | | } |
| | | |
| | | void CJobDataS::setProductRecipeId(const char* pszId) |
| | | void CJobDataS::setDeviceRecipeId(int nDeviceIndex, short nRecipeId) |
| | | { |
| | | m_strProductRecipeId = pszId; |
| | | if (nDeviceIndex < 0 || nDeviceIndex >= DEVICE_COUNT) { |
| | | return; |
| | | } |
| | | |
| | | m_nRecipeIds[nDeviceIndex] = nRecipeId; |
| | | } |
| | | |
| | | std::string& CJobDataS::getPCode() |
| | | { |
| | | return m_strPCode; |
| | | const short* CJobDataS::getRecipeIds() const |
| | | { |
| | | return m_nRecipeIds; |
| | | } |
| | | |
| | | void CJobDataS::setPCode(const char* pszCode) |
| | | void CJobDataS::setRecipeIds(const short* pIds, int nCount) |
| | | { |
| | | m_strPCode = pszCode; |
| | | } |
| | | int nCopyCount = nCount > DEVICE_COUNT ? DEVICE_COUNT : nCount; |
| | | for (int i = 0; i < nCopyCount; ++i) { |
| | | m_nRecipeIds[i] = pIds[i]; |
| | | } |
| | | |
| | | std::string& CJobDataS::getUseType() |
| | | { |
| | | return m_strPCode; |
| | | } |
| | | |
| | | void CJobDataS::setUseType(const char* pszType) |
| | | { |
| | | m_strPCode = pszType; |
| | | // 妿 nCount < DEVICE_COUNTï¼å¯ä»¥éæ©è¡¥é¶ |
| | | for (int i = nCopyCount; i < DEVICE_COUNT; ++i) { |
| | | m_nRecipeIds[i] = 0; |
| | | } |
| | | } |
| | | |
| | | std::string& CJobDataS::getPanelMeasure() |
| | |
| | | void CJobDataS::setTargetSlotNo(int no) |
| | | { |
| | | m_nTargetSlotNo = no; |
| | | } |
| | | |
| | | short CJobDataS::getProductJudge() const |
| | | { |
| | | return m_nProductJudge; |
| | | } |
| | | |
| | | void CJobDataS::setProductJudge(short nProductJudge) |
| | | { |
| | | m_nProductJudge = nProductJudge; |
| | | } |
| | | |
| | | int CJobDataS::serialize(char* pszBuffer, int nBufferSize) |
| | |
| | | memcpy(&pszBuffer[index], &m_nMasterRecipe, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | strLen = min(10, (int)m_strProductRecipeId.size()); |
| | | memcpy(&pszBuffer[index], m_strProductRecipeId.c_str(), strLen); |
| | | index += 10; |
| | | |
| | | strLen = min(10, (int)m_strPCode.size()); |
| | | memcpy(&pszBuffer[index], m_strPCode.c_str(), strLen); |
| | | index += 10; |
| | | |
| | | strLen = min(10, (int)m_strUseType.size()); |
| | | memcpy(&pszBuffer[index], m_strUseType.c_str(), strLen); |
| | | index += 10; |
| | | for (int i = 0; i < DEVICE_COUNT; i++) { |
| | | memcpy(&pszBuffer[index], &m_nRecipeIds[i], sizeof(short)); |
| | | index += sizeof(short); |
| | | } |
| | | |
| | | strLen = min(80, (int)m_strPanelMeasure.size()); |
| | | memcpy(&pszBuffer[index], m_strPanelMeasure.c_str(), strLen); |
| | |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nTargetSlotNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nProductJudge, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | return 256 * 2; |
| | |
| | | memcpy(&m_nMasterRecipe, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId); |
| | | index += 10; |
| | | for (int i = 0; i < DEVICE_COUNT; i++) { |
| | | memcpy(&m_nRecipeIds[i], &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | } |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId); |
| | | index += 10; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId); |
| | | index += 10; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 80, m_strProductRecipeId); |
| | | CToolUnits::convertString(&pszBuffer[index], 80, m_strPanelMeasure); |
| | | index += 80; |
| | | |
| | | memcpy(&m_nMode, &pszBuffer[index], sizeof(short)); |
| | |
| | | memcpy(&m_nTargetSlotNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nProductJudge, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | // ç¼ååå§æ°æ® |
| | | if (m_pRawData != nullptr) { |
| | | memcpy(m_pRawData, pszBuffer, JOBDATAS_SIZE); |
| | | } |
| | | |
| | | |
| | | return JOBDATAS_SIZE; |
| | | } |
| | |
| | | attrubutes.addAttribute(new CAttribute("MasterRecipe", |
| | | std::to_string(getMasterRecipe()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProductRecipeId", |
| | | getProductRecipeId().c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Recipe ID(EFEM)", |
| | | std::to_string(getDeviceRecipeId(0)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("PCode", |
| | | getPCode().c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Recipe ID(BONDER1)", |
| | | std::to_string(getDeviceRecipeId(1)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("UseType", |
| | | getUseType().c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Recipe ID(BONDER2)", |
| | | std::to_string(getDeviceRecipeId(2)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("Recipe ID(Bake Cooling)", |
| | | std::to_string(getDeviceRecipeId(3)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("Recipe ID(Vacuum Bake)", |
| | | std::to_string(getDeviceRecipeId(4)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("Recipe ID(Measurement)", |
| | | std::to_string(getDeviceRecipeId(5)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("PanelMeasure", |
| | | getPanelMeasure().c_str(), "", weight++)); |
| | |
| | | |
| | | attrubutes.addAttribute(new CAttribute("TargetSlotNo", |
| | | std::to_string(getTargetSlotNo()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProductJudge", |
| | | std::to_string(getProductJudge()).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | #include "CAttributeVector.h" |
| | | #include "CJobDataB.h" |
| | | |
| | | |
| | | #define DEVICE_COUNT 15 |
| | | #define JOBDATAS_SIZE (256 * 2) |
| | | namespace SERVO { |
| | | class CJobDataS |
| | |
| | | void setQTimeOverFlag(int flag); |
| | | int getMasterRecipe(); |
| | | void setMasterRecipe(int recipe); |
| | | std::string& getProductRecipeId(); |
| | | void setProductRecipeId(const char* pszId); |
| | | std::string& getPCode(); |
| | | void setPCode(const char* pszCode); |
| | | std::string& getUseType(); |
| | | void setUseType(const char* pszType); |
| | | short getDeviceRecipeId(int nDeviceIndex) const; |
| | | void setDeviceRecipeId(int nDeviceIndex, short nRecipeId); |
| | | const short* getRecipeIds() const; |
| | | void setRecipeIds(const short* pIds, int nCount); |
| | | std::string& getPanelMeasure(); |
| | | void setPanelMeasure(const char* pszMeasure); |
| | | int getMode(); |
| | |
| | | void setTargetPortNo(int no); |
| | | int getTargetSlotNo(); |
| | | void setTargetSlotNo(int no); |
| | | short getProductJudge() const; |
| | | void setProductJudge(short nProductJudge); |
| | | int serialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(const char* pszBuffer, int nBufferSize); |
| | | void getAttributeVector(CAttributeVector& attrubutes, int beginWeight); |
| | |
| | | int m_nQTime[3]; |
| | | int m_nQTimeOverFlag; |
| | | int m_nMasterRecipe; |
| | | std::string m_strProductRecipeId; |
| | | std::string m_strPCode; |
| | | std::string m_strUseType; |
| | | short m_nRecipeIds[DEVICE_COUNT]; |
| | | std::string m_strPanelMeasure; |
| | | int m_nMode; |
| | | int m_nSlotUnitSelectFlag; |
| | |
| | | int m_nSourceSlotNo; |
| | | int m_nTargetPortNo; |
| | | int m_nTargetSlotNo; |
| | | short m_nProductJudge; |
| | | |
| | | private: |
| | | char* m_pRawData; |
| | |
| | | m_bEnable = FALSE; |
| | | m_bAutoChangeEnable = FALSE; |
| | | m_nNextCassetteSequenceNo = 0; |
| | | m_isCompareMapsBeforeProceeding = FALSE; |
| | | } |
| | | |
| | | CLoadPort::~CLoadPort() |
| | |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_cassetteType = (CassetteType)CToolUnits::toInt16(pszData); |
| | | //m_cassetteType = (CassetteType)CToolUnits::toInt16(pszData); |
| | | } |
| | | return 0; |
| | | }); |
| | |
| | | void CLoadPort::onTimer(UINT nTimerid) |
| | | { |
| | | CEquipment::onTimer(nTimerid); |
| | | |
| | | // æ¨¡ææµè¯ |
| | | /* |
| | | if (m_nIndex == 0) { |
| | | static int ii = 0; |
| | | ii++; |
| | | if (ii == 20) { |
| | | char szBuffer[64]; |
| | | CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE); |
| | | CPortStatusReport portStatusReport; |
| | | portStatusReport.setPortStatus(PORT_INUSE); |
| | | portStatusReport.setJobExistenceSlot(0xf); |
| | | int nRet = portStatusReport.serialize(szBuffer, 64); |
| | | decodePortStatusReport(pStep, szBuffer, 64); |
| | | } |
| | | } |
| | | */ |
| | | } |
| | | |
| | | void CLoadPort::serialize(CArchive& ar) |
| | |
| | | |
| | | // å½portç¶æä¸ºInUse, æ¯è¾map |
| | | if (m_portStatusReport.getPortStatus() == PORT_INUSE) { |
| | | short scanMap = m_portStatusReport.getJobExistenceSlot(); |
| | | short downMap = getCassetteMap(); |
| | | if (scanMap == downMap) { |
| | | this->sendCassetteCtrlCmd(5, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | if (m_isCompareMapsBeforeProceeding) { |
| | | short scanMap = getScanCassetteMap(); |
| | | short downloadMap = getDownloadCassetteMap(); |
| | | if (scanMap == downloadMap) { |
| | | generateGlassList(scanMap); |
| | | this->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | } |
| | | else { |
| | | this->sendCassetteCtrlCmd(CCC_PROCESS_CANCEL, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | |
| | | // æåºå°åºç¨å±åæç¤º |
| | | if (m_listener.onMapMismatch != nullptr) { |
| | | m_listener.onMapMismatch(this, scanMap, downloadMap); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | this->sendCassetteCtrlCmd(10, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | |
| | | // æåºå°åºç¨å±åæç¤º |
| | | if (m_listener.onMapMismatch != nullptr) { |
| | | m_listener.onMapMismatch(this, scanMap, downMap); |
| | | // æåºå°åºç¨å±åéæ©è¦å å·¥ççå |
| | | generateGlassList(getScanCassetteMap()); |
| | | if (m_listener.onPortInUse != nullptr) { |
| | | m_listener.onPortInUse(this, getScanCassetteMap()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | int CLoadPort::setCassetteType(CassetteType type, ONWRITED onWritedBlock/* = nullptr*/) |
| | | { |
| | | m_cassetteType = type; |
| | | static char* pszName[] = { STEP_PORT1_CASSETTE_TYPE_CHANGE, STEP_PORT2_CASSETTE_TYPE_CHANGE, STEP_PORT3_CASSETTE_TYPE_CHANGE, STEP_PORT4_CASSETTE_TYPE_CHANGE }; |
| | | SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]); |
| | | if (pStep == nullptr) { |
| | |
| | | // test |
| | | code = WOK; |
| | | if (code == WOK) { |
| | | m_cassetteType = type; |
| | | LOGI("<CLoadPort-%d>设置Cassette Typeæå.", m_nIndex); |
| | | } |
| | | else { |
| | |
| | | m_bAutoChangeEnable = bEnable; |
| | | } |
| | | |
| | | short CLoadPort::getCassetteMap() |
| | | short CLoadPort::getScanCassetteMap() |
| | | { |
| | | short map = 0; |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | if (!m_slot[i].isEnable()) continue; |
| | | if (m_slot[i].getContext() == nullptr) continue; |
| | | map |= (1 << i); |
| | | } |
| | | return m_portStatusReport.getJobExistenceSlot(); |
| | | } |
| | | |
| | | short CLoadPort::getDownloadCassetteMap() |
| | | { |
| | | // ææ¶æªå®ç°æ¤åè½ |
| | | short map = 0; |
| | | return map; |
| | | } |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | /* |
| | | * æ ¹æ®efemæ«æå°çmapï¼çæç»çå表 |
| | | */ |
| | | int CLoadPort::generateGlassList(short map) |
| | | { |
| | | // å
éæ¾è¾æ©åçæ°æ® |
| | | Lock(); |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | m_slot[i].setContext(nullptr); |
| | | } |
| | | Unlock(); |
| | | |
| | | |
| | | // æ ¹æ®mapçææ°ç |
| | | char szBuffer[64]; |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | if (!m_slot[i].isEnable()) continue; |
| | | if (!(map >> i) & 1) continue; |
| | | |
| | | CJobDataS js; |
| | | js.setCassetteSequenceNo(getNextCassetteSequenceNo()); |
| | | js.setJobSequenceNo(m_slot[i].getNo()); |
| | | sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo()); |
| | | js.setJobType(1); |
| | | js.setMaterialsType((int)m_cassetteType); |
| | | |
| | | CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pGlass->setOriginPort(m_nIndex, i); |
| | | pGlass->setScheduledForProcessing(i % 2 == 1); |
| | | pGlass->addPath(m_nID, 0); |
| | | pGlass->processEnd(m_nID, 0); |
| | | pGlass->setID(szBuffer); |
| | | pGlass->setType(m_cassetteType); |
| | | pGlass->setJobDataS(&js); |
| | | m_slot[i].setContext(pGlass); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | int CLoadPort::testGenerateGlassListFromConfig(const SERVO::PortConfig& config) |
| | | { |
| | | char szBuffer[64]; |
| | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | void CLoadPort::setCompareMapsBeforeProceeding(BOOL bCompare) |
| | | { |
| | | m_isCompareMapsBeforeProceeding = bCompare; |
| | | } |
| | | } |
| | |
| | | void localSetCessetteType(CassetteType type); |
| | | void localSetTransferMode(TransferMode mode); |
| | | void localAutoChangeEnable(BOOL bEnable); |
| | | short getCassetteMap(); |
| | | short getScanCassetteMap(); |
| | | short getDownloadCassetteMap(); |
| | | |
| | | public: |
| | | short getNextCassetteSequenceNo(); |
| | |
| | | int getCassetteMappingState(); |
| | | int getCassetteStatus(); |
| | | int testGenerateGlassList(MaterialsType type); |
| | | int generateGlassList(short map); |
| | | int testGenerateGlassListFromConfig(const SERVO::PortConfig& config); |
| | | |
| | | public: |
| | |
| | | CJobDataA* pJobDataA, |
| | | ONWRITED onWritedBlock); |
| | | CStep* getCassetteCtrlCmdStep(); |
| | | void setCompareMapsBeforeProceeding(BOOL bCompare); |
| | | |
| | | private: |
| | | int decodePortStatusReport(CStep* pStep, const char* pszData, size_t size); |
| | |
| | | BOOL m_bAutoChangeEnable; |
| | | CPortStatusReport m_portStatusReport; |
| | | int m_nNextCassetteSequenceNo; |
| | | |
| | | // å¨å¼å§å·¥èºåæ¯å¦å
éè¦å
æ¯è¾map |
| | | BOOL m_isCompareMapsBeforeProceeding; |
| | | }; |
| | | } |
| | | |
| | |
| | | m_state = MASTERSTATE::READY; |
| | | m_pActiveRobotTask = nullptr; |
| | | m_nLastError = 0; |
| | | m_isCompareMapsBeforeProceeding = FALSE; |
| | | InitializeCriticalSection(&m_criticalSection); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | PORT_PUT: |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | |
| | | |
| | | // Measurement NG -> LoadPort |
| | | // NGååä½ |
| | | if (!rmd.armState[1]) { |
| | | m_pActiveRobotTask = createTransferTask_restore(pMeasurement, pLoadPorts); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建Measurementåéä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // BakeCooling ->Measurement |
| | | if (!rmd.armState[0]) { |
| | | m_pActiveRobotTask = createTransferTask_bakecooling_to_measurement(pBakeCooling, pMeasurement); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | |
| | | // BakeCoolingå
é¨ |
| | | // Bake -> Cooling |
| | | if (!rmd.armState[0]) { |
| | | m_pActiveRobotTask = createTransferTask_bake_to_cooling(pBakeCooling); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | // Bonder -> BakeCooling |
| | | if (!rmd.armState[0]) { |
| | | m_pActiveRobotTask = createTransferTask_bonder_to_bakecooling(pBonder1, pBakeCooling); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | if (!rmd.armState[0]) { |
| | | m_pActiveRobotTask = createTransferTask_bonder_to_bakecooling(pBonder2, pBakeCooling); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | // Fliper(G2) -> Bonder |
| | | // VacuumBake(G1) -> Bonder |
| | | if (!rmd.armState[1] && !pBonder1->hasBondClass()) { |
| | | auto pSrcSlot = pVacuumBake->getProcessedSlot(primaryType); |
| | | if (pSrcSlot != nullptr && !rmd.armState[1] && !pBonder1->hasBondClass()) { |
| | | m_pActiveRobotTask = createTransferTask(pFliper, pBonder1, primaryType, secondaryType, 2); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | if (!rmd.armState[1] && !pBonder2->hasBondClass()) { |
| | | if (pSrcSlot != nullptr && !rmd.armState[1] && !pBonder2->hasBondClass()) { |
| | | m_pActiveRobotTask = createTransferTask(pFliper, pBonder2, primaryType, secondaryType, 2); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | // VacuumBake(G1) -> Bonder |
| | | if (!rmd.armState[0] && !pBonder1->hasBondClass()) { |
| | | m_pActiveRobotTask = createTransferTask(pVacuumBake, pBonder1, primaryType, secondaryType); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | if (!rmd.armState[0] && !pBonder2->hasBondClass()) { |
| | | m_pActiveRobotTask = createTransferTask(pVacuumBake, pBonder2, primaryType, secondaryType); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | |
| | | // Aligner -> VacuumBake(G1) |
| | | if (!rmd.armState[1]) { |
| | | m_pActiveRobotTask = createTransferTask(pAligner, pFliper, primaryType, secondaryType); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | if (!rmd.armState[0]) { |
| | | m_pActiveRobotTask = createTransferTask(pAligner, pVacuumBake, primaryType, secondaryType); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | // Aligner -> LoadPort |
| | | if (!rmd.armState[1]) { |
| | | m_pActiveRobotTask = createTransferTask_restore(pAligner, pLoadPorts); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建Aligneråéä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // LoadPort -> Aligner |
| | |
| | | } |
| | | |
| | | PORT_GET: |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->pick(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | | unlock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE); |
| | | } |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); |
| | | continue; |
| | | } |
| | | CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask); |
| | | |
| | | |
| | | unlock(); |
| | | |
| | | continue; |
| | | } |
| | | unlock(); |
| | | } |
| | |
| | | LOGE("<Master-%s>Port InUse, map(%d!=%d)ä¸ä¸è´ï¼è¯·æ£æ¥ã", |
| | | ((CEquipment*)pEquipment)->getName().c_str(), scanMap, downMap); |
| | | }; |
| | | listener.onPortInUse = [&](void* pEquipment, short scanMap) { |
| | | LOGE("<Master-%s>Port InUseãscanMap=%d", ((CEquipment*)pEquipment)->getName().c_str(), scanMap); |
| | | if (m_listener.onLoadPortInUse != nullptr) { |
| | | m_listener.onLoadPortInUse(this, (CEquipment*)pEquipment, scanMap); |
| | | } |
| | | }; |
| | | pEquipment->setListener(listener); |
| | | pEquipment->setCcLink(&m_cclink); |
| | | m_listEquipment.push_back(pEquipment); |
| | |
| | | pEquipment->setID(EQ_ID_LOADPORT1 + index); |
| | | pEquipment->setName(szName); |
| | | pEquipment->setDescription(szName); |
| | | pEquipment->setCompareMapsBeforeProceeding(m_isCompareMapsBeforeProceeding); |
| | | addToEquipmentList(pEquipment); |
| | | |
| | | |
| | |
| | | unlock(); |
| | | |
| | | // å½å任塿å¨ä¸æ¢åï¼åæ¢è°åº¦ï¼éè¦æä½åå¨è§£å³é®é¢åï¼éæ°å¯å¨ |
| | | stop(); |
| | | // 25å¹´7æ23æ¥åä¿®æ¹ä¸ºä¸åæ¢ä»»å¡ |
| | | // stop(); |
| | | |
| | | return 0; |
| | | } |
| | |
| | | lock(); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->restore(); |
| | | } |
| | | unlock(); |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CMaster::resendCurrentTask() |
| | | { |
| | | lock(); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->resend(); |
| | | } |
| | | unlock(); |
| | | |
| | |
| | | pPort->localSetTransferMode((SERVO::TransferMode)transferMode); |
| | | pPort->localAutoChangeEnable(autoChangeEnable); |
| | | } |
| | | |
| | | void CMaster::setPortCassetteType(unsigned int index, SERVO::CassetteType type) |
| | | { |
| | | ASSERT(index < 4); |
| | | int eqid[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4 }; |
| | | CLoadPort* pPort = (CLoadPort*)getEquipment(eqid[index]); |
| | | pPort->localSetCessetteType(type); |
| | | } |
| | | |
| | | void CMaster::setCompareMapsBeforeProceeding(BOOL bCompare) |
| | | { |
| | | m_isCompareMapsBeforeProceeding = bCompare; |
| | | } |
| | | } |
| | |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, CVcrEventReport* pReport)> ONEQVCREVENTREPORT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int code)> ONEQDATACHANGED; |
| | | typedef std::function<void(void* pMaster, CRobotTask* pTask, int code)> ONROBOTTASKEVENT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, short scanMap)> ONLOADPORTINUSE; |
| | | typedef struct _MasterListener |
| | | { |
| | | ONMASTERSTATECHANGED onMasterStateChanged; |
| | |
| | | ONEQVCREVENTREPORT onEqVcrEventReport; |
| | | ONEQDATACHANGED onEqDataChanged; |
| | | ONROBOTTASKEVENT onRobotTaskEvent; |
| | | ONLOADPORTINUSE onLoadPortInUse; |
| | | } MasterListener; |
| | | |
| | | class CMaster |
| | |
| | | void setCacheFilepath(const char* pszFilepath); |
| | | int abortCurrentTask(); |
| | | int restoreCurrentTask(); |
| | | int resendCurrentTask(); |
| | | void setPortType(unsigned int index, BOOL enable, int type, int mode, |
| | | int cassetteType, int transferMode, BOOL autoChangeEnable); |
| | | void setPortCassetteType(unsigned int index, SERVO::CassetteType type); |
| | | void setCompareMapsBeforeProceeding(BOOL bCompare); |
| | | |
| | | private: |
| | | inline void lock() { EnterCriticalSection(&m_criticalSection); } |
| | |
| | | // é误代ç |
| | | int m_nLastError; |
| | | std::string m_strLastError; |
| | | |
| | | // å¨å¼å§å·¥èºåæ¯å¦å
éè¦å
æ¯è¾map |
| | | BOOL m_isCompareMapsBeforeProceeding; |
| | | }; |
| | | } |
| | | |
| | |
| | | ASSERT(pItem); |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | |
| | | CHMPropertyDlg dlg(pEquipment->getName().c_str(), 658, 788); |
| | | CHMPropertyDlg dlg(pEquipment->getName().c_str(), 1258, 788); |
| | | |
| | | CPageLinkSignal* pPage1 = new CPageLinkSignal(); |
| | | pPage1->setEquipment(pEquipment); |
| | |
| | | |
| | | // æµè¯ |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST1) { |
| | | BOOL bTestGenerate = FALSE; |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | if (pEquipment->getID() == EQ_ID_LOADPORT4 && !pEquipment->hasGlass()) { |
| | | ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G1); |
| | | bTestGenerate = TRUE; |
| | | } |
| | | /* |
| | | else if (pEquipment->getID() == EQ_ID_LOADPORT1 && !pEquipment->hasGlass()) { |
| | | ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G2); |
| | | bTestGenerate = TRUE; |
| | | } |
| | | */ |
| | | if (!bTestGenerate) { |
| | | SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask(); |
| | | if (pTask != nullptr) { |
| | | SERVO::CGlass* pGlass = (SERVO::CGlass*)pTask->getContext(); |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pJobDataS != nullptr) { |
| | | SERVO::CJobDataB jobDataB; |
| | | pEquipment->onFetchedOutJob(0, &pJobDataS->getJobDataB(jobDataB)); |
| | | pEquipment->onSentOutJob(0, pJobDataS); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST2) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | |
| | | // TODO: 卿¤å¤æ·»å æ¶æ¯å¤çç¨åºä»£ç |
| | | for (int i = 0; i < 8; i++) { |
| | | for (int j = 0; j < 8; j++) { |
| | | if (m_pBtn[i][j] != nullptr) { |
| | | m_pBtn[i][j]->DestroyWindow(); |
| | | delete m_pBtn[i][j]; |
| | | m_pBtn[i][j] = nullptr; |
| | | if (m_pBtnUpstream[i][j] != nullptr) { |
| | | m_pBtnUpstream[i][j]->DestroyWindow(); |
| | | delete m_pBtnUpstream[i][j]; |
| | | m_pBtnUpstream[i][j] = nullptr; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < 8; i++) { |
| | | for (int j = 0; j < 4; j++) { |
| | | if (m_pBtnDwonstream[i][j] != nullptr) { |
| | | m_pBtnDwonstream[i][j]->DestroyWindow(); |
| | | delete m_pBtnDwonstream[i][j]; |
| | | m_pBtnDwonstream[i][j] = nullptr; |
| | | } |
| | | } |
| | | } |
| | |
| | | y = BTN_Y + (BTN_WIDTH + marginy) * row; |
| | | for (int col = 0; col < 8; col++) { |
| | | x = BTN_X + (BTN_WIDTH + marginx) * col; |
| | | m_pBtn[row][col] = new CBlButton(); |
| | | m_pBtn[row][col]->Create("", WS_VISIBLE, { x, y, x + 36, y + 36 }, this, 1000); |
| | | m_pBtn[row][col]->SetFaceColor(FACECOLOR_OFF); |
| | | m_pBtn[row][col]->SetFrameColor(RGB(28, 28, 28)); |
| | | m_pBtn[row][col]->SetTextColor(RGB(238, 238, 238)); |
| | | m_pBtnUpstream[row][col] = new CBlButton(); |
| | | m_pBtnUpstream[row][col]->Create("", WS_VISIBLE, { x, y, x + 36, y + 36 }, this, 1000); |
| | | m_pBtnUpstream[row][col]->SetFaceColor(FACECOLOR_OFF); |
| | | m_pBtnUpstream[row][col]->SetFrameColor(RGB(28, 28, 28)); |
| | | m_pBtnUpstream[row][col]->SetTextColor(RGB(238, 238, 238)); |
| | | } |
| | | } |
| | | |
| | | CRect rcLine; |
| | | GetDlgItem(IDC_LINE1)->GetWindowRect(&rcLine); |
| | | GetDlgItem(IDC_LINE1)->MoveWindow(BTN_X + (BTN_WIDTH + marginx) * 8 - marginx / 2, BTN_Y, |
| | | rcLine.Width(), (BTN_WIDTH + marginy) * 7 + BTN_WIDTH); |
| | | |
| | | for (int row = 0; row < 8; row++) { |
| | | y = BTN_Y + (BTN_WIDTH + marginy) * row; |
| | | for (int col = 0; col < 4; col++) { |
| | | x = BTN_X + (BTN_WIDTH + marginx) * (col + 8); |
| | | m_pBtnDwonstream[row][col] = new CBlButton(); |
| | | m_pBtnDwonstream[row][col]->Create("", WS_VISIBLE, { x, y, x + 36, y + 36 }, this, 1000); |
| | | m_pBtnDwonstream[row][col]->SetFaceColor(FACECOLOR_OFF); |
| | | m_pBtnDwonstream[row][col]->SetFrameColor(RGB(28, 28, 28)); |
| | | m_pBtnDwonstream[row][col]->SetTextColor(RGB(238, 238, 238)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | int idy[] = { IDC_LABEL_NAME1, IDC_LABEL_NAME2, IDC_LABEL_NAME3, IDC_LABEL_NAME4, IDC_LABEL_NAME5, |
| | | IDC_LABEL_NAME6, IDC_LABEL_NAME7, IDC_LABEL_NAME8 }; |
| | | for (int i = 0; i < 8; i++) { |
| | | IDC_LABEL_NAME6, IDC_LABEL_NAME7, IDC_LABEL_NAME8, IDC_LABEL_NAME9, IDC_LABEL_NAME10, |
| | | IDC_LABEL_NAME11, IDC_LABEL_NAME12}; |
| | | for (int i = 0; i < sizeof(idy) / sizeof(int); i++) { |
| | | pItem = GetDlgItem(idy[i]); |
| | | pItem->GetWindowRect(&rcItem); |
| | | pItem->MoveWindow(BTN_X + (BTN_WIDTH + marginx) * i, |
| | |
| | | { |
| | | if (nIDEvent == TIMER_ID_SIGNAL_UPDATE) { |
| | | if (m_pEquipment) { |
| | | UpdateAllSignalStatesFromDevice(); |
| | | UpdateAllUpstreamSignalStatesFromDevice(); |
| | | UpdateAllDownstreamSignalStatesFromDevice(); |
| | | } |
| | | } |
| | | |
| | | CHMPropertyPage::OnTimer(nIDEvent); |
| | | } |
| | | |
| | | void CPageLinkSignal::UpdateAllSignalStatesFromDevice() |
| | | void CPageLinkSignal::UpdateAllUpstreamSignalStatesFromDevice() |
| | | { |
| | | ASSERT(m_pEquipment); |
| | | |
| | | for (int nRow = 0; nRow < 8; ++nRow) { |
| | | for (int nCol = 0; nCol < 8; ++nCol) { |
| | | BOOL bCurrentState = m_pEquipment->isLinkSignalUpstreamOn(nRow, nCol) && m_pEquipment->IsEnabled(); |
| | | UpdateSignalState(nRow, nCol, bCurrentState); |
| | | UpdateUpstreamSignalState(nRow, nCol, bCurrentState); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageLinkSignal::UpdateSignalState(int nRow, int nCol, bool bNewState) |
| | | void CPageLinkSignal::UpdateAllDownstreamSignalStatesFromDevice() |
| | | { |
| | | if (!::IsWindow(m_pBtn[nRow][nCol]->GetSafeHwnd())) { |
| | | ASSERT(m_pEquipment); |
| | | |
| | | for (int nRow = 0; nRow < 8; ++nRow) { |
| | | for (int nCol = 0; nCol < 4; ++nCol) { |
| | | BOOL bCurrentState = m_pEquipment->isLinkSignalDownstreamOn(nRow, nCol) && m_pEquipment->IsEnabled(); |
| | | UpdateDownstreamSignalState(nRow, nCol, bCurrentState); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageLinkSignal::UpdateUpstreamSignalState(int nRow, int nCol, bool bNewState) |
| | | { |
| | | if (!::IsWindow(m_pBtnUpstream[nRow][nCol]->GetSafeHwnd())) { |
| | | return; |
| | | } |
| | | |
| | | bool bState = ::GetProp(m_pBtn[nRow][nCol]->GetSafeHwnd(), _T("State")) == (void*)1; |
| | | bool bState = ::GetProp(m_pBtnUpstream[nRow][nCol]->GetSafeHwnd(), _T("State")) == (void*)1; |
| | | if (bState != bNewState) { |
| | | m_pBtn[nRow][nCol]->SetFaceColor(bNewState ? FACECOLOR_ON : FACECOLOR_OFF); |
| | | ::SetProp(m_pBtn[nRow][nCol]->GetSafeHwnd(), _T("State"), bNewState ? (void*)1 : (void*)0); |
| | | m_pBtnUpstream[nRow][nCol]->SetFaceColor(bNewState ? FACECOLOR_ON : FACECOLOR_OFF); |
| | | ::SetProp(m_pBtnUpstream[nRow][nCol]->GetSafeHwnd(), _T("State"), bNewState ? (void*)1 : (void*)0); |
| | | } |
| | | } |
| | | |
| | | void CPageLinkSignal::UpdateDownstreamSignalState(int nRow, int nCol, bool bNewState) |
| | | { |
| | | if (!::IsWindow(m_pBtnDwonstream[nRow][nCol]->GetSafeHwnd())) { |
| | | return; |
| | | } |
| | | |
| | | bool bState = ::GetProp(m_pBtnDwonstream[nRow][nCol]->GetSafeHwnd(), _T("State")) == (void*)1; |
| | | if (bState != bNewState) { |
| | | m_pBtnDwonstream[nRow][nCol]->SetFaceColor(bNewState ? FACECOLOR_ON : FACECOLOR_OFF); |
| | | ::SetProp(m_pBtnDwonstream[nRow][nCol]->GetSafeHwnd(), _T("State"), bNewState ? (void*)1 : (void*)0); |
| | | } |
| | | } |
| | | |
| | |
| | | virtual ~CPageLinkSignal(); |
| | | void setEquipment(SERVO::CEquipment* pEquipment); |
| | | void CreateSignalButtons(); |
| | | void UpdateAllSignalStatesFromDevice(); |
| | | void UpdateSignalState(int nRow, int nCol, bool bNewState); |
| | | void UpdateAllUpstreamSignalStatesFromDevice(); |
| | | void UpdateAllDownstreamSignalStatesFromDevice(); |
| | | void UpdateUpstreamSignalState(int nRow, int nCol, bool bNewState); |
| | | void UpdateDownstreamSignalState(int nRow, int nCol, bool bNewState); |
| | | |
| | | |
| | | private: |
| | | SERVO::CEquipment* m_pEquipment; |
| | | CBlButton* m_pBtn[8][8]; |
| | | CBlButton* m_pBtnUpstream[8][8]; |
| | | CBlButton* m_pBtnDwonstream[8][4]; |
| | | BOOL m_bEnable; |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | |
| | | |
| | | void CPagePortProperty::OnCbnSelchangeComboPortCassertType() |
| | | { |
| | | // ç±åæ¥çæ´æ°å°EFEM, ä¿®æ¹ä¸ºä¿åå°æ¬å°iniæä»¶ |
| | | ASSERT(m_pPort != nullptr); |
| | | int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE))->GetCurSel(); |
| | | theApp.m_model.setPortCassetteType(m_pPort->getIndex(), SERVO::CassetteType(index + 1)); |
| | | |
| | | |
| | | /* |
| | | g_nMsgDlgShow = 0; |
| | | CMsgDlg msgDlg("请çå¾
", "æ£å¨æä½ï¼è¯·çå¾
..."); |
| | | msgDlg.SetData((DWORD_PTR)this); |
| | |
| | | |
| | | msgDlg.DoModal(); |
| | | g_nMsgDlgShow = 1; |
| | | */ |
| | | } |
| | | |
| | | void CPagePortProperty::OnCbnSelchangeComboPortTransferMode() |
| | |
| | | return m_nPortStatus; |
| | | } |
| | | |
| | | void CPortStatusReport::setPortStatus(short status) |
| | | { |
| | | m_nPortStatus = status; |
| | | } |
| | | |
| | | short CPortStatusReport::getCassetteSequenceNo() |
| | | { |
| | | return m_nCassetteSequenceNo; |
| | |
| | | memcpy(&m_nCassetteStatus, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | return 15 * 2; |
| | | return 32 * 2; |
| | | } |
| | | |
| | | void CPortStatusReport::getAttributeVector(CAttributeVector& attrubutes, int beginWeight) |
| | |
| | | return m_nJobExistenceSlot[0]; |
| | | } |
| | | |
| | | void CPortStatusReport::setJobExistenceSlot(short map) |
| | | { |
| | | m_nJobExistenceSlot[0] = map; |
| | | } |
| | | |
| | | void CPortStatusReport::WriteString(CArchive& ar, std::string& string) |
| | | { |
| | | CString strTemp = string.c_str(); |
| | |
| | | public: |
| | | void copyEx(CPortStatusReport& other); |
| | | short getPortStatus(); |
| | | void setPortStatus(short status); |
| | | short getCassetteSequenceNo(); |
| | | std::string& getCassetteId(); |
| | | short getLoadingCassetteType(); |
| | |
| | | bool canPickFromPort(); |
| | | bool isJobExistenceSlot(); |
| | | short getJobExistenceSlot(); |
| | | void setJobExistenceSlot(short map); |
| | | |
| | | private: |
| | | void WriteString(CArchive& ar, std::string& string); |
| | |
| | | return m_nUnitNo; |
| | | } |
| | | |
| | | int CRecipeList::addRecipePacket(int totalGroup, int currentGroup, const char* pszData, size_t size) |
| | | int CRecipeList::addRecipePacket(int totalCount, int totalGroup, int currentGroup, const char* pszData, size_t size) |
| | | { |
| | | if (m_nToatlGroupCount == 0) m_nToatlGroupCount = totalGroup; |
| | | if (m_nToatlGroupCount != totalGroup) { |
| | |
| | | for (int i = 0; i < size; i += 4) { |
| | | int index = CToolUnits::toInt16(&pszData[i]); |
| | | short id = CToolUnits::toInt16(&pszData[i + 2]); |
| | | addRecipe(index, id); |
| | | if (index != 0 && id != 0) { |
| | | addRecipe(index, id); |
| | | } |
| | | } |
| | | |
| | | if (m_nCurrentGroupCount == m_nToatlGroupCount) { |
| | |
| | | } |
| | | |
| | | m_ids[index] = id; |
| | | return 0; |
| | | return (int)m_ids.size(); |
| | | } |
| | | |
| | | std::map<int, short>& CRecipeList::getIds() |
| | |
| | | |
| | | public: |
| | | int getUnitNo(); |
| | | int addRecipePacket(int totalGroup, int currentGroup, const char* pszData, size_t size); |
| | | int addRecipePacket(int totalCount,int totalGroup, int currentGroup, const char* pszData, size_t size); |
| | | int addRecipe(int index, short id); |
| | | std::map<int, short>& getIds(); |
| | | void reset(); |
| | |
| | | if (m_onSyncingStateChanged != nullptr) { |
| | | m_onSyncingStateChanged(m_nSyncStatus); |
| | | } |
| | | } |
| | | |
| | | void CRecipesManager::syncTimeout() |
| | | { |
| | | lock(); |
| | | m_nSyncStatus = SS_TIMEOUT; |
| | | m_nTimeoutCount = 0; |
| | | unlock(); |
| | | |
| | | if (m_onSyncingStateChanged != nullptr) { |
| | | m_onSyncingStateChanged(m_nSyncStatus); |
| | | } |
| | | } |
| | | |
| | | short CRecipesManager::decodeRecipeListReport(const char* pszData, size_t size) |
| | |
| | | |
| | | } |
| | | else if (reportType == RT_REQUEST_FROM_EAS) { |
| | | int nRet = pRecipeList->addRecipePacket(toatlGroupCount, currentGroupCount, pszIdsData, 250 * 2); |
| | | int nRet = pRecipeList->addRecipePacket(totalMasterRecipeCount, toatlGroupCount, currentGroupCount, pszIdsData, 250 * 2); |
| | | if (MRLRC_CURRENT_RECIPE_COMPLETE == nRet) { |
| | | lock(); |
| | | for (auto item : m_mapRecipes) { |
| | |
| | | if (m_nSyncStatus == SS_SYNCING) { |
| | | m_nTimeoutCount++; |
| | | if (m_nTimeoutCount > 10) { |
| | | m_nSyncStatus = SS_TIMEOUT; |
| | | unlock(); |
| | | syncTimeout(); |
| | | TRACE("CRecipesManager::TimeoutCheckWorkingProc è¶
æ¶éåº\n"); |
| | | lock(); |
| | | } |
| | | } |
| | | |
| | |
| | | unsigned TimeoutCheckWorkingProc(); |
| | | int syncing(); |
| | | void syncFailed(); |
| | | void syncTimeout(); |
| | | short decodeRecipeListReport(const char* pszData, size_t size); |
| | | short decodeRecipeParameterReport(const char* pszData, size_t size); |
| | | CRecipeList* getRecipeListFromTemp(int unitNo); |
| | |
| | | }); |
| | | } |
| | | |
| | | void CRobotTask::resend() |
| | | { |
| | | // éæ°ä¸åå½ä»¤ï¼æ 鿝ä¸ååææä¸åæ¾æçå½ä»¤ï¼æ ¹æ®å½åç¶ææ¥ |
| | | if (ROBOT_TASK_STATE::Picking == m_state || ROBOT_TASK_STATE::Picked == m_state) { |
| | | pick(); |
| | | } |
| | | else if (ROBOT_TASK_STATE::Placing == m_state) { |
| | | place(); |
| | | } |
| | | } |
| | | |
| | | void CRobotTask::completed() |
| | | { |
| | | m_state = ROBOT_TASK_STATE::Completed; |
| | |
| | | void place(); |
| | | void restore(); |
| | | void restored(); |
| | | void resend(); |
| | | void completed(); |
| | | void error(); |
| | | void abort(); |
| | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | // å建â忢任å¡âæé®åâæ¤åâæé® |
| | | m_btnAbortTask.Create(_T("忢任å¡"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_ABORT_TASK); |
| | | m_btnRestore.Create(_T("æ¤å"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_RESTORE); |
| | | m_btnRestore.Create(_T("éåæä»¤"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_RESTORE); |
| | | |
| | | // 卿æé®å建å设置åä½ |
| | | if (m_fontButton.GetSafeHandle() == nullptr) { |
| | |
| | | |
| | | void CRobotTaskDlg::OnBnClickedRestore() |
| | | { |
| | | int ret = AfxMessageBox(_T("ç©æå°ä¼è¢«æ¬è¿ååä½ç½®ï¼ç¡®è®¤è¦åæ¤å½åä»»å¡åï¼é¤éåçäºå¼å¸¸ï¼å¦å请ä¸è¦åæ¤ä»»å¡ï¼"), MB_OKCANCEL | MB_ICONEXCLAMATION); |
| | | // 忤任å¡ä¿®æ¹ä¸ºéåä»»å¡ |
| | | int ret = AfxMessageBox(_T("确认è¦éæ°ä¸åä»»å¡åï¼"), MB_OKCANCEL | MB_ICONEXCLAMATION); |
| | | if (ret != IDOK) { |
| | | return; |
| | | } |
| | | |
| | | theApp.m_model.getMaster().restoreCurrentTask(); |
| | | theApp.m_model.getMaster().resendCurrentTask(); |
| | | } |
| | |
| | | #define RX_CODE_EQ_DATA_CHANGED 1010 |
| | | #define RX_CODE_MASTER_STATE_CHANGED 1011 |
| | | #define RX_CODE_EQ_ROBOT_TASK 1012 |
| | | #define RX_CODE_LOADPORT_INUSE 1013 |
| | | |
| | | |
| | | /* Channel Name */ |
| | |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CConfiguration::setPortCassetteType(unsigned int index, int cassetteType) |
| | | { |
| | | if (index >= 4) return FALSE; |
| | | if (cassetteType < 1 || 3 < cassetteType) return FALSE; |
| | | |
| | | static char* pszSection[] = { "Port1", "Port2", "Port3", "Port4" }; |
| | | WritePrivateProfileString(pszSection[index], _T("CassetteType"), std::to_string(cassetteType).c_str(), m_strFilepath); |
| | | return true; |
| | | } |
| | | |
| | | BOOL CConfiguration::isCompareMapsBeforeProceeding() |
| | | { |
| | | return GetPrivateProfileInt(_T("Master"), _T("CompareMapsBeforeProceeding"), 0, m_strFilepath); |
| | | } |
| | | |
| | |
| | | int getFilterMode(); |
| | | BOOL getPortParms(unsigned int index, BOOL& bEnable, int& type, int& mode, |
| | | int& cassetteType, int& transferMode, BOOL& bAutoChangeEnable); |
| | | BOOL setPortCassetteType(unsigned int index, int cassetteType); |
| | | BOOL isCompareMapsBeforeProceeding(); |
| | | |
| | | public: |
| | | void setP2RemoteEqReconnectInterval(int second); |
| | |
| | | } |
| | | } |
| | | |
| | | void CModel::setPortCassetteType(unsigned int index, SERVO::CassetteType type) |
| | | { |
| | | m_master.setPortCassetteType(index, type); |
| | | m_configuration.setPortCassetteType(index, (int)type); |
| | | } |
| | | |
| | | int CModel::init() |
| | | { |
| | | CString strIniFile; |
| | |
| | | notifyPtrAndInt(RX_CODE_EQ_ROBOT_TASK, pTask, nullptr, code); |
| | | |
| | | }; |
| | | masterListener.onLoadPortInUse = [&] (void* pMaster, SERVO::CEquipment* pEquipment, short scanMap) { |
| | | LOGE("<CModel>onLoadPortInUse. scanMap = %d", scanMap); |
| | | notifyPtr(RX_CODE_LOADPORT_INUSE, pEquipment); |
| | | }; |
| | | m_master.setListener(masterListener); |
| | | |
| | | |
| | |
| | | CString strMasterDataFile; |
| | | strMasterDataFile.Format(_T("%s\\Master.dat"), (LPTSTR)(LPCTSTR)m_strWorkDir); |
| | | m_master.setCacheFilepath((LPTSTR)(LPCTSTR)strMasterDataFile); |
| | | |
| | | m_master.setCompareMapsBeforeProceeding(m_configuration.isCompareMapsBeforeProceeding()); |
| | | |
| | | // å è½½è¦åä¿¡æ¯ |
| | | AlarmManager& alarmManager = AlarmManager::getInstance(); |
| | |
| | | SERVO::CMaster& getMaster(); |
| | | void setWorkDir(const char* pszWorkDir); |
| | | void loadPortParams(); |
| | | void setPortCassetteType(unsigned int index, SERVO::CassetteType type); |
| | | int init(); |
| | | int term(); |
| | | |
| | |
| | | #include "afxdialogex.h" |
| | | #include "PageRecipe.h" |
| | | #include "MsgDlg.h" |
| | | |
| | | #include "RecipeDeviceBindDlg.h" |
| | | |
| | | // CPageRecipe å¯¹è¯æ¡ |
| | | |
| | |
| | | { |
| | | } |
| | | |
| | | void CPageRecipe::UpdateRecipeByPPID(const CString& strPPID) |
| | | { |
| | | if (strPPID.IsEmpty()) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªé
æ¹ï¼")); |
| | | return; |
| | | } |
| | | |
| | | auto& mgr = RecipeManager::getInstance(); |
| | | |
| | | // æ¥è¯¢éä¸é
æ¹çè¯¦ç»æ°æ® |
| | | std::string oldPPID = CT2A(strPPID); |
| | | RecipeInfo oldRecipe = mgr.getRecipeByPPID(oldPPID); |
| | | if (oldRecipe.strPPID.empty()) { |
| | | AfxMessageBox(_T("è·åé
æ¹æ°æ®å¤±è´¥ï¼")); |
| | | return; |
| | | } |
| | | |
| | | // å¼¹åºç¼è¾å¯¹è¯æ¡ï¼å¹¶åå§å为å½åå
容 |
| | | CRecipeDeviceBindDlg dlg(this); |
| | | dlg.SetRecipeInfo(oldRecipe); |
| | | |
| | | if (dlg.DoModal() == IDOK) { |
| | | const RecipeInfo& newRecipe = dlg.GetRecipeInfo(); |
| | | |
| | | bool success = false; |
| | | // 夿PPIDæ¯å¦ææ¹å¨ |
| | | if (oldRecipe.strPPID != newRecipe.strPPID) { |
| | | // å
æ´æ°PPIDï¼åæ´ä½æ´æ°å
容 |
| | | if (mgr.updatePPID(oldRecipe.strPPID, newRecipe.strPPID)) { |
| | | success = mgr.updateRecipe(newRecipe); |
| | | if (!success) { |
| | | AfxMessageBox(_T("å·²æ´æ¹PPIDï¼ä½æ´æ°é
æ¹å
容失败ï¼è¯·æ£æ¥æ¥å¿")); |
| | | } |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("æ´æ°PPID失败ï¼è¯·æ£æ¥æ¥å¿")); |
| | | return; |
| | | } |
| | | } |
| | | else { |
| | | // åªæ´æ°å
容 |
| | | success = mgr.updateRecipe(newRecipe); |
| | | if (!success) { |
| | | AfxMessageBox(_T("æ´æ°é
æ¹å¤±è´¥ï¼è¯·æ£æ¥æ¥å¿")); |
| | | } |
| | | } |
| | | |
| | | if (success) { |
| | | auto vecData = mgr.getAllRecipes(); |
| | | FillDataToListCtrl(vecData); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::FillDataToListCtrl(const std::vector<RecipeInfo>& vecRecipe) { |
| | | CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST_PPID); |
| | | if (pListCtrl == nullptr || !::IsWindow(pListCtrl->m_hWnd)) { |
| | |
| | | // éåæ°æ®å¹¶æå
¥å°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())); |
| | | } |
| | | |
| | | // è·ååæ° |
| | |
| | | if (pList == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // éåæ°æ®å¹¶æå
¥å°CListCtrlä¸ |
| | | std::map<int, short>& ids = pList->getIds(); |
| | |
| | | |
| | | BEGIN_MESSAGE_MAP(CPageRecipe, CDialogEx) |
| | | ON_WM_SIZE() |
| | | ON_WM_DESTROY() |
| | | ON_WM_SHOWWINDOW() |
| | | ON_BN_CLICKED(IDC_BUTTON_NEW, &CPageRecipe::OnBnClickedButtonNew) |
| | | 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_REFRESH, &CPageRecipe::OnBnClickedButtonRefresh) |
| | | ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST_PPID, &CPageRecipe::OnLvnItemChangedListPPID) |
| | | ON_WM_DESTROY() |
| | | ON_CBN_SELCHANGE(IDC_COMBO_EQUIPMENT, &CPageRecipe::OnCbnSelchangeComboEquipment) |
| | | ON_WM_SHOWWINDOW() |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | // 读åºå宽 |
| | | 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("ç空çç¤"), LVCFMT_LEFT, width[6]); |
| | | 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[7]); |
| | | pListCtrl->InsertColumn(7, _T("ç²¾åº¦æ£æ¥"), LVCFMT_LEFT, width[8]); |
| | | pListCtrl->InsertColumn(8, _T("EFEM"), LVCFMT_LEFT, width[3]); |
| | | 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(); |
| | |
| | | // æé®ç«ç´æåå¨å³ä¾§ |
| | | CWnd* buttons[] = { |
| | | GetDlgItem(IDC_BUTTON_REFRESH), |
| | | GetDlgItem(IDC_BUTTON_NEW), |
| | | GetDlgItem(IDC_BUTTON_MODIFY), |
| | | GetDlgItem(IDC_BUTTON_DELETE), |
| | | GetDlgItem(IDC_BUTTON_DELETE_ALL), |
| | | GetDlgItem(IDC_BUTTON_MODIFY) |
| | | GetDlgItem(IDC_BUTTON_DELETE_ALL) |
| | | }; |
| | | |
| | | for (auto pBtn : buttons) { |
| | |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | | // ä¿åå宽 |
| | | CString strIniFile, strItem, strTemp; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir); |
| | | CHeaderCtrl* pHeader = m_listPPID.GetHeaderCtrl(); |
| | | for (int i = 0; i < pHeader->GetItemCount(); i++) { |
| | | RECT rect; |
| | | pHeader->GetItemRect(i, &rect); |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | strTemp.Format(_T("%d"), rect.right - rect.left); |
| | | WritePrivateProfileString("PageRecipeListCtrl", strItem, strTemp, strIniFile); |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::OnShowWindow(BOOL bShow, UINT nStatus) |
| | | { |
| | | CDialogEx::OnShowWindow(bShow, nStatus); |
| | | |
| | | if (bShow) { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | if (pComboBox->GetCount() == 0) { |
| | | SERVO::CMaster& master = theApp.m_model.getMaster(); |
| | | SERVO::CEquipment* pEq[] = { |
| | | nullptr, |
| | | master.getEquipment(EQ_ID_EFEM), |
| | | master.getEquipment(EQ_ID_Bonder1), |
| | | master.getEquipment(EQ_ID_Bonder2), |
| | | master.getEquipment(EQ_ID_BAKE_COOLING), |
| | | master.getEquipment(EQ_ID_VACUUMBAKE), |
| | | master.getEquipment(EQ_ID_MEASUREMENT), |
| | | }; |
| | | |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | for (int i = 0; i < sizeof(pEq) / sizeof(pEq[0]); i++) { |
| | | pComboBox->InsertString(i, |
| | | pEq[i] == nullptr ? _T("Master") : pEq[i]->getName().c_str()); |
| | | pComboBox->SetItemDataPtr(i, pEq[i]); |
| | | } |
| | | pComboBox->SetCurSel(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonNew() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | //CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | //int nSel = pComboBox->GetCurSel(); |
| | | //SERVO::CEquipment* pEq = (SERVO::CEquipment*)pComboBox->GetItemDataPtr(nSel); |
| | | //if (pEq == nullptr) { |
| | | // return; |
| | | //} |
| | | |
| | | CRecipeDeviceBindDlg dlg(this); |
| | | if (dlg.DoModal() == IDOK) { |
| | | const RecipeInfo& newRecipe = dlg.GetRecipeInfo(); |
| | | |
| | | auto& mgr = RecipeManager::getInstance(); |
| | | if (mgr.ppidExists(newRecipe.strPPID)) { |
| | | // å·²åå¨ï¼è¯¢é®æ¯å¦è¦ç |
| | | int ret = AfxMessageBox(_T("该 PPID å·²åå¨ï¼æ¯å¦è¦çåé
æ¹ï¼"), MB_YESNO | MB_ICONQUESTION); |
| | | if (ret == IDYES) { |
| | | if (mgr.updateRecipe(newRecipe)) { |
| | | auto vecData = mgr.getAllRecipes(); |
| | | FillDataToListCtrl(vecData); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("æ´æ°é
æ¹å¤±è´¥ï¼è¯·æ£æ¥æ¥å¿")); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | // ä¸åå¨ï¼ç´æ¥æ°å¢ |
| | | if (mgr.addRecipe(newRecipe)) { |
| | | auto vecData = mgr.getAllRecipes(); |
| | | FillDataToListCtrl(vecData); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("æ·»å é
æ¹å¤±è´¥ï¼è¯·æ£æ¥æ¥å¿")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonSearch() |
| | | { |
| | | CString strKeyword; |
| | | GetDlgItemText(IDC_EDIT_KEYWORD, strKeyword); |
| | | AfxMessageBox(strKeyword); |
| | | strKeyword.Trim(); |
| | | |
| | | std::vector<RecipeInfo> vecData; |
| | | if (strKeyword.IsEmpty()) { |
| | | // å
³é®è¯ä¸ºç©ºï¼æ¾ç¤ºå
¨é¨é
æ¹ |
| | | vecData = RecipeManager::getInstance().getAllRecipes(); |
| | | } |
| | | else { |
| | | // æ ¹æ®å
³é®è¯æç´¢é
æ¹ |
| | | vecData = RecipeManager::getInstance().getRecipesByKeyword(std::string(CT2A(strKeyword))); |
| | | } |
| | | |
| | | // å¦ææ²¡ææ°æ®ï¼å¼¹åºæç¤º |
| | | if (vecData.empty()) { |
| | | AfxMessageBox(_T("æªæ¾å°å¹é
çé
æ¹ï¼")); |
| | | return; |
| | | } |
| | | |
| | | FillDataToListCtrl(vecData); |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonModify() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | /* |
| | | POSITION pos = m_listPPID.GetFirstSelectedItemPosition(); |
| | | if (!pos) { |
| | | AfxMessageBox(_T("è¯·éæ©è¦ä¿®æ¹çé
æ¹")); |
| | | AfxMessageBox(_T("请å
鿩䏿¡é
æ¹è®°å½è¿è¡ä¿®æ¹ï¼")); |
| | | return; |
| | | } |
| | | |
| | | int nSel = m_listPPID.GetNextSelectedItem(pos); |
| | | CString strOldPPID = m_listPPID.GetItemText(nSel, 2); |
| | | CString strOldDesc = m_listPPID.GetItemText(nSel, 3); |
| | | |
| | | CString strNewPPID, strNewDesc; |
| | | m_editPPID.GetWindowText(strNewPPID); |
| | | m_editDesc.GetWindowText(strNewDesc); |
| | | |
| | | // å¤ç©º |
| | | if (strOldPPID.IsEmpty() || strNewPPID.IsEmpty()) { |
| | | AfxMessageBox(_T("PPID ä¸è½ä¸ºç©º")); |
| | | return; |
| | | } |
| | | |
| | | std::string oldPPID = CT2A(strOldPPID); |
| | | std::string newPPID = CT2A(strNewPPID); |
| | | std::string newDesc = CT2A(strNewDesc); |
| | | |
| | | bool bPPIDChanged = (strOldPPID.Compare(strNewPPID) != 0); |
| | | bool bDescChanged = (strOldDesc.Compare(strNewDesc) != 0); |
| | | |
| | | if (!bPPIDChanged && !bDescChanged) { |
| | | return; |
| | | } |
| | | |
| | | if (bPPIDChanged) { |
| | | // æ° PPID ä¸å¯éå¤ |
| | | if (RecipeManager::getInstance().ppidExists(newPPID)) { |
| | | AfxMessageBox(_T("æ° PPID å·²åå¨ï¼è¯·ä½¿ç¨å
¶ä»å¼")); |
| | | return; |
| | | } |
| | | |
| | | // è°ç¨ updatePPIDï¼åæ¶æ´æ°æè¿° |
| | | if (RecipeManager::getInstance().updatePPID(oldPPID, newPPID)) { |
| | | m_listPPID.SetItemText(nSel, 2, strNewPPID); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("æ´æ°å¤±è´¥ï¼è¯·æ£æ¥æ¥å¿")); |
| | | } |
| | | } |
| | | |
| | | if (bDescChanged) { |
| | | // æ´æ°æè¿° |
| | | if (RecipeManager::getInstance().updateDescription(oldPPID, newDesc)) { |
| | | m_listPPID.SetItemText(nSel, 3, strNewDesc); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("æè¿°æ´æ°å¤±è´¥")); |
| | | } |
| | | } |
| | | */ |
| | | CString strPPID = m_listPPID.GetItemText(nSel, 2); |
| | | UpdateRecipeByPPID(strPPID); |
| | | } |
| | | |
| | | void CPageRecipe::OnBnClickedButtonDelete() |
| | |
| | | // enable port |
| | | CMsgDlg msgDlg("请çå¾
", "æ£å¨è·åé
æ¹..."); |
| | | pEq->masterRecipeListRequest(0, [&](int status) -> void { |
| | | if (status == SS_FAILED) { |
| | | if (status == SS_FAILED || status == SS_TIMEOUT) { |
| | | CString strMsg; |
| | | strMsg.Format(_T("è·åé
æ¹å¤±è´¥ï¼")); |
| | | strMsg.Format(status == SS_FAILED ? _T("è·åé
æ¹å¤±è´¥ï¼") : _T("è·åé
æ¹è¶
æ¶ï¼")); |
| | | msgDlg.DelayClose(3000); |
| | | msgDlg.SetIcon(MSG_BOX_ERROR); |
| | | msgDlg.SetTitle(_T("æä½å¤±è´¥")); |
| | |
| | | msgDlg.SetMarquee(FALSE, 0); |
| | | msgDlg.SetCompleteCode(0); |
| | | } |
| | | }); |
| | | }); |
| | | msgDlg.DoModal(); |
| | | } |
| | | } |
| | |
| | | else { |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | FillRecipeListToListCtrl(pRecipeList); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | void CPageRecipe::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | | // ä¿åå宽 |
| | | CString strIniFile, strItem, strTemp; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir); |
| | | CHeaderCtrl* pHeader = m_listPPID.GetHeaderCtrl(); |
| | | for (int i = 0; i < pHeader->GetItemCount(); i++) { |
| | | RECT rect; |
| | | pHeader->GetItemRect(i, &rect); |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | strTemp.Format(_T("%d"), rect.right - rect.left); |
| | | WritePrivateProfileString("PageRecipeListCtrl", strItem, strTemp, strIniFile); |
| | | } |
| | | } |
| | | |
| | | |
| | | void CPageRecipe::OnShowWindow(BOOL bShow, UINT nStatus) |
| | | { |
| | | CDialogEx::OnShowWindow(bShow, nStatus); |
| | | |
| | | if (bShow) { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | if (pComboBox->GetCount() == 0) { |
| | | SERVO::CMaster& master = theApp.m_model.getMaster(); |
| | | SERVO::CEquipment* pEq[] = { |
| | | nullptr, |
| | | master.getEquipment(EQ_ID_EFEM), |
| | | master.getEquipment(EQ_ID_Bonder1), |
| | | master.getEquipment(EQ_ID_Bonder2), |
| | | master.getEquipment(EQ_ID_BAKE_COOLING), |
| | | master.getEquipment(EQ_ID_VACUUMBAKE), |
| | | master.getEquipment(EQ_ID_MEASUREMENT), |
| | | }; |
| | | |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | for (int i = 0; i < sizeof(pEq) / sizeof(pEq[0]); i++) { |
| | | pComboBox->InsertString(i, |
| | | pEq[i] == nullptr ? _T("Master") : pEq[i]->getName().c_str()); |
| | | pComboBox->SetItemDataPtr(i, pEq[i]); |
| | | } |
| | | pComboBox->SetCurSel(0); |
| | | } |
| | | } |
| | | } |
| | |
| | | virtual ~CPageRecipe(); |
| | | |
| | | private: |
| | | void UpdateRecipeByPPID(const CString& strPPID); |
| | | void FillDataToListCtrl(const std::vector<RecipeInfo>& vecRecipe); |
| | | void FillRecipeListToListCtrl(SERVO::CRecipeList* pList); |
| | | |
| | |
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV æ¯æ |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnDestroy(); |
| | | afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); |
| | | afx_msg void OnBnClickedButtonNew(); |
| | | afx_msg void OnBnClickedButtonSearch(); |
| | | afx_msg void OnBnClickedButtonModify(); |
| | | afx_msg void OnBnClickedButtonDelete(); |
| | | afx_msg void OnBnClickedButtonDeleteAll(); |
| | | afx_msg void OnBnClickedButtonRefresh(); |
| | | afx_msg void OnLvnItemChangedListPPID(NMHDR* pNMHDR, LRESULT* pResult); |
| | | afx_msg void OnCbnSelchangeComboEquipment(); |
| | | DECLARE_MESSAGE_MAP() |
| | | |
| | | private: |
| | | CListCtrl m_listPPID; |
| | | public: |
| | | afx_msg void OnDestroy(); |
| | | afx_msg void OnCbnSelchangeComboEquipment(); |
| | | afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); |
| | | }; |
| | |
| | | #include "ServoCommo.h" |
| | | |
| | | |
| | | |
| | | #define CHECKBOX_ALL_ID 0x1234 |
| | | |
| | | // CPortConfigurationDlg å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CPortConfigurationDlg, CDialogEx) |
| | |
| | | m_pPort[1] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT2)); |
| | | m_pPort[2] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT3)); |
| | | m_pPort[3] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT4)); |
| | | m_nCurSelPort = -1; |
| | | m_pCheckBox = nullptr; |
| | | m_bCheckedAll = FALSE; |
| | | } |
| | | |
| | | CPortConfigurationDlg::~CPortConfigurationDlg() |
| | | { |
| | | } |
| | | |
| | | void CPortConfigurationDlg::setCurSelPort(int sel) |
| | | { |
| | | m_nCurSelPort = sel; |
| | | } |
| | | |
| | | int CPortConfigurationDlg::GetLoadPortEqID(const std::string& strPortName) |
| | |
| | | continue; |
| | | } |
| | | |
| | | SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext()); |
| | | int nRow = i + 1; |
| | | |
| | | // 设置 Panel ID åå¾éæ¡ |
| | | CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(nRow, 1)); |
| | | if (pCheck && pGlass) { |
| | | pCheck->SetCheck(pSlot->isEnable() ? TRUE : FALSE); |
| | | pCheck->SetText(pGlass ? pGlass->getID().c_str() : _T("")); |
| | | SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext()); |
| | | int nRow = i + 1; |
| | | if (pGlass != nullptr) { |
| | | m_wndGrid.SetItemState(nRow, 0, GVIS_READONLY); |
| | | m_wndGrid.SetItemText(nRow, 0, pSlot->getName().c_str()); |
| | | m_wndGrid.SetCellType(nRow, 1, RUNTIME_CLASS(CGridCellCheck)); |
| | | CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(nRow, 1)); |
| | | ASSERT(pCheck); |
| | | pCheck->SetCheck(pGlass->isScheduledForProcessing()); |
| | | pCheck->SetText(pGlass->getID().c_str()); |
| | | } |
| | | else { |
| | | pCheck->SetCheck(FALSE); |
| | | pCheck->SetText(_T("")); |
| | | } |
| | | m_wndGrid.SetItemData(nRow, 0, (LPARAM)pGlass); |
| | | |
| | | |
| | | // åå¡« Job ä¿¡æ¯ï¼åªå第ä¸ä¸ªææ Glassï¼ |
| | | if (!bJobInfoSet && pGlass) { |
| | |
| | | } |
| | | } |
| | | } |
| | | m_pCheckBox->SetCheck(IsCheckedAll() ? BST_CHECKED : BST_UNCHECKED); |
| | | } |
| | | |
| | | void CPortConfigurationDlg::InitGrid() |
| | |
| | | m_wndGrid.SetColumnWidth(nColIdx, 50); |
| | | m_wndGrid.SetItemText(0, nColIdx++, _T("Slot ID")); |
| | | m_wndGrid.SetColumnWidth(nColIdx, 60); |
| | | m_wndGrid.SetItemText(0, nColIdx++, _T("å¯ç¨")); |
| | | m_wndGrid.SetItemText(0, nColIdx++, _T("Glass ID")); |
| | | |
| | | |
| | | // 设置è¡ä¸ºæ ·å¼ |
| | | m_wndGrid.SetFixedRowSelection(FALSE); |
| | |
| | | m_wndGrid.SetRowHeight(i, nEachRowHeight); |
| | | } |
| | | |
| | | FillGrid(); |
| | | } |
| | | |
| | | void CPortConfigurationDlg::FillGrid() |
| | | { |
| | | //CStringArray recipeOptions; |
| | | //recipeOptions.Add(_T("Recipe A")); |
| | | //recipeOptions.Add(_T("Recipe B")); |
| | | //recipeOptions.Add(_T("Recipe C")); |
| | | |
| | | for (int i = 1; i < 9; ++i) { |
| | | CString strIndex; |
| | | strIndex.Format(_T("%d"), i); |
| | | m_wndGrid.SetItemText(i, 0, strIndex); |
| | | m_wndGrid.SetItemState(i, 0, GVIS_READONLY); |
| | | |
| | | // Checkbox |
| | | m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellCheck)); |
| | | CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); |
| | | if (pCheck) { |
| | | pCheck->SetCheck(FALSE); |
| | | } |
| | | } |
| | | |
| | | m_wndGrid.Invalidate(); |
| | | m_wndGrid.UpdateWindow(); |
| | | CRect rect; |
| | | BOOL bOK = m_wndGrid.GetCellRect(0, 1, rect); |
| | | m_pCheckBox = new CCustomCheckBox(); |
| | | m_pCheckBox->Create(_T("éæ©ææ"), |
| | | WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, // èªå¨å¾é |
| | | CRect(0, 0, 150, 32), &m_wndGrid, CHECKBOX_ALL_ID); |
| | | m_pCheckBox->SetFont(GetFont()); |
| | | m_pCheckBox->MoveWindow(rect.left + 5, rect.top + 3, 150, rect.Height() - 6); |
| | | m_pCheckBox->SetBackgroundColor(g_nGridFixCellColor); |
| | | m_pCheckBox->SetNotifyHwnd(GetSafeHwnd()); |
| | | } |
| | | |
| | | void CPortConfigurationDlg::DoDataExchange(CDataExchange* pDX) |
| | |
| | | BEGIN_MESSAGE_MAP(CPortConfigurationDlg, CDialogEx) |
| | | ON_CBN_SELCHANGE(IDC_COMBO_PORT, &CPortConfigurationDlg::OnSelchangeComboPort) |
| | | ON_BN_CLICKED(IDC_BUTTON_APPLY, &CPortConfigurationDlg::OnBnClickedButtonApply) |
| | | ON_MESSAGE(WM_CHECKBOX_STATE_CHANGED, &CPortConfigurationDlg::OnCheckAllClicked) |
| | | ON_WM_DESTROY() |
| | | ON_BN_CLICKED(IDC_BUTTON_PROCESS_START, &CPortConfigurationDlg::OnBnClickedButtonProcessStart) |
| | | ON_BN_CLICKED(IDC_BUTTON_PROCESS_CANCEL, &CPortConfigurationDlg::OnBnClickedButtonProcessCancel) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | for (const auto& item : ports) { |
| | | m_comboPort.AddString(item); |
| | | } |
| | | m_comboPort.SetCurSel(0); // é»è®¤éæ©ç¬¬ä¸ä¸ªç«¯å£ |
| | | if (0 <= m_nCurSelPort && m_nCurSelPort <= 3) { |
| | | m_comboPort.SetCurSel(m_nCurSelPort); |
| | | m_comboPort.EnableWindow(FALSE); |
| | | } |
| | | else { |
| | | m_comboPort.SetCurSel(0); |
| | | } |
| | | |
| | | // åå§åé
æ¹ä¸ææ¡å
容 |
| | | std::vector<std::string> vecRecipe = RecipeManager::getInstance().getAllPPID(); |
| | |
| | | LoadPortConfigToUI(m_pPort[0]); // é»è®¤å 载第ä¸ä¸ªç«¯å£çé
ç½® |
| | | |
| | | // è®¾ç½®å¯¹è¯æ¡æ é¢ |
| | | SetWindowText(_T("Port Configuration")); |
| | | BOOL bAutoPopup = 0 <= m_nCurSelPort && m_nCurSelPort <= 3; |
| | | if (bAutoPopup) { |
| | | CString strTitle; |
| | | strTitle.Format(_T("%s Configuration"), ports[m_nCurSelPort]); |
| | | SetWindowText(strTitle); |
| | | } |
| | | else { |
| | | SetWindowText(_T("Port Configuration")); |
| | | } |
| | | |
| | | |
| | | // Porcess Start / Process Cancel æé®ç¶æ |
| | | GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(FALSE); |
| | | GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(FALSE); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | |
| | | } |
| | | |
| | | // å è½½éä¸ç«¯å£çé
ç½®å° UI |
| | | for (int i = 1; i <= 8; i++) { |
| | | m_wndGrid.SetItemText(i, 0, ""); |
| | | m_wndGrid.SetItemText(i, 1, ""); |
| | | m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellNumeric)); |
| | | } |
| | | m_wndGrid.Invalidate(); |
| | | LoadPortConfigToUI(m_pPort[selPort]); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // è·å Grid è¡¨æ ¼ä¸ Slot ç¶æï¼ç¬¬1~8è¡ï¼ |
| | | for (int i = 1; i <= 8; ++i) { |
| | | SERVO::SlotConfig slot; |
| | | slot.nSlotID = i; |
| | | for (int i = 1; i <= SLOT_MAX; ++i) { |
| | | SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0); |
| | | if (pGlass != nullptr) { |
| | | CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); |
| | | ASSERT(pCheck); |
| | | pGlass->setScheduledForProcessing(pCheck->GetCheck()); |
| | | pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType)); |
| | | |
| | | CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); |
| | | if (pCheck) { |
| | | slot.isEnabled = pCheck->GetCheck(); |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | pJobDataS->setLotId(config.strLotID.c_str()); |
| | | pJobDataS->setProductId(config.strProductID.c_str()); |
| | | pJobDataS->setOperationId(config.strOperationID.c_str()); |
| | | pJobDataS->setMaterialsType(config.nMaterialType); |
| | | |
| | | RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(config.strRecipe); |
| | | std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList; |
| | | |
| | | for (const auto& info : vecRecipeInfo) { |
| | | const std::string& name = info.strDeviceName; |
| | | short nRecipeID = (short)info.nRecipeID; |
| | | |
| | | if (name == EQ_NAME_EFEM) { |
| | | pJobDataS->setDeviceRecipeId(0, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BONDER1) { |
| | | pJobDataS->setDeviceRecipeId(1, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BONDER2) { |
| | | pJobDataS->setDeviceRecipeId(2, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BAKE_COOLING) { |
| | | pJobDataS->setDeviceRecipeId(3, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_VACUUMBAKE) { |
| | | pJobDataS->setDeviceRecipeId(4, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_MEASUREMENT) { |
| | | pJobDataS->setDeviceRecipeId(5, nRecipeID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | config.vecSlot.push_back(slot); |
| | | } |
| | | |
| | | int nEqID = GetLoadPortEqID(config.strPortName); |
| | | if (nEqID < 0) { |
| | | AfxMessageBox(_T("æªç¥ç端å£åç§°ï¼")); |
| | | return; |
| | | GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(TRUE); |
| | | GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(TRUE); |
| | | } |
| | | |
| | | void CPortConfigurationDlg::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | | if (m_pCheckBox != nullptr) { |
| | | m_pCheckBox->DestroyWindow(); |
| | | delete m_pCheckBox; |
| | | m_pCheckBox = nullptr; |
| | | } |
| | | } |
| | | |
| | | LRESULT CPortConfigurationDlg::OnCheckAllClicked(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | UINT ctrlID = (UINT)wParam; |
| | | BOOL bChecked = (BOOL)lParam; |
| | | for (int i = 1; i <= SLOT_MAX; ++i) { |
| | | CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); |
| | | if (pCheck != nullptr) { |
| | | pCheck->SetCheck(bChecked); |
| | | } |
| | | } |
| | | |
| | | SERVO::CLoadPort* pPort = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(nEqID)); |
| | | if (!pPort) { |
| | | AfxMessageBox(_T("æ¾ä¸å°å¯¹åºç LoadPort 设å¤ï¼")); |
| | | return; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | BOOL CPortConfigurationDlg::IsCheckedAll() |
| | | { |
| | | for (int i = 1; i <= SLOT_MAX; ++i) { |
| | | CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); |
| | | if (pCheck != nullptr) { |
| | | if (!pCheck->GetCheck()) return FALSE; |
| | | } |
| | | } |
| | | |
| | | // åºç¨é
ç½®ï¼ä¾å¦æµè¯çæç»çï¼ |
| | | if (pPort->testGenerateGlassListFromConfig(config) < 0) { |
| | | AfxMessageBox(_T("Failed to generate glass list from configuration!")); |
| | | return; |
| | | } |
| | | return TRUE; |
| | | } |
| | | |
| | | OnOK(); |
| | | } |
| | | void CPortConfigurationDlg::OnBnClickedButtonProcessStart() |
| | | { |
| | | int selPort = (0 <= m_nCurSelPort && m_nCurSelPort <= 3) ? m_nCurSelPort |
| | | : m_comboPort.GetCurSel(); |
| | | if (selPort < 0 || selPort >= 4) return; |
| | | m_pPort[selPort]->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | } |
| | | |
| | | void CPortConfigurationDlg::OnBnClickedButtonProcessCancel() |
| | | { |
| | | int selPort = (0 <= m_nCurSelPort && m_nCurSelPort <= 3) ? m_nCurSelPort |
| | | : m_comboPort.GetCurSel(); |
| | | if (selPort < 0 || selPort >= 4) return; |
| | | m_pPort[selPort]->sendCassetteCtrlCmd(CCC_PROCESS_CANCEL, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | } |
| | |
| | | #include "afxdialogex.h" |
| | | #include "GridCtrl.h" |
| | | #include "CLoadPort.h" |
| | | #include "CCustomCheckBox.h" |
| | | |
| | | |
| | | // CPortConfigurationDlg å¯¹è¯æ¡ |
| | | |
| | |
| | | CPortConfigurationDlg(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CPortConfigurationDlg(); |
| | | |
| | | public: |
| | | void setCurSelPort(int sel); |
| | | BOOL IsCheckedAll(); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_DIALOG_PORT_CONFIGURATION }; |
| | |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg void OnSelchangeComboPort(); |
| | | afx_msg void OnBnClickedButtonApply(); |
| | | afx_msg LRESULT OnCheckAllClicked(WPARAM wParam, LPARAM lParam); |
| | | DECLARE_MESSAGE_MAP() |
| | | |
| | | private: |
| | | int GetLoadPortEqID(const std::string& strPortName); |
| | | void LoadPortConfigToUI(SERVO::CLoadPort* pPort); |
| | | void InitGrid(); |
| | | void FillGrid(); |
| | | |
| | | private: |
| | | SERVO::CLoadPort* m_pPort[4]; |
| | | int m_nCurSelPort; |
| | | |
| | | CGridCtrl m_wndGrid; |
| | | CComboBox m_comboPort; |
| | | CComboBox m_comboRecipe; |
| | | CComboBox m_comboMaterialsType; |
| | | |
| | | CCustomCheckBox* m_pCheckBox; |
| | | BOOL m_bCheckedAll; |
| | | |
| | | public: |
| | | afx_msg void OnDestroy(); |
| | | afx_msg void OnBnClickedButtonProcessStart(); |
| | | afx_msg void OnBnClickedButtonProcessCancel(); |
| | | }; |
| | |
| | | |
| | | CRecipeDeviceBindDlg::CRecipeDeviceBindDlg(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_DIALOG_RECIPE_DEVICE_BIND, pParent) |
| | | , m_strPPID(_T("")) |
| | | , m_strDesc(_T("")) |
| | | { |
| | | |
| | | } |
| | |
| | | { |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | const RecipeInfo& CRecipeDeviceBindDlg::GetRecipeInfo() const { |
| | | return m_recipe; |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::SetRecipeInfo(const RecipeInfo& info) |
| | | { |
| | | m_recipe = info; |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::ReleaseDeviceControls() |
| | | { |
| | | for (auto& ctrl : m_vecDevices) { |
| | | delete ctrl.editDeviceID; ctrl.editDeviceID = nullptr; |
| | | delete ctrl.editDeviceName; ctrl.editDeviceName = nullptr; |
| | | delete ctrl.comboRecipeID; ctrl.comboRecipeID = nullptr; |
| | | } |
| | | m_vecDevices.clear(); |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::CreateDeviceControls(int nXStart, int nYStart, int nTotalControlWidth, int nRowHeight) |
| | | { |
| | | for (size_t i = 0; i < g_vecBindDevices.size(); ++i) { |
| | | int y = nYStart + static_cast<int>(i) * nRowHeight; |
| | | auto* pEditID = new CEdit; |
| | | pEditID->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_CENTER, CRect(nXStart, y, nXStart + 100, y + 25), this, (UINT)(IDC_EDIT_DEVICEID_BASE + i)); |
| | | pEditID->SetFont(&m_font); |
| | | |
| | | auto* pEditName = new CEdit; |
| | | pEditName->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_CENTER, CRect(nXStart + 110, y, nXStart + 210, y + 25), this, (UINT)(IDC_EDIT_DEVICENAME_BASE + i)); |
| | | pEditName->SetFont(&m_font); |
| | | |
| | | auto* pCombo = new CComboBox; |
| | | pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, CRect(nXStart + 220, y, nXStart + nTotalControlWidth, y + 25), this, (UINT)(IDC_COMBO_RECIPEID_BASE + i)); |
| | | pCombo->SetFont(&m_font); |
| | | |
| | | m_vecDevices.push_back({ pEditID, pEditName, pCombo }); |
| | | } |
| | | } |
| | | |
| | | bool CRecipeDeviceBindDlg::FillComboRecipeList(CComboBox* pCombo, int nDeviceID, int nSelectedRecipeID) |
| | | { |
| | | auto& master = theApp.m_model.getMaster(); |
| | | auto* pEq = master.getEquipment(nDeviceID); |
| | | if (!pEq) { |
| | | return false; |
| | | } |
| | | |
| | | auto* pRecipeList = pEq->getRecipeList(0); |
| | | if (!pRecipeList) { |
| | | return false; |
| | | } |
| | | |
| | | auto& mapRecipeIds = pRecipeList->getIds(); |
| | | bool bFound = false; |
| | | pCombo->ResetContent(); |
| | | for (const auto& pair : mapRecipeIds) { |
| | | int nRecipeID = pair.second; |
| | | CString strRecipeName; |
| | | strRecipeName.Format(_T("%d"), nRecipeID); |
| | | int idx = pCombo->AddString(strRecipeName); |
| | | pCombo->SetItemData(idx, nRecipeID); |
| | | if (nSelectedRecipeID == nRecipeID) { |
| | | pCombo->SetCurSel(idx); |
| | | bFound = true; |
| | | } |
| | | } |
| | | |
| | | if (nSelectedRecipeID != -1 && !bFound) { |
| | | pCombo->SetCurSel(CB_ERR); |
| | | } |
| | | else if (pCombo->GetCount() > 0 && nSelectedRecipeID == -1) { |
| | | pCombo->SetCurSel(0); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | bool CRecipeDeviceBindDlg::FillDeviceInfo(int idx, int nDeviceID, const CString& strDeviceName, int nSelectedRecipeID) |
| | | { |
| | | if (idx < 0 || idx >= (int)m_vecDevices.size()) { |
| | | return false; |
| | | } |
| | | |
| | | auto& ctrl = m_vecDevices[idx]; |
| | | CString strID; |
| | | strID.Format(_T("%d"), nDeviceID); |
| | | ctrl.editDeviceID->SetWindowText(strID); |
| | | ctrl.editDeviceID->SetReadOnly(TRUE); |
| | | ctrl.editDeviceName->SetWindowText(strDeviceName); |
| | | ctrl.editDeviceName->SetReadOnly(TRUE); |
| | | |
| | | if (!FillComboRecipeList(ctrl.comboRecipeID, nDeviceID, nSelectedRecipeID)) { |
| | | CString str; |
| | | str.Format(_T("è®¾å¤ [%s] æå
¶é
æ¹åè¡¨æªæ¾å°ï¼è¯·æ£æ¥è®¾å¤é
ç½®"), strDeviceName.GetString()); |
| | | AfxMessageBox(str); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | DDX_Text(pDX, IDC_EDIT_PPID, m_strPPID); |
| | | DDX_Text(pDX, IDC_EDIT_DESC, m_strDesc); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CRecipeDeviceBindDlg, CDialogEx) |
| | | ON_WM_CLOSE() |
| | | ON_WM_SIZE() |
| | | ON_BN_CLICKED(IDOK, &CRecipeDeviceBindDlg::OnBnClickedOk) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | // 设置åºå®å¤§å°ï¼ä¾å¦ 600x400ï¼ |
| | | SetWindowPos(nullptr, 0, 0, 600, 400, SWP_NOMOVE | SWP_NOZORDER); |
| | | // è®¾ç½®å¯¹è¯æ¡æ é¢ |
| | | SetWindowText(m_recipe.vecDeviceList.empty() ? _T("æ°å»ºé
æ¹") : _T("ç¼è¾é
æ¹")); |
| | | |
| | | // å建æ§ä»¶ |
| | | const int totalControlWidth = 340; |
| | | CRect clientRect; |
| | | GetClientRect(&clientRect); |
| | | int xStart = (clientRect.Width() - totalControlWidth) / 2; |
| | | |
| | | const int nRowHeight = 30; |
| | | const int yStart = 30; // é¡¶é¨èµ·å§é«åº¦ |
| | | |
| | | const int nRowCount = static_cast<int>(g_vecBindDevices.size()); |
| | | for (int i = 0; i < nRowCount; ++i) { |
| | | int y = yStart + i * nRowHeight; |
| | | const auto& meta = g_vecBindDevices[i]; |
| | | |
| | | CEdit* pEditID = new CEdit(); |
| | | pEditID->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(xStart, y, xStart + 100, y + 25), this, IDC_EDIT_DEVICEID_BASE + i); |
| | | |
| | | CString strID; |
| | | strID.Format(_T("%d"), meta.nDeviceID); |
| | | pEditID->SetWindowText(strID); |
| | | pEditID->SetReadOnly(TRUE); // 设å¤IDåªè¯» |
| | | |
| | | CEdit* pEditName = new CEdit(); |
| | | pEditName->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(xStart + 110, y, xStart + 210, y + 25), this, IDC_EDIT_DEVICENAME_BASE + i); |
| | | pEditName->SetWindowText(CA2T(meta.strDeviceName)); |
| | | pEditName->SetReadOnly(TRUE); // 设å¤åç§°åªè¯» |
| | | |
| | | CComboBox* pCombo = new CComboBox(); |
| | | pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, CRect(xStart + 220, y, xStart + 340, y + 300), this, IDC_COMBO_RECIPEID_BASE + i); |
| | | |
| | | // æ·»å éé¡¹å° ComboBox |
| | | m_vecDevices.push_back({ pEditID, pEditName, pCombo }); |
| | | // åå»ºå¨ææ§ä»¶åä½ |
| | | if (!m_font.m_hObject) { |
| | | CFont* pDlgFont = GetFont(); |
| | | LOGFONT lf; |
| | | if (pDlgFont && pDlgFont->GetLogFont(&lf)) { |
| | | lf.lfHeight = -16; |
| | | m_font.CreateFontIndirect(&lf); |
| | | } |
| | | } |
| | | |
| | | // 计ç®åæ |
| | | CRect rDesc; |
| | | int nXStart = 30, nYStart = 30, nTotalControlWidth = 340; |
| | | if (auto* pWndDesc = GetDlgItem(IDC_STATIC_DESC)) { |
| | | pWndDesc->GetWindowRect(&rDesc); ScreenToClient(&rDesc); |
| | | nXStart = rDesc.left; |
| | | } |
| | | if (auto* pWndEdit = GetDlgItem(IDC_EDIT_DESC)) { |
| | | pWndEdit->GetWindowRect(&rDesc); ScreenToClient(&rDesc); |
| | | nYStart = rDesc.bottom + 20; |
| | | } |
| | | CRect rClient; GetClientRect(&rClient); |
| | | nTotalControlWidth = rClient.Width() - nXStart * 2; |
| | | const int nRowHeight = 30; |
| | | |
| | | // æ¸
ç©ºæ§æ§ä»¶ |
| | | ReleaseDeviceControls(); |
| | | |
| | | // åå»ºæ°æ§ä»¶ |
| | | CreateDeviceControls(nXStart, nYStart, nTotalControlWidth, nRowHeight); |
| | | |
| | | auto& master = theApp.m_model.getMaster(); |
| | | |
| | | // å¡«å
å
容 |
| | | if (m_recipe.vecDeviceList.empty()) { |
| | | // æ°å»º |
| | | for (size_t i = 0; i < g_vecBindDevices.size(); ++i) { |
| | | const auto& meta = g_vecBindDevices[i]; |
| | | FillDeviceInfo((int)i, meta.nDeviceID, meta.strDeviceName); |
| | | } |
| | | } |
| | | else { |
| | | // ç¼è¾ |
| | | m_strPPID = CA2T(m_recipe.strPPID.c_str()); |
| | | m_strDesc = CA2T(m_recipe.strDescription.c_str()); |
| | | UpdateData(FALSE); |
| | | |
| | | for (size_t i = 0; i < m_recipe.vecDeviceList.size() && i < m_vecDevices.size(); ++i) { |
| | | const auto& d = m_recipe.vecDeviceList[i]; |
| | | FillDeviceInfo((int)i, d.nDeviceID, d.strDeviceName.c_str(), d.nRecipeID); |
| | | } |
| | | } |
| | | |
| | | CenterWindow(); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | |
| | | CDialogEx::OnClose(); |
| | | |
| | | // æ¸
çæ§ä»¶ |
| | | for (auto& device : m_vecDevices) { |
| | | if (device.editDeviceID) { |
| | | device.editDeviceID->DestroyWindow(); |
| | | delete device.editDeviceID; |
| | | } |
| | | if (device.editDeviceName) { |
| | | device.editDeviceName->DestroyWindow(); |
| | | delete device.editDeviceName; |
| | | } |
| | | if (device.comboRecipeID) { |
| | | device.comboRecipeID->DestroyWindow(); |
| | | delete device.comboRecipeID; |
| | | } |
| | | } |
| | | m_vecDevices.clear(); |
| | | ReleaseDeviceControls(); |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::OnSize(UINT nType, int cx, int cy) |
| | |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | |
| | | // TODO: 卿¤å¤æ·»å æ¶æ¯å¤çç¨åºä»£ç |
| | | } |
| | | } |
| | | |
| | | void CRecipeDeviceBindDlg::OnBnClickedOk() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | UpdateData(TRUE); |
| | | |
| | | // æ¶éææè®¾å¤æ å° |
| | | m_recipe.vecDeviceList.clear(); |
| | | for (const auto& dev : m_vecDevices) { |
| | | DeviceRecipe info; |
| | | CString strID, strName; |
| | | dev.editDeviceID->GetWindowText(strID); |
| | | dev.editDeviceName->GetWindowText(strName); |
| | | |
| | | int sel = dev.comboRecipeID->GetCurSel(); |
| | | info.nRecipeID = -1; |
| | | if (sel != CB_ERR) { |
| | | info.nRecipeID = (int)dev.comboRecipeID->GetItemData(sel); |
| | | } |
| | | info.nDeviceID = _ttoi(strID); |
| | | info.strDeviceName = CT2A(strName); |
| | | |
| | | m_recipe.vecDeviceList.push_back(info); |
| | | } |
| | | |
| | | // æ£æ¥ PPID æ¯å¦ä¸ºç©º |
| | | if (m_strPPID.IsEmpty()) { |
| | | AfxMessageBox(_T("é
æ¹ PPID ä¸è½ä¸ºç©º")); |
| | | return; |
| | | } |
| | | |
| | | // PPIDåæè¿° |
| | | m_recipe.strPPID = CT2A(m_strPPID); |
| | | m_recipe.strDescription = CT2A(m_strDesc); |
| | | |
| | | CDialogEx::OnOK(); |
| | | } |
| | |
| | | #pragma once |
| | | #include "afxdialogex.h" |
| | | |
| | | #include "RecipeManager.h" |
| | | |
| | | // CRecipeDeviceBindDlg å¯¹è¯æ¡ |
| | | |
| | |
| | | CRecipeDeviceBindDlg(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CRecipeDeviceBindDlg(); |
| | | |
| | | const RecipeInfo& GetRecipeInfo() const; |
| | | void SetRecipeInfo(const RecipeInfo& info); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_DIALOG_RECIPE_DEVICE_BIND }; |
| | |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg void OnClose(); |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnBnClickedOk(); |
| | | DECLARE_MESSAGE_MAP() |
| | | |
| | | private: |
| | | void ReleaseDeviceControls(); |
| | | void CreateDeviceControls(int nXStart, int nYStart, int nTotalControlWidth, int nRowHeight); |
| | | bool FillDeviceInfo(int idx, int nDeviceID, const CString& strDeviceName, int nSelectedRecipeID = -1); |
| | | bool FillComboRecipeList(CComboBox* pCombo, int nDeviceID, int nSelectedRecipeID = -1); |
| | | |
| | | struct DeviceWidget { |
| | | CEdit* editDeviceID; |
| | | CEdit* editDeviceName; |
| | | CComboBox* comboRecipeID; |
| | | }; |
| | | |
| | | CFont m_font; |
| | | CString m_strPPID; |
| | | CString m_strDesc; |
| | | RecipeInfo m_recipe; |
| | | std::vector<DeviceWidget> m_vecDevices; |
| | | }; |
| | |
| | | |
| | | for (const auto& dev : devs) { |
| | | DeviceRecipe dr; |
| | | dr.strPPID = info.strPPID; |
| | | try { |
| | | dr.nDeviceID = std::stoi(dev[0]); |
| | | dr.strDeviceName = dev[1]; |
| | |
| | | auto devs = m_pDB->fetchResults("SELECT device_id, device_name, recipe_id FROM recipe_devices WHERE ppid = '" + ppid + "';"); |
| | | for (const auto& dev : devs) { |
| | | DeviceRecipe dr; |
| | | dr.strPPID = ppid; |
| | | try { |
| | | dr.nDeviceID = std::stoi(dev[0]); |
| | | dr.strDeviceName = dev[1]; |
| | |
| | | recipe.strDescription = "Main Board Burn-in"; |
| | | |
| | | recipe.vecDeviceList = { |
| | | {1, 101, "P1001","Burner A"}, |
| | | {2, 102, "P1001", "Burner B"} |
| | | {1, 101, "Burner A"}, |
| | | {2, 102, "Burner B"} |
| | | }; |
| | | |
| | | addRecipe(recipe); |
| | |
| | | std::getline(ss, description, ','); |
| | | std::getline(ss, createTime, ','); |
| | | |
| | | dev.strPPID = ppid; |
| | | auto& recipe = recipeMap[ppid]; |
| | | recipe.strPPID = ppid; |
| | | recipe.strDescription = description; |
| | |
| | | // å个设å¤é
æ¹æ å°ä¿¡æ¯ |
| | | struct DeviceRecipe { |
| | | int nDeviceID; // 设å¤ID |
| | | int nRecipeID; // 该设å¤å¯¹åºçåé
æ¹ID |
| | | std::string strPPID; // é
æ¹IDï¼ä¸»é®ï¼ |
| | | int nRecipeID; // åé
æ¹ID |
| | | std::string strDeviceName; // 设å¤åç§° |
| | | }; |
| | | |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClInclude Include="CBaseDlg.h" /> |
| | | <ClInclude Include="CCustomCheckBox.h" /> |
| | | <ClInclude Include="CEquipmentPage3.h" /> |
| | | <ClInclude Include="CGlassPool.h" /> |
| | | <ClInclude Include="ChangePasswordDlg.h" /> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClCompile Include="CBaseDlg.cpp" /> |
| | | <ClCompile Include="CCustomCheckBox.cpp" /> |
| | | <ClCompile Include="CEquipmentPage3.cpp" /> |
| | | <ClCompile Include="CGlassPool.cpp" /> |
| | | <ClCompile Include="ChangePasswordDlg.cpp" /> |
| | |
| | | <ClCompile Include="InputDialog.cpp" /> |
| | | <ClCompile Include="RecipeManager.cpp" /> |
| | | <ClCompile Include="RecipeDeviceBindDlg.cpp" /> |
| | | <ClCompile Include="CCustomCheckBox.cpp" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClInclude Include="AlarmManager.h" /> |
| | |
| | | <ClInclude Include="InputDialog.h" /> |
| | | <ClInclude Include="RecipeManager.h" /> |
| | | <ClInclude Include="RecipeDeviceBindDlg.h" /> |
| | | <ClInclude Include="CCustomCheckBox.h" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ResourceCompile Include="Servo.rc" /> |
| | |
| | | } \ |
| | | } |
| | | |
| | | #define CHECK_RUN_ACTIVE_ROBOT_TASK(art) { \ |
| | | if (art != nullptr) { \ |
| | | art->pick(); \ |
| | | std::string strDescription = art->getDescription(); \ |
| | | unlock(); \ |
| | | if (m_listener.onRobotTaskEvent != nullptr) { \ |
| | | m_listener.onRobotTaskEvent(this, art, ROBOT_EVENT_CREATE); \ |
| | | } \ |
| | | LOGI("å建æ°ä»»å¡<%s>...", strDescription.c_str()); \ |
| | | continue; \ |
| | | } \ |
| | | } |
| | | |
| | | namespace SERVO { |
| | | #define BLOCK_BUFFER_MAX 1024 |
| | | #define ALIVE_TIMEOUT 15 |
| | |
| | | /* EQ Data changed code */ |
| | | #define EDCC_FETCHOUT_JOB 1000 /* ȡƬ */ |
| | | #define EDCC_STORED_JOB 1001 /* æ¾ç */ |
| | | |
| | | |
| | | /* Cassette Ctrl CMD */ |
| | | #define CCC_MAP_DOWNLOAD 1 |
| | | #define CCC_CLAMP 2 |
| | | #define CCC_UNCLAMP 3 |
| | | #define CCC_RECLAMP 4 |
| | | #define CCC_PROCESS_START 5 |
| | | #define CCC_PROCESS_START_BY_COUNT 6 |
| | | #define CCC_PROCESS_PAUSE 7 |
| | | #define CCC_PROCESS_RESUME 8 |
| | | #define CCC_PROCESS_ABORT 9 |
| | | #define CCC_PROCESS_CANCEL 10 |
| | | #define CCC_PROCESS_END 11 |
| | | #define CCC_ID_UPDATE 12 |
| | | #define CCC_MAP_UPDATE 13 |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | else if (RX_CODE_LOADPORT_INUSE == code) { |
| | | SERVO::CLoadPort* pLoadPort = nullptr; |
| | | if (pAny->getPtrValue("ptr", (void*&)pLoadPort)) { |
| | | //CPortConfigurationDlg dlg; |
| | | //dlg.setCurSelPort(pLoadPort->getIndex()); |
| | | //dlg.DoModal(); |
| | | } |
| | | } |
| | | |
| | | pAny->release(); |
| | | }, [&]() -> void { |