Пример #1
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._groupEntityID.Unmarshal(dis);
                    this._groupedEntityCategory   = dis.ReadUnsignedByte();
                    this._numberOfGroupedEntities = dis.ReadUnsignedByte();
                    this._pad2      = dis.ReadUnsignedInt();
                    this._latitude  = dis.ReadDouble();
                    this._longitude = dis.ReadDouble();

                    for (int idx = 0; idx < this.NumberOfGroupedEntities; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._groupedEntityDescriptions.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._aggregateID.Unmarshal(dis);
                    this._forceID        = dis.ReadUnsignedByte();
                    this._aggregateState = dis.ReadUnsignedByte();
                    this._aggregateType.Unmarshal(dis);
                    this._formation = dis.ReadUnsignedInt();
                    this._aggregateMarking.Unmarshal(dis);
                    this._dimensions.Unmarshal(dis);
                    this._orientation.Unmarshal(dis);
                    this._centerOfMass.Unmarshal(dis);
                    this._velocity.Unmarshal(dis);
                    this._numberOfDisAggregates        = dis.ReadUnsignedShort();
                    this._numberOfDisEntities          = dis.ReadUnsignedShort();
                    this._numberOfSilentAggregateTypes = dis.ReadUnsignedShort();
                    this._numberOfSilentEntityTypes    = dis.ReadUnsignedShort();

                    for (int idx = 0; idx < this.NumberOfDisAggregates; idx++)
                    {
                        AggregateID anX = new AggregateID();
                        anX.Unmarshal(dis);
                        this._aggregateIDList.Add(anX);
                    }

                    for (int idx = 0; idx < this.NumberOfDisEntities; idx++)
                    {
                        EntityID anX = new EntityID();
                        anX.Unmarshal(dis);
                        this._entityIDList.Add(anX);
                    }

                    this._pad2 = dis.ReadUnsignedByte();

                    for (int idx = 0; idx < this.NumberOfSilentAggregateTypes; idx++)
                    {
                        EntityType anX = new EntityType();
                        anX.Unmarshal(dis);
                        this._silentAggregateSystemList.Add(anX);
                    }

                    for (int idx = 0; idx < this.NumberOfSilentEntityTypes; idx++)
                    {
                        EntityType anX = new EntityType();
                        anX.Unmarshal(dis);
                        this._silentEntitySystemList.Add(anX);
                    }

                    this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();

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

                    this.RaiseExceptionOccured(e);

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