From 38f2ff1e5bc6c4434875e03b8cadc8f3f4e39bf6 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 27 八月 2025 18:18:02 +0800
Subject: [PATCH] 1.修改调度逻辑,增加G0,第二类型,增加TestFlag, 用于必要时输出指定日志;

---
 SourceCode/Bond/Servo/PortConfigurationDlg.cpp |   86 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/PortConfigurationDlg.cpp b/SourceCode/Bond/Servo/PortConfigurationDlg.cpp
index 62b883a..a8969fe 100644
--- a/SourceCode/Bond/Servo/PortConfigurationDlg.cpp
+++ b/SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -240,7 +240,6 @@
     GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(FALSE);
     GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(FALSE);
 
-
 	return TRUE;  // return TRUE unless you set the focus to a control
 	// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
 }
@@ -254,6 +253,12 @@
 	}
 
 	// 鍔犺浇閫変腑绔彛鐨勯厤缃埌 UI
+    for (int i = 1; i <= 8; i++) {
+        m_wndGrid.SetItemText(i, 0, "");
+        m_wndGrid.SetItemText(i, 1, "");
+        m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellNumeric));
+    }
+    m_wndGrid.Invalidate();
 	LoadPortConfigToUI(m_pPort[selPort]);
 }
 
@@ -312,6 +317,7 @@
 	}
 
     // 鑾峰彇 Grid 琛ㄦ牸涓� Slot 鐘舵�侊紙绗�1~8琛岋級
+    /*
     for (int i = 1; i <= SLOT_MAX; ++i) {
         SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0);
         if (pGlass != nullptr) {
@@ -319,14 +325,92 @@
             ASSERT(pCheck);
             pGlass->setScheduledForProcessing(pCheck->GetCheck());
             pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
+            LOGI("i: %d, nMaterialType:%d", i, config.nMaterialType);
 
             SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
             pJobDataS->setLotId(config.strLotID.c_str());
             pJobDataS->setProductId(config.strProductID.c_str());
             pJobDataS->setOperationId(config.strOperationID.c_str());
             pJobDataS->setMaterialsType(config.nMaterialType);
+
+            RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(config.strRecipe);
+            std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList;
+
+            for (const auto& info : vecRecipeInfo) {
+                const std::string& name = info.strDeviceName;
+                short nRecipeID = (short)info.nRecipeID;
+
+                if (name == EQ_NAME_EFEM) {
+                    pJobDataS->setDeviceRecipeId(0, nRecipeID);
+                }
+                else if (name == EQ_NAME_BONDER1) {
+                    pJobDataS->setDeviceRecipeId(1, nRecipeID);
+                }
+                else if (name == EQ_NAME_BONDER2) {
+                    pJobDataS->setDeviceRecipeId(2, nRecipeID);
+                }
+                else if (name == EQ_NAME_BAKE_COOLING) {
+                    pJobDataS->setDeviceRecipeId(3, nRecipeID);
+                }
+                else if (name == EQ_NAME_VACUUMBAKE) {
+                    pJobDataS->setDeviceRecipeId(4, nRecipeID);
+                }
+                else if (name == EQ_NAME_MEASUREMENT) {
+                    pJobDataS->setDeviceRecipeId(5, nRecipeID);
+                }
+            }
         }
     }
+    */
+
+
+    // 鎵撳嬀涓烘洿鏂扮被鍨嬶紝鏆傛椂娴嬭瘯浣跨敤锛屽師鎵撹壊涓烘槸鍚﹀姞宸�
+    for (int i = 1; i <= SLOT_MAX; ++i) {
+        SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0);
+        if (pGlass != nullptr) {
+            CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
+            ASSERT(pCheck);
+            pGlass->setScheduledForProcessing(TRUE);
+            if (pCheck->GetCheck()) {
+                pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
+                LOGI("i: %d, nMaterialType:%d", i, config.nMaterialType);
+
+                SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
+                pJobDataS->setLotId(config.strLotID.c_str());
+                pJobDataS->setProductId(config.strProductID.c_str());
+                pJobDataS->setOperationId(config.strOperationID.c_str());
+                pJobDataS->setMaterialsType(config.nMaterialType);
+
+                RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(config.strRecipe);
+                std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList;
+
+                for (const auto& info : vecRecipeInfo) {
+                    const std::string& name = info.strDeviceName;
+                    short nRecipeID = (short)info.nRecipeID;
+
+                    if (name == EQ_NAME_EFEM) {
+                        pJobDataS->setDeviceRecipeId(0, nRecipeID);
+                    }
+                    else if (name == EQ_NAME_BONDER1) {
+                        pJobDataS->setDeviceRecipeId(1, nRecipeID);
+                    }
+                    else if (name == EQ_NAME_BONDER2) {
+                        pJobDataS->setDeviceRecipeId(2, nRecipeID);
+                    }
+                    else if (name == EQ_NAME_BAKE_COOLING) {
+                        pJobDataS->setDeviceRecipeId(3, nRecipeID);
+                    }
+                    else if (name == EQ_NAME_VACUUMBAKE) {
+                        pJobDataS->setDeviceRecipeId(4, nRecipeID);
+                    }
+                    else if (name == EQ_NAME_MEASUREMENT) {
+                        pJobDataS->setDeviceRecipeId(5, nRecipeID);
+                    }
+                }
+            }
+        }
+    }
+
 
     GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(TRUE);
     GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(TRUE);

--
Gitblit v1.9.3