Merge branch 'clh'
# Conflicts:
# SourceCode/Bond/Servo/CPageGraph1.cpp
# SourceCode/Bond/Servo/PageAlarm.cpp
# SourceCode/Bond/Servo/PageLog.cpp
# SourceCode/Bond/Servo/ProductionLogDlg.cpp
# SourceCode/Bond/Servo/ProductionLogDlg.h
# SourceCode/Bond/Servo/Servo.cpp
# SourceCode/Bond/Servo/Servo.rc
# SourceCode/Bond/Servo/Servo.vcxproj
# SourceCode/Bond/Servo/Servo.vcxproj.filters
# SourceCode/Bond/Servo/Servo.vcxproj.user
# SourceCode/Bond/Servo/ServoDlg.cpp
# SourceCode/Bond/Servo/ServoDlg.h
已重命名4个文件
已添加6个文件
已修改67个文件
已删除1个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CArm.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | CArm::CArm() : CEquipment() |
| | | { |
| | | } |
| | | |
| | | CArm::~CArm() |
| | | { |
| | | |
| | | } |
| | | |
| | | const char* CArm::getClassName() |
| | | { |
| | | static char* pszName = "CArm"; |
| | | return pszName; |
| | | } |
| | | |
| | | void CArm::init() |
| | | { |
| | | CEquipment::init(); |
| | | } |
| | | |
| | | void CArm::term() |
| | | { |
| | | CEquipment::term(); |
| | | } |
| | | |
| | | // å¿
é¡»è¦å®ç°çè彿°ï¼å¨æ¤åå§åPinå表 |
| | | void CArm::initPins() |
| | | { |
| | | |
| | | } |
| | | |
| | | void CArm::onTimer(UINT nTimerid) |
| | | { |
| | | CEquipment::onTimer(nTimerid); |
| | | } |
| | | |
| | | void CArm::serialize(CArchive& ar) |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CArm::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CArm::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | |
| | | int CArm::tempStore(CGlass* pGlass) |
| | | { |
| | | // ä¿è¯å表ä¸åªåå¨ä¸ä¸ªç©æ |
| | | Lock(); |
| | | for (auto item : m_glassList) { |
| | | item->release(); |
| | | } |
| | | m_glassList.clear(); |
| | | addGlassToList(pGlass); |
| | | Unlock(); |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CArm::tempFetchOut(OUT CGlass*& pGlass) |
| | | { |
| | | Lock(); |
| | | if (m_glassList.empty()) { |
| | | Unlock(); |
| | | return -1; |
| | | } |
| | | |
| | | pGlass = m_glassList.front(); |
| | | pGlass->addRef(); |
| | | for (auto item : m_glassList) { |
| | | item->release(); |
| | | } |
| | | m_glassList.clear(); |
| | | Unlock(); |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include "CEquipment.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | class CArm : public CEquipment |
| | | { |
| | | public: |
| | | CArm(); |
| | | virtual ~CArm(); |
| | | |
| | | public: |
| | | virtual const char* getClassName(); |
| | | virtual BOOL isArm() { return TRUE; }; |
| | | virtual void init(); |
| | | virtual void term(); |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | |
| | | public: |
| | | int tempStore(CGlass* pGlass); |
| | | |
| | | // è°ç¨tempFetchOutåï¼pGlasså¿
é¡»release䏿¬¡ |
| | | int tempFetchOut(OUT CGlass*& pGlass); |
| | | }; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CArmTray.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | CArmTray::CArmTray() : CEquipment() |
| | | { |
| | | } |
| | | |
| | | CArmTray::~CArmTray() |
| | | { |
| | | |
| | | } |
| | | |
| | | const char* CArmTray::getClassName() |
| | | { |
| | | static char* pszName = "CArmTray"; |
| | | return pszName; |
| | | } |
| | | |
| | | void CArmTray::init() |
| | | { |
| | | CEquipment::init(); |
| | | } |
| | | |
| | | void CArmTray::term() |
| | | { |
| | | CEquipment::term(); |
| | | } |
| | | |
| | | // å¿
é¡»è¦å®ç°çè彿°ï¼å¨æ¤åå§åPinå表 |
| | | void CArmTray::initPins() |
| | | { |
| | | |
| | | } |
| | | |
| | | void CArmTray::onTimer(UINT nTimerid) |
| | | { |
| | | CEquipment::onTimer(nTimerid); |
| | | } |
| | | |
| | | void CArmTray::serialize(CArchive& ar) |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CArmTray::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CArmTray::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include "CEquipment.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | class CArmTray : public CEquipment |
| | | { |
| | | public: |
| | | CArmTray(); |
| | | virtual ~CArmTray(); |
| | | |
| | | public: |
| | | virtual const char* getClassName(); |
| | | virtual void init(); |
| | | virtual void term(); |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | namespace SERVO { |
| | | CAttribute::CAttribute() |
| | | { |
| | | |
| | | m_nWeight = 0; |
| | | } |
| | | |
| | | CAttribute::CAttribute(const char* pszName, const char* pszValue, const char* pszDescription) |
| | | CAttribute::CAttribute(const char* pszName, const char* pszValue, const char* pszDescription, unsigned int weight) |
| | | { |
| | | m_strName = pszName; |
| | | m_strValue = pszValue; |
| | | m_strDescription = pszDescription; |
| | | m_nWeight = weight; |
| | | } |
| | | |
| | | CAttribute::~CAttribute() |
| | |
| | | { |
| | | return m_strDescription; |
| | | } |
| | | |
| | | unsigned int CAttribute::getWeight() |
| | | { |
| | | return m_nWeight; |
| | | } |
| | | } |
| | |
| | | { |
| | | public: |
| | | CAttribute(); |
| | | CAttribute(const char* pszName, const char* pszValue, const char* pszDescription); |
| | | CAttribute(const char* pszName, const char* pszValue, const char* pszDescription, unsigned int weight); |
| | | ~CAttribute(); |
| | | |
| | | public: |
| | | std::string& getName(); |
| | | std::string& getValue(); |
| | | std::string& getDescription(); |
| | | unsigned int getWeight(); |
| | | |
| | | private: |
| | | std::string m_strName; |
| | | std::string m_strValue; |
| | | std::string m_strDescription; |
| | | unsigned int m_nWeight; // æéï¼ç¨äºæåº |
| | | }; |
| | | } |
| | | |
| | |
| | | #include "stdafx.h" |
| | | #include "CAttributeVector.h" |
| | | #include <algorithm> |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | m_attributes.clear(); |
| | | } |
| | | |
| | | void CAttributeVector::addAttribute(CAttribute* pAttribute) |
| | | void CAttributeVector::addAttribute(CAttribute* pAttribute, BOOL bReplace/* = FALSE*/) |
| | | { |
| | | if (bReplace) { |
| | | for (auto it = m_attributes.begin(); it != m_attributes.end(); ) { |
| | | if ((*it)->getName().compare(pAttribute->getName()) == 0) { |
| | | delete (*it); |
| | | it = m_attributes.erase(it); |
| | | } |
| | | else { |
| | | ++it; |
| | | } |
| | | } |
| | | } |
| | | |
| | | m_attributes.push_back(pAttribute); |
| | | } |
| | | |
| | | void CAttributeVector::addAttributeVector(CAttributeVector& av) |
| | | { |
| | | for (auto item : av.m_attributes) { |
| | | m_attributes.push_back(item); |
| | | } |
| | | } |
| | | |
| | | unsigned int CAttributeVector::size() |
| | | { |
| | | return m_attributes.size(); |
| | | return (unsigned int)m_attributes.size(); |
| | | } |
| | | |
| | | void CAttributeVector::clear() |
| | |
| | | m_attributes.clear(); |
| | | } |
| | | |
| | | void CAttributeVector::sortWithWeight() |
| | | { |
| | | std::sort(m_attributes.begin(), m_attributes.end(), [](CAttribute* pAttribute1, CAttribute* pAttribut2) { |
| | | return pAttribute1->getWeight() < pAttribut2->getWeight(); |
| | | }); |
| | | } |
| | | |
| | | bool CAttributeVector::empty() |
| | | { |
| | | return m_attributes.empty(); |
| | |
| | | ~CAttributeVector(); |
| | | |
| | | public: |
| | | void addAttribute(CAttribute* pAttribute); |
| | | void addAttribute(CAttribute* pAttribute, BOOL bReplace = FALSE); |
| | | void addAttributeVector(CAttributeVector& av); |
| | | void clear(); |
| | | void sortWithWeight(); |
| | | unsigned int size(); |
| | | bool empty(); |
| | | CAttribute* getAttribute(unsigned int index); |
| | |
| | | // eq mode |
| | | CEqModeStep* pStep = new CEqModeStep(); |
| | | pStep->setName(STEP_MODE); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x350 : 0x650); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x340 : 0x640); |
| | | pStep->setModeDev(m_nIndex == 0 ? 0x9d7d : 0xdd7d); |
| | | if (addStep(STEP_ID_EQMODE_CHANGED, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | // eq status |
| | | CEqStatusStep* pStep = new CEqStatusStep(); |
| | | pStep->setName(STEP_STATUS); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x351 : 0x651); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x341 : 0x641); |
| | | pStep->setStatusDev(m_nIndex == 0 ? 0x9d59 : 0xdd59); |
| | | if (addStep(STEP_ID_EQSTATUS_CHANGED, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | static char* pszName[] = { STEP_ALARM_BLOCK1, STEP_ALARM_BLOCK2, STEP_ALARM_BLOCK3, STEP_ALARM_BLOCK4, STEP_ALARM_BLOCK5 }; |
| | | static int dev[2][5] = { { 0x9f0e , 0x9f3b, 0x9f68, 0x9f95, 0x9fc2 }, |
| | | { 0xdf0e , 0xdf3b, 0xdf68, 0xdf95, 0xdfc2 } }; |
| | | static int writeSignalDev[2][5] = { { 0x352, 0x353, 0x354, 0x355, 0x356 }, |
| | | { 0x652, 0x653, 0x654, 0x655, 0x656 } }; |
| | | static int writeSignalDev[2][5] = { { 0x342, 0x343, 0x344, 0x345, 0x346 }, |
| | | { 0x642, 0x643, 0x644, 0x645, 0x646 } }; |
| | | static int addr[] = { STEP_ID_EQALARM1, STEP_ID_EQALARM2, STEP_ID_EQALARM3, STEP_ID_EQALARM4, STEP_ID_EQALARM5 }; |
| | | |
| | | for (int i = 0; i < 5; i++) { |
| | |
| | | // eq process |
| | | CEqProcessStep* pStep = new CEqProcessStep(); |
| | | pStep->setName(STEP_PROCESS); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x357 : 0x657); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x347 : 0x647); |
| | | pStep->setProcessDev(m_nIndex == 0 ? 0xab55 : 0xeb55); |
| | | if (addStep(STEP_ID_PROCESS_DATA_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | // eq cim mode change |
| | | CEqCimModeChangeStep* pStep = new CEqCimModeChangeStep(); |
| | | pStep->setName(STEP_CIM_MODE_CHANGE); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x370 : 0x670); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x360 : 0x660); |
| | | pStep->setCimModeDev(m_nIndex == 0 ? 0x965 : 0x12b5); |
| | | if (addStep(STEP_ID_CIMMODE_CHANGED_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | // eq cim message cmd |
| | | CEqCimMessageCmdStep* pStep = new CEqCimMessageCmdStep(); |
| | | pStep->setName(STEP_CIM_MESSAGE_CMD); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x371 : 0x671); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x361 : 0x661); |
| | | pStep->setCimMessageDev(m_nIndex == 0 ? 0x950 : 0x12a0); |
| | | if (addStep(STEP_ID_CIM_MSG_SET_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | |
| | | { |
| | | // CIM Message Confirm |
| | | // è¦å°int32ç弿å为两个short, åå«ä¸ºmsg idåpanel id |
| | | // 65538, 2Ϊmsg id, 1Ϊpanel id |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT32, m_nIndex == 0 ? 0x9d80 : 0xdd80); |
| | | pStep->setName(STEP_EQ_CIM_MESSAGE_CONFIRM); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x359 : 0x659); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x349 : 0x649); |
| | | if (addStep(STEP_ID_CIM_MSG_CONFIRM_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | |
| | | { |
| | | CEqCimMessageClearStep* pStep = new CEqCimMessageClearStep(); |
| | | pStep->setName(STEP_CIM_MESSAGE_CLEAR); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x372 : 0x672); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x362 : 0x662); |
| | | pStep->setClearCimMessageDev(m_nIndex == 0 ? 0x963 : 0x12b3); |
| | | if (addStep(STEP_ID_CIM_MSG_CLEAR_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | { |
| | | CEqDateTimeSetCmdStep* pStep = new CEqDateTimeSetCmdStep(); |
| | | pStep->setName(STEP_DATETIME_SET_CMD); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x373 : 0x673); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x363 : 0x663); |
| | | pStep->setDateTimeDev(m_nIndex == 0 ? 0x966 : 0x12b6); |
| | | if (addStep(STEP_ID_DATETIME_SET_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | { |
| | | CEqModeChangeStep* pStep = new CEqModeChangeStep(); |
| | | pStep->setName(STEP_EQ_MODE_CHANGE); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x375 : 0x675); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x365 : 0x665); |
| | | pStep->setEqModeDev(m_nIndex == 0 ? 0x96E : 0x12be); |
| | | if (addStep(STEP_ID_EQMODE_CHANGE_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | { |
| | | // master recipe list report |
| | | CEqReadStep* pStep = new CEqReadStep(m_nIndex == 0 ? 0xa955 : 0xe955, 255 * 2, |
| | | [&](int code, const char* pszData, size_t size) -> int { |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | short ret = decodeRecipeListReport(pszData, size); |
| | |
| | | } |
| | | } |
| | | |
| | | { |
| | | // 请æ±é
æ¹åæ° |
| | | CEqWriteStep* pStep = new CEqWriteStep(); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x367 : 0x667); |
| | | pStep->setDataDev(m_nIndex == 0 ? 0x125b : 0x1bab); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | { |
| | | // recipe parameter report |
| | | CEqReadStep* pStep = new CEqReadStep(m_nIndex == 0 ? 0xaa54 : 0xea54, 257 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | short ret = decodeRecipeParameterReport(pszData, size); |
| | | pStep->setReturnCode(ret); |
| | | } |
| | | pStep->setReturnCode(MRLRC_OK); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x34c : 0x64c); |
| | | pStep->setReturnDev(m_nIndex == 0 ? 0x126c : 0x1bbc); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨CEqReadStepæ¿æ¢CEqJobEventStep |
| | | { |
| | | // Received Job Report Upstream #1~9 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 9; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep((m_nIndex == 0 ? 0x8c90 : 0xcc90) + 320 * i, 320 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeReceivedJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_RECEIVED_JOB_UPSn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev((m_nIndex == 0 ? 0x300 : 0x600) + i); |
| | | if (addStep(STEP_ID_RECIVE_JOB_UPS1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | { |
| | | // Sent Out Job Report Downstream #1~9 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 9; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep((m_nIndex == 0 ? 0x8000 : 0xc000) + 320 * i, 320 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeReceivedJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_SENT_OUT_JOB_DOWNSn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev((m_nIndex == 0 ? 0x30a : 0x60a) + i); |
| | | if (addStep(STEP_ID_SENT_OUT_JOB_DOWNS1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* |
| | | { |
| | | CEqJobEventStep* pStep = new CEqJobEventStep(); |
| | | pStep->setName(STEP_EQ_RECEIVED_JOB_UPS1); |
| | |
| | | { |
| | | CEqJobEventStep* pStep = new CEqJobEventStep(); |
| | | pStep->setName(STEP_EQ_SENT_OUT_JOB_DOWNS1); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x310 : 0x610); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x30a : 0x60a); |
| | | pStep->setJobDataDev(m_nIndex == 0 ? 0x8000 : 0xc000); |
| | | if (addStep(STEP_ID_SENT_OUT_JOB_DOWNS1, pStep) != 0) { |
| | | delete pStep; |
| | |
| | | { |
| | | CEqJobEventStep* pStep = new CEqJobEventStep(); |
| | | pStep->setName(STEP_EQ_SENT_OUT_JOB_DOWNS2); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x311 : 0x611); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x30b : 0x60b); |
| | | pStep->setJobDataDev(m_nIndex == 0 ? 0x8140 : 0xc140); |
| | | if (addStep(STEP_ID_SENT_OUT_JOB_DOWNS2, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | */ |
| | | |
| | | { |
| | | // Fetched Out Job Report #1~15 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 15; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep((m_nIndex == 0 ? 0x9c31 : 0xdc31) + 18 * i, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev((m_nIndex == 0 ? 0x323 : 0x623) + i); |
| | | if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Stored Job Report #1~15 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 15; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep((m_nIndex == 0 ? 0x9b23 : 0xdb23) + 18 * i, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeStoredJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev((m_nIndex == 0 ? 0x314 : 0x614) + i); |
| | | if (addStep(STEP_ID_STORE_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CBonder::onTimer(UINT nTimerid) |
| | |
| | | m_pPort[1] = nullptr; |
| | | m_pPort[2] = nullptr; |
| | | m_pPort[3] = nullptr; |
| | | m_pAligner = nullptr; |
| | | m_pFliper = nullptr; |
| | | } |
| | | |
| | | CEFEM::~CEFEM() |
| | |
| | | { |
| | | if (index < 4) { |
| | | m_pPort[index] = pPort; |
| | | } |
| | | } |
| | | |
| | | void CEFEM::setAligner(CAligner* pAligner) |
| | | { |
| | | m_pAligner = pAligner; |
| | | } |
| | | |
| | | void CEFEM::setFliper(CFliper* pFliper) |
| | | { |
| | | m_pFliper = pFliper; |
| | | } |
| | | |
| | | void CEFEM::setArmTray(unsigned int index, CArmTray* pArmTray) |
| | | { |
| | | if (index < 2) { |
| | | m_pArmTray[index] = pArmTray; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | { |
| | | // 请æ±ä¸»é
æ¹å表çstep |
| | | CEqWriteStep* pStep = new CEqWriteStep(); |
| | |
| | | STEP_ID_PORT4_CASSETTIE_UNLOAD_READY, 0x60b0); |
| | | ADD_EQ_CASSETTE_TRANSFER_STATE_STEP(STEP_EQ_P4_CASSETTE_BLOCKED, 0x103, |
| | | STEP_ID_PORT4_CASSETTIE_BLOCKED, 0x60b0); |
| | | |
| | | { |
| | | // Received Job Report Upstream#1~9 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 9; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(0x4c90 + 320 * i, 320 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_RECEIVED_JOBn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Upstream", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev(0x0 + i); |
| | | if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Fetched Out Job Report #1~15 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 15; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(0x5c31 + 18 * i, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, i+1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev(0x023 + i); |
| | | if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Store Job Report #1~15 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 15; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(0x5b23 + 18 * i, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeStoredJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev(0x014 + i); |
| | | if (addStep(STEP_ID_STORE_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int CEFEM::onStepEvent(CStep* pStep, int code) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | int CEFEM::onFetchedOutJob(int port, const char* pszGlassId) |
| | | { |
| | | if (port == 1) { |
| | | return m_pPort[0]->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 2) { |
| | | return m_pPort[1]->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 3) { |
| | | return m_pPort[2]->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 4) { |
| | | return m_pPort[3]->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 5) { |
| | | return m_pArmTray[0]->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 6) { |
| | | return m_pArmTray[1]->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 7) { |
| | | return m_pAligner->fetchedOutJob(pszGlassId); |
| | | } |
| | | if (port == 8) { |
| | | return m_pFliper->fetchedOutJob(pszGlassId); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | int CEFEM::onStoreJob(int port, const char* pszGlassId) |
| | | { |
| | | if (port == 1) { |
| | | return m_pPort[0]->storedJob(pszGlassId); |
| | | } |
| | | if (port == 2) { |
| | | return m_pPort[1]->storedJob(pszGlassId); |
| | | } |
| | | if (port == 3) { |
| | | return m_pPort[2]->storedJob(pszGlassId); |
| | | } |
| | | if (port == 4) { |
| | | return m_pPort[3]->storedJob(pszGlassId); |
| | | } |
| | | if (port == 5) { |
| | | return m_pArmTray[0]->storedJob(pszGlassId); |
| | | } |
| | | if (port == 6) { |
| | | return m_pArmTray[1]->storedJob(pszGlassId); |
| | | } |
| | | if (port == 7) { |
| | | return m_pAligner->storedJob(pszGlassId); |
| | | } |
| | | if (port == 8) { |
| | | return m_pFliper->storedJob(pszGlassId); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | } |
| | |
| | | #pragma once |
| | | #include "CEquipment.h" |
| | | #include "CLoadPort.h" |
| | | #include "CAligner.h" |
| | | #include "CFliper.h" |
| | | #include "CArmTray.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | virtual BOOL glassWillArrive(CGlass* pGlass); |
| | | virtual void onReceiveLBData(const char* pszData, size_t size); |
| | | virtual int onFetchedOutJob(int port, const char* pszGlassId); |
| | | virtual int onStoreJob(int port, const char* pszGlassId); |
| | | |
| | | public: |
| | | void setPort(unsigned int index, CLoadPort* pPort); |
| | | |
| | | void setAligner(CAligner* pAligner); |
| | | void setFliper(CFliper* pFliper); |
| | | void setArmTray(unsigned int index, CArmTray* pArmTray); |
| | | |
| | | private: |
| | | CLoadPort* m_pPort[4]; |
| | | CAligner* m_pAligner; |
| | | CFliper* m_pFliper; |
| | | CArmTray* m_pArmTray[2]; |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | attrubutes.addAttribute(new CAttribute("Alarm State", |
| | | std::to_string(m_nAlarmState).c_str(), "")); |
| | | std::to_string(m_nAlarmState).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Unit ID", |
| | | std::to_string(m_nUnitId).c_str(), "")); |
| | | std::to_string(m_nUnitId).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Alarm Level", |
| | | std::to_string(m_nAlarmLevel).c_str(), "")); |
| | | std::to_string(m_nAlarmLevel).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Alarm Code", |
| | | std::to_string(m_nAlarmCode).c_str(), "")); |
| | | std::to_string(m_nAlarmCode).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Alarm ID", |
| | | std::to_string(m_nAlarmId).c_str(), "")); |
| | | std::to_string(m_nAlarmId).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Text", |
| | | m_strText.c_str(), "")); |
| | | m_strText.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Description", |
| | | m_strDescription.c_str(), "")); |
| | | m_strDescription.c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqAlarmStep::onReadData() |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Control Command Dev", |
| | | ("W" + CToolUnits::toHexString(m_nCtrlCmdDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nCtrlCmdDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Dev", |
| | | ("W" + CToolUnits::toHexString(m_nPortStatusDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nPortStatusDev, strTemp)).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Port Status", |
| | | getPortStatusDescription(strTemp).c_str(), "")); |
| | | getPortStatusDescription(strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(m_nCassetteSequenceNo).c_str(), "")); |
| | | std::to_string(m_nCassetteSequenceNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CassetteID", |
| | | m_strCassetteID.c_str(), "")); |
| | | m_strCassetteID.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("LoadingCassetteType", |
| | | getLoadingCassetteTypeDescription(strTemp).c_str(), "")); |
| | | getLoadingCassetteTypeDescription(strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Q-Time Flag", |
| | | getQTimeFlagDescription(strTemp).c_str(), "")); |
| | | getQTimeFlagDescription(strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CassetteMappingState", |
| | | getCassetteMappingStateDescription(strTemp).c_str(), "")); |
| | | getCassetteMappingStateDescription(strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CassetteStatus", |
| | | getCassetteStatusDescription(strTemp).c_str(), "")); |
| | | getCassetteStatusDescription(strTemp).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqCassetteTransferStateStep::onReadData() |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Clear Cim Message Dev", |
| | | ("W" + CToolUnits::toHexString(m_nClearCimMessageDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nClearCimMessageDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Cim Message Dev", |
| | | ("W" + CToolUnits::toHexString(m_nCimMessageDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nCimMessageDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Cim Mode Dev", |
| | | ("W" + CToolUnits::toHexString(m_nCimModeDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nCimModeDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | attrubutes.addAttribute(new CAttribute("UnitNo", |
| | | std::to_string(m_nUnitNo).c_str(), "")); |
| | | std::to_string(m_nUnitNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CurrentMasterRecipeId", |
| | | std::to_string(m_nCurrentMasterRecipeId).c_str(), "")); |
| | | std::to_string(m_nCurrentMasterRecipeId).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("LocalRecipeId", |
| | | std::to_string(m_nLocalRecipeId).c_str(), "")); |
| | | std::to_string(m_nLocalRecipeId).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqCurrentRecipeChangeStep::onReadData() |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("DateTime Dev", |
| | | ("W" + CToolUnits::toHexString(m_nDateTimeDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nDateTimeDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | |
| | | void CEqJobEventStep::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Dev", |
| | | ("W" + CToolUnits::toHexString(m_nJobDataADev, strTemp)).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("PortNo", |
| | | std::to_string(m_jobDataA.getPortNo()).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("CarrierId", |
| | | m_jobDataA.getCarrierId().c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("PruductId", |
| | | m_jobDataA.getPruductId().c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("CarrierState", |
| | | m_jobDataA.getCarrierStateDescription(strTemp).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("SlotMapping", |
| | | std::to_string(m_jobDataA.getSlotMapping()).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("SlotSelectedFlag", |
| | | std::to_string(m_jobDataA.getSlotSelectedFlag()).c_str(), "")); |
| | | std::vector<std::string>& ids = m_jobDataA.getGlassIds(); |
| | | for (int i = 0; i < ids.size(); i++) { |
| | | attrubutes.addAttribute(new CAttribute((std::string("GlassId") + std::to_string(i+1)).c_str(), |
| | | ids[i].c_str(), "")); |
| | | } |
| | | ("W" + CToolUnits::toHexString(m_nJobDataADev, strTemp)).c_str(), "", weight++)); |
| | | m_jobDataS.getAttributeVector(attrubutes, weight); |
| | | } |
| | | |
| | | int CEqJobEventStep::onReadData() |
| | |
| | | return -1; |
| | | } |
| | | |
| | | m_jobDataA.unserialize(szBuffer, 640); |
| | | m_jobDataS.unserialize(szBuffer, 640); |
| | | LOGI("<CEqJobEventStep-%s>Read JobDataA\n", m_strName.c_str()); |
| | | |
| | | return 0; |
| | |
| | | return 0; |
| | | } |
| | | |
| | | CJobDataA* CEqJobEventStep::getJobDataA() |
| | | CJobDataS* CEqJobEventStep::getJobDataS() |
| | | { |
| | | return &m_jobDataA; |
| | | return &m_jobDataS; |
| | | } |
| | | } |
| | |
| | | #pragma once |
| | | #include "CReadStep.h" |
| | | #include "CJobDataA.h" |
| | | #include "CJobDataS.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | virtual int onComplete(); |
| | | virtual int onTimeout(); |
| | | void setJobDataDev(int nDev); |
| | | CJobDataA* getJobDataA(); |
| | | CJobDataS* getJobDataS(); |
| | | |
| | | private: |
| | | int m_nJobDataADev; |
| | | CJobDataA m_jobDataA; |
| | | CJobDataS m_jobDataS; |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Equipment Mode Dev", |
| | | ("W" + CToolUnits::toHexString(m_nEqModeDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nEqModeDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Mode", |
| | | std::to_string(m_nMode).c_str(), getModeDescription(strTemp).c_str())); |
| | | std::to_string(m_nMode).c_str(), getModeDescription(strTemp).c_str(), weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Mode Dev", |
| | | ("W" + CToolUnits::toHexString(m_nModeDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nModeDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqModeStep::onReadData() |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Port Dev", |
| | | ("W" + CToolUnits::toHexString(m_nPortDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nPortDev, strTemp)).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("PortType", |
| | | std::to_string(m_nPortType).c_str(), getPortTypeDescription(strTemp).c_str())); |
| | | std::to_string(m_nPortType).c_str(), getPortTypeDescription(strTemp).c_str(), weight++)); |
| | | attrubutes.addAttribute(new CAttribute("PortMode", |
| | | std::to_string(m_nPortMode).c_str(), getPortModeDescription(strTemp).c_str())); |
| | | std::to_string(m_nPortMode).c_str(), getPortModeDescription(strTemp).c_str(), weight++)); |
| | | attrubutes.addAttribute(new CAttribute("PortCassetteType", |
| | | std::to_string(m_nPortCassetteType).c_str(), getPortCassetteTypeDescription(strTemp).c_str())); |
| | | std::to_string(m_nPortCassetteType).c_str(), getPortCassetteTypeDescription(strTemp).c_str(), weight++)); |
| | | attrubutes.addAttribute(new CAttribute("PortTransferMode", |
| | | std::to_string(m_nPortTransferMode).c_str(), getPortTransferModeDescription(strTemp).c_str())); |
| | | std::to_string(m_nPortTransferMode).c_str(), getPortTransferModeDescription(strTemp).c_str(), weight++)); |
| | | attrubutes.addAttribute(new CAttribute("PortEnableMode", |
| | | std::to_string(m_nPortEanbleMode).c_str(), getPortEnableModeDescription(strTemp).c_str())); |
| | | std::to_string(m_nPortEanbleMode).c_str(), getPortEnableModeDescription(strTemp).c_str(), weight++)); |
| | | attrubutes.addAttribute(new CAttribute("PortTypeAutoChangeMode", |
| | | std::to_string(m_nPortTypeAutoChangeMode).c_str(), getPortTypeAutoChangeModeDescription(strTemp).c_str())); |
| | | std::to_string(m_nPortTypeAutoChangeMode).c_str(), getPortTypeAutoChangeModeDescription(strTemp).c_str(), weight++)); |
| | | } |
| | | |
| | | int CEqPortChangeStep::onReadData() |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | attrubutes.addAttribute(new CAttribute("Glass ID", |
| | | m_strGlassId.c_str(), "")); |
| | | m_strGlassId.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Start Time", |
| | | m_strStartTime.c_str(), "")); |
| | | m_strStartTime.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("End Time", |
| | | m_strEndTime.c_str(), "")); |
| | | m_strEndTime.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Total Parameter", |
| | | std::to_string(m_nTotalParameter).c_str(), "")); |
| | | std::to_string(m_nTotalParameter).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Total Group", |
| | | std::to_string(m_nTotalGroup).c_str(), "")); |
| | | std::to_string(m_nTotalGroup).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Current Group", |
| | | std::to_string(m_nCurrentGroup).c_str(), "")); |
| | | std::to_string(m_nCurrentGroup).c_str(), "", weight++)); |
| | | |
| | | char szName[256]; |
| | | int index = 0; |
| | | for (auto item : m_params) { |
| | | sprintf_s(szName, 256, "Parameter %d", ++index); |
| | | attrubutes.addAttribute(new CAttribute(szName, |
| | | item.c_str(), "")); |
| | | item.c_str(), "", weight++)); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Dev", |
| | | ("W" + CToolUnits::toHexString(m_nValueDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nValueDev, strTemp)).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Value", |
| | | std::to_string(m_nValue).c_str(), "")); |
| | | std::to_string(m_nValue).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqReadIntStep::onReadData() |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Dev", |
| | | ("W" + CToolUnits::toHexString(m_nDataDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nDataDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqReadStep::onReadData() |
| | |
| | | if (0 != nRet) { |
| | | LOGI("<CEqReadStep>Read data error."); |
| | | if (m_onReadBlock != nullptr) { |
| | | m_onReadBlock(RERROR, nullptr, 0); |
| | | m_onReadBlock(this, RERROR, nullptr, 0); |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | LOGI("<CEqReadStep>read data succeed."); |
| | | if (m_onReadBlock != nullptr) { |
| | | m_onReadBlock(ROK, szBuffer, m_nReadSize); |
| | | m_onReadBlock(this, ROK, szBuffer, m_nReadSize); |
| | | } |
| | | |
| | | |
| | |
| | | CReadStep::onComplete(); |
| | | LOGI("<CEqReadStep> onComplete."); |
| | | if (m_onReadBlock != nullptr) { |
| | | m_onReadBlock(RCOMPLETE, nullptr, 0); |
| | | m_onReadBlock(this, RCOMPLETE, nullptr, 0); |
| | | } |
| | | |
| | | return 0; |
| | |
| | | CReadStep::onTimeout(); |
| | | LOGI("<CEqReadStep> onTimeout."); |
| | | if (m_onReadBlock != nullptr) { |
| | | m_onReadBlock(RTIMEOUT, nullptr, 0); |
| | | m_onReadBlock(this, RTIMEOUT, nullptr, 0); |
| | | } |
| | | |
| | | return 0; |
| | |
| | | #define RCOMPLETE 1 /* è¯»æ°æ®æµç¨å®æ */ |
| | | |
| | | namespace SERVO { |
| | | typedef std::function<int(int code, const char* pszData, size_t size)> ONREAD; |
| | | typedef std::function<int(void* pFrom, int code, const char* pszData, size_t size)> ONREAD; |
| | | |
| | | class CEqReadStep : public CReadStep |
| | | { |
| | |
| | | { |
| | | m_nStatusDev = 0; |
| | | for (int i = 0; i < STATUS_MAX; i++) { |
| | | m_nStatus[i] = 7; |
| | | m_nStatus[i] = 0; |
| | | m_nReasonCode[i] = 0; |
| | | } |
| | | |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | char szName[256]; |
| | | for (int i = 0; i < STATUS_MAX; i++) { |
| | | sprintf_s(szName, 256, "Status %d", i + 1); |
| | | attrubutes.addAttribute(new CAttribute(szName, |
| | | std::to_string(m_nStatus[i]).c_str(), "")); |
| | | std::to_string(m_nStatus[i]).c_str(), "", weight++)); |
| | | sprintf_s(szName, 256, "Reason Code %d", i + 1); |
| | | attrubutes.addAttribute(new CAttribute(szName, |
| | | std::to_string(m_nReasonCode[i]).c_str(), "")); |
| | | std::to_string(m_nReasonCode[i]).c_str(), "", weight++)); |
| | | } |
| | | |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Status Dev", |
| | | ("W" + CToolUnits::toHexString(m_nStatusDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nStatusDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqStatusStep::getStatus(unsigned int uint) |
| | |
| | | |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("VCR Mode Dev", |
| | | ("W" + CToolUnits::toHexString(m_nEqVCRModeDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nEqVCRModeDev, strTemp)).c_str(), "", 31)); |
| | | } |
| | | } |
| | |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Dev", |
| | | ("W" + CToolUnits::toHexString(m_nVcrEventReportDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nVcrEventReportDev, strTemp)).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("GlassId", |
| | | m_vcrEventReport.getGlassId().c_str(), "")); |
| | | m_vcrEventReport.getGlassId().c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(m_vcrEventReport.getCassetteSequenceNo()).c_str(), "")); |
| | | std::to_string(m_vcrEventReport.getCassetteSequenceNo()).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(m_vcrEventReport.getJobSequenceNo()).c_str(), "")); |
| | | std::to_string(m_vcrEventReport.getJobSequenceNo()).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("UnitNo", |
| | | std::to_string(m_vcrEventReport.getUnitNo()).c_str(), "")); |
| | | std::to_string(m_vcrEventReport.getUnitNo()).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("VCR No", |
| | | std::to_string(m_vcrEventReport.getVcrNo()).c_str(), "")); |
| | | std::to_string(m_vcrEventReport.getVcrNo()).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("VCR Result", |
| | | m_vcrEventReport.getVcrResultDescription(strTemp).c_str(), "")); |
| | | m_vcrEventReport.getVcrResultDescription(strTemp).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqVcrEventStep::onReadData() |
| | |
| | | { |
| | | CWriteStep::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 31; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Data Dev", |
| | | ("W" + CToolUnits::toHexString(m_nDataDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nDataDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | |
| | | int CEqWriteStep::onComplete() |
| | |
| | | #include "CEquipment.h" |
| | | #include "ToolUnits.h" |
| | | #include <regex> |
| | | #include "CArm.h" |
| | | |
| | | |
| | | #define CHECK_READ_STEP_SIGNAL(addr, data, size) { \ |
| | |
| | | m_bVCREnable[0] = FALSE; |
| | | m_pCclink = nullptr; |
| | | m_nBaseAlarmId = 0; |
| | | m_pArm = nullptr; |
| | | InitializeCriticalSection(&m_criticalSection); |
| | | } |
| | | |
| | |
| | | void CEquipment::setCcLink(CCCLinkIEControl* pCcLink) |
| | | { |
| | | m_pCclink = pCcLink; |
| | | } |
| | | |
| | | void CEquipment::setArm(CEquipment* pEquipment) |
| | | { |
| | | ASSERT(pEquipment->isArm()); |
| | | ASSERT(!this->isArm()); |
| | | m_pArm = pEquipment; |
| | | } |
| | | |
| | | void CEquipment::setBaseAlarmId(int nBaseId) |
| | |
| | | void CEquipment::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | attrubutes.clear(); |
| | | |
| | | unsigned int weight = 0; |
| | | attrubutes.addAttribute(new CAttribute("Network", |
| | | std::to_string(m_station.nNetNo).c_str(), "")); |
| | | std::to_string(m_station.nNetNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Station", |
| | | std::to_string(m_station.nStNo).c_str(), "")); |
| | | std::to_string(m_station.nStNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("ID", |
| | | std::to_string(m_nID).c_str(), "")); |
| | | std::to_string(m_nID).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Name", |
| | | m_strName.c_str(), "")); |
| | | m_strName.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Description", |
| | | m_strDescription.c_str(), "")); |
| | | m_strDescription.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Alive", |
| | | this->isAlive() ? _T("TRUE") : _T("FALSE"), "")); |
| | | this->isAlive() ? _T("TRUE") : _T("FALSE"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CIM State", |
| | | m_bCimState ? _T("ON") : _T("OFF"), "")); |
| | | m_bCimState ? _T("ON") : _T("OFF"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Upstream", |
| | | m_bUpstreamInline ? _T("Inline") : _T("Offline"), "")); |
| | | m_bUpstreamInline ? _T("Inline") : _T("Offline"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Downstream", |
| | | m_bDownstreamInline ? _T("Inline") : _T("Offline"), "")); |
| | | m_bDownstreamInline ? _T("Inline") : _T("Offline"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Local Alarm", |
| | | m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), "")); |
| | | m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Auto Recipe Change", |
| | | m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), "")); |
| | | m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), "", weight++)); |
| | | char szTemp[256]; |
| | | for (int i = 0; i < VCR_MAX; i++) { |
| | | sprintf_s(szTemp, 256, "VCR-%d", i + 1); |
| | | attrubutes.addAttribute(new CAttribute(szTemp, |
| | | m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "")); |
| | | m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "", weight++)); |
| | | } |
| | | |
| | | for (auto item : m_inputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | std::to_string((int)item->getType()).c_str(), "", weight++)); |
| | | } |
| | | |
| | | for (auto item : m_outputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | std::to_string((int)item->getType()).c_str(), "", weight++)); |
| | | } |
| | | |
| | | for (auto item : m_glassList) { |
| | | attrubutes.addAttribute(new CAttribute("Glass", |
| | | item->getID().c_str(), "")); |
| | | item->getID().c_str(), "", weight++)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 以ä¸è§£éåå¤çæ°æ® |
| | | BOOL bFlag; |
| | | int index = 0x840; |
| | | int index = 0x540; |
| | | |
| | | |
| | | // alive |
| | |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_EQMODE_CHANGED + i, pszData, size); |
| | | } |
| | | |
| | | // process data report |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_PROCESS_DATA_REPORT, pszData, size); |
| | | |
| | | // é
æ¹æ¹å |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_CURRENT_RECIPE_CHANGE_REPORT, pszData, size); |
| | | |
| | | // 主é
æ¹ä¸æ¥ |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_MASTER_RECIPE_LIST_REPORT, pszData, size); |
| | | |
| | | // CIM Mode |
| | | CHECK_WRITE_STEP_SIGNAL(STEP_ID_CIMMODE_CHANGED_CMD_REPLY, pszData, size); |
| | |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_RECIVE_JOB_UPS2, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_SENT_OUT_JOB_DOWNS1, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_SENT_OUT_JOB_DOWNS2, pszData, size); |
| | | |
| | | // Store Job Report #1~15 |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT1, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT2, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT3, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT4, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT5, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT6, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT7, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT8, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT9, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT10, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT11, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT12, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT13, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT14, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT15, pszData, size); |
| | | |
| | | // Fetched Out Job Report #1~15 |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT1, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT2, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT3, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT4, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT5, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT6, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT7, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT8, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT9, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT10, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT11, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT12, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT13, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT14, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT15, pszData, size); |
| | | |
| | | |
| | | // CEqCassetteTranserStateStep |
| | |
| | | return pGlass; |
| | | } |
| | | |
| | | int CEquipment::fetchedOutJob(const char* pszGlassId) |
| | | { |
| | | if (m_pArm == nullptr) { |
| | | return -1; |
| | | } |
| | | |
| | | // æ¾å°æå®çglass id, |
| | | Lock(); |
| | | if (m_glassList.empty()) { |
| | | Unlock(); |
| | | return -2; |
| | | } |
| | | |
| | | CGlass* pContext = nullptr; |
| | | for (auto iter = m_glassList.begin(); iter != m_glassList.end(); iter++) { |
| | | if ((*iter)->getID().compare(pszGlassId) == 0) { |
| | | pContext = (*iter); |
| | | m_glassList.erase(iter); |
| | | break; |
| | | } |
| | | } |
| | | if (pContext == nullptr) { |
| | | Unlock(); |
| | | return -3; |
| | | } |
| | | |
| | | ((CArm*)m_pArm)->tempStore(pContext); |
| | | pContext->release(); |
| | | Unlock(); |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::storedJob(const char* pszGlassId) |
| | | { |
| | | if (m_pArm == nullptr) { |
| | | return -1; |
| | | } |
| | | |
| | | CGlass* pGlass = nullptr; |
| | | if (((CArm*)m_pArm)->tempFetchOut(pGlass) != 0) { |
| | | return -2; |
| | | } |
| | | |
| | | |
| | | ASSERT(pGlass); |
| | | Lock(); |
| | | pGlass->addPath(m_nID); |
| | | pGlass->addRef(); // å å
¥list,addRef |
| | | m_glassList.push_back(pGlass); |
| | | pGlass->release(); // tempFetchOutéè¦è°ç¨ä¸æ¬¡release |
| | | Unlock(); |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, 0); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | BOOL CEquipment::isGlassListEmpty() |
| | | { |
| | | return m_glassList.empty(); |
| | | } |
| | | |
| | | bool CEquipment::isAlarmStep(SERVO::CStep* pStep) |
| | | { |
| | | return CToolUnits::startsWith(pStep->getName(), STEP_ALARM_START); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo) |
| | | { |
| | | SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_MASTER_RECIPE_LIST_REQ); |
| | | if (pStep == nullptr) { |
| | | return -1; |
| | | } |
| | | |
| | | LOGI("<CEquipment-%s>æ£å¨è¯·æ±åå
<%d>主é
æ¹å表", m_strName.c_str(), unitNo); |
| | | if (m_recipesManager.syncing() != 0) { |
| | | return -2; |
| | | } |
| | | pStep->writeShort(unitNo, [&, unitNo](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI("<CEquipment-%s>请æ±åå
<%d>主é
æ¹å表æåï¼æ£å¨çå¾
æ°æ®.", m_strName.c_str(), unitNo); |
| | | } |
| | | else { |
| | | m_recipesManager.syncFailed(); |
| | | LOGI("<CEquipment-%s>请æ±åå
<%d>主é
æ¹å表失败ï¼code:%d", m_strName.c_str(), unitNo, code); |
| | | } |
| | | |
| | | return 0; |
| | | }); |
| | | return 0; |
| | | } |
| | | |
| | | short CEquipment::decodeRecipeListReport(const char* pszData, size_t size) |
| | | { |
| | | return m_recipesManager.decodeRecipeListReport(pszData, size); |
| | | } |
| | | |
| | | short CEquipment::decodeRecipeParameterReport(const char* pszData, size_t size) |
| | | { |
| | | return m_recipesManager.decodeRecipeParameterReport(pszData, size); |
| | | } |
| | | |
| | | int CEquipment::decodeReceivedJobReport(CStep* pStep, int port, const char* pszData, size_t size) |
| | | { |
| | | CJobDataS jobDataS; |
| | | int nRet = jobDataS.unserialize(&pszData[0], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | |
| | | // ç¼åAttributeï¼ç¨äºè°è¯æ¶æ¾ç¤ºä¿¡æ¯ |
| | | unsigned int weight = 201; |
| | | CAttributeVector attrubutes; |
| | | jobDataS.getAttributeVector(attrubutes, weight); |
| | | pStep->addAttributeVector(attrubutes); |
| | | |
| | | |
| | | onReceivedJob(port, &jobDataS); |
| | | |
| | | return nRet; |
| | | } |
| | | |
| | | int CEquipment::onReceivedJob(int port, CJobDataS* pJobDataS) |
| | | { |
| | | LOGI("<CEquipment-%s>onReceivedJob.", m_strName.c_str()); |
| | | // return fetchedOutJob(pszGlassId); |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::decodeSentOutJobReport(CStep* pStep, int port, const char* pszData, size_t size) |
| | | { |
| | | CJobDataS jobDataS; |
| | | int nRet = jobDataS.unserialize(&pszData[0], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | |
| | | // ç¼åAttributeï¼ç¨äºè°è¯æ¶æ¾ç¤ºä¿¡æ¯ |
| | | unsigned int weight = 201; |
| | | CAttributeVector attrubutes; |
| | | jobDataS.getAttributeVector(attrubutes, weight); |
| | | pStep->addAttributeVector(attrubutes); |
| | | |
| | | |
| | | onReceivedJob(port, &jobDataS); |
| | | |
| | | return nRet; |
| | | } |
| | | |
| | | int CEquipment::onSentOutJob(int port, CJobDataS* pJobDataS) |
| | | { |
| | | LOGI("<CEquipment-%s>onSentOutJob.", m_strName.c_str()); |
| | | // return fetchedOutJob(pszGlassId); |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size) |
| | | { |
| | | int index = 0; |
| | | short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo; |
| | | CJobDataB jobDataB; |
| | | int nRet = jobDataB.unserialize(&pszData[index], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | index += nRet; |
| | | |
| | | memcpy(&unitOrPort, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&unitOrPortNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&subUnitNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&subSlotNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | |
| | | // ç¼åAttributeï¼ç¨äºè°è¯æ¶æ¾ç¤ºä¿¡æ¯ |
| | | unsigned int weight = 201; |
| | | pStep->addAttribute(new CAttribute("UnitOrPort", |
| | | std::to_string(unitOrPort).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("UnitOrPortNo", |
| | | std::to_string(unitOrPortNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubUnitNo", |
| | | std::to_string(subUnitNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubSlotNo", |
| | | std::to_string(subSlotNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(jobDataB.getCassetteSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(jobDataB.getJobSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("GlassId", |
| | | jobDataB.getGlassId().c_str(), "", weight++)); |
| | | |
| | | |
| | | onFetchedOutJob(port, jobDataB.getGlassId().c_str()); |
| | | |
| | | return index; |
| | | } |
| | | |
| | | int CEquipment::onFetchedOutJob(int port, const char* pszGlassId) |
| | | { |
| | | LOGI("<CEquipment-%s>onFetchedOutJob:port:%d|GlassId:%s", |
| | | m_strName.c_str(), port, pszGlassId); |
| | | return fetchedOutJob(pszGlassId); |
| | | } |
| | | |
| | | int CEquipment::decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size) |
| | | { |
| | | int index = 0; |
| | | short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo; |
| | | CJobDataB jobDataB; |
| | | int nRet = jobDataB.unserialize(&pszData[index], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | index += nRet; |
| | | |
| | | memcpy(&unitOrPort, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&unitOrPortNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&subUnitNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&subSlotNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | |
| | | // ç¼åAttributeï¼ç¨äºè°è¯æ¶æ¾ç¤ºä¿¡æ¯ |
| | | unsigned int weight = 201; |
| | | pStep->addAttribute(new CAttribute("UnitOrPort", |
| | | std::to_string(unitOrPort).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("UnitOrPortNo", |
| | | std::to_string(unitOrPortNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubUnitNo", |
| | | std::to_string(subUnitNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubSlotNo", |
| | | std::to_string(subSlotNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(jobDataB.getCassetteSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(jobDataB.getJobSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("GlassId", |
| | | jobDataB.getGlassId().c_str(), "", weight++)); |
| | | |
| | | |
| | | onStoreJob(port, jobDataB.getGlassId().c_str()); |
| | | |
| | | return index; |
| | | } |
| | | |
| | | int CEquipment::onStoreJob(int port, const char* pszGlassId) |
| | | { |
| | | LOGI("<CEquipment-%s>onStore:port:%d|GlassId:%s", |
| | | m_strName.c_str(), port, pszGlassId); |
| | | return storedJob(pszGlassId); |
| | | } |
| | | } |
| | |
| | | #include <list> |
| | | #include "CGlass.h" |
| | | #include "CRecipesManager.h" |
| | | #include "CJobDataA.h" |
| | | #include "CJobDataB.h" |
| | | #include "CJobDataC.h" |
| | | #include "CJobDataS.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | virtual const char* getClassName() = 0; |
| | | virtual void setListener(EquipmentListener listener); |
| | | void setCcLink(CCCLinkIEControl* pCcLink); |
| | | virtual BOOL isArm() { return FALSE; }; |
| | | void setArm(CEquipment* pEquipment); |
| | | void setBaseAlarmId(int nBaseId); |
| | | int getBaseAlarmId(); |
| | | void setID(int nID); |
| | |
| | | virtual BOOL glassWillArrive(CGlass* pGlass); |
| | | virtual int outputGlass(int port); |
| | | virtual int glassArrived(CGlass* pGlass); |
| | | virtual int onReceivedJob(int port, CJobDataS* pJobDataS); |
| | | virtual int onSentOutJob(int port, CJobDataS* pJobDataS); |
| | | virtual int onFetchedOutJob(int port, const char* pszGlassId); |
| | | virtual int onStoreJob(int port, const char* pszGlassId); |
| | | void getGlassList(std::list<CGlass*>& list); |
| | | CGlass* getFrontGlass(); |
| | | BOOL removeClass(CGlass* pGlass); |
| | |
| | | // unitNo: 0:local; Others:unit No |
| | | int masterRecipeListRequest(short unitNo); |
| | | |
| | | // 请æ±é
æ¹åæ° |
| | | // masterRecipeId: 主é
æ¹id |
| | | // localRecipeId: æ¬å°é
æ¹id |
| | | // unitNo: 0:local; Others:unit No |
| | | int recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo); |
| | | |
| | | public: |
| | | int fetchedOutJob(const char* pszGlassId); |
| | | int storedJob(const char* pszGlassId); |
| | | BOOL isGlassListEmpty(); |
| | | |
| | | |
| | | // 以ä¸ä¸ºä»CC-Link读åå°çBitæ å¿ä½æ£æµå½æ° |
| | | public: |
| | |
| | | inline BOOL equalBool(BOOL b1, BOOL b2); |
| | | void addGlassToList(CGlass* pGlass); |
| | | short decodeRecipeListReport(const char* pszData, size_t size); |
| | | short decodeRecipeParameterReport(const char* pszData, size_t size); |
| | | int decodeReceivedJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | int decodeSentOutJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | int decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | int decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | |
| | | protected: |
| | | EquipmentListener m_listener; |
| | |
| | | std::map<unsigned int, CStep*> m_mapStep; |
| | | int m_nBaseAlarmId; |
| | | CRecipesManager m_recipesManager; |
| | | |
| | | private: |
| | | CEquipment* m_pArm; |
| | | }; |
| | | } |
| | | |
| | |
| | | #include "Context.h" |
| | | #include <string> |
| | | #include "CPath.h" |
| | | #include "CJobDataA.h" |
| | | #include "CJobDataB.h" |
| | | #include "CJobDataC.h" |
| | | #include "CJobDataS.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | return 320 * 2; |
| | | } |
| | | |
| | | int CJobDataA::unserialize(char* pszBuffer, int nBufferSize) |
| | | int CJobDataA::unserialize(const char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 640) return -1; |
| | | |
| | |
| | | int getSlotSelectedFlag(); |
| | | std::vector<std::string>& getGlassIds(); |
| | | int serialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(const char* pszBuffer, int nBufferSize); |
| | | |
| | | private: |
| | | short m_nPortNo; |
| | |
| | | #include "stdafx.h" |
| | | #include "CJobDataB.h" |
| | | #include "ToolUnits.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | { |
| | | m_strGlassId = pszGlassId; |
| | | } |
| | | |
| | | int CJobDataB::serialize(char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 28) return -1; |
| | | |
| | | int index = 0; |
| | | memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nJobSequenceNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | int strLen = min(20, m_strGlassId.size()); |
| | | memcpy(&pszBuffer[index], m_strGlassId.c_str(), strLen); |
| | | index += 20; |
| | | |
| | | return 14 * 2; |
| | | } |
| | | |
| | | int CJobDataB::unserialize(const char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 14) return -1; |
| | | |
| | | int index = 0; |
| | | memcpy(&m_nCassetteSequenceNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nJobSequenceNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 20, m_strGlassId); |
| | | index += 20; |
| | | |
| | | return 14 * 2; |
| | | } |
| | | } |
| | |
| | | void setJobSequenceNo(int no); |
| | | std::string& getGlassId(); |
| | | void setGlassId(const char* pszGlassId); |
| | | int serialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(const char* pszBuffer, int nBufferSize); |
| | | |
| | | private: |
| | | int m_nCassetteSequenceNo; |
| | |
| | | #include "stdafx.h" |
| | | #include "CJobDataS.h" |
| | | #include "ToolUnits.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | #define JOBDATAS_SIZE (256 * 2) |
| | | #define ENABLE_JOBDATAS_RAWDATA TRUE |
| | | |
| | | CJobDataS::CJobDataS() |
| | | { |
| | | m_nCassetteSequenceNo = 0; |
| | |
| | | m_nSourceSlotNo = 0; |
| | | m_nTargetPortNo = 0; |
| | | m_nTargetSlotNo = 0; |
| | | m_pRawData = nullptr; |
| | | if (ENABLE_JOBDATAS_RAWDATA) { |
| | | m_pRawData = new char[JOBDATAS_SIZE]; |
| | | serialize(m_pRawData, JOBDATAS_SIZE); |
| | | } |
| | | } |
| | | |
| | | CJobDataS::~CJobDataS() |
| | | { |
| | | |
| | | if (m_pRawData != nullptr) { |
| | | delete[] m_pRawData; |
| | | m_pRawData = nullptr; |
| | | } |
| | | } |
| | | |
| | | int CJobDataS::getCassetteSequenceNo() |
| | |
| | | |
| | | std::string& CJobDataS::getGlass2Id() |
| | | { |
| | | return m_strGlass1Id; |
| | | return m_strGlass2Id; |
| | | } |
| | | |
| | | void CJobDataS::setGlass2Id(const char* pszId) |
| | |
| | | { |
| | | m_nTargetSlotNo = no; |
| | | } |
| | | |
| | | int CJobDataS::serialize(char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 256 * 2) return -1; |
| | | |
| | | int index = 0; |
| | | memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nJobSequenceNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | int strLen = min(40, (int)m_strLotId.size()); |
| | | memcpy(&pszBuffer[index], m_strLotId.c_str(), strLen); |
| | | index += 40; |
| | | |
| | | strLen = min(20, (int)m_strProductId.size()); |
| | | memcpy(&pszBuffer[index], m_strProductId.c_str(), strLen); |
| | | index += 20; |
| | | |
| | | strLen = min(20, (int)m_strOperationId.size()); |
| | | memcpy(&pszBuffer[index], m_strOperationId.c_str(), strLen); |
| | | index += 20; |
| | | |
| | | strLen = min(20, (int)m_strGlass1Id.size()); |
| | | memcpy(&pszBuffer[index], m_strGlass1Id.c_str(), strLen); |
| | | index += 20; |
| | | |
| | | strLen = min(20, (int)m_strGlass2Id.size()); |
| | | memcpy(&pszBuffer[index], m_strGlass2Id.c_str(), strLen); |
| | | index += 20; |
| | | |
| | | memcpy(&pszBuffer[index], &m_nJobType, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nMaterialsType, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nProductType, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nDummyType, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nSkipFlag, sizeof(int)); |
| | | index += sizeof(int); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nProcessFlag, sizeof(int)); |
| | | index += sizeof(int); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nProcessResonCode, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nLastGlassFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nFirstGlassFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nLastGlassFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nQTime[0], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nQTime[1], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nQTime[2], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nQTimeOverFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nMasterRecipe, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | strLen = min(10, (int)m_strProductRecipeId.size()); |
| | | memcpy(&pszBuffer[index], m_strProductRecipeId.c_str(), strLen); |
| | | index += 10; |
| | | |
| | | strLen = min(10, (int)m_strPCode.size()); |
| | | memcpy(&pszBuffer[index], m_strPCode.c_str(), strLen); |
| | | index += 10; |
| | | |
| | | strLen = min(10, (int)m_strUseType.size()); |
| | | memcpy(&pszBuffer[index], m_strUseType.c_str(), strLen); |
| | | index += 10; |
| | | |
| | | strLen = min(80, (int)m_strPanelMeasure.size()); |
| | | memcpy(&pszBuffer[index], m_strPanelMeasure.c_str(), strLen); |
| | | index += 80; |
| | | |
| | | memcpy(&pszBuffer[index], &m_nMode, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nSlotUnitSelectFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nSourcePortNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nSourceSlotNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nTargetPortNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nTargetSlotNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | return 256 * 2; |
| | | } |
| | | |
| | | int CJobDataS::unserialize(const char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 256 * 2) return -1; |
| | | |
| | | int index = 0; |
| | | memcpy(&m_nCassetteSequenceNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nJobSequenceNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 40, m_strLotId); |
| | | index += 40; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 20, m_strProductId); |
| | | index += 20; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 20, m_strOperationId); |
| | | index += 20; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 20, m_strGlass1Id); |
| | | index += 20; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 20, m_strGlass2Id); |
| | | index += 20; |
| | | |
| | | memcpy(&m_nJobType, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nMaterialsType, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nProductType, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nDummyType, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nSkipFlag, &pszBuffer[index], sizeof(int)); |
| | | index += sizeof(int); |
| | | |
| | | memcpy(&m_nProcessFlag, &pszBuffer[index], sizeof(int)); |
| | | index += sizeof(int); |
| | | |
| | | memcpy(&m_nProcessResonCode, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nLastGlassFlag, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nFirstGlassFlag, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nQTime[0], &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nQTime[1], &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(int); |
| | | |
| | | memcpy(&m_nQTime[2], &pszBuffer[index], sizeof(int)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nQTimeOverFlag, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nMasterRecipe, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId); |
| | | index += 10; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId); |
| | | index += 10; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId); |
| | | index += 10; |
| | | |
| | | CToolUnits::convertString(&pszBuffer[index], 80, m_strProductRecipeId); |
| | | index += 80; |
| | | |
| | | memcpy(&m_nMode, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nSlotUnitSelectFlag, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nSourcePortNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nSourceSlotNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nTargetPortNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nTargetSlotNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | |
| | | // ç¼ååå§æ°æ® |
| | | if (m_pRawData != nullptr) { |
| | | memcpy(m_pRawData, pszBuffer, JOBDATAS_SIZE); |
| | | } |
| | | |
| | | |
| | | return 256 * 2; |
| | | } |
| | | |
| | | void CJobDataS::getAttributeVector(CAttributeVector& attrubutes, int beginWeight) |
| | | { |
| | | unsigned int weight = beginWeight; |
| | | std::string strTemp; |
| | | |
| | | attrubutes.addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(getCassetteSequenceNo()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(getJobSequenceNo()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("LotId", |
| | | getLotId().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProductId", |
| | | getProductId().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("OperationId", |
| | | getOperationId().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("Glass1Id", |
| | | getGlass1Id().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("Glass2Id", |
| | | getGlass2Id().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("JobType", |
| | | std::to_string(getJobType()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("MaterialsType", |
| | | std::to_string(getMaterialsType()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProductType", |
| | | std::to_string(getProductType()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("DummyType", |
| | | std::to_string(getDummyType()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("SkipFlag", |
| | | std::to_string(getSkipFlag()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProcessFlag", |
| | | std::to_string(getProcessFlag()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProcessResonCode", |
| | | std::to_string(getProcessResonCode()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("LastGlassFlag", |
| | | std::to_string(getLastGlassFlag()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("FirstGlassFlag", |
| | | std::to_string(getFirstGlassFlag()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("QTime1", |
| | | std::to_string(getQTime(0)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("QTime2", |
| | | std::to_string(getQTime(1)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("QTime3", |
| | | std::to_string(getQTime(2)).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("QTimeOverFlag", |
| | | std::to_string(getQTimeOverFlag()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("MasterRecipe", |
| | | std::to_string(getMasterRecipe()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("ProductRecipeId", |
| | | getProductRecipeId().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("PCode", |
| | | getPCode().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("UseType", |
| | | getUseType().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("PanelMeasure", |
| | | getPanelMeasure().c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("SlotUnitSelectFlag", |
| | | std::to_string(getSlotUnitSelectFlag()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("SourcePortNo", |
| | | std::to_string(getSourcePortNo()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("SourceSlotNo", |
| | | std::to_string(getSourceSlotNo()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("TargetPortNo", |
| | | std::to_string(getTargetPortNo()).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("TargetSlotNo", |
| | | std::to_string(getTargetSlotNo()).c_str(), "", weight++)); |
| | | } |
| | | } |
| | |
| | | #pragma once |
| | | #include "CAttributeVector.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | void setTargetPortNo(int no); |
| | | int getTargetSlotNo(); |
| | | void setTargetSlotNo(int no); |
| | | int serialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(const char* pszBuffer, int nBufferSize); |
| | | void getAttributeVector(CAttributeVector& attrubutes, int beginWeight); |
| | | |
| | | |
| | | private: |
| | | int m_nCassetteSequenceNo; |
| | |
| | | int m_nSourceSlotNo; |
| | | int m_nTargetPortNo; |
| | | int m_nTargetSlotNo; |
| | | |
| | | private: |
| | | char* m_pRawData; |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | |
| | | unsigned int weight = 101; |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Index", |
| | | std::to_string(m_nIndex).c_str(), "")); |
| | | std::to_string(m_nIndex).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Type", |
| | | getPortTypeDescription(m_nType, strTemp).c_str(), "")); |
| | | getPortTypeDescription(m_nType, strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Mode", |
| | | getPortModeDescription(m_nMode, strTemp).c_str(), "")); |
| | | getPortModeDescription(m_nMode, strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CassetteType", |
| | | getPortCassetteTypeDescription(m_nCassetteType, strTemp).c_str(), "")); |
| | | getPortCassetteTypeDescription(m_nCassetteType, strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("TransferMode", |
| | | getPortTransferModeDescription(m_nTransferMode, strTemp).c_str(), "")); |
| | | getPortTransferModeDescription(m_nTransferMode, strTemp).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Enable", |
| | | m_bEnable ? "Eanble" : "Disable", "")); |
| | | m_bEnable ? "Eanble" : "Disable", "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Auto Change", |
| | | m_bAutoChangeEnable ? "Eanble" : "Disable", "")); |
| | | m_bAutoChangeEnable ? "Eanble" : "Disable", "", weight++)); |
| | | } |
| | | |
| | | int CLoadPort::recvIntent(CPin* pPin, CIntent* pIntent) |
| | |
| | | |
| | | CMaster::CMaster() |
| | | { |
| | | m_listener = {nullptr, nullptr, nullptr, nullptr}; |
| | | m_listener = {nullptr, nullptr, nullptr, nullptr, nullptr}; |
| | | m_bDataModify = FALSE; |
| | | m_hEventReadBitsThreadExit[0] = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
| | | m_hEventReadBitsThreadExit[1] = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
| | |
| | | m_listener.onEqCimStateChanged = listener.onEqCimStateChanged; |
| | | m_listener.onEqAlarm = listener.onEqAlarm; |
| | | m_listener.onEqVcrEventReport = listener.onEqVcrEventReport; |
| | | m_listener.onEqDataChanged = listener.onEqDataChanged; |
| | | } |
| | | |
| | | int CMaster::init() |
| | |
| | | |
| | | // åå§åæ·»å ååè®¾å¤ |
| | | CLoadPort* pPort1, * pPort2, * pPort3, * pPort4; |
| | | CBonder* pBonder1, * pBonder2; |
| | | CEFEM* pEfem; |
| | | CArm* pArm; |
| | | CArmTray* pArmTray1, * pArmTray2; |
| | | CFliper* pFliper; |
| | | CVacuumBake* pVacuumBake; |
| | | CAligner* pAligner; |
| | | CBakeCooling* pBakeCooling; |
| | | |
| | | pPort1 = addLoadPort(0); |
| | | pPort2 = addLoadPort(1); |
| | | pPort3 = addLoadPort(2); |
| | | pPort4 = addLoadPort(3); |
| | | pEfem = addEFEM(); |
| | | pArm = addArm(); |
| | | pArmTray1 = addArmTray(0); |
| | | pArmTray2 = addArmTray(1); |
| | | pFliper = addFliper(); |
| | | pVacuumBake = addVacuumBake(); |
| | | pAligner = addAligner(); |
| | | pBonder1 = addBonder(0); |
| | | pBonder2 = addBonder(1); |
| | | pBakeCooling = addBakeCooling(); |
| | | |
| | | ASSERT(pEfem); |
| | | ASSERT(pFliper); |
| | | ASSERT(pVacuumBake); |
| | | ASSERT(pAligner); |
| | | ASSERT(pBonder1); |
| | | ASSERT(pBonder2); |
| | | ASSERT(pBakeCooling); |
| | | |
| | | pEfem->setPort(0, pPort1); |
| | | pEfem->setPort(1, pPort1); |
| | | pEfem->setPort(2, pPort1); |
| | | pEfem->setPort(3, pPort1); |
| | | pEfem->setFliper(pFliper); |
| | | pEfem->setAligner(pAligner); |
| | | pEfem->setArmTray(0, pArmTray1); |
| | | pEfem->setArmTray(1, pArmTray2); |
| | | pPort1->setArm(pArm); |
| | | pPort2->setArm(pArm); |
| | | pPort3->setArm(pArm); |
| | | pPort4->setArm(pArm); |
| | | pArmTray1->setArm(pArm); |
| | | pArmTray2->setArm(pArm); |
| | | pFliper->setArm(pArm); |
| | | pVacuumBake->setArm(pArm); |
| | | pAligner->setArm(pArm); |
| | | pBonder1->setArm(pArm); |
| | | pBonder2->setArm(pArm); |
| | | pBakeCooling->setArm(pArm); |
| | | |
| | | addFliper(); |
| | | addVacuumBake(); |
| | | addAligner(); |
| | | addBonder(0); |
| | | addBonder(1); |
| | | addBakeCooling(); |
| | | connectEquipments(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 读ç¼åæ°æ® |
| | |
| | | }; |
| | | listener.onDataChanged = [&](void* pEquipment, int code) -> void { |
| | | m_bDataModify = TRUE; |
| | | CEquipment* p = (CEquipment*)pEquipment; |
| | | if (m_listener.onEqDataChanged != nullptr) { |
| | | m_listener.onEqDataChanged(this, p, 0); |
| | | } |
| | | }; |
| | | |
| | | pEquipment->setListener(listener); |
| | |
| | | return pEquipment; |
| | | } |
| | | |
| | | int CMaster::addFliper() |
| | | CFliper* CMaster::addFliper() |
| | | { |
| | | CFliper* pEquipment = new CFliper(); |
| | | pEquipment->setID(EQ_ID_FLIPER); |
| | |
| | | |
| | | pEquipment->init(); |
| | | LOGE("已添å âFliperâ."); |
| | | return 0; |
| | | return pEquipment; |
| | | } |
| | | |
| | | int CMaster::addVacuumBake() |
| | | CVacuumBake* CMaster::addVacuumBake() |
| | | { |
| | | CVacuumBake* pEquipment = new CVacuumBake(); |
| | | pEquipment->setID(EQ_ID_VACUUMBAKE); |
| | |
| | | |
| | | pEquipment->init(); |
| | | LOGE("已添å âVacuumBakeâ."); |
| | | return 0; |
| | | |
| | | return pEquipment; |
| | | } |
| | | |
| | | int CMaster::addAligner() |
| | | CAligner* CMaster::addAligner() |
| | | { |
| | | CAligner* pEquipment = new CAligner(); |
| | | pEquipment->setID(EQ_ID_ALIGNER); |
| | |
| | | |
| | | pEquipment->init(); |
| | | LOGE("已添å âAlignerâ."); |
| | | return 0; |
| | | |
| | | return pEquipment; |
| | | } |
| | | |
| | | CEFEM* CMaster::addEFEM() |
| | |
| | | return pEquipment; |
| | | } |
| | | |
| | | CArm* CMaster::addArm() |
| | | { |
| | | CArm* pEquipment = new CArm(); |
| | | pEquipment->setID(EQ_ID_ARM); |
| | | pEquipment->setBaseAlarmId(BASE_ALARM_EFEM); |
| | | pEquipment->setName("ARM"); |
| | | pEquipment->setDescription("ARM."); |
| | | addToEquipmentList(pEquipment); |
| | | |
| | | |
| | | pEquipment->init(); |
| | | LOGE("已添å âARMâ."); |
| | | |
| | | return pEquipment; |
| | | } |
| | | |
| | | CArmTray* CMaster::addArmTray(int index) |
| | | { |
| | | CArmTray* pEquipment = new CArmTray(); |
| | | pEquipment->setID(index == 0 ? EQ_ID_ARM_TRAY1 : EQ_ID_ARM_TRAY2); |
| | | pEquipment->setBaseAlarmId(BASE_ALARM_EFEM); |
| | | pEquipment->setName(index == 0 ? "Arm Tray1" : "Arm Tray2"); |
| | | pEquipment->setDescription(index == 0 ? "Arm Tray1." : "Arm Tray2."); |
| | | addToEquipmentList(pEquipment); |
| | | |
| | | |
| | | pEquipment->init(); |
| | | LOGE("已添å â%sâ.", pEquipment->getName().c_str()); |
| | | |
| | | return pEquipment; |
| | | } |
| | | |
| | | /* æ·»å bonder1 æ bonder2 |
| | | * index -- 0, bonder1 |
| | | * index -- 1, bonder2 |
| | | */ |
| | | int CMaster::addBonder(int index) |
| | | CBonder* CMaster::addBonder(int index) |
| | | { |
| | | ASSERT(index == 0 || index == 1); |
| | | CBonder* pEquipment = new CBonder(); |
| | |
| | | LOGE("已添å â%sâ.", pEquipment->getName().c_str()); |
| | | |
| | | |
| | | return 0; |
| | | return pEquipment; |
| | | } |
| | | |
| | | int CMaster::addBakeCooling() |
| | | CBakeCooling* CMaster::addBakeCooling() |
| | | { |
| | | CBakeCooling* pEquipment = new CBakeCooling(); |
| | | pEquipment->setID(EQ_ID_BAKE_COOLING); |
| | |
| | | pEquipment->setStation(0, 255); |
| | | addToEquipmentList(pEquipment); |
| | | |
| | | |
| | | pEquipment->init(); |
| | | LOGE("已添å âAlignerâ."); |
| | | return 0; |
| | | |
| | | return pEquipment; |
| | | } |
| | | |
| | | void CMaster::onTimer(UINT nTimerid) |
| | |
| | | #include "CAligner.h" |
| | | #include "CVacuumBake.h" |
| | | #include "CBakeCooling.h" |
| | | #include "CArm.h" |
| | | #include "CArmTray.h" |
| | | #include "CCLinkIEControl.h" |
| | | |
| | | |
| | |
| | | typedef std::function<void(CStep* pStep, int code, void* pData)> ONEQSTEPEVENT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int state, int alarmId, int unitId, int level)> ONEQALARM; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, CVcrEventReport* pReport)> ONEQVCREVENTREPORT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int code)> ONEQDATACHANGED; |
| | | typedef struct _MasterListener |
| | | { |
| | | ONEQALIVE onEqAlive; |
| | | ONEQALIVE onEqCimStateChanged; |
| | | ONEQALARM onEqAlarm; |
| | | ONEQVCREVENTREPORT onEqVcrEventReport; |
| | | ONEQDATACHANGED onEqDataChanged; |
| | | } MasterListener; |
| | | |
| | | class CMaster |
| | |
| | | private: |
| | | int addToEquipmentList(CEquipment* pEquipment); |
| | | CLoadPort* addLoadPort(int index); |
| | | int addFliper(); |
| | | int addVacuumBake(); |
| | | int addAligner(); |
| | | CFliper* addFliper(); |
| | | CVacuumBake* addVacuumBake(); |
| | | CAligner* addAligner(); |
| | | CEFEM* addEFEM(); |
| | | int addBonder(int index); |
| | | int addBakeCooling(); |
| | | CArm* addArm(); |
| | | CArmTray* addArmTray(int index); |
| | | CBonder* addBonder(int index); |
| | | CBakeCooling* addBakeCooling(); |
| | | void connectEquipments(); |
| | | int saveCache(); |
| | | int saveCacheAndBackups(); |
| | |
| | | BOOL CPageGraph1::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | InitRxWindows(); |
| | | SetTimer(1, 3000, nullptr); |
| | | |
| | | |
| | |
| | | if (m_hbrBkgnd != nullptr) { |
| | | ::DeleteObject(m_hbrBkgnd); |
| | | } |
| | | |
| | | if (m_pObserver != nullptr) { |
| | | m_pObserver->unsubscribe(); |
| | | m_pObserver = NULL; |
| | | } |
| | | } |
| | | |
| | | void CPageGraph1::OnSize(UINT nType, int cx, int cy) |
| | |
| | | CString s; s.Format(_T("OnGraphItemClicked %d"), pGraphNmhdr->dwData); |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)m_pGraph->GetIndicateBoxData(pGraphNmhdr->dwData); |
| | | if (pEquipment != nullptr) { |
| | | //AfxMessageBox(pEquipment->getName().c_str()); |
| | | theApp.m_model.notifyPtr(RX_CODE_SELECT_EQUIPMENT, pEquipment); |
| | | } |
| | | |
| | |
| | | { |
| | | if (1 == nIDEvent) { |
| | | KillTimer(1); |
| | | InitRxWindows(); |
| | | |
| | | // æ´æ°ç¶æ |
| | | { |
| | |
| | | m_pEqsGraphWnd = nullptr; |
| | | m_crBkgnd = PAGE_GRPAH2_BACKGROUND_COLOR; |
| | | m_hbrBkgnd = nullptr; |
| | | m_pObserver = nullptr; |
| | | } |
| | | |
| | | CPageGraph2::~CPageGraph2() |
| | |
| | | // CPageGraph2 æ¶æ¯å¤çç¨åº |
| | | |
| | | |
| | | void CPageGraph2::InitRxWindows() |
| | | { |
| | | /* code */ |
| | | // 订é
æ°æ® |
| | | IRxWindows* pRxWindows = RX_GetRxWindows(); |
| | | pRxWindows->enableLog(5); |
| | | if (m_pObserver == NULL) { |
| | | m_pObserver = pRxWindows->allocObserver([&](IAny* pAny) -> void { |
| | | // onNext |
| | | pAny->addRef(); |
| | | int code = pAny->getCode(); |
| | | if (RX_CODE_EQ_DATA_CHANGED == code) { |
| | | // éç¥è®¾å¤ç¶æ |
| | | SERVO::CEquipment* pEquipment = nullptr; |
| | | if (pAny->getPtrValue("ptr", (void*&)pEquipment)) { |
| | | if (pEquipment != nullptr) { |
| | | m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, !pEquipment->isGlassListEmpty()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | pAny->release(); |
| | | }, [&]() -> void { |
| | | // onComplete |
| | | }, [&](IThrowable* pThrowable) -> void { |
| | | // onErrorm |
| | | pThrowable->printf(); |
| | | }); |
| | | |
| | | theApp.m_model.getObservable()->observeOn(pRxWindows->mainThread()) |
| | | ->subscribe(m_pObserver); |
| | | } |
| | | } |
| | | |
| | | BOOL CPageGraph2::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | InitRxWindows(); |
| | | SetTimer(1, 2000, nullptr); |
| | | |
| | | |
| | |
| | | // æµè¯ |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST1) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(0); |
| | | if (pEquipment->getID() == EQ_ID_LOADPORT1) { |
| | | pEquipment->outputGlass(1); |
| | | } |
| | | pEquipment->fetchedOutJob("P20250320A1A2"); |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST2) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(1); |
| | | pEquipment->storedJob("P20250320A1A2"); |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST3) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | |
| | | } |
| | | */ |
| | | |
| | | /* |
| | | |
| | | if (pEquipment->getID() == EQ_ID_Bonder1 |
| | | || pEquipment->getID() == EQ_ID_Bonder2) { |
| | | static int ii = 0; ii++; |
| | | pEquipment->setEqMode((ii % 5) + 1); |
| | | } |
| | | */ |
| | | |
| | | |
| | | /* |
| | | SERVO::CGlass* pGlass = pEquipment->getFrontGlass(); |
| | |
| | | if (m_hbrBkgnd != nullptr) { |
| | | ::DeleteObject(m_hbrBkgnd); |
| | | } |
| | | |
| | | if (m_pObserver != nullptr) { |
| | | m_pObserver->unsubscribe(); |
| | | m_pObserver = NULL; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | for (auto outPin : outPins) { |
| | | m_pEqsGraphWnd->AddPin(pItem, OUTPIN, outPin->getName().c_str(), (DWORD_PTR)outPin); |
| | | } |
| | | |
| | | m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, !pEquipment->isGlassListEmpty()); |
| | | } |
| | | |
| | | void CPageGraph2::OnTimer(UINT_PTR nIDEvent) |
| | |
| | | |
| | | |
| | | private: |
| | | void InitRxWindows(); |
| | | void AddEqToGraphWnd(SERVO::CEquipment* pEquipment); |
| | | void SaveEqsGraphData(); |
| | | void GetItemDataFormIni(const char* pszItemName, int& left, int& top); |
| | | |
| | | private: |
| | | IObserver* m_pObserver; |
| | | CEqsGraphWnd* m_pEqsGraphWnd; |
| | | COLORREF m_crBkgnd; |
| | | HBRUSH m_hbrBkgnd; |
| | |
| | | SetDlgItemText(IDC_LABEL_TITLE, pStep->getName().c_str()); |
| | | SERVO::CAttributeVector attrubutes; |
| | | pStep->getAttributeVector(attrubutes); |
| | | attrubutes.sortWithWeight(); |
| | | unsigned int nSize = attrubutes.size(); |
| | | for (unsigned int i = 0; i < nSize; i++) { |
| | | SERVO::CAttribute* pAttribute = attrubutes.getAttribute(i); |
| | |
| | | CStep::getAttributeVector(attrubutes); |
| | | std::string strTemp; |
| | | |
| | | unsigned int weight = 21; |
| | | attrubutes.addAttribute(new CAttribute("Current Step", |
| | | std::to_string(m_nCurStep).c_str(), "")); |
| | | std::to_string(m_nCurStep).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Signal Dev", |
| | | ("W" + CToolUnits::toHexString(m_nWriteSignalDev, strTemp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nWriteSignalDev, strTemp)).c_str(), "", weight++)); |
| | | } |
| | | |
| | | void CReadStep::init() |
| | |
| | | { |
| | | m_nSyncStatus = SS_NONE; |
| | | m_nTotalMasterRecipeCount = 0; |
| | | m_nTotalParameterCount = 0; |
| | | m_nWordThreadAddr = 0; |
| | | m_hWorkStop = nullptr; |
| | | m_hWorkThreadHandle = nullptr; |
| | |
| | | ASSERT(pRecipeList); |
| | | |
| | | |
| | | // è¿éææ¶åªå¤çreportType=4ï¼å³Request from EAS |
| | | if (reportType == 4) { |
| | | /* |
| | | 1: Create |
| | | 2: Modify |
| | | 3: Delete |
| | | 4: Request from EAS |
| | | */ |
| | | if (reportType == RT_CREATE) { |
| | | |
| | | } |
| | | else if (reportType == RT_MODIFY) { |
| | | |
| | | } |
| | | else if (reportType == RT_DELETE) { |
| | | |
| | | } |
| | | else if (reportType == RT_REQUEST_FROM_EAS) { |
| | | int nRet = pRecipeList->addRecipePacket(toatlGroupCount, currentGroupCount, pszIdsData, 250 * 2); |
| | | if (MRLRC_CURRENT_RECIPE_COMPLETE == nRet) { |
| | | lock(); |
| | |
| | | return MRLRC_OK; |
| | | } |
| | | |
| | | short CRecipesManager::decodeRecipeParameterReport(const char* pszData, size_t size) |
| | | { |
| | | int index = 0; |
| | | int masterRecipeId, localRecipeId, unitNo, reportType; |
| | | int totalParameterCount; |
| | | int toatlGroupCount, currentGroupCount; |
| | | const char* pszParameterData; |
| | | |
| | | masterRecipeId = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | localRecipeId = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | unitNo = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | reportType = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | totalParameterCount = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | toatlGroupCount = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | currentGroupCount = CToolUnits::toInt16(&pszData[index]); |
| | | index += 2; |
| | | |
| | | pszParameterData = &pszData[index]; |
| | | |
| | | |
| | | lock(); |
| | | if (m_nTotalParameterCount == 0) m_nTotalParameterCount = toatlGroupCount; |
| | | if (m_nTotalParameterCount != toatlGroupCount) { |
| | | return MRLRC_MASTER_RECIPE_LIST_COUNT_NG; |
| | | } |
| | | m_nTimeoutCount = 0; |
| | | unlock(); |
| | | |
| | | |
| | | |
| | | |
| | | // æ¾å°å¯¹åºCRecipeList, æ¾ä¸å°åæ°å»º |
| | | /* |
| | | lock(); |
| | | CRecipeList* pRecipeList = getRecipeListFromTemp(unitNo); |
| | | if (pRecipeList == nullptr) { |
| | | pRecipeList = new CRecipeList(unitNo); |
| | | m_mapRecipesTemp[unitNo] = pRecipeList; |
| | | } |
| | | unlock(); |
| | | ASSERT(pRecipeList); |
| | | */ |
| | | |
| | | /* |
| | | 1: Create |
| | | 2: Modify |
| | | 3: Delete |
| | | 4: Request from EAS |
| | | */ |
| | | /* |
| | | if (reportType == RT_CREATE) { |
| | | |
| | | } |
| | | else if (reportType == RT_MODIFY) { |
| | | |
| | | } |
| | | else if (reportType == RT_DELETE) { |
| | | |
| | | } |
| | | else if (reportType == RT_REQUEST_FROM_EAS) { |
| | | int nRet = pRecipeList->addRecipePacket(toatlGroupCount, currentGroupCount, pszIdsData, 250 * 2); |
| | | if (MRLRC_CURRENT_RECIPE_COMPLETE == nRet) { |
| | | lock(); |
| | | if (m_nTotalMasterRecipeCount == m_mapRecipesTemp.size()) { |
| | | for (auto item : m_mapRecipes) { |
| | | delete item.second; |
| | | } |
| | | m_mapRecipes = m_mapRecipesTemp; |
| | | m_mapRecipesTemp.clear(); |
| | | m_nSyncStatus = SS_COMPLETE; |
| | | unlock(); |
| | | return MRLRC_OK; |
| | | } |
| | | unlock(); |
| | | } |
| | | else if (MRLRC_CONTINUE == nRet) { |
| | | return MRLRC_CONTINUE; |
| | | } |
| | | } |
| | | */ |
| | | |
| | | return MRLRC_OK; |
| | | } |
| | | |
| | | CRecipeList* CRecipesManager::getRecipeListFromTemp(int unitNo) |
| | | { |
| | | auto iter = m_mapRecipesTemp.find(unitNo); |
| | |
| | | int syncing(); |
| | | void syncFailed(); |
| | | short decodeRecipeListReport(const char* pszData, size_t size); |
| | | short decodeRecipeParameterReport(const char* pszData, size_t size); |
| | | CRecipeList* getRecipeListFromTemp(int unitNo); |
| | | |
| | | public: |
| | |
| | | CRITICAL_SECTION m_cs; // 忥é |
| | | int m_nSyncStatus; |
| | | int m_nTotalMasterRecipeCount; |
| | | int m_nTotalParameterCount; |
| | | std::map<int, CRecipeList*> m_mapRecipes; |
| | | std::map<int, CRecipeList*> m_mapRecipesTemp; |
| | | }; |
| | |
| | | |
| | | void CStep::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | unsigned int weight = 1; |
| | | attrubutes.clear(); |
| | | attrubutes.addAttribute(new CAttribute("Network", |
| | | std::to_string(m_station.nNetNo).c_str(), "")); |
| | | std::to_string(m_station.nNetNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Station", |
| | | std::to_string(m_station.nStNo).c_str(), "")); |
| | | std::to_string(m_station.nStNo).c_str(), "", weight++)); |
| | | attrubutes.addAttributeVector(m_attributeVector); |
| | | |
| | | } |
| | | |
| | | void CStep::init() |
| | |
| | | |
| | | } |
| | | |
| | | void CStep::setProp(const char* pszKey, void* pValue) |
| | | { |
| | | m_mapProp[pszKey] = pValue; |
| | | } |
| | | |
| | | void* CStep::getProp(const char* pszKey) |
| | | { |
| | | auto iter = m_mapProp.find(pszKey); |
| | | if (iter == m_mapProp.end()) return nullptr; |
| | | return iter->second; |
| | | } |
| | | |
| | | void CStep::addAttribute(CAttribute* pAttribute) |
| | | { |
| | | // æ·»å attributeæ¶ï¼è¦åå é¤åå¨çååçattribute |
| | | m_attributeVector.addAttribute(pAttribute, TRUE); |
| | | } |
| | | |
| | | void CStep::addAttributeVector(CAttributeVector& attributeVector) |
| | | { |
| | | // æ·»å attributeæ¶ï¼è¦åå é¤åå¨çååçattribute |
| | | unsigned int size = attributeVector.size(); |
| | | for (unsigned int i = 0; i < size; i++) { |
| | | m_attributeVector.addAttribute(attributeVector.getAttribute(i), TRUE); |
| | | } |
| | | } |
| | | |
| | | void CStep::convertString(const char* pszBuffer, int size, std::string& strOut) |
| | | { |
| | | strOut.clear(); |
| | |
| | | #include "CCLinkIEControl.h" |
| | | #include "CAttributeVector.h" |
| | | #include "ToolUnits.h" |
| | | #include <map> |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual void init(); |
| | | virtual void term(); |
| | | |
| | | void setProp(const char* pszKey, void* pValue); |
| | | void* getProp(const char* pszKey); |
| | | void addAttribute(CAttribute* pAttribute); |
| | | void addAttributeVector(CAttributeVector& attributeVector); |
| | | |
| | | protected: |
| | | inline void Lock() { EnterCriticalSection(&m_criticalSection); } |
| | |
| | | CEquipment* m_pEquipment; |
| | | CCCLinkIEControl* m_pCclink; |
| | | CRITICAL_SECTION m_criticalSection; |
| | | std::map<std::string, void*> m_mapProp; |
| | | CAttributeVector m_attributeVector; |
| | | }; |
| | | } |
| | | |
| | |
| | | CStep::getAttributeVector(attrubutes); |
| | | std::string temp; |
| | | |
| | | unsigned int weight = 20; |
| | | attrubutes.addAttribute(new CAttribute("Current Step", |
| | | std::to_string(m_nCurStep).c_str(), "")); |
| | | std::to_string(m_nCurStep).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Signal Dev", |
| | | ("W" + CToolUnits::toHexString(m_nWriteSignalDev, temp)).c_str(), "")); |
| | | ("W" + CToolUnits::toHexString(m_nWriteSignalDev, temp)).c_str(), "", weight++)); |
| | | } |
| | | |
| | | void CWriteStep::init() |
| | |
| | | #define RX_CODE_SELECT_STEP 1007 |
| | | #define RX_CODE_ALARM_SET 1008 |
| | | #define RX_CODE_ALARM_CLEAR 1009 |
| | | #define RX_CODE_EQ_DATA_CHANGED 1010 |
| | | |
| | | |
| | | /* Channel Name */ |
| | |
| | | #define EQ_ID_VACUUMBAKE 9 |
| | | #define EQ_ID_ALIGNER 10 |
| | | #define EQ_ID_BAKE_COOLING 11 |
| | | #define EQ_ID_ARM 12 |
| | | #define EQ_ID_ARM_TRAY1 13 |
| | | #define EQ_ID_ARM_TRAY2 14 |
| | | #define EQ_ID_OPERATOR_REMOVE 999 |
| | | |
| | | |
| | |
| | | #define STEP_EQ_P3_CASSETTE_CTRL_CMD _T("EQPort3CassetteCtrlCmd") |
| | | #define STEP_EQ_P4_CASSETTE_CTRL_CMD _T("EQPort4CassetteCtrlCmd") |
| | | #define STEP_EQ_CIM_MESSAGE_CONFIRM _T("EQCimMessageConfirm") |
| | | #define STEP_EQ_RECEIVED_JOB_UPSn _T("EQJEReceivedJobUps") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS1 _T("EQJEReceivedJobUps1") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS2 _T("EQJEReceivedJobUps2") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS3 _T("EQJEReceivedJobUps3") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS4 _T("EQJEReceivedJobUps4") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS5 _T("EQJEReceivedJobUps5") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS6 _T("EQJEReceivedJobUps6") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS7 _T("EQJEReceivedJobUps7") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS8 _T("EQJEReceivedJobUps8") |
| | | #define STEP_EQ_RECEIVED_JOB_UPS9 _T("EQJEReceivedJobUps9") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNSn _T("EQJESentOutJobDowns") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS1 _T("EQJESentOutJobDowns1") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS2 _T("EQJESentOutJobDowns2") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS3 _T("EQJESentOutJobDowns3") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS4 _T("EQJESentOutJobDowns4") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS5 _T("EQJESentOutJobDowns5") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS6 _T("EQJESentOutJobDowns6") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS7 _T("EQJESentOutJobDowns7") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS8 _T("EQJESentOutJobDowns8") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS9 _T("EQJESentOutJobDowns9") |
| | | #define STEP_EQ_VCR1_EVENT_REPORT _T("EQVcr1EventReport") |
| | | #define STEP_EQ_RURRENT_RECIPE_CHANGE _T("EQCurrentRecipeChange") |
| | | #define STEP_EQ_MASTER_RECIPE_LIST_REQ _T("EQMasterRecipeListReq") |
| | | #define STEP_EQ_MASTER_RECIPE_LIST _T("EQMasterRecipeListReport") |
| | | #define STEP_EQ_RECIPE_PARAMETER_REQ _T("EQRecipeParameterReq") |
| | | #define STEP_EQ_RECIPE_PARAMETER _T("EQRecipeParameterReport") |
| | | #define STEP_EQ_RECEIVED_JOBn _T("EQReceivedJobReport") |
| | | #define STEP_EQ_RECEIVED_JOB1 _T("EQReceivedJobReport1") |
| | | #define STEP_EQ_RECEIVED_JOB2 _T("EQReceivedJobReport2") |
| | | #define STEP_EQ_RECEIVED_JOB3 _T("EQReceivedJobReport3") |
| | | #define STEP_EQ_RECEIVED_JOB4 _T("EQReceivedJobReport4") |
| | | #define STEP_EQ_RECEIVED_JOB5 _T("EQReceivedJobReport5") |
| | | #define STEP_EQ_RECEIVED_JOB6 _T("EQReceivedJobReport6") |
| | | #define STEP_EQ_RECEIVED_JOB7 _T("EQReceivedJobReport7") |
| | | #define STEP_EQ_RECEIVED_JOB8 _T("EQReceivedJobReport8") |
| | | #define STEP_EQ_RECEIVED_JOB9 _T("EQReceivedJobReport9") |
| | | #define STEP_EQ_FETCHED_OUT_JOBn _T("EQFetchedOutJobReport") |
| | | #define STEP_EQ_FETCHED_OUT_JOB1 _T("EQFetchedOutJobReport1") |
| | | #define STEP_EQ_FETCHED_OUT_JOB2 _T("EQFetchedOutJobReport2") |
| | | #define STEP_EQ_FETCHED_OUT_JOB3 _T("EQFetchedOutJobReport3") |
| | | #define STEP_EQ_FETCHED_OUT_JOB4 _T("EQFetchedOutJobReport4") |
| | | #define STEP_EQ_FETCHED_OUT_JOB5 _T("EQFetchedOutJobReport5") |
| | | #define STEP_EQ_FETCHED_OUT_JOB6 _T("EQFetchedOutJobReport6") |
| | | #define STEP_EQ_FETCHED_OUT_JOB7 _T("EQFetchedOutJobReport7") |
| | | #define STEP_EQ_FETCHED_OUT_JOB8 _T("EQFetchedOutJobReport8") |
| | | #define STEP_EQ_FETCHED_OUT_JOB9 _T("EQFetchedOutJobReport9") |
| | | #define STEP_EQ_FETCHED_OUT_JOB10 _T("EQFetchedOutJobReport10") |
| | | #define STEP_EQ_FETCHED_OUT_JOB11 _T("EQFetchedOutJobReport11") |
| | | #define STEP_EQ_FETCHED_OUT_JOB12 _T("EQFetchedOutJobReport12") |
| | | #define STEP_EQ_FETCHED_OUT_JOB13 _T("EQFetchedOutJobReport13") |
| | | #define STEP_EQ_FETCHED_OUT_JOB14 _T("EQFetchedOutJobReport14") |
| | | #define STEP_EQ_FETCHED_OUT_JOB15 _T("EQFetchedOutJobReport15") |
| | | #define STEP_EQ_STORED_JOBn _T("EQStoredJobReport") |
| | | #define STEP_EQ_STORED_JOB1 _T("EQStoredJobReport1") |
| | | #define STEP_EQ_STORED_JOB2 _T("EQStoredJobReport2") |
| | | #define STEP_EQ_STORED_JOB3 _T("EQStoredJobReport3") |
| | | #define STEP_EQ_STORED_JOB4 _T("EQStoredJobReport4") |
| | | #define STEP_EQ_STORED_JOB5 _T("EQStoredJobReport5") |
| | | #define STEP_EQ_STORED_JOB6 _T("EQStoredJobReport6") |
| | | #define STEP_EQ_STORED_JOB7 _T("EQStoredJobReport7") |
| | | #define STEP_EQ_STORED_JOB8 _T("EQStoredJobReport8") |
| | | #define STEP_EQ_STORED_JOB9 _T("EQStoredJobReport9") |
| | | #define STEP_EQ_STORED_JOB10 _T("EQStoredJobReport10") |
| | | #define STEP_EQ_STORED_JOB11 _T("EQStoredJobReport11") |
| | | #define STEP_EQ_STORED_JOB12 _T("EQStoredJobReport12") |
| | | #define STEP_EQ_STORED_JOB13 _T("EQStoredJobReport13") |
| | | #define STEP_EQ_STORED_JOB14 _T("EQStoredJobReport14") |
| | | #define STEP_EQ_STORED_JOB15 _T("EQStoredJobReport15") |
| | | |
| | | |
| | | |
| | | /* Step ID */ |
| | |
| | | #define STEP_ID_VCR_ENABLE_CMD_REPLY 0x554 |
| | | #define STEP_ID_EQMODE_CHANGE_CMD_REPLY 0x555 |
| | | #define STEP_ID_MASTER_RECIPE_LIST_CMD_REPLY 0x556 |
| | | #define STEP_ID_RECIPE_PARAMETER_CMD_REPLY 0x557 |
| | | #define STEP_ID_EQMODE_CHANGED 0x560 |
| | | #define STEP_ID_EQSTATUS_CHANGED 0x561 |
| | | #define STEP_ID_EQALARM1 0x562 |
| | |
| | | #define STEP_ID_CIM_MSG_CONFIRM_REPORT 0x569 |
| | | #define STEP_ID_VCR1_EVENT_REPORT 0x56A |
| | | #define STEP_ID_MASTER_RECIPE_LIST_REPORT 0x56B |
| | | #define STEP_ID_RECIPE_PARAMETER_REPORT 0x56C |
| | | #define STEP_ID_RECIVE_JOB_UPS1 0x580 |
| | | #define STEP_ID_RECIVE_JOB_UPS2 0x581 |
| | | #define STEP_ID_RECIVE_JOB_UPS3 0x582 |
| | | #define STEP_ID_RECIVE_JOB_UPS4 0x583 |
| | | #define STEP_ID_RECIVE_JOB_UPS5 0x584 |
| | | #define STEP_ID_RECIVE_JOB_UPS6 0x585 |
| | | #define STEP_ID_RECIVE_JOB_UPS7 0x586 |
| | | #define STEP_ID_RECIVE_JOB_UPS8 0x587 |
| | | #define STEP_ID_RECIVE_JOB_UPS9 0x588 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS1 0x590 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS2 0x591 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS3 0x592 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS4 0x593 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS5 0x594 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS6 0x595 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS7 0x596 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS8 0x597 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS9 0x598 |
| | | #define STEP_ID_STORE_JOB_REPORT1 0x5A0 |
| | | #define STEP_ID_STORE_JOB_REPORT2 0x5A1 |
| | | #define STEP_ID_STORE_JOB_REPORT3 0x5A2 |
| | | #define STEP_ID_STORE_JOB_REPORT4 0x5A3 |
| | | #define STEP_ID_STORE_JOB_REPORT5 0x5A4 |
| | | #define STEP_ID_STORE_JOB_REPORT6 0x5A5 |
| | | #define STEP_ID_STORE_JOB_REPORT7 0x5A6 |
| | | #define STEP_ID_STORE_JOB_REPORT8 0x5A7 |
| | | #define STEP_ID_STORE_JOB_REPORT9 0x5A8 |
| | | #define STEP_ID_STORE_JOB_REPORT10 0x5A9 |
| | | #define STEP_ID_STORE_JOB_REPORT11 0x5AA |
| | | #define STEP_ID_STORE_JOB_REPORT12 0x5AB |
| | | #define STEP_ID_STORE_JOB_REPORT13 0x5AC |
| | | #define STEP_ID_STORE_JOB_REPORT14 0x5AD |
| | | #define STEP_ID_STORE_JOB_REPORT15 0x5AE |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT1 0x5AF |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT2 0x5B0 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT3 0x5B1 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT4 0x5B2 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT5 0x5B3 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT6 0x5B4 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT7 0x5B5 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT8 0x5B6 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT9 0x5B7 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT10 0x5B8 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT11 0x5B9 |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT12 0x5BA |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT13 0x5BB |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT14 0x5BC |
| | | #define STEP_ID_FETCHED_OUT_JOB_REPORT15 0x5BD |
| | | #define STEP_ID_PORT1_TYPE_CHANGE 0x600 |
| | | #define STEP_ID_PORT2_TYPE_CHANGE 0x601 |
| | | #define STEP_ID_PORT3_TYPE_CHANGE 0x602 |
| | |
| | | #define ORDER_BY_GROUP_COUNT_NG 7 |
| | | |
| | | |
| | | /* |
| | | Report type |
| | | 1: Create |
| | | 2: Modify |
| | | 3: Delete |
| | | 4: Request from EAS |
| | | */ |
| | | #define RT_CREATE 1 |
| | | #define RT_MODIFY 2 |
| | | #define RT_DELETE 3 |
| | | #define RT_REQUEST_FROM_EAS 4 |
| | | |
| | | |
| | |
| | | HBRUSH hbrItemBackground[2]; |
| | | HBRUSH hbrItemFrame[2]; |
| | | HBRUSH hbrPinBackground[3]; |
| | | HBRUSH hbrIndicator; |
| | | hbrItemBackground[0] = CreateSolidBrush(m_crItemBackground[0]); |
| | | hbrItemBackground[1] = CreateSolidBrush(m_crItemBackground[1]); |
| | | hbrItemFrame[0] = CreateSolidBrush(m_crItemFrame[0]); |
| | | hbrItemFrame[1] = CreateSolidBrush(m_crItemFrame[1]); |
| | | hbrIndicator = CreateSolidBrush(RGB(34, 177, 76)); |
| | | for (int i = 0; i < 3; i++) { |
| | | hbrPinBackground[i] = CreateSolidBrush(m_crPinBkgnd[i]); |
| | | } |
| | |
| | | HFONT hFontOld = (HFONT)::SelectObject(hMemDC, m_hFontName); |
| | | ::SetTextColor(hMemDC, pItem->bHighlight ? m_crItemNameText[1] : m_crItemNameText[0]); |
| | | ::DrawText(hMemDC, pItem->text, (int)strlen(pItem->text), &rcItem, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS); |
| | | |
| | | |
| | | // æ·»å ä¸ä¸ªå°ç»¿ç¹æç¤ºå¨ |
| | | if(pItem->bShowIndicator[0]){ |
| | | RECT rcIndicator; |
| | | rcIndicator.left = rcItem.left + 5; |
| | | rcIndicator.top = rcItem.top + 5; |
| | | rcIndicator.right = rcIndicator.left + 12; |
| | | rcIndicator.bottom = rcIndicator.top + 12; |
| | | HRGN hRgn = CreateRoundRectRgn(rcIndicator.left, rcIndicator.top, rcIndicator.right, rcIndicator.bottom, 2, 2); |
| | | ::FillRgn(hMemDC, hRgn, hbrIndicator); |
| | | ::FrameRgn(hMemDC, hRgn, hbrItemFrame[0], 1, 1); |
| | | ::DeleteObject(hRgn); |
| | | } |
| | | |
| | | |
| | | if (pItem->nShowType != ITEM_SMALL) { |
| | | RECT rcId = rcItem; |
| | |
| | | ::DeleteObject(hbrItemBackground[1]); |
| | | ::DeleteObject(hbrItemFrame[0]); |
| | | ::DeleteObject(hbrItemFrame[1]); |
| | | ::DeleteObject(hbrIndicator); |
| | | } |
| | | |
| | | |
| | |
| | | SetTimer(m_hWnd, TIMER_ANIMATION_RECT, uElpase, NULL); |
| | | } |
| | | |
| | | void CEqsGraphWnd::ShowItemIndicator(DWORD_PTR dwItemData, BOOL bShow) |
| | | { |
| | | EQITEM* pItem = GetItem(dwItemData); |
| | | if (pItem != nullptr) { |
| | | pItem->bShowIndicator[0] = bShow; |
| | | ::InvalidateRect(m_hWnd, nullptr, TRUE); |
| | | } |
| | | } |
| | | |
| | | double CEqsGraphWnd::PointToSegDist(double x, double y, double x1, double y1, double x2, double y2) |
| | | { |
| | | double cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1); |
| | |
| | | DWORD_PTR pInPins; |
| | | DWORD_PTR pOutPins; |
| | | int nFlashFlag; |
| | | BOOL bShowIndicator[2]; |
| | | } EQITEM; |
| | | |
| | | typedef struct tagPIN |
| | |
| | | void SetItemPos(EQITEM* pItem, int x, int y); |
| | | void FlashItem(EQITEM* pItem); |
| | | void AnimationItem(EQITEM*pItem); |
| | | void ShowItemIndicator(DWORD_PTR dwItemData, BOOL bShow); |
| | | |
| | | private: |
| | | void Init(); |
| | |
| | | |
| | | IObservable* CModel::getObservable() |
| | | { |
| | | if (m_pObservable == nullptr) { |
| | | m_pObservable = RX_AllocaObservable([&](IObservableEmitter* e) -> void { |
| | | m_pObservableEmitter = e; // ä¿ååå°å¨ |
| | | }); |
| | | } |
| | | |
| | | return m_pObservable; |
| | | } |
| | | |
| | |
| | | CLog::GetLog()->SetLogsDir(strLogDir); |
| | | CLog::GetLog()->SetEquipmentId((LPTSTR)(LPCTSTR)strUnitId); |
| | | LOGI("\r\n\r\n~~~ Prog Start! ~~~"); |
| | | |
| | | |
| | | m_pObservable = RX_AllocaObservable([&](IObservableEmitter* e) -> void { |
| | | m_pObservableEmitter = e; // ä¿ååå°å¨ |
| | | }); |
| | | |
| | | |
| | | SECSListener listener; |
| | |
| | | masterListener.onEqVcrEventReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, SERVO::CVcrEventReport* pReport) { |
| | | LOGE("<CModel>onEqVcrEventReport."); |
| | | }; |
| | | masterListener.onEqDataChanged = [&](void* pMaster, SERVO::CEquipment* pEquipment, int code) { |
| | | LOGE("<CModel>onEqDataChanged."); |
| | | notifyPtr(RX_CODE_EQ_DATA_CHANGED, pEquipment); |
| | | }; |
| | | m_master.setListener(masterListener); |
| | | |
| | | |
| ÎļþÃû´Ó SourceCode/Bond/Servo/AlarmDlg.cpp ÐÞ¸Ä |
| | |
| | | #include "stdafx.h" |
| | | #include "Servo.h" |
| | | #include "afxdialogex.h" |
| | | #include "AlarmDlg.h" |
| | | #include "PageAlarm.h" |
| | | #include "AlarmManager.h" |
| | | #include "Common.h" |
| | | #include <iomanip> |
| | |
| | | #define PAGE_SIZE 100 |
| | | #define PAGE_BACKGROUND_COLOR RGB(252, 252, 255) |
| | | |
| | | // CAlarmDlg å¯¹è¯æ¡ |
| | | // CPageAlarm å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CAlarmDlg, CDialogEx) |
| | | IMPLEMENT_DYNAMIC(CPageAlarm, CDialogEx) |
| | | |
| | | CAlarmDlg::CAlarmDlg(CWnd* pParent /*=nullptr*/) |
| | | CPageAlarm::CPageAlarm(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_DIALOG_ALARM, pParent) |
| | | { |
| | | m_crBkgnd = PAGE_BACKGROUND_COLOR; |
| | |
| | | m_szTimeEnd[0] = '\0'; |
| | | } |
| | | |
| | | CAlarmDlg::~CAlarmDlg() |
| | | CPageAlarm::~CPageAlarm() |
| | | { |
| | | } |
| | | |
| | | void CAlarmDlg::InitRxWindow() |
| | | void CPageAlarm::InitRxWindow() |
| | | { |
| | | /* code */ |
| | | // 订é
æ°æ® |
| | |
| | | } |
| | | } |
| | | |
| | | void CAlarmDlg::Resize() |
| | | void CPageAlarm::Resize() |
| | | { |
| | | CWnd* pItem; |
| | | CRect rcClient; |
| | |
| | | pItem->MoveWindow(12, 58, rcClient.Width() - 24, rcClient.Height() - 64); |
| | | } |
| | | |
| | | void CAlarmDlg::LoadAlarms() |
| | | void CPageAlarm::LoadAlarms() |
| | | { |
| | | // å·æ°å岿¥è¦æ°æ® |
| | | m_nCurPage = 1; |
| | | UpdatePageData(); |
| | | } |
| | | |
| | | void CAlarmDlg::UpdatePageData() |
| | | void CPageAlarm::UpdatePageData() |
| | | { |
| | | // æ ¹æ®è¿æ»¤æ¡ä»¶å è½½æ°æ®ï¼æä¾æè¿°åæ¶é´èå´æ¥è¯¢ |
| | | auto vecData = AlarmManager::getInstance().getFilteredAlarms("", "", m_strDeviceName, m_strUnitName, m_strKeyword, m_szTimeStart, m_szTimeEnd, m_nCurPage, PAGE_SIZE); |
| | |
| | | UpdatePageControls(); |
| | | } |
| | | |
| | | void CAlarmDlg::UpdatePageControls() |
| | | void CPageAlarm::UpdatePageControls() |
| | | { |
| | | // æ´æ°åé¡µä¿¡æ¯ |
| | | CString strPage; |
| | |
| | | GetDlgItem(IDC_BUTTON_NEXT_PAGE)->EnableWindow(m_nCurPage < m_nTotalPages); |
| | | } |
| | | |
| | | <<<<<<< HEAD:SourceCode/Bond/Servo/AlarmDlg.cpp |
| | | void CAlarmDlg::FillDataToListCtrl(CListCtrl* pListCtrl, const std::vector<AlarmData>& vecData) |
| | | ======= |
| | | void CPageAlarm::FillDataToListCtrl(CListCtrl* pListCtrl, const std::vector<AlarmData>& vecData) |
| | | >>>>>>> clh:SourceCode/Bond/Servo/PageAlarm.cpp |
| | | { |
| | | if (pListCtrl == nullptr || pListCtrl->m_hWnd == nullptr) { |
| | | return; |
| | |
| | | } |
| | | |
| | | static char* pszAlarmLevel[] = { "Warning", "Error" }; |
| | | <<<<<<< HEAD:SourceCode/Bond/Servo/AlarmDlg.cpp |
| | | void CAlarmDlg::InsertAlarmData(CListCtrl* pListCtrl, const AlarmData& alarmData) |
| | | ======= |
| | | void CPageAlarm::InsertAlarmData(CListCtrl* pListCtrl, const AlarmData& alarmData) |
| | | >>>>>>> clh:SourceCode/Bond/Servo/PageAlarm.cpp |
| | | { |
| | | if (pListCtrl == nullptr || pListCtrl->m_hWnd == nullptr) { |
| | | return; |
| | |
| | | pListCtrl->SetItemText(nNewItem, 7, alarmData.strDescription.c_str()); // æè¿° |
| | | } |
| | | |
| | | std::string CAlarmDlg::getCurrentTimeString() |
| | | std::string CPageAlarm::getCurrentTimeString() |
| | | { |
| | | auto now = std::chrono::system_clock::now(); |
| | | auto time_t_now = std::chrono::system_clock::to_time_t(now); |
| | |
| | | return ss.str(); |
| | | } |
| | | |
| | | void CAlarmDlg::DoDataExchange(CDataExchange* pDX) |
| | | void CPageAlarm::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_START, m_dateTimeStart); |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_END, m_dateTimeEnd); |
| | |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CAlarmDlg, CDialogEx) |
| | | BEGIN_MESSAGE_MAP(CPageAlarm, CDialogEx) |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_DESTROY() |
| | | ON_WM_CLOSE() |
| | | ON_WM_SIZE() |
| | | <<<<<<< HEAD:SourceCode/Bond/Servo/AlarmDlg.cpp |
| | | ON_WM_TIMER() |
| | | ON_CBN_SELCHANGE(IDC_COMBO_DATETIME, &CAlarmDlg::OnCbnSelchangeComboDatetime) |
| | | ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CAlarmDlg::OnBnClickedButtonSearch) |
| | | ON_BN_CLICKED(IDC_BUTTON_EXPORT, &CAlarmDlg::OnBnClickedButtonExport) |
| | | ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CAlarmDlg::OnBnClickedButtonPrevPage) |
| | | ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CAlarmDlg::OnBnClickedButtonNextPage) |
| | | ======= |
| | | ON_CBN_SELCHANGE(IDC_COMBO_DATETIME, &CPageAlarm::OnCbnSelchangeComboDatetime) |
| | | ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CPageAlarm::OnBnClickedButtonSearch) |
| | | ON_BN_CLICKED(IDC_BUTTON_EXPORT, &CPageAlarm::OnBnClickedButtonExport) |
| | | ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CPageAlarm::OnBnClickedButtonPrevPage) |
| | | ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CPageAlarm::OnBnClickedButtonNextPage) |
| | | >>>>>>> clh:SourceCode/Bond/Servo/PageAlarm.cpp |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CAlarmDlg æ¶æ¯å¤çç¨åº |
| | | BOOL CAlarmDlg::OnInitDialog() |
| | | BOOL CPageAlarm::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | SetTimer(1, 3000, nullptr); |
| | |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | HBRUSH CAlarmDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | HBRUSH CPageAlarm::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); |
| | | |
| | |
| | | return m_hbrBkgnd; |
| | | } |
| | | |
| | | void CAlarmDlg::OnDestroy() |
| | | void CPageAlarm::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | void CAlarmDlg::OnClose() |
| | | void CPageAlarm::OnClose() |
| | | { |
| | | ShowWindow(SW_HIDE); |
| | | GetParent()->PostMessage(ID_MSG_ALARMDLG_HIDE, 0, 0); |
| | | } |
| | | |
| | | void CAlarmDlg::OnSize(UINT nType, int cx, int cy) |
| | | void CPageAlarm::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | if (GetDlgItem(IDC_LIST_ALARM) == nullptr) return; |
| | | Resize(); |
| | | } |
| | | |
| | | <<<<<<< HEAD:SourceCode/Bond/Servo/AlarmDlg.cpp |
| | | void CAlarmDlg::OnTimer(UINT_PTR nIDEvent) |
| | | { |
| | | if (1 == nIDEvent) { |
| | |
| | | } |
| | | |
| | | void CAlarmDlg::OnCbnSelchangeComboDatetime() |
| | | ======= |
| | | void CPageAlarm::OnCbnSelchangeComboDatetime() |
| | | >>>>>>> clh:SourceCode/Bond/Servo/PageAlarm.cpp |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | int nIndex = pComboBox->GetCurSel(); |
| | |
| | | m_dateTimeEnd.EnableWindow(nIndex == nCount - 1); |
| | | } |
| | | |
| | | void CAlarmDlg::OnBnClickedButtonSearch() |
| | | void CPageAlarm::OnBnClickedButtonSearch() |
| | | { |
| | | // è·åå
³é®å |
| | | CString cstrKeyword; |
| | |
| | | UpdatePageData(); // è°ç¨åé¡µæ´æ°å½æ° |
| | | } |
| | | |
| | | void CAlarmDlg::OnBnClickedButtonExport() |
| | | void CPageAlarm::OnBnClickedButtonExport() |
| | | { |
| | | CFileDialog fileDialog(FALSE, "csv", "", OFN_HIDEREADONLY, "csv.files(*.csv)|*.csv||"); |
| | | if (fileDialog.DoModal() != IDOK) { |
| | |
| | | file.Close(); |
| | | } |
| | | |
| | | void CAlarmDlg::OnBnClickedButtonPrevPage() |
| | | void CPageAlarm::OnBnClickedButtonPrevPage() |
| | | { |
| | | // ç¹å»ä¸ä¸é¡µ |
| | | m_nCurPage--; |
| | | UpdatePageData(); // è°ç¨åé¡µæ´æ°å½æ° |
| | | } |
| | | |
| | | void CAlarmDlg::OnBnClickedButtonNextPage() |
| | | void CPageAlarm::OnBnClickedButtonNextPage() |
| | | { |
| | | // ç¹å»ä¸ä¸é¡µ |
| | | m_nCurPage++; |
| ÎļþÃû´Ó SourceCode/Bond/Servo/AlarmDlg.h ÐÞ¸Ä |
| | |
| | | |
| | | #define ID_MSG_ALARMDLG_HIDE WM_USER + 1024 |
| | | |
| | | // CAlarmDlg å¯¹è¯æ¡ |
| | | // CPageAlarm å¯¹è¯æ¡ |
| | | |
| | | class CAlarmDlg : public CDialogEx |
| | | class CPageAlarm : public CDialogEx |
| | | { |
| | | DECLARE_DYNAMIC(CAlarmDlg) |
| | | DECLARE_DYNAMIC(CPageAlarm) |
| | | |
| | | public: |
| | | CAlarmDlg(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CAlarmDlg(); |
| | | CPageAlarm(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CPageAlarm(); |
| | | |
| | | private: |
| | | void InitRxWindow(); |
| ÎļþÃû´Ó SourceCode/Bond/Servo/LogDlg.cpp ÐÞ¸Ä |
| | |
| | | |
| | | #include "stdafx.h" |
| | | #include "Servo.h" |
| | | #include "LogDlg.h" |
| | | #include "PageLog.h" |
| | | #include "afxdialogex.h" |
| | | #include "Common.h" |
| | | #include <regex> |
| | | |
| | | |
| | | // CLogDlg å¯¹è¯æ¡ |
| | | // CPageLog å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CLogDlg, CDialogEx) |
| | | IMPLEMENT_DYNAMIC(CPageLog, CDialogEx) |
| | | |
| | | CLogDlg::CLogDlg(CWnd* pParent /*=NULL*/) |
| | | CPageLog::CPageLog(CWnd* pParent /*=NULL*/) |
| | | : CDialogEx(IDD_DIALOG_LOG, pParent) |
| | | { |
| | | m_crBkgnd = LOGDLG_BACKGROUND_COLOR; |
| | |
| | | m_bIncludeRegex = FALSE; |
| | | } |
| | | |
| | | CLogDlg::~CLogDlg() |
| | | CPageLog::~CPageLog() |
| | | { |
| | | } |
| | | |
| | | void CLogDlg::DoDataExchange(CDataExchange* pDX) |
| | | void CPageLog::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | DDX_Control(pDX, IDC_BUTTON_LEVEL, m_btnLevel); |
| | |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CLogDlg, CDialogEx) |
| | | BEGIN_MESSAGE_MAP(CPageLog, CDialogEx) |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_SIZE() |
| | | ON_WM_DESTROY() |
| | | ON_WM_CLOSE() |
| | | ON_NOTIFY(BLBUTTON_MENU_ITEM_CLICKED, IDC_BUTTON_LEVEL, &CLogDlg::OnButtonLevelMenuClicked) |
| | | ON_NOTIFY(BLBUTTON_MENU_ITEM_CLICKED, IDC_BUTTON_INCLUDE, &CLogDlg::OnButtonIncludeMenuClicked) |
| | | ON_EN_CHANGE(IDC_EDIT_INCLUDE, &CLogDlg::OnEnChangeEditInclude) |
| | | ON_BN_CLICKED(IDC_CHECK_REGEX, &CLogDlg::OnBnClickedCheckRegex) |
| | | ON_NOTIFY(BLBUTTON_MENU_ITEM_CLICKED, IDC_BUTTON_LEVEL, &CPageLog::OnButtonLevelMenuClicked) |
| | | ON_NOTIFY(BLBUTTON_MENU_ITEM_CLICKED, IDC_BUTTON_INCLUDE, &CPageLog::OnButtonIncludeMenuClicked) |
| | | ON_EN_CHANGE(IDC_EDIT_INCLUDE, &CPageLog::OnEnChangeEditInclude) |
| | | ON_BN_CLICKED(IDC_CHECK_REGEX, &CPageLog::OnBnClickedCheckRegex) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CLogDlg æ¶æ¯å¤çç¨åº |
| | | |
| | | |
| | | void CLogDlg::InitRxWindow() |
| | | void CPageLog::InitRxWindow() |
| | | { |
| | | /* code */ |
| | | // 订é
æ°æ® |
| | |
| | | } |
| | | } |
| | | |
| | | BOOL CLogDlg::OnInitDialog() |
| | | BOOL CPageLog::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | InitRxWindow(); |
| | | |
| | | |
| | | // ç¼å |
| | |
| | | m_logEdit.SetLimitText(-1); |
| | | |
| | | |
| | | <<<<<<< HEAD:SourceCode/Bond/Servo/LogDlg.cpp |
| | | std::thread([this]() { |
| | | constexpr int nMaxWaitMs = 3000; // æå¤çå¾
3 ç§ |
| | | constexpr int nStepMs = 1; // æ¯æ¬¡çå¾
1ms |
| | |
| | | }).detach(); |
| | | |
| | | |
| | | ======= |
| | | >>>>>>> clh:SourceCode/Bond/Servo/PageLog.cpp |
| | | Resize(); |
| | | |
| | | |
| | |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | void CLogDlg::OnSize(UINT nType, int cx, int cy) |
| | | void CPageLog::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | if (GetDlgItem(IDC_EDIT_LOG) == nullptr) return; |
| | | Resize(); |
| | | } |
| | | |
| | | void CLogDlg::Resize() |
| | | void CPageLog::Resize() |
| | | { |
| | | int x, y, y2, temp; |
| | | CRect rcClient, rcItem; |
| | | CWnd* pItem; |
| | | GetClientRect(&rcClient); |
| | | |
| | | y = 0; |
| | | y = 12; |
| | | x = 8; |
| | | pItem = GetDlgItem(IDC_BUTTON_LEVEL); |
| | | pItem->GetWindowRect(&rcItem); |
| | |
| | | pItem->MoveWindow(x, y2, rcClient.Width() - 16, rcClient.Height() - 5 - y2); |
| | | } |
| | | |
| | | void CLogDlg::OnDestroy() |
| | | void CPageLog::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | HBRUSH CLogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | HBRUSH CPageLog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); |
| | | |
| | |
| | | return m_hbrBkgnd; |
| | | } |
| | | |
| | | void CLogDlg::OnClose() |
| | | void CPageLog::OnClose() |
| | | { |
| | | ShowWindow(SW_HIDE); |
| | | GetParent()->PostMessage(ID_MSG_LOGDLG_HIDE, 0, 0); |
| | | } |
| | | |
| | | BOOL CLogDlg::PreTranslateMessage(MSG* pMsg) |
| | | BOOL CPageLog::PreTranslateMessage(MSG* pMsg) |
| | | { |
| | | if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) { |
| | | return TRUE; |
| | |
| | | return CDialogEx::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | void CLogDlg::AppendLog(int level, const char* pszText) |
| | | void CPageLog::AppendLog(int level, const char* pszText) |
| | | { |
| | | if (!::IsWindow(m_logEdit.m_hWnd)) { |
| | | return; |
| | |
| | | m_logEdit.AppendText(pszText); |
| | | } |
| | | |
| | | void CLogDlg::OnButtonLevelMenuClicked(NMHDR* pNMHDR, LRESULT* pResult) |
| | | void CPageLog::OnButtonLevelMenuClicked(NMHDR* pNMHDR, LRESULT* pResult) |
| | | { |
| | | BLBUTTON_NMHDR* pblbNmhdr = reinterpret_cast<BLBUTTON_NMHDR*>(pNMHDR); |
| | | m_nLevel = (int)pblbNmhdr->dwData; |
| | |
| | | *pResult = 0; |
| | | } |
| | | |
| | | void CLogDlg::OnButtonIncludeMenuClicked(NMHDR* pNMHDR, LRESULT* pResult) |
| | | void CPageLog::OnButtonIncludeMenuClicked(NMHDR* pNMHDR, LRESULT* pResult) |
| | | { |
| | | BLBUTTON_NMHDR* pblbNmhdr = reinterpret_cast<BLBUTTON_NMHDR*>(pNMHDR); |
| | | int position = (int)pblbNmhdr->dwData; |
| | |
| | | *pResult = 0; |
| | | } |
| | | |
| | | void CLogDlg::OnEnChangeEditInclude() |
| | | void CPageLog::OnEnChangeEditInclude() |
| | | { |
| | | GetDlgItemText(IDC_EDIT_INCLUDE, m_strIncludeText); |
| | | theApp.m_model.m_configuration.setLogcatIncludeText(m_strIncludeText); |
| | | } |
| | | |
| | | void CLogDlg::OnBnClickedCheckRegex() |
| | | void CPageLog::OnBnClickedCheckRegex() |
| | | { |
| | | CButton* pCheckBox = (CButton*)GetDlgItem(IDC_CHECK_REGEX); |
| | | m_bIncludeRegex = pCheckBox->GetCheck(); |
| ÎļþÃû´Ó SourceCode/Bond/Servo/LogDlg.h ÐÞ¸Ä |
| | |
| | | |
| | | #define ID_MSG_LOGDLG_HIDE WM_USER + 1023 |
| | | |
| | | // CLogDlg å¯¹è¯æ¡ |
| | | // CPageLog å¯¹è¯æ¡ |
| | | |
| | | class CLogDlg : public CDialogEx |
| | | class CPageLog : public CDialogEx |
| | | { |
| | | DECLARE_DYNAMIC(CLogDlg) |
| | | DECLARE_DYNAMIC(CPageLog) |
| | | |
| | | public: |
| | | CLogDlg(CWnd* pParent = NULL); // æ åæé 彿° |
| | | virtual ~CLogDlg(); |
| | | CPageLog(CWnd* pParent = NULL); // æ åæé 彿° |
| | | virtual ~CPageLog(); |
| | | |
| | | |
| | | private: |
| | |
| | | #include "Common.h" |
| | | #include <iomanip> |
| | | |
| | | <<<<<<< HEAD |
| | | //#define PAGE_SIZE 100 |
| | | //#define PAGE_BACKGROUND_COLOR RGB(252, 252, 255) |
| | | // |
| | | //// CProductionLogDlg å¯¹è¯æ¡ |
| | | // |
| | | ======= |
| | | #define PAGE_SIZE 100 |
| | | #define PAGE_BACKGROUND_COLOR RGB(252, 252, 255) |
| | | |
| | | // CProductionLogDlg å¯¹è¯æ¡ |
| | | |
| | | >>>>>>> clh |
| | | //IMPLEMENT_DYNAMIC(CProductionLogDlg, CDialogEx) |
| | | // |
| | | //CProductionLogDlg::CProductionLogDlg(CWnd* pParent /*=nullptr*/) |
| | |
| | | // m_szTimeStart[0] = '\0'; |
| | | // m_szTimeEnd[0] = '\0'; |
| | | //} |
| | | <<<<<<< HEAD |
| | | // |
| | | ======= |
| | | |
| | | >>>>>>> clh |
| | | //CProductionLogDlg::~CProductionLogDlg() |
| | | //{ |
| | | //} |
| | |
| | | // theApp.m_model.getObservable()->observeOn(pRxWindows->mainThread())->subscribe(m_pObserver); |
| | | // } |
| | | //} |
| | | <<<<<<< HEAD |
| | | // |
| | | //void CProductionLogDlg::Resize() |
| | | //{ |
| | |
| | | // // ç¹å»ä¸ä¸é¡µ |
| | | // m_nCurPage++; |
| | | // UpdatePageData(); // è°ç¨åé¡µæ´æ°å½æ° |
| | | //} |
| | | //} |
| | | ======= |
| | | |
| | | /* |
| | | void CProductionLogDlg::Resize() |
| | | { |
| | | CRect rcClient; |
| | | GetClientRect(&rcClient); |
| | | |
| | | m_listCtrl.MoveWindow(12, 58, rcClient.Width() - 24, rcClient.Height() - 64); |
| | | } |
| | | |
| | | void CProductionLogDlg::UpdatePageData() |
| | | { |
| | | // æ ¹æ®è¿æ»¤æ¡ä»¶å è½½æ°æ®ï¼æ¯æåé¡µãæ¨¡ç³æ¥è¯¢ãæ¶é´èå´ï¼ |
| | | auto vecData = ProductionLogManager::getInstance().getFilteredSteps( |
| | | m_strProductId, // 产åID |
| | | m_strBatchNo, // æ¹æ¬¡å· |
| | | m_strDeviceId, // 设å¤ID |
| | | m_strOperatorName, // æä½å |
| | | m_strStatus, // ç¶æ |
| | | m_szTimeStart, // èµ·å§æ¶é´ |
| | | m_szTimeEnd, // ç»ææ¶é´ |
| | | m_nCurPage, // å½å页ç |
| | | PAGE_SIZE // æ¯é¡µæ¡æ° |
| | | ); |
| | | |
| | | // å¡«å
æ°æ®å°å表æ§ä»¶ |
| | | FillDataToListCtrl(&m_listCtrl, vecData); |
| | | |
| | | // æ´æ°å页æ§ä»¶ |
| | | UpdatePageControls(); |
| | | } |
| | | |
| | | void CProductionLogDlg::UpdatePageControls() |
| | | { |
| | | // æ´æ°åé¡µä¿¡æ¯ |
| | | CString strPage; |
| | | strPage.Format(_T("第 %d 页"), m_nCurPage); |
| | | SetDlgItemText(IDC_LABEL_PAGE_NUMBER, strPage); |
| | | |
| | | // å¯ç¨/ç¦ç¨ç¿»é¡µæé® |
| | | GetDlgItem(IDC_BUTTON_PREV_PAGE)->EnableWindow(m_nCurPage > 1); |
| | | GetDlgItem(IDC_BUTTON_NEXT_PAGE)->EnableWindow(m_nCurPage < m_nTotalPages); |
| | | } |
| | | |
| | | void CProductionLogDlg::FillDataToListCtrl(CListCtrl* pListCtrl, const std::vector<ProductionStep>& vecSteps) |
| | | { |
| | | if (pListCtrl == nullptr || pListCtrl->m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | // æ¸
空å½åCListCtrlä¸çææé¡¹ |
| | | pListCtrl->DeleteAllItems(); |
| | | |
| | | // éåæ°æ®å¹¶æå
¥å°CListCtrlä¸ |
| | | for (const auto& step : vecSteps) { |
| | | InsertStepData(pListCtrl, step); |
| | | } |
| | | |
| | | // è·ååæ° |
| | | int nColCount = pListCtrl->GetHeaderCtrl()->GetItemCount(); |
| | | pListCtrl->SetColumnWidth(nColCount - 1, LVSCW_AUTOSIZE_USEHEADER); |
| | | } |
| | | |
| | | void CProductionLogDlg::InsertStepData(CListCtrl* pListCtrl, const ProductionStep& step) |
| | | { |
| | | if (pListCtrl == nullptr || pListCtrl->m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | int nRowCount = pListCtrl->GetItemCount(); |
| | | if (nRowCount >= PAGE_SIZE) { |
| | | pListCtrl->DeleteItem(nRowCount - 1); |
| | | } |
| | | |
| | | CString str; |
| | | int nNewItem = pListCtrl->InsertItem(0, _T("")); |
| | | str.Format(_T("%d"), step.nStepId); pListCtrl->SetItemText(nNewItem, 1, str); |
| | | pListCtrl->SetItemText(nNewItem, 2, step.strProductId.c_str()); |
| | | pListCtrl->SetItemText(nNewItem, 3, step.strBatchNo.c_str()); |
| | | str.Format(_T("%d"), step.nDeviceId); pListCtrl->SetItemText(nNewItem, 4, str); |
| | | pListCtrl->SetItemText(nNewItem, 5, step.strOperator.c_str()); |
| | | pListCtrl->SetItemText(nNewItem, 6, step.strStartTime.c_str()); |
| | | pListCtrl->SetItemText(nNewItem, 7, step.strEndTime.c_str()); |
| | | str.Format(_T("%d"), step.nYield); pListCtrl->SetItemText(nNewItem, 8, str); |
| | | str.Format(_T("%d"), step.nGoodCount); pListCtrl->SetItemText(nNewItem, 9, str); |
| | | str.Format(_T("%d"), step.nBadCount); pListCtrl->SetItemText(nNewItem, 10, str); |
| | | pListCtrl->SetItemText(nNewItem, 11, step.strStatus.c_str()); |
| | | } |
| | | |
| | | std::string CProductionLogDlg::getCurrentTimeString() |
| | | { |
| | | auto now = std::chrono::system_clock::now(); |
| | | auto time_t_now = std::chrono::system_clock::to_time_t(now); |
| | | |
| | | std::tm tm_now = {}; |
| | | localtime_s(&tm_now, &time_t_now); |
| | | |
| | | std::stringstream ss; |
| | | ss << std::put_time(&tm_now, "%Y-%m-%d %H:%M:%S"); |
| | | return ss.str(); |
| | | } |
| | | |
| | | void CProductionLogDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_START, m_dateTimeStart); |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_END, m_dateTimeEnd); |
| | | DDX_Control(pDX, IDC_LIST_PRODUCTION_LOG, m_listCtrl); |
| | | CDialogEx::DoDataExchange(pDX); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CProductionLogDlg, CDialogEx) |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_DESTROY() |
| | | ON_WM_CLOSE() |
| | | ON_WM_SIZE() |
| | | ON_CBN_SELCHANGE(IDC_COMBO_DATETIME, &CProductionLogDlg::OnCbnSelchangeComboDatetime) |
| | | ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CProductionLogDlg::OnBnClickedButtonSearch) |
| | | ON_BN_CLICKED(IDC_BUTTON_EXPORT, &CProductionLogDlg::OnBnClickedButtonExport) |
| | | ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CProductionLogDlg::OnBnClickedButtonPrevPage) |
| | | ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CProductionLogDlg::OnBnClickedButtonNextPage) |
| | | END_MESSAGE_MAP() |
| | | |
| | | // CProductionLogDlg æ¶æ¯å¤çç¨åº |
| | | BOOL CProductionLogDlg::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | InitRxWindow(); |
| | | |
| | | // åå§åæ¶é´èå´éæ© |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | pComboBox->AddString(_T("ä¸é")); |
| | | pComboBox->AddString(_T("ä»å¤©")); |
| | | pComboBox->AddString(_T("ä¸å¤©å
")); |
| | | pComboBox->AddString(_T("æ¬æ")); |
| | | pComboBox->AddString(_T("ä»å¹´")); |
| | | pComboBox->AddString(_T("èªå®ä¹")); |
| | | pComboBox->SetCurSel(0); |
| | | |
| | | m_dateTimeStart.EnableWindow(FALSE); |
| | | m_dateTimeEnd.EnableWindow(FALSE); |
| | | |
| | | // 读åå宽é
ç½® |
| | | CString strIniFile, strItem; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPCTSTR)theApp.m_strAppDir); |
| | | int width[12] = { 0, 60, 100, 100, 70, 100, 140, 140, 60, 60, 60, 80 }; |
| | | for (int i = 0; i < 12; ++i) { |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | width[i] = GetPrivateProfileInt("ProductionListCtrl", strItem, width[i], strIniFile); |
| | | } |
| | | |
| | | // åå§åå表æ§ä»¶ |
| | | CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST_PRODUCTION_LOG); |
| | | DWORD dwStyle = pListCtrl->GetExtendedStyle(); |
| | | dwStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES; |
| | | pListCtrl->SetExtendedStyle(dwStyle); |
| | | |
| | | HIMAGELIST imageList = ImageList_Create(24, 24, ILC_COLOR24, 1, 1); |
| | | ListView_SetImageList(pListCtrl->GetSafeHwnd(), imageList, LVSIL_SMALL); |
| | | |
| | | pListCtrl->InsertColumn(0, _T(""), LVCFMT_RIGHT, width[0]); |
| | | pListCtrl->InsertColumn(1, _T("æ¥éª¤ID"), LVCFMT_LEFT, width[1]); |
| | | pListCtrl->InsertColumn(2, _T("产åID"), LVCFMT_LEFT, width[2]); |
| | | pListCtrl->InsertColumn(3, _T("æ¹æ¬¡å·"), LVCFMT_LEFT, width[3]); |
| | | pListCtrl->InsertColumn(4, _T("设å¤ID"), LVCFMT_LEFT, width[4]); |
| | | pListCtrl->InsertColumn(5, _T("æä½å"), LVCFMT_LEFT, width[5]); |
| | | pListCtrl->InsertColumn(6, _T("å¼å§æ¶é´"), LVCFMT_LEFT, width[6]); |
| | | pListCtrl->InsertColumn(7, _T("ç»ææ¶é´"), LVCFMT_LEFT, width[7]); |
| | | pListCtrl->InsertColumn(8, _T("产é"), LVCFMT_LEFT, width[8]); |
| | | pListCtrl->InsertColumn(9, _T("è¯åæ°"), LVCFMT_LEFT, width[9]); |
| | | pListCtrl->InsertColumn(10, _T("ä¸è¯åæ°"), LVCFMT_LEFT, width[10]); |
| | | pListCtrl->InsertColumn(11, _T("ç¶æ"), LVCFMT_LEFT, width[11]); |
| | | |
| | | // åå§ååé¡µæ°æ® |
| | | int totalRecords = ProductionLogManager::getInstance().getTotalStepCount( |
| | | m_strProductId, m_strBatchNo, m_strDeviceId, m_strOperatorName, |
| | | m_strStatus, m_szTimeStart, m_szTimeEnd); |
| | | m_nTotalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE; |
| | | m_nCurPage = 1; |
| | | |
| | | Resize(); |
| | | UpdatePageData(); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | HBRUSH CProductionLogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); |
| | | |
| | | if (nCtlColor == CTLCOLOR_STATIC) { |
| | | pDC->SetBkColor(m_crBkgnd); |
| | | } |
| | | |
| | | if (m_hbrBkgnd == nullptr) { |
| | | m_hbrBkgnd = CreateSolidBrush(m_crBkgnd); |
| | | } |
| | | |
| | | return m_hbrBkgnd; |
| | | } |
| | | |
| | | void CProductionLogDlg::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | | // ä¿åå宽 |
| | | CString strIniFile, strItem, strTemp; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPCTSTR)theApp.m_strAppDir); |
| | | CHeaderCtrl* pHeader = m_listCtrl.GetHeaderCtrl(); |
| | | for (int i = 0; i < pHeader->GetItemCount(); ++i) { |
| | | RECT rect; |
| | | pHeader->GetItemRect(i, &rect); |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | strTemp.Format(_T("%d"), rect.right - rect.left); |
| | | WritePrivateProfileString("ProductionListCtrl", strItem, strTemp, strIniFile); |
| | | } |
| | | |
| | | if (m_hbrBkgnd != nullptr) { |
| | | ::DeleteObject(m_hbrBkgnd); |
| | | } |
| | | |
| | | if (m_pObserver != NULL) { |
| | | m_pObserver->unsubscribe(); |
| | | m_pObserver = NULL; |
| | | } |
| | | } |
| | | |
| | | void CProductionLogDlg::OnClose() |
| | | { |
| | | ShowWindow(SW_HIDE); |
| | | //GetParent()->PostMessage(ID_MSG_ALARMDLG_HIDE, 0, 0); |
| | | CDialogEx::OnClose(); |
| | | } |
| | | |
| | | void CProductionLogDlg::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | if (GetDlgItem(IDC_LIST_PRODUCTION_LOG) == nullptr) return; |
| | | Resize(); |
| | | } |
| | | |
| | | void CProductionLogDlg::OnCbnSelchangeComboDatetime() |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | int nIndex = pComboBox->GetCurSel(); |
| | | int nCount = pComboBox->GetCount(); |
| | | m_dateTimeStart.EnableWindow(nIndex == nCount - 1); |
| | | m_dateTimeEnd.EnableWindow(nIndex == nCount - 1); |
| | | } |
| | | |
| | | void CProductionLogDlg::OnBnClickedButtonSearch() |
| | | { |
| | | // è·åå
³é®å |
| | | CString cstrKeyword; |
| | | GetDlgItemText(IDC_EDIT_KEYWORD, cstrKeyword); |
| | | m_strKeyword = CT2A(cstrKeyword); |
| | | |
| | | // è·åæ¥æ |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | m_nDateTimeFlag = pComboBox->GetCurSel(); |
| | | if (m_nDateTimeFlag == 0) { |
| | | memset(m_szTimeStart, 0, sizeof(m_szTimeStart)); |
| | | memset(m_szTimeEnd, 0, sizeof(m_szTimeEnd)); |
| | | m_szTimeStart[0] = '\0'; |
| | | m_szTimeEnd[0] = '\0'; |
| | | } |
| | | else { |
| | | CTime time = CTime::GetCurrentTime(); |
| | | if (m_nDateTimeFlag == 1) { |
| | | // ä»å¤© |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d 00:00:00", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | } |
| | | else if (m_nDateTimeFlag == 2) { |
| | | // 7天å
|
| | | CTime time2 = time - CTimeSpan(7, 0, 0, 0); |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d 00:00:00", time2.GetYear(), time2.GetMonth(), time2.GetDay()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | } |
| | | else if (m_nDateTimeFlag == 3) { |
| | | // æ¬æ |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-01 00:00:00", time.GetYear(), time.GetMonth()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | } |
| | | else if (m_nDateTimeFlag == 4) { |
| | | // ä»å¹´ |
| | | sprintf_s(m_szTimeStart, 64, "%d-01-01 00:00:00", time.GetYear()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-12-31 23:59:59", time.GetYear()); |
| | | } |
| | | else if (m_nDateTimeFlag == 5) { |
| | | // èªå®ä¹ |
| | | SYSTEMTIME t1, t2; |
| | | m_dateTimeStart.GetTime(&t1); |
| | | m_dateTimeEnd.GetTime(&t2); |
| | | |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d %02d:%02d:%02d", |
| | | t1.wYear, t1.wMonth, t1.wDay, t1.wHour, t1.wMinute, t1.wSecond); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d %02d:%02d:%02d", |
| | | t2.wYear, t2.wMonth, t2.wDay, t2.wHour, t2.wMinute, t2.wSecond); |
| | | } |
| | | } |
| | | |
| | | // è®¡ç®æ»é¡µæ° |
| | | int totalRecords = ProductionLogManager::getInstance().getTotalStepCount( |
| | | m_strProductId, m_strBatchNo, m_strDeviceId, m_strOperatorName, |
| | | m_strStatus, m_szTimeStart, m_szTimeEnd); |
| | | m_nTotalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE; |
| | | m_nCurPage = 1; |
| | | |
| | | UpdatePageData(); // è°ç¨åé¡µæ´æ°å½æ° |
| | | } |
| | | |
| | | void CProductionLogDlg::OnBnClickedButtonExport() |
| | | { |
| | | CFileDialog fileDialog(FALSE, "csv", "", OFN_HIDEREADONLY, "CSV Files (*.csv)|*.csv||"); |
| | | if (fileDialog.DoModal() != IDOK) { |
| | | return; |
| | | } |
| | | |
| | | CStdioFile file; |
| | | if (!file.Open(fileDialog.GetPathName(), CFile::modeCreate | CFile::modeWrite | CFile::typeText)) { |
| | | CString err; |
| | | err.Format(_T("æ æ³å建æä»¶: %s"), fileDialog.GetPathName()); |
| | | AfxMessageBox(err); |
| | | return; |
| | | } |
| | | |
| | | const int MAX_COLS = 32; |
| | | char szItem[256] = { 0 }; |
| | | HDITEM hdItem[MAX_COLS]; |
| | | |
| | | for (int i = 0; i < MAX_COLS; i++) { |
| | | hdItem[i].pszText = szItem; |
| | | hdItem[i].cchTextMax = 256; |
| | | hdItem[i].mask = HDI_TEXT | HDI_WIDTH; |
| | | } |
| | | |
| | | // è·ååæ° |
| | | CHeaderCtrl* pHeader = m_listCtrl.GetHeaderCtrl(); |
| | | int nSubItemCount = min(pHeader->GetItemCount(), MAX_COLS); |
| | | |
| | | // 表头 |
| | | CString strHeader; |
| | | for (int i = 0; i < nSubItemCount; i++) { |
| | | pHeader->GetItem(i, &hdItem[i]); |
| | | if (hdItem[i].cxy > 0) { |
| | | if (!strHeader.IsEmpty()) strHeader += ","; |
| | | strHeader += CString(hdItem[i].pszText); |
| | | } |
| | | } |
| | | strHeader += "\n"; |
| | | file.WriteString(strHeader); |
| | | |
| | | // è¡¨æ ¼å
容 |
| | | int nItemCount = m_listCtrl.GetItemCount(); |
| | | for (int i = 0; i < nItemCount; i++) { |
| | | CStringArray arrRow; |
| | | for (int j = 0; j < nSubItemCount; j++) { |
| | | if (hdItem[j].cxy > 0) { |
| | | CString strText = m_listCtrl.GetItemText(i, j); |
| | | strText.Replace(_T("* "), _T("")); |
| | | // 妿忮µä¸å«éå·ï¼å
裹åå¼å· |
| | | if (strText.Find(',') != -1) { |
| | | strText = _T("\"") + strText + _T("\""); |
| | | } |
| | | arrRow.Add(strText); |
| | | } |
| | | } |
| | | |
| | | CString strRow; |
| | | for (int k = 0; k < arrRow.GetCount(); ++k) { |
| | | if (k > 0) strRow += ","; |
| | | strRow += arrRow[k]; |
| | | } |
| | | strRow += "\n"; |
| | | file.WriteString(strRow); |
| | | } |
| | | |
| | | file.Close(); |
| | | } |
| | | |
| | | void CProductionLogDlg::OnBnClickedButtonPrevPage() |
| | | { |
| | | // ç¹å»ä¸ä¸é¡µ |
| | | m_nCurPage--; |
| | | UpdatePageData(); // è°ç¨åé¡µæ´æ°å½æ° |
| | | } |
| | | |
| | | void CProductionLogDlg::OnBnClickedButtonNextPage() |
| | | { |
| | | // ç¹å»ä¸ä¸é¡µ |
| | | m_nCurPage++; |
| | | UpdatePageData(); // è°ç¨åé¡µæ´æ°å½æ° |
| | | } |
| | | */ |
| | | >>>>>>> clh |
| | |
| | | |
| | | |
| | | // CProductionLogDlg å¯¹è¯æ¡ |
| | | <<<<<<< HEAD |
| | | |
| | | //class CProductionLogDlg : public CDialogEx |
| | | //{ |
| | |
| | | // afx_msg void OnBnClickedButtonNextPage(); |
| | | // DECLARE_MESSAGE_MAP() |
| | | //}; |
| | | ======= |
| | | /* |
| | | class CProductionLogDlg : public CDialogEx |
| | | { |
| | | DECLARE_DYNAMIC(CProductionLogDlg) |
| | | |
| | | public: |
| | | CProductionLogDlg(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CProductionLogDlg(); |
| | | |
| | | private: |
| | | void InitRxWindow(); |
| | | void Resize(); |
| | | void UpdatePageData(); |
| | | void UpdatePageControls(); |
| | | void FillDataToListCtrl(CListCtrl* pListCtrl, const std::vector<ProductionStep>& vecSteps); |
| | | void InsertStepData(CListCtrl* pListCtrl, const ProductionStep& step); |
| | | std::string getCurrentTimeString(); |
| | | |
| | | private: |
| | | COLORREF m_crBkgnd; |
| | | HBRUSH m_hbrBkgnd; |
| | | IObserver* m_pObserver; |
| | | |
| | | // æç´¢å
³é®å |
| | | std::string m_strKeyword; |
| | | std::string m_strProductId; |
| | | std::string m_strBatchNo; |
| | | std::string m_strDeviceId; |
| | | std::string m_strOperatorName; |
| | | std::string m_strStatus; |
| | | |
| | | // 页ç |
| | | int m_nCurPage; |
| | | int m_nTotalPages; |
| | | |
| | | // æ¥æ |
| | | int m_nDateTimeFlag; |
| | | char m_szTimeStart[64]; |
| | | char m_szTimeEnd[64]; |
| | | |
| | | // æ§ä»¶ |
| | | CDateTimeCtrl m_dateTimeStart; |
| | | CDateTimeCtrl m_dateTimeEnd; |
| | | CListCtrlEx m_listCtrl; |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_DIALOG_PRODUCTION_LOG }; |
| | | #endif |
| | | |
| | | protected: |
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV æ¯æ |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); |
| | | afx_msg void OnDestroy(); |
| | | afx_msg void OnClose(); |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnCbnSelchangeComboDatetime(); |
| | | afx_msg void OnBnClickedButtonSearch(); |
| | | afx_msg void OnBnClickedButtonExport(); |
| | | afx_msg void OnBnClickedButtonPrevPage(); |
| | | afx_msg void OnBnClickedButtonNextPage(); |
| | | DECLARE_MESSAGE_MAP() |
| | | }; |
| | | */ |
| | | >>>>>>> clh |
| | |
| | | |
| | | |
| | | // åå§åç产履å管çå¨ |
| | | //try { |
| | | // if (!ProductionLogManager::getInstance().initProductionTable()) { |
| | | // AfxMessageBox("åå§åç产履å管çå¨å¤±è´¥ï¼"); |
| | | // return FALSE; |
| | | // } |
| | | //} |
| | | //catch (const std::exception& ex) { |
| | | // CString errorMsg; |
| | | // errorMsg.Format(_T("åå§åç产履å管çå¨å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | // AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | // return FALSE; |
| | | //} |
| | | try { |
| | | if (!ProductionLogManager::getInstance().initProductionTable()) { |
| | | AfxMessageBox("åå§åç产履å管çå¨å¤±è´¥ï¼"); |
| | | return FALSE; |
| | | } |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("åå§åç产履å管çå¨å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | // åå§åSECSè¿è¡è®¾ç½®ç®¡çåº |
| | |
| | | <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| | | </ResourceCompile> |
| | | <PostBuildEvent> |
| | | <Command>if exist "\\DESKTOP-IODBVIQ\Servo\Debug\" ( |
| | | xcopy /Y /D "$(OutDir)*.exe" "\\DESKTOP-IODBVIQ\Servo\Debug\" |
| | | xcopy /Y /D "$(OutDir)*.pdb" "\\DESKTOP-IODBVIQ\Servo\Debug\" |
| | | )</Command> |
| | | <Command>copy "$(TargetDir)$(ProjectName).exe" "\\DESKTOP-IODBVIQ\Servo\Debug\$(ProjectName).exe"</Command> |
| | | </PostBuildEvent> |
| | | </ItemDefinitionGroup> |
| | | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
| | |
| | | <Text Include="ReadMe.txt" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClInclude Include="AlarmDlg.h" /> |
| | | <ClInclude Include="PageAlarm.h" /> |
| | | <ClInclude Include="AlarmManager.h" /> |
| | | <ClInclude Include="ApredTreeCtrl2.h" /> |
| | | <ClInclude Include="BlButton.h" /> |
| | | <ClInclude Include="CAligner.h" /> |
| | | <ClInclude Include="CArm.h" /> |
| | | <ClInclude Include="CArmTray.h" /> |
| | | <ClInclude Include="CAttribute.h" /> |
| | | <ClInclude Include="CAttributeVector.h" /> |
| | | <ClInclude Include="CBakeCooling.h" /> |
| | |
| | | <ClInclude Include="Intent.h" /> |
| | | <ClInclude Include="ListCtrlEx.h" /> |
| | | <ClInclude Include="Log.h" /> |
| | | <ClInclude Include="LogDlg.h" /> |
| | | <ClInclude Include="PageLog.h" /> |
| | | <ClInclude Include="LogEdit.h" /> |
| | | <ClInclude Include="MapPosWnd.h" /> |
| | | <ClInclude Include="Model.h" /> |
| | |
| | | <ClInclude Include="VerticalLine.h" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClCompile Include="AlarmDlg.cpp" /> |
| | | <ClCompile Include="PageAlarm.cpp" /> |
| | | <ClCompile Include="AlarmManager.cpp" /> |
| | | <ClCompile Include="ApredTreeCtrl2.cpp" /> |
| | | <ClCompile Include="BlButton.cpp" /> |
| | | <ClCompile Include="CAligner.cpp" /> |
| | | <ClCompile Include="CArm.cpp" /> |
| | | <ClCompile Include="CArmTray.cpp" /> |
| | | <ClCompile Include="CAttribute.cpp" /> |
| | | <ClCompile Include="CAttributeVector.cpp" /> |
| | | <ClCompile Include="CBakeCooling.cpp" /> |
| | |
| | | <ClCompile Include="Intent.cpp" /> |
| | | <ClCompile Include="ListCtrlEx.cpp" /> |
| | | <ClCompile Include="Log.cpp" /> |
| | | <ClCompile Include="LogDlg.cpp" /> |
| | | <ClCompile Include="PageLog.cpp" /> |
| | | <ClCompile Include="LogEdit.cpp" /> |
| | | <ClCompile Include="MapPosWnd.cpp" /> |
| | | <ClCompile Include="Model.cpp" /> |
| | |
| | | <ClCompile Include="HsmsAction.cpp" /> |
| | | <ClCompile Include="HsmsPassive.cpp" /> |
| | | <ClCompile Include="Log.cpp" /> |
| | | <ClCompile Include="LogDlg.cpp" /> |
| | | <ClCompile Include="PageLog.cpp" /> |
| | | <ClCompile Include="LogEdit.cpp" /> |
| | | <ClCompile Include="Model.cpp" /> |
| | | <ClCompile Include="SecsTestDlg.cpp" /> |
| | |
| | | <ClCompile Include="CEqModeStep.cpp" /> |
| | | <ClCompile Include="CEqStatusStep.cpp" /> |
| | | <ClCompile Include="CEqAlarmStep.cpp" /> |
| | | <ClCompile Include="AlarmDlg.cpp" /> |
| | | <ClCompile Include="PageAlarm.cpp" /> |
| | | <ClCompile Include="CEqProcessStep.cpp" /> |
| | | <ClCompile Include="CAttribute.cpp" /> |
| | | <ClCompile Include="CAttributeVector.cpp" /> |
| | |
| | | <ClCompile Include="CEqReadStep.cpp" /> |
| | | <ClCompile Include="CRecipesManager.cpp" /> |
| | | <ClCompile Include="CRecipeList.cpp" /> |
| | | <ClCompile Include="CArm.cpp" /> |
| | | <ClCompile Include="CArmTray.cpp" /> |
| | | <ClCompile Include="ProductionLogDlg.cpp" /> |
| | | <ClCompile Include="ProductionLogManager.cpp" /> |
| | | </ItemGroup> |
| | |
| | | <ClInclude Include="HsmsAction.h" /> |
| | | <ClInclude Include="HsmsPassive.h" /> |
| | | <ClInclude Include="Log.h" /> |
| | | <ClInclude Include="LogDlg.h" /> |
| | | <ClInclude Include="PageLog.h" /> |
| | | <ClInclude Include="LogEdit.h" /> |
| | | <ClInclude Include="Model.h" /> |
| | | <ClInclude Include="Resource.h" /> |
| | |
| | | <ClInclude Include="CEqModeStep.h" /> |
| | | <ClInclude Include="CEqStatusStep.h" /> |
| | | <ClInclude Include="CEqAlarmStep.h" /> |
| | | <ClInclude Include="AlarmDlg.h" /> |
| | | <ClInclude Include="PageAlarm.h" /> |
| | | <ClInclude Include="CEqProcessStep.h" /> |
| | | <ClInclude Include="CAttribute.h" /> |
| | | <ClInclude Include="CAttributeVector.h" /> |
| | |
| | | <ClInclude Include="CEqReadStep.h" /> |
| | | <ClInclude Include="CRecipesManager.h" /> |
| | | <ClInclude Include="CRecipeList.h" /> |
| | | <ClInclude Include="CArm.h" /> |
| | | <ClInclude Include="CArmTray.h" /> |
| | | <ClInclude Include="ProductionLogDlg.h" /> |
| | | <ClInclude Include="ProductionLogManager.h" /> |
| | | </ItemGroup> |
| | |
| | | <RESOURCE_FILE>Servo.rc</RESOURCE_FILE> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
| | | <RemoteDebuggerCommand>\\DESKTOP-IODBVIQ\Servo\Debug\Servo.exe</RemoteDebuggerCommand> |
| | | <RemoteDebuggerWorkingDirectory>\\DESKTOP-IODBVIQ\Servo\Debug</RemoteDebuggerWorkingDirectory> |
| | | <RemoteDebuggerCommand>D:\Servo\Debug\Servo.exe</RemoteDebuggerCommand> |
| | | <RemoteDebuggerWorkingDirectory>D:\Servo\Debug\</RemoteDebuggerWorkingDirectory> |
| | | <RemoteDebuggerServerName>DESKTOP-IODBVIQ</RemoteDebuggerServerName> |
| | | <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> |
| | | </PropertyGroup> |
| | |
| | | #include "Common.h" |
| | | #include "Log.h" |
| | | #include "SecsTestDlg.h" |
| | | #include "AlarmDlg.h" |
| | | #include <chrono> |
| | | #include <thread> |
| | | #include <cmath> |
| | |
| | | m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); |
| | | m_crBkgnd = APPDLG_BACKGROUND_COLOR; |
| | | m_hbrBkgnd = nullptr; |
| | | //m_bShowLogWnd = FALSE; |
| | | //m_bShowAlarmWnd = FALSE; |
| | | //m_pLogDlg = nullptr; |
| | | //m_pAlarmDlg = nullptr; |
| | | m_pTerminalDisplayDlg = nullptr; |
| | | m_pObserver = nullptr; |
| | | m_pPanelMaster = nullptr; |
| | |
| | | m_pPanelAttributes = nullptr; |
| | | m_pPageGraph1 = nullptr; |
| | | m_pPageGraph2 = nullptr; |
| | | m_pPageGraph3 = nullptr; |
| | | m_pPageGraph4 = nullptr; |
| | | m_pPageAlarm = nullptr; |
| | | m_pPageLog = nullptr; |
| | | } |
| | | |
| | | void CServoDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | //DDX_Control(pDX, IDC_BUTTON_LOG, m_btnLog); |
| | | //DDX_Control(pDX, IDC_BUTTON_ALARM, m_btnAlarm); |
| | | DDX_Control(pDX, IDC_BUTTON_LOG, m_btnLog); |
| | | DDX_Control(pDX, IDC_BUTTON_ALARM, m_btnAlarm); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CServoDlg, CDialogEx) |
| | |
| | | ON_BN_CLICKED(IDCANCEL, &CServoDlg::OnBnClickedCancel) |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_DESTROY() |
| | | //ON_BN_CLICKED(IDC_BUTTON_LOG, &CServoDlg::OnBnClickedButtonLog) |
| | | ON_WM_SIZE() |
| | | ON_WM_CLOSE() |
| | | //ON_MESSAGE(ID_MSG_LOGDLG_HIDE, &CServoDlg::OnLogDlgHide) |
| | | //ON_MESSAGE(ID_MSG_ALARMDLG_HIDE, &CServoDlg::OnAlarmDlgHide) |
| | | ON_WM_MOVING() |
| | | ON_WM_MOVE() |
| | | ON_COMMAND(ID_MENU_FILE_EXIT, &CServoDlg::OnMenuFileExit) |
| | |
| | | ON_UPDATE_COMMAND_UI(ID_MENU_FILE_SETTINGS, &CServoDlg::OnUpdateMenuFileSettings) |
| | | ON_COMMAND(ID_MENU_FILE_SECSTEST, &CServoDlg::OnMenuFileSecsTest) |
| | | ON_UPDATE_COMMAND_UI(ID_MENU_FILE_SECSTEST, &CServoDlg::OnUpdateMenuFileSecsTest) |
| | | //ON_COMMAND(ID_MENU_WND_LOG, &CServoDlg::OnMenuWndLog) |
| | | //ON_UPDATE_COMMAND_UI(ID_MENU_WND_LOG, &CServoDlg::OnUpdateMenuWndLog) |
| | | //ON_COMMAND(ID_MENU_WND_ALARM, &CServoDlg::OnMenuWndAlarm) |
| | | //ON_UPDATE_COMMAND_UI(ID_MENU_WND_ALARM, &CServoDlg::OnUpdateMenuWndAlarm) |
| | | ON_COMMAND(ID_MENU_TEST_MESSAGE_SET, &CServoDlg::OnMenuTestMessageSet) |
| | | ON_UPDATE_COMMAND_UI(ID_MENU_TEST_MESSAGE_SET, &CServoDlg::OnUpdateMenuTestMessageSet) |
| | | ON_COMMAND(ID_MENU_TEST_MESSAGE_CLEAR, &CServoDlg::OnMenuTestMessageClear) |
| | |
| | | ON_COMMAND(ID_MENU_HELP_ABOUT, &CServoDlg::OnMenuHelpAbout) |
| | | ON_WM_INITMENUPOPUP() |
| | | ON_WM_TIMER() |
| | | //ON_BN_CLICKED(IDC_BUTTON_ALARM, &CServoDlg::OnBnClickedButtonAlarm) |
| | | ON_MESSAGE(ID_MSG_PANEL_RESIZE, OnPanelResize) |
| | | ON_NOTIFY(BYHMTAB_SEL_CHANGED, IDC_TAB1, &CServoDlg::OnTabSelChanged) |
| | | END_MESSAGE_MAP() |
| | |
| | | m_pPageGraph1->Create(IDD_PAGE_GRAPH1, this); |
| | | m_pPageGraph2 = new CPageGraph2(); |
| | | m_pPageGraph2->Create(IDD_PAGE_GRAPH2, this); |
| | | m_pPageGraph3 = new CAlarmDlg(); |
| | | m_pPageGraph3->Create(IDD_DIALOG_ALARM, this); |
| | | m_pPageGraph4 = new CLogDlg(); |
| | | m_pPageGraph4->Create(IDD_DIALOG_LOG, this); |
| | | m_pPageAlarm = new CPageAlarm(); |
| | | m_pPageAlarm->Create(IDD_DIALOG_ALARM, this); |
| | | m_pPageLog = new CPageLog(); |
| | | m_pPageLog->Create(IDD_DIALOG_LOG, this); |
| | | |
| | | CHmTab* m_pTab = CHmTab::Hook(GetDlgItem(IDC_TAB1)->m_hWnd); |
| | | m_pTab->SetPaddingLeft(20); |
| | |
| | | |
| | | SetTimer(TIMER_ID_CREATE_TERMINAL, 3000, nullptr); |
| | | InitRxWindows(); |
| | | //OnBnClickedButtonLog(); |
| | | //UpdateLogBtn(); |
| | | //UpdateAlarmBtn(); |
| | | Resize(); |
| | | |
| | | |
| | |
| | | pCmdUI->Enable(TRUE); |
| | | } |
| | | |
| | | //void CServoDlg::OnMenuWndLog() |
| | | //{ |
| | | // OnBnClickedButtonLog(); |
| | | //} |
| | | |
| | | //void CServoDlg::OnUpdateMenuWndLog(CCmdUI* pCmdUI) |
| | | //{ |
| | | // pCmdUI->SetCheck(m_bShowLogWnd); |
| | | //} |
| | | |
| | | //void CServoDlg::OnMenuWndAlarm() |
| | | //{ |
| | | // OnBnClickedButtonAlarm(); |
| | | //} |
| | | |
| | | //void CServoDlg::OnUpdateMenuWndAlarm(CCmdUI* pCmdUI) |
| | | //{ |
| | | // pCmdUI->SetCheck(m_bShowAlarmWnd); |
| | | //} |
| | | |
| | | void CServoDlg::OnMenuFileExit() |
| | | { |
| | | PostMessage(WM_CLOSE); |
| | |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | |
| | | //if (m_pLogDlg != nullptr) { |
| | | // m_pLogDlg->DestroyWindow(); |
| | | // delete m_pLogDlg; |
| | | // m_pLogDlg = nullptr; |
| | | //} |
| | | |
| | | //if (m_pAlarmDlg != nullptr) { |
| | | // m_pAlarmDlg->DestroyWindow(); |
| | | // delete m_pAlarmDlg; |
| | | // m_pAlarmDlg = nullptr; |
| | | //} |
| | | |
| | | if (m_pTerminalDisplayDlg != nullptr) { |
| | | m_pTerminalDisplayDlg->DestroyWindow(); |
| | |
| | | m_pPageGraph2 = nullptr; |
| | | } |
| | | |
| | | if (m_pPageGraph3 != nullptr) { |
| | | m_pPageGraph3->DestroyWindow(); |
| | | delete m_pPageGraph3; |
| | | m_pPageGraph3 = nullptr; |
| | | if (m_pPageAlarm != nullptr) { |
| | | m_pPageAlarm->DestroyWindow(); |
| | | delete m_pPageAlarm; |
| | | m_pPageAlarm = nullptr; |
| | | } |
| | | |
| | | if (m_pPageGraph4 != nullptr) { |
| | | m_pPageGraph4->DestroyWindow(); |
| | | delete m_pPageGraph4; |
| | | m_pPageGraph4 = nullptr; |
| | | if (m_pPageLog != nullptr) { |
| | | m_pPageLog->DestroyWindow(); |
| | | delete m_pPageLog; |
| | | m_pPageLog = nullptr; |
| | | } |
| | | |
| | | if (m_hbrBkgnd != nullptr) { |
| | |
| | | |
| | | } |
| | | |
| | | //void CServoDlg::OnBnClickedButtonAlarm() |
| | | //{ |
| | | // m_bShowAlarmWnd = !m_bShowAlarmWnd; |
| | | // |
| | | // // å¦æè¦æ¾ç¤ºæ¥è¦çªå£ï¼åéèæ¥å¿çªå£ |
| | | // if (m_bShowLogWnd) { |
| | | // m_bShowLogWnd = false; |
| | | // if (m_pLogDlg != nullptr) { |
| | | // m_pLogDlg->ShowWindow(SW_HIDE); |
| | | // UpdateLogBtn(); |
| | | // } |
| | | // } |
| | | // |
| | | // if (m_pAlarmDlg == nullptr) { |
| | | // m_pAlarmDlg = new CAlarmDlg(); |
| | | // m_pAlarmDlg->Create(IDD_DIALOG_ALARM, this); |
| | | // |
| | | // CRect rcWnd; |
| | | // GetWindowRect(&rcWnd); |
| | | // int nHeight = GetSystemMetrics(SM_CYSCREEN) - rcWnd.bottom - 38; |
| | | // if (nHeight < 280) nHeight = 280; |
| | | // m_pAlarmDlg->MoveWindow(rcWnd.left, rcWnd.bottom - 8, rcWnd.Width(), nHeight); |
| | | // } |
| | | // ASSERT(m_pAlarmDlg); |
| | | // m_pAlarmDlg->ShowWindow(m_bShowAlarmWnd ? SW_SHOW : SW_HIDE); |
| | | // |
| | | // UpdateAlarmBtn(); |
| | | //} |
| | | |
| | | //void CServoDlg::OnBnClickedButtonLog() |
| | | //{ |
| | | // m_bShowLogWnd = !m_bShowLogWnd; |
| | | // |
| | | // // å¦æè¦æ¾ç¤ºæ¥å¿çªå£ï¼åéèæ¥è¦çªå£ |
| | | // if (m_bShowLogWnd) { |
| | | // m_bShowAlarmWnd = false; |
| | | // if (m_pAlarmDlg != nullptr) { |
| | | // m_pAlarmDlg->ShowWindow(SW_HIDE); |
| | | // UpdateAlarmBtn(); |
| | | // } |
| | | // } |
| | | // |
| | | // if (m_pLogDlg == nullptr) { |
| | | // m_pLogDlg = new CLogDlg(); |
| | | // m_pLogDlg->Create(IDD_DIALOG_LOG, this); |
| | | // |
| | | // CRect rcWnd; |
| | | // GetWindowRect(&rcWnd); |
| | | // int nHeight = GetSystemMetrics(SM_CYSCREEN) - rcWnd.bottom - 38; |
| | | // if (nHeight < 280) nHeight = 280; |
| | | // m_pLogDlg->MoveWindow(rcWnd.left, rcWnd.bottom - 8, rcWnd.Width(), nHeight); |
| | | // } |
| | | // ASSERT(m_pLogDlg); |
| | | // m_pLogDlg->ShowWindow(m_bShowLogWnd ? SW_SHOW : SW_HIDE); |
| | | // |
| | | // UpdateLogBtn(); |
| | | //} |
| | | |
| | | //void CServoDlg::UpdateLogBtn() |
| | | //{ |
| | | // m_btnLog.SetFrameColor(BS_NORMAL, BTN_LOG_FRAME_NORMAL); |
| | | // m_btnLog.SetFrameColor(BS_HOVER, BTN_LOG_FRAME_HOVER); |
| | | // m_btnLog.SetFrameColor(BS_PRESS, BTN_LOG_FRAME_PRESS); |
| | | // m_btnLog.SetBkgndColor(BS_NORMAL, m_bShowLogWnd ? BTN_LOG_BKGND_PRESS : BTN_LOG_BKGND_NORMAL); |
| | | // m_btnLog.SetBkgndColor(BS_HOVER, BTN_LOG_BKGND_HOVER); |
| | | // m_btnLog.SetBkgndColor(BS_PRESS, BTN_LOG_BKGND_PRESS); |
| | | // m_btnLog.Invalidate(); |
| | | //} |
| | | |
| | | //void CServoDlg::UpdateAlarmBtn() |
| | | //{ |
| | | // m_btnAlarm.SetFrameColor(BS_NORMAL, BTN_ALARM_FRAME_NORMAL); |
| | | // m_btnAlarm.SetFrameColor(BS_HOVER, BTN_ALARM_FRAME_HOVER); |
| | | // m_btnAlarm.SetFrameColor(BS_PRESS, BTN_ALARM_FRAME_PRESS); |
| | | // m_btnAlarm.SetBkgndColor(BS_NORMAL, m_bShowAlarmWnd ? BTN_ALARM_BKGND_PRESS : BTN_ALARM_BKGND_NORMAL); |
| | | // m_btnAlarm.SetBkgndColor(BS_HOVER, BTN_ALARM_BKGND_HOVER); |
| | | // m_btnAlarm.SetBkgndColor(BS_PRESS, BTN_ALARM_BKGND_PRESS); |
| | | // m_btnAlarm.Invalidate(); |
| | | //} |
| | | |
| | | void CServoDlg::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | if (GetDlgItem(IDC_TAB1) == nullptr) return; |
| | | if (m_pPageGraph1 == nullptr) return; |
| | | if (m_pPageGraph2 == nullptr) return; |
| | | if (m_pPageGraph3 == nullptr) return; |
| | | if (m_pPageGraph4 == nullptr) return; |
| | | if (m_pPageAlarm == nullptr) return; |
| | | if (m_pPageLog == nullptr) return; |
| | | |
| | | Resize(); |
| | | Invalidate(); |
| | |
| | | y += rcItem.Height(); |
| | | |
| | | |
| | | m_pPageGraph1->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height()); |
| | | m_pPageGraph2->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height()); |
| | | m_pPageGraph3->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height()); |
| | | m_pPageGraph4->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height()); |
| | | |
| | | |
| | | //x = rcClient.right - 8; |
| | | //pItem = GetDlgItem(IDC_BUTTON_LOG); |
| | | //pItem->GetClientRect(&rcItem); |
| | | //x -= rcItem.Width(); |
| | | //pItem->MoveWindow(x, rcClient.bottom - 8 - rcItem.Height(), rcItem.Width(), rcItem.Height()); |
| | | //x -= 8; |
| | | |
| | | //pItem = GetDlgItem(IDC_BUTTON_ALARM); |
| | | //pItem->GetClientRect(&rcItem); |
| | | //x -= rcItem.Width(); |
| | | //pItem->MoveWindow(x, rcClient.bottom - 8 - rcItem.Height(), rcItem.Width(), rcItem.Height()); |
| | | m_pPageGraph1->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageGraph2->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageAlarm->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | m_pPageLog->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y); |
| | | } |
| | | |
| | | void CServoDlg::OnClose() |
| | |
| | | CDialogEx::OnClose(); |
| | | } |
| | | |
| | | //LRESULT CServoDlg::OnLogDlgHide(WPARAM wParam, LPARAM lParam) |
| | | //{ |
| | | // m_bShowLogWnd = FALSE; |
| | | // UpdateLogBtn(); |
| | | // LOGE("OnLogDlgHide"); |
| | | // |
| | | // unsigned int DATAID, RPTID; |
| | | // DATAID = 111; |
| | | // RPTID = 1001; |
| | | // std::vector<std::string> v; |
| | | // v.push_back("abc"); |
| | | // v.push_back("def"); |
| | | // theApp.m_model.m_hsmsPassive.requestEventReportSend(DATAID, RPTID, v); |
| | | // |
| | | // return 0; |
| | | //} |
| | | |
| | | //LRESULT CServoDlg::OnAlarmDlgHide(WPARAM wParam, LPARAM lParam) |
| | | //{ |
| | | // m_bShowAlarmWnd = FALSE; |
| | | // UpdateAlarmBtn(); |
| | | // LOGE("OnAlarmDlgHide"); |
| | | // |
| | | // return 0; |
| | | //} |
| | | |
| | | void CServoDlg::OnMoving(UINT fwSide, LPRECT pRect) |
| | | { |
| | | CDialogEx::OnMoving(fwSide, pRect); |
| | |
| | | |
| | | void CServoDlg::OnMove(int x, int y) |
| | | { |
| | | //if (m_pLogDlg != nullptr && !m_pLogDlg->IsZoomed()) { |
| | | // CRect rcWnd; |
| | | // GetWindowRect(&rcWnd); |
| | | // m_pLogDlg->SetWindowPos(nullptr, rcWnd.left, rcWnd.bottom - 8, 0, 0, SWP_NOSIZE); |
| | | //} |
| | | |
| | | //if (m_pAlarmDlg != nullptr && !m_pAlarmDlg->IsZoomed()) { |
| | | // CRect rcWnd; |
| | | // GetWindowRect(&rcWnd); |
| | | // m_pAlarmDlg->SetWindowPos(nullptr, rcWnd.left, rcWnd.bottom - 8, 0, 0, SWP_NOSIZE); |
| | | //} |
| | | |
| | | CDialogEx::OnMove(x, y); |
| | | } |
| | |
| | | |
| | | LRESULT CServoDlg::OnPanelResize(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | int width = wParam; |
| | | int width = (int)wParam; |
| | | // m_pPanel->SetPanelWidth(width); |
| | | Resize(); |
| | | |
| | |
| | | void CServoDlg::ShowChildPage(int index) |
| | | { |
| | | ASSERT(0 <= index && index < 4); |
| | | static CWnd* pPages[] = { m_pPageGraph1, m_pPageGraph2, m_pPageGraph3, m_pPageGraph4 }; |
| | | static CWnd* pPages[] = { m_pPageGraph1, m_pPageGraph2, m_pPageAlarm, m_pPageLog }; |
| | | for (int i = 0; i < 4; i++) { |
| | | pPages[i]->ShowWindow(i == index ? SW_SHOW : SW_HIDE); |
| | | } |
| | |
| | | |
| | | #pragma once |
| | | #include "BlButton.h" |
| | | #include "LogDlg.h" |
| | | #include "AlarmDlg.h" |
| | | #include "PageLog.h" |
| | | #include "PageAlarm.h" |
| | | #include "TerminalDisplayDlg.h" |
| | | #include "CPanelMaster.h" |
| | | #include "CPanelEquipment.h" |
| | |
| | | private: |
| | | void InitRxWindows(); |
| | | void Resize(); |
| | | //void UpdateLogBtn(); |
| | | //void UpdateAlarmBtn(); |
| | | void ShowChildPage(int index); |
| | | |
| | | |
| | | private: |
| | | IObserver* m_pObserver; |
| | | //BOOL m_bShowLogWnd; |
| | | //BOOL m_bShowAlarmWnd; |
| | | //CLogDlg* m_pLogDlg; |
| | | //CAlarmDlg* m_pAlarmDlg; |
| | | CTerminalDisplayDlg* m_pTerminalDisplayDlg; |
| | | CPageGraph1* m_pPageGraph1; |
| | | CPageGraph2* m_pPageGraph2; |
| | | CAlarmDlg* m_pPageGraph3; |
| | | CLogDlg* m_pPageGraph4; |
| | | CPageAlarm* m_pPageAlarm; |
| | | CPageLog* m_pPageLog; |
| | | |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | |
| | | HICON m_hIcon; |
| | | COLORREF m_crBkgnd; |
| | | HBRUSH m_hbrBkgnd; |
| | | //CBlButton m_btnLog; |
| | | //CBlButton m_btnAlarm; |
| | | CBlButton m_btnLog; |
| | | CBlButton m_btnAlarm; |
| | | CPanelMaster* m_pPanelMaster; |
| | | CPanelEquipment* m_pPanelEquipment; |
| | | CPanelAttributes* m_pPanelAttributes; |
| | |
| | | afx_msg void OnBnClickedCancel(); |
| | | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); |
| | | afx_msg void OnDestroy(); |
| | | //afx_msg void OnBnClickedButtonLog(); |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnClose(); |
| | | //afx_msg LRESULT OnLogDlgHide(WPARAM wParam, LPARAM lParam); |
| | | //afx_msg LRESULT OnAlarmDlgHide(WPARAM wParam, LPARAM lParam); |
| | | afx_msg void OnMoving(UINT fwSide, LPRECT pRect); |
| | | afx_msg void OnMove(int x, int y); |
| | | afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); |
| | |
| | | afx_msg void OnUpdateMenuFileSettings(CCmdUI* pCmdUI); |
| | | afx_msg void OnMenuFileSecsTest(); |
| | | afx_msg void OnUpdateMenuFileSecsTest(CCmdUI* pCmdUI); |
| | | //afx_msg void OnMenuWndLog(); |
| | | //afx_msg void OnUpdateMenuWndLog(CCmdUI* pCmdUI); |
| | | //afx_msg void OnMenuWndAlarm(); |
| | | //afx_msg void OnUpdateMenuWndAlarm(CCmdUI* pCmdUI); |
| | | afx_msg void OnMenuFileExit(); |
| | | afx_msg void OnUpdateMenuFileExit(CCmdUI* pCmdUI); |
| | | afx_msg void OnMenuTestMessageSet(); |
| | |
| | | afx_msg void OnUpdateMenuTestMessageClear(CCmdUI* pCmdUI); |
| | | afx_msg void OnMenuHelpAbout(); |
| | | afx_msg void OnTimer(UINT_PTR nIDEvent); |
| | | //afx_msg void OnBnClickedButtonAlarm(); |
| | | afx_msg LRESULT OnPanelResize(WPARAM wParam, LPARAM lParam); |
| | | afx_msg void OnTabSelChanged(NMHDR* nmhdr, LRESULT* result); |
| | | }; |