#ifndef RADARWINDOW_H
#define RADARWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QObject>
#include <QtCore>
#include <QtGui>
#include <QTimer>
#include <QTime>
#include <QPen>
#include <QSound>
#include "mytextitem.h"
#include "cflwidget.h"
namespace Ui {
class RadarWindow;
}
{
Q_OBJECT
public:
explicit RadarWindow
(QWidget *parent
= 0);
~RadarWindow();
QVector<double> loadLatFromMap
(const QString &filename
);
QVector<double> loadLonFromMap
(const QString &filename
);
void drawMap
(const QString &filename
);
void drawMapSection
(const QString &filename
);
void drawNavPoints
(const QStringList &navPointList,
const double &scale
);
void drawRWY
(const QString &filename
);
void drawCTR
(const QString &filename
);
void drawTMA
(const QString &filename
);
void drawAircraft(const QHash<QString, QStringList> &flightsimhash, const double &scale);
QVector<double> prediction_calculation(const double &init_LON, const double &init_LAT, const double &init_HDG, const double &seconds, const double &GS);
double BCOtoDEC(const double &code);
void drawCollisonPoint
(const QString &aircraft_1,
const QString &aircraft_2
);
double calculateDistance(const double &LAT_1, const double &LON_1, const double &LAT_2, const double &LON_2);
void drawSTCAPoint
(const QString &aircraft_1,
const QString &aircraft_2
);
bool determineSTCAPoint
(const QString &aircraft_1,
const QString &aircraft_2
);
void testSTCA();
double getAlpha(const double &HDG);
double ROCD
(const QHash<QString, QStringList>
&flightsimhash,
const QString CallSign
);
private slots:
void update_drawing();
void dataFromFlightSim
(const QString &callSign,
const QString &message
);
void update_flightHistoryNum(const int &number);
void changeselection();
void aircraftClicked
(const QString &text
);
void deselectAircraft_slot
(const QString &text
);
void getSTRIPDataFrom
(const QString &dataFrom
);
void GSclicked_slot();
void CFLclicked_slot
(const QString &callsign
);
signals:
void changeEmergencyStatus(const bool &);
void closed_connection
(const QString &callsign
);
void CFLclicked
(const QString &callsign
);
private:
Ui::RadarWindow *ui;
MyTextItem *mytextitem;
CFLWidget *cflwidget;
QHash<QString, QStringList> FlightSimHash;
int FlightHistory_num;
int FROM;
int TO;
bool visibility;
bool HOMEpressed;
QHash<QString, bool> STCAhash;
protected:
//virtual void wheelEvent(QWheelEvent *event);
};
#endif // RADARWINDOW_H
#ifndef RADARWINDOW_H
#define RADARWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QObject>
#include <QtCore>
#include <QtGui>
#include <QTimer>
#include <QTime>
#include <QPen>
#include <QSound>
#include "mytextitem.h"
#include "cflwidget.h"
namespace Ui {
class RadarWindow;
}
class RadarWindow : public QMainWindow
{
Q_OBJECT
public:
explicit RadarWindow(QWidget *parent = 0);
~RadarWindow();
QVector<double> loadLatFromMap(const QString &filename);
QVector<double> loadLonFromMap(const QString &filename);
QStringList loadNavPoints(const QString &filename);
void drawMap(const QString &filename);
void drawMapSection(const QString &filename);
void drawNavPoints(const QStringList &navPointList, const double &scale);
void drawRWY(const QString &filename);
void drawCTR(const QString &filename);
void drawTMA(const QString &filename);
void drawAircraft(const QHash<QString, QStringList> &flightsimhash, const double &scale);
QVector<double> prediction_calculation(const double &init_LON, const double &init_LAT, const double &init_HDG, const double &seconds, const double &GS);
double BCOtoDEC(const double &code);
void drawCollisonPoint(const QString &aircraft_1, const QString &aircraft_2);
double calculateDistance(const double &LAT_1, const double &LON_1, const double &LAT_2, const double &LON_2);
void drawSTCAPoint(const QString &aircraft_1, const QString &aircraft_2);
bool determineSTCAPoint(const QString &aircraft_1, const QString &aircraft_2);
void testSTCA();
double getAlpha(const double &HDG);
double ROCD(const QHash<QString, QStringList> &flightsimhash, const QString CallSign);
QStringList readSTRIP(const QString &fileName, const QString &CallSign);
void overwriteSQUAWK(const QString &fileName, const QString &CallSign, const QString &squawk);
private slots:
void update_drawing();
void dataFromFlightSim(const QString &callSign, const QString &message);
void update_flightHistoryNum(const int &number);
void changeselection();
void aircraftClicked(const QString &text);
void deselectAircraft_slot(const QString &text);
void getSTRIPDataFrom(const QString &dataFrom);
void GSclicked_slot();
void CFLclicked_slot(const QString &callsign);
signals:
void changeEmergencyStatus(const bool &);
void closed_connection(const QString &callsign);
void CFLclicked(const QString &callsign);
private:
Ui::RadarWindow *ui;
QGraphicsScene *scene;
MyTextItem *mytextitem;
CFLWidget *cflwidget;
QGraphicsEllipseItem *ellipse;
QGraphicsRectItem *rectangle;
QPolygonF polygon;
QPolygonF poly;
QGraphicsLineItem *line;
QGraphicsPolygonItem *polygonItem;
QGraphicsTextItem *pointText;
QGraphicsTextItem *aircraftText;
QPainterPath *path;
QStringList CallSignList;
QStringList MessageList;
QStringList SelectedAircraftList;
QHash<QString, QStringList> FlightSimHash;
QStringList selectedCallSign;
QTimer *update_timer;
int FlightHistory_num;
int FROM;
int TO;
bool visibility;
bool HOMEpressed;
QStringList OnlineAircraftList;
QHash<QString, bool> STCAhash;
QString StripDataFrom;
protected:
//virtual void wheelEvent(QWheelEvent *event);
virtual void keyPressEvent(QKeyEvent *e);
virtual void keyReleaseEvent(QKeyEvent *e);
};
#endif // RADARWINDOW_H
To copy to clipboard, switch view to plain text mode
Bookmarks