00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 #ifndef __JAUS_EXTRAS_RANGE_SENSOR_REPORT_RANGE_SENSOR_LOCAL_SCAN__H 00041 #define __JAUS_EXTRAS_RANGE_SENSOR_REPORT_RANGE_SENSOR_LOCAL_SCAN__H 00042 00043 #include "jaus/extras/extrascodes.h" 00044 #include "jaus/core/message.h" 00045 #include "jaus/mobility/mobilitycodes.h" 00046 #include <cxutils/circulararray.h> 00047 00048 namespace JAUS 00049 { 00067 class JAUS_EXTRAS_DLL ReportLocalRangeScan : public Message 00068 { 00069 public: 00070 typedef CxUtils::CircularArray<UShort> Scan; 00071 ReportLocalRangeScan(const Address& dest = Address(), 00072 const Address& src = Address()) : Message(REPORT_LOCAL_RANGE_SCAN, dest, src) 00073 { 00074 mSensorID = 0; 00075 } 00076 ReportLocalRangeScan(const ReportLocalRangeScan& message) : Message(REPORT_LOCAL_RANGE_SCAN) 00077 { 00078 *this = message; 00079 } 00080 ~ReportLocalRangeScan() {} 00081 void SetSensorID(const Byte id) { mSensorID = id; } 00082 void SetSensorLocation(const Point3D& position) { mLocation = position; } 00083 void SetSensorOrientation(const Point3D& orientation) { mOrientation = orientation; } 00084 void SetTimeStamp(const Time& timestamp) { mTimeStamp = timestamp; } 00085 Byte GetSensorID() const { return mSensorID; } 00086 Point3D GetSensorLocation() const { return mLocation; } 00087 Point3D GetSensorOrientation() const { return mOrientation; } 00088 Scan* GetScan() { return &mScan; } 00089 const Scan* GetScan() const { return &mScan; } 00090 Time GetTimeStamp() const { return mTimeStamp; } 00091 virtual bool IsCommand() const { return false; } 00092 virtual int WriteMessageBody(Packet& packet) const; 00093 virtual int ReadMessageBody(const Packet& packet); 00094 virtual Message* Clone() const { return new ReportLocalRangeScan(*this); } 00095 virtual UInt GetPresenceVector() const { return 0; } 00096 virtual UInt GetPresenceVectorSize() const { return 0; } 00097 virtual UInt GetPresenceVectorMask() const { return 0; } 00098 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00099 virtual std::string GetMessageName() const { return "Report Local Range Scan"; } 00100 virtual void ClearMessageBody() 00101 { 00102 mSensorID = 0; 00103 mLocation = mOrientation = Point3D(); 00104 mScan.Clear(); 00105 } 00106 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize) const; 00107 ReportLocalRangeScan& operator=(const ReportLocalRangeScan& message) 00108 { 00109 CopyHeaderData(&message); 00110 mScan = message.mScan; 00111 mSensorID = message.mSensorID; 00112 mLocation = message.mLocation; 00113 mOrientation = message.mOrientation; 00114 return *this; 00115 } 00116 protected: 00117 Byte mSensorID; 00118 Point3D mLocation; 00119 Point3D mOrientation; 00120 Scan mScan; 00121 Time mTimeStamp; 00122 }; 00123 } 00124 00125 #endif 00126 /* End of File */