Optimaze with new mbed os for study

Dependencies:   TS_DISCO_F746NG BSP_DISCO_F746NG Graphics

Committer:
karpent
Date:
Fri Nov 04 01:02:37 2016 +0000
Revision:
0:d8b9955d2b36
Child:
1:5e49b46de1b0
Initial revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
karpent 0:d8b9955d2b36 1 //
karpent 0:d8b9955d2b36 2 // Target.h - Simple simulation of radar target
karpent 0:d8b9955d2b36 3 //
karpent 0:d8b9955d2b36 4
karpent 0:d8b9955d2b36 5 #pragma once
karpent 0:d8b9955d2b36 6
karpent 0:d8b9955d2b36 7 #include "Location.h"
karpent 0:d8b9955d2b36 8 #include "mbed.h" // for uint32_t
karpent 0:d8b9955d2b36 9
karpent 0:d8b9955d2b36 10 class Target
karpent 0:d8b9955d2b36 11 {
karpent 0:d8b9955d2b36 12 public:
karpent 0:d8b9955d2b36 13 /// <summary>
karpent 0:d8b9955d2b36 14 /// Initializes a new instance of the <see cref="Target"/> class.
karpent 0:d8b9955d2b36 15 /// </summary>
karpent 0:d8b9955d2b36 16 /// <param name="id">The identifier.</param>
karpent 0:d8b9955d2b36 17 /// <param name="speed">The speed.</param>
karpent 0:d8b9955d2b36 18 /// <param name="direction">The direction.</param>
karpent 0:d8b9955d2b36 19 Target(int id, float speed, float direction);
karpent 0:d8b9955d2b36 20
karpent 0:d8b9955d2b36 21 Target(int id, float x, float y, float h, float speed, float direction);
karpent 0:d8b9955d2b36 22
karpent 0:d8b9955d2b36 23 /// <summary>
karpent 0:d8b9955d2b36 24 /// Sets the location angular.
karpent 0:d8b9955d2b36 25 /// </summary>
karpent 0:d8b9955d2b36 26 /// <param name="distance">The distance.</param>
karpent 0:d8b9955d2b36 27 /// <param name="azimuth">The azimuth.</param>
karpent 0:d8b9955d2b36 28 void SetLocationAngular(float distance, float azimuth);
karpent 0:d8b9955d2b36 29
karpent 0:d8b9955d2b36 30 /// <summary>
karpent 0:d8b9955d2b36 31 /// Gets the location of target.
karpent 0:d8b9955d2b36 32 /// </summary>
karpent 0:d8b9955d2b36 33 /// <returns>Target location</returns>
karpent 0:d8b9955d2b36 34 Location GetLocation();
karpent 0:d8b9955d2b36 35
karpent 0:d8b9955d2b36 36 /// <summary>
karpent 0:d8b9955d2b36 37 /// Sets target location.
karpent 0:d8b9955d2b36 38 /// </summary>
karpent 0:d8b9955d2b36 39 /// <param name="x">x value.</param>
karpent 0:d8b9955d2b36 40 /// <param name="y">y value.</param>
karpent 0:d8b9955d2b36 41 void SetLocation(float x, float y);
karpent 0:d8b9955d2b36 42
karpent 0:d8b9955d2b36 43 /// <summary>
karpent 0:d8b9955d2b36 44 /// Update target location for the specified time in miliseconds.
karpent 0:d8b9955d2b36 45 /// </summary>
karpent 0:d8b9955d2b36 46 /// <param name="currentTime">The current time.</param>
karpent 0:d8b9955d2b36 47 void UpdateLocationForTime(uint32_t currentTime);
karpent 0:d8b9955d2b36 48
karpent 0:d8b9955d2b36 49 float GetX();
karpent 0:d8b9955d2b36 50 float GetY();
karpent 0:d8b9955d2b36 51 float GetAzimuth();
karpent 0:d8b9955d2b36 52 float GetDistance();
karpent 0:d8b9955d2b36 53
karpent 0:d8b9955d2b36 54 float GetSpeed();
karpent 0:d8b9955d2b36 55 float GetDirection();
karpent 0:d8b9955d2b36 56 int GetType();
karpent 0:d8b9955d2b36 57
karpent 0:d8b9955d2b36 58 int Id;
karpent 0:d8b9955d2b36 59
karpent 0:d8b9955d2b36 60 protected:
karpent 0:d8b9955d2b36 61 Location _location;
karpent 0:d8b9955d2b36 62 float _speed;
karpent 0:d8b9955d2b36 63 float _direction;
karpent 0:d8b9955d2b36 64 int _type;
karpent 0:d8b9955d2b36 65 uint32_t _lastUpdateTime;
karpent 0:d8b9955d2b36 66 };
karpent 0:d8b9955d2b36 67