LAPTOP-SNT8I5JK\Boounion
2025-06-13 f6e82f09bb6fb4727da61366c195cb99f3474e49
1.将Port的配置数据从.dat文件驳离到ini文件中。
已修改10个文件
116 ■■■■ 文件已修改
SourceCode/Bond/Servo/CLoadPort.cpp 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Configuration.cpp 22 ●●●●● 补丁 | 查看 | 原始文档 | 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/ServoDlg.cpp 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -378,23 +378,23 @@
        if (ar.IsStoring()) {
            ar << m_nIndex;
            ar << (int)m_portType;
            ar << (int)m_portMode;
            ar << (int)m_cassetteType;
            ar << (int)m_transferMode;
            ar << m_bEnable;
            ar << m_bAutoChangeEnable;
            //ar << (int)m_portType;
            //ar << (int)m_portMode;
            //ar << (int)m_cassetteType;
            //ar << (int)m_transferMode;
            //ar << m_bEnable;
            //ar << m_bAutoChangeEnable;
            m_portStatusReport.serialize(ar);
        }
        else {
            int temp;
            ar >> m_nIndex;
            ar >> temp; m_portType = (PortType)temp;
            ar >> temp; m_portMode = (PortMode)temp;
            ar >> temp; m_cassetteType = (CassetteType)temp;
            ar >> temp; m_transferMode = (TransferMode)temp;
            ar >> m_bEnable;
            ar >> m_bAutoChangeEnable;
            //ar >> temp; m_portType = (PortType)temp;
            //ar >> temp; m_portMode = (PortMode)temp;
            //ar >> temp; m_cassetteType = (CassetteType)temp;
            //ar >> temp; m_transferMode = (TransferMode)temp;
            //ar >> m_bEnable;
            //ar >> m_bAutoChangeEnable;
            m_portStatusReport.serialize(ar);
        }
    }
@@ -1077,6 +1077,36 @@
        return 0;
    }
    void CLoadPort::localEanblePort(BOOL bEnable)
    {
        m_bEnable = bEnable;
    }
    void CLoadPort::localSetPortType(PortType type)
    {
        m_portType = type;
    }
    void CLoadPort::localSetPortMode(PortMode mode)
    {
        m_portMode = mode;
    }
    void CLoadPort::localSetCessetteType(CassetteType type)
    {
        m_cassetteType = type;
    }
    void CLoadPort::localSetTransferMode(TransferMode mode)
    {
        m_transferMode = mode;
    }
    void CLoadPort::localAutoChangeEnable(BOOL bEnable)
    {
        m_bAutoChangeEnable = bEnable;
    }
    /*
     * 生成测试用的玻璃列表
     */
SourceCode/Bond/Servo/CLoadPort.h
@@ -31,6 +31,12 @@
        int setCassetteType(CassetteType type, ONWRITED onWritedBlock = nullptr);
        int setTransferMode(TransferMode mode, ONWRITED onWritedBlock = nullptr);
        int eableAutoChange(BOOL bEnable, ONWRITED onWritedBlock = nullptr);
        void localEanblePort(BOOL bEnable);
        void localSetPortType(PortType type);
        void localSetPortMode(PortMode mode);
        void localSetCessetteType(CassetteType type);
        void localSetTransferMode(TransferMode mode);
        void localAutoChangeEnable(BOOL bEnable);
    public:
        void setIndex(unsigned int index);
SourceCode/Bond/Servo/CMaster.cpp
@@ -1338,4 +1338,18 @@
        return 0;
    }
    void CMaster::setPortType(unsigned int index, BOOL enable, int type, int mode,
        int cassetteType, int transferMode, BOOL autoChangeEnable)
    {
        ASSERT(index < 4);
        int eqid[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4};
        CLoadPort* pPort = (CLoadPort*)getEquipment(eqid[index]);
        pPort->localEanblePort(enable);
        pPort->localSetPortType((SERVO::PortType)type);
        pPort->localSetPortMode((SERVO::PortMode)mode);
        pPort->localSetCessetteType((SERVO::CassetteType)cassetteType);
        pPort->localSetTransferMode((SERVO::TransferMode)transferMode);
        pPort->localAutoChangeEnable(autoChangeEnable);
    }
}
SourceCode/Bond/Servo/CMaster.h
@@ -64,6 +64,8 @@
        CEquipment* getEquipment(int id);
        void setCacheFilepath(const char* pszFilepath);
        int abortCurrentTask();
        void setPortType(unsigned int index, BOOL enable, int type, int mode,
            int cassetteType, int transferMode, BOOL autoChangeEnable);
    private:
        inline void lock() { EnterCriticalSection(&m_criticalSection); }
SourceCode/Bond/Servo/CPagePortProperty.cpp
@@ -57,7 +57,7 @@
    CComboBox* pComboBox;
    std::string strTemp;
    ((CButton*)GetDlgItem(IDC_CHECK_ENABLE))->SetCheck(m_pPort->isEnable() ? BST_CHECKED : BST_UNCHECKED);
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_TYPE);
    for (int i = 1; i <= 7; i++) {
        pComboBox->InsertString(i - 1, SERVO::CLoadPort::getPortTypeDescription((SERVO::PortType)i, strTemp).c_str());
SourceCode/Bond/Servo/Configuration.cpp
@@ -103,3 +103,25 @@
        std::to_string(second).c_str(), m_strFilepath);
}
BOOL CConfiguration::getPortParms(unsigned int index, BOOL& bEnable, int& type, int& mode,
    int& cassetteType, int& transferMode, BOOL& bAutoChangeEnable)
{
    if (index >= 4) return FALSE;
    static char* pszSection[] = {"Port1", "Port2", "Port3", "Port4"};
    bEnable = GetPrivateProfileInt(pszSection[index], _T("Enable"), 0, m_strFilepath) == 1;
    type = GetPrivateProfileInt(pszSection[index], _T("Type"), 0, m_strFilepath);
    mode = GetPrivateProfileInt(pszSection[index], _T("Mode"), 0, m_strFilepath);
    cassetteType = GetPrivateProfileInt(pszSection[index], _T("CassetteType"), 0, m_strFilepath);
    transferMode = GetPrivateProfileInt(pszSection[index], _T("TransferMode"), 0, m_strFilepath);
    bAutoChangeEnable = GetPrivateProfileInt(pszSection[index], _T("AutoChangeEnable"), 0, m_strFilepath) == 1;
    // type, mode, cassetteType, transferMode 范围检查
    type = max(1, min(type, 7));
    mode = max(0, min(mode, 5));
    cassetteType = max(1, min(cassetteType, 3));
    transferMode = max(1, min(transferMode, 3));
    return TRUE;
}
SourceCode/Bond/Servo/Configuration.h
@@ -20,6 +20,8 @@
    void setLogcatIncludeRegex(BOOL bRegex);
    BOOL isLogcatIncludeRegex();
    int getCustomLogcatIncludeTexts(std::vector<std::string>& texts);
    BOOL getPortParms(unsigned int index, BOOL& bEnable, int& type, int& mode,
        int& cassetteType, int& transferMode, BOOL& bAutoChangeEnable);
public:
    void setP2RemoteEqReconnectInterval(int second);
SourceCode/Bond/Servo/Model.cpp
@@ -40,6 +40,18 @@
    m_strWorkDir = pszWorkDir;
}
void CModel::loadPortParams()
{
    BOOL portEnable, autoChangeEnable;
    int portType, portMode, cassetteType, transferMode;
    for (int i = 0; i < 4; i++) {
        m_configuration.getPortParms(i, portEnable, portType, portMode,
            cassetteType, transferMode, autoChangeEnable);
        m_master.setPortType(i, portEnable, portType, portMode, cassetteType,
            transferMode, autoChangeEnable);
    }
}
int CModel::init()
{
    CString strIniFile;
SourceCode/Bond/Servo/Model.h
@@ -14,6 +14,7 @@
    IObservable* getObservable();
    SERVO::CMaster& getMaster();
    void setWorkDir(const char* pszWorkDir);
    void loadPortParams();
    int init();
    int term();
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -349,6 +349,7 @@
    // 相当于延时调用master的初始化
    theApp.m_model.m_master.init();
    theApp.m_model.loadPortParams();
    // 初始化master以后需要控件绑定数据