From 72f3802bd7ab24b672c951a287787b5dea253f3b Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期六, 02 八月 2025 10:48:36 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang

---
 SourceCode/Bond/Servo/CEquipment.cpp |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 0d99db6..322923d 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -1292,6 +1292,21 @@
 		return nullptr;
 	}
 
+	CSlot* CEquipment::isSlotAvailable(unsigned int slot)
+	{
+		if (slot >= 8) return nullptr;
+		if (!m_slot[slot].isEnable()) return nullptr;
+		if (m_slot[slot].isLock()) return nullptr;
+		if (!m_slot[slot].isEmpty()) return nullptr;
+		int lsPath = m_slot[slot].getLinkSignalPath();
+		if (!m_bLinkSignalToDownstream[lsPath][SIGNAL_UPSTREAM_INLINE]
+			|| m_bLinkSignalToDownstream[lsPath][SIGNAL_UPSTREAM_TROUBLE]
+			|| !m_bLinkSignalToDownstream[lsPath][SIGNAL_INTERLOCK]
+			|| !m_bLinkSignalToDownstream[lsPath][SIGNAL_RECEIVE_ABLE]) return nullptr;
+
+		return &m_slot[slot];
+	}
+
 	CSlot* CEquipment::getNonEmptySlot(MaterialsType putSlotType)
 	{
 		for (int i = 0; i < SLOT_MAX; i++) {
@@ -1364,6 +1379,22 @@
 		return nullptr;
 	}
 
+	CSlot* CEquipment::getProcessedSlotCt(unsigned int slot)
+	{
+		if (slot >= 8) return nullptr;
+		if (!m_slot[slot].isEnable()) return nullptr;
+		if (m_slot[slot].isLock()) return nullptr;
+		CGlass* pGlass = (CGlass*)m_slot[slot].getContext();
+		if (pGlass == nullptr) return nullptr;
+		int lsPath = m_slot[slot].getLinkSignalPath();
+		if (!m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_INLINE]
+			|| m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_TROUBLE]
+			|| !m_bLinkSignalToUpstream[lsPath][SIGNAL_INTERLOCK]
+			|| !m_bLinkSignalToUpstream[lsPath][SIGNAL_SEND_ABLE]) return nullptr;
+		
+		return &m_slot[slot];
+	}
+
 	CSlot* CEquipment::getInspFailSlot()
 	{
 		for (int i = 0; i < SLOT_MAX; i++) {

--
Gitblit v1.9.3