Esempio n. 1
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;
                    }
                }
            }
        }
Esempio n. 2
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._minefieldID.Unmarshal(dis);
                    this._requestingEntityID.Unmarshal(dis);
                    this._requestID = dis.ReadUnsignedByte();
                    this._numberOfPerimeterPoints = dis.ReadUnsignedByte();
                    this._pad2 = dis.ReadUnsignedByte();
                    this._numberOfSensorTypes = dis.ReadUnsignedByte();
                    this._dataFilter          = dis.ReadUnsignedInt();
                    this._requestedMineType.Unmarshal(dis);

                    for (int idx = 0; idx < this.NumberOfPerimeterPoints; idx++)
                    {
                        Point anX = new Point();
                        anX.Unmarshal(dis);
                        this._requestedPerimeterPoints.Add(anX);
                    }

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

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._fieldScale     = dis.ReadFloat();
                    this._fieldOffset    = dis.ReadFloat();
                    this._numberOfValues = dis.ReadUnsignedShort();

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

                    this.RaiseExceptionOccured(e);

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