mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Ref T658, matching script
This commit is contained in:
@@ -44,6 +44,16 @@ namespace BlackMisc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAircraftMatcherSetup::doRunMsNetworkEntryScript() const
|
||||
{
|
||||
return m_msNetworkEnabled && !m_msNetworkEntryFile.isEmpty();
|
||||
}
|
||||
|
||||
bool CAircraftMatcherSetup::doRunMsMatchingStageScript() const
|
||||
{
|
||||
return m_msMatchingEnabled && !m_msMatchingStageFile.isEmpty();
|
||||
}
|
||||
|
||||
void CAircraftMatcherSetup::setVerificationAtStartup(bool verify)
|
||||
{
|
||||
MatchingMode m = this->getMatchingMode();
|
||||
@@ -115,7 +125,7 @@ namespace BlackMisc
|
||||
this->reset(MatchingStepwiseReducePlusScoreBased);
|
||||
m_msNetworkEntryFile.clear();
|
||||
m_msMatchingStageFile.clear();
|
||||
m_msNetworkEnabled = false;
|
||||
m_msNetworkEnabled = false;
|
||||
m_msMatchingEnabled = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,11 @@ namespace BlackMisc
|
||||
bool isMsMatchingStageEnabled() const { return m_msMatchingEnabled; }
|
||||
//! @}
|
||||
|
||||
//! Run the scripts @{
|
||||
bool doRunMsNetworkEntryScript() const;
|
||||
bool doRunMsMatchingStageScript() const;
|
||||
//! @}
|
||||
|
||||
//! Is matching script enabled @{
|
||||
void setMsNetworkEntryEnabled(bool enabled) { m_msNetworkEnabled = enabled; }
|
||||
void setMsMatchingStageEnabled(bool enabled) { m_msMatchingEnabled = enabled; }
|
||||
|
||||
@@ -12,49 +12,49 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
void MSNetworkValues::setCallsign(const QString &callsign)
|
||||
void MSSwiftValues::setCallsign(const QString &callsign)
|
||||
{
|
||||
if (m_callsign == callsign) { return; }
|
||||
m_callsign = callsign;
|
||||
emit this->callsignChanged();
|
||||
}
|
||||
|
||||
void MSNetworkValues::setDbAircraftIcaoId(int id)
|
||||
void MSSwiftValues::setDbAircraftIcaoId(int id)
|
||||
{
|
||||
if (id == m_dbAircraftIcaoId) { return; }
|
||||
m_dbAircraftIcaoId = id;
|
||||
emit this->dbAircraftIcaoIdChanged();
|
||||
}
|
||||
|
||||
void MSNetworkValues::setDbAirlineIcaoId(int id)
|
||||
void MSSwiftValues::setDbAirlineIcaoId(int id)
|
||||
{
|
||||
if (id == m_dbAirlineIcaoId) { return; }
|
||||
m_dbAirlineIcaoId = id;
|
||||
emit this->dbAirlineIcaoIdChanged();
|
||||
}
|
||||
|
||||
void MSNetworkValues::setDbLiveryId(int id)
|
||||
void MSSwiftValues::setDbLiveryId(int id)
|
||||
{
|
||||
if (id == m_dbLiveryId) { return; }
|
||||
m_dbLiveryId = id;
|
||||
emit this->dbLiveryIdChanged();
|
||||
}
|
||||
|
||||
void MSNetworkValues::setAircraftIcao(const QString &aircraftIcao)
|
||||
void MSSwiftValues::setAircraftIcao(const QString &aircraftIcao)
|
||||
{
|
||||
if (aircraftIcao == m_aircraftIcao) { return; }
|
||||
m_aircraftIcao = aircraftIcao;
|
||||
emit this->aircraftIcaoChanged();
|
||||
}
|
||||
|
||||
void MSNetworkValues::setAirlineIcao(const QString &airlineIcao)
|
||||
void MSSwiftValues::setAirlineIcao(const QString &airlineIcao)
|
||||
{
|
||||
if (airlineIcao == m_airlineIcao) { return; }
|
||||
m_airlineIcao = airlineIcao;
|
||||
emit this->airlineIcaoChanged();
|
||||
}
|
||||
|
||||
void MSNetworkValues::setLivery(const QString &livery)
|
||||
void MSSwiftValues::setLivery(const QString &livery)
|
||||
{
|
||||
if (livery == m_livery) { return; }
|
||||
m_livery = livery;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BlackMisc
|
||||
namespace Simulation
|
||||
{
|
||||
//! The network values
|
||||
class BLACKMISC_EXPORT MSNetworkValues : public QObject
|
||||
class BLACKMISC_EXPORT MSSwiftValues : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -37,7 +37,19 @@ namespace BlackMisc
|
||||
|
||||
public:
|
||||
//! Ctor
|
||||
Q_INVOKABLE MSNetworkValues() {}
|
||||
Q_INVOKABLE MSSwiftValues() {}
|
||||
|
||||
//! Ctor
|
||||
Q_INVOKABLE MSSwiftValues(const QString &cs,
|
||||
const QString &aircraftIcao, int idAircraftIcao,
|
||||
const QString &airlineIcao, int idAirlineIcao,
|
||||
const QString &livery, int liveryId) :
|
||||
m_callsign(cs.trimmed().toUpper()),
|
||||
m_aircraftIcao(aircraftIcao.trimmed().toUpper()),
|
||||
m_airlineIcao(airlineIcao.trimmed().toUpper()),
|
||||
m_livery(livery.trimmed().toUpper()),
|
||||
m_dbAircraftIcaoId(idAircraftIcao), m_dbAirlineIcaoId(idAirlineIcao), m_dbLiveryId(liveryId)
|
||||
{}
|
||||
|
||||
//! Get callsign
|
||||
const QString &getCallsign() const { return m_callsign; }
|
||||
|
||||
Reference in New Issue
Block a user