From bc7f1c4e028e69be51079b59dae4ae5c4d43f5bb Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 31 一月 2026 21:54:56 +0800
Subject: [PATCH] 1.状态指示图,目前灰色表示掉线,绿色表示在线。增加Slot的小点表示有没有料,及加工状态 。 2.增加图示
---
SourceCode/Bond/Servo/CRecipesManager.h | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/SourceCode/Bond/Servo/CRecipesManager.h b/SourceCode/Bond/Servo/CRecipesManager.h
index 489e2a5..e61df75 100644
--- a/SourceCode/Bond/Servo/CRecipesManager.h
+++ b/SourceCode/Bond/Servo/CRecipesManager.h
@@ -1,15 +1,19 @@
#pragma once
#include <map>
#include "CRecipeList.h"
+#include <functional>
#define SS_NONE 0
#define SS_SYNCING 1
-#define SS_COMPLETE 2
-#define SS_TIMEOUT 3
-#define SS_FAILED 4
+#define SS_LIST_COMPLETE 2
+#define SS_PARAMS_COMPLETE 3
+#define SS_TIMEOUT 4
+#define SS_FAILED 5
namespace SERVO {
+ typedef std::function<void(int state)> ONSYNCINGSTATECHANGED;
+
class CRecipesManager
{
public:
@@ -17,11 +21,17 @@
virtual ~CRecipesManager();
public:
+ void setOnSyncingStateChanged(ONSYNCINGSTATECHANGED block);
unsigned TimeoutCheckWorkingProc();
int syncing();
void syncFailed();
- int decodeRecipeListReport(const char* pszData, size_t size);
+ void syncTimeout();
+ short decodeRecipeListReport(const char* pszData, size_t size);
+ short decodeRecipeParameterReport(const char* pszData, size_t size);
CRecipeList* getRecipeListFromTemp(int unitNo);
+ CRecipeList* getRecipeList(int unitNo);
+ bool saveRecipeList(int unitNo, std::string& strFilepath);
+ bool readRecipeList(int unitNo, std::string& strFilepath);
public:
inline void lock() { ::EnterCriticalSection(&m_cs); };
@@ -35,8 +45,10 @@
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;
+ ONSYNCINGSTATECHANGED m_onSyncingStateChanged;
};
}
--
Gitblit v1.9.3