Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for AreaEffectSimulation - GasPipe Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2017-06-19
|
||||
*/
|
||||
|
||||
|
||||
#include "aes_gas_pipes_model.h"
|
||||
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <FileManagement/flm_translation.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
GasPipesModel::GasPipesModel(QObject *parent)
|
||||
: AesGuiBaseModel<GasPipe>(parent, {})
|
||||
{
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool GasPipesModel::initModel(LtsSession::LtsSession *session)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "--- Start GasPipesModel::initModel()";
|
||||
|
||||
if (!AesGuiBaseModel::initModel(session))
|
||||
return false;
|
||||
|
||||
connect(m_aesDtc.get(), &AreaEffectSimulation::Interface::Dtc::gasPipeChanged,
|
||||
this, &GasPipesModel::onDataChanged);
|
||||
m_aesDtc->gasPipes([this](const GasPipe &item) { insertRow(item); });
|
||||
|
||||
return true;
|
||||
} // end of initModel()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
QVariant GasPipesModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const GasPipe &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()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool GasPipesModel::isFiltered(const GasPipe &data, DataModification modType) const
|
||||
{
|
||||
return AesGuiBaseModel::isFiltered(data, modType);
|
||||
} // end of isFiltered()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user