Documentation
¶
Index ¶
- Constants
- Variables
- func EventSinkAddRef(this unsafe.Pointer) uintptr
- func EventSinkOnEvent(this *com.IUnknown, clientHandle uint32, refresh int32, lastRefresh int32, ...) uintptr
- func EventSinkQueryInterface(this unsafe.Pointer, iid *windows.GUID, punk *unsafe.Pointer) uintptr
- func EventSinkRelease(this unsafe.Pointer) uintptr
- func MarshalEventCategoryType(categories []EventCategoryType) (category uint32)
- func MarshalFilter(filters []Filter) (filter uint32)
- type BrowseType
- type ChangeMask
- type EventAttribute
- type EventCategory
- type EventCategoryType
- type EventSinkOnEventData
- type Filter
- type IOPCEventSink
- type IOPCEventSinkVtbl
- type ItemID
- type ONEVENTSTRUCT
- type OPCAreaBrowser
- func (b *OPCAreaBrowser) BrowseOPCAreas(browseFilterType BrowseType, filterCriteria string) (areas []string, err error)
- func (b *OPCAreaBrowser) GetQualifiedAreaName(areaName string) (qualifiedAreaName string, err error)
- func (b *OPCAreaBrowser) GetQualifiedSourceName(sourceName string) (qualifiedSourceName string, err error)
- func (b *OPCAreaBrowser) MoveDown(area string) error
- func (b *OPCAreaBrowser) MoveToRoot() error
- func (b *OPCAreaBrowser) MoveUP() error
- func (b *OPCAreaBrowser) Release() error
- type OPCEventServer
- func (v *OPCEventServer) CreateAreaBrowser() (*OPCAreaBrowser, error)
- func (v *OPCEventServer) CreateEventSubscription(active bool, bufferTime, maxSize, receiverBufSize uint32) (*OPCEventSubscription, uint32, uint32, error)
- func (v *OPCEventServer) Disconnect() error
- func (v *OPCEventServer) GetStatus() (*aecom.EventServerStatus, error)
- func (v *OPCEventServer) QueryAvailableFilters() ([]Filter, error)
- func (v *OPCEventServer) QueryConditionNames(categories []EventCategoryType) ([]string, error)
- func (v *OPCEventServer) QueryEventAttributes(eventCategoryID uint32) ([]*EventAttribute, error)
- func (v *OPCEventServer) QueryEventCategories(categories []EventCategoryType) ([]*EventCategory, error)
- func (v *OPCEventServer) QuerySourceConditions(source string) ([]string, error)
- func (v *OPCEventServer) QuerySubConditionNames(conditionName string) ([]string, error)
- func (v *OPCEventServer) TranslateToItemIDs(source string, eventCategoryID uint32, conditionName string, ...) ([]*ItemID, error)
- type OPCEventSubscription
- func (es *OPCEventSubscription) CancelRefresh() error
- func (es *OPCEventSubscription) GetClientHandle() uint32
- func (es *OPCEventSubscription) GetFilter() (events []EventCategoryType, eventCategories []uint32, lowSeverity uint32, ...)
- func (es *OPCEventSubscription) GetReceiver() <-chan *EventSinkOnEventData
- func (es *OPCEventSubscription) GetReturnedAttributes(eventCategory uint32) (attributeIDs []uint32, err error)
- func (es *OPCEventSubscription) GetState() (active bool, bufferTime uint32, maxSize uint32, clientSubscription uint32, ...)
- func (es *OPCEventSubscription) Refresh() error
- func (es *OPCEventSubscription) Release() error
- func (es *OPCEventSubscription) SelectReturnedAttributes(eventCategory uint32, attributeIDs []uint32) (err error)
- func (es *OPCEventSubscription) SetActive(active bool) error
- func (es *OPCEventSubscription) SetBufferTime(bufferTime uint32) (uint32, error)
- func (es *OPCEventSubscription) SetFilter(events []EventCategoryType, eventCategories []uint32, lowSeverity uint32, ...) error
- func (es *OPCEventSubscription) SetMaxSize(maxSize uint32) (uint32, error)
- type OnEventStruct
- type State
Constants ¶
const ( OPCAE_BROWSE_UP uint32 = 1 OPCAE_BROWSE_DOWN = OPCAE_BROWSE_UP + 1 OPCAE_BROWSE_TO = OPCAE_BROWSE_DOWN + 1 )
const VariantSize = unsafe.Sizeof(com.VARIANT{})
Variables ¶
var IID_IOPCEventSink = windows.GUID{ Data1: 0x6516885F, Data2: 0x5783, Data3: 0x11D1, Data4: [8]byte{0x84, 0xA0, 0x00, 0x60, 0x8C, 0xB8, 0xA7, 0xE9}, }
Functions ¶
func EventSinkAddRef ¶
func EventSinkOnEvent ¶
func EventSinkOnEvent(this *com.IUnknown, clientHandle uint32, refresh int32, lastRefresh int32, count uint32, events unsafe.Pointer) uintptr
virtual HRESULT STDMETHODCALLTYPE OnEvent( /* [in] */ OPCHANDLE hClientSubscription, /* [in] */ BOOL bRefresh, /* [in] */ BOOL bLastRefresh, /* [in] */ DWORD dwCount, /* [size_is][in] */ ONEVENTSTRUCT *pEvents) = 0;
func EventSinkQueryInterface ¶
func EventSinkRelease ¶
func MarshalEventCategoryType ¶
func MarshalEventCategoryType(categories []EventCategoryType) (category uint32)
func MarshalFilter ¶
Types ¶
type BrowseType ¶
type BrowseType uint32
const ( OPC_AREA BrowseType = 0x1 OPC_SOURCE BrowseType = 0x2 )
type ChangeMask ¶
type ChangeMask uint16
const ( OPC_CHANGE_ACTIVE_STATE ChangeMask = 0x1 OPC_CHANGE_ACK_STATE ChangeMask = 0x2 OPC_CHANGE_ENABLE_STATE ChangeMask = 0x4 OPC_CHANGE_QUALITY ChangeMask = 0x8 OPC_CHANGE_SEVERITY ChangeMask = 0x10 OPC_CHANGE_SUBCONDITION ChangeMask = 0x20 OPC_CHANGE_MESSAGE ChangeMask = 0x40 OPC_CHANGE_ATTRIBUTE ChangeMask = 0x80 )
func ParseChangeMask ¶
func ParseChangeMask(mask uint16) (masks []ChangeMask)
type EventAttribute ¶
type EventCategory ¶
type EventCategoryType ¶
type EventCategoryType uint32
const ( OPC_SIMPLE_EVENT EventCategoryType = 0x1 OPC_TRACKING_EVENT EventCategoryType = 0x2 OPC_CONDITION_EVENT EventCategoryType = 0x4 OPC_ALL_EVENTS EventCategoryType = 0x7 )
func UnmarshalEventCategoryType ¶
func UnmarshalEventCategoryType(category uint32) (categories []EventCategoryType)
type EventSinkOnEventData ¶
type EventSinkOnEventData struct { ClientHandle uint32 Refresh bool LastRefresh bool Events []*OnEventStruct }
type IOPCEventSink ¶
type IOPCEventSink struct {
// contains filtered or unexported fields
}
func NewEventSink ¶
func NewEventSink( receiver chan *EventSinkOnEventData, ) *IOPCEventSink
type IOPCEventSinkVtbl ¶
type IOPCEventSinkVtbl struct {
// contains filtered or unexported fields
}
type ONEVENTSTRUCT ¶
type ONEVENTSTRUCT struct { WChangeMask uint16 WNewState uint16 SzSource *uint16 FtTime windows.Filetime SzMessage *uint16 DwEventType uint32 DwEventCategory uint32 DwSeverity uint32 SzConditionName *uint16 SzSubconditionName *uint16 WQuality uint16 WReserved uint16 BAckRequired int32 FtActiveTime windows.Filetime DwCookie uint32 DwNumEventAttrs uint32 PEventAttributes unsafe.Pointer SzActorID *uint16 }
typedef /* [public][public] */ struct __MIDL___MIDL_itf_opc_ae_0262_0004
{ WORD wChangeMask; WORD wNewState; /* [string] */ LPWSTR szSource; FILETIME ftTime; /* [string] */ LPWSTR szMessage; DWORD dwEventType; DWORD dwEventCategory; DWORD dwSeverity; /* [string] */ LPWSTR szConditionName; /* [string] */ LPWSTR szSubconditionName; WORD wQuality; WORD wReserved; BOOL bAckRequired; FILETIME ftActiveTime; DWORD dwCookie; DWORD dwNumEventAttrs; /* [size_is] */ VARIANT *pEventAttributes; /* [string] */ LPWSTR szActorID; } ONEVENTSTRUCT;
type OPCAreaBrowser ¶
type OPCAreaBrowser struct {
// contains filtered or unexported fields
}
func NewOPCAreaBrowser ¶
func NewOPCAreaBrowser(unknown *com.IUnknown) *OPCAreaBrowser
func (*OPCAreaBrowser) BrowseOPCAreas ¶
func (b *OPCAreaBrowser) BrowseOPCAreas(browseFilterType BrowseType, filterCriteria string) (areas []string, err error)
func (*OPCAreaBrowser) GetQualifiedAreaName ¶
func (b *OPCAreaBrowser) GetQualifiedAreaName(areaName string) (qualifiedAreaName string, err error)
func (*OPCAreaBrowser) GetQualifiedSourceName ¶
func (b *OPCAreaBrowser) GetQualifiedSourceName(sourceName string) (qualifiedSourceName string, err error)
func (*OPCAreaBrowser) MoveDown ¶
func (b *OPCAreaBrowser) MoveDown(area string) error
func (*OPCAreaBrowser) MoveToRoot ¶
func (b *OPCAreaBrowser) MoveToRoot() error
func (*OPCAreaBrowser) MoveUP ¶
func (b *OPCAreaBrowser) MoveUP() error
func (*OPCAreaBrowser) Release ¶
func (b *OPCAreaBrowser) Release() error
type OPCEventServer ¶
func ConnectEventServer ¶
func ConnectEventServer(progID, node string) (eventServer *OPCEventServer, err error)
func (*OPCEventServer) CreateAreaBrowser ¶
func (v *OPCEventServer) CreateAreaBrowser() (*OPCAreaBrowser, error)
func (*OPCEventServer) CreateEventSubscription ¶
func (v *OPCEventServer) CreateEventSubscription(active bool, bufferTime, maxSize, receiverBufSize uint32) (*OPCEventSubscription, uint32, uint32, error)
CreateEventSubscription active: FALSE if the Event Subscription is to be created inactive and TRUE if it is to be created as active. bufferTime: The requested buffer time. The buffer time is in milliseconds and tells the server how often to send event notifications. A value of 0 for dwBufferTime means that the server should send event notifications as soon as it gets them. maxSize: The requested maximum number of events that will be sent in a single IOPCEventSink::OnEvent callback. A value of 0 means that there is no limit to the number of events that will be sent in a single callback
func (*OPCEventServer) Disconnect ¶
func (v *OPCEventServer) Disconnect() error
func (*OPCEventServer) GetStatus ¶
func (v *OPCEventServer) GetStatus() (*aecom.EventServerStatus, error)
func (*OPCEventServer) QueryAvailableFilters ¶
func (v *OPCEventServer) QueryAvailableFilters() ([]Filter, error)
func (*OPCEventServer) QueryConditionNames ¶
func (v *OPCEventServer) QueryConditionNames(categories []EventCategoryType) ([]string, error)
func (*OPCEventServer) QueryEventAttributes ¶
func (v *OPCEventServer) QueryEventAttributes(eventCategoryID uint32) ([]*EventAttribute, error)
func (*OPCEventServer) QueryEventCategories ¶
func (v *OPCEventServer) QueryEventCategories(categories []EventCategoryType) ([]*EventCategory, error)
func (*OPCEventServer) QuerySourceConditions ¶
func (v *OPCEventServer) QuerySourceConditions(source string) ([]string, error)
func (*OPCEventServer) QuerySubConditionNames ¶
func (v *OPCEventServer) QuerySubConditionNames(conditionName string) ([]string, error)
func (*OPCEventServer) TranslateToItemIDs ¶
type OPCEventSubscription ¶
type OPCEventSubscription struct {
// contains filtered or unexported fields
}
func NewOPCEventSubscription ¶
func NewOPCEventSubscription(unknown *com.IUnknown, common *com.IOPCCommon, clientHandle, receiverBufSize uint32) (*OPCEventSubscription, error)
func (*OPCEventSubscription) CancelRefresh ¶
func (es *OPCEventSubscription) CancelRefresh() error
func (*OPCEventSubscription) GetClientHandle ¶
func (es *OPCEventSubscription) GetClientHandle() uint32
func (*OPCEventSubscription) GetFilter ¶
func (es *OPCEventSubscription) GetFilter() (events []EventCategoryType, eventCategories []uint32, lowSeverity uint32, highSeverity uint32, areaList []string, sourceList []string, err error)
func (*OPCEventSubscription) GetReceiver ¶
func (es *OPCEventSubscription) GetReceiver() <-chan *EventSinkOnEventData
func (*OPCEventSubscription) GetReturnedAttributes ¶
func (es *OPCEventSubscription) GetReturnedAttributes(eventCategory uint32) (attributeIDs []uint32, err error)
func (*OPCEventSubscription) Refresh ¶
func (es *OPCEventSubscription) Refresh() error
func (*OPCEventSubscription) Release ¶
func (es *OPCEventSubscription) Release() error
func (*OPCEventSubscription) SelectReturnedAttributes ¶
func (es *OPCEventSubscription) SelectReturnedAttributes(eventCategory uint32, attributeIDs []uint32) (err error)
func (*OPCEventSubscription) SetActive ¶
func (es *OPCEventSubscription) SetActive(active bool) error
func (*OPCEventSubscription) SetBufferTime ¶
func (es *OPCEventSubscription) SetBufferTime(bufferTime uint32) (uint32, error)
func (*OPCEventSubscription) SetFilter ¶
func (es *OPCEventSubscription) SetFilter(events []EventCategoryType, eventCategories []uint32, lowSeverity uint32, highSeverity uint32, areaList []string, sourceList []string) error
func (*OPCEventSubscription) SetMaxSize ¶
func (es *OPCEventSubscription) SetMaxSize(maxSize uint32) (uint32, error)
type OnEventStruct ¶
type OnEventStruct struct { ChangeMask []ChangeMask NewState State Source string Time time.Time Message string EventType uint32 Category uint32 Severity uint32 Condition string Subcond string Quality uint16 Reserved uint16 AckReq bool ActiveTime time.Time Cookie uint32 NumAttrs uint32 Attributes []interface{} ActorID string }