} // 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>
        public void reflection(StringBuilder sb)
        {
            sb.Append("<ElectronicEmissionSystemData>" + System.Environment.NewLine);
            try
            {
                sb.Append("<systemDataLength type=\"byte\">" + _systemDataLength.ToString() + "</systemDataLength> " + System.Environment.NewLine);
                sb.Append("<beamDataRecords type=\"byte\">" + _beamDataRecords.Count.ToString() + "</beamDataRecords> " + System.Environment.NewLine);
                sb.Append("<emissionsPadding2 type=\"ushort\">" + _emissionsPadding2.ToString() + "</emissionsPadding2> " + System.Environment.NewLine);
                sb.Append("<emitterSystem>" + System.Environment.NewLine);
                _emitterSystem.reflection(sb);
                sb.Append("</emitterSystem>" + System.Environment.NewLine);
                sb.Append("<location>" + System.Environment.NewLine);
                _location.reflection(sb);
                sb.Append("</location>" + System.Environment.NewLine);

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

                sb.Append("</ElectronicEmissionSystemData>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method
示例#2
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(ElectronicEmissionBeamData rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_beamDataLength == rhs._beamDataLength))
            {
                ivarsEqual = false;
            }
            if (!(_beamIDNumber == rhs._beamIDNumber))
            {
                ivarsEqual = false;
            }
            if (!(_beamParameterIndex == rhs._beamParameterIndex))
            {
                ivarsEqual = false;
            }
            if (!(_fundamentalParameterData.Equals(rhs._fundamentalParameterData)))
            {
                ivarsEqual = false;
            }
            if (!(_beamFunction == rhs._beamFunction))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfTrackJamTargets == rhs._numberOfTrackJamTargets))
            {
                ivarsEqual = false;
            }
            if (!(_highDensityTrackJam == rhs._highDensityTrackJam))
            {
                ivarsEqual = false;
            }
            if (!(_pad4 == rhs._pad4))
            {
                ivarsEqual = false;
            }
            if (!(_jammingModeSequence == rhs._jammingModeSequence))
            {
                ivarsEqual = false;
            }

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


            return(ivarsEqual);
        }
        public int getMarshalledSize()
        {
            int marshalSize = 0;

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

            return(marshalSize);
        }
示例#4
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(ElectronicEmissionSystemData rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_systemDataLength == rhs._systemDataLength))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfBeams == rhs._numberOfBeams))
            {
                ivarsEqual = false;
            }
            if (!(_emissionsPadding2 == rhs._emissionsPadding2))
            {
                ivarsEqual = false;
            }
            if (!(_emitterSystem.Equals(rhs._emitterSystem)))
            {
                ivarsEqual = false;
            }
            if (!(_location.Equals(rhs._location)))
            {
                ivarsEqual = false;
            }

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


            return(ivarsEqual);
        }
        ///<summary>
        ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
        ///</summary>
        public void marshal(DataOutputStream dos)
        {
            try
            {
                dos.writeByte((byte)_systemDataLength);
                dos.writeByte((byte)_beamDataRecords.Count);
                dos.writeUshort((ushort)_emissionsPadding2);
                _emitterSystem.marshal(dos);
                _location.marshal(dos);

                for (int idx = 0; idx < _beamDataRecords.Count; idx++)
                {
                    ElectronicEmissionBeamData aElectronicEmissionBeamData = (ElectronicEmissionBeamData)_beamDataRecords[idx];
                    aElectronicEmissionBeamData.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
        } // end of marshal method

        public void unmarshal(DataInputStream dis)
        {
            try
            {
                _systemDataLength  = dis.readByte();
                _numberOfBeams     = dis.readByte();
                _emissionsPadding2 = dis.readUshort();
                _emitterSystem.unmarshal(dis);
                _location.unmarshal(dis);
                for (int idx = 0; idx < _numberOfBeams; idx++)
                {
                    ElectronicEmissionBeamData anX = new ElectronicEmissionBeamData();
                    anX.unmarshal(dis);
                    _beamDataRecords.Add(anX);
                }
                ;
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of unmarshal method
        public void unmarshal(DataInputStream dis)
        {
            try
            {
                _systemDataLength = dis.readByte();
                _numberOfBeams = dis.readByte();
                _emissionsPadding2 = dis.readUshort();
                _emitterSystem.unmarshal(dis);
                _location.unmarshal(dis);
                for(int idx = 0; idx < _numberOfBeams; idx++)
                {
                    ElectronicEmissionBeamData anX = new ElectronicEmissionBeamData();
                    anX.unmarshal(dis);
                    _beamDataRecords.Add(anX);
                };

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

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

             if( ! (_beamDataLength == rhs._beamDataLength)) ivarsEqual = false;
             if( ! (_beamIDNumber == rhs._beamIDNumber)) ivarsEqual = false;
             if( ! (_beamParameterIndex == rhs._beamParameterIndex)) ivarsEqual = false;
             if( ! (_fundamentalParameterData.Equals( rhs._fundamentalParameterData) )) ivarsEqual = false;
             if( ! (_beamFunction == rhs._beamFunction)) ivarsEqual = false;
             if( ! (_numberOfTrackJamTargets == rhs._numberOfTrackJamTargets)) ivarsEqual = false;
             if( ! (_highDensityTrackJam == rhs._highDensityTrackJam)) ivarsEqual = false;
             if( ! (_pad4 == rhs._pad4)) ivarsEqual = false;
             if( ! (_jammingModeSequence == rhs._jammingModeSequence)) ivarsEqual = false;

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

            return ivarsEqual;
        }