From 3628a707a38e1c590216c5983c9b97b9c742f86c Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期一, 24 三月 2025 09:01:42 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
SourceCode/Bond/Servo/CLoadPort.cpp | 79 +++++++++++++++++++++++++++++++++++++++
1 files changed, 79 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
new file mode 100644
index 0000000..079b3f2
--- /dev/null
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -0,0 +1,79 @@
+#include "stdafx.h"
+#include "CLoadPort.h"
+
+
+namespace SERVO {
+ CLoadPort::CLoadPort() : CEquipment()
+ {
+
+ }
+
+ CLoadPort::~CLoadPort()
+ {
+
+ }
+
+ const char* CLoadPort::getClassName()
+ {
+ static char* pszName = "CLoadPort";
+ return pszName;
+ }
+
+ void CLoadPort::init()
+ {
+ CEquipment::init();
+ }
+
+ void CLoadPort::term()
+ {
+ CEquipment::term();
+ }
+
+ // 必须要实现的虚函数,在此初始化Pin列表
+ void CLoadPort::initPins()
+ {
+ // 加入Pin初始化代码
+ LOGI("<CLoadPort>initPins");
+ addPin(SERVO::PinType::INPUT, _T("In"));
+ addPin(SERVO::PinType::OUTPUT, _T("Out1"));
+ addPin(SERVO::PinType::OUTPUT, _T("Out2"));
+ }
+
+ void CLoadPort::onTimer(UINT nTimerid)
+ {
+ CEquipment::onTimer(nTimerid);
+ }
+
+ void CLoadPort::serialize(CArchive& ar)
+ {
+ CEquipment::serialize(ar);
+ }
+
+ void CLoadPort::getAttributeVector(CAttributeVector& attrubutes)
+ {
+ __super::getAttributeVector(attrubutes);
+ }
+
+ int CLoadPort::recvIntent(CPin* pPin, CIntent* pIntent)
+ {
+ return __super::recvIntent(pPin, pIntent);
+ }
+
+ int CLoadPort::outputGlass(int port)
+ {
+ // 如果列表中没有Panel,模拟生成10张
+ if (m_panelList.empty()) {
+ static int ii = 0;
+ char szBuffer[64];
+ LOGI("<CLoadPort>模拟生成10张PANEL");
+ for (int i = 0; i < 10; i++) {
+ sprintf_s(szBuffer, "P20250320A1A%d", ++ii);
+ CPanel* pPanel = new CPanel();
+ pPanel->setID(szBuffer);
+ addPanelToList(pPanel);
+ }
+ }
+
+ return __super::outputGlass(port);
+ }
+}
--
Gitblit v1.9.3