mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +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/uppercasevalidator.h"
|
||||||
#include "blackgui/guiapplication.h"
|
#include "blackgui/guiapplication.h"
|
||||||
#include "blackmisc/aviation/liverylist.h"
|
#include "blackmisc/aviation/liverylist.h"
|
||||||
|
#include "blackmisc/stringutils.h"
|
||||||
#include <QDragEnterEvent>
|
#include <QDragEnterEvent>
|
||||||
|
|
||||||
using namespace BlackGui;
|
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)
|
void CDbLiverySelectorComponent::setReadOnly(bool readOnly)
|
||||||
{
|
{
|
||||||
this->ui->le_Livery->setReadOnly(readOnly);
|
this->ui->le_Livery->setReadOnly(readOnly);
|
||||||
@@ -211,6 +218,5 @@ namespace BlackGui
|
|||||||
if (i < 0) { return l; }
|
if (i < 0) { return l; }
|
||||||
return l.left(i);
|
return l.left(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
|||||||
//! Livery
|
//! Livery
|
||||||
BlackMisc::Aviation::CLivery getLivery() const;
|
BlackMisc::Aviation::CLivery getLivery() const;
|
||||||
|
|
||||||
|
//! Livery combined code
|
||||||
|
QString getRawCombinedCode() const;
|
||||||
|
|
||||||
//! Show description
|
//! Show description
|
||||||
void withLiveryDescription(bool description);
|
void withLiveryDescription(bool description);
|
||||||
|
|
||||||
@@ -64,7 +67,6 @@ namespace BlackGui
|
|||||||
//! Clear selection
|
//! Clear selection
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Distributor was changed
|
//! Distributor was changed
|
||||||
void changedLivery(const BlackMisc::Aviation::CLivery &livery);
|
void changedLivery(const BlackMisc::Aviation::CLivery &livery);
|
||||||
|
|||||||
@@ -114,8 +114,10 @@ namespace BlackGui
|
|||||||
const QString model(ui->le_ModelString->text().trimmed().toUpper());
|
const QString model(ui->le_ModelString->text().trimmed().toUpper());
|
||||||
const QString combined(ui->comp_CombinedCode->getCombinedType());
|
const QString combined(ui->comp_CombinedCode->getCombinedType());
|
||||||
const QString manufacturer(ui->le_Manufacturer->text().trimmed().toUpper());
|
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;
|
CSimulatedAircraft sa;
|
||||||
if (!model.isEmpty())
|
if (!model.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -124,18 +126,16 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
sa.setCallsign(cs);
|
sa.setCallsign(cs);
|
||||||
|
|
||||||
if (!aircraft.isEmpty())
|
|
||||||
{
|
|
||||||
CAircraftIcaoCode icao(aircraft, combined);
|
CAircraftIcaoCode icao(aircraft, combined);
|
||||||
icao.setManufacturer(manufacturer);
|
icao.setManufacturer(manufacturer);
|
||||||
sa.setAircraftIcaoCode(icao);
|
sa.setAircraftIcaoCode(icao);
|
||||||
}
|
|
||||||
if (!airline.isEmpty())
|
|
||||||
{
|
|
||||||
const CAirlineIcaoCode al(airline);
|
const CAirlineIcaoCode al(airline);
|
||||||
const CLivery l(CLivery::getStandardCode(al), al, "Standard");
|
const CLivery l(liveryCombinedCode.isEmpty() ? CLivery::getStandardCode(al) : liveryCombinedCode,
|
||||||
|
al,
|
||||||
|
"Standard");
|
||||||
sa.setLivery(l);
|
sa.setLivery(l);
|
||||||
}
|
sa.setPilot(pilot);
|
||||||
return sa;
|
return sa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user