From bd30f028a163c7293620064fc98744dacd41ceae Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 09 四月 2025 11:58:38 +0800
Subject: [PATCH] 1.CassetteControlCommand(cassette控制指令下发,测试页面)

---
 SourceCode/Bond/Servo/CPageGraph2.cpp            |    9 +
 SourceCode/Bond/Servo/Servo.vcxproj              |    6 
 SourceCode/Bond/Servo/CPageCassetteCtrlCmd.h     |   36 ++++
 SourceCode/Bond/Servo/resource.h                 |    0 
 SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.cpp |   49 ++++++
 SourceCode/Bond/Servo/CLoadPort.h                |    7 
 SourceCode/Bond/Servo/CJobDataB.cpp              |   48 ++++++
 SourceCode/Bond/Servo/CEFEM.h                    |    1 
 SourceCode/Bond/Servo/CLoadPort.cpp              |   35 ++++
 SourceCode/Bond/Servo/Servo.vcxproj.filters      |    6 
 SourceCode/Bond/Servo/CJobDataB.h                |   26 +++
 SourceCode/Bond/Servo/CStep.h                    |    3 
 SourceCode/Bond/Servo/CEquipment.cpp             |    6 
 SourceCode/Bond/Servo/Servo.rc                   |    0 
 SourceCode/Bond/Servo/CEFEM.cpp                  |   23 ++
 SourceCode/Bond/Servo/CMaster.cpp                |   24 +++
 SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp   |  116 ++++++++++++++
 SourceCode/Bond/Servo/CEquipment.h               |    7 
 SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.h   |   27 +++
 SourceCode/Bond/Servo/CStep.cpp                  |   11 +
 SourceCode/Bond/Servo/Common.h                   |    4 
 21 files changed, 442 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index 6b0548f..b77ed4a 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -36,6 +36,29 @@
 		LOGI("<CEFEM>initPins");
 	}
 
+	int CEFEM::onStepEvent(CStep* pStep, int code)
+	{
+		if (code == STEP_EVENT_READDATA) {
+			if (isCassetteTransferStateStep(pStep)) {
+				SERVO::CEqCassetteTransferStateStep* pEqCassetteStep = (SERVO::CEqCassetteTransferStateStep*)pStep;
+				int id = pEqCassetteStep->getID();
+				if (id == STEP_ID_PORT1_CASSETTIE_EMPTY) {
+
+				}
+/*
+	#define STEP_ID_PORT1_CASSETTIE_LOAD_READY		0x420
+	#define STEP_ID_PORT1_CASSETTIE_LOADED			0x428
+	#define STEP_ID_PORT1_CASSETTIE_INUSE			0x430
+	#define STEP_ID_PORT1_CASSETTIE_UNLOAD_READY	0x438
+	#define STEP_ID_PORT1_CASSETTIE_BLOCKED			0x440
+*/
+			}
+		}
+
+
+		return 0;
+	}
+
 	void CEFEM::onTimer(UINT nTimerid)
 	{
 		CEquipment::onTimer(nTimerid);
diff --git a/SourceCode/Bond/Servo/CEFEM.h b/SourceCode/Bond/Servo/CEFEM.h
index 35d8db2..df6ab8d 100644
--- a/SourceCode/Bond/Servo/CEFEM.h
+++ b/SourceCode/Bond/Servo/CEFEM.h
@@ -15,6 +15,7 @@
         virtual void init();
         virtual void term();
         virtual void initPins();
+        virtual int onStepEvent(CStep* pStep, int code);
         virtual void onTimer(UINT nTimerid);
         virtual void serialize(CArchive& ar);
         virtual void getAttributeVector(CAttributeVector& attrubutes);
diff --git a/SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.cpp b/SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.cpp
new file mode 100644
index 0000000..c59ab4d
--- /dev/null
+++ b/SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.cpp
@@ -0,0 +1,49 @@
+#include "stdafx.h"
+#include "CEqCassetteCtrlCmdStep.h"
+
+
+namespace SERVO {
+	CEqCassetteCtrlCmdStep::CEqCassetteCtrlCmdStep() : CWriteStep()
+	{
+		m_nCtrlCmdDev = 0;
+	}
+
+	CEqCassetteCtrlCmdStep::~CEqCassetteCtrlCmdStep()
+	{
+
+	}
+
+	void CEqCassetteCtrlCmdStep::setCtrlCmdDev(int nDev)
+	{
+		m_nCtrlCmdDev = nDev;
+	}
+
+	int CEqCassetteCtrlCmdStep::sendCtrlCmd(short cmd,
+		short* jobExistence,
+		int jobExistenceSize,
+		short slotProcess,
+		short jopCount,
+		CJobDataB* pJobDataB)
+	{
+		ASSERT(jobExistenceSize == 12);
+		ASSERT(pJobDataB);
+
+		char szBuffer[1024] = { 0 };
+		memcpy(&szBuffer[0], &cmd, sizeof(short));
+		memcpy(&szBuffer[2], jobExistence, sizeof(short) * jobExistenceSize);
+		memcpy(&szBuffer[26], &slotProcess, sizeof(short));
+		memcpy(&szBuffer[36], &jopCount, sizeof(short));
+		int nLen = pJobDataB->serialize(&szBuffer[38], 1024 - 38);
+		return writeData(m_nCtrlCmdDev, (const char*)szBuffer, 38 + nLen);
+	}
+
+	void CEqCassetteCtrlCmdStep::getAttributeVector(CAttributeVector& attrubutes)
+	{
+		CWriteStep::getAttributeVector(attrubutes);
+
+		std::string strTemp;
+		attrubutes.addAttribute(new CAttribute("Control Command Dev",
+			("W" + CToolUnits::toHexString(m_nCtrlCmdDev, strTemp)).c_str(), ""));
+	}
+}
+
diff --git a/SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.h b/SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.h
new file mode 100644
index 0000000..f0efa38
--- /dev/null
+++ b/SourceCode/Bond/Servo/CEqCassetteCtrlCmdStep.h
@@ -0,0 +1,27 @@
+#pragma once
+#include "CWriteStep.h"
+#include "CJobDataB.h"
+
+
+namespace SERVO {
+	class CEqCassetteCtrlCmdStep : public CWriteStep
+	{
+	public:
+		CEqCassetteCtrlCmdStep();
+		~CEqCassetteCtrlCmdStep();
+
+	public:
+		void setCtrlCmdDev(int nDev);
+		int sendCtrlCmd(short cmd,
+			short* jobExistence,
+			int jobExistenceSize,
+			short slotProcess, 
+			short jopCount,
+			CJobDataB* pJobDataB);
+		void getAttributeVector(CAttributeVector& attrubutes);
+
+	private:
+		int m_nCtrlCmdDev;
+	};
+}
+
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 85f5a0b..e61b4b3 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -121,6 +121,7 @@
 		auto iter = m_mapStep.find(addr);
 		if (iter != m_mapStep.end()) return -1;
 		pStep->setEquipment(this);
+		pStep->setID(addr);
 		pStep->setCcLink(m_pCclink);
 		m_mapStep[addr] = pStep;
 		return 0;
@@ -742,4 +743,9 @@
 		return CToolUnits::startsWith(pStep->getName(), STEP_ALARM_START);
 	}
 
+	bool CEquipment::isCassetteTransferStateStep(SERVO::CStep* pStep)
+	{
+		return CToolUnits::startsWith(pStep->getName(), "EQPort")
+			&& pStep->getName().find("Cassette") != std::string::npos;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 407b505..7dd0501 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -16,6 +16,7 @@
 #include "CEqPortChangeStep.h"
 #include "CEqReadIntStep.h"
 #include "CEqCassetteTransferStateStep.h"
+#include "CEqCassetteCtrlCmdStep.h"
 #include <vector>
 #include <map>
 #include <list>
@@ -104,6 +105,8 @@
 		CGlass* getFrontGlass();
 		BOOL removeClass(CGlass* pGlass);
 		bool isAlarmStep(SERVO::CStep* pStep);
+		bool isCassetteTransferStateStep(SERVO::CStep* pStep);
+
 
 	// 以下为从CC-Link读取到的Bit标志位检测函数
 	public:
@@ -140,7 +143,7 @@
 
 
 		// 以下为从CC-Link读取到的Bit标志位
-	private:
+	protected:
 		ALIVE m_alive;
 		BOOL m_bCimState;			// ON/OFF
 		BOOL m_bUpstreamInline;
@@ -149,7 +152,7 @@
 		BOOL m_bAutoRecipeChange;
 		BOOL m_bVCREnable[VCR_MAX];
 
-	private:
+	protected:
 		CCCLinkIEControl* m_pCclink;
 		std::map<unsigned int, CStep*> m_mapStep;
 		int m_nBaseAlarmId;
diff --git a/SourceCode/Bond/Servo/CJobDataB.cpp b/SourceCode/Bond/Servo/CJobDataB.cpp
new file mode 100644
index 0000000..efa4896
--- /dev/null
+++ b/SourceCode/Bond/Servo/CJobDataB.cpp
@@ -0,0 +1,48 @@
+#include "stdafx.h"
+#include "CJobDataB.h"
+
+
+namespace SERVO {
+	CJobDataB::CJobDataB()
+	{
+
+	}
+
+	CJobDataB::~CJobDataB()
+	{
+
+	}
+
+	int CJobDataB::serialize(char* pszBuffer, int nBufferSize)
+	{
+		int index = 0;
+		memcpy(&pszBuffer[index], &m_nPortNo, sizeof(short));
+		index += sizeof(short);
+
+		int strLen = min(20, m_strCarrierId.size());
+		memcpy(&pszBuffer[index], m_strCarrierId.c_str(), strLen);
+		index += strLen;
+
+		strLen = min(20, m_pruductId.size());
+		memcpy(&pszBuffer[index], m_pruductId.c_str(), strLen);
+		index += strLen;
+
+		memcpy(&pszBuffer[index], &m_nCarrierState, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nSlotMapping, sizeof(int));
+		index += sizeof(int);
+
+		memcpy(&pszBuffer[index], &m_nSlotSelectedFlag, sizeof(int));
+		index += sizeof(int);
+
+		for (int i = 0; i < min(25, m_glassIds.size()); i++) {
+			std::string& strGlassId = m_glassIds.at(i);
+			strLen = min(20, strGlassId.size());
+			memcpy(&pszBuffer[index], strGlassId.c_str(), strLen);
+			index += strLen;
+		}
+
+		return 320 * 2;
+	}
+}
diff --git a/SourceCode/Bond/Servo/CJobDataB.h b/SourceCode/Bond/Servo/CJobDataB.h
new file mode 100644
index 0000000..3644ad9
--- /dev/null
+++ b/SourceCode/Bond/Servo/CJobDataB.h
@@ -0,0 +1,26 @@
+#pragma once
+#include <vector>
+#include <string>
+
+
+namespace SERVO {
+	class CJobDataB
+	{
+	public:
+		CJobDataB();
+		~CJobDataB();
+
+	public:
+		int serialize(char* pszBuffer, int nBufferSize);
+
+	private:
+		short m_nPortNo;
+		std::string m_strCarrierId;
+		std::string m_pruductId;
+		short m_nCarrierState;
+		int m_nSlotMapping;
+		int m_nSlotSelectedFlag;
+		std::vector<std::string> m_glassIds;
+	};
+}
+
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index b881e5a..f736ee1 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -86,4 +86,39 @@
 
 		return (m_glassList.size() < 8);
 	}
+
+	int CLoadPort::sendCassetteCtrlCmd(short cmd,
+		short* jobExistence,
+		int jobExistenceSize,
+		short slotProcess,
+		short jopCount,
+		CJobDataB* pJobDataB)
+	{
+		int id = getID();
+		if ( !(id == EQ_ID_LOADPORT1 || id == EQ_ID_LOADPORT2) ) {
+			return -1;
+		}
+
+
+		SERVO::CEqCassetteCtrlCmdStep* pStep = (SERVO::CEqCassetteCtrlCmdStep*)getCassetteCtrlCmdStep();
+		ASSERT(pStep);
+		return pStep->sendCtrlCmd(cmd, jobExistence, jobExistenceSize, slotProcess, jopCount, pJobDataB);
+	}
+
+	CStep* CLoadPort::getCassetteCtrlCmdStep()
+	{
+		CStep* pStep = nullptr;
+		Lock();
+		for (auto item : m_mapStep) {
+			if (item.second->getName().find(STEP_EQ_P1_CASSETTE_CTRL_CMD) == 0
+				|| item.second->getName().find(STEP_EQ_P2_CASSETTE_CTRL_CMD) == 0
+				|| item.second->getName().find(STEP_EQ_P3_CASSETTE_CTRL_CMD) == 0
+				|| item.second->getName().find(STEP_EQ_P4_CASSETTE_CTRL_CMD) == 0) {
+				pStep = item.second;
+			}
+		}
+		Unlock();
+
+		return pStep;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CLoadPort.h b/SourceCode/Bond/Servo/CLoadPort.h
index 3fa8afd..a6b2831 100644
--- a/SourceCode/Bond/Servo/CLoadPort.h
+++ b/SourceCode/Bond/Servo/CLoadPort.h
@@ -23,6 +23,13 @@
 
 	public:
 		virtual int outputGlass(int port);
+		int sendCassetteCtrlCmd(short cmd,
+			short* jobExistence,
+			int jobExistenceSize,
+			short slotProcess,
+			short jopCount,
+			CJobDataB* pJobDataB);
+		CStep* getCassetteCtrlCmdStep();
 	};
 }
 
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index fff1ab0..6e00a3a 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -166,6 +166,17 @@
 	int CMaster::addLoadPort(int index)
 	{
 		ASSERT(index == 0 || index == 1 || index == 2 || index == 3);
+		static char* pszCassetteCtrlCmd[] = { 
+			STEP_EQ_P1_CASSETTE_CTRL_CMD,
+			STEP_EQ_P2_CASSETTE_CTRL_CMD,
+			STEP_EQ_P3_CASSETTE_CTRL_CMD,
+			STEP_EQ_P4_CASSETTE_CTRL_CMD
+		};
+		int nWriteSignalDev[] = {0x120, 0x121, 0x122, 0x123};
+		int nCtrlCmdDev[] = {0x45, 0x1a5, 0x305, 0x465};
+		int nStepDev[] = { 0x480, 0x481, 0x482, 0x483 };
+
+
 		char szName[64];
 		sprintf_s(szName, 64, "LoadPort %d", index + 1);
 		CLoadPort* pEquipment = new CLoadPort();
@@ -174,6 +185,19 @@
 		pEquipment->setDescription(szName);
 		addToEquipmentList(pEquipment);
 
+
+		// step
+		{
+			CEqCassetteCtrlCmdStep* pStep = new CEqCassetteCtrlCmdStep();
+			pStep->setName(pszCassetteCtrlCmd[index]);
+			pStep->setWriteSignalDev(nWriteSignalDev[index]);
+			pStep->setCtrlCmdDev(nCtrlCmdDev[index]);
+			if (pEquipment->addStep(nStepDev[index], pStep) != 0) {
+				delete pStep;
+			}
+		}
+
+
 		pEquipment->init();
 		LOGE("已添加“%s”.", pEquipment->getName().c_str());
 
diff --git a/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp b/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp
new file mode 100644
index 0000000..16f72f7
--- /dev/null
+++ b/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp
@@ -0,0 +1,116 @@
+锘�// CPageCassetteCtrlCmd.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "Servo.h"
+#include "CPageCassetteCtrlCmd.h"
+#include "afxdialogex.h"
+
+
+// CPageCassetteCtrlCmd 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CPageCassetteCtrlCmd, CHMPropertyPage)
+
+CPageCassetteCtrlCmd::CPageCassetteCtrlCmd(CWnd* pParent /*=nullptr*/)
+	: CHMPropertyPage(IDD_PAGE_CASSETTE_CTRL_CMD, pParent)
+{
+	m_pEquipment = nullptr;
+}
+
+CPageCassetteCtrlCmd::~CPageCassetteCtrlCmd()
+{
+}
+
+void CPageCassetteCtrlCmd::DoDataExchange(CDataExchange* pDX)
+{
+	CHMPropertyPage::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CPageCassetteCtrlCmd, CHMPropertyPage)
+	ON_WM_CTLCOLOR()
+	ON_WM_DESTROY()
+	ON_WM_SIZE()
+	ON_BN_CLICKED(IDC_BUTTON_SEND_CMD, &CPageCassetteCtrlCmd::OnBnClickedButtonSendCmd)
+END_MESSAGE_MAP()
+
+
+// CPageCassetteCtrlCmd 娑堟伅澶勭悊绋嬪簭
+void CPageCassetteCtrlCmd::OnApply()
+{
+	__super::OnApply();
+}
+
+void CPageCassetteCtrlCmd::setEquipment(SERVO::CEquipment* pEquipment)
+{
+	m_pEquipment = pEquipment;
+}
+
+BOOL CPageCassetteCtrlCmd::OnInitDialog()
+{
+	CHMPropertyPage::OnInitDialog();
+
+	const char* pszText[] = {"Cassette Map Download", "Clamp", "Unclamp",
+		"Reclamp", "Cassette Process Start", "Cassette Process Start By Count",
+		"Cassette Process Pause", "Cassette Process Resume", "Cassette Process Abort",
+		"Cassette Process Cancel", "Cassette Process End"};
+
+	CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_CASSETTE_CTRL_CMD);
+	for (int i = 0; i < 11; i++) {
+		pComboBox->InsertString(i, pszText[i]);
+	}
+	pComboBox->SetCurSel(0);
+
+
+	return TRUE;  // return TRUE unless you set the focus to a control
+				  // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+HBRUSH CPageCassetteCtrlCmd::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
+{
+	HBRUSH hbr = CHMPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
+
+	// TODO:  鍦ㄦ鏇存敼 DC 鐨勪换浣曠壒鎬�
+
+	// TODO:  濡傛灉榛樿鐨勪笉鏄墍闇�鐢荤瑪锛屽垯杩斿洖鍙︿竴涓敾绗�
+	return hbr;
+}
+
+void CPageCassetteCtrlCmd::OnDestroy()
+{
+	CHMPropertyPage::OnDestroy();
+}
+
+void CPageCassetteCtrlCmd::OnSize(UINT nType, int cx, int cy)
+{
+	CHMPropertyPage::OnSize(nType, cx, cy);
+}
+
+void CPageCassetteCtrlCmd::OnBnClickedButtonSendCmd()
+{
+	ASSERT(m_pEquipment != nullptr);
+	ASSERT(m_pEquipment->getID() == EQ_ID_LOADPORT1
+		|| m_pEquipment->getID() == EQ_ID_LOADPORT2);
+	SERVO::CLoadPort* pLoadPort = (SERVO::CLoadPort*)m_pEquipment;
+
+	short cmd = 0;
+	short jobExistence[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+	int jobExistenceSize = 12;
+	short slotProcess = 0;
+	short jobCount = 0;
+	SERVO::CJobDataB* pJobDataB = new SERVO::CJobDataB();
+
+
+	CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_CASSETTE_CTRL_CMD);
+	cmd = pComboBox->GetCurSel() + 1;
+	for (int i = 0; i < 12; i++) {
+		jobExistence[i] = (short)GetDlgItemInt(IDC_EDIT_EXISTENCE1 + i);
+	}
+
+	slotProcess = (short)GetDlgItemInt(IDC_EDIT_SLOT_TO_PROCESS);
+	jobCount = (short)GetDlgItemInt(IDC_EDIT_JOB_COUNT);
+
+
+	pLoadPort->sendCassetteCtrlCmd(cmd, &jobExistence[0], jobExistenceSize, slotProcess,
+		jobCount, pJobDataB);	
+}
diff --git a/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.h b/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.h
new file mode 100644
index 0000000..edec95f
--- /dev/null
+++ b/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.h
@@ -0,0 +1,36 @@
+锘�#pragma once
+#include "CHMPropertyPage.h"
+
+
+// CPageCassetteCtrlCmd 瀵硅瘽妗�
+
+class CPageCassetteCtrlCmd : public CHMPropertyPage
+{
+	DECLARE_DYNAMIC(CPageCassetteCtrlCmd)
+
+public:
+	CPageCassetteCtrlCmd(CWnd* pParent = nullptr);   // 鏍囧噯鏋勯�犲嚱鏁�
+	virtual ~CPageCassetteCtrlCmd();
+	virtual void OnApply();
+	void setEquipment(SERVO::CEquipment* pEquipment);
+
+private:
+	SERVO::CEquipment* m_pEquipment;
+
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+	enum { IDD = IDD_PAGE_CASSETTE_CTRL_CMD };
+#endif
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 鏀寔
+
+	DECLARE_MESSAGE_MAP()
+public:
+	virtual BOOL OnInitDialog();
+	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
+	afx_msg void OnDestroy();
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+	afx_msg void OnBnClickedButtonSendCmd();
+};
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index 4d6b07f..082667e 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -8,6 +8,7 @@
 #include "CHMPropertyDlg.h"
 #include "CEquipmentPage1.h"
 #include "CEquipmentPage2.h"
+#include "CPageCassetteCtrlCmd.h"
 
 
 // CPageGraph2 瀵硅瘽妗�
@@ -96,6 +97,14 @@
 		pPage2->Create(IDD_PAGE_EQUIPMENT2);
 		dlg.addPage(pPage2, "Glass");
 
+		if (pEquipment->getID() == EQ_ID_LOADPORT1
+			|| pEquipment->getID() == EQ_ID_LOADPORT2) {
+			CPageCassetteCtrlCmd* pPage = new CPageCassetteCtrlCmd();
+			pPage->setEquipment(pEquipment);
+			pPage->Create(IDD_PAGE_CASSETTE_CTRL_CMD);
+			dlg.addPage(pPage, "Cassette control command");
+		}
+
 		dlg.DoModal();
 		return true;
 	};
diff --git a/SourceCode/Bond/Servo/CStep.cpp b/SourceCode/Bond/Servo/CStep.cpp
index 0f23732..7ffc65d 100644
--- a/SourceCode/Bond/Servo/CStep.cpp
+++ b/SourceCode/Bond/Servo/CStep.cpp
@@ -6,6 +6,7 @@
 
 	CStep::CStep()
 	{
+		m_nID = 0;
 		m_pCclink = nullptr;
 		InitializeCriticalSection(&m_criticalSection);
 	}
@@ -30,6 +31,16 @@
 		return m_pEquipment;
 	}
 
+	void CStep::setID(int id)
+	{
+		m_nID = id;
+	}
+
+	int CStep::getID()
+	{
+		return m_nID;
+	}
+
 	void CStep::setName(const char* pszName)
 	{
 		m_strName = pszName;
diff --git a/SourceCode/Bond/Servo/CStep.h b/SourceCode/Bond/Servo/CStep.h
index aae469e..866e6f2 100644
--- a/SourceCode/Bond/Servo/CStep.h
+++ b/SourceCode/Bond/Servo/CStep.h
@@ -19,6 +19,8 @@
 		void setCcLink(CCCLinkIEControl* pCcLink);
 		void setEquipment(CEquipment* pEquipment);
 		CEquipment* getEquipment();
+		void setID(int id);
+		int getID();
 		void setName(const char* pszName);
 		std::string& getName();
 		virtual void getAttributeVector(CAttributeVector& attrubutes);
@@ -32,6 +34,7 @@
 		void convertString(const char* pszBuffer, int size, std::string& strOut);
 
 	protected:
+		int m_nID;
 		StationIdentifier m_station;
 		std::string m_strName;
 		CEquipment* m_pEquipment;
diff --git a/SourceCode/Bond/Servo/Common.h b/SourceCode/Bond/Servo/Common.h
index 84bc43e..6576532 100644
--- a/SourceCode/Bond/Servo/Common.h
+++ b/SourceCode/Bond/Servo/Common.h
@@ -128,6 +128,10 @@
 #define STEP_EQ_P4_CASSETTE_INUSE		_T("EQPort4CassetteInUse")
 #define STEP_EQ_P4_CASSETTE_UNLOAD_EADY	_T("EQPort4CassetteUnloadReady")
 #define STEP_EQ_P4_CASSETTE_BLOCKED		_T("EQPort4CassetteBlocked")
+#define STEP_EQ_P1_CASSETTE_CTRL_CMD	_T("EQPort1CassetteCtrlCmd")
+#define STEP_EQ_P2_CASSETTE_CTRL_CMD	_T("EQPort2CassetteCtrlCmd")
+#define STEP_EQ_P3_CASSETTE_CTRL_CMD	_T("EQPort3CassetteCtrlCmd")
+#define STEP_EQ_P4_CASSETTE_CTRL_CMD	_T("EQPort4CassetteCtrlCmd")
 
 
 /* Step ID */
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index b533912..a5b077d 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 36a12e3..8ec1d6a 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj
+++ b/SourceCode/Bond/Servo/Servo.vcxproj
@@ -204,6 +204,7 @@
     <ClInclude Include="CAttributeVector.h" />
     <ClInclude Include="CBakeCooling.h" />
     <ClInclude Include="CBonder.h" />
+    <ClInclude Include="CEqCassetteCtrlCmdStep.h" />
     <ClInclude Include="CEqCassetteTransferStateStep.h" />
     <ClInclude Include="CCLinkPerformance\CCLinkIEControl.h" />
     <ClInclude Include="CCLinkPerformance\PerformanceMelsec.h" />
@@ -225,9 +226,11 @@
     <ClInclude Include="CGlass.h" />
     <ClInclude Include="CHMPropertyDlg.h" />
     <ClInclude Include="CHMPropertyPage.h" />
+    <ClInclude Include="CJobDataB.h" />
     <ClInclude Include="CLoadPort.h" />
     <ClInclude Include="CMeasurement.h" />
     <ClInclude Include="ColorTransfer.h" />
+    <ClInclude Include="CPageCassetteCtrlCmd.h" />
     <ClInclude Include="CPageGraph1.h" />
     <ClInclude Include="CPageGraph2.h" />
     <ClInclude Include="CPanelAttributes.h" />
@@ -280,6 +283,7 @@
     <ClCompile Include="CAttributeVector.cpp" />
     <ClCompile Include="CBakeCooling.cpp" />
     <ClCompile Include="CBonder.cpp" />
+    <ClCompile Include="CEqCassetteCtrlCmdStep.cpp" />
     <ClCompile Include="CEqCassetteTransferStateStep.cpp" />
     <ClCompile Include="CCLinkPerformance\CCLinkIEControl.cpp" />
     <ClCompile Include="CCLinkPerformance\PerformanceMelsec.cpp" />
@@ -301,9 +305,11 @@
     <ClCompile Include="CGlass.cpp" />
     <ClCompile Include="CHMPropertyDlg.cpp" />
     <ClCompile Include="CHMPropertyPage.cpp" />
+    <ClCompile Include="CJobDataB.cpp" />
     <ClCompile Include="CLoadPort.cpp" />
     <ClCompile Include="CMeasurement.cpp" />
     <ClCompile Include="ColorTransfer.cpp" />
+    <ClCompile Include="CPageCassetteCtrlCmd.cpp" />
     <ClCompile Include="CPageGraph1.cpp" />
     <ClCompile Include="CPageGraph2.cpp" />
     <ClCompile Include="CPanelAttributes.cpp" />
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj.filters b/SourceCode/Bond/Servo/Servo.vcxproj.filters
index 00faaa0..f288998 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj.filters
+++ b/SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -82,6 +82,9 @@
     <ClCompile Include="CEqPortChangeStep.cpp" />
     <ClCompile Include="CEqReadIntStep.cpp" />
     <ClCompile Include="CEqCassetteTransferStateStep.cpp" />
+    <ClCompile Include="CEqCassetteCtrlCmdStep.cpp" />
+    <ClCompile Include="CJobDataB.cpp" />
+    <ClCompile Include="CPageCassetteCtrlCmd.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="AlarmManager.h" />
@@ -162,6 +165,9 @@
     <ClInclude Include="CEqPortChangeStep.h" />
     <ClInclude Include="CEqReadIntStep.h" />
     <ClInclude Include="CEqCassetteTransferStateStep.h" />
+    <ClInclude Include="CEqCassetteCtrlCmdStep.h" />
+    <ClInclude Include="CJobDataB.h" />
+    <ClInclude Include="CPageCassetteCtrlCmd.h" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Servo.rc" />
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index a676416..1098369 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
Binary files differ

--
Gitblit v1.9.3