/// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(ElectronicEmissionSystemData obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            if (this._systemDataLength != obj._systemDataLength)
            {
                ivarsEqual = false;
            }

            if (this._numberOfBeams != obj._numberOfBeams)
            {
                ivarsEqual = false;
            }

            if (this._emissionsPadding2 != obj._emissionsPadding2)
            {
                ivarsEqual = false;
            }

            if (!this._emitterSystem.Equals(obj._emitterSystem))
            {
                ivarsEqual = false;
            }

            if (!this._location.Equals(obj._location))
            {
                ivarsEqual = false;
            }

            if (this._beamDataRecords.Count != obj._beamDataRecords.Count)
            {
                ivarsEqual = false;
            }

            if (ivarsEqual)
            {
                for (int idx = 0; idx < this._beamDataRecords.Count; idx++)
                {
                    if (!this._beamDataRecords[idx].Equals(obj._beamDataRecords[idx]))
                    {
                        ivarsEqual = false;
                    }
                }
            }

            return(ivarsEqual);
        }
Пример #2
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._emittingEntityID.GetMarshalledSize(); // this._emittingEntityID
            marshalSize += this._eventID.GetMarshalledSize();          // this._eventID
            marshalSize += 1;                                          // this._stateUpdateIndicator
            marshalSize += 1;                                          // this._numberOfSystems
            marshalSize += 2;                                          // this._paddingForEmissionsPdu
            for (int idx = 0; idx < this._systems.Count; idx++)
            {
                ElectronicEmissionSystemData listElement = (ElectronicEmissionSystemData)this._systems[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Пример #3
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<ElectronicEmissionsPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<emittingEntityID>");
                this._emittingEntityID.Reflection(sb);
                sb.AppendLine("</emittingEntityID>");
                sb.AppendLine("<eventID>");
                this._eventID.Reflection(sb);
                sb.AppendLine("</eventID>");
                sb.AppendLine("<stateUpdateIndicator type=\"byte\">" + this._stateUpdateIndicator.ToString(CultureInfo.InvariantCulture) + "</stateUpdateIndicator>");
                sb.AppendLine("<systems type=\"byte\">" + this._systems.Count.ToString(CultureInfo.InvariantCulture) + "</systems>");
                sb.AppendLine("<paddingForEmissionsPdu type=\"ushort\">" + this._paddingForEmissionsPdu.ToString(CultureInfo.InvariantCulture) + "</paddingForEmissionsPdu>");
                for (int idx = 0; idx < this._systems.Count; idx++)
                {
                    sb.AppendLine("<systems" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"ElectronicEmissionSystemData\">");
                    ElectronicEmissionSystemData aElectronicEmissionSystemData = (ElectronicEmissionSystemData)this._systems[idx];
                    aElectronicEmissionSystemData.Reflection(sb);
                    sb.AppendLine("</systems" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</ElectronicEmissionsPdu>");
            }
            catch (Exception e)
            {
                if (PduBase.TraceExceptions)
                {
                    Trace.WriteLine(e);
                    Trace.Flush();
                }

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }
Пример #4
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._emittingEntityID.Unmarshal(dis);
                    this._eventID.Unmarshal(dis);
                    this._stateUpdateIndicator   = dis.ReadUnsignedByte();
                    this._numberOfSystems        = dis.ReadUnsignedByte();
                    this._paddingForEmissionsPdu = dis.ReadUnsignedShort();

                    for (int idx = 0; idx < this.NumberOfSystems; idx++)
                    {
                        ElectronicEmissionSystemData anX = new ElectronicEmissionSystemData();
                        anX.Unmarshal(dis);
                        this._systems.Add(anX);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
Пример #5
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._emittingEntityID.Marshal(dos);
                    this._eventID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._stateUpdateIndicator);
                    dos.WriteUnsignedByte((byte)this._systems.Count);
                    dos.WriteUnsignedShort((ushort)this._paddingForEmissionsPdu);

                    for (int idx = 0; idx < this._systems.Count; idx++)
                    {
                        ElectronicEmissionSystemData aElectronicEmissionSystemData = (ElectronicEmissionSystemData)this._systems[idx];
                        aElectronicEmissionSystemData.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        /// 	<c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(ElectronicEmissionSystemData obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            if (this._systemDataLength != obj._systemDataLength)
            {
                ivarsEqual = false;
            }

            if (this._numberOfBeams != obj._numberOfBeams)
            {
                ivarsEqual = false;
            }

            if (this._emissionsPadding2 != obj._emissionsPadding2)
            {
                ivarsEqual = false;
            }

            if (!this._emitterSystem.Equals(obj._emitterSystem))
            {
                ivarsEqual = false;
            }

            if (!this._location.Equals(obj._location))
            {
                ivarsEqual = false;
            }

            if (this._beamDataRecords.Count != obj._beamDataRecords.Count)
            {
                ivarsEqual = false;
            }

            if (ivarsEqual)
            {
                for (int idx = 0; idx < this._beamDataRecords.Count; idx++)
                {
                    if (!this._beamDataRecords[idx].Equals(obj._beamDataRecords[idx]))
                    {
                        ivarsEqual = false;
                    }
                }
            }

            return ivarsEqual;
        }