| | |
| | | this->saveState(); |
| | | LOGE("<Master>ProcessJob(%s)完成.", |
| | | pJob->id().c_str()); |
| | | processJobFromInPorcessToComplete(pJob); |
| | | if (m_listener.onPjEnd != nullptr) { |
| | | m_listener.onPjEnd(this, pJob); |
| | | } |
| | |
| | | LOGI("<Master>onProcessStateChanged<%d>", (int)state); |
| | | if (state == PROCESS_STATE::Processing) { |
| | | if (pGlass != nullptr) { |
| | | m_pCollector->batchStart(eqid, |
| | | m_pCollector->batchStart(SlotToMid(eqid, slotNo), |
| | | pGlass->getID().c_str(), 10 * 60 * 1000ULL); |
| | | } |
| | | } |
| | | else if (state == PROCESS_STATE::Complete) { |
| | | m_pCollector->batchStop(eqid); |
| | | if (pGlass != nullptr) { |
| | | m_pCollector->batchStop(SlotToMid(eqid, slotNo)); |
| | | } |
| | | } |
| | | }; |
| | | listener.onMapMismatch = [&](void* pEquipment, short scanMap, short downMap) { |
| | |
| | | |
| | | CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(2); |
| | | auto& dataTypes = CServoUtilsTool::getEqDataTypes(); |
| | | auto& bonderTypes = dataTypes[eqid]; |
| | | auto& bonderTypes = dataTypes[SlotToMid(eqid, 2)]; |
| | | 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()); |
| | | m_pCollector->buffersPush(SlotToMid(eqid, 2), channel, ts, params.at(paramIndex).getDoubleValue()); |
| | | if(pGlass != nullptr) |
| | | pGlass->addSVData(eqid, bonderTypes[channel - 1], ts, params.at(paramIndex).getDoubleValue()); |
| | | } |
| | |
| | | CGlass* pGlass1 = ((CEquipment*)pEquipment)->getGlassFromSlot(1); |
| | | CGlass* pGlass2 = ((CEquipment*)pEquipment)->getGlassFromSlot(2); |
| | | auto& dataTypes = CServoUtilsTool::getEqDataTypes(); |
| | | auto& vacuumbakeTypes = dataTypes[eqid]; |
| | | auto& vacuumbakeTypes = dataTypes[SlotToMid(eqid, 1)]; |
| | | LOGD("<Master>onSVDataReport 003 : %d", vacuumMapping.size()); |
| | | for (const auto& mapping : vacuumMapping) { |
| | | int paramIndex = mapping.first; |
| | | int channel = mapping.second; |
| | | |
| | | if (paramIndex < params.size() && channel - 1 < vacuumbakeTypes.size()) { |
| | | double value = params.at(paramIndex).getDoubleValue(); |
| | | auto& param = params.at(paramIndex); |
| | | double value = param.getDoubleValue(); |
| | | const std::string& dataType = vacuumbakeTypes[channel - 1]; |
| | | if (m_pCollector != nullptr) |
| | | m_pCollector->buffersPush(eqid, channel, ts, value); |
| | | const std::string& paramName = param.getName(); |
| | | const char slotTag = !paramName.empty() ? paramName[0] : '\0'; |
| | | |
| | | if (m_pCollector != nullptr) { |
| | | if (slotTag == 'A') |
| | | m_pCollector->buffersPush(SlotToMid(eqid, 1), channel, ts, value); |
| | | else if (slotTag == 'B') |
| | | m_pCollector->buffersPush(SlotToMid(eqid, 2), channel, ts, value); |
| | | } |
| | | |
| | | // 根据腔体前缀写入对应 Slot 的玻璃 |
| | | if (pGlass1 != nullptr && !dataType.empty() && dataType[0] == 'A') |
| | | if (pGlass1 != nullptr && !dataType.empty() && slotTag == 'A') |
| | | pGlass1->addSVData(eqid, dataType, ts, value); |
| | | if (pGlass2 != nullptr && !dataType.empty() && dataType[0] == 'B') |
| | | if (pGlass2 != nullptr && !dataType.empty() && slotTag == 'B') |
| | | pGlass2->addSVData(eqid, dataType, ts, value); |
| | | } |
| | | } |
| | |
| | | CGlass* pGlass3 = ((CEquipment*)pEquipment)->getGlassFromSlot(3); // B Bake |
| | | CGlass* pGlass4 = ((CEquipment*)pEquipment)->getGlassFromSlot(4); // B Cool |
| | | auto& dataTypes = CServoUtilsTool::getEqDataTypes(); |
| | | auto& coolingTypes = dataTypes[eqid]; |
| | | auto& coolingTypes = dataTypes[SlotToMid(eqid, 1)]; |
| | | LOGD("<Master>onSVDataReport 003B : %d", coolingMapping.size()); |
| | | auto addToGlass = [&](CGlass* glass, const std::string& type, double val) { |
| | | if (glass != nullptr) |
| | |
| | | int channel = mapping.second; |
| | | |
| | | if (paramIndex < params.size() && channel - 1 < coolingTypes.size()) { |
| | | double value = params.at(paramIndex).getDoubleValue(); |
| | | auto& param = params.at(paramIndex); |
| | | double value = param.getDoubleValue(); |
| | | const std::string& dataType = coolingTypes[channel - 1]; |
| | | if (m_pCollector != nullptr) |
| | | m_pCollector->buffersPush(eqid, channel, ts, value); |
| | | const std::string& paramName = param.getName(); |
| | | const char slotTag = !paramName.empty() ? paramName[0] : '\0'; |
| | | const bool paramIsBake = paramName.find("烘烤") != std::string::npos; |
| | | const bool paramIsCooling = paramName.find("冷却") != std::string::npos; |
| | | |
| | | if (m_pCollector != nullptr && paramIsBake) { |
| | | if (slotTag == 'A') |
| | | m_pCollector->buffersPush(SlotToMid(eqid, 1), channel, ts, value); |
| | | else if (slotTag == 'B') |
| | | m_pCollector->buffersPush(SlotToMid(eqid, 3), channel, ts, value); |
| | | } |
| | | |
| | | if (!dataType.empty()) { |
| | | const bool isBake = dataType.find("烘烤") != std::string::npos; |
| | | const bool isCooling = dataType.find("冷却") != std::string::npos; |
| | | switch (dataType[0]) { |
| | | switch (slotTag) { |
| | | case 'A': |
| | | if (isBake) |
| | | if (paramIsBake) |
| | | addToGlass(pGlass1, dataType, value); |
| | | else if (isCooling) |
| | | else if (paramIsCooling) |
| | | addToGlass(pGlass2, dataType, value); |
| | | break; |
| | | case 'B': |
| | | if (isBake) |
| | | if (paramIsBake) |
| | | addToGlass(pGlass3, dataType, value); |
| | | else if (isCooling) |
| | | else if (paramIsCooling) |
| | | addToGlass(pGlass4, dataType, value); |
| | | break; |
| | | default: |
| | |
| | | |
| | | // 1) 注册机台(推荐:先注册 id + 机器名称) |
| | | RetentionPolicy defP; defP.mode = RetainMode::ByCount; defP.maxSamples = 200; |
| | | m_pCollector->registryAddMachine(EQ_ID_Bonder1, "Bonder1", defP); |
| | | m_pCollector->registryAddMachine(EQ_ID_Bonder2, "Bonder2", defP); |
| | | m_pCollector->registryAddMachine(EQ_ID_VACUUMBAKE, "前烘烤", defP); |
| | | m_pCollector->registryAddMachine(EQ_ID_BAKE_COOLING, "烘烤冷却", defP); |
| | | m_pCollector->registryAddMachine(MID_Bonder1, "Bonder1", defP); |
| | | m_pCollector->registryAddMachine(MID_Bonder2, "Bonder2", defP); |
| | | m_pCollector->registryAddMachine(MID_VacuumBakeA, "前烘-A", defP); |
| | | m_pCollector->registryAddMachine(MID_VacuumBakeB, "前烘-B", defP); |
| | | m_pCollector->registryAddMachine(MID_BakeCoolingA, "后烘-A", defP); |
| | | m_pCollector->registryAddMachine(MID_BakeCoolingB, "后烘-B", defP); |
| | | |
| | | |
| | | // 2) 为通道设置“曲线名称” |
| | | auto& dataTypes = CServoUtilsTool::getEqDataTypes(); |
| | | auto& bonderTypes = dataTypes[EQ_ID_Bonder1]; |
| | | auto& bonderTypes = dataTypes[MID_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(MID_Bonder1, i + 1, bonderTypes[i].c_str()); |
| | | m_pCollector->buffersSetChannelName(MID_Bonder2, i + 1, bonderTypes[i].c_str()); |
| | | } |
| | | |
| | | auto& vacuumbakeTypes = dataTypes[EQ_ID_VACUUMBAKE]; |
| | | auto& vacuumbakeTypes = dataTypes[MID_VacuumBakeA]; |
| | | for (size_t i = 0; i < vacuumbakeTypes.size(); ++i) { |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, i + 1, vacuumbakeTypes[i].c_str()); |
| | | m_pCollector->buffersSetChannelName(MID_VacuumBakeA, i + 1, vacuumbakeTypes[i].c_str()); |
| | | m_pCollector->buffersSetChannelName(MID_VacuumBakeB, i + 1, vacuumbakeTypes[i].c_str()); |
| | | } |
| | | |
| | | auto& coolingTypes = dataTypes[EQ_ID_BAKE_COOLING]; |
| | | auto& coolingTypes = dataTypes[MID_BakeCoolingA]; |
| | | for (size_t i = 0; i < coolingTypes.size(); ++i) { |
| | | m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, i + 1, coolingTypes[i].c_str()); |
| | | m_pCollector->buffersSetChannelName(MID_BakeCoolingA, i + 1, coolingTypes[i].c_str()); |
| | | m_pCollector->buffersSetChannelName(MID_BakeCoolingB, i + 1, coolingTypes[i].c_str()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | uint32_t CMaster::SlotToMid(int eqid, int slot) |
| | | { |
| | | if (eqid == EQ_ID_Bonder1) { |
| | | return MID_Bonder1; |
| | | } |
| | | |
| | | if (eqid == EQ_ID_Bonder2) { |
| | | return MID_Bonder2; |
| | | } |
| | | |
| | | if (eqid == EQ_ID_VACUUMBAKE) { |
| | | if(slot == 1) |
| | | return MID_VacuumBakeA; |
| | | if (slot == 2) |
| | | return MID_VacuumBakeB; |
| | | } |
| | | |
| | | if (eqid == EQ_ID_BAKE_COOLING) { |
| | | if (slot == 1) |
| | | return MID_BakeCoolingA; |
| | | if (slot == 3) |
| | | return MID_BakeCoolingB; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | } |