Removed old model/views for aircraft, now all with simulated aircraft

Updates of models in view now manually / automatic possible
Allow to reload models (in backend)
This commit is contained in:
Klaus Basan
2015-03-19 23:56:08 +01:00
parent afed33dbbf
commit 48dc360237
22 changed files with 143 additions and 182 deletions

View File

@@ -1,55 +0,0 @@
/* Copyright (C) 2013
* 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 "aircraftlistmodel.h"
#include "blackmisc/nwuser.h"
#include "blackmisc/avaircraftsituation.h"
#include "blackmisc/blackmiscfreefunctions.h"
using namespace BlackMisc::Aviation;
using namespace BlackMisc::Network;
namespace BlackGui
{
namespace Models
{
/*
* Constructor
*/
CAircraftListModel::CAircraftListModel(QObject *parent) : CListModelBase("ViewAircraftList", parent)
{
this->m_columns.addColumn(CColumn::standardValueObject("cs.", "callsign", { CAircraft::IndexCallsign, CCallsign::IndexCallsignString }));
this->m_columns.addColumn(CColumn::standardString("realname", "pilot's real name", { CAircraft::IndexPilot, CUser::IndexRealName }));
this->m_columns.addColumn(CColumn("dist.", "distance", CAircraft::IndexDistanceToOwnAircraft, new CAirspaceDistanceFormatter()));
this->m_columns.addColumn(CColumn("frequency", { CAircraft::IndexCom1System, CComSystem::IndexActiveFrequency }, new CComFrequencyFormatter()));
this->m_columns.addColumn(CColumn::standardString("icao", { CAircraft::IndexIcao, CAircraftIcao::IndexAsString}));
this->m_columns.addColumn(CColumn::standardString("transponder", { CAircraft::IndexTransponder, CTransponder::IndexTransponderCodeAndModeFormatted }));
this->m_columns.addColumn(CColumn("latitude", { CAircraft::IndexSituation, CAircraftSituation::IndexLatitude }, new CLatLonFormatter()));
this->m_columns.addColumn(CColumn("longitude", { CAircraft::IndexSituation, CAircraftSituation::IndexLongitude }, new CLatLonFormatter()));
this->m_columns.addColumn(CColumn::standardValueObject("altitude", { CAircraft::IndexSituation, CAircraftSituation::IndexAltitude }, CDefaultFormatter::alignRightVCenter()));
this->m_columns.addColumn(CColumn("gs", { CAircraft::IndexSituation, CAircraftSituation::IndexGroundspeed }, new CAircraftSpeedFormatter()));
// default sort order
this->setSortColumnByPropertyIndex(CAircraft::IndexDistanceToOwnAircraft);
this->m_sortOrder = Qt::AscendingOrder;
// force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "callsign");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "pilotrealname");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "latitude");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "longitude");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "altitude");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "distance");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "height");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "transponder");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "groundspeed");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "icao");
}
} // namespace
} // namespace

View File

@@ -1,40 +0,0 @@
/* Copyright (C) 2013
* 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_AIRCRAFTLISTMODEL_H
#define BLACKGUI_AIRCRAFTLISTMODEL_H
#include "blackmisc/avaircraftlist.h"
#include "blackgui/models/listmodelbase.h"
#include <QAbstractItemModel>
#include <QDBusConnection>
namespace BlackGui
{
namespace Models
{
//! Aircraft list model
class CAircraftListModel : public CListModelBase<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>
{
public:
//! Constructor
explicit CAircraftListModel(QObject *parent = nullptr);
//! Destructor
virtual ~CAircraftListModel() {}
};
} // namespace
} // namespace
#endif // guard