mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
refs #195, refs#212, flightplan widget (completely encapsulated) for FP handling
This commit is contained in:
65
src/blackgui/flightplancomponent.h
Normal file
65
src/blackgui/flightplancomponent.h
Normal 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
|
||||
Reference in New Issue
Block a user