コード例 #1
0
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedByte((byte)this._systemDataLength);
                    dos.WriteUnsignedByte((byte)this._beamDataRecords.Count);
                    dos.WriteUnsignedShort((ushort)this._emissionsPadding2);
                    this._emitterSystem.Marshal(dos);
                    this._location.Marshal(dos);

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

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
コード例 #2
0
        public virtual int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize += 1;                                       // this._systemDataLength
            marshalSize += 1;                                       // this._numberOfBeams
            marshalSize += 2;                                       // this._emissionsPadding2
            marshalSize += this._emitterSystem.GetMarshalledSize(); // this._emitterSystem
            marshalSize += this._location.GetMarshalledSize();      // this._location
            for (int idx = 0; idx < this._beamDataRecords.Count; idx++)
            {
                ElectronicEmissionBeamData listElement = (ElectronicEmissionBeamData)this._beamDataRecords[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
コード例 #3
0
        public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<ElectronicEmissionSystemData>");
            try
            {
                sb.AppendLine("<systemDataLength type=\"byte\">" + this._systemDataLength.ToString(CultureInfo.InvariantCulture) + "</systemDataLength>");
                sb.AppendLine("<beamDataRecords type=\"byte\">" + this._beamDataRecords.Count.ToString(CultureInfo.InvariantCulture) + "</beamDataRecords>");
                sb.AppendLine("<emissionsPadding2 type=\"ushort\">" + this._emissionsPadding2.ToString(CultureInfo.InvariantCulture) + "</emissionsPadding2>");
                sb.AppendLine("<emitterSystem>");
                this._emitterSystem.Reflection(sb);
                sb.AppendLine("</emitterSystem>");
                sb.AppendLine("<location>");
                this._location.Reflection(sb);
                sb.AppendLine("</location>");
                for (int idx = 0; idx < this._beamDataRecords.Count; idx++)
                {
                    sb.AppendLine("<beamDataRecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"ElectronicEmissionBeamData\">");
                    ElectronicEmissionBeamData aElectronicEmissionBeamData = (ElectronicEmissionBeamData)this._beamDataRecords[idx];
                    aElectronicEmissionBeamData.Reflection(sb);
                    sb.AppendLine("</beamDataRecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

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

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }
コード例 #4
0
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._systemDataLength  = dis.ReadUnsignedByte();
                    this._numberOfBeams     = dis.ReadUnsignedByte();
                    this._emissionsPadding2 = dis.ReadUnsignedShort();
                    this._emitterSystem.Unmarshal(dis);
                    this._location.Unmarshal(dis);

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

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
コード例 #5
0
        /// <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(ElectronicEmissionBeamData obj)
        {
            bool ivarsEqual = true;

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

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

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

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

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

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

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

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

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

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

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

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

            return(ivarsEqual);
        }