예제 #1
0
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + _emittingEntityID.getMarshalledSize(); // _emittingEntityID
            marshalSize = marshalSize + _eventID.getMarshalledSize();          // _eventID
            marshalSize = marshalSize + 1;                                     // _stateChangeIndicator
            marshalSize = marshalSize + 1;                                     // _pad
            marshalSize = marshalSize + 2;                                     // _passiveParameterIndex
            marshalSize = marshalSize + 1;                                     // _propulsionPlantConfiguration
            marshalSize = marshalSize + 1;                                     // _numberOfShafts
            marshalSize = marshalSize + 1;                                     // _numberOfAPAs
            marshalSize = marshalSize + 1;                                     // _numberOfUAEmitterSystems
            for (int idx = 0; idx < _shaftRPMs.Count; idx++)
            {
                ShaftRPMs listElement = (ShaftRPMs)_shaftRPMs[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }
            for (int idx = 0; idx < _apaData.Count; idx++)
            {
                ApaData listElement = (ApaData)_apaData[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }
            for (int idx = 0; idx < _emitterSystems.Count; idx++)
            {
                AcousticEmitterSystemData listElement = (AcousticEmitterSystemData)_emitterSystems[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

            return(marshalSize);
        }
예제 #2
0
        } // end of unmarshal method

        ///<summary>
        ///This allows for a quick display of PDU data.  The current format is unacceptable and only used for debugging.
        ///This will be modified in the future to provide a better display.  Usage:
        ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
        ///where pdu is an object representing a single pdu and sb is a StringBuilder.
        ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
        ///</summary>
        new public void reflection(StringBuilder sb)
        {
            sb.Append("<UaPdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<emittingEntityID>" + System.Environment.NewLine);
                _emittingEntityID.reflection(sb);
                sb.Append("</emittingEntityID>" + System.Environment.NewLine);
                sb.Append("<eventID>" + System.Environment.NewLine);
                _eventID.reflection(sb);
                sb.Append("</eventID>" + System.Environment.NewLine);
                sb.Append("<stateChangeIndicator type=\"byte\">" + _stateChangeIndicator.ToString() + "</stateChangeIndicator> " + System.Environment.NewLine);
                sb.Append("<pad type=\"byte\">" + _pad.ToString() + "</pad> " + System.Environment.NewLine);
                sb.Append("<passiveParameterIndex type=\"ushort\">" + _passiveParameterIndex.ToString() + "</passiveParameterIndex> " + System.Environment.NewLine);
                sb.Append("<propulsionPlantConfiguration type=\"byte\">" + _propulsionPlantConfiguration.ToString() + "</propulsionPlantConfiguration> " + System.Environment.NewLine);
                sb.Append("<shaftRPMs type=\"byte\">" + _shaftRPMs.Count.ToString() + "</shaftRPMs> " + System.Environment.NewLine);
                sb.Append("<apaData type=\"byte\">" + _apaData.Count.ToString() + "</apaData> " + System.Environment.NewLine);
                sb.Append("<emitterSystems type=\"byte\">" + _emitterSystems.Count.ToString() + "</emitterSystems> " + System.Environment.NewLine);

                for (int idx = 0; idx < _shaftRPMs.Count; idx++)
                {
                    sb.Append("<shaftRPMs" + idx.ToString() + " type=\"ShaftRPMs\">" + System.Environment.NewLine);
                    ShaftRPMs aShaftRPMs = (ShaftRPMs)_shaftRPMs[idx];
                    aShaftRPMs.reflection(sb);
                    sb.Append("</shaftRPMs" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling


                for (int idx = 0; idx < _apaData.Count; idx++)
                {
                    sb.Append("<apaData" + idx.ToString() + " type=\"ApaData\">" + System.Environment.NewLine);
                    ApaData aApaData = (ApaData)_apaData[idx];
                    aApaData.reflection(sb);
                    sb.Append("</apaData" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling


                for (int idx = 0; idx < _emitterSystems.Count; idx++)
                {
                    sb.Append("<emitterSystems" + idx.ToString() + " type=\"AcousticEmitterSystemData\">" + System.Environment.NewLine);
                    AcousticEmitterSystemData aAcousticEmitterSystemData = (AcousticEmitterSystemData)_emitterSystems[idx];
                    aAcousticEmitterSystemData.reflection(sb);
                    sb.Append("</emitterSystems" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</UaPdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method
예제 #3
0
        } // end of marshal method

        new public void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
                _emittingEntityID.unmarshal(dis);
                _eventID.unmarshal(dis);
                _stateChangeIndicator = dis.readByte();
                _pad = dis.readByte();
                _passiveParameterIndex        = dis.readUshort();
                _propulsionPlantConfiguration = dis.readByte();
                _numberOfShafts           = dis.readByte();
                _numberOfAPAs             = dis.readByte();
                _numberOfUAEmitterSystems = dis.readByte();
                for (int idx = 0; idx < _numberOfShafts; idx++)
                {
                    ShaftRPMs anX = new ShaftRPMs();
                    anX.unmarshal(dis);
                    _shaftRPMs.Add(anX);
                }
                ;

                for (int idx = 0; idx < _numberOfAPAs; idx++)
                {
                    ApaData anX = new ApaData();
                    anX.unmarshal(dis);
                    _apaData.Add(anX);
                }
                ;

                for (int idx = 0; idx < _numberOfUAEmitterSystems; idx++)
                {
                    AcousticEmitterSystemData anX = new AcousticEmitterSystemData();
                    anX.unmarshal(dis);
                    _emitterSystems.Add(anX);
                }
                ;
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of unmarshal method
예제 #4
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(ApaData rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_parameterIndex == rhs._parameterIndex))
            {
                ivarsEqual = false;
            }
            if (!(_parameterValue == rhs._parameterValue))
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
예제 #5
0
        ///<summary>
        ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
        ///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                _emittingEntityID.marshal(dos);
                _eventID.marshal(dos);
                dos.writeByte((byte)_stateChangeIndicator);
                dos.writeByte((byte)_pad);
                dos.writeUshort((ushort)_passiveParameterIndex);
                dos.writeByte((byte)_propulsionPlantConfiguration);
                dos.writeByte((byte)_shaftRPMs.Count);
                dos.writeByte((byte)_apaData.Count);
                dos.writeByte((byte)_emitterSystems.Count);

                for (int idx = 0; idx < _shaftRPMs.Count; idx++)
                {
                    ShaftRPMs aShaftRPMs = (ShaftRPMs)_shaftRPMs[idx];
                    aShaftRPMs.marshal(dos);
                } // end of list marshalling


                for (int idx = 0; idx < _apaData.Count; idx++)
                {
                    ApaData aApaData = (ApaData)_apaData[idx];
                    aApaData.marshal(dos);
                } // end of list marshalling


                for (int idx = 0; idx < _emitterSystems.Count; idx++)
                {
                    AcousticEmitterSystemData aAcousticEmitterSystemData = (AcousticEmitterSystemData)_emitterSystems[idx];
                    aAcousticEmitterSystemData.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
예제 #6
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(ApaData rhs)
        {
            bool ivarsEqual = true;

            if(rhs.GetType() != this.GetType())
                return false;

            if( ! (_parameterIndex == rhs._parameterIndex)) ivarsEqual = false;
            if( ! (_parameterValue == rhs._parameterValue)) ivarsEqual = false;

            return ivarsEqual;
        }
예제 #7
0
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
               _emittingEntityID.unmarshal(dis);
               _eventID.unmarshal(dis);
               _stateChangeIndicator = dis.readByte();
               _pad = dis.readByte();
               _passiveParameterIndex = dis.readUshort();
               _propulsionPlantConfiguration = dis.readByte();
               _numberOfShafts = dis.readByte();
               _numberOfAPAs = dis.readByte();
               _numberOfUAEmitterSystems = dis.readByte();
            for(int idx = 0; idx < _numberOfShafts; idx++)
            {
               ShaftRPMs anX = new ShaftRPMs();
            anX.unmarshal(dis);
            _shaftRPMs.Add(anX);
            };

            for(int idx = 0; idx < _numberOfAPAs; idx++)
            {
               ApaData anX = new ApaData();
            anX.unmarshal(dis);
            _apaData.Add(anX);
            };

            for(int idx = 0; idx < _numberOfUAEmitterSystems; idx++)
            {
               AcousticEmitterSystemData anX = new AcousticEmitterSystemData();
            anX.unmarshal(dis);
            _emitterSystems.Add(anX);
            };

            } // end try
               catch(Exception e)
            {
              Trace.WriteLine(e);
              Trace.Flush();
            }
        }
예제 #8
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(UaPdu rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_emittingEntityID.Equals(rhs._emittingEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_eventID.Equals(rhs._eventID)))
            {
                ivarsEqual = false;
            }
            if (!(_stateChangeIndicator == rhs._stateChangeIndicator))
            {
                ivarsEqual = false;
            }
            if (!(_pad == rhs._pad))
            {
                ivarsEqual = false;
            }
            if (!(_passiveParameterIndex == rhs._passiveParameterIndex))
            {
                ivarsEqual = false;
            }
            if (!(_propulsionPlantConfiguration == rhs._propulsionPlantConfiguration))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfShafts == rhs._numberOfShafts))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfAPAs == rhs._numberOfAPAs))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfUAEmitterSystems == rhs._numberOfUAEmitterSystems))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _shaftRPMs.Count; idx++)
            {
                ShaftRPMs x = (ShaftRPMs)_shaftRPMs[idx];
                if (!(_shaftRPMs[idx].Equals(rhs._shaftRPMs[idx])))
                {
                    ivarsEqual = false;
                }
            }


            for (int idx = 0; idx < _apaData.Count; idx++)
            {
                ApaData x = (ApaData)_apaData[idx];
                if (!(_apaData[idx].Equals(rhs._apaData[idx])))
                {
                    ivarsEqual = false;
                }
            }


            for (int idx = 0; idx < _emitterSystems.Count; idx++)
            {
                AcousticEmitterSystemData x = (AcousticEmitterSystemData)_emitterSystems[idx];
                if (!(_emitterSystems[idx].Equals(rhs._emitterSystems[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }