コード例 #1
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._minefieldID.GetMarshalledSize();        // this._minefieldID
            marshalSize += this._requestingEntityID.GetMarshalledSize(); // this._requestingEntityID
            marshalSize += 2;                                            // this._minefieldSequenceNumbeer
            marshalSize += 1;                                            // this._requestID
            marshalSize += 1;                                            // this._pduSequenceNumber
            marshalSize += 1;                                            // this._numberOfPdus
            marshalSize += 1;                                            // this._numberOfMinesInThisPdu
            marshalSize += 1;                                            // this._numberOfSensorTypes
            marshalSize += 1;                                            // this._pad2
            marshalSize += 4;                                            // this._dataFilter
            marshalSize += this._mineType.GetMarshalledSize();           // this._mineType
            for (int idx = 0; idx < this._sensorTypes.Count; idx++)
            {
                TwoByteChunk listElement = (TwoByteChunk)this._sensorTypes[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            marshalSize += 1;  // this._pad3
            for (int idx = 0; idx < this._mineLocation.Count; idx++)
            {
                Vector3Float listElement = (Vector3Float)this._mineLocation[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
コード例 #2
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(Vector3Float obj)
        {
            bool ivarsEqual = true;

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

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

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

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

            return(ivarsEqual);
        }
コード例 #3
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<MinefieldDataPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<minefieldID>");
                this._minefieldID.Reflection(sb);
                sb.AppendLine("</minefieldID>");
                sb.AppendLine("<requestingEntityID>");
                this._requestingEntityID.Reflection(sb);
                sb.AppendLine("</requestingEntityID>");
                sb.AppendLine("<minefieldSequenceNumbeer type=\"ushort\">" + this._minefieldSequenceNumbeer.ToString(CultureInfo.InvariantCulture) + "</minefieldSequenceNumbeer>");
                sb.AppendLine("<requestID type=\"byte\">" + this._requestID.ToString(CultureInfo.InvariantCulture) + "</requestID>");
                sb.AppendLine("<pduSequenceNumber type=\"byte\">" + this._pduSequenceNumber.ToString(CultureInfo.InvariantCulture) + "</pduSequenceNumber>");
                sb.AppendLine("<numberOfPdus type=\"byte\">" + this._numberOfPdus.ToString(CultureInfo.InvariantCulture) + "</numberOfPdus>");
                sb.AppendLine("<mineLocation type=\"byte\">" + this._mineLocation.Count.ToString(CultureInfo.InvariantCulture) + "</mineLocation>");
                sb.AppendLine("<sensorTypes type=\"byte\">" + this._sensorTypes.Count.ToString(CultureInfo.InvariantCulture) + "</sensorTypes>");
                sb.AppendLine("<pad2 type=\"byte\">" + this._pad2.ToString(CultureInfo.InvariantCulture) + "</pad2>");
                sb.AppendLine("<dataFilter type=\"uint\">" + this._dataFilter.ToString(CultureInfo.InvariantCulture) + "</dataFilter>");
                sb.AppendLine("<mineType>");
                this._mineType.Reflection(sb);
                sb.AppendLine("</mineType>");
                for (int idx = 0; idx < this._sensorTypes.Count; idx++)
                {
                    sb.AppendLine("<sensorTypes" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"TwoByteChunk\">");
                    TwoByteChunk aTwoByteChunk = (TwoByteChunk)this._sensorTypes[idx];
                    aTwoByteChunk.Reflection(sb);
                    sb.AppendLine("</sensorTypes" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("<pad3 type=\"byte\">" + this._pad3.ToString(CultureInfo.InvariantCulture) + "</pad3>");
                for (int idx = 0; idx < this._mineLocation.Count; idx++)
                {
                    sb.AppendLine("<mineLocation" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"Vector3Float\">");
                    Vector3Float aVector3Float = (Vector3Float)this._mineLocation[idx];
                    aVector3Float.Reflection(sb);
                    sb.AppendLine("</mineLocation" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</MinefieldDataPdu>");
            }
            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._radioEntityType.Unmarshal(dis);
                    this._transmitState = dis.ReadUnsignedByte();
                    this._inputSource   = dis.ReadUnsignedByte();
                    this._padding1      = dis.ReadUnsignedShort();
                    this._antennaLocation.Unmarshal(dis);
                    this._relativeAntennaLocation.Unmarshal(dis);
                    this._antennaPatternType         = dis.ReadUnsignedShort();
                    this._antennaPatternCount        = dis.ReadUnsignedShort();
                    this._frequency                  = dis.ReadUnsignedLong();
                    this._transmitFrequencyBandwidth = dis.ReadFloat();
                    this._power = dis.ReadFloat();
                    this._modulationType.Unmarshal(dis);
                    this._cryptoSystem             = dis.ReadUnsignedShort();
                    this._cryptoKeyId              = dis.ReadUnsignedShort();
                    this._modulationParameterCount = dis.ReadUnsignedByte();
                    this._padding2 = dis.ReadUnsignedShort();
                    this._padding3 = dis.ReadUnsignedByte();

                    for (int idx = 0; idx < this.ModulationParameterCount; idx++)
                    {
                        Vector3Float anX = new Vector3Float();
                        anX.Unmarshal(dis);
                        this._modulationParametersList.Add(anX);
                    }

                    for (int idx = 0; idx < this.AntennaPatternCount; idx++)
                    {
                        Vector3Float anX = new Vector3Float();
                        anX.Unmarshal(dis);
                        this._antennaPatternList.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._radioEntityType.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._transmitState);
                    dos.WriteUnsignedByte((byte)this._inputSource);
                    dos.WriteUnsignedShort((ushort)this._padding1);
                    this._antennaLocation.Marshal(dos);
                    this._relativeAntennaLocation.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._antennaPatternType);
                    dos.WriteUnsignedShort((ushort)this._antennaPatternList.Count);
                    dos.WriteUnsignedLong((ulong)this._frequency);
                    dos.WriteFloat((float)this._transmitFrequencyBandwidth);
                    dos.WriteFloat((float)this._power);
                    this._modulationType.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._cryptoSystem);
                    dos.WriteUnsignedShort((ushort)this._cryptoKeyId);
                    dos.WriteUnsignedByte((byte)this._modulationParametersList.Count);
                    dos.WriteUnsignedShort((ushort)this._padding2);
                    dos.WriteUnsignedByte((byte)this._padding3);

                    for (int idx = 0; idx < this._modulationParametersList.Count; idx++)
                    {
                        Vector3Float aVector3Float = (Vector3Float)this._modulationParametersList[idx];
                        aVector3Float.Marshal(dos);
                    }

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

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
コード例 #6
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._minefieldID.Unmarshal(dis);
                    this._requestingEntityID.Unmarshal(dis);
                    this._minefieldSequenceNumbeer = dis.ReadUnsignedShort();
                    this._requestID              = dis.ReadUnsignedByte();
                    this._pduSequenceNumber      = dis.ReadUnsignedByte();
                    this._numberOfPdus           = dis.ReadUnsignedByte();
                    this._numberOfMinesInThisPdu = dis.ReadUnsignedByte();
                    this._numberOfSensorTypes    = dis.ReadUnsignedByte();
                    this._pad2       = dis.ReadUnsignedByte();
                    this._dataFilter = dis.ReadUnsignedInt();
                    this._mineType.Unmarshal(dis);

                    for (int idx = 0; idx < this.NumberOfSensorTypes; idx++)
                    {
                        TwoByteChunk anX = new TwoByteChunk();
                        anX.Unmarshal(dis);
                        this._sensorTypes.Add(anX);
                    }

                    this._pad3 = dis.ReadUnsignedByte();

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

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
コード例 #7
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._minefieldID.Marshal(dos);
                    this._requestingEntityID.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._minefieldSequenceNumbeer);
                    dos.WriteUnsignedByte((byte)this._requestID);
                    dos.WriteUnsignedByte((byte)this._pduSequenceNumber);
                    dos.WriteUnsignedByte((byte)this._numberOfPdus);
                    dos.WriteUnsignedByte((byte)this._mineLocation.Count);
                    dos.WriteUnsignedByte((byte)this._sensorTypes.Count);
                    dos.WriteUnsignedByte((byte)this._pad2);
                    dos.WriteUnsignedInt((uint)this._dataFilter);
                    this._mineType.Marshal(dos);

                    for (int idx = 0; idx < this._sensorTypes.Count; idx++)
                    {
                        TwoByteChunk aTwoByteChunk = (TwoByteChunk)this._sensorTypes[idx];
                        aTwoByteChunk.Marshal(dos);
                    }

                    dos.WriteUnsignedByte((byte)this._pad3);

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

                    this.RaiseExceptionOccured(e);

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

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._radioEntityType.GetMarshalledSize();         // this._radioEntityType
            marshalSize += 1;                                                 // this._transmitState
            marshalSize += 1;                                                 // this._inputSource
            marshalSize += 2;                                                 // this._padding1
            marshalSize += this._antennaLocation.GetMarshalledSize();         // this._antennaLocation
            marshalSize += this._relativeAntennaLocation.GetMarshalledSize(); // this._relativeAntennaLocation
            marshalSize += 2;                                                 // this._antennaPatternType
            marshalSize += 2;                                                 // this._antennaPatternCount
            marshalSize += 8;                                                 // this._frequency
            marshalSize += 4;                                                 // this._transmitFrequencyBandwidth
            marshalSize += 4;                                                 // this._power
            marshalSize += this._modulationType.GetMarshalledSize();          // this._modulationType
            marshalSize += 2;                                                 // this._cryptoSystem
            marshalSize += 2;                                                 // this._cryptoKeyId
            marshalSize += 1;                                                 // this._modulationParameterCount
            marshalSize += 2;                                                 // this._padding2
            marshalSize += 1;                                                 // this._padding3
            for (int idx = 0; idx < this._modulationParametersList.Count; idx++)
            {
                Vector3Float listElement = (Vector3Float)this._modulationParametersList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

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

            return(marshalSize);
        }
コード例 #9
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<TransmitterPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<radioEntityType>");
                this._radioEntityType.Reflection(sb);
                sb.AppendLine("</radioEntityType>");
                sb.AppendLine("<transmitState type=\"byte\">" + this._transmitState.ToString(CultureInfo.InvariantCulture) + "</transmitState>");
                sb.AppendLine("<inputSource type=\"byte\">" + this._inputSource.ToString(CultureInfo.InvariantCulture) + "</inputSource>");
                sb.AppendLine("<padding1 type=\"ushort\">" + this._padding1.ToString(CultureInfo.InvariantCulture) + "</padding1>");
                sb.AppendLine("<antennaLocation>");
                this._antennaLocation.Reflection(sb);
                sb.AppendLine("</antennaLocation>");
                sb.AppendLine("<relativeAntennaLocation>");
                this._relativeAntennaLocation.Reflection(sb);
                sb.AppendLine("</relativeAntennaLocation>");
                sb.AppendLine("<antennaPatternType type=\"ushort\">" + this._antennaPatternType.ToString(CultureInfo.InvariantCulture) + "</antennaPatternType>");
                sb.AppendLine("<antennaPatternList type=\"ushort\">" + this._antennaPatternList.Count.ToString(CultureInfo.InvariantCulture) + "</antennaPatternList>");
                sb.AppendLine("<frequency type=\"ulong\">" + this._frequency.ToString(CultureInfo.InvariantCulture) + "</frequency>");
                sb.AppendLine("<transmitFrequencyBandwidth type=\"float\">" + this._transmitFrequencyBandwidth.ToString(CultureInfo.InvariantCulture) + "</transmitFrequencyBandwidth>");
                sb.AppendLine("<power type=\"float\">" + this._power.ToString(CultureInfo.InvariantCulture) + "</power>");
                sb.AppendLine("<modulationType>");
                this._modulationType.Reflection(sb);
                sb.AppendLine("</modulationType>");
                sb.AppendLine("<cryptoSystem type=\"ushort\">" + this._cryptoSystem.ToString(CultureInfo.InvariantCulture) + "</cryptoSystem>");
                sb.AppendLine("<cryptoKeyId type=\"ushort\">" + this._cryptoKeyId.ToString(CultureInfo.InvariantCulture) + "</cryptoKeyId>");
                sb.AppendLine("<modulationParametersList type=\"byte\">" + this._modulationParametersList.Count.ToString(CultureInfo.InvariantCulture) + "</modulationParametersList>");
                sb.AppendLine("<padding2 type=\"ushort\">" + this._padding2.ToString(CultureInfo.InvariantCulture) + "</padding2>");
                sb.AppendLine("<padding3 type=\"byte\">" + this._padding3.ToString(CultureInfo.InvariantCulture) + "</padding3>");
                for (int idx = 0; idx < this._modulationParametersList.Count; idx++)
                {
                    sb.AppendLine("<modulationParametersList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"Vector3Float\">");
                    Vector3Float aVector3Float = (Vector3Float)this._modulationParametersList[idx];
                    aVector3Float.Reflection(sb);
                    sb.AppendLine("</modulationParametersList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._antennaPatternList.Count; idx++)
                {
                    sb.AppendLine("<antennaPatternList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"Vector3Float\">");
                    Vector3Float aVector3Float = (Vector3Float)this._antennaPatternList[idx];
                    aVector3Float.Reflection(sb);
                    sb.AppendLine("</antennaPatternList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

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

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }