• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DLMS.GXDLMSSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Gurux.DLMS.GXDLMSSettings的典型用法代码示例。如果您正苦于以下问题:C# GXDLMSSettings类的具体用法?C# GXDLMSSettings怎么用?C# GXDLMSSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GXDLMSSettings类属于Gurux.DLMS命名空间,在下文中一共展示了GXDLMSSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GXDLMSNotify

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="useLogicalNameReferencing">Is Logical or short name referencing used.</param>
 /// <param name="clientAddress">Client address. Default is 0x10</param>
 /// <param name="ServerAddress">Server ID. Default is 1.</param>
 /// <param name="interfaceType">Interface type. Default is general.</param>
 public GXDLMSNotify(bool useLogicalNameReferencing,
     int clientAddress, int serverAddress, InterfaceType interfaceType)
 {
     Settings = new GXDLMSSettings(true);
     Settings.UseLogicalNameReferencing = useLogicalNameReferencing;
     Settings.InterfaceType = interfaceType;
     Settings.ServerAddress = serverAddress;
     Settings.ClientAddress = clientAddress;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:16,代码来源:GXDLMSNotify.cs


示例2: HandleGetRequest

        public static void HandleGetRequest(GXDLMSSettings settings, GXDLMSServer server, GXByteBuffer data, GXByteBuffer replyData, GXDLMSTranslatorStructure xml)
        {
            //Return error if connection is not established.
            if (xml == null && !settings.Connected)
            {
                replyData.Set(GXDLMSServer.GenerateConfirmedServiceError(ConfirmedServiceError.InitiateError,
                              ServiceError.Service, (byte)Service.Unsupported));
                return;
            }

            GetCommandType type = (GetCommandType)data.GetUInt8();
            // Get invoke ID and priority.
            byte invokeID = data.GetUInt8();
            if (xml != null)
            {
                xml.AppendStartTag(Command.GetRequest);
                xml.AppendStartTag(Command.GetRequest, type);
                xml.AppendLine(TranslatorTags.InvokeId, "Value", xml.IntegerToHex(invokeID, 2));
            }

            // GetRequest normal
            if (type == GetCommandType.Normal)
            {
                GetRequestNormal(settings, server, data, replyData, xml);
            }
            else if (type == GetCommandType.NextDataBlock)
            {
                // Get request for next data block
                GetRequestNextDataBlock(settings, server, data, replyData, xml);
            }
            else if (type == GetCommandType.WithList)
            {
                // Get request with a list.
                GetRequestWithList(settings, server, data, replyData, xml);
            }
            else
            {
                Debug.WriteLine("HandleGetRequest failed. Invalid command type.");
                settings.ResetBlockIndex();
                GXByteBuffer bb = new GXByteBuffer();
                // Access Error : Device reports a hardware fault.
                bb.SetUInt8((byte)ErrorCode.HardwareFault);
                GXDLMS.GetLNPdu(new GXDLMSLNParameters(settings, Command.GetResponse, (byte)type, null, bb, (byte)ErrorCode.Ok), replyData);
            }
            if (xml != null)
            {
                xml.AppendEndTag(Command.GetRequest, type);
                xml.AppendEndTag(Command.GetRequest);
            }
        }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:50,代码来源:GXDLMSLNCommandHandlers.cs


示例3: GetInvokeIDPriority

 /// <summary>
 /// Generates Invoke ID and priority.
 /// </summary>
 /// <param name="settings">DLMS settings.</param>
 /// <returns>Invoke ID and priority.</returns>
 static byte GetInvokeIDPriority(GXDLMSSettings settings)
 {
     byte value = 0;
     if (settings.Priority == Priority.High)
     {
         value = 0x80;
     }
     if (settings.ServiceClass == ServiceClass.Confirmed)
     {
         value |= 0x40;
     }
     value |= (byte)(settings.InvokeID & 0xF);
     return value;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:19,代码来源:GXDLMS.cs


示例4: GetLongInvokeIDPriority

 /// <summary>
 /// Generates Invoke ID and priority.
 /// </summary>
 /// <param name="settings">DLMS settings.</param>
 /// <returns>Invoke ID and priority.</returns>
 static UInt32 GetLongInvokeIDPriority(GXDLMSSettings settings)
 {
     UInt32 value = 0;
     if (settings.Priority == Priority.High)
     {
         value = 0x80000000;
     }
     if (settings.ServiceClass == ServiceClass.Confirmed)
     {
         value |= 0x40000000;
     }
     value |= (UInt32)(settings.longInvokeID & 0xFFFFFF);
     ++settings.longInvokeID;
     return value;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:20,代码来源:GXDLMS.cs


示例5: GXByteBuffer

 object IGXDLMSBase.GetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         return this.LogicalName;
     }
     if (e.Index == 2)
     {
         return MBusPortReference;
     }
     if (e.Index == 3)
     {
         GXByteBuffer buff = new GXByteBuffer();
         buff.Add((byte)DataType.Array);
         GXCommon.SetObjectCount(CaptureDefinition.Count, buff);
         foreach (KeyValuePair<string, string> it in CaptureDefinition)
         {
             buff.Add((byte)DataType.Structure);
             buff.Add(2);
             GXCommon.SetData(settings, buff, DataType.UInt8, it.Key);
             GXCommon.SetData(settings, buff, DataType.OctetString, ASCIIEncoding.ASCII.GetBytes(it.Value));
         }
         return buff.Array();
     }
     if (e.Index == 4)
     {
         return CapturePeriod;
     }
     if (e.Index == 5)
     {
         return PrimaryAddress;
     }
     if (e.Index == 6)
     {
         return IdentificationNumber;
     }
     if (e.Index == 7)
     {
         return ManufacturerID;
     }
     if (e.Index == 8)
     {
         return DataHeaderVersion;
     }
     if (e.Index == 9)
     {
         return DeviceType;
     }
     if (e.Index == 10)
     {
         return AccessNumber;
     }
     if (e.Index == 11)
     {
         return Status;
     }
     if (e.Index == 12)
     {
         return Alarm;
     }
     if (Version > 0)
     {
         if (e.Index == 13)
         {
             return Configuration;
         }
         if (e.Index == 14)
         {
             return EncryptionKeyStatus;
         }
     }
     e.Error = ErrorCode.ReadWriteDenied;
     return null;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:74,代码来源:GXDLMSMBusClient.cs


示例6: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         if (e.Value is string)
         {
             PHYReference = e.Value.ToString();
         }
         else
         {
             PHYReference = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 3)
     {
         List<GXDLMSPppSetupLcpOption> items = new List<GXDLMSPppSetupLcpOption>();
         if (e.Value is Object[])
         {
             foreach (Object[] item in (Object[])e.Value)
             {
                 GXDLMSPppSetupLcpOption it = new GXDLMSPppSetupLcpOption();
                 it.Type = (PppSetupLcpOptionType)Convert.ToByte(item[0]);
                 it.Length = Convert.ToByte(item[1]);
                 it.Data = item[2];
                 items.Add(it);
             }
         }
         LCPOptions = items.ToArray();
     }
     else if (e.Index == 4)
     {
         List<GXDLMSPppSetupIPCPOption> items = new List<GXDLMSPppSetupIPCPOption>();
         if (e.Value is Object[])
         {
             foreach (Object[] item in (Object[])e.Value)
             {
                 GXDLMSPppSetupIPCPOption it = new GXDLMSPppSetupIPCPOption();
                 it.Type = (PppSetupIPCPOptionType)Convert.ToByte(item[0]);
                 it.Length = Convert.ToByte(item[1]);
                 it.Data = item[2];
                 items.Add(it);
             }
         }
         IPCPOptions = items.ToArray();
     }
     else if (e.Index == 5)
     {
         UserName = (byte[])((Object[])e.Value)[0];
         Password = (byte[])((Object[])e.Value)[1];
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:66,代码来源:GXDLMSPppSetup.cs


示例7: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         PlcInactivityTimeout = (byte)e.Value;
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:22,代码来源:GXDLMSIEC14908PhysicalSetup.cs


示例8: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         if (Scaler != 1)
         {
             try
             {
                 CurrentAverageValue = Convert.ToDouble(e.Value) * Scaler;
             }
             catch (Exception)
             {
                 //Sometimes scaler is set for wrong Object type.
                 CurrentAverageValue = e.Value;
             }
         }
         else
         {
             CurrentAverageValue = e.Value;
         }
     }
     else if (e.Index == 3)
     {
         if (Scaler != 1)
         {
             try
             {
                 LastAverageValue = Convert.ToDouble(e.Value) * Scaler;
             }
             catch (Exception)
             {
                 //Sometimes scaler is set for wrong Object type.
                 LastAverageValue = e.Value;
             }
         }
         else
         {
             LastAverageValue = e.Value;
         }
     }
     else if (e.Index == 4)
     {
         if (e.Value == null)
         {
             Scaler = 1;
             Unit = Unit.None;
         }
         else
         {
             object[] arr = (object[])e.Value;
             if (arr.Length != 2)
             {
                 throw new Exception("setValue failed. Invalid scaler unit value.");
             }
             _scaler = Convert.ToInt32(arr[0]);
             Unit = (Unit)Convert.ToInt32(arr[1]);
         }
     }
     else if (e.Index == 5)
     {
         Status = Convert.ToInt32(e.Value);
     }
     else if (e.Index == 6)
     {
         if (e.Value == null)
         {
             CaptureTime = new GXDateTime(DateTime.MinValue);
         }
         else
         {
             if (e.Value is byte[])
             {
                 e.Value = GXDLMSClient.ChangeType((byte[])e.Value, DataType.DateTime);
             }
             CaptureTime = (GXDateTime)e.Value;
         }
     }
     else if (e.Index == 7)
     {
         if (e.Value == null)
         {
             StartTimeCurrent = new GXDateTime(DateTime.MinValue);
         }
         else
         {
             if (e.Value is byte[])
             {
                 e.Value = GXDLMSClient.ChangeType((byte[])e.Value, DataType.DateTime);
             }
//.........这里部分代码省略.........
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:101,代码来源:GXDLMSDemandRegister.cs


示例9: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         Mode = (AutoConnectMode)Convert.ToInt32(e.Value);
     }
     else if (e.Index == 3)
     {
         Repetitions = Convert.ToInt32(e.Value);
     }
     else if (e.Index == 4)
     {
         RepetitionDelay = Convert.ToInt32(e.Value);
     }
     else if (e.Index == 5)
     {
         CallingWindow.Clear();
         if (e.Value != null)
         {
             foreach (Object[] item in (Object[])e.Value)
             {
                 GXDateTime start = (GXDateTime)GXDLMSClient.ChangeType((byte[])item[0], DataType.DateTime);
                 GXDateTime end = (GXDateTime)GXDLMSClient.ChangeType((byte[])item[1], DataType.DateTime);
                 CallingWindow.Add(new KeyValuePair<GXDateTime, GXDateTime>(start, end));
             }
         }
     }
     else if (e.Index == 6)
     {
         Destinations = null;
         if (e.Value != null)
         {
             List<string> items = new List<string>();
             foreach (byte[] item in (object[])e.Value)
             {
                 string it = GXDLMSClient.ChangeType(item, DataType.String).ToString();
                 items.Add(it);
             }
             Destinations = items.ToArray();
         }
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:57,代码来源:GXDLMSAutoConnect.cs


示例10: GXByteBuffer

 object IGXDLMSBase.GetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         return this.LogicalName;
     }
     if (e.Index == 2)
     {
         return Value;
     }
     if (e.Index == 3)
     {
         GXByteBuffer data = new GXByteBuffer();
         data.SetUInt8((byte)DataType.Structure);
         data.SetUInt8(2);
         GXCommon.SetData(settings, data, DataType.Int8, scaler);
         GXCommon.SetData(settings, data, DataType.Enum, Unit);
         return data.Array();
     }
     e.Error = ErrorCode.ReadWriteDenied;
     return null;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:22,代码来源:GXDLMSRegister.cs


示例11: GXByteBuffer

 object IGXDLMSBase.GetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         return this.LogicalName;
     }
     if (e.Index == 2)
     {
         int cnt = 0;
         if (SapAssignmentList != null)
         {
             cnt = SapAssignmentList.Count;
         }
         GXByteBuffer data = new GXByteBuffer();
         data.SetUInt8((byte)DataType.Array);
         //Add count
         GXCommon.SetObjectCount(cnt, data);
         if (cnt != 0)
         {
             foreach (var it in SapAssignmentList)
             {
                 data.SetUInt8((byte)DataType.Structure);
                 data.SetUInt8((byte)2); //Count
                 GXCommon.SetData(settings, data, DataType.UInt16, it.Key);
                 GXCommon.SetData(settings, data, DataType.OctetString, ASCIIEncoding.ASCII.GetBytes(it.Value));
             }
         }
         return data.Array();
     }
     e.Error = ErrorCode.ReadWriteDenied;
     return null;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:32,代码来源:GXDLMSSapAssignment.cs


示例12: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         SecurityPolicy = (SecurityPolicy)Convert.ToInt32(e.Value);
     }
     else if (e.Index == 3)
     {
         SecuritySuite = (SecuritySuite)Convert.ToInt32(e.Value);
     }
     else if (e.Index == 4)
     {
         ClientSystemTitle = (byte[])e.Value;
     }
     else if (e.Index == 5)
     {
         ServerSystemTitle = (byte[])e.Value;
     }
     else if (e.Index == 6)
     {
         UpdateSertificates((object[])e.Value);
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:38,代码来源:GXDLMSSecuritySetup.cs


示例13: AddData

 /// <summary>
 /// Add value of COSEM object to byte buffer.
 /// </summary>
 /// <param name="obj">COSEM object.</param>
 /// <param name="index">Attribute index.</param>
 /// <param name="buff">Byte buffer.</param>
 /// <remarks>
 /// AddData method can be used with GetDataNotificationMessage -method.
 /// DLMS spesification do not specify the structure of Data-Notification body.
 /// So each manufacture can sent different data.
 /// </remarks>
 /// <seealso cref="GetDataNotificationMessages"/>
 internal static void AddData(GXDLMSSettings settings, GXDLMSObject obj, int index, GXByteBuffer buff)
 {
     DataType dt;
     object value = (obj as IGXDLMSBase).GetValue(settings, new ValueEventArgs(settings, obj, index, 0, null));
     dt = obj.GetDataType(index);
     if (dt == DataType.None && value != null)
     {
         dt = GXCommon.GetValueType(value);
     }
     GXCommon.SetData(settings, buff, dt, value);
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:23,代码来源:GXDLMSNotify.cs


示例14: GetSertificates

 object IGXDLMSBase.GetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         return this.LogicalName;
     }
     if (e.Index == 2)
     {
         return SecurityPolicy;
     }
     if (e.Index == 3)
     {
         return SecuritySuite;
     }
     if (this.Version > 0)
     {
         if (e.Index == 4)
         {
             return ClientSystemTitle;
         }
         if (e.Index == 5)
         {
             return ServerSystemTitle;
         }
         if (e.Index == 6)
         {
             return GetSertificates();
         }
     }
     e.Error = ErrorCode.ReadWriteDenied;
     return null;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:32,代码来源:GXDLMSSecuritySetup.cs


示例15: foreach

 byte[] IGXDLMSBase.Invoke(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 2)
     {
         foreach (object tmp in e.Parameters as object[])
         {
             object[] item = tmp as object[];
             GlobalKeyType type = (GlobalKeyType)Convert.ToInt32(item[0]);
             byte[] data = (byte[])item[1];
             switch (type)
             {
                 case GlobalKeyType.UnicastEncryption:
                 case GlobalKeyType.BroadcastEncryption:
                     //Invalid type
                     e.Error = ErrorCode.ReadWriteDenied;
                     break;
                 case GlobalKeyType.Authentication:
                     //if settings.Cipher is null non secure server is used.
                     settings.Cipher.AuthenticationKey = GXDLMSSecureClient.Decrypt(settings.Kek, data);
                     break;
                 case GlobalKeyType.Kek:
                     settings.Kek = GXDLMSSecureClient.Decrypt(settings.Kek, data);
                     break;
                 default:
                     //Invalid type
                     e.Error = ErrorCode.ReadWriteDenied;
                     break;
             }
         }
         //Return standard reply.
         return null;
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
         return null;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:38,代码来源:GXDLMSSecuritySetup.cs


示例16: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         SapAssignmentList.Clear();
         if (e.Value != null)
         {
             foreach (Object[] item in (Object[])e.Value)
             {
                 string str;
                 if (item[1] is byte[])
                 {
                     str = GXDLMSClient.ChangeType((byte[])item[1], DataType.String).ToString();
                 }
                 else
                 {
                     str = Convert.ToString(item[1]);
                 }
                 SapAssignmentList.Add(new KeyValuePair<UInt16, string>(Convert.ToUInt16(item[0]), str));
             }
         }
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:38,代码来源:GXDLMSSapAssignment.cs


示例17: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         if (e.Value is string)
         {
             MBusPortReference = e.Value.ToString();
         }
         else
         {
             MBusPortReference = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 3)
     {
         CaptureDefinition.Clear();
         if (e.Value != null)
         {
             foreach (object[] it in (object[])e.Value)
             {
                 CaptureDefinition.Add(new KeyValuePair<string, string>(GXDLMSClient.ChangeType((byte[])it[0], DataType.OctetString).ToString(),
                                       GXDLMSClient.ChangeType((byte[])it[1], DataType.OctetString).ToString()));
             }
         }
     }
     else if (e.Index == 4)
     {
         CapturePeriod = Convert.ToUInt32(e.Value);
     }
     else if (e.Index == 5)
     {
         PrimaryAddress = Convert.ToByte(e.Value);
     }
     else if (e.Index == 6)
     {
         IdentificationNumber = Convert.ToUInt32(e.Value);
     }
     else if (e.Index == 7)
     {
         ManufacturerID = Convert.ToUInt16(e.Value);
     }
     else if (e.Index == 8)
     {
         DataHeaderVersion = Convert.ToByte(e.Value);
     }
     else if (e.Index == 9)
     {
         DeviceType = Convert.ToByte(e.Value);
     }
     else if (e.Index == 10)
     {
         AccessNumber = Convert.ToByte(e.Value);
     }
     else if (e.Index == 11)
     {
         Status = Convert.ToByte(e.Value);
     }
     else if (e.Index == 12)
     {
         Alarm = Convert.ToByte(e.Value);
     }
     else if (Version > 0)
     {
         if (e.Index == 13)
         {
             Configuration = Convert.ToUInt16(e.Value);
         }
         else if (e.Index == 14)
         {
             EncryptionKeyStatus = (MBusEncryptionKeyStatus)Convert.ToInt32(e.Value);
         }
         else
         {
             e.Error = ErrorCode.ReadWriteDenied;
         }
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:92,代码来源:GXDLMSMBusClient.cs


示例18: ValueEventArgs

 /// <summary>
 /// Constructor.
 /// </summary>
 public ValueEventArgs(GXDLMSSettings settings, GXDLMSObject target, int index, int selector, object parameters)
 {
     Settings = settings;
     Target = target;
     Index = index;
     Selector = selector;
     Parameters = parameters;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:11,代码来源:ValueEventArgs.cs


示例19:

 byte[] IGXDLMSBase.Invoke(GXDLMSSettings settings, ValueEventArgs e)
 {
     // Resets the value to the default value.
     // The default value is an instance specific constant.
     if (e.Index == 1)
     {
         Value = null;
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
     return null;
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:14,代码来源:GXDLMSRegister.cs


示例20: if

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         if (e.Value is string)
         {
             LogicalName = e.Value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])e.Value, DataType.OctetString).ToString();
         }
     }
     else if (e.Index == 2)
     {
         Mode = (IecTwistedPairSetupMode)e.Value;
     }
     else if (e.Index == 3)
     {
         Speed = (BaudRate)e.Value;
     }
     else if (e.Index == 4)
     {
         GXByteBuffer list = new GXByteBuffer();
         foreach (object it in (object[])e.Value)
         {
             list.Add((byte)it);
         }
         PrimaryAddresses = list.Array();
     }
     else if (e.Index == 5)
     {
         List<sbyte> list = new List<sbyte>();
         foreach (object it in (object[])e.Value)
         {
             list.Add((sbyte)it);
         }
         Tabis = list.ToArray();
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:44,代码来源:GXDLMSIecTwistedPairSetup.cs



注:本文中的Gurux.DLMS.GXDLMSSettings类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Control.Base类代码示例发布时间:2022-05-26
下一篇:
C# Generation.GenerationInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap