SDC C-Project CF Review 프로그램
LYW
2022-04-15 8ede40e3f7cfe1772ef7db2b1d74e905639cf343
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
#pragma once
 
#include "CHAfmControls/AfmControl.h"
#include "IOCPNetwork/IOCPNetwork2Parent.h"
#include "IOCPNetwork/NetClient.h"
class CNetClient;
class CNetPacket;
 
class AFX_EXT_CLASS CAfmControl_NDit : public CAfmControl, public IIOCPNetwork2Parent
{
public:
    CAfmControl_NDit(int nIndex);
    virtual ~CAfmControl_NDit(void);
    
    // net iocp 2 parent
 
    virtual void    IOCPNet2P_Connected(int Type);
    virtual void    IOCPNet2P_Disconnected(int Type, int nModuleNo = -1);
    virtual BOOL    IOCPNet2P_Received(int Type, CNetPacket* pPacket, int nContext = -1);
 
    virtual int        Connect(const CAfmControlInfo& controlInfo);
    virtual void    Disconnect();
 
    // getter
    virtual BOOL    GetTracking(int& nTracking) const;
    virtual BOOL    GetZoomIndex(int& nZoomIndex) const;
    virtual BOOL    GetRecipeIndex(int& nRecipeIdnex, int& nZoomIndex) const;
    virtual BOOL    GetRecipeName(CString& strRecipeName, int& nZoomIndex) const;
    virtual int        GetAFMHomePosition(bool &bHome) const;
    virtual BOOL    GetInFocus(BOOL* pRtCheck);
 
    // setter
    virtual BOOL    SetTracking(int nTracking);
    virtual BOOL    SetZoomIndex(int nZoomIndex);
    virtual BOOL    SetRecipeIndex(int nRecipeIdnex, int nZoomIndex=-1);
    virtual BOOL    SetRecipeName(const CString& strRecipeName, int nZoomIndex=-1);
    virtual BOOL    SetSystemTime(SYSTEMTIME stCurrentTime);
 
    virtual int        RecipeJogSpeed(double dSpeed);
    virtual int        RecipeJogCommand(int nCmd);
    virtual int        RecipeTracking(int nTracking);
    virtual int        RecipeZoom(int nZoomIndex);
    virtual int        RecipeChange(int nRecipeIndex, int nZoomIndex);
    virtual int        RecipeChange(const CString& strRecipeName, int nZoomIndex);
    
    virtual BOOL    MoveToLimitPlus();
    virtual BOOL    MoveToLimitMinus();
    virtual int        MoveToHomePosition(int nHomePos = 0);
    virtual BOOL    MoveToBasePosition(int nZoomIndex);
    virtual BOOL    MoveToTargetPosition(double dPos);
 
    virtual int    JumpAF(){return -1;};
    
    int        NetProcess_FC_SEND_ALIVE();
    BOOL    NetProcess_FC_RECV_ALIVE(CNetPacket* packet);
    BOOL    IsSetTime() {return m_bSetTime;};
    void    KillTime(){m_bSetTime = FALSE;};
    CTime    GetLastAliveTime(){return m_lastAliveTime;};
 
protected:
    int        InitNetwork(const CString& strIPAddress);
    void    DeinitNetwork();
 
    void    NetProcess_FC_MODULE_INDEX(CNetPacket* pPacket);
    void    NetProcess_FC_SEND_SIGNAL(CNetPacket* pPacket);
    void    NetProcess_FC_RECV_SIGNAL(CNetPacket* pPacket);
    void    NetProcess_FC_SEND_RECIPE(CNetPacket* pPacket);
    void    NetProcess_FC_RECV_RECIPE(CNetPacket* pPacket);
    void    NetProcess_FC_RECIPE_COMP(CNetPacket* pPacket);
    void    NetProcess_FC_RECIPE_COUNT(CNetPacket* pPacket);
    void    NetProcess_FC_RECIPE_INFO(CNetPacket* pPacket);
    void    NetProcess_FC_SEND_BIT(CNetPacket* pPacket);
    void    NetProcess_FC_RECV_BIT(CNetPacket* pPacket);
    
    CNetClient*        m_pClientSocket;                // AFM Client Socket
    CTime        m_lastAliveTime;
    BOOL        m_bSetTime;
};