mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refs #634, allow to use livery for testing
* added raw data in selector * adjusted matcher component
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "blackgui/uppercasevalidator.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include <QDragEnterEvent>
|
||||
|
||||
using namespace BlackGui;
|
||||
@@ -101,6 +102,12 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
QString CDbLiverySelectorComponent::getRawCombinedCode() const
|
||||
{
|
||||
const QString cc(this->ui->le_Livery->text().trimmed().toUpper());
|
||||
return stripDesignatorFromCompleterString(cc);
|
||||
}
|
||||
|
||||
void CDbLiverySelectorComponent::setReadOnly(bool readOnly)
|
||||
{
|
||||
this->ui->le_Livery->setReadOnly(readOnly);
|
||||
@@ -211,6 +218,5 @@ namespace BlackGui
|
||||
if (i < 0) { return l; }
|
||||
return l.left(i);
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
||||
//! Livery
|
||||
BlackMisc::Aviation::CLivery getLivery() const;
|
||||
|
||||
//! Livery combined code
|
||||
QString getRawCombinedCode() const;
|
||||
|
||||
//! Show description
|
||||
void withLiveryDescription(bool description);
|
||||
|
||||
@@ -64,7 +67,6 @@ namespace BlackGui
|
||||
//! Clear selection
|
||||
void clear();
|
||||
|
||||
|
||||
signals:
|
||||
//! Distributor was changed
|
||||
void changedLivery(const BlackMisc::Aviation::CLivery &livery);
|
||||
|
||||
@@ -114,8 +114,10 @@ namespace BlackGui
|
||||
const QString model(ui->le_ModelString->text().trimmed().toUpper());
|
||||
const QString combined(ui->comp_CombinedCode->getCombinedType());
|
||||
const QString manufacturer(ui->le_Manufacturer->text().trimmed().toUpper());
|
||||
const QString liveryCombinedCode(ui->comp_LiverySelector->getRawCombinedCode());
|
||||
|
||||
CCallsign cs("SWIFT");
|
||||
static const CCallsign cs("SWIFT");
|
||||
static const CUser pilot("123456", "swift Test", cs);
|
||||
CSimulatedAircraft sa;
|
||||
if (!model.isEmpty())
|
||||
{
|
||||
@@ -124,18 +126,16 @@ namespace BlackGui
|
||||
}
|
||||
sa.setCallsign(cs);
|
||||
|
||||
if (!aircraft.isEmpty())
|
||||
{
|
||||
CAircraftIcaoCode icao(aircraft, combined);
|
||||
icao.setManufacturer(manufacturer);
|
||||
sa.setAircraftIcaoCode(icao);
|
||||
}
|
||||
if (!airline.isEmpty())
|
||||
{
|
||||
const CAirlineIcaoCode al(airline);
|
||||
const CLivery l(CLivery::getStandardCode(al), al, "Standard");
|
||||
sa.setLivery(l);
|
||||
}
|
||||
CAircraftIcaoCode icao(aircraft, combined);
|
||||
icao.setManufacturer(manufacturer);
|
||||
sa.setAircraftIcaoCode(icao);
|
||||
|
||||
const CAirlineIcaoCode al(airline);
|
||||
const CLivery l(liveryCombinedCode.isEmpty() ? CLivery::getStandardCode(al) : liveryCombinedCode,
|
||||
al,
|
||||
"Standard");
|
||||
sa.setLivery(l);
|
||||
sa.setPilot(pilot);
|
||||
return sa;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user