Files
pilotclient/src/blackgui/models/windlayerlistmodel.cpp
Klaus Basan c94584a19f Removed redundant speed formatter, use existing CSpeedKtsFormatter
CAircraftSpeedFormatter renamed to CSpeedKtsFormatter in same step
2017-01-10 23:46:16 +00:00

44 lines
1.8 KiB
C++

/* Copyright (C) 2016
* 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 "windlayerlistmodel.h"
#include "columnformatters.h"
#include <Qt>
#include <QtGlobal>
using namespace BlackMisc;
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackMisc::Weather;
namespace BlackGui
{
namespace Models
{
CWindLayerListModel::CWindLayerListModel(QObject *parent) :
CListModelBase("WindLayerListModel", parent)
{
this->m_columns.addColumn(CColumn("level", CWindLayer::IndexLevel, new CAltitudeFormatter()));
this->m_columns.addColumn(CColumn("direction", CWindLayer::IndexDirection, new CAngleDegreeFormatter()));
this->m_columns.addColumn(CColumn("speed", CWindLayer::IndexSpeed, new CSpeedKtsFormatter()));
this->m_columns.addColumn(CColumn("gust speed", CWindLayer::IndexGustSpeed, new CSpeedKtsFormatter()));
// default sort order
this->setSortColumnByPropertyIndex(CWindLayer::IndexLevel);
this->m_sortOrder = Qt::AscendingOrder;
// force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "level");
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "direction");
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "speed");
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "gust speed");
}
} // ns
} // ns