Click or drag to resize

TelegramFormatSelectorSelectOutboundTelegramFormat Method

Selects the appropriate TelegramFormat for an outbound telegram value, or null.

Namespace:  Demo3D.HLE.Comms.Telegram
Assembly:  Demo3D.HLE (in Demo3D.HLE.dll) Version: 15.0.2.11458
Syntax
C#
public virtual TelegramFormat? SelectOutboundTelegramFormat(
	IEnumerable<TelegramFormat> formats,
	DataStruct value
)

Parameters

formats
Type: System.Collections.GenericIEnumerableTelegramFormat
Formats to select from.
value
Type: Demo3D.PLC.CommsDataStruct
Outbound value.

Return Value

Type: TelegramFormat
Selected format or null.
Remarks

By default, the method just iterates through the given formats and matches the format name with the ToString method of the value object.

To implement a custom selection algorithm, TelegramFormatSelector can be extended. This allows SelectOutboundTelegramFormat(IEnumerableTelegramFormat, DataStruct) to be overriden with a custom method.

See Also