simulated

package
v0.0.0-...-2d02f19 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(_options ...options.WithOption) plc4go.PlcDriver

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(device *Device, tagHandler spi.PlcTagHandler, valueHandler spi.PlcValueHandler, connectionOptions map[string][]string, _options ...options.WithOption) *Connection

func (*Connection) BlockingClose

func (c *Connection) BlockingClose()

func (*Connection) BrowseRequestBuilder

func (c *Connection) BrowseRequestBuilder() apiModel.PlcBrowseRequestBuilder

func (*Connection) Close

func (c *Connection) Close() <-chan plc4go.PlcConnectionCloseResult

func (*Connection) Connect

func (c *Connection) Connect() <-chan plc4go.PlcConnectionConnectResult

func (*Connection) ConnectWithContext

func (c *Connection) ConnectWithContext(_ context.Context) <-chan plc4go.PlcConnectionConnectResult

func (*Connection) GetConnectionId

func (c *Connection) GetConnectionId() string

func (*Connection) GetMetadata

func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata

func (*Connection) GetTracer

func (c *Connection) GetTracer() tracer.Tracer

func (*Connection) IsConnected

func (c *Connection) IsConnected() bool

func (*Connection) IsTraceEnabled

func (c *Connection) IsTraceEnabled() bool

func (*Connection) Ping

func (c *Connection) Ping() <-chan plc4go.PlcConnectionPingResult

func (*Connection) ReadRequestBuilder

func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder

func (*Connection) String

func (c *Connection) String() string

func (*Connection) SubscriptionRequestBuilder

func (c *Connection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder

func (*Connection) UnsubscriptionRequestBuilder

func (c *Connection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder

func (*Connection) WriteRequestBuilder

func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder

type Device

type Device struct {
	Name  string
	State map[simulatedTag]*apiValues.PlcValue
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(name string, _options ...options.WithOption) *Device

func (*Device) Get

func (d *Device) Get(tag simulatedTag) *apiValues.PlcValue

func (*Device) Set

func (d *Device) Set(tag simulatedTag, value *apiValues.PlcValue)

type Driver

type Driver struct {
	_default.DefaultDriver
	// contains filtered or unexported fields
}

func (*Driver) GetConnectionWithContext

func (d *Driver) GetConnectionWithContext(ctx context.Context, _ url.URL, _ map[string]transports.Transport, driverOptions map[string][]string) <-chan plc4go.PlcConnectionConnectResult

func (*Driver) SupportsDiscovery

func (d *Driver) SupportsDiscovery() bool

SupportsDiscovery returns true if this driver supports discovery TODO: Actually the connection could support discovery to list up all tags in the Device

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(device *Device, readerOptions map[string][]string, tracer tracer.Tracer, _options ...options.WithOption) *Reader

func (*Reader) Read

type Subscriber

type Subscriber struct {
	// contains filtered or unexported fields
}

func NewSubscriber

func NewSubscriber(device *Device, options map[string][]string, tracer tracer.Tracer) *Subscriber

func (Subscriber) Subscribe

func (Subscriber) Unregister

func (r Subscriber) Unregister(registration apiModel.PlcConsumerRegistration)

func (Subscriber) Unsubscribe

type Tag

type Tag interface {
	apiModel.PlcTag

	GetTagType() TagType
	GetName() string
	GetDataTypeSize() model.SimulatedDataTypeSizes
}

func NewSimulatedTag

func NewSimulatedTag(tagType TagType, name string, dataTypeSize model.SimulatedDataTypeSizes, quantity uint16) Tag

type TagHandler

type TagHandler struct {
	// contains filtered or unexported fields
}

func NewTagHandler

func NewTagHandler() TagHandler

func (TagHandler) ParseQuery

func (m TagHandler) ParseQuery(query string) (apiModel.PlcQuery, error)

func (TagHandler) ParseTag

func (m TagHandler) ParseTag(tagAddress string) (apiModel.PlcTag, error)

type TagType

type TagType uint8
const (
	TagRandom TagType = iota
	TagState
	TagStdOut
)

func (TagType) Name

func (e TagType) Name() string

type ValueHandler

type ValueHandler struct {
}

func NewValueHandler

func NewValueHandler() ValueHandler

func (ValueHandler) NewPlcValue

func (v ValueHandler) NewPlcValue(tag apiModel.PlcTag, value any) (apiValues.PlcValue, error)

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(device *Device, writerOptions map[string][]string, tracer tracer.Tracer, _options ...options.WithOption) *Writer

func (*Writer) Write

func (w *Writer) Write(_ context.Context, writeRequest apiModel.PlcWriteRequest) <-chan apiModel.PlcWriteRequestResult

Jump to

Keyboard shortcuts

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