refs #195, refs#212, flightplan widget (completely encapsulated) for FP handling

This commit is contained in:
Klaus Basan
2014-04-26 16:05:25 +02:00
parent 1644890938
commit 4149b0a19d
4 changed files with 1100 additions and 7 deletions

View File

@@ -0,0 +1,65 @@
#ifndef BLACKGUI_FLIGHTPLANCOMPONENT_H
#define BLACKGUI_FLIGHTPLANCOMPONENT_H
#include "blackgui/runtimebasedcomponent.h"
#include "blackmisc/avaircraft.h"
#include "blackmisc/avflightplan.h"
#include <QTabWidget>
namespace Ui { class CFlightPlanComponent; }
namespace BlackGui
{
//! Flight plan widget
class CFlightPlanComponent : public QTabWidget, public CRuntimeBasedComponent
{
Q_OBJECT
public:
//! Constructor
explicit CFlightPlanComponent(QWidget *parent = nullptr);
//! Destructor
~CFlightPlanComponent();
public slots:
//! Prefill with aircraft data
void prefillWithAircraftData(const BlackMisc::Aviation::CAircraft &aircraftData);
//! Prefill with aircraft dara
void prefillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan);
private:
Ui::CFlightPlanComponent *ui;
//! Validate, generates status messages
BlackMisc::CStatusMessageList validateAndInitializeFlightPlan(BlackMisc::Aviation::CFlightPlan &fligtPlan);
//! Default value for airport ICAO airports
static const QString &defaultIcao() { static QString d("ICAO"); return d; }
//! Default value for time
static const QString &defaultTime() { static QString t("00:00"); return t; }
private slots:
//! Send flightplan
void sendFlightPlan();
//! Reset Flightplan
void resetFlightPlan();
//! Load Flightplan
void loadFlightPlan();
//! Remark
void buildRemarkString();
//! Copy over
void copyRemarks();
//! Show generator tab page
void currentTabGenerator();
};
}
#endif // guard