swift
interpolationsetupmodel.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include <Qt>
7 #include <QtGlobal>
8 
9 #include "gui/models/columns.h"
10 
11 using namespace swift::misc;
12 using namespace swift::misc::physical_quantities;
13 using namespace swift::misc::aviation;
14 using namespace swift::misc::simulation;
15 
16 namespace swift::gui::models
17 {
18  CInterpolationSetupListModel::CInterpolationSetupListModel(QObject *parent)
19  : CListModelCallsignObjects("CInterpolationSetupListModel", parent)
20  {
22  CInterpolationAndRenderingSetupPerCallsign::IndexCallsign,
23  CCallsign::IndexCallsignString));
25  "interpolator", CInterpolationAndRenderingSetupPerCallsign::IndexInterpolatorModeAsString));
26  m_columns.addColumn(CColumn("parts", "aircraft parts",
27  CInterpolationAndRenderingSetupPerCallsign::IndexEnabledAircraftParts,
28  new CBoolIconFormatter("parts", "aircraft parts")));
29  m_columns.addColumn(CColumn("send gnd.", "send gnd.",
30  CInterpolationAndRenderingSetupPerCallsign::IndexSendGndFlagToSimulator,
31  new CBoolIconFormatter("send gnd.", "send gnd.")));
32  m_columns.addColumn(CColumn("sc.os.", "fix scenery offset",
33  CInterpolationAndRenderingSetupPerCallsign::IndexFixSceneryOffset,
34  new CBoolIconFormatter("sc.os.", "fix scenery offset")));
35  m_columns.addColumn(CColumn("full int.", "full interpolation",
36  CInterpolationAndRenderingSetupPerCallsign::IndexForceFullInterpolation,
37  new CBoolIconFormatter("full int.", "full interpolation")));
38  m_columns.addColumn(CColumn("sim.dbg.", "simulator debug",
39  CInterpolationAndRenderingSetupPerCallsign::IndexSimulatorDebugMessages,
40  new CBoolIconFormatter("sim.dbg.", "simulator debug")));
41  m_columns.addColumn(CColumn("log.int.", "log.interpolation",
42  CInterpolationAndRenderingSetupPerCallsign::IndexLogInterpolation,
43  new CBoolIconFormatter("log.int.", "log.interpolation")));
44  m_columns.addColumn(CColumn("gnd.pitch", "pitch on ground",
45  CInterpolationAndRenderingSetupPerCallsign::IndexPitchOnGround,
46  new CPhysiqalQuantiyFormatter<CAngleUnit, CAngle>(CAngleUnit::deg(), 1)));
47 
48  // default sort order
49  this->setSortColumnByPropertyIndex(CCountry::IndexIsoCode);
50  m_sortOrder = Qt::AscendingOrder;
51  }
52 } // namespace swift::gui::models
Single column.
Definition: columns.h:26
static CColumn standardValueObject(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard value object formatted column.
Definition: columns.cpp:46
static CColumn standardString(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard string object formatted column.
Definition: columns.cpp:57
void addColumn(const CColumn &column)
Add a column.
Definition: columns.cpp:100
virtual bool setSortColumnByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Set column for sorting.
List model for callsign based objects (callsign is unique key)
Formatter for physical quantities.
Models to be used with views, mainly QTableView.
Free functions in swift::misc.