📄 opcclient.h
字号:
#if !defined(AFX_OPCCLIENT_H__14944EFF_0DD0_4F54_A98D_1C199BE0634A__INCLUDED_)
#define AFX_OPCCLIENT_H__14944EFF_0DD0_4F54_A98D_1C199BE0634A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// OPCClient.h : header file
//
#include "StdAfx.h"
#include "ConnectionPoint.h"
#include "AdviseSink.h"
/////////////////////////////////////////////////////////////////////////////
// COPCClient command target
class COPCClient : public CDocument
{
DECLARE_DYNCREATE(COPCClient)
COPCClient(); // protected constructor used by dynamic creation
// Attributes
public:
ItemList items;
Item* pCurrentItem; // selected item in view
HWND hView; // for updates
OPCServer opcServer; // the connected server
OPCGroupStateMgt opcGroup; // the single group on this server
BOOL m_async;
CString m_value;
CString lastServer;
CString lastNode;
CLSID m_clsid;
BOOL m_connect;
BOOL m_PV;//是否记录数据PV
BOOL m_CV;//是否记录数据CV
BOOL m_PID;//PID参数下载
// Operations
public:
double m_doublevalue;
double m_doubleitemvalue[10];
CString m_Itemvalue[10];
CString m_itemname;
void AutoDoubleWrite();
void AutoWrite();
void WriteItems();
void Write(CString name,double s);
void ReadItems();
void refresh();
void OpcAdditem();
void DisConnect();
void Additem(LPCTSTR itemID, LPCTSTR accessPath, VARTYPE type);
void AutoAdditem(CString m_ItemID);
BOOL HandWrite();
BOOL Read();
BOOL connect();
virtual ~COPCClient();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COPCClient)
//}}AFX_VIRTUAL
// Implementation
protected:
// OPC 1.0 IDataObject
DWORD dwConnection1;
DWORD dwConnection2;
OPCHANDLE groupHandle;
CAdviseSink* testSink;
// OPC 2.0 ConnectionPoint
OPCCallback* callbackCP;
OPCShutdown* shutdownCP;
DWORD dwShutdownConnection;
BOOL usingCP;
DWORD transactionID; // only used for asynchronous I/O
// Generated message map functions
//{{AFX_MSG(COPCClient)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OPCCLIENT_H__14944EFF_0DD0_4F54_A98D_1C199BE0634A__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -