100 lines
2.4 KiB
C++
Executable File
100 lines
2.4 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include <QSortFilterProxyModel>
|
|
#include <memory>
|
|
|
|
class QComboBox;
|
|
class QStandardItemModel;
|
|
|
|
namespace ProjectDataManagement
|
|
{
|
|
enum class PdmComboBoxType
|
|
{
|
|
CbUnkown = 0,
|
|
CbLanguage,
|
|
CbOperationMode,
|
|
CbModeHelmet,
|
|
CbModeVest,
|
|
CbPersonalProtection,
|
|
CbProtectionLevel,
|
|
CbHandgrenadeSearchMode,
|
|
CbInternationalMode,
|
|
CbABCProtectionMode,
|
|
};
|
|
|
|
// Forward declarations for external DDS types - only available when external dependencies are present
|
|
#ifdef BUILD_WITH_EXTERNAL_DDS
|
|
namespace Interface
|
|
{
|
|
class Dtc;
|
|
}
|
|
enum class GearClass;
|
|
enum class HandgrenadeSearchMode;
|
|
enum class InternationalMode;
|
|
enum class ABCProtectionMode;
|
|
enum class PersonalProtection;
|
|
enum class ProtectionLevel;
|
|
enum class Language; // from training_area_telegrams.h
|
|
enum class OperationMode; // from training_area_telegrams.h
|
|
enum class WphMode; // from training_area_telegrams.h
|
|
#endif
|
|
|
|
|
|
|
|
|
|
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);
|
|
#ifdef BUILD_WITH_EXTERNAL_DDS
|
|
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);
|
|
#endif
|
|
|
|
bool setChargeTypePropertyFilter(QComboBox *cbx, const QString &property, const QVariant &value);
|
|
|
|
}
|
|
|
|
}
|