/// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";
            var id  = 0;

            ret += "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine;
            ret += "<Document>" + Environment.NewLine;
            ret += "<SW.PlcTagTable ID=\"" + id++ + "\">" + Environment.NewLine;
            ret += "<AttributeList>" + Environment.NewLine;
            ret += "<Name>" + AdjustNames.AdjustXmlStrings(Name) + "</Name>" + Environment.NewLine;
            ret += "</AttributeList>" + Environment.NewLine;
            ret += "<ObjectList>" + Environment.NewLine;
            foreach (var constant in _constants)
            {
                ret += constant.ToString(ref id);
            }
            foreach (var tag in _tags)
            {
                ret += tag.ToString(ref id);
            }
            ret += "</ObjectList>" + Environment.NewLine;
            ret += "</SW.PlcTagTable>" + Environment.NewLine;
            ret += "</Document>" + Environment.NewLine;

            return(ret);
        }
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";

            var id = 0;

            ret += "<Member Name=\"" + AdjustNames.AdjustXmlStrings(MemberName) + "\" Datatype=\"" + AdjustNames.AdjustXmlStrings(MemberDatatype) + "\">" + Environment.NewLine;
            if (MemberComment.CompositionNameInXml != null)
            {
                ret += MemberComment.ToString(ref id);
            }

            ret += "<Sections>" + Environment.NewLine;
            foreach (var section in InterfaceSections)
            {
                ret += "<Section name=\"" + InterfaceSections[0].InterfaceSectionName + "\">" + Environment.NewLine;
                foreach (var member in section.InterfaceMember)
                {
                    ret += member.ToString();
                }
                ret += "</Section>" + Environment.NewLine;
            }
            ret += "</Sections>" + Environment.NewLine;

            if (!string.IsNullOrEmpty(MemberDefaultValue))
            {
                ret += "<StartValue>" + AdjustNames.AdjustXmlStrings(MemberDefaultValue) + "</StartValue>" + Environment.NewLine;
            }
            ret += "</Member>" + Environment.NewLine;

            return(ret);
        }
Exemple #3
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public string ToString(ref int id)
        {
            var ret = "";

            if (CompositionNameInXml != null)
            {
                if (CompositionNameInXml.Equals(""))
                {
                    ret += "<Comment>" + Environment.NewLine;
                    foreach (var entry in MultiLanguageTextItems)
                    {
                        ret += "<MultiLanguageText Lang=\"" + AdjustNames.AdjustXmlStrings(entry.Key) + "\">" + AdjustNames.AdjustXmlStrings(entry.Value) + "</MultiLanguageText>" + Environment.NewLine;
                    }
                    ret += "</Comment>" + Environment.NewLine;
                }

                else if (CompositionNameInXml.Equals("Comment") || CompositionNameInXml.Equals("Title"))
                {
                    ret += "<MultilingualText ID= \"" + id++ + "\"" + " CompositionName=\"" + AdjustNames.AdjustXmlStrings(CompositionNameInXml) + "\">" + Environment.NewLine;
                    ret += "<AttributeList>" + Environment.NewLine;
                    ret += "<TextItems>" + Environment.NewLine;

                    foreach (var entry in MultiLanguageTextItems)
                    {
                        ret += "<Value lang=\"" + AdjustNames.AdjustXmlStrings(entry.Key) + "\">" + AdjustNames.AdjustXmlStrings(entry.Value) + "</Value>" + Environment.NewLine;
                    }

                    ret += "</TextItems>" + Environment.NewLine;
                    ret += "</AttributeList>" + Environment.NewLine;
                    ret += "</MultilingualText>" + Environment.NewLine;
                }
            }

            return(ret);
        }
Exemple #4
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";
            var id  = 0;

            ret += "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine;
            ret += "<Document>" + Environment.NewLine;
            ret += "<SW.PlcType ID=\"" + id++ + "\">" + Environment.NewLine;
            ret += "<AttributeList>" + Environment.NewLine;
            ret += "<Interface>" + Environment.NewLine;
            ret += "<Sections xmlns=\"http://www.siemens.com/automation/Openness/SW/Interface/v1\">" + Environment.NewLine;
            ret += "<Section Name=\"None\">" + Environment.NewLine;
            foreach (var member in DatatypeMember)
            {
                ret += member + Environment.NewLine;
            }
            ret += "</Section>" + Environment.NewLine;
            ret += "</Sections>" + Environment.NewLine;
            ret += "</Interface>" + Environment.NewLine;
            ret += "<Name>" + AdjustNames.AdjustXmlStrings(Name) + "</Name>" + Environment.NewLine;
            ret += "</AttributeList>" + Environment.NewLine;

            ret += "<ObjectList>" + Environment.NewLine;
            ret += UdtComment.ToString(ref id) + Environment.NewLine;
            ret += UdtTitle.ToString(ref id) + Environment.NewLine;
            ret += "</ObjectList>" + Environment.NewLine;

            ret += "</SW.PlcType>" + Environment.NewLine;
            ret += "</Document>";

            return(ret);
        }
Exemple #5
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";

            ret += "<Section Name=\"" + AdjustNames.AdjustXmlStrings(InterfaceSectionName) + "\">" + Environment.NewLine;
            foreach (var member in InterfaceMember)
            {
                ret += member.ToString();
            }
            ret += "</Section>" + Environment.NewLine;

            return(ret);
        }
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";
            var id  = 0;

            ret += "<Member Name=\"" + AdjustNames.AdjustXmlStrings(MemberName) + "\" Datatype=\"" + AdjustNames.AdjustXmlStrings(MemberDatatype) + "\">" + Environment.NewLine;
            if (MemberComment.CompositionNameInXml != null)
            {
                ret += MemberComment.ToString(ref id);
            }
            foreach (var member in NestedMembers)
            {
                ret += member.ToString();
            }
            ret += "</Member>" + Environment.NewLine;

            return(ret);
        }
Exemple #7
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";
            var id  = 0;

            ret += "<Member Name=\"" + AdjustNames.AdjustXmlStrings(MemberName) + "\" Datatype=\"" + AdjustNames.AdjustXmlStrings(MemberDatatype) + "\">" + Environment.NewLine;
            if (MemberComment.CompositionNameInXml != null)
            {
                ret += MemberComment.ToString(ref id);
            }
            if (!string.IsNullOrEmpty(MemberDefaultValue))
            {
                ret += "<StartValue>" + AdjustNames.AdjustXmlStrings(MemberDefaultValue) + "</StartValue>" + Environment.NewLine;
            }
            ret += "</Member>" + Environment.NewLine;

            return(ret);
        }
Exemple #8
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public string ToString(ref int id)
        {
            var ret = "";

            ret += "<SW.ControllerConstant ID=\"" + id++ + "\" CompositionName=\"Constants\">" + Environment.NewLine;
            ret += "<AttributeList>" + Environment.NewLine;
            ret += "<Name>" + AdjustNames.AdjustXmlStrings(MemberName) + "</Name>" + Environment.NewLine;
            ret += "<Value>" + AdjustNames.AdjustXmlStrings(ConstantValue) + "</Value>" + Environment.NewLine;
            ret += "</AttributeList>" + Environment.NewLine;
            ret += "<LinkList>" + Environment.NewLine;
            ret += "<DataType TargetID=\"@OpenLink\">" + Environment.NewLine;
            ret += "<Name>" + AdjustNames.AdjustXmlStrings(MemberDatatype) + "</Name>" + Environment.NewLine;
            ret += "</DataType>" + Environment.NewLine;
            ret += "</LinkList>" + Environment.NewLine;
            ret += "<ObjectList>" + Environment.NewLine;
            ret += MemberComment.ToString(ref id);
            ret += "</ObjectList>" + Environment.NewLine;
            ret += "</SW.ControllerConstant>" + Environment.NewLine;

            return(ret);
        }
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        /// TODO Edit XML Comment Template for ToString
        public override string ToString()
        {
            var ret = "";
            var id  = 0;

            ret += "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine;
            ret += "<Document>" + Environment.NewLine;
            ret += "<SW.DataBlock ID=\"" + id++ + "\">" + Environment.NewLine;
            ret += "<AttributeList>" + Environment.NewLine;
            ret += "<AutoNumber>" + AdjustNames.AdjustXmlStrings(BlockAutoNumber) + "</AutoNumber>" + Environment.NewLine;
            ret += "<DownloadWithoutReinit>" + AdjustNames.AdjustXmlStrings(DownloadWithoutReinit) + "</DownloadWithoutReinit>" + Environment.NewLine;
            ret += "<DatablockType>" + AdjustNames.AdjustXmlStrings(DbType.ToString()) + "</DatablockType>" + Environment.NewLine;
            ret += "<HeaderAuthor>" + AdjustNames.AdjustXmlStrings(BlockAuthor) + "</HeaderAuthor>" + Environment.NewLine;
            ret += "<HeaderFamily>" + AdjustNames.AdjustXmlStrings(BlockFamily) + "</HeaderFamily>" + Environment.NewLine;
            ret += "<HeaderName>" + AdjustNames.AdjustXmlStrings(BlockUserId) + "</HeaderName>" + Environment.NewLine;
            ret += "<HeaderVersion>" + AdjustNames.AdjustXmlStrings(BlockVersion) + "</HeaderVersion>" + Environment.NewLine;
            ret += "<InstanceOfName>" + AdjustNames.AdjustXmlStrings(InstanceOfName) + "</InstanceOfName>" + Environment.NewLine;
            ret += BlockInterface.ToString();
            ret += "<IsOnlyStoredInLoadMemory>" + AdjustNames.AdjustXmlStrings(IsOnlyStoredInLoadMemory) + "</IsOnlyStoredInLoadMemory>" + Environment.NewLine;
            ret += "<IsRetainMemResEnabled>" + AdjustNames.AdjustXmlStrings(IsRetainMemResEnabled) + "</IsRetainMemResEnabled>" + Environment.NewLine;
            ret += "<IsWriteProtectedInAS>" + AdjustNames.AdjustXmlStrings(IsWriteProtectedInAs) + "</IsWriteProtectedInAS>" + Environment.NewLine;
            ret += "<MemoryLayout>" + AdjustNames.AdjustXmlStrings(BlockMemoryLayout) + "</MemoryLayout>" + Environment.NewLine;
            ret += "<MemoryReserve>" + AdjustNames.AdjustXmlStrings(MemoryReserve) + "</MemoryReserve>" + Environment.NewLine;
            ret += "<Name>" + AdjustNames.AdjustXmlStrings(Name) + "</Name>" + Environment.NewLine;
            ret += "<Number>" + BlockNumber + "</Number>" + Environment.NewLine;
            ret += "<ProgrammingLanguage>DB</ProgrammingLanguage>" + Environment.NewLine;
            ret += "<Type>DB</Type>" + Environment.NewLine;
            ret += "</AttributeList>" + Environment.NewLine;
            ret += "<ObjectList>" + Environment.NewLine;
            ret += BlockComment.ToString(ref id);
            ret += BlockTitle.ToString(ref id);
            ret += "</ObjectList>" + Environment.NewLine;
            ret += "</SW.DataBlock>" + Environment.NewLine;
            ret += "</Document>" + Environment.NewLine;
            return(ret);
        }