WIP: Build fixes und EXTERNAL_DEPENDENCIES.md
This commit is contained in:
300 files changed
+983
-417
No files matched your search
+7
-2
@@ -3,11 +3,14 @@
|
||||
|
||||
|
||||
#include "pdm_charge_selector.h"
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <ProjectDataManagement/pdm_translation.h>
|
||||
#include <LtsUtils/LtsUtilsCore/json_object.h>
|
||||
#include <LtsUtilsCore/json_object.h>
|
||||
|
||||
namespace ProjectDataManagement
|
||||
{
|
||||
@@ -70,4 +73,6 @@ void ChargeSelector::reject()
|
||||
LtsWidgets::LtsFramelessDialog::reject();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BUILD_WITH_EXTERNAL_DDS
|
||||
+13
@@ -7,28 +7,41 @@
|
||||
#include <ProjectDataManagement/logger.h>
|
||||
#include <ProjectDataManagement/pdm_dtc.h>
|
||||
#include <QSet>
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
#include <ProjectDataManagement/pdm_gear_class.h>
|
||||
#endif
|
||||
|
||||
#include "ui_pdm_charge_selector.h"
|
||||
|
||||
namespace ProjectDataManagement
|
||||
{
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
class ChargeSelector final : public LtsWidgets::LtsFramelessDialog
|
||||
#else
|
||||
class ChargeSelector;
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ChargeSelector(QWidget *parent = nullptr);
|
||||
~ChargeSelector();
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
bool init(const std::shared_ptr<ProjectDataManagement::Interface::Dtc> &dtc,
|
||||
GearClass gearClass,
|
||||
const QSet<int> &preselectedCharges);
|
||||
#endif
|
||||
Q_SIGNALS:
|
||||
void chargesSelected(const QSet<int> &selectedCharges);
|
||||
private:
|
||||
void chargeCheckBoxChanged(int chargeId, bool bChecked);
|
||||
void reject() override;
|
||||
private:
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
QSet<int> m_selectedCharges;
|
||||
QSet<int> m_selectedChargesOriginal;
|
||||
Ui::ChargeSelector m_ui;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
+14
-2
@@ -11,6 +11,12 @@
|
||||
#include <LtsWidgets/lts_combo_box.h>
|
||||
#include <ProjectDataManagement/pdm_translation.h>
|
||||
|
||||
// External DDS types - only available when external dependencies are present
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
#include <ProjectDataManagement/pdm_dtc.h>
|
||||
#include <training_area_telegrams.h>
|
||||
#endif
|
||||
|
||||
namespace ProjectDataManagement
|
||||
{
|
||||
namespace PdmComboBox
|
||||
@@ -56,6 +62,7 @@ bool ChargeTypeFilterProxyModel::filterAcceptsRow(int source_row, const QModelIn
|
||||
return obj.value(m_property) == m_value;
|
||||
}
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
void fillGearClass(QComboBox *cbx, GearClass gearClass, const std::shared_ptr<Interface::Dtc> &dtc)
|
||||
{
|
||||
QStandardItemModel *itemModel = new QStandardItemModel(cbx);
|
||||
@@ -205,6 +212,7 @@ void fillFirePurpose(QComboBox *cbx, const std::shared_ptr<Interface::Dtc> &dtc)
|
||||
}
|
||||
itemModel->sort(0, Qt::AscendingOrder);
|
||||
}
|
||||
#endif // BUILD_WITH_EXTERNAL_DDS
|
||||
|
||||
bool fill(QComboBox *cbx, PdmComboBoxType type)
|
||||
{
|
||||
@@ -218,13 +226,14 @@ bool fill(QComboBox *cbx, PdmComboBoxType type)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
case PdmComboBoxType::CbLanguage:
|
||||
{
|
||||
const QString languages = LtsUtils::ProjectSettings::getInstance()->value(QStringLiteral("pdm"), QStringLiteral("EquipmentLanguages")).toString();
|
||||
const QStringList slLang = languages.split(QLatin1Char(','));
|
||||
QSet<int> alreadySeen;
|
||||
alreadySeen += LanguageConfiguration::NoChange;
|
||||
cbx->addItem(toString(LanguageConfiguration::NoChange), LanguageConfiguration::NoChange);
|
||||
alreadySeen += Language::NoChange;
|
||||
cbx->addItem(toString(Language::NoChange), Language::NoChange);
|
||||
for (const QString &r : slLang)
|
||||
{
|
||||
const int langId = r.toInt();
|
||||
@@ -289,6 +298,7 @@ bool fill(QComboBox *cbx, PdmComboBoxType type)
|
||||
cbx->addItem(toString(ABCProtectionMode::Off), ABCProtectionMode::Off);
|
||||
break;
|
||||
}
|
||||
#endif // BUILD_WITH_EXTERNAL_DDS
|
||||
case PdmComboBoxType::CbUnkown:
|
||||
break;
|
||||
}
|
||||
@@ -302,6 +312,7 @@ bool fill(QComboBox *cbx, PdmComboBoxType type)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
bool fill(QComboBox *cbx, GearClass gearClass, const std::shared_ptr<Interface::Dtc> &dtc)
|
||||
{
|
||||
if (!cbx)
|
||||
@@ -321,6 +332,7 @@ bool fill(QComboBox *cbx, GearClass gearClass, const std::shared_ptr<Interface::
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif // BUILD_WITH_EXTERNAL_DDS
|
||||
|
||||
bool setChargeTypePropertyFilter(QComboBox *cbx, const QString &property, const QVariant &value)
|
||||
{
|
||||
|
||||
+20
-2
@@ -5,8 +5,7 @@
|
||||
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <ProjectDataManagement/pdm_dtc.h>
|
||||
#include <Lts/Proxies/TrainingAreaBase/training_area_telegrams.h>
|
||||
#include <memory>
|
||||
|
||||
class QComboBox;
|
||||
class QStandardItemModel;
|
||||
@@ -27,6 +26,23 @@ enum class PdmComboBoxType
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +82,7 @@ enum Role
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -73,6 +90,7 @@ void fillLoadType(QComboBox *cbx, int chargeTypeId, const std::shared_ptr<Interf
|
||||
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);
|
||||
|
||||
|
||||
+6
-1
@@ -2,6 +2,9 @@
|
||||
|
||||
|
||||
#include "pdm_combobox_foreign_gui_interface_impl.h"
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
|
||||
#include "pdm_charge_selector.h"
|
||||
#include "pdm_combobox.h"
|
||||
|
||||
@@ -172,4 +175,6 @@ bool ForeignGuiInterfaceImpl::fillABCProtectionComboBox(QComboBox *cbx)
|
||||
return PdmComboBox::fill(cbx, PdmComboBoxType::CbABCProtectionMode);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BUILD_WITH_EXTERNAL_DDS
|
||||
+12
@@ -6,10 +6,18 @@
|
||||
#include <ProjectDataManagement/pdm_gui_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_dtc.h>
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
#include <ProjectDataManagement/pdm_gear_class.h>
|
||||
#endif
|
||||
|
||||
namespace ProjectDataManagement
|
||||
{
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
class ForeignGuiInterfaceImpl : public ForeignGuiInterface
|
||||
#else
|
||||
class ForeignGuiInterfaceImpl
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
ForeignGuiInterfaceImpl();
|
||||
@@ -17,6 +25,7 @@ public:
|
||||
bool init(const std::shared_ptr<ProjectDataManagement::Interface::Dtc> &dtc);
|
||||
void uninit();
|
||||
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
bool fillBComboBox(QComboBox *cbx) override;
|
||||
bool fillCComboBox(QComboBox *cbx) override;
|
||||
bool fillNComboBox(QComboBox *cbx) override;
|
||||
@@ -51,9 +60,12 @@ public:
|
||||
GearClass gearClass,
|
||||
const std::function<void(const QSet<int>&)> &cb,
|
||||
QWidget *parent) override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_dtc;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user