From 6d140a6e6f2c24c9c7de46bb7c375ae4cbf931e7 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 10 一月 2026 10:38:26 +0800
Subject: [PATCH] 1.实现远程删除配方功能;

---
 SourceCode/Bond/Servo/Model.cpp |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 31788e7..5087821 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -190,6 +190,21 @@
 			m_master.enableEventReport(bEnable);
 		}
 	};
+	listener.onDeletePPID = [&](void* pFrom, const std::vector<std::string>& ppids) -> bool {
+		(void)pFrom;
+		bool allOk = true;
+		std::vector<std::string> targets = ppids;
+		if (targets.empty()) {
+			// L:0 => delete all PPIDs
+			targets = RecipeManager::getInstance().getAllPPID();
+		}
+		for (auto& ppid : targets) {
+			bool ok = RecipeManager::getInstance().deleteRecipeByPPID(ppid);
+			allOk = allOk && ok;
+			LOGI("<CModel>DeletePPID: %s, result=%s", ppid.c_str(), ok ? "OK" : "FAIL");
+		}
+		return allOk;
+	};
 	listener.onEnableDisableAlarmReport = [&](void* pFrom, bool bEnable, unsigned int id) -> void {
 		LOGI("onEnableDisableAlarmReport bEnable:%s, id:%d", bEnable ? _T("YES") : _T("NO"), id);
 		if (id == 0) {

--
Gitblit v1.9.3