mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 22:29:13 +08:00
Ref T280, QHash for aircraft and models and some minor improvements
* CValueObject::comparePropertyByIndex * bool "true" if value has been changed
This commit is contained in:
@@ -43,10 +43,19 @@ namespace BlackMisc
|
|||||||
//! Construct from initializer list.
|
//! Construct from initializer list.
|
||||||
CAircraftSituationChangeList(std::initializer_list<CAircraftSituationChange> il);
|
CAircraftSituationChangeList(std::initializer_list<CAircraftSituationChange> il);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Change per callsign
|
||||||
|
using CAircraftSituationChangePerCallsign = QHash<CCallsign, CAircraftSituationChange>;
|
||||||
|
|
||||||
|
//! Changes per callsign
|
||||||
|
using CAircraftSituationChangeListPerCallsign = QHash<CCallsign, CAircraftSituationChangeList>;
|
||||||
|
|
||||||
} //namespace
|
} //namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituationChangeList)
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituationChangeList)
|
||||||
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituationChangePerCallsign)
|
||||||
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituationChangeListPerCallsign)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Aviation::CAircraftSituationChange>)
|
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Aviation::CAircraftSituationChange>)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Aviation::CAircraftSituationChange>)
|
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Aviation::CAircraftSituationChange>)
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,8 @@ namespace BlackMisc
|
|||||||
case IndexCallsignStringAsSet: return m_callsignAsSet.compare(compareValue.m_callsignAsSet, Qt::CaseInsensitive);
|
case IndexCallsignStringAsSet: return m_callsignAsSet.compare(compareValue.m_callsignAsSet, Qt::CaseInsensitive);
|
||||||
case IndexTelephonyDesignator: return m_telephonyDesignator.compare(compareValue.m_telephonyDesignator, Qt::CaseInsensitive);
|
case IndexTelephonyDesignator: return m_telephonyDesignator.compare(compareValue.m_telephonyDesignator, Qt::CaseInsensitive);
|
||||||
case IndexSuffix: return this->getSuffix().compare(compareValue.getSuffix(), Qt::CaseInsensitive);
|
case IndexSuffix: return this->getSuffix().compare(compareValue.getSuffix(), Qt::CaseInsensitive);
|
||||||
default: break;
|
default:
|
||||||
|
return CValueObject::comparePropertyByIndex(index, compareValue);
|
||||||
}
|
}
|
||||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Compare failed");
|
Q_ASSERT_X(false, Q_FUNC_INFO, "Compare failed");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -353,10 +354,15 @@ namespace BlackMisc
|
|||||||
//! \remark checking for some criteria in the given model
|
//! \remark checking for some criteria in the given model
|
||||||
QString extCoverageSummary(const CAircraftModel &checkModel, const QString &separator = "\n") const;
|
QString extCoverageSummary(const CAircraftModel &checkModel, const QString &separator = "\n") const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Model per callsign
|
||||||
|
using CAircraftModelPerCallsign = QHash<Aviation::CCallsign, CAircraftModel>;
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModelList)
|
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModelList)
|
||||||
|
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModelPerCallsign)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Simulation::CAircraftModel>)
|
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Simulation::CAircraftModel>)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Simulation::CAircraftModel>)
|
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Simulation::CAircraftModel>)
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,20 @@ namespace BlackMisc
|
|||||||
return m_enabled;
|
return m_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSimulatedAircraft::setFastPositionUpdates(bool useFastPositions)
|
||||||
|
{
|
||||||
|
if (m_fastPositionUpdates == useFastPositions) { return false; }
|
||||||
|
m_fastPositionUpdates = useFastPositions;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CSimulatedAircraft::setRendered(bool rendered)
|
||||||
|
{
|
||||||
|
if (m_rendered == rendered) { return false; }
|
||||||
|
m_rendered = rendered;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CSimulatedAircraft::getAircraftIcaoCodeDesignator() const
|
const QString &CSimulatedAircraft::getAircraftIcaoCodeDesignator() const
|
||||||
{
|
{
|
||||||
return getAircraftIcaoCode().getDesignator();
|
return getAircraftIcaoCode().getDesignator();
|
||||||
|
|||||||
@@ -409,10 +409,10 @@ namespace BlackMisc
|
|||||||
bool fastPositionUpdates() const {return m_fastPositionUpdates;}
|
bool fastPositionUpdates() const {return m_fastPositionUpdates;}
|
||||||
|
|
||||||
//! Support fast position updates
|
//! Support fast position updates
|
||||||
void setFastPositionUpdates(bool useFastPositions) { m_fastPositionUpdates = useFastPositions; }
|
bool setFastPositionUpdates(bool useFastPositions);
|
||||||
|
|
||||||
//! Rendered?
|
//! Rendered?
|
||||||
void setRendered(bool rendered) { m_rendered = rendered; }
|
bool setRendered(bool rendered);
|
||||||
|
|
||||||
//! Have parts been synchronized with a remote client?
|
//! Have parts been synchronized with a remote client?
|
||||||
bool isPartsSynchronized() const { return m_partsSynchronized; }
|
bool isPartsSynchronized() const { return m_partsSynchronized; }
|
||||||
|
|||||||
@@ -117,10 +117,15 @@ namespace BlackMisc
|
|||||||
//! Number of aircraft with parts
|
//! Number of aircraft with parts
|
||||||
int countAircraftPartsSynchronized() const;
|
int countAircraftPartsSynchronized() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Aircraft per callsign
|
||||||
|
using CSimulatedAircraftPerCallsign = QHash<Aviation::CCallsign, CSimulatedAircraft>;
|
||||||
|
|
||||||
} //namespace
|
} //namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraftList)
|
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraftList)
|
||||||
|
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraftPerCallsign)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Simulation::CSimulatedAircraft>)
|
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Simulation::CSimulatedAircraft>)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Simulation::CSimulatedAircraft>)
|
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Simulation::CSimulatedAircraft>)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user