Miroslaw K. / Mbed 2 deprecated RadarDemo

Dependencies:   BSP_DISCO_F746NG Graphics mbed TS_DISCO_F746NG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Target.h Source File

Target.h

00001 /*
00002     Target.h - Simple simulation of radar target.
00003 
00004     Copyright(c) 2016 karpent at gmail.com, MIT License
00005 
00006     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
00007     to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008     and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
00009 
00010     The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00011 
00012     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00013     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00014     OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00015     THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016 */ 
00017 
00018 #pragma once
00019 
00020 #include "Location.h"
00021 #include "mbed.h"   // for uint32_t
00022 
00023 /**
00024   * @brief Simple simulation of radar target.
00025   */
00026 class Target
00027 {
00028 public:
00029     /// <summary>
00030     /// Initializes a new instance of the <see cref="Target"/> class.
00031     /// </summary>
00032     /// <param name="id">The identifier.</param>
00033     /// <param name="speed">The speed.</param>
00034     /// <param name="direction">The direction.</param>
00035     Target(int id, float speed, float direction);
00036 
00037     Target(int id, float x, float y, float h, float speed, float direction);
00038 
00039     /// <summary>
00040     /// Sets the location angular.
00041     /// </summary>
00042     /// <param name="distance">The distance.</param>
00043     /// <param name="azimuth">The azimuth.</param>
00044     void SetLocationAngular(float distance, float azimuth);
00045 
00046     /// <summary>
00047     /// Gets the location of target.
00048     /// </summary>
00049     /// <returns>Target location</returns>
00050     Location GetLocation();
00051     
00052     /// <summary>
00053     /// Sets target location.
00054     /// </summary>
00055     /// <param name="x">x value.</param>
00056     /// <param name="y">y value.</param>
00057     void SetLocation(float x, float y);
00058 
00059     /// <summary>
00060     /// Update target location for the specified time in miliseconds.
00061     /// </summary>
00062     /// <param name="currentTime">The current time.</param>
00063     void UpdateLocationForTime(uint32_t currentTime);
00064 
00065     float GetX();
00066     float GetY();
00067     float GetAzimuth();
00068     float GetDistance();
00069     
00070     float GetSpeed();
00071     float GetDirection();
00072     int GetType();
00073 
00074     int Id;
00075 
00076 protected:
00077     Location _location;
00078     float _speed;
00079     float _direction;
00080     int _type;
00081     uint32_t _lastUpdateTime;
00082 };
00083