From 2fb87c832d5ff07008308da1bab9b846b60ba7d3 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期一, 09 六月 2025 15:22:00 +0800
Subject: [PATCH] 1. 把搬运记录的界面添加到主界面的Tab页
---
SourceCode/Bond/Servo/CLoadPort.cpp | 69 ++++++++++++++++++++++++----------
1 files changed, 48 insertions(+), 21 deletions(-)
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index a61e86e..566faef 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -17,10 +17,10 @@
{
m_nIndex = 0;
m_portType = PortType::Loading;
- m_portMode = PortMode::InService;
+ m_portMode = PortMode::ReadyToLoad;
m_cassetteType = CassetteType::G1;
m_transferMode = TransferMode::AGVMode;
- m_bEnable = FALSE;
+ m_bEnable = TRUE;
m_bAutoChangeEnable = FALSE;
}
@@ -53,6 +53,35 @@
addPin(SERVO::PinType::INPUT, _T("In"));
addPin(SERVO::PinType::OUTPUT, _T("Out1"));
addPin(SERVO::PinType::OUTPUT, _T("Out2"));
+ }
+
+ // 必须要实现的虚函数,在此初始化Slot信息
+ void CLoadPort::initSlots()
+ {
+ m_slot[0].enable();
+ m_slot[0].setPosition(m_nID);
+ m_slot[0].setNo(1);
+ m_slot[0].setName("Slot 1");
+ m_slot[1].enable();
+ m_slot[1].setPosition(m_nID);
+ m_slot[1].setNo(2);
+ m_slot[1].setName("Slot 2");
+ m_slot[2].setPosition(m_nID);
+ m_slot[2].enable();
+ m_slot[2].setNo(3);
+ m_slot[2].setName("Slot 3");
+ m_slot[3].setPosition(m_nID);
+ m_slot[3].enable();
+ m_slot[3].setNo(4);
+ m_slot[3].setName("Slot 4");
+ m_slot[4].setPosition(m_nID);
+ m_slot[4].enable();
+ m_slot[4].setNo(5);
+ m_slot[4].setName("Slot 5");
+ m_slot[5].setPosition(m_nID);
+ m_slot[5].enable();
+ m_slot[5].setNo(6);
+ m_slot[5].setName("Slot 6");
}
void CLoadPort::initSteps()
@@ -374,21 +403,6 @@
int CLoadPort::recvIntent(CPin* pPin, CIntent* pIntent)
{
return __super::recvIntent(pPin, pIntent);
- }
-
- int CLoadPort::outputGlass(int port)
- {
- return __super::outputGlass(port);
- }
-
- BOOL CLoadPort::glassWillArrive(CGlass* pGlass)
- {
- BOOL bRet = __super::glassWillArrive(pGlass);
- if (!bRet) {
- return FALSE;
- }
-
- return (m_glassList.size() < 8);
}
int CLoadPort::sendCassetteCtrlCmd(short cmd,
@@ -1044,11 +1058,16 @@
/*
* 生成测试用的玻璃列表
*/
- int CLoadPort::testGenerateGlassList(MaterialsType type, int count, const char* pszPrefix, int startSuffix)
+ int CLoadPort::testGenerateGlassList(MaterialsType type, const char* pszPrefix, int startSuffix)
{
+ static unsigned short nJobSequenceNo = 0;
+ static unsigned short nCassetteSequenceNo = 0;
+ nCassetteSequenceNo++;
+
+
// 如果非空就不生成了
Lock();
- if (!m_glassList.empty()) {
+ if (hasGlass()) {
Unlock();
return -1;
}
@@ -1057,13 +1076,19 @@
char szBuffer[64];
int suffix = startSuffix;
- for (int i = 0; i < count; i++) {
+ for (int i = 0; i < SLOT_MAX; i++) {
+ if (!m_slot[i].isEnable()) continue;
+
CJobDataB jb;
CJobDataS js;
sprintf_s(szBuffer, "%s%d", pszPrefix, suffix++);
jb.setGlassId(szBuffer);
+ jb.setCassetteSequenceNo(nCassetteSequenceNo);
+ jb.setJobSequenceNo(++nJobSequenceNo);
js.setMaterialsType((int)type);
+ js.setCassetteSequenceNo(nCassetteSequenceNo);
+ js.setJobSequenceNo(nJobSequenceNo);
if (type == MaterialsType::G1) {
js.setGlass1Id(szBuffer);
}
@@ -1072,11 +1097,13 @@
}
CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
+ pGlass->addPath(m_nID, 0);
+ pGlass->processEnd(m_nID, 0);
pGlass->setID(szBuffer);
pGlass->setJobDataB(&jb);
pGlass->setType(type);
pGlass->setJobDataS(&js);
- addGlassToList(pGlass);
+ m_slot[i].setContext(pGlass);
}
return 0;
--
Gitblit v1.9.3