Optimaze with new mbed os for study

Dependencies:   TS_DISCO_F746NG BSP_DISCO_F746NG Graphics

RadarDemo/RadarDemo.h

Committer:
karpent
Date:
2016-11-04
Revision:
0:d8b9955d2b36
Child:
1:5e49b46de1b0

File content as of revision 0:d8b9955d2b36:

//
// RadarDemo.h - example of graphic commands usage to create 2D graphics.
//

#pragma once

#include "Radar.h"

/// <summary>
/// Radar display demo class.
/// </summary>
///<seealso cref="Radar" />

/**
@verbatim
#include "RK043FN48H.h"
#include "RadarDemo.h"

RK043FN48H display;

int main()
{
    RadarDemo demo(&display);
    demo.Initialize();
    
    while(demo.IsRunning()) {
        demo.Render();
        wait(0.04f);
    }
}
@endverbatim
*/
class RadarDemo : public Radar
{
public:
    /// <summary>
    /// The radar scan period in milisecons.
    /// </summary>
    uint32_t scanPeriod;

    /// <summary>
    /// Duration time of the demo in milisecons.
    /// Set <c>demoTime</c> to 0 if you do not need the time limit.
    /// Set for 0 
    /// </summary>
    uint32_t demoTime;

    /// <summary>
    /// Class constructor.
    /// </summary>
    /// <param name="display">The display.</param>
    RadarDemo(Display* display);

    /// <summary>
    /// Class destructor.
    /// </summary>
    ~RadarDemo();

    /// <summary>
    /// Initializes radar demo instance. Generates sample data for the demo.
    /// </summary>
    void Initialize();

    /// <summary>
    /// Renders single frame of radar imaging.
    /// </summary>
    void Render();

    /// <summary>
    /// Determines whether this instance is running.
    /// </summary>
    /// <returns>
    ///   <c>true</c> if this instance is running; otherwise, <c>false</c>.
    /// </returns>
    bool IsRunning();
    
    bool NeedsRedraw();
    
    void UnvalidateBackground();

    /// <summary>
    /// Generate sample targets.
    /// </summary>
    /// <param name="count">The number of targets to create.</param>
    void AddSampleTargets(int count);
    
#ifndef _SDL_timer_h
    Timer t;
#endif

private:
    uint32_t lastScanTime;
    uint32_t runningTime;
    float currentBeamAngle;
    float lastBeamAngle;
    
    bool _needsRedraw;
};