SDC C-Project CF Review 프로그램
LYW
2021-06-28 cf6a4019e9efbc0503bd3fbcf6f951565d028972
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
#pragma once
 
#include "VcrControlInfo.h"
 
enum VCRControllerType                { TYPE_V5111N=0, TYPE_SIMULATION, TYPE_COUNT };                    // Á¦¾î±â Å¸ÀÔ
enum VCRControllerConnectStatus        { STATUS_DISCONNECTEED=0, STATUS_CONNECTEED, STATUS_COUNT };    // ÄÁÆ®·Ñ·¯ ¿¬°á »óÅÂ
enum VCRControllerReturnMassage        { MSG_V=0, MSG_R1, MSG_R2, MSG_R3, MSG_COUNT };                    // 
enum VCRControllerReturnCode        { CODE_FAIL=0, CODE_SUCCESS, CODE_COUNT };                        //
 
// VCR ÄÁÆ®·Ñ·¯¸¦ °ü¸®ÇÒ ºÎ¸ð Å¬·¡½º(Ãß»ó Å¬·¡½º)
class AFX_EXT_CLASS CVcrControl
{
public:
    CVcrControl(int nIndex)
    {
        m_pVC2P            = NULL;
 
        m_nIndex        = nIndex;
        m_nPortIndex    = 1;
        m_nBaudRate        = CBR_9600;
        m_bConnected    = FALSE;
    }
 
    virtual ~CVcrControl(void)
    {
    }
 
    // Setter
    void    SetLC2P(IVcrControl2Parent* pVC2P)    { m_pVC2P = pVC2P; }
 
    // Getter
    int        GetControlType() const                { return m_ControlInfo.GetControllerType(); }
    CString    GetConnectionPort() const            { return m_ControlInfo.GetConnectionPort(); }
    int        GetBaudRate() const                    { return m_ControlInfo.GetBaudRate(); }
 
    int        GetPortIndex() const                { return m_nPortIndex; }
    BOOL    GetConnected() const                { return m_bConnected; }
 
    // ¼ø¼ö °¡»ó ÇÔ¼ö
    virtual BOOL Connect(const CVcrControlInfo& controlInfo) = 0;
    virtual void Disconnect() = 0;
 
    virtual BOOL GetDecodeStatus(BOOL &bValue) = 0;
    virtual BOOL GetDecodeData(CString &strValue) = 0;
    virtual BOOL GetReadSize(int &readSize) = 0;
 
    virtual BOOL DecodeTriggerSignal() = 0;
 
 
protected:
    IVcrControl2Parent*    m_pVC2P;
    CVcrControlInfo        m_ControlInfo;
 
    int                    m_nIndex;            // Controller No.
    int                    m_nPortIndex;        // 
    int                    m_nBaudRate;
 
    BOOL                m_bConnected;        // Connected Status (TRUE : Á¢¼Ó, FALSE : ²÷±è)
};