Esempio n. 1
0
        /// <summary>
        /// Add a new Connected Access Point to a Subnetwork.
        /// </summary>
        /// <param name="ied">
        /// A <see cref="tIED"/> object with the IED to connect to this subnetwork.
        /// </param>
        /// <param name="ap">
        /// A <see cref="System.Int32"/> with the index of the Access Point in the IED to connect to
        /// this subnetwork.
        /// </param>
        /// <param name="addr">
        /// A <see cref="tAddress"/> object to set Connected Access Point's address of the IED to
        /// connect to this network.
        /// </param>
        /// <param name="desc">
        /// A <see cref="System.String"/> with the description of the new Connected Access Point.
        /// </param>
        /// <returns>
        /// A <see cref="System.Int32"/>, with the index of Connected Access Point added, -1 on error.
        /// </returns>
        public int AddConnectedAP(tIED ied, int apIndex, tAddress addr, string desc)
        {
            if (ied == null || addr == null || apIndex < 0 || apIndex > ied.AccessPoint.GetLength(0))
            {
                return(-1);
            }

            tConnectedAP ap = new tConnectedAP();

            ap.Address = addr;
            ap.desc    = desc;
            ap.iedName = ied.name;
            ap.apName  = ied.AccessPoint[apIndex].name;

            if (this.connectedAPField == null)
            {
                this.connectedAPField    = new tConnectedAP[1];
                this.connectedAPField[0] = ap;
                return(0);
            }
            return(this.AddConnectedAP(ap));
        }
Esempio n. 2
0
 public tConnectedAP(tIED ied, int ap, tAddress addr)
 {
     this.iedNameField = ied.name;
     this.apName       = ied.AccessPoint[ap].name;
     this.addressField = addr;
 }