From cfcab53b0e7d5918c79cc77f0f447730682f94b1 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 14 十月 2025 11:31:03 +0800
Subject: [PATCH] 1.glass, 保存csv
---
SourceCode/Bond/Servo/CMaster.cpp | 47 +++++++++++++----------------------------------
1 files changed, 13 insertions(+), 34 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index c7c5f61..6f5cbd7 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -6,35 +6,10 @@
#include "RecipeManager.h"
#include <fstream>
#include "SerializeUtil.h"
+#include "CServoUtilsTool.h"
namespace SERVO {
- static std::unordered_map<int, std::vector<std::string>> MACHINE_DATA_TYPES = {
- {EQ_ID_Bonder1, {
- "气囊压力", "上腔压力", "管道真空规值", "腔体真空规值",
- "上腔温度1", "上腔温度2", "上腔温度3", "上腔温度4",
- "上腔温度5", "上腔温度6", "下腔温度1", "下腔温度2",
- "下腔温度3", "下腔温度4", "下腔温度5", "下腔温度6"
- }},
- {EQ_ID_Bonder2, {
- "气囊压力", "上腔压力", "管道真空规值", "腔体真空规值",
- "上腔温度1", "上腔温度2", "上腔温度3", "上腔温度4",
- "上腔温度5", "上腔温度6", "下腔温度1", "下腔温度2",
- "下腔温度3", "下腔温度4", "下腔温度5", "下腔温度6"
- }},
- {EQ_ID_VACUUMBAKE, {
- "A腔真空规值", "A腔温控1", "A腔温控2", "A腔温控4",
- "A腔温控5", "A腔温控6", "A腔温控7", "B腔真空规值",
- "B腔温控1", "B腔温控2", "B腔温控4", "B腔温控5",
- "B腔温控6", "B腔温控7"
- }},
- {EQ_ID_BAKE_COOLING, {
- "A烘烤温控1", "A烘烤温控2", "A烘烤温控4", "A烘烤温控5",
- "A烘烤温控6", "A烘烤温控7", "B烘烤温控1", "B烘烤温控2",
- "B烘烤温控4", "B烘烤温控5", "B烘烤温控6", "B烘烤温控7"
- }}
- };
-
static inline int64_t now_ms_epoch() {
using namespace std::chrono;
return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
@@ -1662,7 +1637,8 @@
};
CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(0);
- auto& bonderTypes = MACHINE_DATA_TYPES[eqid];
+ auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+ auto& bonderTypes = dataTypes[eqid];
for (const auto& mapping : bonderMapping) {
int paramIndex = mapping.first;
int channel = mapping.second;
@@ -1683,16 +1659,17 @@
};
CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(0);
- auto& bonderTypes = MACHINE_DATA_TYPES[eqid];
+ auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+ auto& vacuumbakeTypes = dataTypes[eqid];
for (const auto& mapping : vacuumMapping) {
int paramIndex = mapping.first;
int channel = mapping.second;
- if (paramIndex < params.size() && channel - 1 < bonderTypes.size()) {
+ if (paramIndex < params.size() && channel - 1 < vacuumbakeTypes.size()) {
if (m_pCollector != nullptr)
m_pCollector->buffersPush(eqid, channel, ts, params.at(paramIndex).getDoubleValue());
if (pGlass != nullptr)
- pGlass->addSVData(eqid, bonderTypes[channel], ts, params.at(paramIndex).getDoubleValue());
+ pGlass->addSVData(eqid, vacuumbakeTypes[channel], ts, params.at(paramIndex).getDoubleValue());
}
}
}
@@ -1704,7 +1681,8 @@
};
CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(0);
- auto& coolingTypes = MACHINE_DATA_TYPES[eqid];
+ auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+ auto& coolingTypes = dataTypes[eqid];
for (const auto& mapping : coolingMapping) {
int paramIndex = mapping.first;
int channel = mapping.second;
@@ -3161,18 +3139,19 @@
// 2) 为通道设置“曲线名称”
- auto& bonderTypes = MACHINE_DATA_TYPES[EQ_ID_Bonder1];
+ auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+ auto& bonderTypes = dataTypes[EQ_ID_Bonder1];
for (size_t i = 0; i < bonderTypes.size(); ++i) {
m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, i + 1, bonderTypes[i].c_str());
m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, i + 1, bonderTypes[i].c_str());
}
- auto& vacuumbakeTypes = MACHINE_DATA_TYPES[EQ_ID_VACUUMBAKE];
+ auto& vacuumbakeTypes = dataTypes[EQ_ID_VACUUMBAKE];
for (size_t i = 0; i < bonderTypes.size(); ++i) {
m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, i + 1, vacuumbakeTypes[i].c_str());
}
- auto& coolingTypes = MACHINE_DATA_TYPES[EQ_ID_BAKE_COOLING];
+ auto& coolingTypes = dataTypes[EQ_ID_BAKE_COOLING];
for (size_t i = 0; i < bonderTypes.size(); ++i) {
m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, i + 1, coolingTypes[i].c_str());
}
--
Gitblit v1.9.3