From cacea2da59a3acd73f3161d819a10e0060762616 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期二, 06 五月 2025 14:54:13 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp b/SourceCode/Bond/Servo/CPageCassetteCtrlCmd.cpp
new file mode 100644
index 0000000..0b36e1e
--- /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::CJobDataA* pJobDataA = new SERVO::CJobDataA();
+
+
+ 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, pJobDataA);
+}
--
Gitblit v1.9.3