Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by hjl, SLSE, 2017-06-06
|
||||
#
|
||||
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
AesAirSupportGuiPluginInterface
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aes_air_support_gui_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
|
||||
|
||||
SET(aes_air_support_impact_gui_SRCS
|
||||
aes_air_support_gui_plugin.h
|
||||
aes_air_support_gui_plugin.cpp
|
||||
aes_air_support_9liner_list.h
|
||||
aes_air_support_9liner_list.cpp
|
||||
aes_air_support_9liner_model.h
|
||||
aes_air_support_9liner_model.cpp
|
||||
aes_air_support_impact_list.h
|
||||
aes_air_support_impact_list.cpp
|
||||
aes_air_support_impact_model.h
|
||||
aes_air_support_impact_model.cpp
|
||||
CustomView/aes_air_support_impact.h
|
||||
CustomView/aes_air_support_impact.cpp
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(aes_air_support_impact_gui_SRCS
|
||||
aes_air_support_9liner_list.ui
|
||||
CustomView/aes_air_support_impact.ui
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS AesAirSupportGuiPlugin MODULE ${aes_air_support_impact_gui_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(AesAirSupportGuiPlugin
|
||||
AesBaseGui
|
||||
AesAirSupportGuiPluginInterface
|
||||
AesDataPluginInterface
|
||||
AesInfoGuiPluginInterface
|
||||
AesEffectClusterModel
|
||||
GnaDataPluginInterface
|
||||
LtsWidgets
|
||||
LtsSession
|
||||
LtsSessionData
|
||||
LtsDataView
|
||||
LtsUtilsGuiDds
|
||||
LtsUtilsSettings
|
||||
NGLLogger
|
||||
ngltools
|
||||
PpmDataPluginInterface
|
||||
SituationMapGuiPluginInterface
|
||||
Qt5::Widgets
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(AesAirSupportGuiPlugin)
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for AES Explosion
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
|
||||
#include "aes_air_support_impact.h"
|
||||
#include "ui_aes_air_support_impact.h"
|
||||
|
||||
#include <Services/AreaEffectSimulation/Utils/polygons.h>
|
||||
#include <ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
CustomViewAirSupportImpact::CustomViewAirSupportImpact(LtsSession::LtsSession *session, QWidget *parent)
|
||||
: AbstractDisplayWidget(parent)
|
||||
, m_session(session)
|
||||
, m_ui(new Ui::CustomViewAirSupportImpact)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
CustomViewAirSupportImpact::~CustomViewAirSupportImpact()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool CustomViewAirSupportImpact::init(const QModelIndex &idx)
|
||||
{
|
||||
if (!idx.isValid())
|
||||
return false;
|
||||
|
||||
m_ui->lbName->setText(rowData(idx, AreaEffectSimulation::AirSupportImpactModel::BcName).toString());
|
||||
m_ui->lbEffectState->setText(rowData(idx, AreaEffectSimulation::AirSupportImpactModel::BcEffectState).toString());
|
||||
m_ui->lbEffectStart->setText(rowData(idx, AreaEffectSimulation::AirSupportImpactModel::BcEffectStart).toString());
|
||||
m_ui->lbChargeType->setText(rowData(idx, AreaEffectSimulation::AirSupportImpactModel::BcChargeType).toString());
|
||||
|
||||
QString durationString = rowData(idx, AreaEffectSimulation::AirSupportImpactModel::BcEffectDuration).toString();
|
||||
if (!durationString.isEmpty() && durationString != QLatin1String("0"))
|
||||
{
|
||||
m_ui->lbEffectDuration->setText(durationString);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->label_4->hide();
|
||||
m_ui->lbEffectDuration->hide();
|
||||
m_ui->label_6->hide();
|
||||
}
|
||||
m_ui->lblIcon->clear();
|
||||
m_ui->lblIcon->setAutoFillBackground(true);
|
||||
|
||||
const AesItemSortFilterProxyModel *sfpm = qobject_cast<const AesItemSortFilterProxyModel*>(idx.model());
|
||||
if (!sfpm)
|
||||
return false;
|
||||
const AirSupportImpactModel *aesModel = qobject_cast<const AirSupportImpactModel*>(sfpm->sourceModel());
|
||||
if (!aesModel)
|
||||
return false;
|
||||
const auto srcIdx = sfpm->mapToSource(idx);
|
||||
AirSupportImpact asi = aesModel->getRowData(srcIdx.row());
|
||||
calculateIcon(asi, sfpm->partyColor(idx.row()));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CustomViewAirSupportImpact::calculateIcon(const AirSupportImpact &asi, const QColor &color)
|
||||
{
|
||||
Database::AesAirSupportImpact dbAsi;
|
||||
dbAsi.impactPosition = QPointF(asi.impactPosition().lon(), asi.impactPosition().lat());
|
||||
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> pdmDtc;
|
||||
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc))
|
||||
return false;
|
||||
|
||||
double radius = pdmDtc->impactRadius(asi.chargeStruct().chargeTypeId(),
|
||||
asi.chargeStruct().igniterTypeId(),
|
||||
asi.chargeStruct().igniterFunctionId());
|
||||
QPolygonF poly = AreaEffectSimulation::Polygons::airSupportImpact(dbAsi, radius);
|
||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(asi.effectStateId());
|
||||
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
||||
m_ui->lblIcon->setPixmap(pix);
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace AreaEffectSimulation
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for AES Explosion
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Viewer/LtsDataView/abstract_display_widget.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
|
||||
#include "aes_air_support_impact_model.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class CustomViewAirSupportImpact;
|
||||
}
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class CustomViewAirSupportImpact final : public LtsDataView::AbstractDisplayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CustomViewAirSupportImpact(LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~CustomViewAirSupportImpact();
|
||||
bool init(const QModelIndex &idx) override final;
|
||||
|
||||
private:
|
||||
bool calculateIcon(const AreaEffectSimulation::AirSupportImpact &single, const QColor &color);
|
||||
|
||||
LtsSession::LtsSession *m_session;
|
||||
Ui::CustomViewAirSupportImpact *m_ui;
|
||||
|
||||
};
|
||||
} // namespace AreaEffectSimulation
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CustomViewAirSupportImpact</class>
|
||||
<widget class="QWidget" name="CustomViewAirSupportImpact">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>200</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="lbName">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbChargeType">
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>State:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbEffectState">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">State</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AreaEffectSimulation::PixmapLabel" name="lblIcon">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">icon</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lbEffectStart">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">for</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbEffectDuration">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Duration</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>seconds</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>AreaEffectSimulation::PixmapLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>AreaEffectSimulation/Gui/Base/aes_pixmap_label.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#include "aes_air_support_9liner_list.h"
|
||||
#include "aes_air_support_9liner_model.h"
|
||||
#include "ui_aes_air_support_9liner_list.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
AirSupport9LinerList::AirSupport9LinerList(QWidget *parent)
|
||||
: LtsDialog(parent)
|
||||
, m_airSupport9LinerProxyModel(new AirSupport9LinerProxyModel(this))
|
||||
, m_airSupport9LinerModel(new AirSupport9LinerModel(this))
|
||||
, m_ui(new Ui::AirSupport9LinerList)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_airSupport9LinerProxyModel->setSourceModel(m_airSupport9LinerModel);
|
||||
m_ui->widget->setModel(m_airSupport9LinerProxyModel);
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
m_ui->widget->hideColumn(AirSupport9LinerModel::ParticipantId);
|
||||
#endif
|
||||
m_ui->widget->setSortIndicator(AirSupport9LinerModel::Participant, Qt::AscendingOrder);
|
||||
|
||||
QCheckBox *cbExpired = new QCheckBox(tr("Show expired"), m_ui->widget);
|
||||
cbExpired->setProperty("const", true);
|
||||
m_ui->widget->setCustomWidget(cbExpired);
|
||||
connect(cbExpired, &QCheckBox::toggled,
|
||||
m_airSupport9LinerProxyModel, &AirSupport9LinerProxyModel::setShowExpired);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Aerial_Ordnance_9-Liner")); // since 2022-03-01: guez_online_help_de-1.1-11.noarch
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
AirSupport9LinerList::~AirSupport9LinerList()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool AirSupport9LinerList::init(LtsSession::LtsSession *session)
|
||||
{
|
||||
if (!m_airSupport9LinerModel->initModel(session))
|
||||
return false;
|
||||
if (m_airSupport9LinerProxyModel)
|
||||
m_airSupport9LinerProxyModel->setSession(session); // setSession to enable filtering (showExpired)
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AirSupport9LinerList::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Air Support 9-Liner"));
|
||||
}
|
||||
|
||||
void AirSupport9LinerList::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->widget->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
#include "aes_air_support_9liner_model.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class AirSupport9LinerList;
|
||||
}
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
class AirSupport9LinerList final : public LtsWidgets::LtsDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AirSupport9LinerList(QWidget *parent = nullptr);
|
||||
~AirSupport9LinerList();
|
||||
|
||||
bool init(LtsSession::LtsSession *session);
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void tableColumnOrganiserSetting() override;
|
||||
private:
|
||||
AirSupport9LinerProxyModel *m_airSupport9LinerProxyModel = nullptr;
|
||||
AirSupport9LinerModel *m_airSupport9LinerModel = nullptr;
|
||||
Ui::AirSupport9LinerList *m_ui = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AirSupport9LinerList</class>
|
||||
<widget class="QWidget" name="AirSupport9LinerList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>500</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">AirSupport9LinerList</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="LtsDataView::LtsDataView" name="widget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsDataView::LtsDataView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsDataView/lts_data_view.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#include "aes_air_support_9liner_model.h"
|
||||
#include <GuezNasat/gna_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <LtsUtilsCore/variant_operators.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
AirSupport9LinerModel::AirSupport9LinerModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<GuezNasat::Nasat9Liner>({
|
||||
tr("ParticipantId"),
|
||||
tr("Participant"),
|
||||
tr("Timestamp"),
|
||||
tr("Attack Heading"),
|
||||
tr("Target Position")},
|
||||
parent)
|
||||
{
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool AirSupport9LinerModel::initModel(LtsSession::LtsSession *session)
|
||||
{
|
||||
if (!session->getDtc<GuezNasat::DataInterface>(m_gnaDtc))
|
||||
return false;
|
||||
|
||||
session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc);
|
||||
|
||||
connect(m_gnaDtc.get(), &GuezNasat::Interface::Dtc::nasat9LinerChanged,
|
||||
this, &AirSupport9LinerModel::onDataChanged);
|
||||
m_gnaDtc->nasat9Liners([this](const GuezNasat::Nasat9Liner &item) { insertRow(item); });
|
||||
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
QVariant AirSupport9LinerModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const GuezNasat::Nasat9Liner &item = m_vecData.at(index.row());
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case ParticipantId:
|
||||
return item.participantId();
|
||||
case Participant:
|
||||
{
|
||||
if (!m_ppmDtc)
|
||||
return QString();
|
||||
return m_ppmDtc->hierarchyFromParticipant(item.participantId());
|
||||
}
|
||||
case Timestamp:
|
||||
return QDateTime::fromMSecsSinceEpoch(item.sampleTime());
|
||||
case AttackHeading:
|
||||
{
|
||||
if (item.finalAttackHeading() < 0)
|
||||
return QVariant();
|
||||
if (item.finalAttackHeadingHigh() < 0)
|
||||
return tr("%1 degree")
|
||||
.arg(item.finalAttackHeading());
|
||||
return tr("%1 degree (low: %2 degree, high: %3 degreee)", "degree as symbol!")
|
||||
.arg(item.finalAttackHeading())
|
||||
.arg(item.finalAttackHeadingLow())
|
||||
.arg(item.finalAttackHeadingHigh());
|
||||
}
|
||||
case TargetPosition:
|
||||
{
|
||||
if (std::isnan(item.targetPosition().lat()))
|
||||
return tr("---");
|
||||
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(item.targetPosition().lon(),
|
||||
item.targetPosition().lat()));
|
||||
QString ret = coord.mgrs();
|
||||
if (item.targetPosition().z() > 0)
|
||||
ret += QLatin1Char(' ') + QString::number(qRound(item.targetPosition().z()));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// AirSupport9LinerProxyModel
|
||||
//
|
||||
void AirSupport9LinerProxyModel::setSession(LtsSession::LtsSession *session)
|
||||
{
|
||||
m_session = session;
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void AirSupport9LinerProxyModel::setShowExpired(bool bShow)
|
||||
{
|
||||
if (bShow == m_showExpired)
|
||||
return;
|
||||
m_showExpired = bShow;
|
||||
invalidateFilter();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AirSupport9LinerProxyModel::setSourceModel(QAbstractItemModel *model)
|
||||
{
|
||||
m_model = qobject_cast<AirSupport9LinerModel*>(model);
|
||||
LtsWidgets::LtsColumnFilterProxyModel::setSourceModel(model);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool AirSupport9LinerProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
||||
{
|
||||
if (!m_model || source_parent.isValid() || source_row < 0 || source_row >= m_model->m_vecData.size())
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
|
||||
if (m_showExpired)
|
||||
return true;
|
||||
const auto &data = m_model->m_vecData.at(source_row);
|
||||
|
||||
// GUEZE-1676: Nineliner sollen zeitlich wie Trefferlinien angezeigt werden
|
||||
// isCurrent(); is outdated
|
||||
// return data.isCurrent();
|
||||
|
||||
// Expired. Show only if younger than m_offset
|
||||
if (!m_session)
|
||||
return true;
|
||||
|
||||
const qint64 m_offset = 5 * 60 * 1000; // default: 5 minutes, same as default at AES (AesItemSortFilterProxyModel at aes_base_model.cpp)
|
||||
if ((data.sampleTime() + m_offset) > m_session->partitionTime())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool AirSupport9LinerProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
|
||||
{
|
||||
if (!m_model || source_left.parent() != source_right.parent() || source_left.column() != source_right.column())
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
||||
if (source_left.row() < 0 || source_left.row() >= m_model->m_vecData.size() ||
|
||||
source_right.row() < 0 || source_right.row() >= m_model->m_vecData.size())
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
||||
|
||||
const auto &left = m_model->m_vecData.at(source_left.row());
|
||||
const auto &right = m_model->m_vecData.at(source_right.row());
|
||||
switch (source_left.column())
|
||||
{
|
||||
case AirSupport9LinerModel::ParticipantId:
|
||||
if (left.participantId() != right.participantId())
|
||||
return left.participantId() < right.participantId();
|
||||
return left.sampleTime() < right.sampleTime();
|
||||
case AirSupport9LinerModel::Participant:
|
||||
{
|
||||
const auto l = source_left.data();
|
||||
const auto r = source_right.data();
|
||||
if (l != r)
|
||||
return LtsUtils::lessThan(l, r);
|
||||
return left.sampleTime() < right.sampleTime();
|
||||
}
|
||||
case AirSupport9LinerModel::Timestamp:
|
||||
return left.sampleTime() < right.sampleTime();
|
||||
case AirSupport9LinerModel::AttackHeading:
|
||||
if (left.finalAttackHeading() != right.finalAttackHeading())
|
||||
return left.finalAttackHeading() < right.finalAttackHeading();
|
||||
if (left.finalAttackHeadingLow() != right.finalAttackHeadingLow())
|
||||
return left.finalAttackHeadingLow() < right.finalAttackHeadingLow();
|
||||
if (left.finalAttackHeadingHigh() != right.finalAttackHeadingHigh())
|
||||
return left.finalAttackHeadingHigh() < right.finalAttackHeadingHigh();
|
||||
return left.sampleTime() < right.sampleTime();
|
||||
}
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||
#include <GuezNasat/gna_dtc.h>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class AirSupport9LinerModel final : public LtsWidgets::LtsAbstractTableModel<GuezNasat::Nasat9Liner>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
ParticipantId,
|
||||
Participant,
|
||||
Timestamp,
|
||||
AttackHeading,
|
||||
TargetPosition,
|
||||
};
|
||||
explicit AirSupport9LinerModel(QObject *parent = nullptr);
|
||||
|
||||
bool initModel(LtsSession::LtsSession *session);
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
private:
|
||||
std::shared_ptr<GuezNasat::Interface::Dtc> m_gnaDtc;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
friend class AirSupport9LinerProxyModel;
|
||||
};
|
||||
|
||||
class AirSupport9LinerProxyModel final : public LtsWidgets::LtsColumnFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using LtsWidgets::LtsColumnFilterProxyModel::LtsColumnFilterProxyModel;
|
||||
|
||||
void setSession(LtsSession::LtsSession *session);
|
||||
void setShowExpired(bool bShow);
|
||||
|
||||
void setSourceModel(QAbstractItemModel *model) override;
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
|
||||
private:
|
||||
AirSupport9LinerModel *m_model{nullptr};
|
||||
LtsSession::LtsSession *m_session{nullptr};
|
||||
bool m_showExpired = false;
|
||||
};
|
||||
} //namespace AreaEffectSimulation
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for AreaEffectSimulation - AirSupport
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#include "aes_air_support_gui_plugin.h"
|
||||
#include "aes_air_support_9liner_list.h"
|
||||
#include "aes_air_support_impact_list.h"
|
||||
//#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_list.h>
|
||||
|
||||
|
||||
#include <AreaEffectSimulation/aes_operator_rights.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
|
||||
{
|
||||
return std::make_shared<InterfaceImpl>(session);
|
||||
} // end of createGuiInterface()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
|
||||
: AesBaseInterface(session, getLogger("Plugins.Gui.AirSupport"))
|
||||
, ForeignGuiInterface()
|
||||
{
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
QVector<LtsWidgets::PluginData> ret;
|
||||
|
||||
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
||||
const bool enableAirSupport = ps->value(QStringLiteral("aes"),
|
||||
QStringLiteral("enableAirSupport")).toBool();
|
||||
|
||||
if (!enableAirSupport)
|
||||
return ret;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::shared_ptr<GuezNasat::Interface::Dtc> gnaDtc;
|
||||
m_session->getDtc<GuezNasat::DataInterface>(gnaDtc);
|
||||
if (gnaDtc)
|
||||
{
|
||||
ret.append(LtsWidgets::PluginData(menuGroup(),
|
||||
tr("Air Support 9-Liner"),
|
||||
QStringLiteral("ListAirSupport9Liner"),
|
||||
QIcon(QStringLiteral("icon:nasat_nine_liner.svg")),
|
||||
[this](QWidget *parent) {
|
||||
return LtsWidgets::initDialog(new AirSupport9LinerList(parent), m_session);
|
||||
},
|
||||
OperatorRights::AirSupportShow,
|
||||
LtsWidgets::ExercisePart::eExecution));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// old: AirSupportImpactList
|
||||
// ret.append(LtsWidgets::PluginData(menuGroup(),
|
||||
// tr("Air Support ImpactsOLD"),
|
||||
// QStringLiteral("ListAirSupportImpactsOLD"),
|
||||
// QIcon(QStringLiteral("icon:aes_airsupportimpacts.svg")),
|
||||
// [this](QWidget *parent) {
|
||||
// return LtsWidgets::initDialog(new AirSupportImpactList(menuGroup(), parent), m_session);
|
||||
// },
|
||||
// OperatorRights::AirSupportShow,
|
||||
// LtsWidgets::ExercisePart::eExecution));
|
||||
|
||||
// new : AirSupportExplosionClusterImpactList
|
||||
ret.append(LtsWidgets::PluginData(menuGroup(),
|
||||
tr("Air Support Impacts (ExCluster"),
|
||||
QStringLiteral("ListAirSupportImpactsNEW"),
|
||||
QIcon(QStringLiteral("icon:aes_airsupportimpacts.svg")),
|
||||
[this](QWidget *parent) {
|
||||
return LtsWidgets::initDialog(new AirSupportExplosionClusterImpactList(menuGroup(), parent), m_session);
|
||||
},
|
||||
OperatorRights::AirSupportShow,
|
||||
LtsWidgets::ExercisePart::eExecution));
|
||||
|
||||
return ret;
|
||||
} // end of getActions()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for AreaEffectSimulation - AirSupport
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_gui_plugin.h>
|
||||
#include <GuezNasat/gna_data_plugin_interface.h>
|
||||
#include "aes_air_support_gui_plugin_interface.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class GuiPlugin final : public AesBaseGuiPlugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "gui:3:aes.airsupport")
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
QString pluginName() override { return QLatin1String("AreaEffectSimulationAirSupportGui"); }
|
||||
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override
|
||||
{
|
||||
return partition == IDL::PartitionType::Exercise ||
|
||||
partition == IDL::PartitionType::Replay;
|
||||
}
|
||||
};
|
||||
|
||||
class InterfaceImpl final : public AesBaseInterface, public AesAirSupport::ForeignGuiInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
||||
|
||||
QVector<LtsWidgets::PluginData> getActions() override;
|
||||
};
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation AirSupport (Interface for access from other Plugins)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace AesAirSupport
|
||||
{
|
||||
class ForeignGuiInterface
|
||||
{
|
||||
public:
|
||||
ForeignGuiInterface() = default;
|
||||
virtual ~ForeignGuiInterface() = default;
|
||||
};
|
||||
|
||||
} //namespace AesAirSupport
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#include "aes_air_support_impact_list.h"
|
||||
#include "aes_air_support_impact_model.h"
|
||||
#include "CustomView/aes_air_support_impact.h"
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
//
|
||||
// class AirSupportImpactList
|
||||
//
|
||||
bool AirSupportImpactList::init(LtsSession::LtsSession *session)
|
||||
{
|
||||
if (!AesItemList::init(session))
|
||||
return false;
|
||||
|
||||
m_bHasAddEditOperatorRights = false;
|
||||
|
||||
setDataViewModel(m_model, [this]() { return new CustomViewAirSupportImpact(m_session, this); });
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
hideColumn(AirSupportImpactModel::BcId);
|
||||
#endif
|
||||
hideColumn(AirSupportImpactModel::BcEffectDuration);
|
||||
hideColumn(AirSupportImpactModel::BcEffectSource);
|
||||
|
||||
setSortIndicator(AirSupportImpactModel::BcName);
|
||||
|
||||
enaDisa();
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Aerial_Ordnances"));
|
||||
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AirSupportImpactList::createModel()
|
||||
{
|
||||
m_model = new AesItemSortFilterProxyModelTmpl<AirSupportImpact>(m_session, this);
|
||||
|
||||
m_airSupportImpactModel = new AirSupportImpactModel(this);
|
||||
m_airSupportImpactModel->initModel(m_session);
|
||||
m_model->setSourceModel(m_airSupportImpactModel);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AirSupportImpactList::retranslate()
|
||||
{
|
||||
translateBase(tr("Air Support Impacts"));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// class AirSupportExplosionClusterImpactList (successor of AirSupportImpactList)
|
||||
//
|
||||
bool AirSupportExplosionClusterImpactList::init(LtsSession::LtsSession *session)
|
||||
{
|
||||
if (!AesItemList::init(session))
|
||||
return false;
|
||||
|
||||
m_bHasAddEditOperatorRights = false;
|
||||
|
||||
setDataViewModel(m_model, [this]() { return new CustomViewAirSupportImpact(m_session, this); });
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
hideColumn(AirSupportImpactModel::BcId);
|
||||
#endif
|
||||
hideColumn(AirSupportImpactModel::BcEffectDuration);
|
||||
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColGearType);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColIgniterType);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColFiringPosition);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColExplosionGeometry);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColTlaZog);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColMhPointCount);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColMhpRotationCount);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColImpactCount);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColZpElement);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColOriginalFlightDuration);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColOriginalPeakHeight);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColCalculatedFlightDuration);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColCalculatedPeakHeight);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColCalculatedFiringSpeed);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColLaunchVelocity);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColLaunchAngleDeg);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColDropAngle);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColTapTimepoint);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColLcAttack_Prf);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColLcTermination);
|
||||
hideColumn(EffectClusterModel::AdditionalColumns::ColCloudBase);
|
||||
|
||||
setSortIndicator(AirSupportImpactModel::BcName);
|
||||
|
||||
enaDisa();
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Aerial_Ordnances"));
|
||||
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AirSupportExplosionClusterImpactList::createModel()
|
||||
{
|
||||
m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this);
|
||||
|
||||
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass_def::AirSupport}, this);
|
||||
m_effectClusterModel->initModel(m_session);
|
||||
m_model->setSourceModel(m_effectClusterModel);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AirSupportExplosionClusterImpactList::retranslate()
|
||||
{
|
||||
translateBase(tr("Air Support Impacts"));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_effect_cluster_model.h>
|
||||
#include "aes_air_support_impact_model.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
class AirSupportImpactList final : public AesItemListTmpl<AirSupportImpact>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using AesItemListTmpl<AirSupportImpact>::AesItemListTmpl;
|
||||
|
||||
bool init(LtsSession::LtsSession *session) override;
|
||||
|
||||
private slots:
|
||||
void onAddAesItem() override {}
|
||||
void onEditAesItem() override {}
|
||||
void onRemoveAesItem() override {}
|
||||
|
||||
private:
|
||||
void createModel() override;
|
||||
void retranslate() override;
|
||||
AirSupportImpactModel *m_airSupportImpactModel{nullptr};
|
||||
};
|
||||
|
||||
class AirSupportExplosionClusterImpactList final : public AesItemListTmpl<EffectCluster>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using AesItemListTmpl<EffectCluster>::AesItemListTmpl;
|
||||
|
||||
bool init(LtsSession::LtsSession *session) override;
|
||||
|
||||
private slots:
|
||||
void onAddAesItem() override {}
|
||||
void onEditAesItem() override {}
|
||||
void onRemoveAesItem() override {}
|
||||
|
||||
private:
|
||||
void createModel() override;
|
||||
void retranslate() override;
|
||||
EffectClusterModel *m_effectClusterModel{nullptr};
|
||||
};
|
||||
|
||||
|
||||
// since
|
||||
|
||||
|
||||
}
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#include "aes_air_support_impact_model.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
AirSupportImpactModel::AirSupportImpactModel(QObject *parent)
|
||||
: AesGuiBaseModel<AirSupportImpact>(parent, {})
|
||||
{
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool AirSupportImpactModel::initModel(LtsSession::LtsSession *session)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "--- Start AirSupportImpactModel::initModel()";
|
||||
|
||||
if (!AesGuiBaseModel::initModel(session))
|
||||
return false;
|
||||
|
||||
connect(m_aesDtc.get(), &AreaEffectSimulation::Interface::Dtc::airSupportImpactChanged,
|
||||
this, &AirSupportImpactModel::onDataChanged);
|
||||
m_aesDtc->airSupportImpacts([this](const AirSupportImpact &item) { insertRow(item); });
|
||||
|
||||
return true;
|
||||
} // end of initModel()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
QVariant AirSupportImpactModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const AirSupportImpact &item = m_vecData.at(index.row());
|
||||
|
||||
if (index.column() < cntBaseColumns())
|
||||
return AesGuiBaseModel::data(item, index.column(), role);
|
||||
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
return QVariant();
|
||||
} // end of data()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - AirSupportImpact Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by ehrlicher, NLE, 2019-09-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class AirSupportImpactModel final : public AesGuiBaseModel<AirSupportImpact>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AirSupportImpactModel(QObject *parent = nullptr);
|
||||
|
||||
bool initModel(LtsSession::LtsSession *session) override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
};
|
||||
} //namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user