Example #1
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._stateChangeIndicator
            marshalSize += 1;                                          // this._pad
            marshalSize += 2;                                          // this._passiveParameterIndex
            marshalSize += 1;                                          // this._propulsionPlantConfiguration
            marshalSize += 1;                                          // this._numberOfShafts
            marshalSize += 1;                                          // this._numberOfAPAs
            marshalSize += 1;                                          // this._numberOfUAEmitterSystems
            for (int idx = 0; idx < this._shaftRPMs.Count; idx++)
            {
                ShaftRPMs listElement = (ShaftRPMs)this._shaftRPMs[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._apaData.Count; idx++)
            {
                ApaData listElement = (ApaData)this._apaData[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._emitterSystems.Count; idx++)
            {
                AcousticEmitterSystemData listElement = (AcousticEmitterSystemData)this._emitterSystems[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Example #2
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._emittingEntityID.Unmarshal(dis);
                    this._eventID.Unmarshal(dis);
                    this._stateChangeIndicator = dis.ReadByte();
                    this._pad = dis.ReadByte();
                    this._passiveParameterIndex        = dis.ReadUnsignedShort();
                    this._propulsionPlantConfiguration = dis.ReadUnsignedByte();
                    this._numberOfShafts           = dis.ReadUnsignedByte();
                    this._numberOfAPAs             = dis.ReadUnsignedByte();
                    this._numberOfUAEmitterSystems = dis.ReadUnsignedByte();

                    for (int idx = 0; idx < this.NumberOfShafts; idx++)
                    {
                        ShaftRPMs anX = new ShaftRPMs();
                        anX.Unmarshal(dis);
                        this._shaftRPMs.Add(anX);
                    }

                    for (int idx = 0; idx < this.NumberOfAPAs; idx++)
                    {
                        ApaData anX = new ApaData();
                        anX.Unmarshal(dis);
                        this._apaData.Add(anX);
                    }

                    for (int idx = 0; idx < this.NumberOfUAEmitterSystems; idx++)
                    {
                        AcousticEmitterSystemData anX = new AcousticEmitterSystemData();
                        anX.Unmarshal(dis);
                        this._emitterSystems.Add(anX);
                    }
                }
                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(AcousticEmitterSystemData obj)
        {
            bool ivarsEqual = true;

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

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

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

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

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

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

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

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

            return(ivarsEqual);
        }
Example #4
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._emittingEntityID.Marshal(dos);
                    this._eventID.Marshal(dos);
                    dos.WriteByte((byte)this._stateChangeIndicator);
                    dos.WriteByte((byte)this._pad);
                    dos.WriteUnsignedShort((ushort)this._passiveParameterIndex);
                    dos.WriteUnsignedByte((byte)this._propulsionPlantConfiguration);
                    dos.WriteUnsignedByte((byte)this._shaftRPMs.Count);
                    dos.WriteUnsignedByte((byte)this._apaData.Count);
                    dos.WriteUnsignedByte((byte)this._emitterSystems.Count);

                    for (int idx = 0; idx < this._shaftRPMs.Count; idx++)
                    {
                        ShaftRPMs aShaftRPMs = (ShaftRPMs)this._shaftRPMs[idx];
                        aShaftRPMs.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._apaData.Count; idx++)
                    {
                        ApaData aApaData = (ApaData)this._apaData[idx];
                        aApaData.Marshal(dos);
                    }

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

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
Example #5
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<UaPdu>");
            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("<stateChangeIndicator type=\"byte\">" + this._stateChangeIndicator.ToString(CultureInfo.InvariantCulture) + "</stateChangeIndicator>");
                sb.AppendLine("<pad type=\"byte\">" + this._pad.ToString(CultureInfo.InvariantCulture) + "</pad>");
                sb.AppendLine("<passiveParameterIndex type=\"ushort\">" + this._passiveParameterIndex.ToString(CultureInfo.InvariantCulture) + "</passiveParameterIndex>");
                sb.AppendLine("<propulsionPlantConfiguration type=\"byte\">" + this._propulsionPlantConfiguration.ToString(CultureInfo.InvariantCulture) + "</propulsionPlantConfiguration>");
                sb.AppendLine("<shaftRPMs type=\"byte\">" + this._shaftRPMs.Count.ToString(CultureInfo.InvariantCulture) + "</shaftRPMs>");
                sb.AppendLine("<apaData type=\"byte\">" + this._apaData.Count.ToString(CultureInfo.InvariantCulture) + "</apaData>");
                sb.AppendLine("<emitterSystems type=\"byte\">" + this._emitterSystems.Count.ToString(CultureInfo.InvariantCulture) + "</emitterSystems>");
                for (int idx = 0; idx < this._shaftRPMs.Count; idx++)
                {
                    sb.AppendLine("<shaftRPMs" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"ShaftRPMs\">");
                    ShaftRPMs aShaftRPMs = (ShaftRPMs)this._shaftRPMs[idx];
                    aShaftRPMs.Reflection(sb);
                    sb.AppendLine("</shaftRPMs" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._apaData.Count; idx++)
                {
                    sb.AppendLine("<apaData" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"ApaData\">");
                    ApaData aApaData = (ApaData)this._apaData[idx];
                    aApaData.Reflection(sb);
                    sb.AppendLine("</apaData" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._emitterSystems.Count; idx++)
                {
                    sb.AppendLine("<emitterSystems" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"AcousticEmitterSystemData\">");
                    AcousticEmitterSystemData aAcousticEmitterSystemData = (AcousticEmitterSystemData)this._emitterSystems[idx];
                    aAcousticEmitterSystemData.Reflection(sb);
                    sb.AppendLine("</emitterSystems" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</UaPdu>");
            }
            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(AcousticEmitterSystemData obj)
        {
            bool ivarsEqual = true;

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

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

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

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

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

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

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

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

            return ivarsEqual;
        }