| | |
| | | #include "RecipeManager.h" |
| | | #include <fstream> |
| | | #include "SerializeUtil.h" |
| | | #include "CServoUtilsTool.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | |
| | | |
| | | // 以下加入到曲线数据中 |
| | | |
| | | |
| | | const int64_t ts = now_ms_epoch(); |
| | | int eqid = ((CEquipment*)pEquipment)->getID(); |
| | | if (eqid == EQ_ID_Bonder1 || eqid == EQ_ID_Bonder2) { |
| | | m_pCollector->buffersPush(eqid, 1, ts, params.at(1).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 2, ts, params.at(2).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 3, ts, params.at(3).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 4, ts, params.at(4).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 5, ts, params.at(5).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 6, ts, params.at(6).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 7, ts, params.at(7).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 8, ts, params.at(8).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 9, ts, params.at(9).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 10, ts, params.at(10).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 11, ts, params.at(11).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 12, ts, params.at(12).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 13, ts, params.at(13).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 14, ts, params.at(14).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 15, ts, params.at(15).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 16, ts, params.at(16).getDoubleValue()); |
| | | // 定义 Bonder 的特定映射 |
| | | std::vector<std::pair<int, int>> bonderMapping = { |
| | | {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, |
| | | {8, 8}, {9, 9}, {10, 10}, {11, 11}, {12, 12}, {13, 13}, {14, 14}, {15, 15}, {16, 16} |
| | | }; |
| | | |
| | | CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(0); |
| | | auto& dataTypes = CServoUtilsTool::getEqDataTypes(); |
| | | auto& bonderTypes = dataTypes[eqid]; |
| | | for (const auto& mapping : bonderMapping) { |
| | | int paramIndex = mapping.first; |
| | | int channel = mapping.second; |
| | | |
| | | if (paramIndex < params.size() && channel - 1 < bonderTypes.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()); |
| | | } |
| | | } |
| | | } |
| | | else if (eqid == EQ_ID_VACUUMBAKE) { |
| | | m_pCollector->buffersPush(eqid, 1, ts, params.at(1).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 2, ts, params.at(2).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 3, ts, params.at(3).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 4, ts, params.at(4).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 5, ts, params.at(5).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 6, ts, params.at(6).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 7, ts, params.at(7).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 8, ts, params.at(10).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 9, ts, params.at(11).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 10, ts, params.at(12).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 11, ts, params.at(13).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 12, ts, params.at(14).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 13, ts, params.at(15).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 14, ts, params.at(16).getDoubleValue()); |
| | | // 定义 VACUUMBAKE 的特定映射 |
| | | std::vector<std::pair<int, int>> vacuumMapping = { |
| | | {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, |
| | | {10, 8}, {11, 9}, {12, 10}, {13, 11}, {14, 12}, {15, 13}, {16, 14} |
| | | }; |
| | | |
| | | CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(0); |
| | | 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 < vacuumbakeTypes.size()) { |
| | | if (m_pCollector != nullptr) |
| | | m_pCollector->buffersPush(eqid, channel, ts, params.at(paramIndex).getDoubleValue()); |
| | | if (pGlass != nullptr) |
| | | pGlass->addSVData(eqid, vacuumbakeTypes[channel], ts, params.at(paramIndex).getDoubleValue()); |
| | | } |
| | | } |
| | | } |
| | | else if (eqid == EQ_ID_BAKE_COOLING) { |
| | | m_pCollector->buffersPush(eqid, 1, ts, params.at(1).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 2, ts, params.at(2).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 3, ts, params.at(3).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 4, ts, params.at(4).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 5, ts, params.at(5).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 6, ts, params.at(6).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 7, ts, params.at(11).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 8, ts, params.at(12).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 9, ts, params.at(13).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 10, ts, params.at(14).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 11, ts, params.at(15).getDoubleValue()); |
| | | m_pCollector->buffersPush(eqid, 12, ts, params.at(16).getDoubleValue()); |
| | | // 定义 BAKE_COOLING 的特定映射 |
| | | std::vector<std::pair<int, int>> coolingMapping = { |
| | | {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, |
| | | {11, 7}, {12, 8}, {13, 9}, {14, 10}, {15, 11}, {16, 12} |
| | | }; |
| | | |
| | | CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(0); |
| | | auto& dataTypes = CServoUtilsTool::getEqDataTypes(); |
| | | auto& coolingTypes = dataTypes[eqid]; |
| | | for (const auto& mapping : coolingMapping) { |
| | | int paramIndex = mapping.first; |
| | | int channel = mapping.second; |
| | | |
| | | if (paramIndex < params.size() && channel - 1 < coolingTypes.size()) { |
| | | if (m_pCollector != nullptr) |
| | | m_pCollector->buffersPush(eqid, channel, ts, params.at(paramIndex).getDoubleValue()); |
| | | if (pGlass != nullptr) |
| | | pGlass->addSVData(eqid, coolingTypes[channel], ts, params.at(paramIndex).getDoubleValue()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 2) 为通道设置“曲线名称” |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 1, "气囊压力"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 2, "上腔压力"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 3, "管道真空规值"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 4, "腔体真空规值"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 5, "上腔温度1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 6, "上腔温度2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 7, "上腔温度3"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 8, "上腔温度4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 9, "上腔温度5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 10, "上腔温度6"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 11, "下腔温度1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 12, "下腔温度2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 13, "下腔温度3"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 14, "下腔温度4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 15, "下腔温度5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 16, "下腔温度6"); |
| | | 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()); |
| | | } |
| | | |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 1, "气囊压力"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 2, "上腔压力"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 3, "管道真空规值"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 4, "腔体真空规值"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 5, "上腔温度1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 6, "上腔温度2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 7, "上腔温度3"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 8, "上腔温度4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 9, "上腔温度5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 10, "上腔温度6"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 11, "下腔温度1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 12, "下腔温度2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 13, "下腔温度3"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 14, "下腔温度4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 15, "下腔温度5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 16, "下腔温度6"); |
| | | 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()); |
| | | } |
| | | |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 1, "A腔真空规值"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 2, "A腔温控1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 3, "A腔温控2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 4, "A腔温控4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 5, "A腔温控5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 6, "A腔温控6"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 7, "A腔温控7"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 8, "B腔真空规值"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 9, "B腔温控1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 10, "B腔温控2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 11, "B腔温控4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 12, "B腔温控5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 13, "B腔温控6"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 14, "B腔温控7"); |
| | | |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 1, "A烘烤温控1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 2, "A烘烤温控2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 3, "A烘烤温控4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 4, "A烘烤温控5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 5, "A烘烤温控6"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 6, "A烘烤温控7"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 7, "B烘烤温控1"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 8, "B烘烤温控2"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 9, "B烘烤温控4"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 10, "B烘烤温控5"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 11, "B烘烤温控6"); |
| | | m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 12, "B烘烤温控7"); |
| | | 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()); |
| | | } |
| | | } |
| | | } |
| | | } |