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/CMeasurement.cpp | 91 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 86 insertions(+), 5 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMeasurement.cpp b/SourceCode/Bond/Servo/CMeasurement.cpp
index 53ffb9c..67f9c9f 100644
--- a/SourceCode/Bond/Servo/CMeasurement.cpp
+++ b/SourceCode/Bond/Servo/CMeasurement.cpp
@@ -220,12 +220,13 @@
// recipe parameter report
CEqReadStep* pStep = new CEqReadStep(0x1aa54, 257 * 2,
[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+ CEqReadStep* pTmpStep = (CEqReadStep*)pFrom;
if (code == ROK && pszData != nullptr && size > 0) {
// 此处解释配方数据
short ret = decodeRecipeParameterReport(pszData, size);
- pStep->setReturnCode(ret);
+ pTmpStep->setReturnCode(ret);
}
- pStep->setReturnCode(MRLRC_OK);
+ pTmpStep->setReturnCode(MRLRC_OK);
return -1;
});
pStep->setName(STEP_EQ_RECIPE_PARAMETER);
@@ -333,6 +334,26 @@
}
}
+ // FAC Data Report
+ addFacDataReportStep(0x1a589, 0xf4d, 1);
+ /*
+ {
+ CEqReadStep* pStep = new CEqReadStep(0x1a589, 133 * 2,
+ [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+ if (code == ROK && pszData != nullptr && size > 0) {
+ decodeFacDataReport((CStep*)pFrom, pszData, size);
+ }
+ return -1;
+ });
+ pStep->setName(STEP_EQ_FAC_DATA_REPORT);
+ pStep->setProp("Port", (void*)1);
+ pStep->setWriteSignalDev(0xf4d);
+ if (addStep(STEP_ID_FAC_DATA_REPORT, pStep) != 0) {
+ delete pStep;
+ }
+ }
+ */
+
// process start/end report
{
CEqReadStep* pStep = new CEqReadStep(0x19D3F, 13 * 2,
@@ -417,7 +438,7 @@
return 35000;
}
- int CMeasurement::parsingParams(const char* pszData, size_t size, std::vector<CParam>& parsms)
+ int CMeasurement::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params)
{
ASSERT(pszData);
if (size < 250) return 0;
@@ -426,10 +447,70 @@
// 1.检测功能启用/禁用
v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
- parsms.push_back(CParam("检测功能启用/禁用", 0, "", v));
+ params.push_back(CParam("检测功能启用/禁用", "", this->getName().c_str(), v));
i += 2;
+ // 2.检测速度
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+ params.push_back(CParam("检测速度", "", this->getName().c_str(), v * 0.001));
+ i += 4;
- return (int)parsms.size();
+ return (int)params.size();
}
+
+ int CMeasurement::parsingProcessData(const char* pszData, size_t size, std::vector<CParam>& params)
+ {
+ ASSERT(pszData);
+ if (size < 250) return 0;
+ int i = 0, v;
+
+
+ // 1.检测功能启用/禁用
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+ params.push_back(CParam("检测功能启用/禁用", "", this->getName().c_str(), v));
+ i += 2;
+
+ // 2.检测速度
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+ params.push_back(CParam("检测速度", "", this->getName().c_str(), v * 0.001));
+ i += 4;
+
+ // 3.检测1数据
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+ params.push_back(CParam("检测1数据", "", this->getName().c_str(), v * 0.001));
+ i += 4;
+
+ // 4.检测2数据
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+ params.push_back(CParam("检测2数据", "", this->getName().c_str(), v * 0.001));
+ i += 4;
+
+ return (int)params.size();
+ }
+
+ int CMeasurement::parsingSVData(const char* pszData, size_t size, std::vector<CParam>& params)
+ {
+ /*/
+ 1 工艺运行步骤 1Word 123456
+ 2 AOI检测速度 2Word 123.456
+ */
+
+ ASSERT(pszData);
+ if (size < 125) return 0;
+ int i = 0, v;
+
+
+ // 1.工艺运行步骤
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+ params.push_back(CParam("工艺运行步骤", "", this->getName().c_str(), v));
+ i += 2;
+
+ // 2.检测速度
+ v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+ params.push_back(CParam("A腔温控表1当前值", "", this->getName().c_str(), v * 0.001f));
+ i += 4;
+
+ return (int)params.size();
+ }
+
}
--
Gitblit v1.9.3