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
#include "stdafx.h"
#include "CBonder.h"
 
 
namespace SERVO {
    CBonder::CBonder() : CEquipment()
    {
 
    }
 
    CBonder::~CBonder()
    {
 
    }
 
    const char* CBonder::getClassName()
    {
        static char* pszName = "CBonder";
        return pszName;
    }
 
    void CBonder::init()
    {
        CEquipment::init();
    }
 
    void CBonder::term()
    {
        CEquipment::term();
    }
 
    // ±ØÐëҪʵÏÖµÄÐ麯Êý£¬Ôڴ˳õʼ»¯PinÁбí
    void CBonder::initPins()
    {
        // ¼ÓÈëPin³õʼ»¯´úÂë
        LOGI("<CBonder>initPins");
        addPin(SERVO::PinType::INPUT, _T("In"));
        addPin(SERVO::PinType::OUTPUT, _T("Out"));
    }
 
    void CBonder::onTimer(UINT nTimerid)
    {
        CEquipment::onTimer(nTimerid);
    }
 
    void CBonder::serialize(CArchive& ar)
    {
        CEquipment::serialize(ar);
    }
 
    int CBonder::recvSample(CPin* pPin, CSample* pSample)
    {
        ASSERT(pPin);
 
        CPin* pFromPin = pPin->getConnectedPin();
        ASSERT(pFromPin);
 
        CEquipment* pFromEq = pFromPin->getEquipment();
        ASSERT(pFromEq);
 
 
        LOGI("<CBonder><%s-%s>ÊÕµ½À´×Ô<%s.%s>µÄSample", 
            this->getName().c_str(), pPin->getName().c_str(),
            pFromEq->getName().c_str(), pFromPin->getName().c_str());
 
        delete pSample;
        return 0;
    }
}