87 lines
2.2 KiB
C++
Executable File
87 lines
2.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* HMI Plugin for ProjectDataManagement - PDM ComboBox
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, SLSE, 2016-09-12
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// DDS
|
|
#include <QSortFilterProxyModel>
|
|
#include <ProjectDataManagement/pdm_dtc.h>
|
|
|
|
class QComboBox;
|
|
class QStandardItemModel;
|
|
|
|
namespace ProjectDataManagement
|
|
{
|
|
enum class PdmComboBoxType
|
|
{
|
|
CbUnkown = 0,
|
|
CbLanguage,
|
|
CbOperationMode,
|
|
CbModeHelmet,
|
|
CbModeVest,
|
|
CbPersonalProtection,
|
|
CbProtectionLevel,
|
|
CbHandgrenadeSearchMode,
|
|
CbInternationalMode,
|
|
CbABCProtectionMode,
|
|
};
|
|
|
|
// --------------------------------------------------------
|
|
// ComboBox
|
|
// --------------------------------------------------------
|
|
namespace PdmComboBox
|
|
{
|
|
class ChargeTypeFilterProxyModel final : public QSortFilterProxyModel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
using QSortFilterProxyModel::QSortFilterProxyModel;
|
|
|
|
void setPropertyFilter(const QString &property, const QVariant &value);
|
|
void setSourceModel(QAbstractItemModel *model) override;
|
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
|
|
|
|
private:
|
|
QStandardItemModel *m_model = nullptr;
|
|
QString m_property;
|
|
QVariant m_value;
|
|
};
|
|
|
|
namespace CBUserRoles
|
|
{
|
|
enum Role
|
|
{
|
|
Id = Qt::UserRole,
|
|
Properties
|
|
};
|
|
}
|
|
namespace TargetSubTypeRole
|
|
{
|
|
enum Role
|
|
{
|
|
Id = Qt::UserRole,
|
|
Abbreviation
|
|
};
|
|
}
|
|
|
|
bool fill(QComboBox *cbx, PdmComboBoxType type);
|
|
bool fill(QComboBox *cbx, GearClass gearClass, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
void fillIgniterType(QComboBox *cbx, int chargeTypeId, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
void fillIgniterFunction(QComboBox *cbx, int chargeTypeId, int igniterTypeId, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
void fillLoadType(QComboBox *cbx, int chargeTypeId, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
void fillTargetType(QComboBox *cbx, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
void fillTargetSubType(QComboBox *cbx, int targetTypeId, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
void fillFirePurpose(QComboBox *cbx, const std::shared_ptr<Interface::Dtc> &dtc);
|
|
|
|
bool setChargeTypePropertyFilter(QComboBox *cbx, const QString &property, const QVariant &value);
|
|
|
|
} // namespace PdmComboBox
|
|
|
|
} // namespace ProjectDataManagement
|