/** * @RDE_HEADER@ * Klasse fuer das Importieren von MSDL-Dateien * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include #include "msdl_logging.h" #include "msdl_types.h" #include "zwmsmsdl_export.h" #include #include #include #include #include #include #include #include #include #include #include namespace LtsSession { class LtsSession; } class Ui_MSDLImport; namespace msdl { class ImportMsdlShow; class ZWMSMSDL_EXPORT ImportMsdl : public NGLDialog, protected ParticipantManagement::Interface::Ftc::ModifyTypeReplyHandler { Q_OBJECT public: ImportMsdl(ParticipantManagement::ParticipantEditModel *pModel, const QModelIndex &index, QWidget *parent, LtsSession::LtsSession *pSession); virtual ~ImportMsdl(); private slots: void slotOpenImportDialog(); void slotStartImport(); private: void onModifyTypeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } void createWorkingCopy(const QString &strImportFile); bool schemaValidation(); ParticipantManagement::ParticipantData createParticipant(const MSDLParticipant &unit); void insertParticipant(const MSDLParticipant &unit, const QModelIndex &index); void insertParty(const MSDLParty &party); void createNode(const ParticipantManagement::ParticipantData &participant, const QModelIndex &index, const QString &handle); void checkParentlessUnits(); std::shared_ptr m_ppmDtc; std::shared_ptr m_ppmFtc; // Exercise importing has the following call order void importExerciseScenario(); void importPurpose(); QVector importParties(); void importOrganization(); QMap importParticipants(); void importEquipment(QMap &mapUnits); QVector resolveImportMapping(const QMap &mapUnits); QVector showMappingDialog(const QMap > &mapConflictMap, bool typeClassIsUnit); void buildImportTreeView(QVector &vecUnitsWithValidDISTypes); bool applyDISMappingChangesToDatabase(); QMap m_mapMSDL_DIS_2TypeId; // E.g. "003001222001246001000" to "47" QMap m_mapTypes; // E.g. participant id "47" to type id void mapParticipant2Type(MSDLParticipant &participant, qint32 mappedTypeId); QSet m_setTouchedTypes; // Used to create the treeview with the imported participants QMap m_parentIndexCache; QMap m_parentlessItems; QModelIndex m_indexRoot; // Used to append parties/forces to the tree ParticipantManagement::ParticipantEditModel *m_pModel; LtsUtils::RequestHelper *m_requestHelper; msdl::ImportMsdlShow *m_pMsdlImportShow; // Import debug view. Not visible for the actual user when compiling in release mode Ui_MSDLImport *m_pUi; msdl::LOGGER_T mLogger; }; }