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_MOBILITY_SET_GLOBAL_VECTOR__H 00041 #define __JAUS_MOBILITY_SET_GLOBAL_VECTOR__H 00042 00043 #include "jaus/core/message.h" 00044 #include "jaus/mobility/mobilitycodes.h" 00045 00046 namespace JAUS 00047 { 00063 class JAUS_MOBILITY_DLL SetGlobalVector : public Message 00064 { 00065 public: 00073 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00074 { 00075 public: 00076 const static Byte Speed = 0x01; 00077 const static Byte Altitude = 0x02; 00078 const static Byte Heading = 0x04; 00079 const static Byte Roll = 0x08; 00080 const static Byte Pitch = 0x10; 00081 }; 00088 class JAUS_MOBILITY_DLL Limits : public JAUS::Limits 00089 { 00090 public: 00091 const static double MinSpeed; 00092 const static double MaxSpeed; 00093 const static double MinElevation; 00094 const static double MaxElevation; 00095 const static double MinAngle; 00096 const static double MaxAngle; 00097 }; 00098 SetGlobalVector(const Address& dest = Address(), const Address& src = Address()); 00099 SetGlobalVector(const SetGlobalVector& message); 00100 ~SetGlobalVector(); 00101 bool SetSpeed(const double value); 00102 bool SetAltitude(const double value); 00103 bool SetHeading(const double radians); 00104 bool SetRoll(const double radians); 00105 bool SetPitch(const double radians); 00106 inline double GetSpeed() const { return mSpeed; } 00107 inline double GetAltitude() const { return mAltitude; } 00108 inline double GetHeading() const { return mHeading; } 00109 inline double GetRoll() const { return mRoll; } 00110 inline double GetPitch() const { return mPitch; } 00111 virtual bool IsCommand() const { return true; } 00112 virtual int WriteMessageBody(Packet& packet) const; 00113 virtual int ReadMessageBody(const Packet& packet); 00114 virtual Message* Clone() const { return new SetGlobalVector(*this); } 00115 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00116 virtual UInt GetPresenceVectorSize() const { return BYTE_SIZE; } 00117 virtual UInt GetPresenceVectorMask() const { return 0x1F; } 00118 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00119 virtual std::string GetMessageName() const { return "Set Global Vector"; } 00120 virtual void ClearMessageBody(); 00121 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00122 virtual int RunTestCase() const; 00123 SetGlobalVector& operator=(const SetGlobalVector& message); 00124 protected: 00125 Byte mPresenceVector; 00126 double mSpeed; 00127 double mAltitude; 00128 double mHeading; 00129 double mRoll; 00130 double mPitch; 00131 00132 }; 00133 } 00134 00135 #endif 00136 /* End of File */