} // end of marshal method new public void unmarshal(DataInputStream dis) { base.unmarshal(dis); try { _environmentalSimulationApplicationID.unmarshal(dis); _fieldNumber = dis.readUshort(); _pduNumber = dis.readUshort(); _pduTotal = dis.readUshort(); _coordinateSystem = dis.readUshort(); _numberOfGridAxes = dis.readByte(); _constantGrid = dis.readByte(); _environmentType.unmarshal(dis); _orientation.unmarshal(dis); _sampleTime = dis.readLong(); _totalValues = dis.readUint(); _vectorDimension = dis.readByte(); _padding1 = dis.readUshort(); _padding2 = dis.readByte(); for (int idx = 0; idx < _numberOfGridAxes; idx++) { GridAxisRecord anX = new GridAxisRecord(); anX.unmarshal(dis); _gridDataList.Add(anX); } ; } // end try catch (Exception e) { Trace.WriteLine(e); Trace.Flush(); } } // end of unmarshal method
///<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 { _environmentalSimulationApplicationID.marshal(dos); dos.writeUshort((ushort)_fieldNumber); dos.writeUshort((ushort)_pduNumber); dos.writeUshort((ushort)_pduTotal); dos.writeUshort((ushort)_coordinateSystem); dos.writeByte((byte)_gridDataList.Count); dos.writeByte((byte)_constantGrid); _environmentType.marshal(dos); _orientation.marshal(dos); dos.writeLong((long)_sampleTime); dos.writeUint((uint)_totalValues); dos.writeByte((byte)_vectorDimension); dos.writeUshort((ushort)_padding1); dos.writeByte((byte)_padding2); for (int idx = 0; idx < _gridDataList.Count; idx++) { GridAxisRecord aGridAxisRecord = (GridAxisRecord)_gridDataList[idx]; aGridAxisRecord.marshal(dos); } // end of list marshalling } // end try catch (Exception e) { Trace.WriteLine(e); Trace.Flush(); } } // end of marshal method
new public int getMarshalledSize() { int marshalSize = 0; marshalSize = base.getMarshalledSize(); marshalSize = marshalSize + _environmentalSimulationApplicationID.getMarshalledSize(); // _environmentalSimulationApplicationID marshalSize = marshalSize + 2; // _fieldNumber marshalSize = marshalSize + 2; // _pduNumber marshalSize = marshalSize + 2; // _pduTotal marshalSize = marshalSize + 2; // _coordinateSystem marshalSize = marshalSize + 1; // _numberOfGridAxes marshalSize = marshalSize + 1; // _constantGrid marshalSize = marshalSize + _environmentType.getMarshalledSize(); // _environmentType marshalSize = marshalSize + _orientation.getMarshalledSize(); // _orientation marshalSize = marshalSize + 8; // _sampleTime marshalSize = marshalSize + 4; // _totalValues marshalSize = marshalSize + 1; // _vectorDimension marshalSize = marshalSize + 2; // _padding1 marshalSize = marshalSize + 1; // _padding2 for (int idx = 0; idx < _gridDataList.Count; idx++) { GridAxisRecord listElement = (GridAxisRecord)_gridDataList[idx]; marshalSize = marshalSize + listElement.getMarshalledSize(); } return(marshalSize); }
} // 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("<GriddedDataPdu>" + System.Environment.NewLine); base.reflection(sb); try { sb.Append("<environmentalSimulationApplicationID>" + System.Environment.NewLine); _environmentalSimulationApplicationID.reflection(sb); sb.Append("</environmentalSimulationApplicationID>" + System.Environment.NewLine); sb.Append("<fieldNumber type=\"ushort\">" + _fieldNumber.ToString() + "</fieldNumber> " + System.Environment.NewLine); sb.Append("<pduNumber type=\"ushort\">" + _pduNumber.ToString() + "</pduNumber> " + System.Environment.NewLine); sb.Append("<pduTotal type=\"ushort\">" + _pduTotal.ToString() + "</pduTotal> " + System.Environment.NewLine); sb.Append("<coordinateSystem type=\"ushort\">" + _coordinateSystem.ToString() + "</coordinateSystem> " + System.Environment.NewLine); sb.Append("<gridDataList type=\"byte\">" + _gridDataList.Count.ToString() + "</gridDataList> " + System.Environment.NewLine); sb.Append("<constantGrid type=\"byte\">" + _constantGrid.ToString() + "</constantGrid> " + System.Environment.NewLine); sb.Append("<environmentType>" + System.Environment.NewLine); _environmentType.reflection(sb); sb.Append("</environmentType>" + System.Environment.NewLine); sb.Append("<orientation>" + System.Environment.NewLine); _orientation.reflection(sb); sb.Append("</orientation>" + System.Environment.NewLine); sb.Append("<sampleTime type=\"long\">" + _sampleTime.ToString() + "</sampleTime> " + System.Environment.NewLine); sb.Append("<totalValues type=\"uint\">" + _totalValues.ToString() + "</totalValues> " + System.Environment.NewLine); sb.Append("<vectorDimension type=\"byte\">" + _vectorDimension.ToString() + "</vectorDimension> " + System.Environment.NewLine); sb.Append("<padding1 type=\"ushort\">" + _padding1.ToString() + "</padding1> " + System.Environment.NewLine); sb.Append("<padding2 type=\"byte\">" + _padding2.ToString() + "</padding2> " + System.Environment.NewLine); for (int idx = 0; idx < _gridDataList.Count; idx++) { sb.Append("<gridDataList" + idx.ToString() + " type=\"GridAxisRecord\">" + System.Environment.NewLine); GridAxisRecord aGridAxisRecord = (GridAxisRecord)_gridDataList[idx]; aGridAxisRecord.reflection(sb); sb.Append("</gridDataList" + idx.ToString() + ">" + System.Environment.NewLine); } // end of list marshalling sb.Append("</GriddedDataPdu>" + System.Environment.NewLine); } // end try catch (Exception e) { Trace.WriteLine(e); Trace.Flush(); } } // end of reflection method
/** * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful. */ public bool equals(GridAxisRecord rhs) { bool ivarsEqual = true; if (rhs.GetType() != this.GetType()) { return(false); } if (!(_sampleType == rhs._sampleType)) { ivarsEqual = false; } if (!(_dataRepresentation == rhs._dataRepresentation)) { ivarsEqual = false; } return(ivarsEqual); }
public new void unmarshal(DataInputStream dis) { base.unmarshal(dis); try { _environmentalSimulationApplicationID.unmarshal(dis); _fieldNumber = dis.readUshort(); _pduNumber = dis.readUshort(); _pduTotal = dis.readUshort(); _coordinateSystem = dis.readUshort(); _numberOfGridAxes = dis.readByte(); _constantGrid = dis.readByte(); _environmentType.unmarshal(dis); _orientation.unmarshal(dis); _sampleTime = dis.readLong(); _totalValues = dis.readUint(); _vectorDimension = dis.readByte(); _padding1 = dis.readUshort(); _padding2 = dis.readByte(); for(int idx = 0; idx < _numberOfGridAxes; idx++) { GridAxisRecord anX = new GridAxisRecord(); anX.unmarshal(dis); _gridDataList.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(GridAxisRecord rhs) { bool ivarsEqual = true; if(rhs.GetType() != this.GetType()) return false; if( ! (_sampleType == rhs._sampleType)) ivarsEqual = false; if( ! (_dataRepresentation == rhs._dataRepresentation)) ivarsEqual = false; return ivarsEqual; }
/** * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful. */ public bool equals(GriddedDataPdu rhs) { bool ivarsEqual = true; if (rhs.GetType() != this.GetType()) { return(false); } if (!(_environmentalSimulationApplicationID.Equals(rhs._environmentalSimulationApplicationID))) { ivarsEqual = false; } if (!(_fieldNumber == rhs._fieldNumber)) { ivarsEqual = false; } if (!(_pduNumber == rhs._pduNumber)) { ivarsEqual = false; } if (!(_pduTotal == rhs._pduTotal)) { ivarsEqual = false; } if (!(_coordinateSystem == rhs._coordinateSystem)) { ivarsEqual = false; } if (!(_numberOfGridAxes == rhs._numberOfGridAxes)) { ivarsEqual = false; } if (!(_constantGrid == rhs._constantGrid)) { ivarsEqual = false; } if (!(_environmentType.Equals(rhs._environmentType))) { ivarsEqual = false; } if (!(_orientation.Equals(rhs._orientation))) { ivarsEqual = false; } if (!(_sampleTime == rhs._sampleTime)) { ivarsEqual = false; } if (!(_totalValues == rhs._totalValues)) { ivarsEqual = false; } if (!(_vectorDimension == rhs._vectorDimension)) { ivarsEqual = false; } if (!(_padding1 == rhs._padding1)) { ivarsEqual = false; } if (!(_padding2 == rhs._padding2)) { ivarsEqual = false; } for (int idx = 0; idx < _gridDataList.Count; idx++) { GridAxisRecord x = (GridAxisRecord)_gridDataList[idx]; if (!(_gridDataList[idx].Equals(rhs._gridDataList[idx]))) { ivarsEqual = false; } } return(ivarsEqual); }