1.Trace Data,ProcessData, SVData等上报
| | |
| | | strOut.append(szBuffer); |
| | | } |
| | | LOGD("<CMaster-%s>SVDataReport:%s", ((CEquipment*)pEquipment)->getName().c_str(), strOut.c_str()); |
| | | |
| | | if (m_listener.onSVDataReport != nullptr) { |
| | | m_listener.onSVDataReport(this, (CEquipment*)pEquipment, params); |
| | | } |
| | | }; |
| | | listener.onPanelDataReport = [&](void* pEquipment, void* pContext) { |
| | | LOGD("<CMaster-%s>onPanelDataReport", ((CEquipment*)pEquipment)->getName().c_str()); |
| | |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, short status, __int64 data)> ONLOADPORTSTATUSCHANGED; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int slotNo, PROCESS_STATE prevState, PROCESS_STATE state)> ONPROCESSSTATECHANGED; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORTEX; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONSVDATAREPORT; |
| | | typedef std::function<void(void* pMaster, int round)> ONCTROUNDEND; |
| | | typedef std::function<void(void* pMaster, void* pj)> ONPJSTART; |
| | | typedef std::function<void(void* pMaster)> ONCONTROLJOBCHANGED; |
| | |
| | | ONROBOTTASKEVENT onRobotTaskEvent; |
| | | ONLOADPORTSTATUSCHANGED onLoadPortStatusChanged; |
| | | ONPROCESSSTATECHANGED onProcessStateChanged; |
| | | ONSVDATAREPORT onSVDataReport; |
| | | ONPROCESSDATAREPORTEX onProcessDataReport; |
| | | ONCTROUNDEND onCTRoundEnd; |
| | | ONPJSTART onCjStart; |
| | |
| | | #include "CParam.h" |
| | | #include <algorithm> |
| | | #include <iomanip> |
| | | #include <sstream> |
| | | #include <array> |
| | | #include <map> |
| | | |
| | | |
| | |
| | | |
| | | |
| | | SERVO::MasterListener masterListener; |
| | | auto formatParamValue = [](const CParam& p) { |
| | | std::ostringstream oss; |
| | | oss.setf(std::ios::fixed); |
| | | oss << std::setprecision(4) << p.getDoubleValue(); |
| | | return oss.str(); |
| | | }; |
| | | masterListener.onMasterStateChanged = [&](void* pMaster, SERVO::MASTERSTATE state) -> void { |
| | | LOGI("<CModel>Master state changed(%d)", (int)state); |
| | | notify(RX_CODE_MASTER_STATE_CHANGED); |
| | |
| | | } |
| | | }); |
| | | }; |
| | | masterListener.onSVDataReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, const std::vector<CParam>& params) { |
| | | (void)pMaster; |
| | | const int eqId = pEquipment ? pEquipment->getID() : 0; |
| | | |
| | | auto sendSv = [&](const auto& vidMap, const char* evName) { |
| | | const size_t count = (std::min)(params.size(), vidMap.size()); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str()); |
| | | for (size_t idx = 0; idx < count; ++idx) { |
| | | const std::string val = formatParamValue(params[idx]); |
| | | m_hsmsPassive.setVariableValue(std::to_string(vidMap[idx]).c_str(), val.c_str()); |
| | | } |
| | | m_hsmsPassive.requestEventReportSend(evName); |
| | | }); |
| | | }; |
| | | |
| | | if (eqId == EQ_ID_Bonder1 || eqId == EQ_ID_Bonder2) { |
| | | static constexpr std::array<int, 19> vids = { |
| | | 6000,6001,6002,6003,6004,6005,6006,6007,6008,6009, |
| | | 6010,6011,6012,6013,6014,6015,6016,6017,6018 |
| | | }; |
| | | sendSv(vids, "BonderSVData"); |
| | | } |
| | | else if (eqId == EQ_ID_VACUUMBAKE) { |
| | | static constexpr std::array<int, 18> vids = { |
| | | 6200,6201,6202,6203,6204,6205,6206,6207,6208, |
| | | 6209,6210,6211,6212,6213,6214,6215,6216,6217 |
| | | }; |
| | | sendSv(vids, "VacuumBakeSVData"); |
| | | } |
| | | else if (eqId == EQ_ID_BAKE_COOLING) { |
| | | static constexpr std::array<int, 20> vids = { |
| | | 6400,6401,6402,6403,6404,6405,6406,6407,6408,6409, |
| | | 6410,6411,6412,6413,6414,6415,6416,6417,6418,6419 |
| | | }; |
| | | sendSv(vids, "BakeCoolingSVData"); |
| | | } |
| | | else if (eqId == EQ_ID_MEASUREMENT) { |
| | | static constexpr std::array<int, 2> vids = { 6600, 6601 }; |
| | | sendSv(vids, "MeasurementSVData"); |
| | | } |
| | | }; |
| | | masterListener.onProcessDataReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, const std::vector<CParam>& params) { |
| | | (void)pMaster; |
| | | const int eqId = pEquipment ? pEquipment->getID() : 0; |
| | | if (eqId != EQ_ID_Bonder1 && eqId != EQ_ID_Bonder2) return; |
| | | |
| | | auto formatVal = [](const CParam& p) { |
| | | std::ostringstream oss; |
| | | oss.setf(std::ios::fixed); |
| | | oss << std::setprecision(4) << p.getDoubleValue(); |
| | | return oss.str(); |
| | | auto sendProcess = [&](const auto& vidMap, const char* evName) { |
| | | const size_t count = (std::min)(params.size(), vidMap.size()); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str()); |
| | | for (size_t idx = 0; idx < count; ++idx) { |
| | | const std::string val = formatParamValue(params[idx]); |
| | | m_hsmsPassive.setVariableValue(std::to_string(vidMap[idx]).c_str(), val.c_str()); |
| | | } |
| | | m_hsmsPassive.requestEventReportSend(evName); |
| | | }); |
| | | }; |
| | | |
| | | static const int vidMap[] = { |
| | | 6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110, |
| | | 6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121 |
| | | }; |
| | | const size_t count = (std::min)(params.size(), sizeof(vidMap) / sizeof(vidMap[0])); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str()); |
| | | for (size_t idx = 0; idx < count; ++idx) { |
| | | auto& p = params[idx]; |
| | | std::string val = formatVal(p); |
| | | m_hsmsPassive.setVariableValue(std::to_string(vidMap[idx]).c_str(), val.c_str()); |
| | | } |
| | | m_hsmsPassive.requestEventReportSend("BonderProcessData"); |
| | | }); |
| | | if (eqId == EQ_ID_Bonder1 || eqId == EQ_ID_Bonder2) { |
| | | static constexpr std::array<int, 22> vids = { |
| | | 6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110, |
| | | 6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121 |
| | | }; |
| | | sendProcess(vids, "BonderProcessData"); |
| | | } |
| | | else if (eqId == EQ_ID_VACUUMBAKE) { |
| | | static constexpr std::array<int, 5> vids = { 6300,6301,6302,6303,6304 }; |
| | | sendProcess(vids, "VacuumBakeProcessData"); |
| | | } |
| | | else if (eqId == EQ_ID_BAKE_COOLING) { |
| | | static constexpr std::array<int, 4> vids = { 6500,6501,6502,6503 }; |
| | | sendProcess(vids, "BakeCoolingProcessData"); |
| | | } |
| | | else if (eqId == EQ_ID_MEASUREMENT) { |
| | | static constexpr std::array<int, 4> vids = { 6700,6701,6702,6703 }; |
| | | sendProcess(vids, "MeasurementProcessData"); |
| | | } |
| | | }; |
| | | masterListener.onCTRoundEnd = [&](void* pMaster, int round) { |
| | | m_configuration.setContinuousTransferCount(round); |
| | |
| | | 50020,PortStateChange,,(50020) |
| | | 60000,BonderSVData,,(60000) |
| | | 61000,BonderProcessData,,(61000) |
| | | 62000,VacuumBakeSVData,,(62000) |
| | | 63000,VacuumBakeProcessData,,(63000) |
| | | 64000,BakeCoolingSVData,,(64000) |
| | | 65000,BakeCoolingProcessData,,(65000) |
| | | 66000,MeasurementSVData,,(66000) |
| | | 67000,MeasurementProcessData,,(67000) |
| | | 12000,UnitStart,,(12000) |
| | | 12001,UnitStateChange,,(12001) |
| | | 12002,UnitEnd,,(12002) |
| | |
| | | 50020,(500,5020,5021) |
| | | 60000,(500,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018) |
| | | 61000,(500,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121) |
| | | 62000,(500,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217) |
| | | 63000,(500,6300,6301,6302,6303,6304) |
| | | 64000,(500,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419) |
| | | 65000,(500,6500,6501,6502,6503) |
| | | 66000,(500,6600,6601) |
| | | 67000,(500,6700,6701,6702,6703) |
| | | 10015,(5018,5019) |
| | | 10016,(5018,5019) |
| | | 10017,(500,5018) |
| | |
| | | 6119,Bonder_PD_LowerPinHeatDistance,A20,Bonder ProcessData |
| | | 6120,Bonder_PD_PumpGaugeSet,A20,Bonder ProcessData |
| | | 6121,Bonder_PD_TurboReachSet,A20,Bonder ProcessData |
| | | 6200,VacuumBake_SV_A_ProcessStep,A20,VacuumBake SV |
| | | 6201,VacuumBake_SV_A_ChamberVacuum,A20,VacuumBake SV |
| | | 6202,VacuumBake_SV_A_Temp1,A20,VacuumBake SV |
| | | 6203,VacuumBake_SV_A_Temp2,A20,VacuumBake SV |
| | | 6204,VacuumBake_SV_A_Temp4,A20,VacuumBake SV |
| | | 6205,VacuumBake_SV_A_Temp5,A20,VacuumBake SV |
| | | 6206,VacuumBake_SV_A_Temp6,A20,VacuumBake SV |
| | | 6207,VacuumBake_SV_A_Temp7,A20,VacuumBake SV |
| | | 6208,VacuumBake_SV_A_BakeRemaining,A20,VacuumBake SV |
| | | 6209,VacuumBake_SV_B_ProcessStep,A20,VacuumBake SV |
| | | 6210,VacuumBake_SV_B_ChamberVacuum,A20,VacuumBake SV |
| | | 6211,VacuumBake_SV_B_Temp1,A20,VacuumBake SV |
| | | 6212,VacuumBake_SV_B_Temp2,A20,VacuumBake SV |
| | | 6213,VacuumBake_SV_B_Temp4,A20,VacuumBake SV |
| | | 6214,VacuumBake_SV_B_Temp5,A20,VacuumBake SV |
| | | 6215,VacuumBake_SV_B_Temp6,A20,VacuumBake SV |
| | | 6216,VacuumBake_SV_B_Temp7,A20,VacuumBake SV |
| | | 6217,VacuumBake_SV_B_BakeRemaining,A20,VacuumBake SV |
| | | 6300,VacuumBake_PD_ParamIndex,A20,VacuumBake ProcessData |
| | | 6301,VacuumBake_PD_HeatTime,A20,VacuumBake ProcessData |
| | | 6302,VacuumBake_PD_BreakVacuumTime,A20,VacuumBake ProcessData |
| | | 6303,VacuumBake_PD_VacuumReach,A20,VacuumBake ProcessData |
| | | 6304,VacuumBake_PD_TempSet,A20,VacuumBake ProcessData |
| | | 6400,BakeCooling_SV_A_BakeStep,A20,BakeCooling SV |
| | | 6401,BakeCooling_SV_A_Temp1,A20,BakeCooling SV |
| | | 6402,BakeCooling_SV_A_Temp2,A20,BakeCooling SV |
| | | 6403,BakeCooling_SV_A_Temp4,A20,BakeCooling SV |
| | | 6404,BakeCooling_SV_A_Temp5,A20,BakeCooling SV |
| | | 6405,BakeCooling_SV_A_Temp6,A20,BakeCooling SV |
| | | 6406,BakeCooling_SV_A_Temp7,A20,BakeCooling SV |
| | | 6407,BakeCooling_SV_A_BakeRemaining,A20,BakeCooling SV |
| | | 6408,BakeCooling_SV_A_CoolStep,A20,BakeCooling SV |
| | | 6409,BakeCooling_SV_A_CoolRemaining,A20,BakeCooling SV |
| | | 6410,BakeCooling_SV_B_BakeStep,A20,BakeCooling SV |
| | | 6411,BakeCooling_SV_B_Temp1,A20,BakeCooling SV |
| | | 6412,BakeCooling_SV_B_Temp2,A20,BakeCooling SV |
| | | 6413,BakeCooling_SV_B_Temp4,A20,BakeCooling SV |
| | | 6414,BakeCooling_SV_B_Temp5,A20,BakeCooling SV |
| | | 6415,BakeCooling_SV_B_Temp6,A20,BakeCooling SV |
| | | 6416,BakeCooling_SV_B_Temp7,A20,BakeCooling SV |
| | | 6417,BakeCooling_SV_B_BakeRemaining,A20,BakeCooling SV |
| | | 6418,BakeCooling_SV_B_CoolStep,A20,BakeCooling SV |
| | | 6419,BakeCooling_SV_B_CoolRemaining,A20,BakeCooling SV |
| | | 6500,BakeCooling_PD_ParamIndex,A20,BakeCooling ProcessData |
| | | 6501,BakeCooling_PD_TimeOrTemp1,A20,BakeCooling ProcessData |
| | | 6502,BakeCooling_PD_TimeOrTemp2,A20,BakeCooling ProcessData |
| | | 6503,BakeCooling_PD_Reserved,A20,BakeCooling ProcessData |
| | | 6600,Measurement_SV_ProcessStep,A20,Measurement SV |
| | | 6601,Measurement_SV_AOIScore,A20,Measurement SV |
| | | 6700,Measurement_PD_ParamIndex,A20,Measurement ProcessData |
| | | 6701,Measurement_PD_Time,A20,Measurement ProcessData |
| | | 6702,Measurement_PD_Value1,A20,Measurement ProcessData |
| | | 6703,Measurement_PD_Value2,A20,Measurement ProcessData |
| | | 10200,SlotMap,U2,SlotMap(Scan) |
| | | 10201,SlotMapScan,U2,SlotMap(Scan) |
| | | 10202,SlotMapDownload,U2,SlotMap(Download) |