Ejemplo n.º 1
0
        } // end of marshal method

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

            try
            {
                _controlType = dis.readByte();
                _communicationsChannelType = dis.readByte();
                _sourceEntityID.unmarshal(dis);
                _sourceCommunicationsDeviceID = dis.readByte();
                _sourceLineID      = dis.readByte();
                _transmitPriority  = dis.readByte();
                _transmitLineState = dis.readByte();
                _command           = dis.readByte();
                _masterEntityID.unmarshal(dis);
                _masterCommunicationsDeviceID = dis.readUshort();
                _intercomParametersLength     = dis.readUint();
                for (int idx = 0; idx < _intercomParametersLength; idx++)
                {
                    IntercomCommunicationsParameters anX = new IntercomCommunicationsParameters();
                    anX.unmarshal(dis);
                    _intercomParameters.Add(anX);
                }
                ;
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of unmarshal method
Ejemplo n.º 2
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
            {
                dos.writeByte((byte)_controlType);
                dos.writeByte((byte)_communicationsChannelType);
                _sourceEntityID.marshal(dos);
                dos.writeByte((byte)_sourceCommunicationsDeviceID);
                dos.writeByte((byte)_sourceLineID);
                dos.writeByte((byte)_transmitPriority);
                dos.writeByte((byte)_transmitLineState);
                dos.writeByte((byte)_command);
                _masterEntityID.marshal(dos);
                dos.writeUshort((ushort)_masterCommunicationsDeviceID);
                dos.writeUint((uint)_intercomParameters.Count);

                for (int idx = 0; idx < _intercomParameters.Count; idx++)
                {
                    IntercomCommunicationsParameters aIntercomCommunicationsParameters = (IntercomCommunicationsParameters)_intercomParameters[idx];
                    aIntercomCommunicationsParameters.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
Ejemplo n.º 3
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(IntercomCommunicationsParameters rhs)
        {
            bool ivarsEqual = true;

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


            if (!(_recordType == rhs._recordType))
            {
                ivarsEqual = false;
            }
            if (!(_recordLength == rhs._recordLength))
            {
                ivarsEqual = false;
            }
            if (!(_recordSpecificField == rhs._recordSpecificField))
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
Ejemplo n.º 4
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("<IntercomControlPdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<controlType type=\"byte\">" + _controlType.ToString() + "</controlType> " + System.Environment.NewLine);
                sb.Append("<communicationsChannelType type=\"byte\">" + _communicationsChannelType.ToString() + "</communicationsChannelType> " + System.Environment.NewLine);
                sb.Append("<sourceEntityID>" + System.Environment.NewLine);
                _sourceEntityID.reflection(sb);
                sb.Append("</sourceEntityID>" + System.Environment.NewLine);
                sb.Append("<sourceCommunicationsDeviceID type=\"byte\">" + _sourceCommunicationsDeviceID.ToString() + "</sourceCommunicationsDeviceID> " + System.Environment.NewLine);
                sb.Append("<sourceLineID type=\"byte\">" + _sourceLineID.ToString() + "</sourceLineID> " + System.Environment.NewLine);
                sb.Append("<transmitPriority type=\"byte\">" + _transmitPriority.ToString() + "</transmitPriority> " + System.Environment.NewLine);
                sb.Append("<transmitLineState type=\"byte\">" + _transmitLineState.ToString() + "</transmitLineState> " + System.Environment.NewLine);
                sb.Append("<command type=\"byte\">" + _command.ToString() + "</command> " + System.Environment.NewLine);
                sb.Append("<masterEntityID>" + System.Environment.NewLine);
                _masterEntityID.reflection(sb);
                sb.Append("</masterEntityID>" + System.Environment.NewLine);
                sb.Append("<masterCommunicationsDeviceID type=\"ushort\">" + _masterCommunicationsDeviceID.ToString() + "</masterCommunicationsDeviceID> " + System.Environment.NewLine);
                sb.Append("<intercomParameters type=\"uint\">" + _intercomParameters.Count.ToString() + "</intercomParameters> " + System.Environment.NewLine);

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

                sb.Append("</IntercomControlPdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method
Ejemplo n.º 5
0
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + 1;                                   // _controlType
            marshalSize = marshalSize + 1;                                   // _communicationsChannelType
            marshalSize = marshalSize + _sourceEntityID.getMarshalledSize(); // _sourceEntityID
            marshalSize = marshalSize + 1;                                   // _sourceCommunicationsDeviceID
            marshalSize = marshalSize + 1;                                   // _sourceLineID
            marshalSize = marshalSize + 1;                                   // _transmitPriority
            marshalSize = marshalSize + 1;                                   // _transmitLineState
            marshalSize = marshalSize + 1;                                   // _command
            marshalSize = marshalSize + _masterEntityID.getMarshalledSize(); // _masterEntityID
            marshalSize = marshalSize + 2;                                   // _masterCommunicationsDeviceID
            marshalSize = marshalSize + 4;                                   // _intercomParametersLength
            for (int idx = 0; idx < _intercomParameters.Count; idx++)
            {
                IntercomCommunicationsParameters listElement = (IntercomCommunicationsParameters)_intercomParameters[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

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

            try
            {
               _controlType = dis.readByte();
               _communicationsChannelType = dis.readByte();
               _sourceEntityID.unmarshal(dis);
               _sourceCommunicationsDeviceID = dis.readByte();
               _sourceLineID = dis.readByte();
               _transmitPriority = dis.readByte();
               _transmitLineState = dis.readByte();
               _command = dis.readByte();
               _masterEntityID.unmarshal(dis);
               _masterCommunicationsDeviceID = dis.readUshort();
               _intercomParametersLength = dis.readUint();
            for(int idx = 0; idx < _intercomParametersLength; idx++)
            {
               IntercomCommunicationsParameters anX = new IntercomCommunicationsParameters();
            anX.unmarshal(dis);
            _intercomParameters.Add(anX);
            };

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

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

            if (!(_controlType == rhs._controlType))
            {
                ivarsEqual = false;
            }
            if (!(_communicationsChannelType == rhs._communicationsChannelType))
            {
                ivarsEqual = false;
            }
            if (!(_sourceEntityID.Equals(rhs._sourceEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_sourceCommunicationsDeviceID == rhs._sourceCommunicationsDeviceID))
            {
                ivarsEqual = false;
            }
            if (!(_sourceLineID == rhs._sourceLineID))
            {
                ivarsEqual = false;
            }
            if (!(_transmitPriority == rhs._transmitPriority))
            {
                ivarsEqual = false;
            }
            if (!(_transmitLineState == rhs._transmitLineState))
            {
                ivarsEqual = false;
            }
            if (!(_command == rhs._command))
            {
                ivarsEqual = false;
            }
            if (!(_masterEntityID.Equals(rhs._masterEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_masterCommunicationsDeviceID == rhs._masterCommunicationsDeviceID))
            {
                ivarsEqual = false;
            }
            if (!(_intercomParametersLength == rhs._intercomParametersLength))
            {
                ivarsEqual = false;
            }

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


            return(ivarsEqual);
        }
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(IntercomCommunicationsParameters rhs)
        {
            bool ivarsEqual = true;

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

            if( ! (_recordType == rhs._recordType)) ivarsEqual = false;
            if( ! (_recordLength == rhs._recordLength)) ivarsEqual = false;
            if( ! (_recordSpecificField == rhs._recordSpecificField)) ivarsEqual = false;

            return ivarsEqual;
        }