LAPTOP-SNT8I5JK\Boounion
2025-06-27 86074f0cd259814f2c5103e47360b6dd13f064f7
1.Graph刷新问题;
2.AttributeVector造成的闪退问题;
已修改8个文件
64 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CBonder.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageGraph1.cpp 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CStep.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CStep.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoGraph.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoGraph.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CBonder.cpp
@@ -433,6 +433,17 @@
    void CBonder::onTimer(UINT nTimerid)
    {
        CEquipment::onTimer(nTimerid);
        // test
        /*
        static int i[2] = { 0, 0 };
        i[m_nIndex]++;
        if (i[m_nIndex] == 15) {
            char szBuffer[26];
            decodeJobProcessStartReport(getStep(STEP_ID_JOB_PROCESS_START_REPORT), szBuffer, 26);
        }
        */
    }
    void CBonder::serialize(CArchive& ar)
SourceCode/Bond/Servo/CEquipment.cpp
@@ -1409,11 +1409,8 @@
        // 缓存Attribute,用于调试时显示信息
        unsigned int weight = 201;
        CAttributeVector attrubutes;
        CAttributeVector& attrubutes = pStep->attributeVector();
        processData.getAttributeVector(attrubutes, weight);
        pStep->addAttributeVector(attrubutes);
        onProcessData(&processData);
        return nRet;
@@ -1427,11 +1424,8 @@
        // 缓存Attribute,用于调试时显示信息
        unsigned int weight = 201;
        CAttributeVector attrubutes;
        CAttributeVector& attrubutes = pStep->attributeVector();
        jobDataS.getAttributeVector(attrubutes, weight);
        pStep->addAttributeVector(attrubutes);
        onReceivedJob(port, &jobDataS);
        return nRet;
@@ -1451,11 +1445,8 @@
        // 缓存Attribute,用于调试时显示信息
        unsigned int weight = 201;
        CAttributeVector attrubutes;
        CAttributeVector& attrubutes = pStep->attributeVector();
        jobDataS.getAttributeVector(attrubutes, weight);
        pStep->addAttributeVector(attrubutes);
        onSentOutJob(port, &jobDataS);
        return nRet;
@@ -1601,9 +1592,8 @@
        // 缓存Attribute,用于调试时显示信息
        unsigned int weight = 201;
        CAttributeVector attrubutes;
        CAttributeVector& attrubutes = pStep->attributeVector();
        vcrEventReport.getAttributeVector(attrubutes, weight);
        pStep->addAttributeVector(attrubutes);
        // 0426, 先固定返回1(OK)
        ((CReadStep*)pStep)->setReturnCode((short)VCR_Reply_Code::OK);
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -893,10 +893,8 @@
        // 缓存Attribute,用于调试时显示信息
        unsigned int weight = 201;
        CAttributeVector attrubutes;
        CAttributeVector& attrubutes = pStep->attributeVector();
        m_portStatusReport.getAttributeVector(attrubutes, weight);
        pStep->addAttributeVector(attrubutes);
        LOGI("<CCassetteTranserStateStep>decodePortStatusReport<Status:%d, CassetteSequenceNo:%d>",
            m_portStatusReport.getPortStatus(), m_portStatusReport.getCassetteSequenceNo());
SourceCode/Bond/Servo/CPageGraph1.cpp
@@ -272,10 +272,7 @@
    }
    m_pGraph->UpdateIndicateBox1Colors(id, newBackgroundColor, newFrameColor1, newFrameColor2);
    // 刷新界面
    Invalidate();
    UpdateWindow();
    m_pGraph->Invalidata();
}
BOOL CPageGraph1::OnEraseBkgnd(CDC* pDC)
@@ -375,8 +372,6 @@
        m_pGraph->UpdateIndicateBoxCoordinates(INDICATE_ROBOT_ARM1, cx + rotatedX1, cy + rotatedY1);
        m_pGraph->UpdateIndicateBoxCoordinates(INDICATE_ROBOT_ARM2, cx + rotatedX2, cy + rotatedY2);
        Invalidate();
        UpdateWindow();
        std::this_thread::sleep_for(std::chrono::milliseconds(16));
    }
@@ -515,10 +510,10 @@
        MoveRobotToPosition(SERVO::ROBOT_POSITION::Measurement);
    }
    CString s; s.Format(_T("OnGraphItemClicked %d"), pGraphNmhdr->dwData);
    SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)m_pGraph->GetIndicateBoxData(pGraphNmhdr->dwData);
    if (pEquipment != nullptr) {
        theApp.m_model.notifyPtr(RX_CODE_SELECT_EQUIPMENT, pEquipment);
        // 暂时禁用展开属性页的功能
        // theApp.m_model.notifyPtr(RX_CODE_SELECT_EQUIPMENT, pEquipment);
    }
    
    *pResult = 0;
@@ -596,6 +591,8 @@
        if (robotData.position != m_lastRobotPosition) {
            MoveRobotToPosition(robotData.position);
        }
        m_pGraph->Invalidata();
    }
    CDialogEx::OnTimer(nIDEvent);
SourceCode/Bond/Servo/CStep.cpp
@@ -59,8 +59,17 @@
            std::to_string(m_station.nNetNo).c_str(), "", weight++));
        attrubutes.addAttribute(new CAttribute("Station",
            std::to_string(m_station.nStNo).c_str(), "", weight++));
        attrubutes.addAttributeVector(m_attributeVector);
        auto as = m_attributeVector.getAttributes();
        for (auto item : as) {
            attrubutes.addAttribute(new CAttribute(item->getName().c_str(),
                item->getValue().c_str(), item->getDescription().c_str(), item->getWeight()));
        }
    }
    CAttributeVector& CStep::attributeVector()
    {
        return m_attributeVector;
    }
    void CStep::init()
SourceCode/Bond/Servo/CStep.h
@@ -24,6 +24,7 @@
        int getID();
        void setName(const char* pszName);
        std::string& getName();
        CAttributeVector& attributeVector();
        virtual void getAttributeVector(CAttributeVector& attrubutes);
        virtual void init();
        virtual void term();
SourceCode/Bond/Servo/ServoGraph.cpp
@@ -723,3 +723,8 @@
    return nullptr;
}
void CServoGraph::Invalidata()
{
    ::InvalidateRect(m_hWnd, NULL, TRUE);
}
SourceCode/Bond/Servo/ServoGraph.h
@@ -148,6 +148,7 @@
    LRESULT OnLButtonDown(WPARAM wParam, LPARAM lParam);
public:
    void Invalidata();
    void AddImage(int id, char* pszPath, int x, int y);
    void AddIndicateBox(int id, int x, int y, int width);
    void AddIndicateBox(int id, int x, int y, int width,