mrDarker
2025-06-17 58b5bb07de4bcbf670db5ad79ff8b9bd7afc1e28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <map>
#include "CRecipeList.h"
 
 
#define SS_NONE                    0
#define SS_SYNCING                1
#define SS_COMPLETE                2
#define SS_TIMEOUT                3
#define SS_FAILED                4
 
namespace SERVO {
    class CRecipesManager
    {
    public:
        CRecipesManager();
        virtual ~CRecipesManager();
 
    public:
        unsigned TimeoutCheckWorkingProc();
        int syncing();
        void syncFailed();
        short decodeRecipeListReport(const char* pszData, size_t size);
        short decodeRecipeParameterReport(const char* pszData, size_t size);
        CRecipeList* getRecipeListFromTemp(int unitNo);
 
    public:
        inline void lock() { ::EnterCriticalSection(&m_cs); };
        inline void unlock() { ::LeaveCriticalSection(&m_cs); };
 
    private:
        HANDLE m_hWorkThreadHandle;
        unsigned m_nWordThreadAddr;
        HANDLE m_hWorkStop;
        int m_nTimeoutCount;
        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;
    };
}