File: targetmotionanalysis.h

package info (click to toggle)
openssn 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,340 kB
  • sloc: cpp: 10,973; makefile: 80
file content (140 lines) | stat: -rw-r--r-- 3,831 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/***************************************************************************
                          targetmotionanalysis.h  -  description
                             -------------------
    begin                : Sat Mar 16 2002
    copyright            : (C) 2002 by Michael Bridak
    email                : michael.bridak@verizon.net
$Id: targetmotionanalysis.h,v 1.6 2003/04/20 16:55:49 mbridak Exp $
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License.     *
 *    .                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef TARGETMOTIONANALYSIS_H
#define TARGETMOTIONANALYSIS_H
#define MAXTRACKERS 13

#include "boatpositionlog.h"
#include "contact.h"

/**
  *@author Michael Bridak
  */

class TargetMotionAnalysis : public BoatPositionLog  {
public:
	Contact Solution[12];
	Uint32 textcolor, black, white, red, green, yellow, mapcolor;//Place to hold color info

	double our_heading;
	double target_heading;

	float our_speed;
	float target_speed;	

	/** an SDL surface to plot our GeoPlot on */
	SDL_Surface *GeoPlotScreen;

  /**  */
  int plotscale;

  /** Geoplot centering flag */
  bool centerGeoPlot;

	TargetMotionAnalysis();
	~TargetMotionAnalysis();

  /** Frees a tracker to be used later. */
  void ClearTracker(int tracker);

  /** Returns the TRUE if tracker is in use */
  bool GetTrackerState(int tracker) const;

  /** Assign a tracker to a target */
  void AssignTracker(int tracker, int target);

  /** Assign Target designation and Tracker to trace currently under
cursor on SONAR screen.
 */
  void DesignateContact();

  /** Display a GeoPlot for the designated contact based on the
position of the boat and the bearing history of the contact.
 */
  void DisplayGeoPlot(int xoffset, int yoffset);

  /** Display the LOS Diagram
 */
  void DisplayLOS();

  /** Creates a speed ruler which we will use to drag around the
GeoPlot to test solutions.
 */
  void CreateSpeedRuler();

  /** Plots the amount of error from the expected bearing to target
and the actual bearing recieved.
 */
  void BearingDevitaionPlot();

  /** Record the boats current position
 */
  void RecordBoatPosition(float latitude, float longitude, double bearing, Uint32 tick);

  /** Lock Mutex */
  void Lock();

  /** Unlock Mutex */
  void UnLock();

  /** Initialize the graphics */
  void InitGraphics();

  /** No descriptions */
  void PlotPixel(int x, int y, Uint32 color);

  /** erases the work screen */
  void ClearGeoPlot();

  /** Plot the boats history */
  void PlotHistory(int scale, int change_scrollx, int change_scrolly);

  /** Draws a line....What were you expecting? */
  void DrawLine(int X1,int Y1,int X2,int Y2,Uint32 Color);

  /** No descriptions */
  void DrawDot(int x, int y, Uint32 color);

  /** Increments plotscale to zoom in on the GeoPlot */
  void IncreasePlotScale();

  /** Decriment the plotscale to zoom out of GeoPlot */
  void DecreasePlotScale();

  /** No descriptions */
  void ToggleGeoPlotCenter();

  /** Fill in the initial values for the solution. */
  void InitializeSolution(float LatYards, float LonYards, int Speed, int Heading);

private: // Private attributes
  /**  */
  bool trackerstate[MAXTRACKERS];
	struct packet {
		float LatYards;
		float LonYards;
		float BearingToTarget;
	};



	SDL_mutex *MutexLock;
};

#endif