Пример #1
0
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedInt((uint)this._recordType);
                    dos.WriteUnsignedShort((ushort)this._recordLength);
                    dos.WriteUnsignedShort((ushort)this._padding);
                    dos.WriteUnsignedShort((ushort)this._beamAntennaParameterList.Count);
                    dos.WriteUnsignedShort((ushort)this._directedEnergyTargetEnergyDepositionRecordList.Count);

                    for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
                    {
                        BeamAntennaPattern aBeamAntennaPattern = (BeamAntennaPattern)this._beamAntennaParameterList[idx];
                        aBeamAntennaPattern.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
                    {
                        DirectedEnergyTargetEnergyDeposition aDirectedEnergyTargetEnergyDeposition = (DirectedEnergyTargetEnergyDeposition)this._directedEnergyTargetEnergyDepositionRecordList[idx];
                        aDirectedEnergyTargetEnergyDeposition.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(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(DirectedEnergyTargetEnergyDeposition obj)
        {
            bool ivarsEqual = true;

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

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

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

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

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

            marshalSize += 4;  // this._recordType
            marshalSize += 2;  // this._recordLength
            marshalSize += 2;  // this._padding
            marshalSize += 2;  // this._beamAntennaPatternRecordCount
            marshalSize += 2;  // this._directedEnergyTargetEnergyDepositionRecordCount
            for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
            {
                BeamAntennaPattern listElement = (BeamAntennaPattern)this._beamAntennaParameterList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

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

            return(marshalSize);
        }
Пример #4
0
        public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<DirectedEnergyAreaAimpoint>");
            try
            {
                sb.AppendLine("<recordType type=\"uint\">" + this._recordType.ToString(CultureInfo.InvariantCulture) + "</recordType>");
                sb.AppendLine("<recordLength type=\"ushort\">" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "</recordLength>");
                sb.AppendLine("<padding type=\"ushort\">" + this._padding.ToString(CultureInfo.InvariantCulture) + "</padding>");
                sb.AppendLine("<beamAntennaParameterList type=\"ushort\">" + this._beamAntennaParameterList.Count.ToString(CultureInfo.InvariantCulture) + "</beamAntennaParameterList>");
                sb.AppendLine("<directedEnergyTargetEnergyDepositionRecordList type=\"ushort\">" + this._directedEnergyTargetEnergyDepositionRecordList.Count.ToString(CultureInfo.InvariantCulture) + "</directedEnergyTargetEnergyDepositionRecordList>");
                for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
                {
                    sb.AppendLine("<beamAntennaParameterList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"BeamAntennaPattern\">");
                    BeamAntennaPattern aBeamAntennaPattern = (BeamAntennaPattern)this._beamAntennaParameterList[idx];
                    aBeamAntennaPattern.Reflection(sb);
                    sb.AppendLine("</beamAntennaParameterList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
                {
                    sb.AppendLine("<directedEnergyTargetEnergyDepositionRecordList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"DirectedEnergyTargetEnergyDeposition\">");
                    DirectedEnergyTargetEnergyDeposition aDirectedEnergyTargetEnergyDeposition = (DirectedEnergyTargetEnergyDeposition)this._directedEnergyTargetEnergyDepositionRecordList[idx];
                    aDirectedEnergyTargetEnergyDeposition.Reflection(sb);
                    sb.AppendLine("</directedEnergyTargetEnergyDepositionRecordList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</DirectedEnergyAreaAimpoint>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Пример #5
0
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._recordType   = dis.ReadUnsignedInt();
                    this._recordLength = dis.ReadUnsignedShort();
                    this._padding      = dis.ReadUnsignedShort();
                    this._beamAntennaPatternRecordCount = dis.ReadUnsignedShort();
                    this._directedEnergyTargetEnergyDepositionRecordCount = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.BeamAntennaPatternRecordCount; idx++)
                    {
                        BeamAntennaPattern anX = new BeamAntennaPattern();
                        anX.Unmarshal(dis);
                        this._beamAntennaParameterList.Add(anX);
                    }
                    ;

                    for (int idx = 0; idx < this.DirectedEnergyTargetEnergyDepositionRecordCount; idx++)
                    {
                        DirectedEnergyTargetEnergyDeposition anX = new DirectedEnergyTargetEnergyDeposition();
                        anX.Unmarshal(dis);
                        this._directedEnergyTargetEnergyDepositionRecordList.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }