| SourceCode/Bond/Servo/AlarmManager.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CEFEM.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CEquipment.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CEquipment.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CMaster.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CMaster.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CPageGraph1.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CPageGraph2.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/LogDlg.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
SourceCode/Bond/Servo/AlarmManager.cpp
@@ -221,6 +221,17 @@ return result; #else for (AlarmDataMap::const_iterator it = m_mapCache.begin(); it != m_mapCache.end(); ++it) { const AlarmData& alarm = it->second; if (alarm.nId == alarmData.nId && alarm.nDeviceId == alarmData.nDeviceId && alarm.nUnitId == alarmData.nUnitId) { alarmEventId = it->first; return false; } } // 构建插入查询并使用 RETURNING 获取插入后的 alarm_event_id std::ostringstream query; query << "INSERT INTO alarms (id, severity_level, device_id, unit_id, description, start_time, end_time) " SourceCode/Bond/Servo/CEFEM.cpp
@@ -38,6 +38,9 @@ int CEFEM::onStepEvent(CStep* pStep, int code) { int nRet = CEquipment::onStepEvent(pStep, code); if (nRet > 0) return nRet; if (code == STEP_EVENT_READDATA) { if (isCassetteTransferStateStep(pStep)) { SERVO::CEqCassetteTransferStateStep* pEqCassetteStep = (SERVO::CEqCassetteTransferStateStep*)pStep; SourceCode/Bond/Servo/CEquipment.cpp
@@ -383,6 +383,8 @@ // CIM Mode CHECK_WRITE_STEP_SIGNAL(0x350, pszData, size); // EQ Mode CHECK_WRITE_STEP_SIGNAL(0x355, pszData, size); // Port1 ~ Port4 CHECK_READ_STEP_SIGNAL(0x3e0, pszData, size); @@ -500,6 +502,8 @@ pEqAlarmStep->getUnitId(), pEqAlarmStep->getAlarmLevel()); } return 1; } } @@ -748,4 +752,27 @@ return CToolUnits::startsWith(pStep->getName(), "EQPort") && pStep->getName().find("Cassette") != std::string::npos; } int CEquipment::setEqMode(short mode) { SERVO::CEqModeChangeStep* pStep = (SERVO::CEqModeChangeStep*)getStepWithName(STEP_EQ_MODE_CHANGE); if (pStep == nullptr) { return -1; } return pStep->setEqMode(mode); } int CEquipment::setCimMode(BOOL bOn) { SERVO::CEqCimModeChangeStep* pStep = (SERVO::CEqCimModeChangeStep*)getStepWithName(STEP_CIM_MODE_CHANGE); if (pStep == nullptr) { return -1; } if (bOn) return pStep->cimOn(); else return pStep->cimOff(); } } SourceCode/Bond/Servo/CEquipment.h
@@ -106,7 +106,8 @@ BOOL removeClass(CGlass* pGlass); bool isAlarmStep(SERVO::CStep* pStep); bool isCassetteTransferStateStep(SERVO::CStep* pStep); int setEqMode(short mode); int setCimMode(BOOL bOn); // 以下为从CC-Link读取到的Bit标志位检测函数 public: SourceCode/Bond/Servo/CMaster.cpp
@@ -15,6 +15,16 @@ namespace SERVO { CMaster* g_pMaster = NULL; unsigned __stdcall ReadBitsThreadFunction(LPVOID lpParam) { if (g_pMaster != NULL) { return g_pMaster->ReadBitsProc(); } return 0; } void CALLBACK MasterTimerProc(HWND hWnd, UINT nMsg, UINT nTimerid, DWORD dwTime) { if (g_pMaster != NULL) { @@ -26,6 +36,10 @@ { m_listener = {nullptr, nullptr, nullptr}; m_bDataModify = FALSE; m_hEventReadBitsThreadExit[0] = ::CreateEvent(NULL, TRUE, FALSE, NULL); m_hEventReadBitsThreadExit[1] = ::CreateEvent(NULL, TRUE, FALSE, NULL); m_hReadBitsThreadHandle = nullptr; m_nReadBitsThreadAddr = 0; } CMaster::~CMaster() @@ -34,6 +48,16 @@ delete item; } m_listEquipment.clear(); if (m_hEventReadBitsThreadExit[0] != nullptr) { ::CloseHandle(m_hEventReadBitsThreadExit[0]); m_hEventReadBitsThreadExit[0] = nullptr; } if (m_hEventReadBitsThreadExit[1] != nullptr) { ::CloseHandle(m_hEventReadBitsThreadExit[1]); m_hEventReadBitsThreadExit[1] = nullptr; } } void CMaster::setListener(MasterListener listener) @@ -98,12 +122,19 @@ SetTimer(NULL, 1, 250, (TIMERPROC)MasterTimerProc); m_hReadBitsThreadHandle = (HANDLE)_beginthreadex(NULL, 0, SERVO::ReadBitsThreadFunction, this, 0, &m_nReadBitsThreadAddr); LOGI("<Master>初始化完成."); return 0; } int CMaster::term() { SetEvent(m_hEventReadBitsThreadExit[0]); ::WaitForSingleObject(m_hEventReadBitsThreadExit[1], INFINITE); LOGI("<Master>正在结束程序."); for (auto item : m_listEquipment) { item->term(); @@ -111,6 +142,38 @@ saveCache(); return 0; } unsigned CMaster::ReadBitsProc() { while (1) { // 待退出信号或时间到 int nRet = ::WaitForSingleObject(m_hEventReadBitsThreadExit[0], 1000); if (nRet == WAIT_OBJECT_0) { break; } for (auto item : m_listEquipment) { if (item->getID() == EQ_ID_Bonder1) { const StationIdentifier& station = item->getStation(); MemoryBlock& block = item->getReadBitBlock(); int nRet = m_cclink.ReadData2(station, (DeviceType)block.type, block.start, block.size, block.buffer); if (0 == nRet) { item->onReceiveLBData(block.buffer, block.size); } } } } SetEvent(m_hEventReadBitsThreadExit[1]); // _endthreadex(0); TRACE("CMaster::ReadBitsProc 线程退出\n"); return 0; } @@ -663,7 +726,8 @@ pEquipment->setID(EQ_ID_Bonder1 + index); pEquipment->setName(index == 0 ? "Bonder 1" : "Bonder 2"); pEquipment->setDescription(index == 0 ? "Bonder 1." : "Bonder 2."); pEquipment->setStation(1, index == 0 ? 3 : 4); // pEquipment->setStation(1, index == 0 ? 3 : 4); pEquipment->setStation(0, 255); pEquipment->setReadBitBlock(index == 0 ? 0x4600 : 0x4c00, index == 0 ? 0x4c00 : 0x5200); addToEquipmentList(pEquipment); @@ -823,9 +887,11 @@ // 按一定频率扫描LB数据 static int i = 0; i++; /* if (i % (4 * 1) == 0) { for (auto item : m_listEquipment) { if (item->getID() == EQ_ID_Bonder1) { const StationIdentifier& station = item->getStation(); MemoryBlock& block = item->getReadBitBlock(); @@ -836,6 +902,8 @@ } } } } */ // 自动保存缓存 SourceCode/Bond/Servo/CMaster.h
@@ -33,6 +33,7 @@ void setListener(MasterListener listener); int init(); int term(); unsigned ReadBitsProc(); void onTimer(UINT nTimerid); std::list<CEquipment*>& getEquipmentList(); CEquipment* getEquipment(int id); @@ -59,6 +60,11 @@ std::list<CEquipment*> m_listEquipment; std::string m_strFilepath; BOOL m_bDataModify; private: HANDLE m_hEventReadBitsThreadExit[2]; HANDLE m_hReadBitsThreadHandle; unsigned m_nReadBitsThreadAddr; }; } SourceCode/Bond/Servo/CPageGraph1.cpp
@@ -86,6 +86,14 @@ UpdateDeviceStatus(INDICATE_ROBOT_ARM1, status); UpdateDeviceStatus(INDICATE_ROBOT_ARM2, status); } else if(EQ_ID_Bonder1 == nID) { DeviceStatus status = bAlive ? DeviceStatus::ONLINE : DeviceStatus::OFFLINE; UpdateDeviceStatus(INDICATE_BONDER1, status); } else if (EQ_ID_Bonder2 == nID) { DeviceStatus status = bAlive ? DeviceStatus::ONLINE : DeviceStatus::OFFLINE; UpdateDeviceStatus(INDICATE_BONDER2, status); } } } } @@ -171,8 +179,6 @@ m_pGraph->AddIndicateBox(INDICATE_ROBOT_ARM2, 243, 294, 48, RGB(22, 22, 22), RGB(255, 127, 39), EQ_BOX_OFFLINE); m_pGraph->SetBoxText(INDICATE_ROBOT_ARM2, "6", "Robot"); // Vacuum bake @@ -400,6 +406,29 @@ if (1 == nIDEvent) { KillTimer(1); InitRxWindows(); // 更新状态 { SERVO::CEquipment* pEquipment = (SERVO::CEFEM*)theApp.m_model.m_master.getEquipment(EQ_ID_EFEM); ASSERT(pEquipment); DeviceStatus status = pEquipment->isAlive() ? DeviceStatus::ONLINE : DeviceStatus::OFFLINE; UpdateDeviceStatus(INDICATE_ROBOT_ARM1, status); UpdateDeviceStatus(INDICATE_ROBOT_ARM2, status); } { SERVO::CEquipment* pEquipment = theApp.m_model.m_master.getEquipment(EQ_ID_Bonder1); ASSERT(pEquipment); DeviceStatus status = pEquipment->isAlive() ? DeviceStatus::ONLINE : DeviceStatus::OFFLINE; UpdateDeviceStatus(INDICATE_BONDER1, status); } { SERVO::CEquipment* pEquipment = theApp.m_model.m_master.getEquipment(EQ_ID_Bonder2); ASSERT(pEquipment); DeviceStatus status = pEquipment->isAlive() ? DeviceStatus::ONLINE : DeviceStatus::OFFLINE; UpdateDeviceStatus(INDICATE_BONDER2, status); } } CDialogEx::OnTimer(nIDEvent); SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -158,6 +158,22 @@ } else if (nCmd == ID_EQSGRAPHITEM_TEST3) { SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; if (pEquipment->getID() == EQ_ID_Bonder1 || pEquipment->getID() == EQ_ID_Bonder2) { static int ii = 0; ii++; pEquipment->setCimMode(ii % 2 == 0); } /* SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; if (pEquipment->getID() == EQ_ID_Bonder1 || pEquipment->getID() == EQ_ID_Bonder2) { static int ii = 0; ii++; pEquipment->setEqMode((ii % 5) + 1); } */ /* SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; SERVO::CGlass* pGlass = pEquipment->getFrontGlass(); if (pGlass != nullptr) { std::string strDescription; @@ -168,6 +184,7 @@ pPath = pPath->getNext(); } } */ } SourceCode/Bond/Servo/LogDlg.cpp
@@ -154,7 +154,7 @@ // 内容 m_logEdit.SetMaxLineCount(20); m_logEdit.SetMaxLineCount(500); m_logEdit.SetLimitText(-1);