| | |
| | | m_robotData.position = ROBOT_POSITION::Port1; |
| | | m_robotData.armState[0] = FALSE; |
| | | m_robotData.armState[1] = FALSE; |
| | | m_pActiveContext = nullptr; |
| | | } |
| | | |
| | | CEFEM::~CEFEM() |
| | | { |
| | | |
| | | if (m_pActiveContext != nullptr) { |
| | | m_pActiveContext->release(); |
| | | m_pActiveContext = nullptr; |
| | | } |
| | | } |
| | | |
| | | const char* CEFEM::getClassName() |
| | | { |
| | | static char* pszName = "CEFEM"; |
| | | return pszName; |
| | | } |
| | | |
| | | void CEFEM::setContext(CContext* pContext) |
| | | { |
| | | if (m_pActiveContext != nullptr) { |
| | | m_pActiveContext->release(); |
| | | } |
| | | m_pActiveContext = pContext; |
| | | m_pActiveContext->addRef(); |
| | | } |
| | | |
| | | void CEFEM::setPort(unsigned int index, CLoadPort* pPort) |
| | |
| | | |
| | | { |
| | | // JOB Data Request |
| | | CEqReadStep* pStep = new CEqReadStep(0x617d, 2 * 2, |
| | | CEqReadStep* pStep = new CEqReadStep(0x0, 0, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | decodeJobDataRequest((CStep*)pFrom, pszData, size); |
| | | if (code == ROK /* && pszData != nullptr && size > 0*/) { |
| | | // 由于EFEM没有发送参数到master, 我们只需要返回数据 |
| | | // Cassette Sequence No和Job Sequence No根据上一次调试缓存而来 |
| | | // decodeJobDataRequest((CStep*)pFrom, pszData, size); |
| | | |
| | | // efme, 获取数据后返回 |
| | | // Cassette Sequence No 1W |
| | | // Job Sequence No 1W |
| | | // Job DataS 256W |
| | | // 获取数据后返回给EFEM |
| | | // Job DataS 320W |
| | | // ACK 1W |
| | | // Reserved 15W |
| | | short ack = (short)JobDataRequestAck::NG; // 不存在jobData |
| | | char szBuffer[1024] = { 0 }; |
| | | CJobDataS* pJobDataS = m_pPort[3]->getJobDataSWithCassette(4001, 1); |
| | | if (pJobDataS != nullptr) { |
| | | int size = pJobDataS->serialize(szBuffer, 1024); |
| | | ((CEqReadStep*)pFrom)->setReturnData(szBuffer, size); |
| | | if (m_pActiveContext != nullptr) { |
| | | CJobDataS* pJobDataS = ((CGlass*)m_pActiveContext)->getJobDataS(); |
| | | if (pJobDataS != nullptr) { |
| | | pJobDataS->serialize(szBuffer, 1024); |
| | | ack = (short)JobDataRequestAck::OK; |
| | | } |
| | | } |
| | | memcpy(&szBuffer[320 * 2], &ack, sizeof(short)); |
| | | ((CEqReadStep*)pFrom)->setReturnData(szBuffer, 336 * 2); |
| | | } |
| | | return -1; |
| | | }); |
| | |
| | | |
| | | int CEFEM::onFetchedOutJob(int port, CJobDataB* pJobDataB) |
| | | { |
| | | if (port == 1) { |
| | | return m_pPort[0]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 2) { |
| | | return m_pPort[1]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 3) { |
| | | return m_pPort[2]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 4) { |
| | | return m_pPort[3]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 5) { |
| | | return m_pArmTray[0]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 6) { |
| | | return m_pArmTray[1]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 7) { |
| | | return m_pAligner->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 8) { |
| | | return m_pFliper->onFetchedOutJob(port, pJobDataB); |
| | | // 转发到子单元设备 |
| | | CEquipment* pEqs[] = { m_pPort[0], m_pPort[1], m_pPort[2], m_pPort[3], m_pArmTray[0], m_pArmTray[1], |
| | | m_pAligner, m_pFliper }; |
| | | if (1 <= port && port <= 8) { |
| | | pEqs[port - 1]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | |
| | | return -1; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEFEM::onStoredJob(int port, CJobDataB* pJobDataB) |
| | | { |
| | | if (port == 1) { |
| | | return m_pPort[0]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 2) { |
| | | return m_pPort[1]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 3) { |
| | | return m_pPort[2]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 4) { |
| | | return m_pPort[3]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 5) { |
| | | return m_pArmTray[0]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 6) { |
| | | return m_pArmTray[1]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 7) { |
| | | return m_pAligner->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 8) { |
| | | return m_pFliper->onStoredJob(port, pJobDataB); |
| | | // 转发到子单元设备 |
| | | CEquipment* pEqs[] = { m_pPort[0], m_pPort[1], m_pPort[2], m_pPort[3], m_pArmTray[0], m_pArmTray[1], |
| | | m_pAligner, m_pFliper }; |
| | | if (1 <= port && port <= 8) { |
| | | pEqs[port - 1]->onStoredJob(port, pJobDataB); |
| | | } |
| | | |
| | | return -1; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEFEM::getIndexerOperationModeBaseValue() |
| | |
| | | #include "CAligner.h" |
| | | #include "CFliper.h" |
| | | #include "CArmTray.h" |
| | | #include "Context.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | virtual int getIndexerOperationModeBaseValue(); |
| | | |
| | | public: |
| | | void setContext(CContext* pContext); |
| | | void setPort(unsigned int index, CLoadPort* pPort); |
| | | void setAligner(CAligner* pAligner); |
| | | void setFliper(CFliper* pFliper); |
| | |
| | | CFliper* m_pFliper; |
| | | CArmTray* m_pArmTray[2]; |
| | | RMDATA m_robotData; |
| | | CContext* m_pActiveContext; |
| | | }; |
| | | } |
| | | |
| | |
| | | CReadStep::onReadData(); |
| | | |
| | | |
| | | // 20250620新增,有些场景是不需要读数据的,只要检测到信息就写数据给机器 |
| | | if (m_nReadSize == 0) { |
| | | if (m_onReadBlock != nullptr) { |
| | | m_onReadBlock(this, ROK, nullptr, 0); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | // 读数据 |
| | | char szBuffer[READ_BUFFER_MAX]; |
| | | int nRet = m_pCclink->ReadData2(m_station, DeviceType::W, m_nDataDev, |
| | | (long)min(READ_BUFFER_MAX, m_nReadSize), szBuffer); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Fetched Out Job Report #1~15 |
| | | char szBuffer[256]; |
| | | CEqReadStep* pStep = new CEqReadStep(0x5c31 + 18 * m_nIndex, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, m_nIndex + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1)); |
| | | pStep->setWriteSignalDev(0x023 + m_nIndex); |
| | | if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + m_nIndex, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Store Job Report #1~15 |
| | | char szBuffer[256]; |
| | | CEqReadStep* pStep = new CEqReadStep(0x5b23 + 18 * m_nIndex, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeStoredJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, m_nIndex + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1)); |
| | | pStep->setWriteSignalDev(0x014 + m_nIndex); |
| | | if (addStep(STEP_ID_STORE_JOB_REPORT1 + m_nIndex, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CLoadPort::onTimer(UINT nTimerid) |
| | |
| | | js.setCassetteSequenceNo(getNextCassetteSequenceNo()); |
| | | js.setJobSequenceNo(m_slot[i].getNo()); |
| | | sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo()); |
| | | js.setGlass1Id(szBuffer); |
| | | //js.setGlass1Id(szBuffer); |
| | | js.setJobType(1); |
| | | js.setMaterialsType((int)type); |
| | | |
| | |
| | | } |
| | | |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | if (m_pActiveRobotTask->isPicked()) { |
| | | m_pActiveRobotTask->place(); |
| | | } |
| | | unlock(); |
| | | // 检测到当前有正在下午的任务,确保当前任务完成或中止后继续 |
| | | // LOGI("检测到当前有正在下午的任务,确保当前任务完成或中止后继续..."); |
| | |
| | | && pEqLoadPort[s]->getPortMode() == PortMode::ReadyToLoad) { |
| | | m_pActiveRobotTask = createTransferTask(pEqLoadPort[s], pAligner, primaryType, secondaryType); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | pEFEM->setContext(m_pActiveRobotTask->getContext()); |
| | | goto PORT_GET; |
| | | } |
| | | } |
| | |
| | | LOGI("<CMaster>onPreFethedOutJob, 已校验数据一致性."); |
| | | } |
| | | } |
| | | |
| | | // 是否回撤 |
| | | else if (m_pActiveRobotTask->isRestoring() && |
| | | m_pActiveRobotTask->getSrcPosition() == p->getID()) { |
| | | CGlass* pGlass = p->getGlassFromSlot(m_pActiveRobotTask->getSrcSlot()); |
| | | if (pGlass == nullptr) { |
| | | bOk = TRUE; |
| | | slot = m_pActiveRobotTask->getSrcSlot(); |
| | | LOGI("<CMaster>onPreFethedOutJob, 已校验数据一致性."); |
| | | } |
| | | } |
| | | } |
| | | unlock(); |
| | | |
| | | if (!bOk) { |
| | | LOGE("<CMaster>onPreFethedOutJob, 数据校验失败."); |
| | | LOGE("<CMaster>onPreStoredJob, 数据校验失败."); |
| | | } |
| | | |
| | | return bOk; |
| | |
| | | ) { |
| | | LOGI("取片完成."); |
| | | m_pActiveRobotTask->fetchOut(); |
| | | m_pActiveRobotTask->place(); |
| | | m_pActiveRobotTask->picked(); |
| | | } |
| | | |
| | | else if (m_pActiveRobotTask != nullptr |
| | |
| | | } |
| | | delete m_pActiveRobotTask; |
| | | m_pActiveRobotTask = nullptr; |
| | | } |
| | | |
| | | else if (m_pActiveRobotTask != nullptr |
| | | && m_pActiveRobotTask->isRestoring() |
| | | && m_pActiveRobotTask->getSrcPosition() == p->getID()) { |
| | | m_pActiveRobotTask->stored(); |
| | | m_pActiveRobotTask->restored(); |
| | | LOGI("回撤完成..."); |
| | | // 完成此条搬送任务,但要把数据和消息上抛应用层 |
| | | unlock(); |
| | | |
| | | |
| | | lock(); |
| | | if (m_listener.onRobotTaskEvent != nullptr) { |
| | | m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_RESTORE); |
| | | } |
| | | delete m_pActiveRobotTask; |
| | | m_pActiveRobotTask = nullptr; |
| | | stop(); |
| | | } |
| | | unlock(); |
| | | } |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CMaster::restoreCurrentTask() |
| | | { |
| | | lock(); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->restore(); |
| | | } |
| | | unlock(); |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | void CMaster::setPortType(unsigned int index, BOOL enable, int type, int mode, |
| | | int cassetteType, int transferMode, BOOL autoChangeEnable) |
| | | { |
| | |
| | | CEquipment* getEquipment(int id); |
| | | void setCacheFilepath(const char* pszFilepath); |
| | | int abortCurrentTask(); |
| | | int restoreCurrentTask(); |
| | | void setPortType(unsigned int index, BOOL enable, int type, int mode, |
| | | int cassetteType, int transferMode, BOOL autoChangeEnable); |
| | | |
| | |
| | | transformPosAndSlot(toPos, toSlot, tarPos, tarSlot); |
| | | |
| | | m_robotCmdParam[ACTION_PICK] = {}; |
| | | m_robotCmdParam[ACTION_PICK].sequenceNo = static_cast<short>(seq+2); |
| | | m_robotCmdParam[ACTION_PICK].sequenceNo = static_cast<short>(seq+1); |
| | | m_robotCmdParam[ACTION_PICK].rcmd = static_cast<short>(SERVO::RCMD::Get); |
| | | m_robotCmdParam[ACTION_PICK].armNo = static_cast<short>(armNo); |
| | | m_robotCmdParam[ACTION_PICK].getPosition = static_cast<short>(srcPos); |
| | |
| | | m_robotCmdParam[ACTION_PLACE].putSlotNo = static_cast<short>(tarSlot); |
| | | |
| | | m_robotCmdParam[ACTION_RESTORE] = {}; |
| | | m_robotCmdParam[ACTION_RESTORE].sequenceNo = static_cast<short>(seq + 1); |
| | | m_robotCmdParam[ACTION_RESTORE].sequenceNo = static_cast<short>(seq + 3); |
| | | m_robotCmdParam[ACTION_RESTORE].rcmd = static_cast<short>(SERVO::RCMD::Put); |
| | | m_robotCmdParam[ACTION_RESTORE].armNo = static_cast<short>(armNo); |
| | | m_robotCmdParam[ACTION_RESTORE].putPosition = static_cast<short>(srcPos); |
| | | m_robotCmdParam[ACTION_RESTORE].putSlotNo = static_cast<short>(srcSlot); |
| | | |
| | | return seq + 1; |
| | | return seq + 3; |
| | | } |
| | | |
| | | ROBOT_CMD_PARAM& CRobotTask::getRobotCmdParam(int index) |
| | |
| | | return m_state == ROBOT_TASK_STATE::Picking; |
| | | } |
| | | |
| | | bool CRobotTask::isPicked() |
| | | { |
| | | return m_state == ROBOT_TASK_STATE::Picked; |
| | | } |
| | | |
| | | bool CRobotTask::isPlacing() |
| | | { |
| | | return m_state == ROBOT_TASK_STATE::Placing; |
| | |
| | | ASSERT(m_pEFEM); |
| | | m_state = ROBOT_TASK_STATE::Picking; |
| | | |
| | | m_pEFEM->robotSendGet(m_robotCmdParam->sequenceNo, |
| | | m_robotCmdParam[ACTION_PICK].armNo, |
| | | m_robotCmdParam[ACTION_PICK].getPosition, |
| | | m_robotCmdParam[ACTION_PICK].getSlotNo, |
| | | m_pEFEM->robotCmd(m_robotCmdParam[ACTION_PICK], |
| | | [&](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI(_T("RobotTask/get已下发到EFEM")); |
| | |
| | | }); |
| | | } |
| | | |
| | | void CRobotTask::picked() |
| | | { |
| | | m_state = ROBOT_TASK_STATE::Picked; |
| | | } |
| | | |
| | | void CRobotTask::place() |
| | | { |
| | | ASSERT(m_pEFEM); |
| | | m_state = ROBOT_TASK_STATE::Placing; |
| | | |
| | | m_pEFEM->robotSendMoveToPut(m_robotCmdParam->sequenceNo, |
| | | m_robotCmdParam[ACTION_PLACE].armNo, |
| | | m_robotCmdParam[ACTION_PLACE].putPosition, |
| | | m_robotCmdParam[ACTION_PLACE].putSlotNo, |
| | | m_pEFEM->robotCmd(m_robotCmdParam[ACTION_PLACE], |
| | | [&](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI(_T("RobotTask/put已下发到EFEM")); |
| | |
| | | ASSERT(m_pEFEM); |
| | | m_state = ROBOT_TASK_STATE::Restoring; |
| | | |
| | | m_pEFEM->robotSendMoveToPut(m_robotCmdParam->sequenceNo, |
| | | m_robotCmdParam[ACTION_RESTORE].armNo, |
| | | m_robotCmdParam[ACTION_RESTORE].putPosition, |
| | | m_robotCmdParam[ACTION_RESTORE].putSlotNo, |
| | | m_pEFEM->robotCmd(m_robotCmdParam[ACTION_RESTORE], |
| | | [&](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI(_T("RobotTask/restore-put已下发到EFEM")); |
| | |
| | | m_state = ROBOT_TASK_STATE::Completed; |
| | | } |
| | | |
| | | void CRobotTask::restored() |
| | | { |
| | | m_state = ROBOT_TASK_STATE::Restored; |
| | | } |
| | | |
| | | void CRobotTask::error() |
| | | { |
| | | m_state = ROBOT_TASK_STATE::Error; |
| | |
| | | int getArmNo(); |
| | | ROBOT_TASK_STATE getState(); |
| | | bool isPicking(); |
| | | bool isPicked(); |
| | | bool isPlacing(); |
| | | bool isRestoring(); |
| | | void run(); |
| | | void pick(); |
| | | void picked(); |
| | | void place(); |
| | | void restore(); |
| | | void restored(); |
| | | void completed(); |
| | | void error(); |
| | | void abort(); |
| | |
| | | ON_WM_SIZE() |
| | | ON_WM_ACTIVATE() |
| | | ON_BN_CLICKED(IDC_BUTTON_ABORT_TASK, &CRobotTaskDlg::OnBnClickedAbortTask) |
| | | ON_BN_CLICKED(IDC_BUTTON_RESTORE, &CRobotTaskDlg::OnBnClickedRestore) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | if (m_btnAbortTask.m_hWnd) { |
| | | m_btnAbortTask.ShowWindow(m_pRobotTask ? SW_SHOW : SW_HIDE); |
| | | } |
| | | |
| | | if (m_btnRestore.m_hWnd) { |
| | | m_btnRestore.ShowWindow(m_pRobotTask ? SW_SHOW : SW_HIDE); |
| | | } |
| | | |
| | | if (m_pRobotTask != nullptr) { |
| | | using namespace SERVO; |
| | | |
| | |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // 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); |
| | | |
| | | // 动态按钮创建后设置字体 |
| | | if (m_fontButton.GetSafeHandle() == nullptr) { |
| | | m_fontButton.CreatePointFont(110, _T("微软雅黑")); // 或 "Segoe UI" |
| | | } |
| | | m_btnAbortTask.SetFont(&m_fontButton); |
| | | m_btnRestore.SetFont(&m_fontButton); |
| | | |
| | | // 设置 LABEL 控件的字体 |
| | | if (m_fontDetail.GetSafeHandle() == nullptr) { |
| | |
| | | } |
| | | |
| | | // 设置“停止任务”按钮位置(右下角) |
| | | const int nBtnWidth = 100; |
| | | const int nBtnHeight = 28; |
| | | const int nMargin = 12; |
| | | const int nMargin2 = 8; |
| | | const int x = rcClient.right - nBtnWidth - nMargin; |
| | | int y = rcClient.bottom - nMargin; |
| | | if (m_btnAbortTask.m_hWnd != nullptr) { |
| | | const int nBtnWidth = 100; |
| | | const int nBtnHeight = 28; |
| | | const int nMargin = 12; |
| | | m_btnAbortTask.MoveWindow(x, y - nBtnHeight, nBtnWidth, nBtnHeight); |
| | | y -= nBtnHeight; |
| | | y -= nMargin2; |
| | | } |
| | | |
| | | const int nPosX = rcClient.right - nBtnWidth - nMargin; |
| | | const int nPosY = rcClient.bottom - nBtnHeight - nMargin; |
| | | |
| | | m_btnAbortTask.MoveWindow(nPosX, nPosY, nBtnWidth, nBtnHeight); |
| | | // 设置“停止任务”按钮位置(右下角) |
| | | if (m_btnRestore.m_hWnd != nullptr) { |
| | | m_btnRestore.MoveWindow(x, y - nBtnHeight, nBtnWidth, nBtnHeight); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | theApp.m_model.getMaster().abortCurrentTask(); |
| | | } |
| | | |
| | | void CRobotTaskDlg::OnBnClickedRestore() |
| | | { |
| | | int ret = AfxMessageBox(_T("物料将会被搬运回原位置,确认要回撤当前任务吗?除非发生了异常,否则请不要回撤任务!"), MB_OKCANCEL | MB_ICONEXCLAMATION); |
| | | if (ret != IDOK) { |
| | | return; |
| | | } |
| | | |
| | | theApp.m_model.getMaster().restoreCurrentTask(); |
| | | } |
| | |
| | | private: |
| | | SERVO::CRobotTask* m_pRobotTask; |
| | | CButton m_btnAbortTask; |
| | | CButton m_btnRestore; |
| | | CFont m_fontButton; |
| | | CFont m_fontDetail; |
| | | |
| | |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); |
| | | afx_msg void OnBnClickedAbortTask(); |
| | | afx_msg void OnBnClickedRestore(); |
| | | }; |
| | |
| | | #define ROBOT_EVENT_CREATE 0 // 新任务创建 |
| | | #define ROBOT_EVENT_FINISH 1 // 正常完成 |
| | | #define ROBOT_EVENT_ERROR 2 // 出现错误 |
| | | #define ROBOT_EVENT_ABORT 3 // 人为中止 |
| | | #define ROBOT_EVENT_ABORT 3 // 人为中止 |
| | | #define ROBOT_EVENT_RESTORE 4 // 回撤 |
| | |
| | | break; |
| | | case ROBOT_EVENT_ERROR: |
| | | LOGE("<CModel>onRobotTaskEvent: 任务错误(%s, ClassID=%s).", strDesc.c_str(), strClassID.c_str()); |
| | | pTask->error(); |
| | | break; |
| | | case ROBOT_EVENT_ABORT: |
| | | LOGE("<CModel>onRobotTaskEvent: 任务停止(%s, ClassID=%s).", strDesc.c_str(), strClassID.c_str()); |
| | | pTask->abort(); |
| | | break; |
| | | case ROBOT_EVENT_RESTORE: |
| | | LOGE("<CModel>onRobotTaskEvent: 任务回撤(%s, ClassID=%s).", strDesc.c_str(), strClassID.c_str()); |
| | | break; |
| | | default: |
| | | LOGE("<CModel>onRobotTaskEvent: 未知事件 code=%d, 任务=%s", code, strDesc.c_str()); |
| | |
| | | |
| | | // 安全格式化时间 |
| | | auto format_time = [](time_t t) -> std::string { |
| | | if (t < 0 || t == _I64_MIN || t == _I64_MAX) { |
| | | if (t <= 0 || t == _I64_MIN || t == _I64_MAX) { |
| | | return ""; |
| | | } |
| | | |
| | |
| | | OK = 1, |
| | | NG, |
| | | }; |
| | | typedef RET JobDataRequestAck; |
| | | |
| | | enum class PortType { |
| | | Loading = 1, |
| | |
| | | Ready = 0, |
| | | Running, |
| | | Picking, |
| | | Picked, |
| | | Placing, |
| | | Restoring, |
| | | Error, |
| | | Abort, |
| | | Restored, |
| | | Completed |
| | | }; |
| | | |
| | |
| | | else if (exCode == ROBOT_EVENT_ABORT) { |
| | | m_pMyStatusbar->setCurTaskBtnText("无"); |
| | | } |
| | | else if (exCode == ROBOT_EVENT_RESTORE) { |
| | | m_pMyStatusbar->setCurTaskBtnText("无"); |
| | | } |
| | | } |
| | | } |
| | | |