opcae

package module
v0.0.0-...-4b008b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPCAE_BROWSE_UP   uint32 = 1
	OPCAE_BROWSE_DOWN        = OPCAE_BROWSE_UP + 1
	OPCAE_BROWSE_TO          = OPCAE_BROWSE_DOWN + 1
)
View Source
const VariantSize = unsafe.Sizeof(com.VARIANT{})

Variables

View Source
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 EventSinkAddRef(this unsafe.Pointer) uintptr

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 EventSinkQueryInterface(this unsafe.Pointer, iid *windows.GUID, punk *unsafe.Pointer) uintptr

func EventSinkRelease

func EventSinkRelease(this unsafe.Pointer) uintptr

func MarshalEventCategoryType

func MarshalEventCategoryType(categories []EventCategoryType) (category uint32)

func MarshalFilter

func MarshalFilter(filters []Filter) (filter uint32)

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 EventAttribute struct {
	ID          uint32
	Description string
	Type        uint16
}

type EventCategory

type EventCategory struct {
	ID          uint32
	Description string
}

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 Filter

type Filter uint32
const (
	OPC_FILTER_BY_EVENT    Filter = 0x1
	OPC_FILTER_BY_CATEGORY Filter = 0x2
	OPC_FILTER_BY_SEVERITY Filter = 0x4
	OPC_FILTER_BY_AREA     Filter = 0x8
	OPC_FILTER_BY_SOURCE   Filter = 0x10
)

func ParseFilter

func ParseFilter(filter uint32) (filters []Filter)

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 ItemID

type ItemID struct {
	ID    string
	Name  string
	CLSID windows.GUID
}

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

type OPCEventServer struct {
	Name string
	Node string
	// contains filtered or unexported fields
}

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

func (v *OPCEventServer) TranslateToItemIDs(source string, eventCategoryID uint32, conditionName string, subConditionName string, assocAttrIDs []uint32) ([]*ItemID, error)

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) GetState

func (es *OPCEventSubscription) GetState() (active bool, bufferTime uint32, maxSize uint32, clientSubscription 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
}

type State

type State uint16
const (
	OPC_CONDITION_ENABLED State = 0x1
	OPC_CONDITION_ACTIVE  State = 0x2
	OPC_CONDITION_ACKED   State = 0x4
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL