LAPTOP-SNT8I5JK\Boounion
2025-03-19 1823e5c63bac2246d066eb74318230952484c58a
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "stdafx.h"
#include "CStep.h"
 
 
namespace SERVO {
 
    CStep::CStep()
    {
        m_listener = {nullptr};
        m_pCclink = nullptr;
        InitializeCriticalSection(&m_criticalSection);
    }
 
    CStep::~CStep()
    {
        DeleteCriticalSection(&m_criticalSection);
    }
 
    void CStep::setListener(StepListener listener)
    {
        m_listener.onEvent = listener.onEvent;
    }
 
    void CStep::setCcLink(CCCLinkIEControl* pCcLink)
    {
        m_pCclink = pCcLink;
    }
 
    void CStep::setEquipment(CEquipment* pEquipment)
    {
        m_pEquipment = pEquipment;
    }
 
    CEquipment* CStep::getEquipment()
    {
        return m_pEquipment;
    }
 
    void CStep::setName(const char* pszName)
    {
        m_strName = pszName;
    }
 
    std::string& CStep::getName()
    {
        return m_strName;
    }
 
    void CStep::getAttributeVector(CAttributeVector& attrubutes)
    {
        attrubutes.clear();
        attrubutes.addAttribute(new CAttribute("Network", 
            std::to_string(m_station.nNetNo).c_str(), ""));
        attrubutes.addAttribute(new CAttribute("Station",
            std::to_string(m_station.nStNo).c_str(), ""));
    }
 
    void CStep::init()
    {
 
    }
 
    void CStep::term()
    {
 
    }
 
    void CStep::convertString(const char* pszBuffer, int size, std::string& strOut)
    {
        strOut.clear();
        int nLength = 0;
        for (int i = 0; i < size; i++) {
            if (pszBuffer[i] == '\0') break;
            nLength++;
        }
        if (nLength > 0) {
            strOut = std::string(pszBuffer, nLength);
        }
    }
}