mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 23:05:34 +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
|
||||
|
||||
Reference in New Issue
Block a user