C# Класс Gurux.DLMS.GXDLMSTranslator

This class is used to translate DLMS frame or PDU to xml.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
AddTag void
ErrorCodeToString String
GetAllDataNodes void
GetCommand void
GetFloat32 void
GetFloat64 void
GetFrame bool
GetOctetString void
GetTags void
GetUa void
GetValue string
HandleAarqAare void
HexToBytes byte[]
PduToXml string
ReadAllNodes void
ReadNode void
ToHex string
ToHex string
ToHex string
UpdateDataType GXByteBuffer
UpdateDateTime GXByteBuffer
ValueOfConformance Conformance
ValueOfErrorCode ErrorCode

Открытые методы

Метод Описание
FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu ) : bool

Find next frame from the string.

Position of data is set to the begin of new frame. If Pdu is null it is not updated.

FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu, InterfaceType type ) : bool

Find next frame from the string.

Position of data is set to the begin of new frame. If Pdu is null it is not updated.

GXDLMSTranslator ( TranslatorOutputType type ) : System

Constructor.

GetDlmsFraming ( GXByteBuffer value ) : InterfaceType

Identify used DLMS framing type.

GetPdu ( GXByteBuffer value ) : byte[]
GetPdu ( byte value ) : byte[]
MessageToXml ( GXByteBuffer value ) : string

Convert message to xml.

MessageToXml ( byte value ) : string

Convert message to xml.

PduToXml ( GXByteBuffer value ) : string

Convert bytes to xml.

PduToXml ( byte value ) : string

Convert bytes to xml.

PduToXml ( string hex ) : string

Convert hex string to xml.

XmlToData ( string xml ) : byte[]

Convert XML data fo bytes.

XmlToHexPdu ( string xml ) : string

Convert xml to hex string.

XmlToPdu ( string xml ) : byte[]

Convert xml to byte array.

Приватные методы

Метод Описание
AddTag ( string>.SortedList list, Enum value, string text ) : void
ErrorCodeToString ( TranslatorOutputType type, ErrorCode value ) : String
GetAllDataNodes ( XmlNodeList nodes, GXDLMSXmlSettings s ) : void
GetCommand ( XmlNode node, GXDLMSXmlSettings s, int tag ) : void

Get command from XML.

GetFloat32 ( XmlNode node, GXDLMSXmlSettings s ) : void
GetFloat64 ( XmlNode node, GXDLMSXmlSettings s ) : void
GetFrame ( XmlNode node, GXDLMSXmlSettings s, int tag ) : bool
GetOctetString ( XmlNode node, GXDLMSXmlSettings s ) : void
GetTags ( TranslatorOutputType type, string>.SortedList list, int>.SortedList tagsByName ) : void

Get all tags.

GetUa ( GXByteBuffer data, GXDLMSTranslatorStructure xml ) : void
GetValue ( XmlNode node, GXDLMSXmlSettings s ) : string
HandleAarqAare ( XmlNode node, GXDLMSXmlSettings s, int tag ) : void

Handle AARE and AARQ XML tags.

HexToBytes ( string value ) : byte[]
PduToXml ( GXByteBuffer value, bool omitDeclaration, bool omitNameSpace ) : string
ReadAllNodes ( XmlDocument doc, GXDLMSXmlSettings s ) : void
ReadNode ( XmlNode node, GXDLMSXmlSettings s ) : void
ToHex ( byte bytes ) : string
ToHex ( byte bytes, bool addSpace ) : string
ToHex ( byte bytes, bool addSpace, int index, int count ) : string
UpdateDataType ( XmlNode node, GXDLMSXmlSettings s, int tag ) : GXByteBuffer
UpdateDateTime ( XmlNode node, GXDLMSXmlSettings s, GXByteBuffer preData ) : GXByteBuffer
ValueOfConformance ( string value ) : Conformance
ValueOfErrorCode ( TranslatorOutputType type, String value ) : ErrorCode

Описание методов

FindNextFrame() публичный Метод

Find next frame from the string.
Position of data is set to the begin of new frame. If Pdu is null it is not updated.
public FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu ) : bool
data GXByteBuffer Data where frame is search.
pdu GXByteBuffer Pdu of received frame is set here.
Результат bool

FindNextFrame() публичный Метод

Find next frame from the string.
Position of data is set to the begin of new frame. If Pdu is null it is not updated.
public FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu, InterfaceType type ) : bool
data GXByteBuffer Data where frame is search.
pdu GXByteBuffer Pdu of received frame is set here.
type InterfaceType
Результат bool

GXDLMSTranslator() публичный Метод

Constructor.
public GXDLMSTranslator ( TranslatorOutputType type ) : System
type TranslatorOutputType Translator output type.
Результат System

GetDlmsFraming() публичный статический Метод

Identify used DLMS framing type.
public static GetDlmsFraming ( GXByteBuffer value ) : InterfaceType
value GXByteBuffer Input data.
Результат InterfaceType

GetPdu() публичный Метод

public GetPdu ( GXByteBuffer value ) : byte[]
value GXByteBuffer
Результат byte[]

GetPdu() публичный Метод

public GetPdu ( byte value ) : byte[]
value byte
Результат byte[]

MessageToXml() публичный Метод

Convert message to xml.
public MessageToXml ( GXByteBuffer value ) : string
value GXByteBuffer Bytes to convert.
Результат string

MessageToXml() публичный Метод

Convert message to xml.
public MessageToXml ( byte value ) : string
value byte Bytes to convert.
Результат string

PduToXml() публичный Метод

Convert bytes to xml.
public PduToXml ( GXByteBuffer value ) : string
value GXByteBuffer Bytes to convert.
Результат string

PduToXml() публичный Метод

Convert bytes to xml.
public PduToXml ( byte value ) : string
value byte Bytes to convert.
Результат string

PduToXml() публичный Метод

Convert hex string to xml.
public PduToXml ( string hex ) : string
hex string Converted hex string.
Результат string

XmlToData() публичный Метод

Convert XML data fo bytes.
public XmlToData ( string xml ) : byte[]
xml string XML data.
Результат byte[]

XmlToHexPdu() публичный Метод

Convert xml to hex string.
public XmlToHexPdu ( string xml ) : string
xml string
Результат string

XmlToPdu() публичный Метод

Convert xml to byte array.
public XmlToPdu ( string xml ) : byte[]
xml string Converted xml.
Результат byte[]