LAPTOP-SNT8I5JK\Boounion
2025-09-12 f0f5854c1c32543aba129f0114a9bdd9e758e220
1.为调机方便,增加物料账单转移的功能;
已修改10个文件
104 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CEquipment.cpp 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipmentPage2.cpp 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipmentPage2.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp
@@ -1497,6 +1497,19 @@
        return &m_slot[index];
    }
    CSlot* CEquipment::getSlotWithNo(int slotNo)
    {
        CSlot* pSlot = nullptr;
        for (int i = 0; i < SLOT_MAX; i++) {
            if (!m_slot[i].isEnable()) continue;
            if (m_slot[i].getNo() != slotNo) continue;
            pSlot = &m_slot[i];
            break;
        }
        return pSlot;
    }
    CGlass* CEquipment::getAnyGlass()
    {
        CSlot* pSlot = nullptr;
@@ -1581,8 +1594,10 @@
        }
        auto rawData = processData.getParamsRawData();
        std::vector<CParam> params;
        this->parsingParams((const char*)rawData.data(), rawData.size(), params);
        std::vector<CParam> tempParams;
        this->parsingParams((const char*)rawData.data(), rawData.size(), tempParams);
        int n = processData.getTotalParameter();
        std::vector<CParam> params(tempParams.begin(), tempParams.begin() + min(n, (int)tempParams.size()));
        pGlass->addParams(params);
        
        // 关联的Glass也要更新
SourceCode/Bond/Servo/CEquipment.h
@@ -181,6 +181,7 @@
        // 获取指定的Slot
        CSlot* getSlot(int index);
        CSlot* getSlotWithNo(int slotNo);
        // 获取一个可用的槽位
        CSlot* getAvailableSlot();
SourceCode/Bond/Servo/CEquipmentPage2.cpp
@@ -34,6 +34,7 @@
    ON_WM_SIZE()
    ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST1, &CEquipmentPage2::OnLvnItemchangedList1)
    ON_BN_CLICKED(IDC_BUTTON_REMOVE, &CEquipmentPage2::OnBnClickedButtonRemove)
    ON_BN_CLICKED(IDC_BUTTON_PUT, &CEquipmentPage2::OnBnClickedButtonPut)
END_MESSAGE_MAP()
@@ -125,10 +126,17 @@
    GetClientRect(&rcClient);
    int x = 12;
    int x1 = x;
    int y2 = rcClient.bottom - 12;
    pItem = GetDlgItem(IDC_BUTTON_REMOVE);
    pItem->GetWindowRect(&rcItem);
    pItem->MoveWindow(x, y2 - rcItem.Height(), rcItem.Width(), rcItem.Height());
    x1 += rcItem.Width();
    x1 += 12;
    pItem = GetDlgItem(IDC_BUTTON_PUT);
    pItem->GetWindowRect(&rcItem);
    pItem->MoveWindow(x1, y2 - rcItem.Height(), rcItem.Width(), rcItem.Height());
    y2 -= rcItem.Height();
    y2 -= 8;
@@ -160,9 +168,24 @@
    if (index >= 0) {
        SERVO::CSlot* pSlot = (SERVO::CSlot*)m_listCtrl.GetItemData(index);
        ASSERT(pSlot);
        int bRet = m_pEquipment->removeGlass(pSlot->getNo());
        if (bRet == 0) {
        if (theApp.m_model.getMaster().moveGlassToBuf(m_pEquipment->getID(),
            pSlot->getNo())) {
            UpdateSlots();
            AfxMessageBox("物料已取出到Buffer中!");
        }
    }
}
void CEquipmentPage2::OnBnClickedButtonPut()
{
    int index = GetSelectedItemIndex();
    if (index >= 0) {
        SERVO::CSlot* pSlot = (SERVO::CSlot*)m_listCtrl.GetItemData(index);
        ASSERT(pSlot);
        if (theApp.m_model.getMaster().moveGlassToSlot(m_pEquipment->getID(),
            pSlot->getNo())) {
            UpdateSlots();
            AfxMessageBox("物料已放入指定位置!");
        }
    }
}
@@ -199,4 +222,3 @@
        }
    }
}
SourceCode/Bond/Servo/CEquipmentPage2.h
@@ -41,4 +41,5 @@
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnLvnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnBnClickedButtonRemove();
    afx_msg void OnBnClickedButtonPut();
};
SourceCode/Bond/Servo/CMaster.cpp
@@ -2076,7 +2076,7 @@
        pTarSlot = pTarEq->getAvailableSlotForGlass(primaryType);
        pSrcSlot = pSrcEq->getProcessedSlot(primaryType, bJobMode);
        if (m_nTestFlag == 1) LOGD("createTransferTask 003 %x, %x", pTarSlot, pSrcSlot);
        if (pSrcSlot == nullptr || nullptr == pTarSlot && secondaryType != SERVO::MaterialsType::G0) {
        if ((pSrcSlot == nullptr || nullptr == pTarSlot) && secondaryType != SERVO::MaterialsType::G0) {
            pTarSlot = pTarEq->getAvailableSlotForGlass(secondaryType);
            pSrcSlot = pSrcEq->getProcessedSlot(secondaryType, bJobMode);
        }
@@ -2782,4 +2782,48 @@
            m_strLastError = "AOI检测未通过.";
        }
    }
    bool CMaster::moveGlassToBuf(int eqid, int slotNo)
    {
        CEquipment* pEquipment = getEquipment(eqid);
        if (pEquipment == nullptr) return false;
        CSlot* pSlot = pEquipment->getSlotWithNo(slotNo);
        if (pSlot == nullptr) return false;
        CGlass* pGlass = (CGlass*)pSlot->getContext();
        m_bufGlass.push_back(pGlass);
        pGlass->addRef();
        pSlot->setContext(nullptr);
        m_bDataModify = TRUE;
        if (m_listener.onEqDataChanged != nullptr) {
            m_listener.onEqDataChanged(this, pEquipment, 0);
        }
        return true;
    }
    bool CMaster::moveGlassToSlot(int eqid, int slotNo)
    {
        CEquipment* pEquipment = getEquipment(eqid);
        if (pEquipment == nullptr) return false;
        CSlot* pSlot = pEquipment->getSlotWithNo(slotNo);
        if (pSlot == nullptr) return false;
        if (m_bufGlass.empty()) return false;
        CGlass* pGlass = m_bufGlass.front();
        m_bufGlass.pop_front();
        if (pGlass == nullptr) return false;
        pSlot->setContext(pGlass);
        pGlass->release();
        m_bDataModify = TRUE;
        if (m_listener.onEqDataChanged != nullptr) {
            m_listener.onEqDataChanged(this, pEquipment, 0);
        }
        return true;
    }
}
SourceCode/Bond/Servo/CMaster.h
@@ -131,6 +131,8 @@
        bool loadState(const std::string& path);
        int getWipGlasses(std::vector<CGlass*>& glasses);
        void test();
        bool moveGlassToBuf(int eqid, int slotNo);
        bool moveGlassToSlot(int eqid, int slotNo);
        int getPortCassetteSnSeed(int port);
        void setPortCassetteSnSeed(int port, int seed);
@@ -249,6 +251,7 @@
        std::string m_strStatePath;
        int m_nTestFlag;
        std::list<CGlass*> m_bufGlass;
    };
}
SourceCode/Bond/Servo/Model.cpp
@@ -482,6 +482,10 @@
int CModel::term()
{
    m_configuration.setPortCassetteSnSeed(1, m_master.getPortCassetteSnSeed(1));
    m_configuration.setPortCassetteSnSeed(2, m_master.getPortCassetteSnSeed(2));
    m_configuration.setPortCassetteSnSeed(3, m_master.getPortCassetteSnSeed(3));
    m_configuration.setPortCassetteSnSeed(4, m_master.getPortCassetteSnSeed(4));
    m_hsmsPassive.saveCache();
    m_hsmsPassive.term();
    CLog::GetLog()->SetOnLogCallback(nullptr);
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -218,6 +218,7 @@
                    m_pMyStatusbar->setForegroundColor(RGB(0, 0, 0));
                    m_pMyStatusbar->setRunTimeText("启动失败.");
                    m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(TRUE);
                    KillTimer(TIMER_ID_UPDATE_RUMTIME);
                }
                else if (state == SERVO::MASTERSTATE::ATHERERROR) {
                    m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(TRUE);
@@ -231,6 +232,7 @@
                        AfxMessageBox(_T("AOI检测失败,请操作员介入解决问题!"));
                    }
                    m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(TRUE);
                    KillTimer(TIMER_ID_UPDATE_RUMTIME);
                }
                else if (state == SERVO::MASTERSTATE::RUNNING || state == SERVO::MASTERSTATE::RUNNING_CONTINUOUS_TRANSFER
                    || state == SERVO::MASTERSTATE::RUNNING_BATCH) {
SourceCode/Bond/Servo/resource.h
Binary files differ