LAPTOP-SNT8I5JK\Boounion
2025-02-15 3ba7f1dbf602fb376c4cd158a8a416a4910902fe
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
44
45
46
47
48
49
50
#pragma once
#include "Log.h"
#include "CCLinkIEControl.h"
 
namespace SERVO {
    // Memory Block ½á¹¹Ì嶨Òå
    typedef struct _MemoryBlock {
        unsigned int type;
        unsigned int start;
        unsigned int end;
        unsigned int size;
    } MemoryBlock;
 
    class CEquipment
    {
    public:
        CEquipment();
        virtual ~CEquipment();
 
 
    public:
        virtual const char* getClassName() = 0;
        void setName(const char* pszName);
        std::string& getName();
        void setDescription(const char* pszDescription);
        std::string& getDescription();
        void setStation(int network, int station);
        const StationIdentifier& getStation();
        void setReadBitBlock(unsigned int start, unsigned int end);
        MemoryBlock& getReadBitBlock();
        void setWriteBitBlock(unsigned int start, unsigned int end);
        MemoryBlock& getWriteBitBlock();
        virtual void init();
        virtual void term();
        virtual void onTimer(UINT nTimerid);
        virtual void serialize(CArchive& ar);
 
    protected:
        inline void Lock() { EnterCriticalSection(&m_criticalSection); }
        inline void Unlock() { LeaveCriticalSection(&m_criticalSection); }
 
    protected:
        std::string m_strName;
        std::string m_strDescription;
        CRITICAL_SECTION m_criticalSection;
        StationIdentifier m_station;
        MemoryBlock m_blockReadBit;
        MemoryBlock m_blockWriteBit;
    };
}