From bea6407b376a4e426f0b120bae569fba6ab867db Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 08 十一月 2025 17:55:47 +0800
Subject: [PATCH] 1.CMaster.cpp 第 1644/1667/1691 行在记录 SV 曲线时通过 getGlassFromSlot(0) 取玻璃,而各设备的 initSlots() 都是从 1 开始编号(例如 CBonder.cpp (line 408)、CVacuumBake.cpp (line 415) 等)。槽位 0 永远不存在,所以 pGlass 始终是 nullptr,pGlass->addSVData(...) 的分支从未执行。结果 SERVO::CGlass::m_svDatas 里没有任何曲线数据,GlassJson::ToPrettyString 生成的 pretty 字符串也就没有 sv_datas,导出 CSV 时自然读不到曲线。 同一段代码还有一个潜在 Bug:虽然判断了 channel - 1 < bonderTypes.size(),但真正索引却用的是 bonderTypes[channel]。索引偏移会导致数据类型错位,最后一个通道甚至可能越界。即使修正了槽位,这里也需要同步改成 bonderTypes[channel - 1](另外两处 vacuumbakeTypes、coolingTypes 也一样)。
---
SourceCode/Bond/Servo/CPath.cpp | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/CPath.cpp b/SourceCode/Bond/Servo/CPath.cpp
index 3eb286b..5898b5b 100644
--- a/SourceCode/Bond/Servo/CPath.cpp
+++ b/SourceCode/Bond/Servo/CPath.cpp
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "CPath.h"
#include "ToolUnits.h"
+#include "CServoUtilsTool.h"
namespace SERVO {
@@ -10,19 +11,22 @@
m_timeOut = 0;
m_timeIn = CToolUnits::getTimestamp();
m_bProcessed = FALSE;
+ m_inspResult = InspResult::NotInspected;
m_pPrev = nullptr;
m_pNext = nullptr;
}
- CPath::CPath(unsigned int nEqId, unsigned int nUnit)
+ CPath::CPath(unsigned int nEqId, unsigned int nUnit, unsigned int nSlot)
{
m_nEqID = nEqId;
m_nUnit = nUnit;
+ m_nSlot = nSlot;
m_timeOut = 0;
m_timeIn = CToolUnits::getTimestamp();
+ m_bProcessed = FALSE;
+ m_inspResult = InspResult::NotInspected;
m_pPrev = nullptr;
m_pNext = nullptr;
- m_bProcessed = FALSE;
}
CPath::~CPath()
@@ -44,25 +48,36 @@
strOut = strOut + ">";
}
+ void CPath::getSimpleDescription(std::string& strOut)
+ {
+ strOut = CServoUtilsTool::getEqUnitName(m_nEqID, m_nUnit, m_nSlot);
+ }
+
void CPath::serialize(CArchive& ar)
{
if (ar.IsStoring()) {
ar << m_nEqID;
ar << m_nUnit;
+ ar << m_nSlot;
ar << m_timeIn;
ar << m_timeOut;
ar << m_bProcessed;
+ ar << (int)m_inspResult;
ar << (ULONGLONG)m_pNext;
if (m_pNext != nullptr) {
m_pNext->serialize(ar);
}
}
else {
+ int temp;
+
ar >> m_nEqID;
ar >> m_nUnit;
+ ar >> m_nSlot;
ar >> m_timeIn;
ar >> m_timeOut;
ar >> m_bProcessed;
+ ar >> temp; m_inspResult = (InspResult)temp;
ULONGLONG ulNext;
ar >> ulNext;
if ((CPath*)ulNext != nullptr) {
@@ -82,6 +97,16 @@
unsigned int CPath::getUnit()
{
return m_nUnit;
+ }
+
+ unsigned int CPath::getSlot()
+ {
+ return m_nSlot;
+ }
+
+ void CPath::setInTime(ULONGLONG time)
+ {
+ m_timeIn = time;
}
ULONGLONG CPath::getInTime()
@@ -109,6 +134,16 @@
return m_bProcessed;
}
+ void CPath::setInspResult(InspResult result)
+ {
+ m_inspResult = result;
+ }
+
+ InspResult CPath::getInspResult()
+ {
+ return m_inspResult;
+ }
+
CPath* CPath::getPrev()
{
return m_pPrev;
--
Gitblit v1.9.3