| | |
| | | SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj.user |
| | | SourceCode/Bond/x64/Debug/ServoConfiguration.ini |
| | | *.iobj |
| | | SourceCode/Bond/x64/Debug/Backups/ |
| | |
| | | |
| | | CEquipment::CEquipment() : m_nID(0), m_strName(""), m_strDescription(""), m_station(0, 255) |
| | | { |
| | | m_listener = { nullptr, nullptr }; |
| | | m_listener = { nullptr, nullptr, nullptr }; |
| | | m_alive = {FALSE, 0, FALSE}; |
| | | m_bCimState = FALSE; |
| | | m_bUpstreamInline = FALSE; |
| | |
| | | { |
| | | m_listener.onAlive = listener.onAlive; |
| | | m_listener.onCimStateChanged = listener.onCimStateChanged; |
| | | m_listener.onDataChanged = listener.onDataChanged; |
| | | } |
| | | |
| | | void CEquipment::setCcLink(CCCLinkIEControl* pCcLink) |
| | |
| | | else if (nRet == FLOW_ACCEPT) { |
| | | m_glassList.pop_front(); |
| | | pContext->release(); // 添加到列队时addRef, 取出时release |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | } |
| | | |
| | | pContext->release(); |
| | |
| | | pGlass->addRef(); |
| | | m_glassList.push_back(pGlass); |
| | | Unlock(); |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | |
| | | pGlass->addRef(); |
| | | m_glassList.push_back(pGlass); |
| | | Unlock(); |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | } |
| | | } |
| | |
| | | #define VCR_MAX 1 |
| | | |
| | | typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE; |
| | | typedef std::function<void(void* pEiuipment, int code)> ONDATACHANGED; |
| | | typedef struct _EquipmentListener |
| | | { |
| | | ONALIVE onAlive; |
| | | ONALIVE onCimStateChanged; |
| | | ONDATACHANGED onDataChanged; |
| | | } EquipmentListener; |
| | | |
| | | // Memory Block 结构体定义 |
| | |
| | | CMaster::CMaster() |
| | | { |
| | | m_listener = {nullptr, nullptr, nullptr}; |
| | | m_bDataModify = FALSE; |
| | | } |
| | | |
| | | CMaster::~CMaster() |
| | |
| | | m_listener.onEqCimStateChanged(this, p, bOn); |
| | | } |
| | | }; |
| | | listener.onDataChanged = [&](void* pEquipment, int code) -> void { |
| | | m_bDataModify = TRUE; |
| | | }; |
| | | |
| | | pEquipment->setListener(listener); |
| | | pEquipment->setCcLink(&m_cclink); |
| | | m_listEquipment.push_back(pEquipment); |
| | |
| | | |
| | | |
| | | // 自动保存缓存 |
| | | saveCache(); |
| | | if (i % (4 * 2) == 0) { |
| | | if (m_bDataModify) { |
| | | saveCacheAndBackups(); |
| | | m_bDataModify = FALSE; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | void CMaster::connectEquipments() |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CMaster::saveCacheAndBackups() |
| | | { |
| | | saveCache(); |
| | | |
| | | |
| | | // 创建备份目录 |
| | | CString strNewFile; |
| | | CString strFileDir = m_strFilepath.c_str(); |
| | | int index = strFileDir.ReverseFind('\\'); |
| | | ASSERT(index > 0); |
| | | strFileDir = strFileDir.Left(index); |
| | | strFileDir = strFileDir + _T("Backups"); |
| | | ::CreateDirectory(strFileDir, nullptr); |
| | | |
| | | CTime time = CTime::GetCurrentTime(); |
| | | strNewFile.Format(_T("%s//Master_%d_%02d_%02d_%02d_%02d_%02d.dat"), |
| | | (LPTSTR)(LPCTSTR)strFileDir, |
| | | time.GetYear(), time.GetMonth(), time.GetDay(), |
| | | time.GetHour(), time.GetMinute(), time.GetSecond()); |
| | | ::CopyFile(m_strFilepath.c_str(), strNewFile, FALSE); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | void CMaster::setCacheFilepath(const char* pszFilepath) |
| | | { |
| | | m_strFilepath = pszFilepath; |
| | |
| | | int addBakeCooling(StepListener& listener); |
| | | void connectEquipments(); |
| | | int saveCache(); |
| | | int saveCacheAndBackups(); |
| | | int readCache(); |
| | | void serialize(CArchive& ar); |
| | | |
| | |
| | | CCCLinkIEControl m_cclink; |
| | | std::list<CEquipment*> m_listEquipment; |
| | | std::string m_strFilepath; |
| | | BOOL m_bDataModify; |
| | | }; |
| | | } |
| | | |
| | |
| | | m_hWnd = NULL; |
| | | m_crFrame = GetSysColor(COLOR_WINDOWFRAME); |
| | | m_crBkgnd = RGB(255, 255, 255); |
| | | m_listener.onConnectPin = nullptr; |
| | | m_listener.onCheckConnectPin = nullptr; |
| | | m_listener.onDisconnectPin = nullptr; |
| | | m_listener.onDeleteEqItem = nullptr; |
| | | m_listener.onEqItemPosChanged = nullptr; |
| | | m_listener.onDblckEqItem = nullptr; |
| | | m_listener.onRclickEqItem = nullptr; |
| | | m_listener.onSelectEqItem = nullptr; |
| | | m_listener = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; |
| | | m_crItemBackground[0] = RGB(218, 218, 218); |
| | | m_crItemBackground[1] = RGB(193, 208, 227); |
| | | m_crItemFrame[0] = RGB(128, 128, 128); |