mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Ref T658, settings for matching (dirs/UI)
This commit is contained in:
@@ -71,7 +71,7 @@ namespace BlackMisc
|
||||
return u"algorithm: '" % this->getMatchingAlgorithmAsString() %
|
||||
u"' mode: '" % this->getMatchingModeAsString() %
|
||||
u"' strategy: '" % this->getPickStrategyAsString() %
|
||||
u'\'';
|
||||
u"\' matching script: " % boolToOnOff(m_msNetworkEnabled) % u'/' % boolToOnOff(m_msMatchingEnabled);
|
||||
}
|
||||
|
||||
CVariant CAircraftMatcherSetup::propertyByIndex(const CPropertyIndex &index) const
|
||||
@@ -80,9 +80,13 @@ namespace BlackMisc
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexMatchingAlgorithm: return CVariant::fromValue(m_algorithm);
|
||||
case IndexMatchingMode: return CVariant::fromValue(m_mode);
|
||||
case IndexPickStrategy: return CVariant::fromValue(m_strategy);
|
||||
case IndexMatchingAlgorithm: return CVariant::fromValue(m_algorithm);
|
||||
case IndexMatchingMode: return CVariant::fromValue(m_mode);
|
||||
case IndexPickStrategy: return CVariant::fromValue(m_strategy);
|
||||
case IndexMsNetworkEntryFile: return CVariant::fromValue(m_msNetworkEntryFile);
|
||||
case IndexMsMatchingStageFile: return CVariant::fromValue(m_msMatchingStageFile);
|
||||
case IndexMsNetworkEnabled: return CVariant::fromValue(m_msNetworkEnabled);
|
||||
case IndexMsMatchingStageEnabled: return CVariant::fromValue(m_msMatchingEnabled);
|
||||
default: break;
|
||||
}
|
||||
return CValueObject::propertyByIndex(index);
|
||||
@@ -97,6 +101,10 @@ namespace BlackMisc
|
||||
case IndexMatchingAlgorithm: m_algorithm = variant.toInt(); break;
|
||||
case IndexMatchingMode: m_mode = variant.toInt(); break;
|
||||
case IndexPickStrategy: m_strategy = variant.toInt(); break;
|
||||
case IndexMsNetworkEntryFile: m_msNetworkEntryFile = variant.toQString(); break;
|
||||
case IndexMsMatchingStageFile: m_msMatchingStageFile = variant.toQString(); break;
|
||||
case IndexMsNetworkEnabled: m_msNetworkEnabled = variant.toBool(); break;
|
||||
case IndexMsMatchingStageEnabled: m_msNetworkEnabled = variant.toBool(); break;
|
||||
default: break;
|
||||
}
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
@@ -105,6 +113,10 @@ namespace BlackMisc
|
||||
void CAircraftMatcherSetup::reset()
|
||||
{
|
||||
this->reset(MatchingStepwiseReducePlusScoreBased);
|
||||
m_msNetworkEntryFile.clear();
|
||||
m_msMatchingStageFile.clear();
|
||||
m_msNetworkEnabled = false;
|
||||
m_msMatchingEnabled = false;
|
||||
}
|
||||
|
||||
void CAircraftMatcherSetup::reset(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
||||
|
||||
@@ -94,7 +94,11 @@ namespace BlackMisc
|
||||
{
|
||||
IndexMatchingAlgorithm = CPropertyIndex::GlobalIndexCAircraftMatcherSetup,
|
||||
IndexMatchingMode,
|
||||
IndexPickStrategy
|
||||
IndexPickStrategy,
|
||||
IndexMsNetworkEntryFile,
|
||||
IndexMsMatchingStageFile,
|
||||
IndexMsNetworkEnabled,
|
||||
IndexMsMatchingStageEnabled
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
@@ -118,6 +122,26 @@ namespace BlackMisc
|
||||
//! Matching mode
|
||||
MatchingMode getMatchingMode() const { return static_cast<MatchingMode>(m_mode); }
|
||||
|
||||
//! Get matching files @{
|
||||
const QString &getMsNetworkEntryFile() const { return m_msNetworkEntryFile; }
|
||||
const QString &getMsMatchingStageFile() const { return m_msMatchingStageFile; }
|
||||
//! @}
|
||||
|
||||
//! Set matching files @{
|
||||
void setMsNetworkEntryFile(const QString &file) { m_msNetworkEntryFile = file; }
|
||||
void setMsMatchingStageFile(const QString &file) { m_msMatchingStageFile = file; }
|
||||
//! @}
|
||||
|
||||
//! Is matching script enabled @{
|
||||
bool isMsNetworkEntryEnabled() const { return m_msNetworkEnabled; }
|
||||
bool isMsMatchingStageEnabled() const { return m_msMatchingEnabled; }
|
||||
//! @}
|
||||
|
||||
//! Is matching script enabled @{
|
||||
void setMsNetworkEntryEnabled(bool enabled) { m_msNetworkEnabled = enabled; }
|
||||
void setMsMatchingStageEnabled(bool enabled) { m_msMatchingEnabled = enabled; }
|
||||
//! @}
|
||||
|
||||
//! Verification at startup?
|
||||
//! \sa ModelVerificationOnStartup
|
||||
bool doVerificationAtStartup() const { return this->getMatchingMode().testFlag(ModelVerificationAtStartup); }
|
||||
@@ -199,12 +223,20 @@ namespace BlackMisc
|
||||
int m_algorithm = static_cast<int>(MatchingStepwiseReducePlusScoreBased);
|
||||
int m_mode = static_cast<int>(ModeDefaultReducePlusScore);
|
||||
int m_strategy = static_cast<int>(PickByOrder);
|
||||
QString m_msNetworkEntryFile; //!< network entry matching script file
|
||||
QString m_msMatchingStageFile; //!< matching stage matching script file
|
||||
bool m_msNetworkEnabled = false; //!< enable network matching script
|
||||
bool m_msMatchingEnabled = false; //!< enable matching stage matching script
|
||||
|
||||
BLACK_METACLASS(
|
||||
CAircraftMatcherSetup,
|
||||
BLACK_METAMEMBER(algorithm),
|
||||
BLACK_METAMEMBER(mode),
|
||||
BLACK_METAMEMBER(strategy)
|
||||
BLACK_METAMEMBER(strategy),
|
||||
BLACK_METAMEMBER(msNetworkEntryFile),
|
||||
BLACK_METAMEMBER(msMatchingStageFile),
|
||||
BLACK_METAMEMBER(msNetworkEnabled),
|
||||
BLACK_METAMEMBER(msMatchingEnabled)
|
||||
);
|
||||
};
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user