mrDarker
2025-07-23 5a66d26a2899a2450a50f00d09c728ae151715be
Merge branch 'clh' into liuyang

# Conflicts:
# SourceCode/Bond/Servo/PortConfigurationDlg.cpp
# SourceCode/Bond/Servo/PortConfigurationDlg.h
# SourceCode/Bond/Servo/Servo.rc
# SourceCode/Bond/Servo/resource.h
已添加2个文件
已修改28个文件
636 ■■■■ 文件已修改
SourceCode/Bond/Servo/CCustomCheckBox.cpp 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCustomCheckBox.h 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CGlass.cpp 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CGlass.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.h 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.h 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageGraph2.cpp 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.cpp 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPortStatusReport.cpp 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPortStatusReport.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CRobotTask.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CRobotTask.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CRobotTaskDlg.cpp 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Common.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Configuration.cpp 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Configuration.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.cpp 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PortConfigurationDlg.cpp 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PortConfigurationDlg.h 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj.filters 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoCommo.h 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCustomCheckBox.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
#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();
}
SourceCode/Bond/Servo/CCustomCheckBox.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
#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;
};
SourceCode/Bond/Servo/CEquipment.cpp
@@ -1318,6 +1318,7 @@
            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]
@@ -1370,6 +1371,7 @@
            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]
SourceCode/Bond/Servo/CEquipment.h
@@ -55,6 +55,7 @@
    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;
@@ -66,6 +67,8 @@
        ONPRESTOREDJOB        onPreStoredJob;
        ONPROCESSSTATE        onProcessStateChanged;
        ONMAPMISMATCH        onMapMismatch;
        ONPORTINUSE            onPortInUse;
    } EquipmentListener;
SourceCode/Bond/Servo/CGlass.cpp
@@ -10,6 +10,7 @@
        m_pBuddy = nullptr;
        m_nOriginPort = 0;
        m_nOriginSlot = 0;
        m_bScheduledForProcessing = FALSE;
    }
    CGlass::~CGlass()
@@ -80,6 +81,16 @@
        slot = m_nOriginSlot;
    }
    BOOL CGlass::isScheduledForProcessing()
    {
        return m_bScheduledForProcessing;
    }
    void CGlass::setScheduledForProcessing(BOOL bProcessing)
    {
        m_bScheduledForProcessing = bProcessing;
    }
    CPath* CGlass::getPath()
    {
        return m_pPath;
@@ -119,6 +130,7 @@
            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);
@@ -141,6 +153,7 @@
            ReadString(ar, m_strID);
            ar >> m_nOriginPort;
            ar >> m_nOriginSlot;
            ar >> m_bScheduledForProcessing;
            ar >> ullPath;
            if (ullPath != 0) {
                m_pPath = new CPath();
SourceCode/Bond/Servo/CGlass.h
@@ -26,6 +26,8 @@
        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);
@@ -51,6 +53,7 @@
        std::string m_strBuddyId;
        int m_nOriginPort;
        int m_nOriginSlot;
        BOOL m_bScheduledForProcessing;            /* æ˜¯å¦å°†åŠ å·¥å¤„ç† */
    };
}
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -16,6 +16,7 @@
        m_bEnable = FALSE;
        m_bAutoChangeEnable = FALSE;
        m_nNextCassetteSequenceNo = 0;
        m_isCompareMapsBeforeProceeding = FALSE;
    }
    CLoadPort::~CLoadPort()
@@ -134,7 +135,7 @@
            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;
                });
@@ -347,6 +348,23 @@
    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)
@@ -887,17 +905,27 @@
        // å½“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());
                }
            }
        }
@@ -1011,6 +1039,7 @@
    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) {
@@ -1023,7 +1052,6 @@
            // test
            code = WOK;
            if (code == WOK) {
                m_cassetteType = type;
                LOGI("<CLoadPort-%d>设置Cassette Type成功.", m_nIndex);
            }
            else {
@@ -1126,15 +1154,15 @@
        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;
    }
@@ -1176,6 +1204,47 @@
        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];
@@ -1215,4 +1284,9 @@
        return 0;
    }
    void CLoadPort::setCompareMapsBeforeProceeding(BOOL bCompare)
    {
        m_isCompareMapsBeforeProceeding = bCompare;
    }
}
SourceCode/Bond/Servo/CLoadPort.h
@@ -37,7 +37,8 @@
        void localSetCessetteType(CassetteType type);
        void localSetTransferMode(TransferMode mode);
        void localAutoChangeEnable(BOOL bEnable);
        short getCassetteMap();
        short getScanCassetteMap();
        short getDownloadCassetteMap();
    public:
        short getNextCassetteSequenceNo();
@@ -57,6 +58,7 @@
        int getCassetteMappingState();
        int getCassetteStatus();
        int testGenerateGlassList(MaterialsType type);
        int generateGlassList(short map);
        int testGenerateGlassListFromConfig(const SERVO::PortConfig& config);
    public:
@@ -80,6 +82,7 @@
            CJobDataA* pJobDataA,
            ONWRITED onWritedBlock);
        CStep* getCassetteCtrlCmdStep();
        void setCompareMapsBeforeProceeding(BOOL bCompare);
    private:
        int decodePortStatusReport(CStep* pStep, const char* pszData, size_t size);
@@ -94,6 +97,9 @@
        BOOL m_bAutoChangeEnable;
        CPortStatusReport m_portStatusReport;
        int m_nNextCassetteSequenceNo;
        // åœ¨å¼€å§‹å·¥è‰ºå‰æ˜¯å¦å…ˆéœ€è¦å…ˆæ¯”较map
        BOOL m_isCompareMapsBeforeProceeding;
    };
}
SourceCode/Bond/Servo/CMaster.cpp
@@ -51,6 +51,7 @@
        m_state = MASTERSTATE::READY;
        m_pActiveRobotTask = nullptr;
        m_nLastError = 0;
        m_isCompareMapsBeforeProceeding = FALSE;
        InitializeCriticalSection(&m_criticalSection);
    }
@@ -1016,6 +1017,12 @@
            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);
@@ -1053,6 +1060,7 @@
        pEquipment->setID(EQ_ID_LOADPORT1 + index);
        pEquipment->setName(szName);
        pEquipment->setDescription(szName);
        pEquipment->setCompareMapsBeforeProceeding(m_isCompareMapsBeforeProceeding);
        addToEquipmentList(pEquipment);
@@ -1567,7 +1575,8 @@
        unlock();
        // å½“前任务手动中止后,停止调度,需要操作员在解决问题后,重新启动
        stop();
        // 25å¹´7月23日后修改为不停止任务
        // stop();
        return 0;
    }
@@ -1577,6 +1586,18 @@
        lock();
        if (m_pActiveRobotTask != nullptr) {
            m_pActiveRobotTask->restore();
        }
        unlock();
        return 0;
    }
    int CMaster::resendCurrentTask()
    {
        lock();
        if (m_pActiveRobotTask != nullptr) {
            m_pActiveRobotTask->resend();
        }
        unlock();
@@ -1597,4 +1618,17 @@
        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;
    }
}
SourceCode/Bond/Servo/CMaster.h
@@ -31,6 +31,7 @@
    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;
@@ -40,6 +41,7 @@
        ONEQVCREVENTREPORT        onEqVcrEventReport;
        ONEQDATACHANGED         onEqDataChanged;
        ONROBOTTASKEVENT        onRobotTaskEvent;
        ONLOADPORTINUSE            onLoadPortInUse;
    } MasterListener;
    class CMaster
@@ -67,8 +69,11 @@
        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); }
@@ -130,6 +135,9 @@
        // é”™è¯¯ä»£ç 
        int m_nLastError;
        std::string m_strLastError;
        // åœ¨å¼€å§‹å·¥è‰ºå‰æ˜¯å¦å…ˆéœ€è¦å…ˆæ¯”较map
        BOOL m_isCompareMapsBeforeProceeding;
    };
}
SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -212,30 +212,7 @@
        // æµ‹è¯•
        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;
SourceCode/Bond/Servo/CPagePortProperty.cpp
@@ -280,6 +280,13 @@
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);
@@ -322,6 +329,7 @@
    msgDlg.DoModal();
    g_nMsgDlgShow = 1;
    */
}
void CPagePortProperty::OnCbnSelchangeComboPortTransferMode()
SourceCode/Bond/Servo/CPortStatusReport.cpp
@@ -51,6 +51,11 @@
        return m_nPortStatus;
    }
    void CPortStatusReport::setPortStatus(short status)
    {
        m_nPortStatus = status;
    }
    short CPortStatusReport::getCassetteSequenceNo()
    {
        return m_nCassetteSequenceNo;
@@ -146,7 +151,7 @@
        memcpy(&m_nCassetteStatus, &pszBuffer[index], sizeof(short));
        index += sizeof(short);
        return 15 * 2;
        return 32 * 2;
    }
    void CPortStatusReport::getAttributeVector(CAttributeVector& attrubutes, int beginWeight)
@@ -242,6 +247,11 @@
        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();
SourceCode/Bond/Servo/CPortStatusReport.h
@@ -14,6 +14,7 @@
    public:
        void copyEx(CPortStatusReport& other);
        short getPortStatus();
        void setPortStatus(short status);
        short getCassetteSequenceNo();
        std::string& getCassetteId();
        short getLoadingCassetteType();
@@ -29,6 +30,7 @@
        bool canPickFromPort();
        bool isJobExistenceSlot();
        short getJobExistenceSlot();
        void setJobExistenceSlot(short map);
    private:
        void WriteString(CArchive& ar, std::string& string);
SourceCode/Bond/Servo/CRobotTask.cpp
@@ -286,6 +286,17 @@
            });
    }
    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;
SourceCode/Bond/Servo/CRobotTask.h
@@ -41,6 +41,7 @@
        void place();
        void restore();
        void restored();
        void resend();
        void completed();
        void error();
        void abort();
SourceCode/Bond/Servo/CRobotTaskDlg.cpp
@@ -103,7 +103,7 @@
    // 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) {
@@ -216,10 +216,11 @@
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();
}
SourceCode/Bond/Servo/Common.h
@@ -18,6 +18,7 @@
#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 */
SourceCode/Bond/Servo/Configuration.cpp
@@ -136,3 +136,18 @@
    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);
}
SourceCode/Bond/Servo/Configuration.h
@@ -24,6 +24,8 @@
    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);
SourceCode/Bond/Servo/Model.cpp
@@ -52,6 +52,12 @@
    }
}
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;
@@ -274,6 +280,10 @@
        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);
@@ -281,7 +291,7 @@
    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();
SourceCode/Bond/Servo/Model.h
@@ -15,6 +15,7 @@
    SERVO::CMaster& getMaster();
    void setWorkDir(const char* pszWorkDir);
    void loadPortParams();
    void setPortCassetteType(unsigned int index, SERVO::CassetteType type);
    int init();
    int term();
SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -12,6 +12,9 @@
#include "ServoCommo.h"
#define CHECKBOX_ALL_ID        0x1234
// CPortConfigurationDlg å¯¹è¯æ¡†
IMPLEMENT_DYNAMIC(CPortConfigurationDlg, CDialogEx)
@@ -24,10 +27,18 @@
    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)
@@ -50,24 +61,42 @@
    SetDlgItemText(IDC_EDIT_OPERATIONID, "");
    m_comboMaterialsType.SetCurSel(0);
    SERVO::CSlot* pSlot = pPort->getSlot(0);
    if (pSlot == nullptr) {
        return;
    }
    bool bJobInfoSet = false;
    for (int i = 0; i < SLOT_MAX; ++i) {
        SERVO::CSlot* pSlot = pPort->getSlot(i);
        if (!pSlot) {
            continue;
        }
    SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
    if (pGlass != nullptr) {
        SERVO::CJobDataS* pJS = pGlass->getJobDataS();
        if (pJS) {
            SetDlgItemText(IDC_EDIT_LOTID, CString(pJS->getLotId().c_str()));
            SetDlgItemText(IDC_EDIT_PRODUCTID, CString(pJS->getProductId().c_str()));
            SetDlgItemText(IDC_EDIT_OPERATIONID, CString(pJS->getOperationId().c_str()));
            m_comboMaterialsType.SetCurSel(pJS->getMaterialsType() - 1);
        // è®¾ç½® Panel ID å’Œå‹¾é€‰æ¡†
        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());
        }
        m_wndGrid.SetItemData(nRow, 0, (LPARAM)pGlass);
        // å›žå¡« Job ä¿¡æ¯ï¼ˆåªå–第一个有效 Glass)
        if (!bJobInfoSet && pGlass) {
            SERVO::CJobDataS* pJS = pGlass->getJobDataS();
            if (pJS) {
                SetDlgItemText(IDC_EDIT_LOTID, CString(pJS->getLotId().c_str()));
                SetDlgItemText(IDC_EDIT_PRODUCTID, CString(pJS->getProductId().c_str()));
                SetDlgItemText(IDC_EDIT_OPERATIONID, CString(pJS->getOperationId().c_str()));
                m_comboMaterialsType.SetCurSel(pJS->getMaterialsType() - 1);
                bJobInfoSet = true;
            }
        }
    }
    // å¡«å…… Grid
    FillGrid(pSlot, pGlass);
    m_pCheckBox->SetCheck(IsCheckedAll() ? BST_CHECKED : BST_UNCHECKED);
}
void CPortConfigurationDlg::InitGrid()
@@ -100,7 +129,8 @@
    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);
@@ -123,46 +153,17 @@
    for (int i = 0; i < nRows; ++i) {
        m_wndGrid.SetRowHeight(i, nEachRowHeight);
    }
}
void CPortConfigurationDlg::FillGrid(SERVO::CSlot* pSlot, SERVO::CGlass* pGlass)
{
    //CStringArray recipeOptions;
    //recipeOptions.Add(_T("Recipe A"));
    //recipeOptions.Add(_T("Recipe B"));
    //recipeOptions.Add(_T("Recipe C"));
    // åŽ»é™¤è¡¨å¤´ï¼Œä»Žç¬¬2行开始填充数据
    for (int i = 1; i < SLOT_MAX + 1; ++i) {
        CString strIndex;
        strIndex.Format(_T("%d"), i);
        m_wndGrid.SetItemText(i, 0, strIndex);
        m_wndGrid.SetItemState(i, 0, GVIS_READONLY);
        if (i != 3) {
            // Checkbox
            m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellCheck));
            CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
            if (pCheck) {
                // è®¾ç½® Panel ID å’Œå‹¾é€‰æ¡†
                CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
                if (pCheck && pSlot && pGlass) {
                    pCheck->SetCheck(pSlot->isEnable() ? TRUE : FALSE);
                    pCheck->SetText(pGlass ? pGlass->getID().c_str() : _T(""));
                }
                else {
                    pCheck->SetCheck(FALSE);
                    pCheck->SetText(_T(""));
                }
            }
        }
        else {
            m_wndGrid.SetItemState(i, 1, GVIS_READONLY);
        }
    }
    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)
@@ -178,6 +179,10 @@
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()
@@ -193,7 +198,13 @@
    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();
@@ -214,7 +225,21 @@
    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
@@ -287,35 +312,76 @@
    }
    // èŽ·å– 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);
        }
        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);
}
SourceCode/Bond/Servo/PortConfigurationDlg.h
@@ -2,6 +2,8 @@
#include "afxdialogex.h"
#include "GridCtrl.h"
#include "CLoadPort.h"
#include "CCustomCheckBox.h"
// CPortConfigurationDlg å¯¹è¯æ¡†
@@ -13,6 +15,10 @@
    CPortConfigurationDlg(CWnd* pParent = nullptr);   // æ ‡å‡†æž„造函数
    virtual ~CPortConfigurationDlg();
public:
    void setCurSelPort(int sel);
    BOOL IsCheckedAll();
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_DIALOG_PORT_CONFIGURATION };
@@ -23,18 +29,28 @@
    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(SERVO::CSlot* pSlot, SERVO::CGlass* pGlass);
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();
};
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -200,6 +200,7 @@
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="CBaseDlg.h" />
    <ClInclude Include="CCustomCheckBox.h" />
    <ClInclude Include="CEquipmentPage3.h" />
    <ClInclude Include="CGlassPool.h" />
    <ClInclude Include="ChangePasswordDlg.h" />
@@ -342,6 +343,7 @@
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="CBaseDlg.cpp" />
    <ClCompile Include="CCustomCheckBox.cpp" />
    <ClCompile Include="CEquipmentPage3.cpp" />
    <ClCompile Include="CGlassPool.cpp" />
    <ClCompile Include="ChangePasswordDlg.cpp" />
SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -169,6 +169,7 @@
    <ClCompile Include="InputDialog.cpp" />
    <ClCompile Include="RecipeManager.cpp" />
    <ClCompile Include="RecipeDeviceBindDlg.cpp" />
    <ClCompile Include="CCustomCheckBox.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="AlarmManager.h" />
@@ -343,6 +344,7 @@
    <ClInclude Include="InputDialog.h" />
    <ClInclude Include="RecipeManager.h" />
    <ClInclude Include="RecipeDeviceBindDlg.h" />
    <ClInclude Include="CCustomCheckBox.h" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Servo.rc" />
SourceCode/Bond/Servo/ServoCommo.h
@@ -209,5 +209,21 @@
    /* 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
}
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -241,6 +241,14 @@
                    }
                }
            }
            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 {
SourceCode/Bond/Servo/resource.h
Binary files differ