Optimaze with new mbed os for study
Dependencies: TS_DISCO_F746NG BSP_DISCO_F746NG Graphics
Diff: RadarDemo/Target.h
- Revision:
- 0:d8b9955d2b36
- Child:
- 1:5e49b46de1b0
diff -r 000000000000 -r d8b9955d2b36 RadarDemo/Target.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RadarDemo/Target.h Fri Nov 04 01:02:37 2016 +0000 @@ -0,0 +1,67 @@ +// +// Target.h - Simple simulation of radar target +// + +#pragma once + +#include "Location.h" +#include "mbed.h" // for uint32_t + +class Target +{ +public: + /// <summary> + /// Initializes a new instance of the <see cref="Target"/> class. + /// </summary> + /// <param name="id">The identifier.</param> + /// <param name="speed">The speed.</param> + /// <param name="direction">The direction.</param> + Target(int id, float speed, float direction); + + Target(int id, float x, float y, float h, float speed, float direction); + + /// <summary> + /// Sets the location angular. + /// </summary> + /// <param name="distance">The distance.</param> + /// <param name="azimuth">The azimuth.</param> + void SetLocationAngular(float distance, float azimuth); + + /// <summary> + /// Gets the location of target. + /// </summary> + /// <returns>Target location</returns> + Location GetLocation(); + + /// <summary> + /// Sets target location. + /// </summary> + /// <param name="x">x value.</param> + /// <param name="y">y value.</param> + void SetLocation(float x, float y); + + /// <summary> + /// Update target location for the specified time in miliseconds. + /// </summary> + /// <param name="currentTime">The current time.</param> + void UpdateLocationForTime(uint32_t currentTime); + + float GetX(); + float GetY(); + float GetAzimuth(); + float GetDistance(); + + float GetSpeed(); + float GetDirection(); + int GetType(); + + int Id; + +protected: + Location _location; + float _speed; + float _direction; + int _type; + uint32_t _lastUpdateTime; +}; +