Example #1
0
        /// <summary>
        /// 对象解析为Xml元素,方便的存储
        /// </summary>
        /// <returns>包含节点信息的Xml元素</returns>
        public override XElement ToXmlElement( )
        {
            XElement element = base.ToXmlElement( );

            element.SetAttributeValue("IpAddress", IpAddress);
            element.SetAttributeValue("Port", Port.ToString( ));
            element.SetAttributeValue("SA1", SA1.ToString( ));
            element.SetAttributeValue("DA1", DA1.ToString( ));
            element.SetAttributeValue("DA2", DA2.ToString( ));
            return(element);
        }
Example #2
0
        /// <summary>
        /// 获取用于在数据表信息中显示的键值数据对信息
        /// </summary>
        /// <returns>键值数据对列表</returns>
        public override List <NodeClassRenderItem> GetNodeClassRenders( )
        {
            var list = base.GetNodeClassRenders( );

            list.Add(NodeClassRenderItem.CreateIpAddress(IpAddress));
            list.Add(NodeClassRenderItem.CreateIpPort(Port));
            list.Add(new NodeClassRenderItem("上位机节点号", SA1.ToString( )));
            list.Add(new NodeClassRenderItem("PLC节点号", DA1.ToString( )));
            list.Add(new NodeClassRenderItem("PLC单元号", DA2.ToString( )));

            return(list);
        }