From 5a66d26a2899a2450a50f00d09c728ae151715be Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 23 七月 2025 11:19:42 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
SourceCode/Bond/Servo/CPagePortProperty.cpp | 8
SourceCode/Bond/Servo/Servo.vcxproj | 2
SourceCode/Bond/Servo/resource.h | 0
SourceCode/Bond/Servo/CGlass.h | 3
SourceCode/Bond/Servo/CRobotTask.cpp | 11 +
SourceCode/Bond/Servo/Configuration.cpp | 15 +
SourceCode/Bond/Servo/CMaster.h | 8
SourceCode/Bond/Servo/PortConfigurationDlg.h | 18 +
SourceCode/Bond/Servo/Configuration.h | 2
SourceCode/Bond/Servo/CEquipment.cpp | 2
SourceCode/Bond/Servo/CPortStatusReport.h | 2
SourceCode/Bond/Servo/Model.h | 1
SourceCode/Bond/Servo/Servo.rc | 0
SourceCode/Bond/Servo/CMaster.cpp | 36 +++
SourceCode/Bond/Servo/CPageGraph2.cpp | 25 --
SourceCode/Bond/Servo/CGlass.cpp | 13 +
SourceCode/Bond/Servo/CCustomCheckBox.cpp | 56 +++++
SourceCode/Bond/Servo/CCustomCheckBox.h | 28 ++
SourceCode/Bond/Servo/CLoadPort.h | 8
SourceCode/Bond/Servo/Model.cpp | 12 +
SourceCode/Bond/Servo/CLoadPort.cpp | 110 ++++++++-
SourceCode/Bond/Servo/ServoDlg.cpp | 8
SourceCode/Bond/Servo/CPortStatusReport.cpp | 12 +
SourceCode/Bond/Servo/CRobotTask.h | 1
SourceCode/Bond/Servo/PortConfigurationDlg.cpp | 226 +++++++++++++-------
SourceCode/Bond/Servo/Servo.vcxproj.filters | 2
SourceCode/Bond/Servo/CEquipment.h | 3
SourceCode/Bond/Servo/ServoCommo.h | 16 +
SourceCode/Bond/Servo/CRobotTaskDlg.cpp | 7
SourceCode/Bond/Servo/Common.h | 1
30 files changed, 506 insertions(+), 130 deletions(-)
diff --git a/SourceCode/Bond/Servo/CCustomCheckBox.cpp b/SourceCode/Bond/Servo/CCustomCheckBox.cpp
new file mode 100644
index 0000000..56a4612
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCustomCheckBox.cpp
@@ -0,0 +1,56 @@
+#include "stdafx.h"
+#include "CCustomCheckBox.h"
+
+
+CCustomCheckBox::CCustomCheckBox()
+ : m_bgColor(RGB(255, 255, 255)), m_textColor(RGB(0, 0, 0))
+{
+ m_brush.CreateSolidBrush(m_bgColor);
+}
+
+CCustomCheckBox::~CCustomCheckBox()
+{
+
+}
+
+void CCustomCheckBox::SetBackgroundColor(COLORREF color)
+{
+ m_bgColor = color;
+ if (m_brush.GetSafeHandle())
+ m_brush.DeleteObject();
+ m_brush.CreateSolidBrush(m_bgColor);
+ Invalidate();
+}
+
+void CCustomCheckBox::SetTextColor(COLORREF color)
+{
+ m_textColor = color;
+ Invalidate();
+}
+
+void CCustomCheckBox::SetNotifyHwnd(HWND hWnd)
+{
+ m_hNotifyWnd = hWnd;
+}
+
+void CCustomCheckBox::OnClicked()
+{
+ BOOL bChecked = (GetCheck() == BST_CHECKED);
+
+ // 你可以定义自己的自定义消息
+ if (m_hNotifyWnd && ::IsWindow(m_hNotifyWnd)) {
+ ::PostMessage(m_hNotifyWnd, WM_CHECKBOX_STATE_CHANGED, GetDlgCtrlID(), bChecked);
+ }
+}
+
+BEGIN_MESSAGE_MAP(CCustomCheckBox, CButton)
+ ON_WM_CTLCOLOR_REFLECT()
+ ON_CONTROL_REFLECT(BN_CLICKED, &CCustomCheckBox::OnClicked)
+END_MESSAGE_MAP()
+
+HBRUSH CCustomCheckBox::CtlColor(CDC* pDC, UINT /*nCtlColor*/)
+{
+ pDC->SetBkMode(TRANSPARENT);
+ pDC->SetTextColor(m_textColor);
+ return (HBRUSH)m_brush.GetSafeHandle();
+}
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/CCustomCheckBox.h b/SourceCode/Bond/Servo/CCustomCheckBox.h
new file mode 100644
index 0000000..c7928f0
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCustomCheckBox.h
@@ -0,0 +1,28 @@
+#pragma once
+
+
+#define WM_CHECKBOX_STATE_CHANGED WM_USER + 1003
+
+class CCustomCheckBox : public CButton
+{
+public:
+ CCustomCheckBox();
+ virtual ~CCustomCheckBox();
+
+public:
+ void SetBackgroundColor(COLORREF color);
+ void SetTextColor(COLORREF color);
+ void SetNotifyHwnd(HWND hWnd); // 设置消息接收窗口
+
+protected:
+ afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
+ afx_msg void OnClicked();
+ DECLARE_MESSAGE_MAP()
+
+private:
+ COLORREF m_bgColor;
+ COLORREF m_textColor;
+ CBrush m_brush;
+ HWND m_hNotifyWnd;
+};
+
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index fce26d2..0d99db6 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -1318,6 +1318,7 @@
CGlass* pGlass = (CGlass*)m_slot[i].getContext();
if (!isSlotProcessed(i)) continue;
if (pGlass == nullptr) continue;
+ if (!pGlass->isScheduledForProcessing()) continue;
if(pGlass->getInspResult(m_nID, 0) == InspResult::Fail) continue;
int lsPath = m_slot[i].getLinkSignalPath();
if(!m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_INLINE]
@@ -1370,6 +1371,7 @@
if (m_slot[i].isLock()) continue;
CGlass* pGlass = (CGlass*)m_slot[i].getContext();
if (pGlass == nullptr) continue;
+ if (!pGlass->isScheduledForProcessing()) continue;
if (pGlass->getInspResult(m_nID, 0) != InspResult::Fail) continue;
int lsPath = m_slot[i].getLinkSignalPath();
if (!m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_INLINE]
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 1a35b85..079e4af 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -55,6 +55,7 @@
typedef std::function<BOOL(void* pEiuipment, int port, CJobDataB* pJobDataB, short& putSlot)> ONPRESTOREDJOB;
typedef std::function<void(void* pEiuipment, PROCESS_STATE state)> ONPROCESSSTATE;
typedef std::function<void(void* pEiuipment, short scanMap, short downMap)> ONMAPMISMATCH;
+ typedef std::function<void(void* pEiuipment, short scanMap)> ONPORTINUSE;
typedef struct _EquipmentListener
{
ONALIVE onAlive;
@@ -66,6 +67,8 @@
ONPRESTOREDJOB onPreStoredJob;
ONPROCESSSTATE onProcessStateChanged;
ONMAPMISMATCH onMapMismatch;
+ ONPORTINUSE onPortInUse;
+
} EquipmentListener;
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index 6d1a1ee..6c1b30f 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -10,6 +10,7 @@
m_pBuddy = nullptr;
m_nOriginPort = 0;
m_nOriginSlot = 0;
+ m_bScheduledForProcessing = FALSE;
}
CGlass::~CGlass()
@@ -80,6 +81,16 @@
slot = m_nOriginSlot;
}
+ BOOL CGlass::isScheduledForProcessing()
+ {
+ return m_bScheduledForProcessing;
+ }
+
+ void CGlass::setScheduledForProcessing(BOOL bProcessing)
+ {
+ m_bScheduledForProcessing = bProcessing;
+ }
+
CPath* CGlass::getPath()
{
return m_pPath;
@@ -119,6 +130,7 @@
WriteString(ar, m_strID);
ar << m_nOriginPort;
ar << m_nOriginSlot;
+ ar << m_bScheduledForProcessing;
ar << (ULONGLONG)m_pPath;
if (m_pPath != nullptr) {
m_pPath->serialize(ar);
@@ -141,6 +153,7 @@
ReadString(ar, m_strID);
ar >> m_nOriginPort;
ar >> m_nOriginSlot;
+ ar >> m_bScheduledForProcessing;
ar >> ullPath;
if (ullPath != 0) {
m_pPath = new CPath();
diff --git a/SourceCode/Bond/Servo/CGlass.h b/SourceCode/Bond/Servo/CGlass.h
index 3127839..844822b 100644
--- a/SourceCode/Bond/Servo/CGlass.h
+++ b/SourceCode/Bond/Servo/CGlass.h
@@ -26,6 +26,8 @@
std::string& getID();
void setOriginPort(int port, int slot);
void getOrginPort(int& port, int& slot);
+ BOOL isScheduledForProcessing();
+ void setScheduledForProcessing(BOOL bProcessing);
CPath* getPathWithEq(unsigned int nEqId, unsigned int nUnit);
CPath* getPath();
void addPath(unsigned int nEqId, unsigned int nUnit);
@@ -51,6 +53,7 @@
std::string m_strBuddyId;
int m_nOriginPort;
int m_nOriginSlot;
+ BOOL m_bScheduledForProcessing; /* 是否将加工处理 */
};
}
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index ee5a8d1..37f3139 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -16,6 +16,7 @@
m_bEnable = FALSE;
m_bAutoChangeEnable = FALSE;
m_nNextCassetteSequenceNo = 0;
+ m_isCompareMapsBeforeProceeding = FALSE;
}
CLoadPort::~CLoadPort()
@@ -134,7 +135,7 @@
CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short),
[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
if (code == ROK && pszData != nullptr && size > 0) {
- m_cassetteType = (CassetteType)CToolUnits::toInt16(pszData);
+ //m_cassetteType = (CassetteType)CToolUnits::toInt16(pszData);
}
return 0;
});
@@ -347,6 +348,23 @@
void CLoadPort::onTimer(UINT nTimerid)
{
CEquipment::onTimer(nTimerid);
+
+ // 模拟测试
+ /*
+ if (m_nIndex == 0) {
+ static int ii = 0;
+ ii++;
+ if (ii == 20) {
+ char szBuffer[64];
+ CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE);
+ CPortStatusReport portStatusReport;
+ portStatusReport.setPortStatus(PORT_INUSE);
+ portStatusReport.setJobExistenceSlot(0xf);
+ int nRet = portStatusReport.serialize(szBuffer, 64);
+ decodePortStatusReport(pStep, szBuffer, 64);
+ }
+ }
+ */
}
void CLoadPort::serialize(CArchive& ar)
@@ -887,17 +905,27 @@
// 当port状态为InUse, 比较map
if (m_portStatusReport.getPortStatus() == PORT_INUSE) {
- short scanMap = m_portStatusReport.getJobExistenceSlot();
- short downMap = getCassetteMap();
- if (scanMap == downMap) {
- this->sendCassetteCtrlCmd(5, nullptr, 0, 0, 0, nullptr, nullptr);
+ if (m_isCompareMapsBeforeProceeding) {
+ short scanMap = getScanCassetteMap();
+ short downloadMap = getDownloadCassetteMap();
+ if (scanMap == downloadMap) {
+ generateGlassList(scanMap);
+ this->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+ }
+ else {
+ this->sendCassetteCtrlCmd(CCC_PROCESS_CANCEL, nullptr, 0, 0, 0, nullptr, nullptr);
+
+ // 抛出到应用层做提示
+ if (m_listener.onMapMismatch != nullptr) {
+ m_listener.onMapMismatch(this, scanMap, downloadMap);
+ }
+ }
}
else {
- this->sendCassetteCtrlCmd(10, nullptr, 0, 0, 0, nullptr, nullptr);
-
- // 抛出到应用层做提示
- if (m_listener.onMapMismatch != nullptr) {
- m_listener.onMapMismatch(this, scanMap, downMap);
+ // 抛出到应用层做选择要加工的片子
+ generateGlassList(getScanCassetteMap());
+ if (m_listener.onPortInUse != nullptr) {
+ m_listener.onPortInUse(this, getScanCassetteMap());
}
}
}
@@ -1011,6 +1039,7 @@
int CLoadPort::setCassetteType(CassetteType type, ONWRITED onWritedBlock/* = nullptr*/)
{
+ m_cassetteType = type;
static char* pszName[] = { STEP_PORT1_CASSETTE_TYPE_CHANGE, STEP_PORT2_CASSETTE_TYPE_CHANGE, STEP_PORT3_CASSETTE_TYPE_CHANGE, STEP_PORT4_CASSETTE_TYPE_CHANGE };
SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
if (pStep == nullptr) {
@@ -1023,7 +1052,6 @@
// test
code = WOK;
if (code == WOK) {
- m_cassetteType = type;
LOGI("<CLoadPort-%d>设置Cassette Type成功.", m_nIndex);
}
else {
@@ -1126,15 +1154,15 @@
m_bAutoChangeEnable = bEnable;
}
- short CLoadPort::getCassetteMap()
+ short CLoadPort::getScanCassetteMap()
{
- short map = 0;
- for (int i = 0; i < SLOT_MAX; i++) {
- if (!m_slot[i].isEnable()) continue;
- if (m_slot[i].getContext() == nullptr) continue;
- map |= (1 << i);
- }
+ return m_portStatusReport.getJobExistenceSlot();
+ }
+ short CLoadPort::getDownloadCassetteMap()
+ {
+ // 暂时未实现此功能
+ short map = 0;
return map;
}
@@ -1176,6 +1204,47 @@
return 0;
}
+ /*
+ * 根据efem扫描到的map,生成玻璃列表
+ */
+ int CLoadPort::generateGlassList(short map)
+ {
+ // 先释放较早前的数据
+ Lock();
+ for (int i = 0; i < SLOT_MAX; i++) {
+ m_slot[i].setContext(nullptr);
+ }
+ Unlock();
+
+
+ // 根据map生成新的
+ char szBuffer[64];
+ for (int i = 0; i < SLOT_MAX; i++) {
+ if (!m_slot[i].isEnable()) continue;
+ if (!(map >> i) & 1) continue;
+
+ CJobDataS js;
+ js.setCassetteSequenceNo(getNextCassetteSequenceNo());
+ js.setJobSequenceNo(m_slot[i].getNo());
+ sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo());
+ js.setJobType(1);
+ js.setMaterialsType((int)m_cassetteType);
+
+ CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
+ pGlass->setOriginPort(m_nIndex, i);
+ pGlass->setScheduledForProcessing(i % 2 == 1);
+ pGlass->addPath(m_nID, 0);
+ pGlass->processEnd(m_nID, 0);
+ pGlass->setID(szBuffer);
+ pGlass->setType(m_cassetteType);
+ pGlass->setJobDataS(&js);
+ m_slot[i].setContext(pGlass);
+ }
+
+ return 0;
+ }
+
+
int CLoadPort::testGenerateGlassListFromConfig(const SERVO::PortConfig& config)
{
char szBuffer[64];
@@ -1215,4 +1284,9 @@
return 0;
}
+
+ void CLoadPort::setCompareMapsBeforeProceeding(BOOL bCompare)
+ {
+ m_isCompareMapsBeforeProceeding = bCompare;
+ }
}
diff --git a/SourceCode/Bond/Servo/CLoadPort.h b/SourceCode/Bond/Servo/CLoadPort.h
index b8279c2..12776df 100644
--- a/SourceCode/Bond/Servo/CLoadPort.h
+++ b/SourceCode/Bond/Servo/CLoadPort.h
@@ -37,7 +37,8 @@
void localSetCessetteType(CassetteType type);
void localSetTransferMode(TransferMode mode);
void localAutoChangeEnable(BOOL bEnable);
- short getCassetteMap();
+ short getScanCassetteMap();
+ short getDownloadCassetteMap();
public:
short getNextCassetteSequenceNo();
@@ -57,6 +58,7 @@
int getCassetteMappingState();
int getCassetteStatus();
int testGenerateGlassList(MaterialsType type);
+ int generateGlassList(short map);
int testGenerateGlassListFromConfig(const SERVO::PortConfig& config);
public:
@@ -80,6 +82,7 @@
CJobDataA* pJobDataA,
ONWRITED onWritedBlock);
CStep* getCassetteCtrlCmdStep();
+ void setCompareMapsBeforeProceeding(BOOL bCompare);
private:
int decodePortStatusReport(CStep* pStep, const char* pszData, size_t size);
@@ -94,6 +97,9 @@
BOOL m_bAutoChangeEnable;
CPortStatusReport m_portStatusReport;
int m_nNextCassetteSequenceNo;
+
+ // 在开始工艺前是否先需要先比较map
+ BOOL m_isCompareMapsBeforeProceeding;
};
}
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 7ef3579..6c9a004 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -51,6 +51,7 @@
m_state = MASTERSTATE::READY;
m_pActiveRobotTask = nullptr;
m_nLastError = 0;
+ m_isCompareMapsBeforeProceeding = FALSE;
InitializeCriticalSection(&m_criticalSection);
}
@@ -1016,6 +1017,12 @@
LOGE("<Master-%s>Port InUse, map(%d!=%d)不一致,请检查。",
((CEquipment*)pEquipment)->getName().c_str(), scanMap, downMap);
};
+ listener.onPortInUse = [&](void* pEquipment, short scanMap) {
+ LOGE("<Master-%s>Port InUse。scanMap=%d", ((CEquipment*)pEquipment)->getName().c_str(), scanMap);
+ if (m_listener.onLoadPortInUse != nullptr) {
+ m_listener.onLoadPortInUse(this, (CEquipment*)pEquipment, scanMap);
+ }
+ };
pEquipment->setListener(listener);
pEquipment->setCcLink(&m_cclink);
m_listEquipment.push_back(pEquipment);
@@ -1053,6 +1060,7 @@
pEquipment->setID(EQ_ID_LOADPORT1 + index);
pEquipment->setName(szName);
pEquipment->setDescription(szName);
+ pEquipment->setCompareMapsBeforeProceeding(m_isCompareMapsBeforeProceeding);
addToEquipmentList(pEquipment);
@@ -1567,7 +1575,8 @@
unlock();
// 当前任务手动中止后,停止调度,需要操作员在解决问题后,重新启动
- stop();
+ // 25年7月23日后修改为不停止任务
+ // stop();
return 0;
}
@@ -1577,6 +1586,18 @@
lock();
if (m_pActiveRobotTask != nullptr) {
m_pActiveRobotTask->restore();
+ }
+ unlock();
+
+
+ return 0;
+ }
+
+ int CMaster::resendCurrentTask()
+ {
+ lock();
+ if (m_pActiveRobotTask != nullptr) {
+ m_pActiveRobotTask->resend();
}
unlock();
@@ -1597,4 +1618,17 @@
pPort->localSetTransferMode((SERVO::TransferMode)transferMode);
pPort->localAutoChangeEnable(autoChangeEnable);
}
+
+ void CMaster::setPortCassetteType(unsigned int index, SERVO::CassetteType type)
+ {
+ ASSERT(index < 4);
+ int eqid[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4 };
+ CLoadPort* pPort = (CLoadPort*)getEquipment(eqid[index]);
+ pPort->localSetCessetteType(type);
+ }
+
+ void CMaster::setCompareMapsBeforeProceeding(BOOL bCompare)
+ {
+ m_isCompareMapsBeforeProceeding = bCompare;
+ }
}
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 37ff05b..57756d0 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -31,6 +31,7 @@
typedef std::function<void(void* pMaster, CEquipment* pEquipment, CVcrEventReport* pReport)> ONEQVCREVENTREPORT;
typedef std::function<void(void* pMaster, CEquipment* pEquipment, int code)> ONEQDATACHANGED;
typedef std::function<void(void* pMaster, CRobotTask* pTask, int code)> ONROBOTTASKEVENT;
+ typedef std::function<void(void* pMaster, CEquipment* pEquipment, short scanMap)> ONLOADPORTINUSE;
typedef struct _MasterListener
{
ONMASTERSTATECHANGED onMasterStateChanged;
@@ -40,6 +41,7 @@
ONEQVCREVENTREPORT onEqVcrEventReport;
ONEQDATACHANGED onEqDataChanged;
ONROBOTTASKEVENT onRobotTaskEvent;
+ ONLOADPORTINUSE onLoadPortInUse;
} MasterListener;
class CMaster
@@ -67,8 +69,11 @@
void setCacheFilepath(const char* pszFilepath);
int abortCurrentTask();
int restoreCurrentTask();
+ int resendCurrentTask();
void setPortType(unsigned int index, BOOL enable, int type, int mode,
int cassetteType, int transferMode, BOOL autoChangeEnable);
+ void setPortCassetteType(unsigned int index, SERVO::CassetteType type);
+ void setCompareMapsBeforeProceeding(BOOL bCompare);
private:
inline void lock() { EnterCriticalSection(&m_criticalSection); }
@@ -130,6 +135,9 @@
// 错误代码
int m_nLastError;
std::string m_strLastError;
+
+ // 在开始工艺前是否先需要先比较map
+ BOOL m_isCompareMapsBeforeProceeding;
};
}
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index 3db47cb..eca3e9e 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -212,30 +212,7 @@
// 娴嬭瘯
else if (nCmd == ID_EQSGRAPHITEM_TEST1) {
- BOOL bTestGenerate = FALSE;
- SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- if (pEquipment->getID() == EQ_ID_LOADPORT4 && !pEquipment->hasGlass()) {
- ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G1);
- bTestGenerate = TRUE;
- }
- /*
- else if (pEquipment->getID() == EQ_ID_LOADPORT1 && !pEquipment->hasGlass()) {
- ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G2);
- bTestGenerate = TRUE;
- }
- */
- if (!bTestGenerate) {
- SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask();
- if (pTask != nullptr) {
- SERVO::CGlass* pGlass = (SERVO::CGlass*)pTask->getContext();
- SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
- if (pJobDataS != nullptr) {
- SERVO::CJobDataB jobDataB;
- pEquipment->onFetchedOutJob(0, &pJobDataS->getJobDataB(jobDataB));
- pEquipment->onSentOutJob(0, pJobDataS);
- }
- }
- }
+
}
else if (nCmd == ID_EQSGRAPHITEM_TEST2) {
SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
diff --git a/SourceCode/Bond/Servo/CPagePortProperty.cpp b/SourceCode/Bond/Servo/CPagePortProperty.cpp
index 380e35d..492a2a7 100644
--- a/SourceCode/Bond/Servo/CPagePortProperty.cpp
+++ b/SourceCode/Bond/Servo/CPagePortProperty.cpp
@@ -280,6 +280,13 @@
void CPagePortProperty::OnCbnSelchangeComboPortCassertType()
{
+ // 鐢卞師鏉ョ殑鏇存柊鍒癊FEM, 淇敼涓轰繚瀛樺埌鏈湴ini鏂囦欢
+ ASSERT(m_pPort != nullptr);
+ int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE))->GetCurSel();
+ theApp.m_model.setPortCassetteType(m_pPort->getIndex(), SERVO::CassetteType(index + 1));
+
+
+ /*
g_nMsgDlgShow = 0;
CMsgDlg msgDlg("璇风瓑寰�", "姝e湪鎿嶄綔锛岃绛夊緟...");
msgDlg.SetData((DWORD_PTR)this);
@@ -322,6 +329,7 @@
msgDlg.DoModal();
g_nMsgDlgShow = 1;
+ */
}
void CPagePortProperty::OnCbnSelchangeComboPortTransferMode()
diff --git a/SourceCode/Bond/Servo/CPortStatusReport.cpp b/SourceCode/Bond/Servo/CPortStatusReport.cpp
index e132f12..0a0453d 100644
--- a/SourceCode/Bond/Servo/CPortStatusReport.cpp
+++ b/SourceCode/Bond/Servo/CPortStatusReport.cpp
@@ -51,6 +51,11 @@
return m_nPortStatus;
}
+ void CPortStatusReport::setPortStatus(short status)
+ {
+ m_nPortStatus = status;
+ }
+
short CPortStatusReport::getCassetteSequenceNo()
{
return m_nCassetteSequenceNo;
@@ -146,7 +151,7 @@
memcpy(&m_nCassetteStatus, &pszBuffer[index], sizeof(short));
index += sizeof(short);
- return 15 * 2;
+ return 32 * 2;
}
void CPortStatusReport::getAttributeVector(CAttributeVector& attrubutes, int beginWeight)
@@ -242,6 +247,11 @@
return m_nJobExistenceSlot[0];
}
+ void CPortStatusReport::setJobExistenceSlot(short map)
+ {
+ m_nJobExistenceSlot[0] = map;
+ }
+
void CPortStatusReport::WriteString(CArchive& ar, std::string& string)
{
CString strTemp = string.c_str();
diff --git a/SourceCode/Bond/Servo/CPortStatusReport.h b/SourceCode/Bond/Servo/CPortStatusReport.h
index 0555d51..727a7d9 100644
--- a/SourceCode/Bond/Servo/CPortStatusReport.h
+++ b/SourceCode/Bond/Servo/CPortStatusReport.h
@@ -14,6 +14,7 @@
public:
void copyEx(CPortStatusReport& other);
short getPortStatus();
+ void setPortStatus(short status);
short getCassetteSequenceNo();
std::string& getCassetteId();
short getLoadingCassetteType();
@@ -29,6 +30,7 @@
bool canPickFromPort();
bool isJobExistenceSlot();
short getJobExistenceSlot();
+ void setJobExistenceSlot(short map);
private:
void WriteString(CArchive& ar, std::string& string);
diff --git a/SourceCode/Bond/Servo/CRobotTask.cpp b/SourceCode/Bond/Servo/CRobotTask.cpp
index 7a9625e..1c9f61d 100644
--- a/SourceCode/Bond/Servo/CRobotTask.cpp
+++ b/SourceCode/Bond/Servo/CRobotTask.cpp
@@ -286,6 +286,17 @@
});
}
+ void CRobotTask::resend()
+ {
+ // 重新下发命令,无非是下发取料或下发放料的命令,根据当前状态来
+ if (ROBOT_TASK_STATE::Picking == m_state || ROBOT_TASK_STATE::Picked == m_state) {
+ pick();
+ }
+ else if (ROBOT_TASK_STATE::Placing == m_state) {
+ place();
+ }
+ }
+
void CRobotTask::completed()
{
m_state = ROBOT_TASK_STATE::Completed;
diff --git a/SourceCode/Bond/Servo/CRobotTask.h b/SourceCode/Bond/Servo/CRobotTask.h
index 324b6cc..e20fd4a 100644
--- a/SourceCode/Bond/Servo/CRobotTask.h
+++ b/SourceCode/Bond/Servo/CRobotTask.h
@@ -41,6 +41,7 @@
void place();
void restore();
void restored();
+ void resend();
void completed();
void error();
void abort();
diff --git a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
index 58b6010..2b2d50e 100644
--- a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
+++ b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
@@ -103,7 +103,7 @@
// 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);
+ m_btnRestore.Create(_T("閲嶅彂鎸囦护"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_RESTORE);
// 鍔ㄦ�佹寜閽垱寤哄悗璁剧疆瀛椾綋
if (m_fontButton.GetSafeHandle() == nullptr) {
@@ -216,10 +216,11 @@
void CRobotTaskDlg::OnBnClickedRestore()
{
- int ret = AfxMessageBox(_T("鐗╂枡灏嗕細琚惉杩愬洖鍘熶綅缃紝纭瑕佸洖鎾ゅ綋鍓嶄换鍔″悧锛熼櫎闈炲彂鐢熶簡寮傚父锛屽惁鍒欒涓嶈鍥炴挙浠诲姟锛�"), MB_OKCANCEL | MB_ICONEXCLAMATION);
+ // 鍥炴挙浠诲姟淇敼涓洪噸鍙戜换鍔�
+ int ret = AfxMessageBox(_T("纭瑕侀噸鏂颁笅鍙戜换鍔″悧锛�"), MB_OKCANCEL | MB_ICONEXCLAMATION);
if (ret != IDOK) {
return;
}
- theApp.m_model.getMaster().restoreCurrentTask();
+ theApp.m_model.getMaster().resendCurrentTask();
}
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/Common.h b/SourceCode/Bond/Servo/Common.h
index cc58f4f..7923773 100644
--- a/SourceCode/Bond/Servo/Common.h
+++ b/SourceCode/Bond/Servo/Common.h
@@ -18,6 +18,7 @@
#define RX_CODE_EQ_DATA_CHANGED 1010
#define RX_CODE_MASTER_STATE_CHANGED 1011
#define RX_CODE_EQ_ROBOT_TASK 1012
+#define RX_CODE_LOADPORT_INUSE 1013
/* Channel Name */
diff --git a/SourceCode/Bond/Servo/Configuration.cpp b/SourceCode/Bond/Servo/Configuration.cpp
index 5df0f4b..6402828 100644
--- a/SourceCode/Bond/Servo/Configuration.cpp
+++ b/SourceCode/Bond/Servo/Configuration.cpp
@@ -136,3 +136,18 @@
return TRUE;
}
+BOOL CConfiguration::setPortCassetteType(unsigned int index, int cassetteType)
+{
+ if (index >= 4) return FALSE;
+ if (cassetteType < 1 || 3 < cassetteType) return FALSE;
+
+ static char* pszSection[] = { "Port1", "Port2", "Port3", "Port4" };
+ WritePrivateProfileString(pszSection[index], _T("CassetteType"), std::to_string(cassetteType).c_str(), m_strFilepath);
+ return true;
+}
+
+BOOL CConfiguration::isCompareMapsBeforeProceeding()
+{
+ return GetPrivateProfileInt(_T("Master"), _T("CompareMapsBeforeProceeding"), 0, m_strFilepath);
+}
+
diff --git a/SourceCode/Bond/Servo/Configuration.h b/SourceCode/Bond/Servo/Configuration.h
index 1de8b08..036e811 100644
--- a/SourceCode/Bond/Servo/Configuration.h
+++ b/SourceCode/Bond/Servo/Configuration.h
@@ -24,6 +24,8 @@
int getFilterMode();
BOOL getPortParms(unsigned int index, BOOL& bEnable, int& type, int& mode,
int& cassetteType, int& transferMode, BOOL& bAutoChangeEnable);
+ BOOL setPortCassetteType(unsigned int index, int cassetteType);
+ BOOL isCompareMapsBeforeProceeding();
public:
void setP2RemoteEqReconnectInterval(int second);
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 6c36c56..7f3ed76 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -52,6 +52,12 @@
}
}
+void CModel::setPortCassetteType(unsigned int index, SERVO::CassetteType type)
+{
+ m_master.setPortCassetteType(index, type);
+ m_configuration.setPortCassetteType(index, (int)type);
+}
+
int CModel::init()
{
CString strIniFile;
@@ -274,6 +280,10 @@
notifyPtrAndInt(RX_CODE_EQ_ROBOT_TASK, pTask, nullptr, code);
};
+ masterListener.onLoadPortInUse = [&] (void* pMaster, SERVO::CEquipment* pEquipment, short scanMap) {
+ LOGE("<CModel>onLoadPortInUse. scanMap = %d", scanMap);
+ notifyPtr(RX_CODE_LOADPORT_INUSE, pEquipment);
+ };
m_master.setListener(masterListener);
@@ -281,7 +291,7 @@
CString strMasterDataFile;
strMasterDataFile.Format(_T("%s\\Master.dat"), (LPTSTR)(LPCTSTR)m_strWorkDir);
m_master.setCacheFilepath((LPTSTR)(LPCTSTR)strMasterDataFile);
-
+ m_master.setCompareMapsBeforeProceeding(m_configuration.isCompareMapsBeforeProceeding());
// 加载警告信息
AlarmManager& alarmManager = AlarmManager::getInstance();
diff --git a/SourceCode/Bond/Servo/Model.h b/SourceCode/Bond/Servo/Model.h
index d2c4e0c..0679568 100644
--- a/SourceCode/Bond/Servo/Model.h
+++ b/SourceCode/Bond/Servo/Model.h
@@ -15,6 +15,7 @@
SERVO::CMaster& getMaster();
void setWorkDir(const char* pszWorkDir);
void loadPortParams();
+ void setPortCassetteType(unsigned int index, SERVO::CassetteType type);
int init();
int term();
diff --git a/SourceCode/Bond/Servo/PortConfigurationDlg.cpp b/SourceCode/Bond/Servo/PortConfigurationDlg.cpp
index b60a1e1..62b883a 100644
--- a/SourceCode/Bond/Servo/PortConfigurationDlg.cpp
+++ b/SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -12,6 +12,9 @@
#include "ServoCommo.h"
+
+#define CHECKBOX_ALL_ID 0x1234
+
// CPortConfigurationDlg 瀵硅瘽妗�
IMPLEMENT_DYNAMIC(CPortConfigurationDlg, CDialogEx)
@@ -24,10 +27,18 @@
m_pPort[1] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT2));
m_pPort[2] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT3));
m_pPort[3] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT4));
+ m_nCurSelPort = -1;
+ m_pCheckBox = nullptr;
+ m_bCheckedAll = FALSE;
}
CPortConfigurationDlg::~CPortConfigurationDlg()
{
+}
+
+void CPortConfigurationDlg::setCurSelPort(int sel)
+{
+ m_nCurSelPort = sel;
}
int CPortConfigurationDlg::GetLoadPortEqID(const std::string& strPortName)
@@ -50,24 +61,42 @@
SetDlgItemText(IDC_EDIT_OPERATIONID, "");
m_comboMaterialsType.SetCurSel(0);
- SERVO::CSlot* pSlot = pPort->getSlot(0);
- if (pSlot == nullptr) {
- return;
- }
+ bool bJobInfoSet = false;
+ for (int i = 0; i < SLOT_MAX; ++i) {
+ SERVO::CSlot* pSlot = pPort->getSlot(i);
+ if (!pSlot) {
+ continue;
+ }
- SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
- if (pGlass != nullptr) {
- SERVO::CJobDataS* pJS = pGlass->getJobDataS();
- if (pJS) {
- SetDlgItemText(IDC_EDIT_LOTID, CString(pJS->getLotId().c_str()));
- SetDlgItemText(IDC_EDIT_PRODUCTID, CString(pJS->getProductId().c_str()));
- SetDlgItemText(IDC_EDIT_OPERATIONID, CString(pJS->getOperationId().c_str()));
- m_comboMaterialsType.SetCurSel(pJS->getMaterialsType() - 1);
+
+ // 璁剧疆 Panel ID 鍜屽嬀閫夋
+ SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
+ int nRow = i + 1;
+ if (pGlass != nullptr) {
+ m_wndGrid.SetItemState(nRow, 0, GVIS_READONLY);
+ m_wndGrid.SetItemText(nRow, 0, pSlot->getName().c_str());
+ m_wndGrid.SetCellType(nRow, 1, RUNTIME_CLASS(CGridCellCheck));
+ CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(nRow, 1));
+ ASSERT(pCheck);
+ pCheck->SetCheck(pGlass->isScheduledForProcessing());
+ pCheck->SetText(pGlass->getID().c_str());
+ }
+ m_wndGrid.SetItemData(nRow, 0, (LPARAM)pGlass);
+
+
+ // 鍥炲~ Job 淇℃伅锛堝彧鍙栫涓�涓湁鏁� Glass锛�
+ if (!bJobInfoSet && pGlass) {
+ SERVO::CJobDataS* pJS = pGlass->getJobDataS();
+ if (pJS) {
+ SetDlgItemText(IDC_EDIT_LOTID, CString(pJS->getLotId().c_str()));
+ SetDlgItemText(IDC_EDIT_PRODUCTID, CString(pJS->getProductId().c_str()));
+ SetDlgItemText(IDC_EDIT_OPERATIONID, CString(pJS->getOperationId().c_str()));
+ m_comboMaterialsType.SetCurSel(pJS->getMaterialsType() - 1);
+ bJobInfoSet = true;
+ }
}
}
-
- // 濉厖 Grid
- FillGrid(pSlot, pGlass);
+ m_pCheckBox->SetCheck(IsCheckedAll() ? BST_CHECKED : BST_UNCHECKED);
}
void CPortConfigurationDlg::InitGrid()
@@ -100,7 +129,8 @@
m_wndGrid.SetColumnWidth(nColIdx, 50);
m_wndGrid.SetItemText(0, nColIdx++, _T("Slot ID"));
m_wndGrid.SetColumnWidth(nColIdx, 60);
- m_wndGrid.SetItemText(0, nColIdx++, _T("鍚敤"));
+ m_wndGrid.SetItemText(0, nColIdx++, _T("Glass ID"));
+
// 璁剧疆琛屼负鏍峰紡
m_wndGrid.SetFixedRowSelection(FALSE);
@@ -123,46 +153,17 @@
for (int i = 0; i < nRows; ++i) {
m_wndGrid.SetRowHeight(i, nEachRowHeight);
}
-}
-void CPortConfigurationDlg::FillGrid(SERVO::CSlot* pSlot, SERVO::CGlass* pGlass)
-{
- //CStringArray recipeOptions;
- //recipeOptions.Add(_T("Recipe A"));
- //recipeOptions.Add(_T("Recipe B"));
- //recipeOptions.Add(_T("Recipe C"));
-
- // 鍘婚櫎琛ㄥご锛屼粠绗�2琛屽紑濮嬪~鍏呮暟鎹�
- for (int i = 1; i < SLOT_MAX + 1; ++i) {
- CString strIndex;
- strIndex.Format(_T("%d"), i);
- m_wndGrid.SetItemText(i, 0, strIndex);
- m_wndGrid.SetItemState(i, 0, GVIS_READONLY);
-
- if (i != 3) {
- // Checkbox
- m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellCheck));
- CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
- if (pCheck) {
- // 璁剧疆 Panel ID 鍜屽嬀閫夋
- CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
- if (pCheck && pSlot && pGlass) {
- pCheck->SetCheck(pSlot->isEnable() ? TRUE : FALSE);
- pCheck->SetText(pGlass ? pGlass->getID().c_str() : _T(""));
- }
- else {
- pCheck->SetCheck(FALSE);
- pCheck->SetText(_T(""));
- }
- }
- }
- else {
- m_wndGrid.SetItemState(i, 1, GVIS_READONLY);
- }
- }
-
- m_wndGrid.Invalidate();
- m_wndGrid.UpdateWindow();
+ CRect rect;
+ BOOL bOK = m_wndGrid.GetCellRect(0, 1, rect);
+ m_pCheckBox = new CCustomCheckBox();
+ m_pCheckBox->Create(_T("閫夋嫨鎵�鏈�"),
+ WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, // 鑷姩鍕鹃��
+ CRect(0, 0, 150, 32), &m_wndGrid, CHECKBOX_ALL_ID);
+ m_pCheckBox->SetFont(GetFont());
+ m_pCheckBox->MoveWindow(rect.left + 5, rect.top + 3, 150, rect.Height() - 6);
+ m_pCheckBox->SetBackgroundColor(g_nGridFixCellColor);
+ m_pCheckBox->SetNotifyHwnd(GetSafeHwnd());
}
void CPortConfigurationDlg::DoDataExchange(CDataExchange* pDX)
@@ -178,6 +179,10 @@
BEGIN_MESSAGE_MAP(CPortConfigurationDlg, CDialogEx)
ON_CBN_SELCHANGE(IDC_COMBO_PORT, &CPortConfigurationDlg::OnSelchangeComboPort)
ON_BN_CLICKED(IDC_BUTTON_APPLY, &CPortConfigurationDlg::OnBnClickedButtonApply)
+ ON_MESSAGE(WM_CHECKBOX_STATE_CHANGED, &CPortConfigurationDlg::OnCheckAllClicked)
+ ON_WM_DESTROY()
+ ON_BN_CLICKED(IDC_BUTTON_PROCESS_START, &CPortConfigurationDlg::OnBnClickedButtonProcessStart)
+ ON_BN_CLICKED(IDC_BUTTON_PROCESS_CANCEL, &CPortConfigurationDlg::OnBnClickedButtonProcessCancel)
END_MESSAGE_MAP()
@@ -193,7 +198,13 @@
for (const auto& item : ports) {
m_comboPort.AddString(item);
}
- m_comboPort.SetCurSel(0); // 榛樿閫夋嫨绗竴涓鍙�
+ if (0 <= m_nCurSelPort && m_nCurSelPort <= 3) {
+ m_comboPort.SetCurSel(m_nCurSelPort);
+ m_comboPort.EnableWindow(FALSE);
+ }
+ else {
+ m_comboPort.SetCurSel(0);
+ }
// 鍒濆鍖栭厤鏂逛笅鎷夋鍐呭
std::vector<std::string> vecRecipe = RecipeManager::getInstance().getAllPPID();
@@ -214,7 +225,21 @@
LoadPortConfigToUI(m_pPort[0]); // 榛樿鍔犺浇绗竴涓鍙g殑閰嶇疆
// 璁剧疆瀵硅瘽妗嗘爣棰�
- SetWindowText(_T("Port Configuration"));
+ BOOL bAutoPopup = 0 <= m_nCurSelPort && m_nCurSelPort <= 3;
+ if (bAutoPopup) {
+ CString strTitle;
+ strTitle.Format(_T("%s Configuration"), ports[m_nCurSelPort]);
+ SetWindowText(strTitle);
+ }
+ else {
+ SetWindowText(_T("Port Configuration"));
+ }
+
+
+ // Porcess Start / Process Cancel 鎸夐挳鐘舵��
+ GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(FALSE);
+ GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(FALSE);
+
return TRUE; // return TRUE unless you set the focus to a control
// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
@@ -287,35 +312,76 @@
}
// 鑾峰彇 Grid 琛ㄦ牸涓� Slot 鐘舵�侊紙绗�1~8琛岋級
- for (int i = 1; i <= 8; ++i) {
- SERVO::SlotConfig slot;
- slot.nSlotID = i;
+ for (int i = 1; i <= SLOT_MAX; ++i) {
+ SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0);
+ if (pGlass != nullptr) {
+ CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
+ ASSERT(pCheck);
+ pGlass->setScheduledForProcessing(pCheck->GetCheck());
+ pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
- CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
- if (pCheck) {
- slot.isEnabled = pCheck->GetCheck();
+ SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
+ pJobDataS->setLotId(config.strLotID.c_str());
+ pJobDataS->setProductId(config.strProductID.c_str());
+ pJobDataS->setOperationId(config.strOperationID.c_str());
+ pJobDataS->setMaterialsType(config.nMaterialType);
}
-
- config.vecSlot.push_back(slot);
}
- int nEqID = GetLoadPortEqID(config.strPortName);
- if (nEqID < 0) {
- AfxMessageBox(_T("鏈煡鐨勭鍙e悕绉帮紒"));
- return;
+ GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(TRUE);
+ GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(TRUE);
+}
+
+void CPortConfigurationDlg::OnDestroy()
+{
+ CDialogEx::OnDestroy();
+
+ if (m_pCheckBox != nullptr) {
+ m_pCheckBox->DestroyWindow();
+ delete m_pCheckBox;
+ m_pCheckBox = nullptr;
+ }
+}
+
+LRESULT CPortConfigurationDlg::OnCheckAllClicked(WPARAM wParam, LPARAM lParam)
+{
+ UINT ctrlID = (UINT)wParam;
+ BOOL bChecked = (BOOL)lParam;
+ for (int i = 1; i <= SLOT_MAX; ++i) {
+ CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
+ if (pCheck != nullptr) {
+ pCheck->SetCheck(bChecked);
+ }
}
- SERVO::CLoadPort* pPort = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(nEqID));
- if (!pPort) {
- AfxMessageBox(_T("鎵句笉鍒板搴旂殑 LoadPort 璁惧锛�"));
- return;
+
+ return 0;
+}
+
+BOOL CPortConfigurationDlg::IsCheckedAll()
+{
+ for (int i = 1; i <= SLOT_MAX; ++i) {
+ CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
+ if (pCheck != nullptr) {
+ if (!pCheck->GetCheck()) return FALSE;
+ }
}
- // 搴旂敤閰嶇疆锛堜緥濡傛祴璇曠敓鎴愮幓鐠冿級
- if (pPort->testGenerateGlassListFromConfig(config) < 0) {
- AfxMessageBox(_T("Failed to generate glass list from configuration!"));
- return;
- }
+ return TRUE;
+}
- OnOK();
-}
\ No newline at end of file
+void CPortConfigurationDlg::OnBnClickedButtonProcessStart()
+{
+ int selPort = (0 <= m_nCurSelPort && m_nCurSelPort <= 3) ? m_nCurSelPort
+ : m_comboPort.GetCurSel();
+ if (selPort < 0 || selPort >= 4) return;
+ m_pPort[selPort]->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+}
+
+void CPortConfigurationDlg::OnBnClickedButtonProcessCancel()
+{
+ int selPort = (0 <= m_nCurSelPort && m_nCurSelPort <= 3) ? m_nCurSelPort
+ : m_comboPort.GetCurSel();
+ if (selPort < 0 || selPort >= 4) return;
+ m_pPort[selPort]->sendCassetteCtrlCmd(CCC_PROCESS_CANCEL, nullptr, 0, 0, 0, nullptr, nullptr);
+}
diff --git a/SourceCode/Bond/Servo/PortConfigurationDlg.h b/SourceCode/Bond/Servo/PortConfigurationDlg.h
index e735153..0475d2d 100644
--- a/SourceCode/Bond/Servo/PortConfigurationDlg.h
+++ b/SourceCode/Bond/Servo/PortConfigurationDlg.h
@@ -2,6 +2,8 @@
#include "afxdialogex.h"
#include "GridCtrl.h"
#include "CLoadPort.h"
+#include "CCustomCheckBox.h"
+
// CPortConfigurationDlg 瀵硅瘽妗�
@@ -13,6 +15,10 @@
CPortConfigurationDlg(CWnd* pParent = nullptr); // 鏍囧噯鏋勯�犲嚱鏁�
virtual ~CPortConfigurationDlg();
+public:
+ void setCurSelPort(int sel);
+ BOOL IsCheckedAll();
+
// 瀵硅瘽妗嗘暟鎹�
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG_PORT_CONFIGURATION };
@@ -23,18 +29,28 @@
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeComboPort();
afx_msg void OnBnClickedButtonApply();
+ afx_msg LRESULT OnCheckAllClicked(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
private:
int GetLoadPortEqID(const std::string& strPortName);
void LoadPortConfigToUI(SERVO::CLoadPort* pPort);
void InitGrid();
- void FillGrid(SERVO::CSlot* pSlot, SERVO::CGlass* pGlass);
+private:
SERVO::CLoadPort* m_pPort[4];
+ int m_nCurSelPort;
CGridCtrl m_wndGrid;
CComboBox m_comboPort;
CComboBox m_comboRecipe;
CComboBox m_comboMaterialsType;
+
+ CCustomCheckBox* m_pCheckBox;
+ BOOL m_bCheckedAll;
+
+public:
+ afx_msg void OnDestroy();
+ afx_msg void OnBnClickedButtonProcessStart();
+ afx_msg void OnBnClickedButtonProcessCancel();
};
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index 9791e38..b7507b2 100644
--- a/SourceCode/Bond/Servo/Servo.rc
+++ b/SourceCode/Bond/Servo/Servo.rc
Binary files differ
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj b/SourceCode/Bond/Servo/Servo.vcxproj
index c3e7398..d3bbe72 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj
+++ b/SourceCode/Bond/Servo/Servo.vcxproj
@@ -200,6 +200,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="CBaseDlg.h" />
+ <ClInclude Include="CCustomCheckBox.h" />
<ClInclude Include="CEquipmentPage3.h" />
<ClInclude Include="CGlassPool.h" />
<ClInclude Include="ChangePasswordDlg.h" />
@@ -342,6 +343,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="CBaseDlg.cpp" />
+ <ClCompile Include="CCustomCheckBox.cpp" />
<ClCompile Include="CEquipmentPage3.cpp" />
<ClCompile Include="CGlassPool.cpp" />
<ClCompile Include="ChangePasswordDlg.cpp" />
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj.filters b/SourceCode/Bond/Servo/Servo.vcxproj.filters
index d4ed655..8b805ea 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj.filters
+++ b/SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -169,6 +169,7 @@
<ClCompile Include="InputDialog.cpp" />
<ClCompile Include="RecipeManager.cpp" />
<ClCompile Include="RecipeDeviceBindDlg.cpp" />
+ <ClCompile Include="CCustomCheckBox.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AlarmManager.h" />
@@ -343,6 +344,7 @@
<ClInclude Include="InputDialog.h" />
<ClInclude Include="RecipeManager.h" />
<ClInclude Include="RecipeDeviceBindDlg.h" />
+ <ClInclude Include="CCustomCheckBox.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Servo.rc" />
diff --git a/SourceCode/Bond/Servo/ServoCommo.h b/SourceCode/Bond/Servo/ServoCommo.h
index 09ca1d0..86fd6e3 100644
--- a/SourceCode/Bond/Servo/ServoCommo.h
+++ b/SourceCode/Bond/Servo/ServoCommo.h
@@ -209,5 +209,21 @@
/* EQ Data changed code */
#define EDCC_FETCHOUT_JOB 1000 /* 取片 */
#define EDCC_STORED_JOB 1001 /* 放片 */
+
+
+ /* Cassette Ctrl CMD */
+#define CCC_MAP_DOWNLOAD 1
+#define CCC_CLAMP 2
+#define CCC_UNCLAMP 3
+#define CCC_RECLAMP 4
+#define CCC_PROCESS_START 5
+#define CCC_PROCESS_START_BY_COUNT 6
+#define CCC_PROCESS_PAUSE 7
+#define CCC_PROCESS_RESUME 8
+#define CCC_PROCESS_ABORT 9
+#define CCC_PROCESS_CANCEL 10
+#define CCC_PROCESS_END 11
+#define CCC_ID_UPDATE 12
+#define CCC_MAP_UPDATE 13
}
diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 26b9e62..bde44da 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -241,6 +241,14 @@
}
}
}
+ else if (RX_CODE_LOADPORT_INUSE == code) {
+ SERVO::CLoadPort* pLoadPort = nullptr;
+ if (pAny->getPtrValue("ptr", (void*&)pLoadPort)) {
+ CPortConfigurationDlg dlg;
+ dlg.setCurSelPort(pLoadPort->getIndex());
+ dlg.DoModal();
+ }
+ }
pAny->release();
}, [&]() -> void {
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index af34923..7d6f58e 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
Binary files differ
--
Gitblit v1.9.3