mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Ref T275, CAircraftSituationChange view/model
* added some more indexes * CAircraftSituationChangeListModel * CAircraftSituationChangeListView
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
//! Client list model
|
||||
//! Aircraft parts list model
|
||||
class BLACKGUI_EXPORT CAircraftPartsListModel : public CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList, true>
|
||||
{
|
||||
public:
|
||||
@@ -37,4 +37,5 @@ namespace BlackGui
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
|
||||
47
src/blackgui/models/aircraftsituationchangelistmodel..cpp
Normal file
47
src/blackgui/models/aircraftsituationchangelistmodel..cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackgui/models/aircraftsituationchangelistmodel.h"
|
||||
#include "blackgui/models/columnformatters.h"
|
||||
#include "blackgui/models/columns.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
CAircraftSituationChangeListModel::CAircraftSituationChangeListModel(QObject *parent) :
|
||||
CListModelTimestampWithOffsetObjects<CAircraftSituationChange, CAircraftSituationChangeList, true>("ViewAircraftPartsList", parent)
|
||||
{
|
||||
this->addTimestampOffsetColumns();
|
||||
|
||||
m_columns.addColumn(CColumn::standardString("situations", CAircraftSituationChange::IndexSituationsCount));
|
||||
m_columns.addColumn(CColumn("null", CAircraftSituationChange::IndexIsNull, new CBoolIconFormatter("null", "not null")));
|
||||
m_columns.addColumn(CColumn("gnd.", CAircraftSituationChange::IndexConstOnGround, new CBoolIconFormatter("const on gnd.", "not const on gnd.")));
|
||||
m_columns.addColumn(CColumn("not gnd.", CAircraftSituationChange::IndexConstNotOnGround, new CBoolIconFormatter("const not on gnd.", "not const not on gnd.")));
|
||||
m_columns.addColumn(CColumn("asc.", CAircraftSituationChange::IndexConstAscending, new CBoolIconFormatter("const ascending", "not const ascending")));
|
||||
m_columns.addColumn(CColumn("desc", CAircraftSituationChange::IndexConstDescending, new CBoolIconFormatter("const decending", "not const decending")));
|
||||
m_columns.addColumn(CColumn("push", CAircraftSituationChange::IndexContainsPushBack, new CBoolIconFormatter("contains pushback", "no pushback")));
|
||||
m_columns.addColumn(CColumn("to.", CAircraftSituationChange::IndexJustTakingOff, new CBoolIconFormatter("just takeoff", "no takeoff")));
|
||||
m_columns.addColumn(CColumn("td.", CAircraftSituationChange::IndexJustTouchingDown, new CBoolIconFormatter("just touching down", "no touchdown")));
|
||||
|
||||
m_columns.addColumn(CColumn("alt.mean", CAircraftSituationChange::IndexAltitudeMean, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("alt.dev.", CAircraftSituationChange::IndexAltitudeStdDev, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("elv.mean", CAircraftSituationChange::IndexElevationMean, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("elv.dev.", CAircraftSituationChange::IndexElevationStdDev, new CAltitudeFormatter()));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
41
src/blackgui/models/aircraftsituationchangelistmodel.h
Normal file
41
src/blackgui/models/aircraftsituationchangelistmodel.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_MODELS_AIRCRAFTSITUATIONCHANGELISTMODEL_H
|
||||
#define BLACKGUI_MODELS_AIRCRAFTSITUATIONCHANGELISTMODEL_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/models/listmodeltimestampobjects.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
class QModelIndex;
|
||||
class QObject;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
//! Aircraft situation changes list model
|
||||
class BLACKGUI_EXPORT CAircraftSituationChangeListModel : public CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList, true>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAircraftSituationChangeListModel(QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CAircraftSituationChangeListModel() {}
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "blackgui/models/aircraftmodellistmodel.h"
|
||||
#include "blackgui/models/aircraftpartslistmodel.h"
|
||||
#include "blackgui/models/aircraftsituationlistmodel.h"
|
||||
#include "blackgui/models/aircraftsituationchangelistmodel.h"
|
||||
#include "blackgui/models/airlineicaolistmodel.h"
|
||||
#include "blackgui/models/airportlistmodel.h"
|
||||
#include "blackgui/models/applicationinfolistmodel.h"
|
||||
|
||||
@@ -770,6 +770,7 @@ namespace BlackGui
|
||||
template class CListModelBase<BlackMisc::Aviation::CAirlineIcaoCode, BlackMisc::Aviation::CAirlineIcaoCodeList, true>;
|
||||
template class CListModelBase<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList, true>;
|
||||
template class CListModelBase<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList, true>;
|
||||
template class CListModelBase<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList, true>;
|
||||
template class CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList, true>;
|
||||
template class CListModelBase<BlackMisc::Network::CUser, BlackMisc::Network::CUserList, true>;
|
||||
template class CListModelBase<BlackMisc::Network::CTextMessage, BlackMisc::Network::CTextMessageList, false>;
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace BlackGui
|
||||
template class CListModelTimestampObjects<BlackMisc::CStatusMessage, BlackMisc::CStatusMessageList, true>;
|
||||
template class CListModelTimestampObjects<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList, true>;
|
||||
template class CListModelTimestampObjects<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList, true>;
|
||||
template class CListModelTimestampObjects<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList, true>;
|
||||
|
||||
template <typename ObjectType, typename ContainerType, bool UseCompare>
|
||||
CListModelTimestampWithOffsetObjects<ObjectType, ContainerType, UseCompare>::CListModelTimestampWithOffsetObjects(const QString &translationContext, QObject *parent) :
|
||||
@@ -59,5 +60,6 @@ namespace BlackGui
|
||||
|
||||
template class CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList, true>;
|
||||
template class CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList, true>;
|
||||
template class CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList, true>;
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
25
src/blackgui/views/aircraftsituationchangeview.cpp
Normal file
25
src/blackgui/views/aircraftsituationchangeview.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackgui/views/aircraftsituationchangeview.h"
|
||||
|
||||
using namespace BlackGui::Models;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
{
|
||||
CAircraftSituationChangeView::CAircraftSituationChangeView(QWidget *parent) :
|
||||
CViewWithTimestampWithOffsetObjects(parent)
|
||||
{
|
||||
this->standardInit(new CAircraftSituationChangeListModel(this));
|
||||
this->setMenu(MenuDefault);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
36
src/blackgui/views/aircraftsituationchangeview.h
Normal file
36
src/blackgui/views/aircraftsituationchangeview.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_VIEWS_AIRCRAFTSITUATIONCHANGEVIEW_H
|
||||
#define BLACKGUI_VIEWS_AIRCRAFTSITUATIONCHANGEVIEW_H
|
||||
|
||||
#include "blackgui/views/viewtimestampobjects.h"
|
||||
#include "blackgui/models/aircraftsituationchangelistmodel.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
{
|
||||
//! Aircraft situation change view
|
||||
class BLACKGUI_EXPORT CAircraftSituationChangeView : public CViewWithTimestampWithOffsetObjects<Models::CAircraftSituationChangeListModel, BlackMisc::Aviation::CAircraftSituationChangeList, BlackMisc::Aviation::CAircraftSituationChange>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAircraftSituationChangeView(QWidget *parent = nullptr);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
@@ -1708,6 +1708,7 @@ namespace BlackGui
|
||||
template class CViewBase<BlackGui::Models::CAircraftModelListModel, BlackMisc::Simulation::CAircraftModelList, BlackMisc::Simulation::CAircraftModel>;
|
||||
template class CViewBase<BlackGui::Models::CAircraftPartsListModel, BlackMisc::Aviation::CAircraftPartsList, BlackMisc::Aviation::CAircraftParts>;
|
||||
template class CViewBase<BlackGui::Models::CAircraftSituationListModel, BlackMisc::Aviation::CAircraftSituationList, BlackMisc::Aviation::CAircraftSituation>;
|
||||
template class CViewBase<BlackGui::Models::CAircraftSituationChangeListModel, BlackMisc::Aviation::CAircraftSituationChangeList, BlackMisc::Aviation::CAircraftSituationChange>;
|
||||
template class CViewBase<BlackGui::Models::CAirlineIcaoCodeListModel, BlackMisc::Aviation::CAirlineIcaoCodeList, BlackMisc::Aviation::CAirlineIcaoCode>;
|
||||
template class CViewBase<BlackGui::Models::CAirportListModel, BlackMisc::Aviation::CAirportList, BlackMisc::Aviation::CAirport>;
|
||||
template class CViewBase<BlackGui::Models::CApplicationInfoListModel, BlackMisc::CApplicationInfoList, BlackMisc::CApplicationInfo>;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "blackgui/views/viewtimestampobjects.h"
|
||||
#include "blackgui/models/aircraftpartslistmodel.h"
|
||||
#include "blackgui/models/aircraftsituationlistmodel.h"
|
||||
#include "blackgui/models/aircraftsituationchangelistmodel.h"
|
||||
#include <QAction>
|
||||
|
||||
using namespace BlackMisc;
|
||||
@@ -36,6 +37,7 @@ namespace BlackGui
|
||||
|
||||
template class CViewWithTimestampWithOffsetObjects<BlackGui::Models::CAircraftPartsListModel, BlackMisc::Aviation::CAircraftPartsList, BlackMisc::Aviation::CAircraftParts>;
|
||||
template class CViewWithTimestampWithOffsetObjects<BlackGui::Models::CAircraftSituationListModel, BlackMisc::Aviation::CAircraftSituationList, BlackMisc::Aviation::CAircraftSituation>;
|
||||
template class CViewWithTimestampWithOffsetObjects<BlackGui::Models::CAircraftSituationChangeListModel, BlackMisc::Aviation::CAircraftSituationChangeList, BlackMisc::Aviation::CAircraftSituationChange>;
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "blackmisc/pq/angle.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/math/mathutils.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include "blackmisc/verify.h"
|
||||
@@ -113,22 +114,27 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftSituationChange::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (index.isMyself()) { return CVariant::fromValue(*this); }
|
||||
if (ITimestampWithOffsetBased::canHandleIndex(index)) { return ITimestampWithOffsetBased::propertyByIndex(index); }
|
||||
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCallsign: return m_correspondingCallsign.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexConstAscending: return CVariant::from(m_constAscending);
|
||||
case IndexConstDescending: return CVariant::from(m_constDescending);
|
||||
case IndexConstNotOnGround: return CVariant::from(m_constNotOnGround);
|
||||
case IndexConstOnGround: return CVariant::from(m_constOnGround);
|
||||
case IndexIsNull: return CVariant::from(this->isNull());
|
||||
case IndexJustTakingOff: return CVariant::from(m_justTakeoff);
|
||||
case IndexJustTouchingDown: return CVariant::from(m_justTouchdown);
|
||||
case IndexRotatingUp: return CVariant::from(m_rotateUp);
|
||||
case IndexContainsPushBack: return CVariant::from(m_containsPushBack);
|
||||
case IndexSituationsCount: return CVariant::fromValue(m_situationsCount);
|
||||
case IndexConstAscending: return CVariant::fromValue(m_constAscending);
|
||||
case IndexConstDescending: return CVariant::fromValue(m_constDescending);
|
||||
case IndexConstNotOnGround: return CVariant::fromValue(m_constNotOnGround);
|
||||
case IndexConstOnGround: return CVariant::fromValue(m_constOnGround);
|
||||
case IndexIsNull: return CVariant::fromValue(this->isNull());
|
||||
case IndexJustTakingOff: return CVariant::fromValue(m_justTakeoff);
|
||||
case IndexJustTouchingDown: return CVariant::fromValue(m_justTouchdown);
|
||||
case IndexRotatingUp: return CVariant::fromValue(m_rotateUp);
|
||||
case IndexContainsPushBack: return CVariant::fromValue(m_containsPushBack);
|
||||
case IndexAltitudeMean: return CVariant::fromValue(m_altMean);
|
||||
case IndexAltitudeStdDev: return CVariant::fromValue(m_altStdDev);
|
||||
case IndexElevationMean: return CVariant::fromValue(m_elvMean);
|
||||
case IndexElevationStdDev: return CVariant::fromValue(m_elvStdDev);
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
@@ -142,6 +148,7 @@ namespace BlackMisc
|
||||
switch (i)
|
||||
{
|
||||
case IndexCallsign: m_correspondingCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||
case IndexSituationsCount: m_situationsCount = variant.toInt(); break;
|
||||
case IndexConstAscending: m_constAscending = variant.toBool(); break;
|
||||
case IndexConstDescending: m_constDescending = variant.toBool(); break;
|
||||
case IndexConstNotOnGround: m_constNotOnGround = variant.toBool(); break;
|
||||
@@ -150,11 +157,45 @@ namespace BlackMisc
|
||||
case IndexJustTouchingDown: m_justTouchdown = variant.toBool(); break;
|
||||
case IndexRotatingUp: m_rotateUp = variant.toBool(); break;
|
||||
case IndexContainsPushBack: m_containsPushBack = variant.toBool(); break;
|
||||
case IndexIsNull: break;
|
||||
case IndexIsNull:
|
||||
case IndexAltitudeMean:
|
||||
case IndexAltitudeStdDev:
|
||||
case IndexElevationMean:
|
||||
case IndexElevationStdDev:
|
||||
break; // read only
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
|
||||
int CAircraftSituationChange::comparePropertyByIndex(const CPropertyIndex &index, const CAircraftSituationChange &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return ITimestampWithOffsetBased::comparePropertyByIndex(CPropertyIndex(), compareValue); }
|
||||
if (ITimestampWithOffsetBased::canHandleIndex(index)) { return ITimestampWithOffsetBased::comparePropertyByIndex(index, compareValue); }
|
||||
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCallsign: return m_correspondingCallsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
||||
case IndexSituationsCount: return Compare::compare(this->getSituationsCount(), compareValue.getSituationsCount());
|
||||
case IndexConstAscending: return Compare::compare(this->isConstAscending(), compareValue.isConstAscending());
|
||||
case IndexConstDescending: return Compare::compare(this->isConstDescending(), compareValue.isConstDescending());
|
||||
case IndexConstNotOnGround: return Compare::compare(this->isConstNotOnGround(), compareValue.isConstNotOnGround());
|
||||
case IndexConstOnGround: return Compare::compare(this->isConstOnGround(), compareValue.isConstOnGround());
|
||||
case IndexJustTakingOff: return Compare::compare(this->isJustTakingOff(), compareValue.isJustTakingOff());
|
||||
case IndexJustTouchingDown: return Compare::compare(this->isJustTouchingDown(), compareValue.isJustTouchingDown());
|
||||
case IndexRotatingUp: return Compare::compare(this->isRotatingUp(), compareValue.isRotatingUp());
|
||||
case IndexContainsPushBack: return Compare::compare(this->containsPushBack(), compareValue.containsPushBack());
|
||||
case IndexIsNull: return Compare::compare(this->isNull(), compareValue.isNull());
|
||||
case IndexAltitudeMean: return m_altMean.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_altMean);
|
||||
case IndexAltitudeStdDev: return m_altStdDev.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_altStdDev);
|
||||
case IndexElevationMean: return m_elvMean.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_elvMean);
|
||||
case IndexElevationStdDev: return m_elvStdDev.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_elvStdDev);
|
||||
default: return CValueObject::comparePropertyByIndex(index, *this);
|
||||
}
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "No comparison");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CAircraftSituationChange::calculateStdDeviations(const CAircraftSituationList &situations, const CLength &cg)
|
||||
{
|
||||
if (situations.isEmpty()) { return false; }
|
||||
|
||||
@@ -50,7 +50,11 @@ namespace BlackMisc
|
||||
IndexJustTakingOff,
|
||||
IndexJustTouchingDown,
|
||||
IndexRotatingUp,
|
||||
IndexContainsPushBack
|
||||
IndexContainsPushBack,
|
||||
IndexAltitudeMean,
|
||||
IndexAltitudeStdDev,
|
||||
IndexElevationMean,
|
||||
IndexElevationStdDev,
|
||||
};
|
||||
|
||||
//! Hint about the guessed scenery deviation
|
||||
@@ -157,6 +161,9 @@ namespace BlackMisc
|
||||
//! \copydoc Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! \copydoc Mixin::Index::comparePropertyByIndex
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAircraftSituationChange &compareValue) const;
|
||||
|
||||
//! Calculate the standard deviiations
|
||||
bool calculateStdDeviations(const CAircraftSituationList &situations, const PhysicalQuantities::CLength &cg);
|
||||
|
||||
|
||||
28
src/blackmisc/aviation/aircraftsituationchangelist.cpp
Normal file
28
src/blackmisc/aviation/aircraftsituationchangelist.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
|
||||
#include <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
CAircraftSituationChangeList::CAircraftSituationChangeList() { }
|
||||
|
||||
CAircraftSituationChangeList::CAircraftSituationChangeList(const CSequence<CAircraftSituationChange> &other) :
|
||||
CSequence<CAircraftSituationChange>(other)
|
||||
{ }
|
||||
|
||||
CAircraftSituationChangeList::CAircraftSituationChangeList(std::initializer_list<CAircraftSituationChange> il) :
|
||||
CSequence<CAircraftSituationChange>(il)
|
||||
{ }
|
||||
} // namespace
|
||||
} // namespace
|
||||
53
src/blackmisc/aviation/aircraftsituationchangelist.h
Normal file
53
src/blackmisc/aviation/aircraftsituationchangelist.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_AVIATION_AIRCRAFTSITUATIONCHANGELIST_H
|
||||
#define BLACKMISC_AVIATION_AIRCRAFTSITUATIONCHANGELIST_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/collection.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchange.h"
|
||||
#include "blackmisc/timestampobjectlist.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
//! Value object encapsulating a list of aircraft parts.
|
||||
class BLACKMISC_EXPORT CAircraftSituationChangeList :
|
||||
public CSequence<CAircraftSituationChange>,
|
||||
public ITimestampWithOffsetObjectList<CAircraftSituationChange, CAircraftSituationChangeList>,
|
||||
public Mixin::MetaType<CAircraftSituationChangeList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAircraftSituationChangeList)
|
||||
|
||||
//! Default constructor.
|
||||
CAircraftSituationChangeList();
|
||||
|
||||
//! Construct from a base class object.
|
||||
CAircraftSituationChangeList(const CSequence<CAircraftSituationChange> &other);
|
||||
|
||||
//! Construct from initializer list.
|
||||
CAircraftSituationChangeList(std::initializer_list<CAircraftSituationChange> il);
|
||||
};
|
||||
} //namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituationChangeList)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Aviation::CAircraftSituationChange>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Aviation::CAircraftSituationChange>)
|
||||
|
||||
#endif //guard
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/aviation/aircrafticaocodelist.h"
|
||||
#include "blackmisc/aviation/airlineicaocodelist.h"
|
||||
@@ -574,8 +575,10 @@ namespace BlackMisc
|
||||
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList>;
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList>;
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList>;
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList>;
|
||||
//! \endcond
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -213,6 +213,8 @@ namespace BlackMisc
|
||||
{
|
||||
class CAircraftSituation;
|
||||
class CAircraftSituationList;
|
||||
class CAircraftSituationChange;
|
||||
class CAircraftSituationChangeList;
|
||||
class CAircraftParts;
|
||||
class CAircraftPartsList;
|
||||
class CAirport;
|
||||
@@ -277,10 +279,12 @@ namespace BlackMisc
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampObjectList<BlackMisc::CCountry, BlackMisc::CCountryList>;
|
||||
|
||||
// for the derived version both templates are required
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE ITimestampWithOffsetObjectList<BlackMisc::Aviation::CAircraftSituationChange, BlackMisc::Aviation::CAircraftSituationChangeList>;
|
||||
//! \endcond
|
||||
|
||||
} //namespace
|
||||
|
||||
Reference in New Issue
Block a user