1.将Port的配置数据从.dat文件驳离到ini文件中。
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | /* |
| | | * 生成测试用的玻璃列表 |
| | | */ |
| | |
| | | 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); |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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); } |
| | |
| | | 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()); |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | IObservable* getObservable(); |
| | | SERVO::CMaster& getMaster(); |
| | | void setWorkDir(const char* pszWorkDir); |
| | | void loadPortParams(); |
| | | int init(); |
| | | int term(); |
| | | |
| | |
| | | |
| | | // 相当于延时调用master的初始化 |
| | | theApp.m_model.m_master.init(); |
| | | theApp.m_model.loadPortParams(); |
| | | |
| | | |
| | | // 初始化master以后需要控件绑定数据 |