27 using namespace swift::misc::physical_quantities;
28 using namespace swift::misc::audio;
29 using namespace swift::misc::aviation;
30 using namespace swift::misc::network;
34 CAtcStationListModel::CAtcStationListModel(
AtcStationMode stationMode, QObject *parent)
40 (void)QT_TRANSLATE_NOOP(
"ModelAtcList",
"callsign");
41 (void)QT_TRANSLATE_NOOP(
"ModelAtcList",
"frequency");
42 (void)QT_TRANSLATE_NOOP(
"ModelAtcList",
"distance");
43 (void)QT_TRANSLATE_NOOP(
"ModelAtcList",
"controllername");
44 (void)QT_TRANSLATE_NOOP(
"ModelAtcList",
"online");
49 if (m_stationMode == stationMode)
return;
50 m_stationMode = stationMode;
58 "cs.",
"callsign", { CAtcStation::IndexCallsign, CCallsign::IndexCallsignStringAsSet }));
59 CColumn col(
"type", CAtcStation::IndexIcon);
81 default: qFatal(
"Wrong mode");
break;
99 if (!c) { this->
insert(station); }
105 beginRemoveRows(
parent, 0, 0);
void changedAtcStationConnectionStatus(const swift::misc::aviation::CAtcStation &station, bool added)
Used to quickly update single station (better response for the user)
void setStationMode(AtcStationMode stationMode)
Set station mode.
CAtcStationTreeModel * toAtcTreeModel() const
A group by type (TWR, APP, ...) model.
AtcStationMode
What kind of stations.
void setColumns(const CColumns &columns)
Set columns.
void updateContainer(const swift::misc::aviation::CAtcStationList &stations)
Update container.
static CColumn standardString(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard string object formatted column.
void setSortPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Property index used when sorting, option alternative.
void addColumnIncognito(const CColumn &column)
Add a column as incognito enabled.
void addColumn(const CColumn &column)
Add a column.
const ContainerType & container() const
Used container data.
virtual void insert(const ObjectType &object)
Similar to ContainerType::insert here inserts at first position.
int removeIf(K0 k0, V0 v0, KeysValues... keysValues)
Remove elements matching some particular key/value pair(s).
ContainerType m_container
used container
int rowCount(const QModelIndex &parentIndex=QModelIndex()) const final
virtual bool setSortColumnByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Set column for sorting.
QModelIndex parent(const QModelIndex &child) const final
CColumns m_columns
columns metadata
Qt::SortOrder m_sortOrder
sort order (asc/desc)
List model for callsign based objects (callsign is unique key)
Value object encapsulating information about an ATC station.
const CCallsign & getCallsign() const
Get callsign.
bool isEmpty() const
Is empty?
Models to be used with views, mainly QTableView.