Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
#
# $Id$
# $HeadURL$
# $Author$
# Created by Philipp Last, SLSE, 2017-10-26
#
ADD_SUBDIRECTORY(msdl)
SET(ppm_msdl_SRCS
ppm_msdl_gui_plugin.cpp
ppm_msdl_gui_plugin.h
ppm_msdl_edit.cpp
ppm_msdl_edit.h
)
NGL_WRAP_UI(ppm_msdl_SRCS
ppm_msdl_edit.ui
)
NGL_ADD_LIBRARY(WS PpmMSDLGuiPlugin MODULE ${ppm_msdl_SRCS})
NGL_TARGET_LINK_LIBRARIES(PpmMSDLGuiPlugin
AsbDataPluginInterface
NGLLogger
LtsSession
PpmGuiPartyPluginInterface
PpmDataPluginInterface
PpmGuiComboboxPluginInterface
Qt5::Widgets
LtsWidgets
LtsDataView
LtsUtilsGuiDds
PpmCommon
zwmsmsdl
LtsUtilsSettings
)
NGL_INSTALL_TARGET(PpmMSDLGuiPlugin)
@@ -0,0 +1,104 @@
#
# @RDE_HEADER@
# $Id$
# $HeadURL$
# $Author$
#
FIND_PACKAGE(XercesC REQUIRED)
FIND_PACKAGE(XSD REQUIRED)
SET(zwmsmsdl_SRCS
msdl_export.cpp
msdl_export.h
msdl_export_scenario_data.cpp
msdl_export_scenario_data.h
msdl_import.cpp
msdl_import.h
msdl_import_show.cpp
msdl_import_show.h
msdl_logging.cpp
msdl_logging.h
msdl_mapping_dialog.cpp
msdl_mapping_dialog.h
msdl_types.cpp
msdl_types.h
zwmsmsdl_export.h
)
SET(zwmsmsdl_UICS
ui/msdl_import_show.ui
ui/msdl_import.ui
ui/msdl_export.ui
ui/msdl_export_scenario_data.ui
ui/msdl_mapping_dialog.ui
)
SET(zwmsmsdl_XSDS
xsd/MilitaryScenario_1.0.0.xsd
xsd/MsdlCodes_1.0.0.xsd
xsd/MsdlComplexTypes_1.0.0.xsd
xsd/MsdlSimpleTypes_1.0.0.xsd
)
SET(zwmsmsdl_XSDS_EXT
xsd/extern/JC3IEDM-3.1-Codes-20061208.xsd
xsd/extern/JC3IEDMMeteorological.xsd
xsd/extern/ModelID_v2006_FINAL.xsd
)
SET(zwmsmsdl_XSDS_install MilitaryScenario_1.0.0.xsd)
FOREACH(xsd ${zwmsmsdl_XSDS} ${zwmsmsdl_XSDS_EXT})
XSD_GENERATE_TREE(zwmsmsdl_IDLS ${xsd})
ENDFOREACH(xsd ${zwmsmsdl_XSDS} ${zwmsmsdl_XSDS_EXT})
# Copy all required msdl *.xml and *.xsd files to shared folder
INSTALL_SHARED_FILES(zwmsmsdl_SRCS
FILES ${zwmsmsdl_XSDS}
DESTINATION "msdl/"
WS
)
INSTALL_SHARED_FILES(zwmsmsdl_SRCS
FILES ${zwmsmsdl_XSDS_EXT}
DESTINATION "msdl/extern"
WS
)
NGL_WRAP_UI(zwmsmsdl_SRCS ${zwmsmsdl_UICS})
NGL_ADD_LIBRARY(WS zwmsmsdl SHARED ${zwmsmsdl_SRCS} ${zwmsmsdl_UICS} ${zwmsmsdl_IDLS})
NGL_TARGET_INCLUDE_DIRECTORIES(zwmsmsdl
PRIVATE
${XSD_INCLUDE_DIR}
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
)
NGL_TARGET_LINK_LIBRARIES(zwmsmsdl
PRIVATE
Qt5::Gui
Qt5::Xml
Qt5::XmlPatterns
XercesC::XercesC
PUBLIC
svcPpmCommon
LtsUtilsSettings
LtsUtilsGuiDds
LtsSession
PpmDataPluginInterface
PpmCommon
ExmDataPluginInterface
OpmDataPluginInterface
LtsSessionData
ngltools
NGLLogger
LtsWidgets
Qt5::Core
)
IF (WIN32)
NGL_SET_TARGET_PROPERTIES(zwmsmsdl PROPERTIES UNITY_BUILD FALSE)
ENDIF()
NGL_INSTALL_TARGET(zwmsmsdl)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,578 @@
/**
* @RDE_HEADER@
* Exportieren einer Uebung in eine MSDL-Datei
* $Id$
* $HeadURL$
* $Author$
*/
// at first to avoid compiler errors on windows
#include <xsd/MilitaryScenario_1.0.0.hxx>
#include "msdl_export.h"
#include "ui_msdl_export.h"
#include "msdl_export_scenario_data.h"
#include <Common/participant_dis_helper.h>
#include <ngltools/ngltools_filesystem.h>
#include <QFileDialog>
#include <QFileInfo>
#include <QUrl>
#include <QDate>
#include <QUuid>
#include <fstream>
#include <LtsWidgets/lts_message_dialog.h>
#include <LtsUtilsSettings/settings.h>
#include <LtsSession/lts_session.h>
#include <ParticipantManagement/ppm_data_plugin_interface.h>
namespace msdl
{
using organizationsType = msdl_1::MilitaryScenarioType::Organizations_type;
using equipType = organizationsType::Equipment_type;
using equipItemType = equipType::EquipmentItem_type;
using coordChoiceType = equipItemType::Disposition_type::Location_type::CoordinateChoice_type;
using coordDataType = equipItemType::Disposition_type::Location_type::CoordinateData_type;
using descriptionType = schemas::modelID::modelIdentificationType::description_type;
using equipOptional = organizationsType::Equipment_optional;
using equipRelationsType = equipItemType::Relations_type;
using unitsType = organizationsType::Units_type;
using unitType = unitsType::Unit_type;
using relationsType = unitType::Relations_type;
using forceRelationChoiceType = relationsType::ForceRelation_type::ForceRelationChoice_type;
using forceRelationDataType = relationsType::ForceRelation_type::ForceRelationData_type;
using forceSidesType = msdl_1::MilitaryScenarioType::ForceSides_type;
using forceSideType = forceSidesType::ForceSide_type;
using ownerChoiceType = equipRelationsType::HoldingOrganization_type::OwnerChoice_type;
using ownerDataType = equipRelationsType::HoldingOrganization_type::OwnerData_type;
namespace Private
{
static msdl_1::MilitaryScenarioType::ScenarioID_type createTagScenarioID(const msdl::ScenarioDataDialog &dlgData);
static msdl_1::MilitaryScenarioType::ForceSides_type createTagForceSides(const QMap<qint32, ParticipantManagement::Party> &mapForces,
QMap<qint32, QString> &mapForceHandles);
static msdl_1::MilitaryScenarioType::Options_type createTagOptions();
static msdl_1::MilitaryScenarioType::Environment_type createTagEnvironment();
static msdl_1::MilitaryScenarioType::Organizations_type::Units_type createTagUnits(const QMap<qint32, ParticipantManagement::Participant> &mapParticipants,
const QMap<qint32, QString> &mapForceHandles,
QMap<qint32, std::string> &mapParticipantsUUIDs);
static msdl_1::MilitaryScenarioType::Organizations_type::Equipment_type createTagEquipment(const QMap<qint32, ParticipantManagement::Participant> &mapParticipants,
const QMap<qint32, std::string> &mapParticipantsUUIDs,
const QMap<int32_t, ParticipantManagement::ParticipantPosition> &mapParticipantPositions,
const QMap<qint32, ParticipantManagement::Type> &mapTypes,
const QMap<int32_t, ParticipantManagement::EquipmentType> &mapEquipment,
const QMap<qint32, QString> &mapForceHandles, NGL::INGLLogger &logger);
static void writeMilitaryScenario(const msdl_1::MilitaryScenarioType &miType,
const std::string &filename);
}
ExportMsdl::ExportMsdl(LtsSession::LtsSession *pSession, QWidget *parent)
: NGLDialog(parent)
, mLogger(msdl::getLogger("ExportMsdl"))
, mUi(new Ui_MSDLExport)
, m_pSession(pSession)
{
mUi->setupUi(this);
setWindowTitle(tr("Export Exercise Scenario"));
connect(mUi->tbExportFile, &QToolButton::clicked, this, &ExportMsdl::onTbExportFileClicked);
connect(mUi->m_pushButton_StartExport, &QPushButton::clicked, this, &ExportMsdl::onApply);
QString strExportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pathSelectedExportFile"), QString()).toString();
if (strExportFile.size())
{
mUi->leExportFile->setText(strExportFile);
mUi->m_pushButton_StartExport->setEnabled(true);
}
if (!m_pSession->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) ||
!m_pSession->getDtc<ExerciseManagement::DataInterface>(m_exmDtc) ||
!m_pSession->getDtc<OperatorManagement::DataInterface>(m_opmDtc))
{
ERROR_LOG(mLogger) << "Fetching m_ppmDtc or m_exmDtc or m_opmDtc failed!";
setEnabled(false);
}
}
ExportMsdl::~ExportMsdl()
{
delete mUi;
}
void ExportMsdl::onTbExportFileClicked()
{
QString strExportPath = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pathSelectedExportFile"), QStringLiteral("/tmp/msdl.xml")).toString();
QString caption(tr("Select File"));
QFileDialog fileDialog(this, caption, strExportPath, tr("XML files (*.xml)"));
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
QList<QUrl> urls;
urls << QUrl::fromLocalFile(strExportPath);
fileDialog.setSidebarUrls(urls);
if (fileDialog.exec()) // TODO: use show(), use signals & slots !
{
strExportPath = fileDialog.selectedFiles().constFirst();
mUi->leExportFile->setText(strExportPath);
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pathSelectedExportFile"), strExportPath);
}
mUi->m_pushButton_StartExport->setEnabled(!mUi->leExportFile->text().isEmpty());
}
msdl_1::MilitaryScenarioType::ScenarioID_type Private::createTagScenarioID(const msdl::ScenarioDataDialog &dlgData)
{
QDate cuDa = QDate::currentDate();
xml_schema::date da(cuDa.year(), cuDa.month(), cuDa.day());
// Block ScenarioID: General information
msdl_1::MilitaryScenarioType::ScenarioID_type::name_type nameType(dlgData.exerciseName().toStdString());
msdl_1::MilitaryScenarioType::ScenarioID_type::type_type typeType("BOM");
msdl_1::MilitaryScenarioType::ScenarioID_type::version_type versionType(dlgData.exerciseVersion().toStdString());
msdl_1::MilitaryScenarioType::ScenarioID_type::modificationDate_type modDateType(da);
msdl_1::MilitaryScenarioType::ScenarioID_type::securityClassification_type secClassType("Unclassified");
msdl_1::MilitaryScenarioType::ScenarioID_type::description_type desType(dlgData.exerciseDescription().toStdString());
msdl_1::MilitaryScenarioType::ScenarioID_type scIDType(nameType,
typeType,
versionType,
modDateType,
secClassType,
desType);
msdl_1::MilitaryScenarioType::ScenarioID_type::applicationDomain_type domainType(dlgData.exerciseDomain().toStdString());
scIDType.applicationDomain(domainType);
// ScenarioID: poc information as part of the general information (Mandatory!)
msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type pocType(dlgData.pocType().toStdString());
pocType.pocName(dlgData.pocAuthor().toStdString());
msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type::pocEmail_sequence pocSeqMail;
pocSeqMail.push_back(msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type::pocEmail_type(dlgData.pocEmail().toStdString()));
pocType.pocEmail(pocSeqMail);
msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type::pocTelephone_sequence pocSeqTelephone;
pocSeqTelephone.push_back(msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type::pocTelephone_type(dlgData.pocTelephone().toStdString()));
// pocSeqTelephone.push_back(msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type::pocTelephone_type("+421-1080-4288")); // Example for adding further telephone numbers
pocType.pocTelephone(pocSeqTelephone);
msdl_1::MilitaryScenarioType::ScenarioID_type::poc_type::pocOrg_type pocOrgType(dlgData.pocOrganization().toStdString());
pocType.pocOrg(pocOrgType);
msdl_1::MilitaryScenarioType::ScenarioID_type::poc_sequence pocSequence;
pocSequence.push_back(pocType);
scIDType.poc(pocSequence);
scIDType.purpose(dlgData.exercisePurpose().toStdString());
scIDType.modificationDate(da);
return scIDType;
}
msdl_1::MilitaryScenarioType::ForceSides_type Private::createTagForceSides(const QMap<qint32, ParticipantManagement::Party> &mapForces,
QMap<qint32, QString> &mapForceHandles)
{
msdl_1::MilitaryScenarioType::ForceSides_type foType;
msdl_1::MilitaryScenarioType::ForceSides_type::ForceSide_sequence &foSiSe(foType.ForceSide());
// We have to create all UUIDs first
QMap<QString, ParticipantManagement::Party> mapUUID2Force;
for (const ParticipantManagement::Party &party : mapForces)
{
// Skip Pool and O/C Service
if (party.id() == 0 || party.id() == 1)
continue;
QString obHaStr = QUuid::createUuid().toString();
obHaStr = obHaStr.mid(1, obHaStr.size() - 2);
mapUUID2Force[obHaStr] = party;
}
// Create ForceSide for each party
QMapIterator<QString, ParticipantManagement::Party> itForce(mapUUID2Force);
while (itForce.hasNext())
{
itForce.next();
const QString &strUUID = itForce.key();
const ParticipantManagement::Party &party = itForce.value();
msdl_1::ForceSideType::ObjectHandle_type obHaTy(strUUID.toStdString().c_str());
msdl_1::ForceSideType::ForceSideName_type foSiNaTy(party.name().c_str());
msdl_1::ForceSideType foSiTy(obHaTy, foSiNaTy);
// Connect all parties among each other by using their relationship status (Hostile, Friend, ...)
msdl_1::ForceSideType::Associations_type::Association_sequence asSequence;
QMapIterator<QString, ParticipantManagement::Party> itRelationship(mapUUID2Force);
while (itRelationship.hasNext())
{
itRelationship.next();
if (itRelationship.key() == strUUID)
continue;
/*
* Identify relationship. Only FR / HO / NEUTR / UNK are used
*/
ParticipantManagement::Role role = itRelationship.value().role();
msdl_1::ForceSideType::Associations_type::Association_type::Relationship_type relType = msdl_1::ForceSideType::Associations_type::Association_type::Relationship_type::UNK;
if (role == ParticipantManagement::Role_def::Enemy)
relType = msdl_1::ForceSideType::Associations_type::Association_type::Relationship_type::HO;
else if (role == ParticipantManagement::Role_def::Friend)
relType = msdl_1::ForceSideType::Associations_type::Association_type::Relationship_type::FR;
else if (role == ParticipantManagement::Role_def::Neutral)
relType = msdl_1::ForceSideType::Associations_type::Association_type::Relationship_type::NEUTRL;
msdl_1::ForceSideType::Associations_type::Association_type aType(itRelationship.key().toStdString().c_str(), relType);
asSequence.push_back(aType);
}
msdl_1::ForceSideType::Associations_type asType;
asType.Association(asSequence);
foSiTy.Associations(asType);
foSiSe.push_back(foSiTy);
mapForceHandles[party.id()] = strUUID;
}
return foType;
}
msdl_1::MilitaryScenarioType::Options_type Private::createTagOptions()
{
msdl_1::MilitaryScenarioType::Options_type opType("");
opType.MSDLVersion("1.0.0");
msdl_1::boolean aggrBased = false;
msdl_1::OrganizationDetailType orType(aggrBased);
msdl_1::OrganizationDetailType::AggregateEchelon_type aggrEchelon(msdl_1::OrganizationDetailType::AggregateEchelon_type::enumEchelon::BATTALION);
orType.AggregateEchelon(aggrEchelon);
opType.OrganizationDetail(orType);
return opType;
}
msdl_1::MilitaryScenarioType::Environment_type Private::createTagEnvironment()
{
msdl_1::MilitaryScenarioType::Environment_type enType;
// Time
msdl_1::MilitaryScenarioType::Environment_type::ScenarioTime_type timeType("2013-05-28T17:37:24Z");
enType.ScenarioTime(timeType);
// Upper Right
msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type::UpperRight_type::CoordinateChoice_type choiceType_ur(msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type::UpperRight_type::CoordinateChoice_type::GCC);
coordDataType::GCC_type::X_type x_ur(123);
coordDataType::GCC_type::X_type y_ur(456);
coordDataType::GCC_type::Z_type z_ur(789);
coordDataType::GCC_type utTy_ur(x_ur, y_ur, z_ur);
coordDataType coDaTy_ur;
coDaTy_ur.GCC(utTy_ur);
msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type::UpperRight_type urType(choiceType_ur, coDaTy_ur);
// Lower Left
msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type::LowerLeft_type::CoordinateChoice_type choiceType(msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type::UpperRight_type::CoordinateChoice_type::GCC);
coordDataType::GCC_type::X_type x_ll(987);
coordDataType::GCC_type::X_type y_ll(654);
coordDataType::GCC_type::Z_type z_ll(321);
coordDataType::GCC_type utTy_ll(x_ll, y_ll, z_ll);
coordDataType coDaTy_ll;
coDaTy_ll.GCC(utTy_ll);
msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type::LowerLeft_type llType(choiceType, coDaTy_ll);
// AreaOfInterest
msdl_1::MilitaryScenarioType::Environment_type::AreaOfInterest_type areaType(urType, llType);
enType.AreaOfInterest(areaType);
return enType;
}
msdl_1::MilitaryScenarioType::Organizations_type::Units_type Private::createTagUnits(const QMap<qint32, ParticipantManagement::Participant> &mapParticipants,
const QMap<qint32, QString> &mapForceHandles,
QMap<qint32, std::string> &mapParticipantsUUIDs)
{
mapParticipantsUUIDs.clear();
// Create unique identifier for all participants
for (const ParticipantManagement::Participant &participant : mapParticipants)
{
QString obHaStr = QUuid::createUuid().toString();
obHaStr = obHaStr.mid(1, obHaStr.size() - 2);
mapParticipantsUUIDs[participant.id()] = obHaStr.toStdString();
}
unitsType unitsTy;
unitsType::Unit_sequence &unSe(unitsTy.Unit());
for (auto it = mapForceHandles.begin(); it != mapForceHandles.end(); ++it)
{
for (const ParticipantManagement::Participant &participant : mapParticipants)
{
// Does participant belong to currently exported party?
if (participant.partyId() != it.key())
continue;
if (participant.isDeleted())
continue;
forceRelationDataType foReDaTy;
forceRelationChoiceType foReChTy = forceRelationChoiceType::FORCE_SIDE;
if (participant.superiorId() == 0) // Vorgesetzter ist die Truppe
{
foReChTy = forceRelationChoiceType::FORCE_SIDE;
const QString &obHaStr = it.value();
foReDaTy.ForceSideHandle(obHaStr.toStdString().c_str());
}
else
{
foReChTy = forceRelationChoiceType::UNIT;
msdl_1::CommandRelationType::CommandingSuperiorHandle_type handle(mapParticipantsUUIDs.value(participant.superiorId()));
forceRelationDataType::CommandRelation_type cmdRelation(handle, msdl_1::CommandRelationType::CommandRelationshipType_type::TACON); // No idea about the enumeration values (ADCON, None, etc.)
foReDaTy.CommandRelation(cmdRelation);
}
unitType::ObjectHandle_type unObHaTy(mapParticipantsUUIDs.value(participant.id()));
unitType::SymbolIdentifier_type syIdTy = "S--------------";
relationsType::ForceRelation_type foReTy(foReChTy, foReDaTy);
unitType::Relations_type reTy(foReTy);
unitType unitTy(unObHaTy, syIdTy, reTy);
unitTy.SymbolIdentifier(syIdTy);
unitType::Name_type naTy(participant.designator().c_str());
unitTy.Name(naTy);
unSe.push_back(unitTy);
}
}
return unitsTy;
}
msdl_1::MilitaryScenarioType::Organizations_type::Equipment_type Private::createTagEquipment(const QMap<qint32, ParticipantManagement::Participant> &mapParticipants,
const QMap<qint32, std::string> &mapParticipantsUUIDs,
const QMap<int32_t, ParticipantManagement::ParticipantPosition> &mapParticipantPositions,
const QMap<qint32, ParticipantManagement::Type> &mapTypes,
const QMap<int32_t, ParticipantManagement::EquipmentType> &mapEquipment,
const QMap<qint32, QString> &mapForceHandles,
NGL::INGLLogger &logger)
{
equipType eqTy;
equipType::EquipmentItem_sequence &eqItSeq(eqTy.EquipmentItem());
for (auto it = mapForceHandles.begin(); it != mapForceHandles.end(); ++it)
{
const int32_t partyId = it.key();
for (const ParticipantManagement::Participant &participant : mapParticipants)
{
// Does participant belong to current party?
if (participant.partyId() != partyId)
continue;
if (participant.isDeleted())
continue;
/*
* Identify equipment owner handle (UUID)
* According to ICD is 'ownerChoise' always unit
*/
ownerDataType::UnitOwnerHandle_type foOwHaTy;
foOwHaTy = mapParticipantsUUIDs.value(participant.id()).c_str();
ownerDataType owDaTy;
owDaTy.UnitOwnerHandle(foOwHaTy);
ownerChoiceType owChTy(ownerChoiceType::UNIT);
equipRelationsType::HoldingOrganization_type hoOrTy(owChTy, owDaTy);
equipItemType::Relations_type reTy(hoOrTy);
// Equipment modifiers
auto vecDISEntities = mapTypes.value(participant.typeId()).disEntities();
if (!vecDISEntities.size())
{
WARNING_LOG(logger) << "Participant id " << participant.id()
<< " belongs to a type id " << participant.typeId() << " which has no DIS id! Skipping export of participant!";
continue;
}
// DIS entity id: Does not matter if this type has more than 1 DIS id. Simply pick first one
equipItemType::EquipmentSymbolModifiers_type eqModifiers(ParticipantManagement::DIS::convertDISTypeInteger2MSDLString(vecDISEntities[0]).toStdString().c_str());
eqModifiers.Quantity(1);
eqModifiers.EquipmentType("S--------------");
// Coordinates and Elevation
// Unclear: Are participant coordinates correctly specified converted?
coordDataType::GCC_type::X_type x(mapParticipantPositions[participant.id()].pos().lon());
coordDataType::GCC_type::X_type y(mapParticipantPositions[participant.id()].pos().lat());
coordDataType::GCC_type::Z_type z(mapParticipantPositions[participant.id()].pos().z());
coordDataType::GCC_type utTy(x, y, z);
coordDataType coDaTy;
coDaTy.GCC(utTy);
coordChoiceType coChTy(coordChoiceType::enumCoordinateSystemType::GCC);
/*
// UTM Version
coordDataType::UTM_type::UTMGridZone_type utmGriZoTy("UTM");
coordDataType::UTM_type::UTMEasting_type utmEaTy(mapParticipantPositions[participant.id()].pos().lon());
coordDataType::UTM_type::UTMNorthing_type utmNoTy(mapParticipantPositions[participant.id()].pos().lat());
coordDataType::UTM_type utTy(utmGriZoTy, utmEaTy, utmNoTy);
coordDataType::UTM_type::ElevationAGL_type elType(mapParticipantPositions[participant.id()].pos().z());
utTy.ElevationAGL(elType);
coordDataType coDaTy;
coDaTy.UTM(utTy);
coordChoiceType coChTy(coordChoiceType::enumCoordinateSystemType::UTM);
*/
equipItemType::Disposition_type::Location_type loTy(coChTy, coDaTy);
equipItemType::Disposition_type diTy(loTy);
// Direction of Movement
equipItemType::Disposition_type::DirectionOfMovement_type loDir(0.0);
diTy.DirectionOfMovement(loDir);
// SIDC
equipItemType::SymbolIdentifier_type syIdTy("S--------------");
// Finally create equipment
equipItemType eqItTy(foOwHaTy, syIdTy, diTy, reTy);
eqItTy.EquipmentSymbolModifiers(eqModifiers);
// Create UUID for equipment
QString obHaStr = QUuid::createUuid().toString();
obHaStr = obHaStr.mid(1, obHaStr.size() - 2);
equipItemType::ObjectHandle_type eqObHaTy = obHaStr.toStdString().c_str();
eqItTy.ObjectHandle(eqObHaTy);
// Participant -> TypeId -> EquipmentId -> Equipment name (Easy workflow, right?)
equipItemType::Name_type naTy(mapEquipment.value(mapTypes.value(participant.typeId()).equipmentTypeId()).name());
eqItTy.Name(naTy);
eqItTy.SymbolIdentifier(syIdTy);
eqItSeq.push_back(eqItTy);
}
}
return eqTy;
}
void Private::writeMilitaryScenario(const msdl_1::MilitaryScenarioType &miType,
const std::string &filename)
{
xml_schema::namespace_infomap map;
map["msdl"].name = "urn:sisostds:scenario:military:data:draft:msdl:1";
map["msdl"].schema = NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("MilitaryScenario_1.0.0.xsd")).toStdString();
map["modelID"].name = "http://www.sisostds.org/schemas/modelID";
std::ofstream ofs(filename);
msdl_1::MilitaryScenario(ofs, miType, map);
}
void ExportMsdl::onApply()
{
ScenarioDataDialog dlg(this, m_pSession, m_opmDtc, m_exmDtc);
int retCode = dlg.exec();
if (retCode == QDialog::Rejected)
{
close();
return;
}
try
{
const auto participants = m_ppmDtc->participants();
QMap<qint32, QString> mapForceHandles;
QMap<qint32, std::string> mapParticipantsUUIDs;
msdl_1::MilitaryScenarioType::ScenarioID_type scIDType = Private::createTagScenarioID(dlg);
msdl_1::MilitaryScenarioType::ForceSides_type foType = Private::createTagForceSides(m_ppmDtc->partys(), mapForceHandles);
msdl_1::MilitaryScenarioType::Options_type opType = Private::createTagOptions();
msdl_1::MilitaryScenarioType miType(scIDType, opType, foType);
msdl_1::MilitaryScenarioType::Environment_type enType = Private::createTagEnvironment();
unitsType unitsTy = Private::createTagUnits(participants, mapForceHandles, mapParticipantsUUIDs);
equipType equipmentTy = Private::createTagEquipment(participants,
mapParticipantsUUIDs,
m_ppmDtc->participantPositions(),
m_ppmDtc->types(),
m_ppmDtc->equipmentTypes(),
mapForceHandles,
mLogger);
equipType::EquipmentItem_sequence &eqItSeq(equipmentTy.EquipmentItem());
organizationsType orTy(unitsTy);
miType.Environment(enType);
if ( eqItSeq.size() > 0)
{
INFO_LOG(mLogger) << "orTy.Equipment(equipmentTy)";
orTy.Equipment(equipmentTy);
}
miType.Organizations(orTy);
QString fileName = mUi->leExportFile->text();
QFileInfo fileInfo(fileName);
if ( !fileInfo.exists(fileName))
{
QFile file(fileName);
file.open(QIODevice::WriteOnly);
file.close();
}
if (!fileInfo.isWritable())
LtsWidgets::LtsMessageDialog::showMessage(this, tr("MSDL export file \"%1\" can not be written").arg(fileName));
else
{
Private::writeMilitaryScenario(miType, fileName.toStdString());
LtsWidgets::LtsMessageDialog::showMessage(this, tr("MSDL export file has successfully been created"));
}
}
catch (const std::exception &e)
{
// There is so much that could be wrong when importing or exporting MSDL files (missing tags, optional tags, ...)
LtsWidgets::LtsMessageDialog::showMessage(this, tr("MSDL export failed!"));
ERROR_LOG(mLogger) << "MSDL export failed with an exception, e.what(): " << e.what();
}
close();
}
}
@@ -0,0 +1,51 @@
/**
* @RDE_HEADER@
* Klasse fuer das Exportieren von einer Uebung in eine MSDL-Datei
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <nglwidgets/ngldialog.h>
#include "msdl_logging.h"
#include "zwmsmsdl_export.h"
#include <memory>
#include <OperatorManagement/opm_data_plugin_interface.h>
#include <ExerciseManagement/exm_data_plugin_interface.h>
#include <ParticipantManagement/ppm_dtc.h>
class Ui_MSDLExport;
namespace LtsSession
{
class LtsSession;
}
namespace msdl
{
class ZWMSMSDL_EXPORT ExportMsdl : public NGLDialog
{
Q_OBJECT
public:
ExportMsdl(LtsSession::LtsSession *pSession, QWidget *parent);
virtual ~ExportMsdl();
protected slots:
void onTbExportFileClicked();
void onApply();
private:
msdl::LOGGER_T mLogger;
Ui_MSDLExport *mUi;
LtsSession::LtsSession *m_pSession;
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc; // Operator name
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc; // Exercise name, description
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc; // Organisation structure, participants, equipment ...
};
}
@@ -0,0 +1,136 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#include "msdl_export_scenario_data.h"
#include <LtsUtilsSettings/settings.h>
#include <LtsSession/lts_session.h>
#include <LtsSession/lts_session_data.h>
#include <LtsWidgets/lts_message_dialog.h>
namespace msdl
{
ScenarioDataDialog::ScenarioDataDialog(QWidget *parent,
LtsSession::LtsSession *pSession,
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
const std::shared_ptr<ExerciseManagement::Interface::Dtc> &exmDtc)
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
, mUi(new Ui_ExportScenarioData)
{
mUi->setupUi(this);
connect(mUi->m_pushButton_Ok, &QPushButton::clicked, this, &ScenarioDataDialog::onButtonOk);
connect(mUi->m_pushButton_Cancel, &QPushButton::clicked, this, &ScenarioDataDialog::onButtonCancel);
ExerciseManagement::Exercise exercise = exmDtc->exercise(pSession->exerciseId());
mUi->m_lineEdit_ExerciseDescription->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("exerciseDescription"), QString::fromStdString(exercise.description())).toString());
// Must be a single word according to msdl standard. "-" is not allowed!
QString strName(QString::fromStdString(exercise.name()));
strName.remove(QLatin1Char(' '));
mUi->m_lineEdit_ExerciseName->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("exerciseName"), strName).toString());
mUi->m_lineEdit_Domain->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("exerciseDomain"), QString::fromStdString(exercise.partitionName())).toString());
mUi->m_lineEdit_Version->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("exerciseVersion"), QString()).toString());
mUi->m_lineEdit_Purpose->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("exercisePurpose"), QString()).toString());
OperatorManagement::User user = opmDtc->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
mUi->m_lineEdit_Type->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pocType"), QString::fromStdString(user.description())).toString());
mUi->m_lineEdit_AuthorName->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pocAuthor"), QString::fromStdString(user.name())).toString());
mUi->m_lineEdit_Organization->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pocOrganization"), QString()).toString());
mUi->m_lineEdit_Email->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pocEmail"), QString()).toString());
mUi->m_lineEdit_Telephone->setText(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pocTelephone"), QString()).toString());
highlightInvalidInput();
}
ScenarioDataDialog::~ScenarioDataDialog()
{
delete mUi;
}
void ScenarioDataDialog::highlightInvalidInput()
{
QString bgColorRed(QStringLiteral("QLineEdit { background: rgb(255, 0, 0); }"));
QString bgColorWhite(QStringLiteral("QLineEdit { background: rgb(255, 255, 255); }"));
mUi->m_lineEdit_ExerciseDescription->setStyleSheet((mUi->m_lineEdit_ExerciseDescription->text().size() < 2) ? bgColorRed : bgColorWhite);
// Must be a single word according to msdl standard. "-" is not allowed!
QStringList strWords = mUi->m_lineEdit_ExerciseName->text().split(QStringLiteral(" "));
mUi->m_lineEdit_ExerciseName->setStyleSheet(bgColorWhite);
if (strWords.size() != 1)
{
mUi->m_lineEdit_ExerciseName->setStyleSheet(bgColorRed);
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Exercise name must be one word!"));
}
else if (strWords[0] == QStringLiteral("-"))
{
mUi->m_lineEdit_ExerciseName->setStyleSheet(bgColorRed);
LtsWidgets::LtsMessageDialog::showMessage(this, tr("\"-\" is no valid exercise name!"));
}
mUi->m_lineEdit_Version->setStyleSheet(mUi->m_lineEdit_Version->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_Purpose->setStyleSheet(mUi->m_lineEdit_Purpose->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_Domain->setStyleSheet(mUi->m_lineEdit_Domain->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_Type->setStyleSheet(mUi->m_lineEdit_Type->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_AuthorName->setStyleSheet(mUi->m_lineEdit_AuthorName->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_Organization->setStyleSheet(mUi->m_lineEdit_Organization->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_Telephone->setStyleSheet(mUi->m_lineEdit_Telephone->text().isEmpty() ? bgColorRed : bgColorWhite);
mUi->m_lineEdit_Email->setStyleSheet(mUi->m_lineEdit_Email->text().isEmpty() ? bgColorRed : bgColorWhite);
}
bool ScenarioDataDialog::inputValid() const
{
QStringList strWords = mUi->m_lineEdit_ExerciseName->text().split(QStringLiteral(" "));
return (!mUi->m_lineEdit_ExerciseDescription->text().isEmpty() &&
(strWords.size() == 1 && strWords[0] != QStringLiteral("-")) &&
!mUi->m_lineEdit_Version->text().isEmpty() &&
!mUi->m_lineEdit_Purpose->text().isEmpty() &&
!mUi->m_lineEdit_Domain->text().isEmpty() &&
!mUi->m_lineEdit_Type->text().isEmpty() &&
!mUi->m_lineEdit_AuthorName->text().isEmpty() &&
!mUi->m_lineEdit_Organization->text().isEmpty() &&
!mUi->m_lineEdit_Telephone->text().isEmpty() &&
!mUi->m_lineEdit_Email->text().isEmpty());
}
void ScenarioDataDialog::onButtonOk()
{
highlightInvalidInput();
if (inputValid())
{
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("exerciseDescription"), mUi->m_lineEdit_ExerciseDescription->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("exerciseName"), mUi->m_lineEdit_ExerciseName->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("exerciseDomain"), mUi->m_lineEdit_Domain->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("exerciseVersion"), mUi->m_lineEdit_Version->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("exercisePurpose"), mUi->m_lineEdit_Purpose->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pocType"), mUi->m_lineEdit_Type->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pocAuthor"), mUi->m_lineEdit_AuthorName->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pocOrganization"), mUi->m_lineEdit_Organization->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pocEmail"), mUi->m_lineEdit_Email->text());
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pocTelephone"), mUi->m_lineEdit_Telephone->text());
QDialog::accept();
}
else
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Please verify your input!"));
}
void ScenarioDataDialog::onButtonCancel()
{
QDialog::reject();
}
}
@@ -0,0 +1,54 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <memory>
#include <LtsWidgets/lts_frameless_dialog.h>
#include <OperatorManagement/opm_dtc.h>
#include <ExerciseManagement/exm_dtc.h>
#include "ui_msdl_export_scenario_data.h"
namespace LtsSession
{
class LtsSession;
}
namespace msdl
{
class ScenarioDataDialog : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
ScenarioDataDialog(QWidget *parent,
LtsSession::LtsSession *pSession,
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
const std::shared_ptr<ExerciseManagement::Interface::Dtc> &exmDtc);
~ScenarioDataDialog();
QString exerciseDescription() const { return mUi->m_lineEdit_ExerciseDescription->text(); }
QString exerciseName() const { return mUi->m_lineEdit_ExerciseName->text(); }
QString exerciseVersion() const { return mUi->m_lineEdit_Version->text(); }
QString exerciseDomain() const { return mUi->m_lineEdit_Domain->text(); }
QString exercisePurpose() const { return mUi->m_lineEdit_Purpose->text(); }
QString pocType() const { return mUi->m_lineEdit_Type->text(); }
QString pocAuthor() const { return mUi->m_lineEdit_AuthorName->text(); }
QString pocOrganization() const { return mUi->m_lineEdit_Organization->text(); }
QString pocEmail() const { return mUi->m_lineEdit_Email->text(); }
QString pocTelephone() const { return mUi->m_lineEdit_Telephone->text(); }
private slots:
void onButtonOk();
void onButtonCancel();
private:
void highlightInvalidInput();
bool inputValid() const;
Ui_ExportScenarioData *mUi;
};
}
@@ -0,0 +1,917 @@
/**
* @RDE_HEADER@
* Importieren von MSDL-Dateien
* $Id$
* $HeadURL$
* $Author$
*/
// at first to avoid compiler errors on windows (CONST as enum value)
#include <xsd/MilitaryScenario_1.0.0.hxx>
#include <xsd/MsdlComplexTypes_1.0.0.hxx>
#include "msdl_import.h"
#include "ui_msdl_import.h"
#include "msdl_logging.h"
#include "msdl_import_show.h"
#include "msdl_mapping_dialog.h"
#include <QFileDialog>
#include <QFile>
#include <QUuid>
#include <QTextStream>
#include <QUrl>
#include <QAbstractMessageHandler>
#include <QDomDocument>
#include <QMimeData>
#include <QProcess>
#include <QtXmlPatterns/QXmlSchema>
#include <QtXmlPatterns/QXmlSchemaValidator>
#include <ngltools/ngltools_filesystem.h>
#include <Common/participant_dis_helper.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
#include <LtsSession/lts_session.h>
#include <LtsUtilsSettings/settings.h>
#include <LtsWidgets/lts_message_dialog.h>
#include <QDir>
namespace msdl
{
static QString gStrMSDLWorkingFolderPath()
{
return QDir::tempPath() + QLatin1String("/excon_msdl/");
}
static QString gStrMSDLWorkingFile()
{
return gStrMSDLWorkingFolderPath() + QStringLiteral("msdl_user_input.xml");
}
using descriptionType = schemas::modelID::modelIdentificationType::description_type;
using organizationsType = msdl_1::MilitaryScenarioType::Organizations_type;
using equipType = organizationsType::Equipment_type;
using equipItemType = equipType::EquipmentItem_type;
using equipOptional = organizationsType::Equipment_optional;
using equipRelationsType = equipItemType::Relations_type;
using unitsType = organizationsType::Units_type;
using unitType = unitsType::Unit_type;
using relationsType = unitType::Relations_type;
using forceRelationDataType = relationsType::ForceRelation_type::ForceRelationData_type;
using forceSidesType = msdl_1::MilitaryScenarioType::ForceSides_type;
using forceSideType = forceSidesType::ForceSide_type;
using ownerChoiceType = equipRelationsType::HoldingOrganization_type::OwnerChoice_type;
using ownerDataType = equipRelationsType::HoldingOrganization_type::OwnerData_type;
using purposeOptional = schemas::modelID::modelIdentificationType::purpose_optional;
ImportMsdl::ImportMsdl(ParticipantManagement::ParticipantEditModel *pModel, const QModelIndex &index, QWidget *parent, LtsSession::LtsSession *pSession)
: NGLDialog(parent)
, m_indexRoot(index)
, m_pModel(pModel)
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_pMsdlImportShow(nullptr)
, m_pUi(new Ui_MSDLImport)
, mLogger(msdl::getLogger("ImportMsdl"))
{
m_pUi->setupUi(this);
setWindowTitle(tr("Import Exercise Scenario"));
if (!pSession->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) || !pSession->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
{
ERROR_LOG(mLogger) << "Fetching m_ppmDtc or m_ppmFtc failed!";
setEnabled(false);
}
else
{
m_mapTypes = m_ppmDtc->types();
/*
* Store all DIS ids of each type in 'm_mapDisStr2TypeId' to allow a mapping between
* DIS ids and types when importing units.
*
* Note: A type may have more than one DIS id.
* Note: Each type should have an assigned DIS id! Otherwise it will not be available for mapping!
*/
for (const ParticipantManagement::Type &type : qAsConst(m_mapTypes))
{
for (const auto &disId : type.disEntities())
{
QString strMSDL_DISId = ParticipantManagement::DIS::convertDISTypeInteger2MSDLString(disId);
if (m_mapMSDL_DIS_2TypeId.find(strMSDL_DISId) != m_mapMSDL_DIS_2TypeId.end())
{
WARNING_LOG(mLogger) << "DIS id \"" << strMSDL_DISId << "\" which is assigned to type id \"" << type.id() << "\" is already assigned to type id \"" << m_mapMSDL_DIS_2TypeId[strMSDL_DISId] << "\"";
continue;
}
m_mapMSDL_DIS_2TypeId[strMSDL_DISId] = type.id();
}
}
}
QDir dir(gStrMSDLWorkingFolderPath());
dir.removeRecursively();
if (!dir.mkpath(QStringLiteral(".")))
{
ERROR_LOG(mLogger) << "Could not create path \"" << gStrMSDLWorkingFolderPath() << "\" which is required to parse MSDL data";
setEnabled(false);
}
if (!NGL::copyDirContentsToDir(QStringLiteral("msdl"), gStrMSDLWorkingFolderPath(), true))
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start MSDL import. Could not copy validation files."));
ERROR_LOG(mLogger) << "Could not copy xsd files to " << gStrMSDLWorkingFolderPath();
return;
}
connect(m_pUi->m_pushbutton_SelectFile, &QPushButton::clicked,
this, &ImportMsdl::slotOpenImportDialog);
connect(m_pUi->m_pushButton_StartImport, &QPushButton::clicked,
this, &ImportMsdl::slotStartImport);
QString strImportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pathSelectedImportFile"), QString()).toString();
m_pUi->m_lineedit_ImportFile->setText(strImportFile);
m_pUi->m_pushButton_StartImport->setEnabled(strImportFile.size());
}
ImportMsdl::~ImportMsdl()
{
delete m_pUi;
}
void ImportMsdl::slotOpenImportDialog()
{
QString strPathSelectedImportFolder = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pathSelectedImportFolder"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
QString strPathSelectedImportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("MSDL"), QStringLiteral("pathSelectedImportFile"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
QList<QUrl> urls;
urls << QUrl::fromLocalFile(strPathSelectedImportFile);
QFileDialog fileDialog(this, tr("Select File"), strPathSelectedImportFolder, tr("XML files (*.xml)"));
fileDialog.setSidebarUrls(urls);
fileDialog.setOptions(QFileDialog::ReadOnly);
fileDialog.setFileMode(QFileDialog::ExistingFile);
if (fileDialog.exec()) // TODO: use show(), use signals & slots !
{
strPathSelectedImportFile = fileDialog.selectedFiles().constFirst();
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pathSelectedImportFolder"), strPathSelectedImportFolder);
if (!strPathSelectedImportFile.size())
return;
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("MSDL"), QStringLiteral("pathSelectedImportFile"), strPathSelectedImportFile);
m_pUi->m_lineedit_ImportFile->setText(strPathSelectedImportFile);
m_pUi->m_pushButton_StartImport->setEnabled(true);
}
}
void ImportMsdl::slotStartImport()
{
QString strPathSelectedImportFile = m_pUi->m_lineedit_ImportFile->text();
createWorkingCopy(strPathSelectedImportFile);
if (!schemaValidation())
return;
#ifdef LTS_DEBUG
delete m_pMsdlImportShow;
m_pMsdlImportShow = new msdl::ImportMsdlShow(nullptr, gStrMSDLWorkingFile());
m_pMsdlImportShow->show();
#endif
QFile file(gStrMSDLWorkingFile());
if (!file.open(QIODevice::ReadOnly))
{
ERROR_LOG(mLogger) << "Could not open msdl working copy: " << gStrMSDLWorkingFile();
return;
}
QDomDocument doc(QStringLiteral("mydocument"));
if (!doc.setContent(&file))
{
file.close();
return;
}
try
{
importExerciseScenario();
}
catch (std::exception &e)
{
// There is so much that could be wrong when importing or exporting MSDL files (missing tags, optional tags, ...)
LtsWidgets::LtsMessageDialog::showMessage(this, tr("MSDL import failed!"));
ERROR_LOG(mLogger) << "MSDL import failed with an exception, e.what(): " << e.what();
}
close();
}
void ImportMsdl::createWorkingCopy(const QString &strImportFile)
{
// Input File
QFile file(strImportFile);
if (!file.open(QIODevice::ReadOnly))
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Selected input file doesn't exist on filesystem. Has it been deleted?"), tr("Error"));
return;
}
// Output File
QFile fileWithNamespace(gStrMSDLWorkingFile());
if (!fileWithNamespace.open(QIODevice::WriteOnly | QIODevice::Text))
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Cannot create working copy of input file on filesystem:") + QLatin1Char('\n') + gStrMSDLWorkingFile(), tr("Error"));
return;
}
QTextStream inputTextStream(&file);
QTextStream outputTextStream(&fileWithNamespace);
QString line;
bool kommentar = false;
do
{
line = inputTextStream.readLine();
if (kommentar && !line.contains(QStringLiteral("-->")))
continue;
if (line.contains(QStringLiteral("-->")))
{
kommentar = false;
continue;
}
if (line.contains(QStringLiteral("<!--")))
{
kommentar = true;
continue;
}
if ((!line.contains(QStringLiteral("msdl:"))) &&
(!line.contains(QStringLiteral("?xml"))) &&
(!line.contains(QStringLiteral("<!"))) &&
(!line.contains(QStringLiteral("<modelID"))) &&
(!line.contains(QStringLiteral("</modelID"))) &&
(!line.contains(QStringLiteral("<?xml"))))
{
line.replace(QStringLiteral("<"), QStringLiteral("<msdl:"));
line.replace(QStringLiteral("<msdl:/"), QStringLiteral("</msdl:"));
}
if (line.contains(QStringLiteral("<msdl:MilitaryScenario")))
line = QStringLiteral("<msdl:MilitaryScenario xmlns:msdl=\"urn:sisostds:scenario:military:data:draft:msdl:1\" xmlns:modelID=\"http://www.sisostds.org/schemas/modelID\" xmlns:jc3=\"urn:int:nato:standard:mip:jc3iedm:3.1:oo:2.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:sisostds:scenario:military:data:draft:msdl:1 ./MilitaryScenario_1.0.0.xsd\">");
outputTextStream << line << "\n";
}
while (!line.isNull());
}
bool ImportMsdl::schemaValidation()
{
QString strPathToSchemaFile = NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("MilitaryScenario_1.0.0.xsd"));
QFile schemaFile(strPathToSchemaFile);
if (!schemaFile.open(QIODevice::ReadOnly))
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("MilitaryScenario_1.0.0.xsd doesn't exist on filesystem"), tr("Validation Error"));
return false;
}
QXmlSchema schema;
msdl::SchemaMessageHandler smh;
schema.setMessageHandler(&smh);
schema.load(&schemaFile, QUrl::fromLocalFile(schemaFile.fileName()));
// Erst einmal das Schema (*.xsd) ueberpruefen
if (!schema.isValid())
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Schema is invalid"));
return false;
}
QProcess xmllint_cmd;
xmllint_cmd.setProcessChannelMode(QProcess::MergedChannels);
xmllint_cmd.start(QStringLiteral("xmllint"), QStringList()
<< QStringLiteral("--noout")
<< QStringLiteral("--schema")
<< schemaFile.fileName()
<< gStrMSDLWorkingFile());
if (!xmllint_cmd.waitForFinished())
{
ERROR_LOG(mLogger) << "Validation Fault cmd";
return false;
}
#ifdef LTS_DEBUG
QByteArray validation = xmllint_cmd.readAllStandardOutput();
LtsWidgets::LtsMessageDialog::showMessage(this, QString::fromLatin1(validation), tr("Info"));
if (!validation.contains("validates"))
return false;
#endif
// Nun das Schema (*.xsd) gegen das zu importierende MilitaryScenario (*.xml) validieren
QXmlSchemaValidator validator(schema);
if (false /*|| validator.validate(QUrl::fromLocalFile(mImportFile))*/)
{
#ifdef LTS_DEBUG
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Instance document is invalid"));
#endif
return false;
}
return true;
}
ParticipantManagement::ParticipantData ImportMsdl::createParticipant(const MSDLParticipant &unit)
{
ParticipantManagement::ParticipantData p;
// Designator
p.designator(unit.m_designator.toStdString());
p.tacticalIdentifier(unit.m_tacticalIdentifier.toStdString());
// State and Equipment
p.equipmentNumber() = 0;
p.assignState() = ParticipantManagement::ParticipantAssignState::HandoutExcon;
/* Symbol respectively sidc
* We are not using the imported 2525c symbol (that would be: p.symbol(unit.m_symbolIdentifier.toStdString());)
* Instead, we use the symbol of the mapped type!
*/
p.symbol(m_mapTypes[unit.m_mappedTypeId].symbol());
p.typeId(unit.m_mappedTypeId); // Class type is internally derived from typeid, no need (and possibility) to set it here
return p;
}
void ImportMsdl::insertParticipant(const MSDLParticipant &unit, const QModelIndex &index)
{
ParticipantManagement::ParticipantData newParticipant = createParticipant(unit);
createNode(newParticipant, index, unit.m_ownHandle);
}
/*
* All parties respectively forces are display in one treewidget. Hence, they represent root nodes which means
* they are directly appended to the QModelIndex 'm_indexRoot'.
*/
void ImportMsdl::insertParty(const MSDLParty &party)
{
// Create "Force"-Node -> No symbol, no tact. identifier, no classtype
ParticipantManagement::ParticipantData newParty;
newParty.designator(party.m_forceSideName.toStdString());
createNode(newParty, m_indexRoot, party.m_ownHandle);
}
void ImportMsdl::createNode(const ParticipantManagement::ParticipantData &participant, const QModelIndex &index, const QString &handle)
{
int newRow = m_pModel->onInsertRow(index, participant);
QModelIndex newIdx = m_pModel->index(newRow, 0, index);
m_parentIndexCache[handle] = newIdx;
}
/*
* Should be called after each 'insertParticipant' since the newly added participant
* might be the parent of one of the so far parentless units.
*/
void ImportMsdl::checkParentlessUnits()
{
// Check all Units which have not been added so far because their parent is missing
bool parentFound = false;
do
{
parentFound = false;
for (auto itParentless = m_parentlessItems.begin(); itParentless != m_parentlessItems.end();)
{
const MSDLParticipant &parentlessUnit = (*itParentless);
auto itParent = m_parentIndexCache.find(parentlessUnit.m_parentHandle);
// Parent now available in tree?
if (itParent != m_parentIndexCache.end())
{
parentFound = true;
insertParticipant(parentlessUnit, (*itParent));
itParentless = m_parentlessItems.erase(itParentless);
}
else
++itParentless;
}
}
while (parentFound);
}
void ImportMsdl::importExerciseScenario()
{
importPurpose();
QVector<MSDLParty> vecParties = importParties();
for (auto &party : vecParties)
insertParty(party);
QMap<QString, MSDLParticipant> mapUnits = importParticipants();
importEquipment(mapUnits);
QVector<MSDLParticipant> vecUnitsWithValidDISTypes = resolveImportMapping(mapUnits);
if (!vecUnitsWithValidDISTypes.size())
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("There are no units or participants which can be imported."), tr("Import Warning"));
return;
}
buildImportTreeView(vecUnitsWithValidDISTypes);
if (m_setTouchedTypes.size())
{
LtsWidgets::Button button = LtsWidgets::LtsMessageDialog::showMessage(this, tr("You have applied manual DIS mappings between imported units/participants and available database types.<br/>Do you want to save this mapping to database?<br/><br/> If you choose \"No\" you will have to perform the DIS mapping again when importing the same input file at a later timepoint."), tr("Import Information"),
LtsWidgets::Behaviour::Modal, LtsWidgets::Button::Yes | LtsWidgets::Button::No);
if (button == LtsWidgets::Button::Yes)
{
while (!applyDISMappingChangesToDatabase())
{
LtsWidgets::Button button = LtsWidgets::LtsMessageDialog::showMessage(this, tr("Applied DIS mapping changes could not be saved to database.<br/>Do you want to retry?"), tr("Import Warning"),
LtsWidgets::Behaviour::Modal, LtsWidgets::Button::Yes | LtsWidgets::Button::No);
if (button == LtsWidgets::Button::No)
break;
}
}
}
}
void ImportMsdl::importPurpose()
{
try
{
std::unique_ptr<msdl_1::MilitaryScenarioType> p(msdl_1::MilitaryScenario(gStrMSDLWorkingFile().toStdString()));
msdl_1::MilitaryScenarioType::ScenarioID_type scIDType = p->ScenarioID();
// Purpose
QString strPurpose;
QString strDescription;
purposeOptional pO = scIDType.purpose();
if (!pO)
{
#ifdef LTS_DEBUG
LtsWidgets::LtsMessageDialog::showMessage(this, tr("No purpose in xml-file"), windowTitle());
#endif
}
else
strPurpose = QString::fromStdString(pO.get());
// Description
descriptionType dT = scIDType.description();
if (dT.empty())
{
#ifdef LTS_DEBUG
LtsWidgets::LtsMessageDialog::showMessage(this, tr("No description in xml-file"), windowTitle());
#endif
}
else
strDescription = QString::fromStdString(dT);
WARNING_LOG(mLogger) << "importPurpose: ToDo: Unused imported data (purpose: \"" << strPurpose << "\", description: \"" << strDescription << "\")";
}
catch (std::exception &e)
{
WARNING_LOG(mLogger) << "importPurpose: exception occurred: " << e.what();
}
}
QVector<MSDLParty> ImportMsdl::importParties()
{
std::unique_ptr<msdl_1::MilitaryScenarioType> p(msdl_1::MilitaryScenario(gStrMSDLWorkingFile().toStdString()));
forceSidesType foSides = p->ForceSides();
forceSidesType::ForceSide_sequence foSiSeq = foSides.ForceSide();
QVector<MSDLParty> vecForces;
vecForces.reserve(foSiSeq.size());
for (const auto &foSiTy : foSiSeq)
{
MSDLParty party; // Destination
party.m_ownHandle = QString::fromStdString(foSiTy.ObjectHandle());
party.m_forceSideName = QString::fromStdString(foSiTy.ForceSideName());
vecForces.push_back(std::move(party));
}
return vecForces;
}
QMap<QString, MSDLParticipant> ImportMsdl::importParticipants()
{
QMap<QString, MSDLParticipant> mapParticipants; // Handle to Participant
std::unique_ptr<msdl_1::MilitaryScenarioType> p(msdl_1::MilitaryScenario(gStrMSDLWorkingFile().toStdString()));
msdl_1::MilitaryScenarioType::Organizations_optional orgOpt = p->Organizations();
if (!orgOpt)
{
WARNING_LOG(mLogger) << "Optional msdl xml tag \"Organizations\" missing. There are not participants to import!";
return mapParticipants;
}
organizationsType orgType = orgOpt.get();
unitsType units = orgType.Units();
unitsType::Unit_sequence unitSeq = units.Unit();
QSet<QString> setParents; // All parents are of type class "Unit"
for (const auto &uTy : unitSeq)
{
try
{
MSDLParticipant tUnit; // Destination
// Designator
QString designator(QStringLiteral("Unknown"));
unitType::Name_optional nameOpt = uTy.Name();
if (nameOpt)
designator = QString::fromStdString(nameOpt.get());
tUnit.m_designator = designator.left(9);
tUnit.m_tacticalIdentifier = designator;
// Symbol respectively sidc
unitType::SymbolIdentifier_type symIdTy = uTy.SymbolIdentifier();
tUnit.m_symbolIdentifier = QString::fromStdString(symIdTy);
// Currently ignoring "hierarchy"
// Element 'ForceSideHandle' stellt den Bezug zur Truppe her
// Element 'CommandingSuperiorHandle' stellt den Bezug zu einer uebergeordneten Einheit her
relationsType reTyps = uTy.Relations();
relationsType::ForceRelation_type reTyp = reTyps.ForceRelation();
relationsType::ForceRelation_type::ForceRelationChoice_type foRelChTy = reTyp.ForceRelationChoice();
unitType::ObjectHandle_type obHaTy = uTy.ObjectHandle();
tUnit.m_ownHandle = QString::fromStdString(obHaTy);
// Einheit ist direkt unter der Truppe
if (foRelChTy == relationsType::ForceRelation_type::ForceRelationChoice_type::FORCE_SIDE)
{
// obHaTy ist eigener Object-Handle. "0", weil Vorgesetzter die Pooltruppe
forceRelationDataType::ForceSideHandle_optional foSiHaOp = uTy.Relations().ForceRelation().ForceRelationData().ForceSideHandle();
tUnit.m_parentForce = QString::fromStdString(foSiHaOp.get());
tUnit.m_parentHandle = QStringLiteral("0"); // 0 for "FORCE_SIDE" types since forces are always on top without parent
setParents.insert(tUnit.m_ownHandle);
DEBUG_LOG(mLogger) << "Party: handle: " << tUnit.m_ownHandle << ", parentHandle: " << tUnit.m_parentHandle << ", parent force: " << tUnit.m_parentForce;
}
else if (foRelChTy == relationsType::ForceRelation_type::ForceRelationChoice_type::UNIT)
{
// Einheit ist unter einer anderen Einheit
// Vorgesetzte Einheit ermitteln
forceRelationDataType::CommandRelation_optional cmdRelOpt = uTy.Relations().ForceRelation().ForceRelationData().CommandRelation();
forceRelationDataType::CommandRelation_type cmdRelTyp = cmdRelOpt.get();
tUnit.m_parentHandle = QString::fromStdString(cmdRelTyp.CommandingSuperiorHandle());
WARNING_LOG(mLogger) << "Participant: handle: " << tUnit.m_ownHandle.toStdString() << ", parentHandle: " << tUnit.m_parentHandle;
setParents.insert(tUnit.m_parentHandle);
}
mapParticipants[tUnit.m_ownHandle] = tUnit;
}
catch (std::exception &e)
{
ERROR_LOG(mLogger) << "Exception occured when importing unit, skipping unit! " << e.what();
}
}
// Each parent is of type class 'Unit' or 'SupportUnit'
for (auto &e : setParents)
mapParticipants[e].m_typeClassIsUnit = true;
return mapParticipants;
}
void ImportMsdl::importEquipment(QMap<QString, MSDLParticipant> &mapUnits)
{
std::unique_ptr<msdl_1::MilitaryScenarioType> p(msdl_1::MilitaryScenario(gStrMSDLWorkingFile().toStdString()));
msdl_1::MilitaryScenarioType::Organizations_optional orgOpt = p->Organizations();
if (!orgOpt)
{
WARNING_LOG(mLogger) << "Optional msdl xml tag \"Organizations\" missing. There is no equipment to import!";
return;
}
organizationsType orgType = orgOpt.get();
equipOptional equipOpt = orgType.Equipment();
if (!equipOpt)
{
WARNING_LOG(mLogger) << "Optional msdl xml tag \"Equipment\" missing: There is no equipment to import!";
return;
}
equipType eqTy = equipOpt.get();
equipType::EquipmentItem_sequence eqItSeq = eqTy.EquipmentItem();
for (const auto &eqItType : eqItSeq)
{
// Equipment handle
equipItemType::ObjectHandle_type obHaTy = eqItType.ObjectHandle();
QString equipmentHandle = QString::fromStdString(obHaTy);
// Owner (unit) handle
equipRelationsType reTyps = eqItType.Relations();
ownerDataType::UnitOwnerHandle_optional unOwHa = reTyps.HoldingOrganization().OwnerData().UnitOwnerHandle();
if (!unOwHa)
{
WARNING_LOG(mLogger) << "No owner handle found for equipment handle " << equipmentHandle << ", ignoring equipment";
continue;
}
QString ownerHandle = QString::fromStdString(unOwHa.get());
if (mapUnits.find(ownerHandle) == mapUnits.end())
{
WARNING_LOG(mLogger) << "Equipment owner handle " << ownerHandle << " for equipment handle " << equipmentHandle << " does not exist, ignoring equipment";
continue;
}
equipItemType::EquipmentSymbolModifiers_optional eqSymModifiers = eqItType.EquipmentSymbolModifiers();
if (!eqSymModifiers)
{
WARNING_LOG(mLogger) << "No EquipmentSymbolModifier found for equipment handle " << equipmentHandle << ", not importing equipment and therefore skipping associated unit";
continue;
}
// prüfen ob vorhanden bzw. 21 zeichen?
QString strDisType = QString::fromStdString(eqSymModifiers.get().UniqueDesignation());
if (strDisType.size() != 21)
{
WARNING_LOG(mLogger) << "IGNORING Equipment handle " << equipmentHandle << ": MSDL DIS string length does not equal 21 characters: " << strDisType << " (ownerHandle: " << ownerHandle << ")";
continue;
}
WARNING_LOG(mLogger) << "Equipment: Handle " << equipmentHandle << ". DIS string " << strDisType << " ownerHandle: " << ownerHandle;
mapUnits[ownerHandle].m_DISTypeMSDL = strDisType;
// Equipment name
// equipItemType::Name_optional nameOpt = eqItType.Name();
// if(nameOpt)
// QString::fromStdString(nameOpt.get());
// Equipment Symbolidentifier
// equipItemType::SymbolIdentifier_type symIdTy = eqItType.SymbolIdentifier();
// symbolIdentifier = QString::fromStdString(symIdTy);
}
}
void ImportMsdl::buildImportTreeView(QVector<MSDLParticipant> &vecUnitsWithValidDISTypes)
{
// Sort units by their designator which allows to create a treeview that has ordered elements
std::sort(vecUnitsWithValidDISTypes.begin(), vecUnitsWithValidDISTypes.end(), [](const MSDLParticipant & unit1, const MSDLParticipant & unit2)
{
return QString::localeAwareCompare(unit1.m_designator, unit2.m_designator) < 0;
});
for (const MSDLParticipant &p : vecUnitsWithValidDISTypes)
{
/*
* At this point we have to distinguish between 'UNIT' and 'FORCE_SIDE'.
* Force sides do not have a 'm_parentHandle' (they are a root node within the xml-file).
* Hence, we have to append them to a actual force which is stored in 'm_parentForce'.
* A 'UNIT' however as always a parent.
*/
auto it = (p.m_parentHandle != QStringLiteral("0")) ? m_parentIndexCache.find(p.m_parentHandle) : m_parentIndexCache.find(p.m_parentForce);
if (it == m_parentIndexCache.end())
{
m_parentlessItems[p.m_ownHandle] = p;
continue;
}
QModelIndex &parentIdx = (*it);
insertParticipant(p, parentIdx);
checkParentlessUnits();
}
for (auto &unit : m_parentlessItems)
WARNING_LOG(mLogger) << "Parent missing: Could not import unit with handle " << unit.m_ownHandle << ", missing parent: " << unit.m_parentHandle;
}
bool ImportMsdl::applyDISMappingChangesToDatabase()
{
// Apply changes (=user mapped imported unknown DIS ids to database type ids) to database
for (int32_t typeId : qAsConst(m_setTouchedTypes))
{
const ParticipantManagement::Type &touchedType = m_mapTypes.value(typeId);
m_requestHelper->addRequest([this, touchedType]()
{
return m_ppmFtc->modifyTypeRequest(touchedType, this);
});
}
return m_requestHelper->startRequests();
}
void ImportMsdl::mapParticipant2Type(MSDLParticipant &participant, qint32 mappedTypeId)
{
participant.m_mappedTypeId = mappedTypeId;
/*
* We can map non existing DIS id (=empty QString) to type ids.
* However, we cannot extend the type disEntities()-vector within the database since in this case since there is
* simply no DIS id which could be appended to the vector.
* Hence, mapping units/participants with no DIS id to a type id is only temporary and needs to be done each time
* a MSDL file is used for import.
*/
if (!participant.hasDISType())
return;
/*
* It may be possible that several participants have the same unknown DIS id.
* Prevent adding the same DIS id again and again to the same type.
*/
if (!m_mapMSDL_DIS_2TypeId.contains(participant.m_DISTypeMSDL))
{
m_mapMSDL_DIS_2TypeId[participant.m_DISTypeMSDL] = mappedTypeId;
m_mapTypes[mappedTypeId].disEntities().push_back(ParticipantManagement::DIS::convertMSDLString2Integer(participant.m_DISTypeMSDL));
m_setTouchedTypes.insert(mappedTypeId);
}
}
QVector<MSDLParticipant> ImportMsdl::resolveImportMapping(const QMap<QString, MSDLParticipant> &mapUnits)
{
QVector<MSDLParticipant> vecObjectsWithValidDISTypes;
/*
* Identify possible conflicts. Each conflict needs to be solved or ignored by the user.
*
* Note: We have to distinguish between actual participants (which will be later leaves in the treemodel) and units such as "Platoon".
* A MSDLParticipant can be both. If a MSDLUnit has no childs it is a participant otherwise an actual unit.
*
* - Participants can only be edited and appended to units.
* - Units can additionally be extended adding new participants.
*
* Hence, if the user needs to manually specify the type only the classes "Unit" and "SupportUnit" should be available for units
* to create a valid treemodel.
*/
QMap<QString, QVector<MSDLParticipant>> mapParticipantsWithUnknownDisType, mapUnitsWithUnknownDisType;
for (const MSDLParticipant &unit : mapUnits)
{
/*
* No DIS type: User has to perform a manual mapping
* DIS type available but there is no type in our database that matches: User has to perform a manual mapping
*/
if (!unit.hasDISType() || !m_mapMSDL_DIS_2TypeId.contains(unit.m_DISTypeMSDL))
{
if (unit.m_typeClassIsUnit)
mapUnitsWithUnknownDisType[unit.m_DISTypeMSDL].push_back(unit);
else
mapParticipantsWithUnknownDisType[unit.m_DISTypeMSDL].push_back(unit);
}
else
{
// A match between the imported unit (its DIS id) and one of the database types exists: Perform mapping, everything is fine.
vecObjectsWithValidDISTypes.push_back(unit);
vecObjectsWithValidDISTypes.back().m_mappedTypeId = m_mapMSDL_DIS_2TypeId[unit.m_DISTypeMSDL];
}
}
if (mapUnitsWithUnknownDisType.size())
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("<b>Units</b> exist whose DIS type is unknown.<br/>You have to solve this by manually mapping<br/> the appropriate DIS types to existing <b>unit types</b>."), tr("Import Error"));
vecObjectsWithValidDISTypes.append(showMappingDialog(mapUnitsWithUnknownDisType, true));
}
if (mapParticipantsWithUnknownDisType.size())
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("<b>Participants</b> exist whose DIS type is unknown.<br/>You have to solve this by manually mapping<br/> the appropriate DIS types to existing <b>participant types</b>."), tr("Import Error"));
vecObjectsWithValidDISTypes.append(showMappingDialog(mapParticipantsWithUnknownDisType, false));
}
return vecObjectsWithValidDISTypes;
}
QVector<MSDLParticipant> ImportMsdl::showMappingDialog(const QMap<QString, QVector<MSDLParticipant>> &mapConflictMap, bool typeClassIsUnit)
{
QVector<MSDLParticipant> vecUnitsWithValidSymbols;
// Let user solve conflicts
bool userWantsAutoSolve = false;
int32_t mappedTypeId = 0;
auto it = mapConflictMap.begin();
for (; it != mapConflictMap.end(); ++it)
{
const QString &strDisType = it.key();
const QVector<MSDLParticipant> &vecData = it.value();
QString strReason;
bool offerDatabaseEntriesWithoutDISType;
if (!strDisType.size())
{
strReason = QString(tr("No DIS type specified."));
// Imported unit/participant has no DIS type. Mapping "no DIS type" to database elements without a DIS type does not make sense
offerDatabaseEntriesWithoutDISType = false;
}
else
{
strReason = QString(tr("Specified DIS type \"%1\" is unknown.<br/>Affected %2:\nDesignator: %3\nTact. Identifier: %4")).arg(ParticipantManagement::DIS::convertMSDLString2DISString(strDisType), typeClassIsUnit ? QStringLiteral("unit") : QStringLiteral("participant"), vecData[0].m_designator, vecData[0].m_tacticalIdentifier);
offerDatabaseEntriesWithoutDISType = true;
}
QString strType = typeClassIsUnit ? tr("unit(s)") : tr("participant(s)");
strReason += tr("<br/>This applies for %1 %2. Please choose an option:").arg(QString::number(vecData.size()), strType);
msdl::MappingDialog dialog(this, typeClassIsUnit, strReason, m_ppmDtc, offerDatabaseEntriesWithoutDISType);
dialog.exec(); // TODO: use show(), use signals & slots !
if (dialog.skipAllUnmappedElements())
break;
mappedTypeId = dialog.getMappedTypeId();
if (dialog.autoMapAllUnmappedElements())
{
userWantsAutoSolve = true;
break;
}
if (dialog.mappingApplied())
{
for (auto participant : vecData)
{
mapParticipant2Type(participant, mappedTypeId);
vecUnitsWithValidSymbols.push_back(participant);
}
}
}
if (userWantsAutoSolve)
{
// Use selected symbol for all remaining conflicts
for (; it != mapConflictMap.end(); ++it)
{
const QVector<MSDLParticipant> &vecData = it.value();
for (auto participant : vecData)
{
mapParticipant2Type(participant, mappedTypeId);
vecUnitsWithValidSymbols.push_back(participant);
}
}
}
return vecUnitsWithValidSymbols;
}
}
@@ -0,0 +1,106 @@
/**
* @RDE_HEADER@
* Klasse fuer das Importieren von MSDL-Dateien
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <nglwidgets/ngldialog.h>
#include "msdl_logging.h"
#include "msdl_types.h"
#include "zwmsmsdl_export.h"
#include <QModelIndex>
#include <Plugins/ParticipantManagement/Gui/Common/participant_edit_model.h>
#include <memory>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h>
#include <LtsUtilsGuiDds/request_helper.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_participants_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_templates_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
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<ParticipantManagement::Interface::Dtc> m_ppmDtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ppmFtc;
// Exercise importing has the following call order
void importExerciseScenario();
void importPurpose();
QVector<MSDLParty> importParties();
void importOrganization();
QMap<QString, MSDLParticipant> importParticipants();
void importEquipment(QMap<QString, MSDLParticipant> &mapUnits);
QVector<MSDLParticipant> resolveImportMapping(const QMap<QString, MSDLParticipant> &mapUnits);
QVector<MSDLParticipant> showMappingDialog(const QMap<QString, QVector<MSDLParticipant> > &mapConflictMap, bool typeClassIsUnit);
void buildImportTreeView(QVector<MSDLParticipant> &vecUnitsWithValidDISTypes);
bool applyDISMappingChangesToDatabase();
QMap<QString, int32_t> m_mapMSDL_DIS_2TypeId; // E.g. "003001222001246001000" to "47"
QMap<qint32, ParticipantManagement::Type> m_mapTypes; // E.g. participant id "47" to type id
void mapParticipant2Type(MSDLParticipant &participant, qint32 mappedTypeId);
QSet<int32_t> m_setTouchedTypes;
// Used to create the treeview with the imported participants
QMap<QString, QModelIndex> m_parentIndexCache;
QMap<QString, MSDLParticipant> 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;
};
}
@@ -0,0 +1,204 @@
/**
* @RDE_HEADER@
* Den Inhalt von MSDL-Dateien anzeigen
* $Id$
* $HeadURL$
* $Author$
*/
#include "msdl_import_show.h"
#include "ui_msdl_import_show.h"
#include <QMenu>
#include <QFile>
#include <LtsWidgets/lts_message_dialog.h>
#include <nglwidgets/nglstandardbutton.h>
using namespace msdl;
ImportMsdlShow::ImportMsdlShow(QWidget *parent, const QString &xmlFile)
: NGLDialog(parent)
, mImportFile(xmlFile)
, mCollapsedAll(true)
, mExpandedAll(false)
, mLogger(getLogger("ImportMsdlShow"))
{
mUi.setupUi(this);
setWindowTitle(tr("Exercise Scenario"));
move(50, 50);
// ButtonBox
connect(mUi.buttonBox, &NGLDialogButtonBox::onClose,
this, &ImportMsdlShow::onClose);
mUi.treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(mUi.treeWidget, &QTreeWidget::customContextMenuRequested,
this, &ImportMsdlShow::slotCustomContextMenuRequested);
// buttons
buttonClose = mUi.buttonBox->button(NGLStandardButton::Close);
buttonClose->setEnabled(true);
QTreeWidgetItem *header = mUi.treeWidget->headerItem();
mUi.treeWidget->setColumnCount(2);
mUi.treeWidget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
header->setText(0, tr("Element"));
header->setText(1, tr("Content"));
// xsd-Schema gegen xml-Datei ueberpruefen
initTree();
}
void ImportMsdlShow::initTree()
{
QFile file(mImportFile);
if (!file.open(QIODevice::ReadOnly))
{
LtsWidgets::LtsMessageDialog::showMessage(this, tr("File doesn't exist on filesystem"));
return;
}
QDomDocument doc(QStringLiteral("mydocument"));
if (!doc.setContent(&file))
{
file.close();
return;
}
QDomElement docElem = doc.documentElement();
QDomNodeList qdlist = docElem.childNodes();
for (int i = 0; i < qdlist.size(); i++)
{
QDomNode qdn = qdlist.item(i);
QDomElement e = qdn.toElement();
QTreeWidgetItem *qtWI = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(e.tagName()));
mItems.append(qtWI);
showTree(qdn, qtWI);
}
mUi.treeWidget->insertTopLevelItems(0, mItems);
file.close();
}
void ImportMsdlShow::addChild(const QDomElement &scenarioIdElement, QTreeWidgetItem *qtWI)
{
QDomNode domNode = scenarioIdElement.firstChildElement();
while (!domNode.isNull())
{
QDomElement domElement = domNode.toElement();
if (!domElement.isNull())
{
QStringList itemList;
itemList << domElement.tagName() << domElement.text();
QTreeWidgetItem *qtWINew = new QTreeWidgetItem((QTreeWidget *)nullptr, itemList);
qtWI->addChild(qtWINew);
}
domNode = domNode.nextSibling();
}
}
void ImportMsdlShow::showTree(const QDomNode &n, QTreeWidgetItem *qtwi)
{
QDomNodeList qdlist = n.childNodes();
QTreeWidgetItem *dummyParent = nullptr;
for (int i = 0; i < qdlist.size(); i++)
{
QDomNode qdn = qdlist.item(i);
QDomElement qde = qdn.toElement();
if (qde.tagName().size() == 0)
continue;
QStringList itemList;
if (qde.firstChild().toElement().tagName().size())
itemList << qde.tagName();
else
itemList << qde.tagName() << qde.text();
QTreeWidgetItem *qtWI1 = new QTreeWidgetItem(dummyParent, itemList);
qtwi->addChild(qtWI1);
showTree(qdn, qtWI1);
}
}
void ImportMsdlShow::onClose()
{
INFO_LOG(mLogger) << "ON close() ";
accept();
emit signalDialogClose(this);
}
void ImportMsdlShow::slotCustomContextMenuRequested(QPoint p)
{
INFO_LOG(mLogger) << "slotCustomContextMenuRequested";
QMenu *menu = new QMenu(this);
QAction *ac = new QAction(tr("Expand all"), this);
ac->setCheckable(true);
if (mExpandedAll)
ac->setChecked(true);
else
ac->setChecked(false);
ac->setData(QVariant(QStringLiteral("E"))); // expand all
menu->addAction(ac);
ac = new QAction(tr("Collapse all"), this);
ac->setCheckable(true);
ac->setData(QVariant(QStringLiteral("C"))); // collapse all
if (mCollapsedAll)
ac->setChecked(true);
else
ac->setChecked(false);
menu->addAction(ac);
connect(menu, &QMenu::triggered,
this, &ImportMsdlShow::slotCustomContextMenuActionTriggered);
menu->exec(mUi.treeWidget->mapToGlobal(p));
delete menu;
}
void ImportMsdlShow::slotCustomContextMenuActionTriggered(QAction *ac)
{
if (!ac)
return;
if (ac->data().toString() == QStringLiteral("E"))
{
mUi.treeWidget->expandAll();
mCollapsedAll = false;
mExpandedAll = true;
return;
}
if (ac->data().toString() == QStringLiteral("C"))
{
mUi.treeWidget->collapseAll();
mCollapsedAll = true;
mExpandedAll = false;
return;
}
}
void SchemaMessageHandler::handleMessage(QtMsgType type,
const QString &description,
const QUrl &identifier,
const QSourceLocation &sourceLocation)
{
ERROR_LOG(mLogger) << "type: " << type << " desc: " << description;
if (identifier.isValid())
ERROR_LOG(mLogger) << "identifier: " << identifier.toString();
if (!sourceLocation.isNull())
ERROR_LOG(mLogger) << "sourceLocation: "
<< sourceLocation.uri().toString()
<< " line: " << sourceLocation.line()
<< " column: " << sourceLocation.column()
;
}
@@ -0,0 +1,65 @@
/**
* @RDE_HEADER@
* Klasse zum Anzeigen von MSDL-Dateien
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtXml/QDomDocument>
#include <QtXmlPatterns/QAbstractMessageHandler>
#include <nglwidgets/ngldialog.h>
#include "msdl_logging.h"
#include "ui_msdl_import_show.h"
namespace msdl
{
class SchemaMessageHandler : public QAbstractMessageHandler
{
Q_OBJECT
public:
explicit SchemaMessageHandler(QObject *parent = nullptr)
: QAbstractMessageHandler(parent)
, mLogger(getLogger("SchemaMessageHandler"))
{}
protected:
void handleMessage(QtMsgType type,
const QString &description,
const QUrl &identifier = QUrl(),
const QSourceLocation &sourceLocation = QSourceLocation()) override;
private:
LOGGER_T mLogger;
};
class ImportMsdlShow : public NGLDialog
{
Q_OBJECT
public:
ImportMsdlShow(QWidget *parent, const QString &xmlFile);
signals:
void signalDialogClose(NGLDialog *ngld);
private slots:
void onClose();
void slotCustomContextMenuRequested(QPoint p);
void slotCustomContextMenuActionTriggered(QAction *ac);
private:
void initTree();
void addChild(const QDomElement &scenarioIdElement, QTreeWidgetItem *qtWI);
void showTree(const QDomNode &n, QTreeWidgetItem *qtwi);
QList<QTreeWidgetItem *> mItems;
NGLStandardButton *buttonClose;
Ui_MSDLImportShow mUi;
QString mImportFile;
bool mCollapsedAll;
bool mExpandedAll;
LOGGER_T &mLogger;
};
} // namespace ZWMSMSDL
@@ -0,0 +1,29 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "msdl_logging.h"
namespace msdl
{
LOGGER_T getLogger(const char *name)
{
static const QLatin1String zwmsmsdl("NGL.ZWMSMSDL.");
std::string loggerName;
const size_t len = strlen(name);
loggerName.reserve(zwmsmsdl.size() + len);
loggerName.append(zwmsmsdl.data(), zwmsmsdl.size());
loggerName.append(name, len);
return NGL::NGLLoggerBootstrap::getNGLRootLogger().
getNGLLogger(loggerName);
}
} // namespace ZWMSMSDL
@@ -0,0 +1,20 @@
/**
* @RDE_HEADER@
* WiSi - logging facility
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <NGLLogger/INGLLogger.h>
namespace msdl
{
using LOGGER_T = NGL::INGLLogger&;
LOGGER_T getLogger(const char *name);
} // namespace ZWMSWI
@@ -0,0 +1,132 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#include "msdl_mapping_dialog.h"
#include "ui_msdl_mapping_dialog.h"
#include <ParticipantManagement/ppm_translation.h>
#include <set>
namespace msdl
{
MappingDialog::MappingDialog(QWidget *parent, bool typeClassIsUnit, const QString &strReason, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc, bool offerDatabaseEntriesWithoutDISType) : LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
, m_offerDatabaseEntriesWithoutDISType(offerDatabaseEntriesWithoutDISType)
, mLogger(msdl::getLogger("MSDLMappingDialog"))
, m_ppmDtc(ppmDtc)
, mUi(new Ui_MSDLMappingDialog)
{
mUi->setupUi(this);
mUi->m_label_ConflictReason->setText(strReason);
m_mapTypes = m_ppmDtc->types();
std::set<ParticipantManagement::TypeClass> setTypeClasses; // unordered set?
/*
* Show only type classes that include types with DIS ids. This should normally the case for all
* type classes!
*/
for (const ParticipantManagement::Type &type : qAsConst(m_mapTypes))
{
if (!m_offerDatabaseEntriesWithoutDISType && (type.disEntities().size() == 0))
{
WARNING_LOG(mLogger) << "Type id " << type.id() << " does not have assigned DIS types! Type cannot be used when importing MSDL data!";
continue;
}
const ParticipantManagement::TypeClass typeClassId = type.typeClass();
if (typeClassIsUnit)
{
if (typeClassId != ParticipantManagement::TypeClass::Unit)
continue;
}
else
{
if (typeClassId == ParticipantManagement::TypeClass::Unit || typeClassId == ParticipantManagement::TypeClass::SupportUnit || typeClassId == ParticipantManagement::TypeClass::SupportEntity)
continue;
}
setTypeClasses.insert(typeClassId);
}
for (const auto &typeclass : setTypeClasses)
mUi->m_ltsComboBox_typeClass->addItem(ParticipantManagement::toString(typeclass), typeclass.underlying());
slotClassTypeChanged();
connect(mUi->m_ltsComboBox_typeClass, static_cast<void (LtsWidgets::LtsComboBox::*)(int)>(&LtsWidgets::LtsComboBox::currentIndexChanged), this, &MappingDialog::slotClassTypeChanged);
connect(mUi->m_PushButton_Skip, &QPushButton::clicked, this, &MappingDialog::close);
connect(mUi->m_pushButton_Apply, &QPushButton::clicked, this, &MappingDialog::slotApplyMapping);
connect(mUi->m_pushButton_SkipAllConflicts, &QPushButton::clicked, this, &MappingDialog::slotSkipAllElements);
}
MappingDialog::~MappingDialog()
{
delete mUi;
}
void MappingDialog::slotClassTypeChanged()
{
mUi->m_ltsComboBox_type->clear();
int currentClass = mUi->m_ltsComboBox_typeClass->currentData().toInt();
for (const ParticipantManagement::Type &type : qAsConst(m_mapTypes))
{
if (type.typeClass().underlying() != currentClass)
continue;
if (!m_offerDatabaseEntriesWithoutDISType && (type.disEntities().size() == 0))
{
// Should never happen -> Database broken?!
WARNING_LOG(mLogger) << "Type id " << type.id() << " does not have assigned DIS types! Type cannot be used when importing MSDL data!";
continue;
}
mUi->m_ltsComboBox_type->addItem(QString::fromStdString(type.name()), type.id());
}
}
void MappingDialog::slotApplyMapping()
{
m_mappingPerformed = true;
close();
}
void MappingDialog::slotSkipAllElements()
{
m_skipAllUnmappedElements = true;
close();
}
bool MappingDialog::mappingApplied() const
{
return m_mappingPerformed;
}
bool MappingDialog::skipAllUnmappedElements() const
{
return m_skipAllUnmappedElements;
}
bool MappingDialog::autoMapAllUnmappedElements() const
{
return mUi->m_checkBox_UseTypeForAllConflicts->isChecked();
}
int32_t MappingDialog::getMappedTypeId() const
{
int index = mUi->m_ltsComboBox_type->currentData().toInt();
return m_mapTypes[index].id();
}
}
@@ -0,0 +1,53 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "msdl_logging.h"
#include <memory>
#include <ParticipantManagement/ppm_dtc.h>
#include <LtsWidgets/lts_frameless_dialog.h>
class Ui_MSDLMappingDialog;
namespace msdl
{
class MappingDialog : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
MappingDialog(QWidget *parent,
bool typeClassIsUnit,
const QString &strReason,
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
bool offerDatabaseEntriesWithoutDISType);
~MappingDialog();
bool mappingApplied() const;
bool skipAllUnmappedElements() const;
bool autoMapAllUnmappedElements() const;
int32_t getMappedTypeId() const;
private slots:
void slotClassTypeChanged();
void slotApplyMapping();
void slotSkipAllElements();
private:
bool m_offerDatabaseEntriesWithoutDISType = false;
bool m_mappingPerformed = false;
bool m_skipAllUnmappedElements = false;
QMap<qint32, ParticipantManagement::Type> m_mapTypes;
msdl::LOGGER_T mLogger;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
Ui_MSDLMappingDialog *mUi;
};
}
@@ -0,0 +1,15 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#include "msdl_types.h"
#include <QRegularExpression>
#include <QStringList>
namespace msdl
{
}
@@ -0,0 +1,51 @@
/**
* @RDE_HEADER@
* Typen fuer das Importieren von MSDL-Dateien
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QString>
namespace msdl
{
struct MSDLParty
{
QString m_ownHandle;
QString m_forceSideName;
};
class MSDLParticipant
{
public:
int32_t m_mappedTypeId = 0;
QString m_parentForce;
QString m_ownHandle;
QString m_parentHandle;
QString m_designator;
QString m_tacticalIdentifier;
QString m_symbolIdentifier;
bool hasDISType() const { return m_DISTypeMSDL.size(); }
/*
* Mapping of imported units is NOT done by using the symbolIdentifier (sidc).
* Instead, the Equipment::UniqueDesignation field which stores a
* dis entity type information is used to perform the mapping.
*/
QString m_DISTypeMSDL;
/*
* If true, the type class is: Bt, Co, Plt, Sec
* This means the created nodes within the treewidget will differ.
* E.g., appending soldiers is only allowed to units.
*/
bool m_typeClassIsUnit = false;
};
}
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MSDLExport</class>
<widget class="NGLDialog" name="MSDLExport">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>48</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>800</width>
<height>600</height>
</size>
</property>
<property name="windowTitle">
<string>Import Exercise Scenario</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Export exercise to file:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="leExportFile">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="tbExportFile">
<property name="text">
<string notr="true">...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="m_pushButton_StartExport">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Ok</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NGLDialog</class>
<extends>QDialog</extends>
<header>nglwidgets/ngldialog.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>leExportFile</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportScenarioData</class>
<widget class="QDialog" name="ExportScenarioData">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>521</width>
<height>527</height>
</rect>
</property>
<property name="windowTitle">
<string>Enter Export Information</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Scenario Information:</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Exercise name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_lineEdit_ExerciseName">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_lineEdit_ExerciseDescription">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Purpose:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="m_lineEdit_Purpose">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="m_lineEdit_Version">
<property name="text">
<string>1.0.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Domain:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="m_lineEdit_Domain">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Point of Contact:</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_lineEdit_Type">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Author:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_lineEdit_AuthorName">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Organization:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="m_lineEdit_Organization">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Telephone:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="m_lineEdit_Telephone">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Email:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="m_lineEdit_Email">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QPushButton" name="m_pushButton_Ok">
<property name="text">
<string>Start Export</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="m_pushButton_Cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MSDLImport</class>
<widget class="NGLDialog" name="MSDLImport">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>433</width>
<height>49</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>800</width>
<height>600</height>
</size>
</property>
<property name="windowTitle">
<string>Import Exercise Scenario</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="m_label_Import">
<property name="text">
<string>Selected MSDL File:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_lineedit_ImportFile">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="m_pushbutton_SelectFile">
<property name="text">
<string notr="true">...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="m_pushButton_StartImport">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Start Import</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NGLDialog</class>
<extends>QDialog</extends>
<header>nglwidgets/ngldialog.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>m_lineedit_ImportFile</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MSDLImportShow</class>
<widget class="NGLDialog" name="MSDLImportShow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>735</width>
<height>514</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">defined in source</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget">
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="NGLDialogButtonBox" name="buttonBox" native="true">
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NGLDialog</class>
<extends>QDialog</extends>
<header>nglwidgets/ngldialog.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>NGLDialogButtonBox</class>
<extends>QWidget</extends>
<header>nglwidgets/ngldialogbuttonbox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MSDLMappingDialog</class>
<widget class="QDialog" name="MSDLMappingDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>645</width>
<height>194</height>
</rect>
</property>
<property name="windowTitle">
<string>Import Conflict Occurred</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="m_label_ConflictReason">
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Skip mapping:</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="m_label_ConflictReason_2">
<property name="text">
<string>Note: Skipped types will not be imported</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="m_pushButton_SkipAllConflicts">
<property name="text">
<string>Skip all remaining types</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="m_PushButton_Skip">
<property name="text">
<string>Skip only this type</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Apply mapping:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="LtsWidgets::LtsComboBox" name="m_ltsComboBox_typeClass"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="LtsWidgets::LtsComboBox" name="m_ltsComboBox_type"/>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="m_checkBox_UseTypeForAllConflicts">
<property name="text">
<string>Use type for all remaining types</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="m_pushButton_Apply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LtsWidgets::LtsComboBox</class>
<extends>QComboBox</extends>
<header>LtsWidgets/lts_combo_box.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?purpose description="This schema defines the Military Scenario" ?>
<?version number="1.0" date="March 25, 2007"?>
<?copyright statement="Copyright © 2007 by the Simulation Interoperability Standards Organization, Inc.
P.O. Box 781238
Orlando, FL 32878-1238, USA
All rights reserved.
Permission is hereby granted for SISO developing committee participants to reproduce this document only for purposes of SISO product development activities. Prior to submitting this document to another standards development organization for standardization activities, permission must first be obtained from the SISO Standards Activity Committee (SAC). Other entities seeking permission to reproduce this document, in whole or in part, must obtain permission from the SISO Executive Committee (EXCOM).
SISO EXCOM
P.O. Box 781238
Orlando, FL 32878-1238, USA"?>
<xs:schema targetNamespace="urn:sisostds:scenario:military:data:draft:msdl:1" xmlns:msdl="urn:sisostds:scenario:military:data:draft:msdl:1"
xmlns:modelID="http://www.sisostds.org/schemas/modelID" xmlns:jc3iedm="urn:int:nato:standard:mip:jc3iedm:3.1:oo:2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="1.0.0" id="MSDL">
<xs:include schemaLocation="MsdlComplexTypes_1.0.0.xsd"/>
<xs:element name="MilitaryScenario" type="msdl:MilitaryScenarioType">
<xs:annotation>
<xs:documentation>The Military Scenario for the exercise.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
@@ -0,0 +1,456 @@
<?xml version="1.0" encoding="UTF-8"?>
<?purpose description="This schema defines the Military Scenario" ?>
<?version number="1.0" date="March 25, 2007"?>
<?copyright statement="Copyright © 2007 by the Simulation Interoperability Standards Organization, Inc.
P.O. Box 781238
Orlando, FL 32878-1238, USA
All rights reserved.
Permission is hereby granted for SISO developing committee participants to reproduce this documentfor purposes of SISO product development activities only. Prior to submitting this document to another standards development organization for standardization activities, permission must first be obtained from the SISO Standards Activity Committee (SAC). Other entities seeking permission to reproduce this document, in whole or in part, must obtain permission from the SISO Executive Committee (EXCOM).
SISO EXCOM
P.O. Box 781238
Orlando, FL 32878-1238, USA"?>
<xs:schema targetNamespace="urn:sisostds:scenario:military:data:draft:msdl:1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdl="urn:sisostds:scenario:military:data:draft:msdl:1" elementFormDefault="qualified" version="1.0.0" id="MSDL">
<xs:simpleType name="enumAnchorPointType">
<xs:annotation>
<xs:documentation>Enumerated choice of an absolute Coordinate or point graphic as a location reference</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="COORDINATE"/>
<xs:enumeration value="POINT_TACTICAL_GRAPHIC"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumAirFormationType">
<xs:annotation>
<xs:documentation>The formation of air (aviation) elements</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="NOT_SPECIFIED"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumBaseAffiliation">
<xs:annotation>
<xs:documentation>Enumerated values for the base affiliation of FRIEND, HOSTILE, NEUTRAL, and UNKNOWN.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="HOSTILE"/>
<xs:enumeration value="FRIEND"/>
<xs:enumeration value="NEUTRAL"/>
<xs:enumeration value="UNKNOWN"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumCombatEffectivenessType">
<xs:annotation>
<xs:documentation>The text modifier for units and installations that indicates unit effectiveness or installation capability.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="GREEN">
<xs:annotation>
<xs:documentation>85 percent or greater strength (combat capable)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="AMBER">
<xs:annotation>
<xs:documentation>70 to 84 percent strength (combat capable with minor deficiencies)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RED">
<xs:annotation>
<xs:documentation>50 to 69 percent strength (combat ineffective, unit has major losses or deficiencies)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="BLACK">
<xs:annotation>
<xs:documentation>Less than 50 percent strength (requires reconstitution before next mission)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WHITE">
<xs:annotation>
<xs:documentation>Not applicable or no information available</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumCommandRelationshipType">
<xs:annotation>
<xs:documentation>Enumerated choice for the type of command under which the unit has been task organized as taken from FM 100-7 'The Army In Theater Operations'</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="ORGANIC"/>
<xs:enumeration value="ATTACHED"/>
<xs:enumeration value="OPCON"/>
<xs:enumeration value="TACON"/>
<xs:enumeration value="ADCON"/>
<xs:enumeration value="NONE"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumCommunicationNetType">
<xs:annotation>
<xs:documentation>The typical list of Communications Net Types for Army Units.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="OTHER"/>
<xs:enumeration value="COMMAND_NET"/>
<xs:enumeration value="OPERATIONS_INTELLIGENCE_NET"/>
<xs:enumeration value="ADMIN_LOGISTICS_NET"/>
<xs:enumeration value="FIRE_SUPPORT_NET"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumCommunicationServiceType">
<xs:annotation>
<xs:documentation>The typical list of Communications Net Types for Army Units.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="DATTRF">
<xs:annotation>
<xs:documentation>Data Transfer.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="FAX">
<xs:annotation>
<xs:documentation>Facsimile.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="IIF">
<xs:annotation>
<xs:documentation>Identify Friend or Foe.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="IMAGE">
<xs:annotation>
<xs:documentation>Image.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MCI">
<xs:annotation>
<xs:documentation>MCI.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MHS">
<xs:annotation>
<xs:documentation>Message Handling Service.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TDL">
<xs:annotation>
<xs:documentation>Tactical Data Link.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="VIDSVC">
<xs:annotation>
<xs:documentation>Video Service.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="VOCSVC">
<xs:annotation>
<xs:documentation>Voice Service.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="NOS">
<xs:annotation>
<xs:documentation>Not Otherwise Specified</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumCoordinateSystemType">
<xs:annotation>
<xs:documentation>Enumerated choice for the type of coordinate as MGRS, UTM, GCC, and GCS.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="MGRS"/>
<xs:enumeration value="GDC"/>
<xs:enumeration value="UTM"/>
<xs:enumeration value="GCC"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumEchelon">
<xs:annotation>
<xs:documentation>Graphic modifier that identifies Command level.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="NONE"/>
<xs:enumeration value="TEAM"/>
<xs:enumeration value="CREW"/>
<xs:enumeration value="SQUAD"/>
<xs:enumeration value="SECTION"/>
<xs:enumeration value="PLATOON"/>
<xs:enumeration value="DETACHMENT"/>
<xs:enumeration value="COMPANY"/>
<xs:enumeration value="BATTERY"/>
<xs:enumeration value="TROOP"/>
<xs:enumeration value="BATTALION"/>
<xs:enumeration value="SQUADRON"/>
<xs:enumeration value="REGIMENT"/>
<xs:enumeration value="GROUP"/>
<xs:enumeration value="BRIGADE"/>
<xs:enumeration value="DIVISION"/>
<xs:enumeration value="CORPS"/>
<xs:enumeration value="ARMY"/>
<xs:enumeration value="ARMYGROUP"/>
<xs:enumeration value="FRONT"/>
<xs:enumeration value="REGION"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumForceOwnerType">
<xs:annotation>
<xs:documentation>Enumerated choice for the type of owning organization as a force or unit.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="UNIT"/>
<xs:enumeration value="FORCE_SIDE"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumFormationLocationType">
<xs:annotation>
<xs:documentation>Enumerated choice for the method used to correlate formation to location as cetner of mass or lead element.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="LEAD_ELEMENT">
<xs:annotation>
<xs:documentation>The unit location represents the location of the formation's lead element, identified by a formation order of 1.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="CENTER_OF_MASS">
<xs:annotation>
<xs:documentation>The unit location represents the location of the geographical center.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumFormationType">
<xs:annotation>
<xs:documentation>Enumerated choice for The type of formation being Ground, Air, Surface or Subsurface</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="GROUND"/>
<xs:enumeration value="AIR"/>
<xs:enumeration value="SURFACE"/>
<xs:enumeration value="SUBSURFACE"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumGroundFormationType">
<xs:annotation>
<xs:documentation>This is the ground formation from which subordinate elements are placed in formation.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="COLUMN"/>
<xs:enumeration value="STAGGERED_COLUMN"/>
<xs:enumeration value="ECHELON_LEFT"/>
<xs:enumeration value="ECHELON_RIGHT"/>
<xs:enumeration value="LINE"/>
<xs:enumeration value="WEDGE"/>
<xs:enumeration value="VEE"/>
<xs:enumeration value="ASSAULT_VEE"/>
<xs:enumeration value="FSE_COLUMN"/>
<xs:enumeration value="STACK"/>
<xs:enumeration value="NONE"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumMilitaryDomainType">
<xs:annotation>
<xs:documentation>Military domain for the scenario of ACR, RDA, and TEMO.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="ACR"/>
<xs:enumeration value="RDA"/>
<xs:enumeration value="TEMO"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumModelResolutionType">
<xs:annotation>
<xs:documentation>Enumeration indicating the level of fidelity appropriate for instancing the unit or equipment in the simulation</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="NONE">
<xs:annotation>
<xs:documentation>No resolution/representation of the unit or equipment is neccesary to achieve scenario objectives.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MINIMAL">
<xs:annotation>
<xs:documentation>Minimal resolution representation (graphical display only, no behaviors) of the unit or equipment is necessary to achieve scenario objectives. This resolution typically applies to elements that are displayed as part of the common operating picture, but have not direct impact on scenario objectives.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="STANDARD">
<xs:annotation>
<xs:documentation>Standard (low) resolution representation of the unit or equipment necessary to achieve scenario objectives. This resolution typically applies to elements that are two or more echelons above, below or adjacient to the principle planning unit.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ENHANCED">
<xs:annotation>
<xs:documentation>Enhanced (medium) resolution representation of the unit or equipment necessary to achieve scenario objectives. This resolution typically applies to elements that are within two echelons of the principle planning unit.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="HIGH">
<xs:annotation>
<xs:documentation>High resolution representation of the unit or equipment necessary to achieve scenario objectives. This resolution typically applies to elements that are within one echelon of the principle planning unit.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="NOT_SPECIFIED">
<xs:annotation>
<xs:documentation>No resolution has been specified for the unit or equipment.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumMOPPLevelType">
<xs:annotation>
<xs:documentation>Unit specific status of Mission Oriented Protective Posture</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="LEVEL_0">
<xs:annotation>
<xs:documentation>None of the protective clothing and equipment is worn, but it is readily available. </xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="LEVEL_1">
<xs:annotation>
<xs:documentation>The overgarment and helmet cover are worn. </xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="LEVEL_2">
<xs:annotation>
<xs:documentation>TBD. </xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="LEVEL_3">
<xs:annotation>
<xs:documentation>Chemical protective mask and hood are added. At this point personnel are completely encapsulated. </xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="LEVEL_4">
<xs:annotation>
<xs:documentation>Butyl rubber gloves are added.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumOrientationType">
<xs:annotation>
<xs:documentation>Orientation of the graphic to the right or left as defined in the symbology standard</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="ORIENT_RIGHT">
<xs:annotation>
<xs:documentation>Orientation of the point graphic is 90 degress to the right.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ORIENT_LEFT">
<xs:annotation>
<xs:documentation>Orientation of the point graphic is 90 degress to the left.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumOverlayType">
<xs:annotation>
<xs:documentation>A specific overlay used in the scenario, that is then referenced by the control measures that are to be included on the overlay</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="OPERATIONS"/>
<xs:enumeration value="FIRE_SUPPORT"/>
<xs:enumeration value="MODIFIED_COMBINED_OBSTACLES"/>
<xs:enumeration value="INTEL"/>
<xs:enumeration value="RECON_SURVEILLANCE"/>
<xs:enumeration value="OBSTACLE"/>
<xs:enumeration value="AIR_DEFENSE"/>
<xs:enumeration value="LOGISTICS"/>
<xs:enumeration value="A2C2"/>
<xs:enumeration value="USER_DEFINED"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumReinforcedReducedType">
<xs:annotation>
<xs:documentation>The graphic modifier in a unit symbol that displays (+) for reinforced, (-) for reduced, (±) for reinforced and reduced.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="R"/>
<xs:enumeration value="D"/>
<xs:enumeration value="RD"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumSubsurfaceFormationType">
<xs:annotation>
<xs:documentation>This is the subsurface formation from which subordinate elements are placed in formation</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="NOT_SPECIFIED"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumSupportRelationType">
<xs:annotation>
<xs:documentation>The support relationship of this unit with respect to the unit being supported</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="GS"/>
<xs:enumeration value="DS"/>
<xs:enumeration value="R"/>
<xs:enumeration value="GSR"/>
<xs:enumeration value="NONE"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumSupportRoleType">
<xs:annotation>
<xs:documentation>The support role taken from classes of Priority of Effort being Chemical, Engineer, Fires, and Intelligence</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="FIRES"/>
<xs:enumeration value="INTELLIGENCE"/>
<xs:enumeration value="ENGINEER"/>
<xs:enumeration value="CHEMICAL"/>
<xs:enumeration value="NOT_SPECIFIED"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumSurfaceFormationType">
<xs:annotation>
<xs:documentation>This is the surface formation from which subordinate elements are placed in formation</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="NOT_SPECIFIED"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumSymbolClassType">
<xs:annotation>
<xs:documentation>Enumerated choice for the class of symbology modifiers.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="POINT"/>
<xs:enumeration value="LINE"/>
<xs:enumeration value="AREA"/>
<xs:enumeration value="BOUNDARY"/>
<xs:enumeration value="NBC_EVENT"/>
<xs:enumeration value="TASK"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumSymbologyStandardType">
<xs:annotation>
<xs:documentation>Enumerated choice for the type of symbology standandard.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="MILSTD_2525B"/>
<xs:enumeration value="NATO_APP-6"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="enumWeaponControlStatusType">
<xs:annotation>
<xs:documentation>Degree of fire control, values include free, tight, and hold.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="WEAPONS_FREE">
<xs:annotation>
<xs:documentation>Weapons systems may be fired at any target not positively recognized as friendly.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WEAPONS_TIGHT">
<xs:annotation>
<xs:documentation>Weapons systems may only be fired in self-defense or in response to a formal order.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WEAPONS_HOLD">
<xs:annotation>
<xs:documentation>Weapons systems may be fired only at targets recognized as hostile.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:schema>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8"?>
<?purpose description="This schema defines simple types used in the Military Scenario Definition Language." ?>
<?version number="1.0" date="March 25, 2007"?>
<?copyright statement="Copyright © 2007 by the Simulation Interoperability Standards Organization, Inc.
P.O. Box 781238
Orlando, FL 32878-1238, USA
All rights reserved.
Permission is hereby granted for SISO developing committee participants to reproduce this document only for purposes of SISO product development activities. Prior to submitting this document to another standards development organization for standardization activities, permission must first be obtained from the SISO Standards Activity Committee (SAC). Other entities seeking permission to reproduce this document, in whole or in part, must obtain permission from the SISO Executive Committee (EXCOM).
SISO EXCOM
P.O. Box 781238
Orlando, FL 32878-1238, USA"?>
<xs:schema targetNamespace="urn:sisostds:scenario:military:data:draft:msdl:1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jc3iedm="urn:int:nato:standard:mip:jc3iedm:3.1:oo:2.0" xmlns:modelID="http://www.sisostds.org/schemas/modelID" xmlns:msdl="urn:sisostds:scenario:military:data:draft:msdl:1" elementFormDefault="qualified" version="1.0.0" id="MSDL">
<xs:simpleType name="boolean">
<xs:annotation>
<xs:documentation>The MSDL base type for boolean values.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:boolean"/>
</xs:simpleType>
<xs:simpleType name="floatCartesianValue9_3">
<xs:annotation>
<xs:documentation>The double precision X component of the Geocentric coordinate.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:double"/>
</xs:simpleType>
<xs:simpleType name="floatCompassDegrees3_3">
<xs:annotation>
<xs:documentation>Compass degrees.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.00"/>
<xs:maxInclusive value="360.00"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="floatElevationAGL6_2">
<xs:annotation>
<xs:documentation>Altitude or height relative to ground level in metres.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:minInclusive value="-999999.0"/>
<xs:maxInclusive value="999999.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="floatLatitudeLongitude3_3">
<xs:annotation>
<xs:documentation>Fractional degrees of longitude/latitude.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:maxInclusive value="180.0"/>
<xs:minInclusive value="-180.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="floatSpacing4_3">
<xs:annotation>
<xs:documentation>The default spacing in metres between subordinate elements one echelon below.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:minInclusive value="1."/>
<xs:maxExclusive value="9999.999"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="floatSpeed6_2">
<xs:annotation>
<xs:documentation>The field for unit or equipment speed (for display only). Kilometres per Hour for ground elements; Nautical miles per Hour for air and marine elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="999999.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="floatUTMEasting9_2">
<xs:annotation>
<xs:documentation>The easting component of the UTM coordinate to the precision value of the MGRS precision element.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="floatUTMNorthing9_2">
<xs:annotation>
<xs:documentation>The northing component of the UTM coordinate to the precision value of the MGRS precision element.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerMajorVersion1">
<xs:annotation>
<xs:documentation>The major version of a product or standard (Major.Minor).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="9"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerMGRSEasting5">
<xs:annotation>
<xs:documentation>The easting component of the MGRS coordinate to the precision value of the MGRS precision element. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:long">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="99999"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerMGRSNorthing5">
<xs:annotation>
<xs:documentation>The northing component of the MGRS coordinate to the precision value of the MGRS precision element.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:long">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="99999"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerMGRSPrecision1">
<xs:annotation>
<xs:documentation>The precision, 2 (km) to 5 (metres), used for each MGRS coordinate.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:minInclusive value="2"/>
<xs:maxInclusive value="5"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerMinorVersion2">
<xs:annotation>
<xs:documentation>The minor version of a product or standard (Major.Minor).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="99"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerPriorityToSupport1">
<xs:annotation>
<xs:documentation> The Supporting Unit's priority to support another unit from 1 to 9 where 1 is the top priority. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="9"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerQuantity9">
<xs:annotation>
<xs:documentation>The text modifier of an equipment symbol that identifies the number of items present.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="999999999"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerSequence6">
<xs:annotation>
<xs:documentation>The sequence or order of elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="999999"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternForceSymbolID15">
<xs:annotation>
<xs:documentation>The 15 character Symbol identifier with fields that shall not be interpreted restricted using dashes. These fields would be redundant to other explicit elements in the standard. Affiliation, Status, and Country Code are restricted in this manner. Affiliation and Country Code values are provided in the ForceStructure data. Status is to be interpreted as 'Present' until such time as a separate element is created to distinguish truth values from perceived values.The coding scheme, position 1, must be ‘S’ for unit and equipment symbol identification.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="15"/>
<xs:pattern value="[S]{1}[\-]{1}[PAGMOSTUFVXLIZ\-]{1}[\-]{1}[A-Z\-]{6}[A-Z\-\*]{1}[A-Z\-\*]{1}[\-]{2}[AECGNSX\-\*]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternInstallationSymbolID15">
<xs:annotation>
<xs:documentation>The 15 character Symbol identifier with fields that shall not be interpreted restricted using dashes. These fields would be redundant to other explicit elements in the standard. Affiliation, Status, and Country Code are restricted in this manner. Affiliation and Country Code values are provided in the ForceStructure data. Status is to be interpreted as 'Present' until such time as a separate element is created to distinguish truth values from perceived values. The coding scheme, position 1, must be ‘S’ for unit and equipment symbol identification.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="15"/>
<xs:pattern value="[S]{1}[\-]{1}[G]{1}[AP\-]{1}[I]{1}[A-Z\-]{5}[A-Z\-\*]{1}[A-Z\-\*]{1}[\-]{2}[AECGNSX\-\*]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternMETOCSymbolID15">
<xs:annotation>
<xs:documentation>The 15 character Symbol identifier with fields that shall not be interpreted restricted using dashes. These fields would be redundant to other explicit elements in the standard. Affiliation, Status, and Country Code are restricted in this manner. Affiliation and Country Code values are provided in the ForceStructure data. Status is to be interpreted as 'Present' until such time as a separate element is created to distinguish truth values from perceived values. The coding scheme, position 1, must be ‘W’ for METOC symbol identification.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="15"/>
<xs:pattern value="[W]{1}[AOS]{1}\-\-[BCGHILMOPTW\-]{1}[ABCDEFHIJLMNOPRSTX\-]{1}[ABCDFGHILMNOPQRSTUVW\-]{1}[ABCDEFGHIKLMOPQRSTUVWZ\-]{1}[ABCDEFGHILMNOPRSTVW\-]{1}[ABCEFGHILMOPQSTUVWYZ\-]{1}\-\-\-\-\-"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternMGRSGridSquare2">
<xs:annotation>
<xs:documentation>The MGRS one hundred thousand meter grid square designator, as defined by NIMA TM 8358.1.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="2"/>
<xs:pattern value="[ABCDEFGHJKLMNPQRSTUVWXYZ]{2}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternMOOTWSymbolID15">
<xs:annotation>
<xs:documentation>The 15 character Symbol identifier with fields that shall not be interpreted restricted using dashes. These fields would be redundant to other explicit elements in the standard. Affiliation, Status, and Country Code are restricted in this manner. Affiliation and Country Code values are provided in the ForceStructure data. Status is to be interpreted as 'Present' until such time as a separate element is created to distinguish truth values from perceived values. The coding scheme, position 1, must be ‘O’ for METOC symbol identification.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="15"/>
<xs:pattern value="[O]{1}[\-]{1}[VXLIZ\-]{1}[AP\-]{1}[A-Z\-]{6}[A-Z\-\*]{1}[A-Z\-\*]{1}[\-]{2}[AECGNSX\-\*]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternTacticalGraphicSymbolID15">
<xs:annotation>
<xs:documentation>The 15 character Symbol identifier with fields that shall not be interpreted restricted using dashes. These fields would be redundant to other explicit elements in the standard. Affiliation, Status, and Country Code are restricted in this manner. Affiliation and Country Code values are provided in the ForceStructure data. Status is to be interpreted as 'Present' until such time as a separate element is created to distinguish truth values from perceived values.The coding scheme, position 1, must be ‘G’ for METOC symbol identification.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="15"/>
<xs:pattern value="[G]{1}[\-]{1}[PAGMOSTUFVXLIZ\-]{1}[AP\-]{1}[A-Z\-]{6}[A-Z\-\*]{1}[A-Z\-\*]{1}[\-]{2}[AECGNSX\-\*]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternTimeDTG20">
<xs:annotation>
<xs:documentation>The ISO 8601:2000 DateTime Group format yyyy-mm-ddThh:mm:ssZ e.g. 1998-05-12T14:15:00Z. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}[T]{1}[0-9]{2}:[0-9]{2}:[0-9]{2}[Z]{1}"/>
<xs:length value="20"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternTimeDTGRelative20">
<xs:annotation>
<xs:documentation>The ISO 8601:2000 time interval by duration format PnYnMnDTnHnMnS e.g. P00Y00M00DT00H00M00S relative to ScenarioTime when n is a two digit number padded with 0.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[P]{1}[0-9]{2}[Y]{1}[M]{1}[0-9]{2}[D]{1}[0-9]{2}[H]{1}[0-9]{2}[M]{1}[0-9]{2}[S]{1}"/>
<xs:length value="20"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternUTMGridZone3">
<xs:annotation>
<xs:documentation>The UTM Grid Zone designator, to include the number and letter as defined by NIMA TM 8358.1.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="3"/>
<xs:pattern value="[0-9]{2}[ABCDEFGHJKLMNPQRSTUVWXYZ]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternUUID32">
<xs:annotation>
<xs:documentation>The Universal Unique Identifier (UUID) of an object as defined in ISO/IEC 11578:1996 Information technology - Open Systems Interconnection - Remote Procedure Call (RPC).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-z]{8}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="patternUUIDRef32">
<xs:annotation>
<xs:documentation>Reference to a Universal Unique Identifier (UUID) of an object as defined in ISO/IEC 11578:1996 Information technology - Open Systems Interconnection - Remote Procedure Call (RPC).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-z]{8}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="text20">
<xs:annotation>
<xs:documentation>General text of length 20 characters.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="20"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="text21">
<xs:annotation>
<xs:documentation>General text of length 21 characters.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="21"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textDatum8">
<xs:annotation>
<xs:documentation>The Datum used to calculate cooridinates.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="8"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textEquipmentType24">
<xs:annotation>
<xs:documentation>The text modifier that indicates type of equipment.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="24"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textFrameShapeModifier1">
<xs:annotation>
<xs:documentation>The affiliation modifier from the base friend, hostile, neutral, and unknown applied to overlay graphics.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="1"/>
<xs:pattern value="[UJK?_]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textIdentifier64">
<xs:annotation>
<xs:documentation>The general text identifier.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="64"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textIFF5">
<xs:annotation>
<xs:documentation>Text modifier for identification friend or foe (IFF).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="5"/>
<xs:minLength value="0"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textName255">
<xs:annotation>
<xs:documentation xml:lang="en">A character string (i.e. a finite set of characters) generally in the form of words of a language.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="255"/>
<xs:pattern value="([ -z\w]{1})*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textSpecialC2HQ9">
<xs:annotation>
<xs:documentation>The name of the special C2 headquarters.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="9"/>
<xs:pattern value="([ -z]{1})*"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,299 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jc3iedm="urn:int:nato:standard:mip:jc3iedm:3.1:oo:2.0" targetNamespace="urn:int:nato:standard:mip:jc3iedm:3.1:oo:2.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
<annotation>
<documentation xml:lang="en">XML schema defined by the Multilateral Interoperability Programme (MIP) - Editor: Dr. Michael Gerz, gerz@fgan.de, FGAN FKIE, Germany</documentation>
</annotation>
<include schemaLocation="JC3IEDM-3.1-Codes-20061208.xsd" />
<simpleType name="AngleOptionalTypeRangeAngle7_4">
<annotation>
<documentation xml:lang="en">The rotational measurement between two lines and/or planes diverging from a common point and/or line. This measurement will be expressed in units of degrees.</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="7" />
<fractionDigits value="4" />
<minInclusive value="0.0000" />
<maxInclusive value="360.0000" />
</restriction>
</simpleType>
<simpleType name="DatetimeOptionalTypeFix18">
<annotation>
<documentation xml:lang="en">A designation of a specified chronological point measured using Coordinated Universal Time (UTC) ISO 8601:2000 as a standard of reference, constrained to "zero meridian" i.e. Zulu time zone only. This is expressed as a composite field using a compacted ISO notation YYYYMMDDHHMMSS.SSS where YYYY represents a year, MM represents a month in values from 00 to 12, and DD represents a day in values from 00 to 31, HH represents an hour, MM represents a minute, and SS.SSS represents the number of seconds and milliseconds. (Optional)</documentation>
</annotation>
<restriction base="string">
<minLength value="18" />
<maxLength value="18" />
</restriction>
</simpleType>
<simpleType name="DimensionOptionalType12_3">
<annotation>
<documentation xml:lang="en">A non-negative one-dimensional linear distance measure. This will be expressed in metres. (Optional)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="12" />
<fractionDigits value="3" />
<minInclusive value="-999999999.999" />
<maxInclusive value="999999999.999" />
</restriction>
</simpleType>
<simpleType name="DimensionMandatoryType12_3">
<annotation>
<documentation xml:lang="en">A non-negative one-dimensional linear distance measure. This will be expressed in metres. (Mandatory)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="12" />
<fractionDigits value="3" />
<minInclusive value="-999999999.999" />
<maxInclusive value="999999999.999" />
</restriction>
</simpleType>
<simpleType name="QuantityOptionalType8_4">
<annotation>
<documentation xml:lang="en">A numeric value that denotes a measure of the physical property of an object. Class word quantity has a fixed unit of measure that must be specified on an attribute-by-attribute basis. Class word quantity is not to be used where class words angle, coordinate, count, dimension, and rate apply. (Optional)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="8" />
<fractionDigits value="4" />
<minInclusive value="-9999.9999" />
<maxInclusive value="9999.9999" />
</restriction>
</simpleType>
<simpleType name="RateOptionalType4_1">
<annotation>
<documentation xml:lang="en">A numeric value that denotes a physical property of an object expressed as a proportion of a physical property with respect to a unit of time.The unit of measure for class word rate must be specified on an attribute-by-attribute basis. (Optional)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="4" />
<fractionDigits value="1" />
<minInclusive value="-999.9" />
<maxInclusive value="999.9" />
</restriction>
</simpleType>
<simpleType name="RateOptionalType8_4">
<annotation>
<documentation xml:lang="en">A numeric value that denotes a physical property of an object expressed as a proportion of a physical property with respect to a unit of time.The unit of measure for class word rate must be specified on an attribute-by-attribute basis. (Optional)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="8" />
<fractionDigits value="4" />
<minInclusive value="-9999.9999" />
<maxInclusive value="9999.9999" />
</restriction>
</simpleType>
<simpleType name="RatioOptionalTypeRangeRatio6_5">
<annotation>
<documentation xml:lang="en">A numeric value representing the quotient of two values that have the same unit of measurement, i.e., ratio has no units of measure. May be used to express a percentage. The allowable range must be specified on an attribute-by-attribute basis. (Optional)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="6" />
<fractionDigits value="5" />
<minInclusive value="0.00000" />
<maxInclusive value="1.00000" />
</restriction>
</simpleType>
<simpleType name="RatioOptionalTypeRangeRatio7_6">
<annotation>
<documentation xml:lang="en">A numeric value representing the quotient of two values that have the same unit of measurement, i.e., ratio has no units of measure. May be used to express a percentage. The allowable range must be specified on an attribute-by-attribute basis. (Optional)</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="7" />
<fractionDigits value="6" />
<minInclusive value="0.000000" />
<maxInclusive value="1.000000" />
</restriction>
</simpleType>
<simpleType name="TemperatureTypeRangeTemperature5_1">
<annotation>
<documentation xml:lang="en">A measure of degree of hotness or coldness in an object or in space. This will be expressed in degrees Celsius.</documentation>
</annotation>
<restriction base="decimal">
<totalDigits value="5" />
<fractionDigits value="1" />
<minInclusive value="-273.2" />
<maxInclusive value="9999.9" />
</restriction>
</simpleType>
<complexType name="Atmosphere">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies humidity, pressure, and temperature characteristics of Earth's atmosphere.</documentation>
</annotation>
<sequence>
<element name="HumidityRatio" type="jc3iedm:RatioOptionalTypeRangeRatio6_5" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The numeric quotient value that represents the proportion of water present in the air to the maximum amount of water (saturation point) possible at a given temperature and pressure. The value must be in the range from 0 to 1.</documentation>
</annotation>
</element>
<element name="InversionLayerCode" type="jc3iedm:AtmosphereInversionLayerCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the height of the inversion layer in the atmosphere. The stability class describes the degree of mixing of released material in the atmosphere.</documentation>
</annotation>
</element>
<element name="PressureQuantity" type="jc3iedm:QuantityOptionalType8_4" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The numeric value that denotes the ambient air in terms of force per unit area. The unit of measure is newtons per square metre.</documentation>
</annotation>
</element>
<element name="Temperature" type="jc3iedm:TemperatureTypeRangeTemperature5_1" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The numeric value that indicates the heat of the ambient air for a specific ATMOSPHERE.</documentation>
</annotation>
</element>
<element name="TemperatureGradientCode" type="jc3iedm:AtmosphereTemperatureGradientCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents heat change with respect to the ground and 100 m in elevation in a certain area. Acts as an indication of vertical air movement between the ground and higher elevations.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="CloudCover">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies the characteristics of clouds above Earth's surface.</documentation>
</annotation>
<sequence>
<element name="CategoryCode" type="jc3iedm:CloudCoverCategoryCode" minOccurs="1" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the prevailing class of a specific CLOUD-COVER.</documentation>
</annotation>
</element>
<element name="BaseDimension" type="jc3iedm:DimensionOptionalType12_3" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The one-dimensional linear distance representing the elevation of the lowest cloud base for a specific CLOUD-COVER.</documentation>
</annotation>
</element>
<element name="TopDimension" type="jc3iedm:DimensionOptionalType12_3" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The one-dimensional linear distance representing the elevation of the highest cloud ceiling for a specific CLOUD-COVER.</documentation>
</annotation>
</element>
<element name="AverageCoverageCode" type="jc3iedm:CloudCoverAverageCoverageCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the average density of a specific CLOUD-COVER as fractional coverage.</documentation>
</annotation>
</element>
<element name="LightRefractionRatio" type="jc3iedm:RatioOptionalTypeRangeRatio7_6" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The numeric quotient value that represents the velocity of light in a specific CLOUD-COVER as a fraction of the velocity of light in a vacuum, based on cloud height. This represents the inverse of the index of refraction. The value must be in the range from 0 to 1.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="Icing">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies the accumulation of frozen water on stationary or moving surfaces.</documentation>
</annotation>
<sequence>
<element name="CategoryCode" type="jc3iedm:IcingCategoryCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the class of a particular ICING.</documentation>
</annotation>
</element>
<element name="SeverityQualifierCode" type="jc3iedm:IcingSeverityQualifierCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the severity of a particular ICING.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="Light">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies the availability of natural illumination by type and time.</documentation>
</annotation>
<sequence>
<element name="CategoryCode" type="jc3iedm:LightCategoryCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the class of LIGHT.</documentation>
</annotation>
</element>
<element name="UpDatetime" type="jc3iedm:DatetimeOptionalTypeFix18" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The character string representing a point in time that designates the time of day that marks the beginning of the period of effectiveness of the specified type of LIGHT.</documentation>
</annotation>
</element>
<element name="DownDatetime" type="jc3iedm:DatetimeOptionalTypeFix18" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The character string representing a point in time that designates the time of day that marks the end of the period of effectiveness of the specified type of LIGHT.</documentation>
</annotation>
</element>
<element name="MoonPhaseCode" type="jc3iedm:LightMoonPhaseCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the phase of the moon for a specific LIGHT.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="Precipitation">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies the type of particulate matter in the Earth's atmosphere and the rate of its descent onto the Earth's surface.</documentation>
</annotation>
<sequence>
<element name="CategoryCode" type="jc3iedm:PrecipitationCategoryCode" minOccurs="1" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the prevailing class of a specific PRECIPITATION.</documentation>
</annotation>
</element>
<element name="Rate" type="jc3iedm:RateOptionalType4_1" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The numeric value that denotes the amount of PRECIPITATION deposited per unit time. The unit of measure is millimetres per hour.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="Visibility">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies the distance at which an object illuminated by light in the visual spectrum can be detected.</documentation>
</annotation>
<sequence>
<element name="CategoryCode" type="jc3iedm:VisibilityCategoryCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the class of obscurant that governs a particular VISIBILITY.</documentation>
</annotation>
</element>
<element name="RangeDimension" type="jc3iedm:DimensionMandatoryType12_3" minOccurs="1" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The one-dimensional linear distance representing the distance which can be surveyed using visual observation for a specific VISIBILITY.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="Wind">
<annotation>
<documentation xml:lang="en">A METEOROLOGIC-FEATURE that specifies the velocity and directional characteristics of atmospheric movement.</documentation>
</annotation>
<sequence>
<element name="CategoryCode" type="jc3iedm:WindCategoryCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value that represents the class of WIND.</documentation>
</annotation>
</element>
<element name="AirStabilityCategoryCode" type="jc3iedm:WindAirStabilityCategoryCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value used to indicate the class of air stability.</documentation>
</annotation>
</element>
<element name="AltitudeLayerCode" type="jc3iedm:WindAltitudeLayerCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value used to indicate the class of the altitude for a specific set of reported wind data.</documentation>
</annotation>
</element>
<element name="DirectionAngle" type="jc3iedm:AngleOptionalTypeRangeAngle7_4" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The rotational measurement clockwise between the line of true North and the direction from which a specific WIND originates.</documentation>
</annotation>
</element>
<element name="EffectiveDownwindDirectionAngle" type="jc3iedm:AngleOptionalTypeRangeAngle7_4" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The rotational measurement of the mean downwind direction at ground level in the hazard area towards which the cloud travels.</documentation>
</annotation>
</element>
<element name="SpeedRate" type="jc3iedm:RateOptionalType8_4" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The numeric value that denotes the distance per unit time of a specific WIND. The unit of measure is kilometres per hour.</documentation>
</annotation>
</element>
<element name="NuclearYieldQualifierCode" type="jc3iedm:NuclearYieldGroupCode" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">The specific value used to identify predicted wind values associated with nuclear fallout prediction for a specific Nuclear yield group.</documentation>
</annotation>
</element>
</sequence>
</complexType>
</schema>
@@ -0,0 +1,301 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by Paul Gustavson (SimVentions, Inc.) -->
<!-- created with XMLSpy v2006 U (http://www.altova.com) by Tram Chase (SimVentions) -->
<!--W3C Schema developed by the SISO BOM Product Develop Group (PDG) - version 2006 - copyright 2006 -->
<!--Schema for BOM DIF
Version 0.12 - Sep 8, 2005
Version 2006 - March 25, 2005
Version 2006a - April 2, 2007 // Reflects and complies to the approved standard SISO-STD-003-2006 submitted March 31, 2006
-->
<xs:schema xmlns="http://www.sisostds.org/schemas/modelID" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.sisostds.org/schemas/modelID" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="String">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="IdentifierType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="NonEmptyString">
<xs:simpleContent>
<xs:extension base="nonEmptyString">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="OMTypeEnumerations">
<xs:restriction base="xs:string">
<xs:enumeration value="FOM"/>
<xs:enumeration value="SOM"/>
<xs:enumeration value="BOM"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="OMTypeUnion">
<xs:union memberTypes="OMTypeEnumerations nonEmptyString"/>
<!--this allows enumerations to be used plus any user defined content -->
</xs:simpleType>
<xs:simpleType name="glyphTypeEnumerations">
<xs:restriction base="xs:string">
<xs:enumeration value="BITMAP"/>
<xs:enumeration value="JPG"/>
<xs:enumeration value="GIF"/>
<xs:enumeration value="PNG"/>
<xs:enumeration value="TIFF"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="glyphTypeUnion">
<xs:union memberTypes="glyphTypeEnumerations xs:string"/>
<!--this allows enumerations to be used plus any user defined content -->
</xs:simpleType>
<xs:complexType name="glyphType">
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="type" type="glyphTypeUnion" use="required"/>
<xs:attribute name="height" type="xs:short"/>
<xs:attribute name="width" type="xs:short"/>
<xs:attribute name="alt" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="pocType">
<xs:sequence>
<xs:element name="pocType" type="pocTypeType">
<xs:annotation>
<xs:documentation>specifies the role that the POC has with
respect to the model</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="pocName" type="String" minOccurs="0"/>
<xs:element name="pocOrg" type="String" minOccurs="0"/>
<xs:element name="pocTelephone" type="String" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="pocEmail" type="String" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:attributeGroup name="commonAttributes">
<!--this is the common attributes for any element -->
<xs:attribute name="notes" type="xs:IDREFS" use="optional"/>
<xs:attribute name="idtag" type="xs:ID" use="optional"/>
<xs:anyAttribute namespace="##other"/>
</xs:attributeGroup>
<xs:simpleType name="nonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SecurityClassificationEnumeration">
<xs:restriction base="xs:string">
<xs:enumeration value="Unclassified"/>
<xs:enumeration value="Confidential"/>
<xs:enumeration value="Secret"/>
<xs:enumeration value="Top Secret"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SecurityClassificationUnion">
<xs:union memberTypes="SecurityClassificationEnumeration nonEmptyString"/>
</xs:simpleType>
<xs:complexType name="modelType">
<xs:simpleContent>
<xs:extension base="OMTypeUnion">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="securityClassificationType">
<xs:simpleContent>
<xs:extension base="SecurityClassificationUnion">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="ApplicationDomainEnumerations">
<xs:restriction base="xs:string">
<xs:enumeration value="Analysis"/>
<xs:enumeration value="Training"/>
<xs:enumeration value="Test and Evaluation"/>
<xs:enumeration value="Engineering"/>
<xs:enumeration value="Acquisition"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ApplicationDomainUnion">
<xs:union memberTypes="ApplicationDomainEnumerations xs:string"/>
</xs:simpleType>
<xs:complexType name="applicationDomainType">
<xs:simpleContent>
<xs:extension base="ApplicationDomainUnion">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="POCTypeEnumeration">
<xs:restriction base="xs:string">
<xs:enumeration value="Primary author"/>
<xs:enumeration value="Contributor"/>
<xs:enumeration value="Proponent"/>
<xs:enumeration value="Sponsor"/>
<xs:enumeration value="Release authority"/>
<xs:enumeration value="Technical POC"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="POCTypeUnion">
<xs:union memberTypes="POCTypeEnumeration nonEmptyString"/>
</xs:simpleType>
<xs:complexType name="pocTypeType">
<xs:simpleContent>
<xs:extension base="POCTypeUnion">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="referenceTypeEnumerations">
<xs:restriction base="xs:string">
<xs:enumeration value="Source Material"/>
<xs:enumeration value="Conceptual Model"/>
<xs:enumeration value="Related BOM"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="referenceTypeUnion">
<xs:union memberTypes="referenceTypeEnumerations xs:string"/>
<!--this allows enumerations to be used plus any user defined content -->
</xs:simpleType>
<xs:complexType name="referenceType">
<xs:sequence>
<xs:element name="type">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="referenceTypeUnion">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="identification">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="commonAttributes"/>
</xs:complexType>
<xs:complexType name="keywordType">
<xs:sequence>
<xs:element name="taxonomy" type="String" minOccurs="0"/>
<xs:element name="keywordValue" type="NonEmptyString"/>
</xs:sequence>
<xs:attributeGroup ref="commonAttributes"/>
</xs:complexType>
<xs:complexType name="modelIdentificationType">
<xs:sequence>
<xs:element name="name" type="IdentifierType">
<xs:annotation>
<xs:documentation>specifies the name assigned to the object model</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="type" type="modelType">
<xs:annotation>
<xs:documentation>specify the type of model that is represented</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="version" type="NonEmptyString">
<xs:annotation>
<xs:documentation>specifies the version identification assigned to the object model</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="modificationDate" nillable="false">
<xs:annotation>
<xs:documentation>specifies the latest date on which this version of the object model was created or modified. The modification date shall be specified in the format "YYYY-MM-DD"</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:date">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="securityClassification" type="securityClassificationType">
<xs:annotation>
<xs:documentation>specifies the security classification of the
object model</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="releaseRestriction" type="String" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>specifies any restrictions on the release of the object models to specific organizations or individuals</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="purpose" type="String" minOccurs="0">
<xs:annotation>
<xs:documentation>specifies the purpose for which the federate or federation was developed</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="applicationDomain" type="applicationDomainType" minOccurs="0">
<xs:annotation>
<xs:documentation>specifies the type or class of application to which the federate or federation applies</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="description" type="NonEmptyString"/>
<xs:element name="useLimitation" type="String" minOccurs="0">
<xs:annotation>
<xs:documentation>specifies any known applications for which this model has been found not to be appropriate</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="useHistory" type="String" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>specifies a description of where this model has been used</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyword" type="keywordType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>specifies keywords that characterize the model</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="poc" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>specify an organization or a
person who has a particular role with respect to the model</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="pocType">
<xs:attributeGroup ref="commonAttributes"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="reference" type="referenceType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>specifies a pointer to additional sources of information</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="other" type="String" minOccurs="0">
<xs:annotation>
<xs:documentation>specifies other data deemed relevant by the author of the object model</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="glyph" minOccurs="0">
<xs:annotation>
<xs:documentation>specifies a glyph to visually represent the model</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:simpleContent>
<xs:extension base="glyphType"/>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="commonAttributes"/>
</xs:complexType>
</xs:schema>
@@ -0,0 +1,17 @@
/**
* Export definitions
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtCore/qglobal.h>
#ifndef ZWMSMSDL_EXPORT
# ifdef MAKE_ZWMSMSDL_LIB
# define ZWMSMSDL_EXPORT Q_DECL_EXPORT
# else
# define ZWMSMSDL_EXPORT Q_DECL_IMPORT
# endif
#endif
@@ -0,0 +1,272 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Last, SLSE, 2017-10-26
*/
#include "ppm_msdl_edit.h"
#include "ui_ppm_msdl_edit.h"
#include "msdl/msdl_import.h"
#include "msdl/msdl_export.h"
#include <QAction>
#include <AdvancedSymbology/asb_data_plugin_interface.h>
#include <Common/participant_edit_model.h>
#include <Common/participant_edit_item.h>
#include <Common/participant_tree_edit_handler.h>
#include <Common/participant_distype_editor.h>
#include <QTreeView>
namespace ParticipantManagement
{
MSDLEdit::MSDLEdit(LtsSession::LtsSession *session, QWidget *parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
, m_actionRemove(nullptr)
, m_actionEdit(nullptr)
, m_ppmDtc(nullptr)
, m_ppmFtc(nullptr)
, m_ppmGuiCbxIfc(nullptr)
, m_session(session)
, m_pTreehandlerSystem(nullptr)
, m_pTreehandlerImport(nullptr)
, m_pModelSystem(nullptr)
, m_pModelImport(nullptr)
, m_ui(new Ui::MSDLDialog)
, m_logger(getLogger("MSDLEdit"))
{
m_ui->setupUi(this);
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &MSDLEdit::onAddItem);
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &MSDLEdit::onEditItem);
connect(m_ui->m_pushButton_Import, &QPushButton::clicked, this, &MSDLEdit::onImport);
connect(m_ui->m_pushButton_Export, &QPushButton::clicked, this, &MSDLEdit::onExport);
connect(m_ui->m_pushButton_distypeEditor, &QPushButton::clicked, this, &MSDLEdit::onDistypeEditor);
setOnlineHelpFilename(QStringLiteral("Situation-Import-Export_MSDL"));
m_ui->m_treeViewEdit_Right->treeView()->setDragDropMode(QAbstractItemView::DragOnly);
m_ui->m_treeViewEdit_Right->treeView()->setSelectionMode(QAbstractItemView::SingleSelection);
m_ui->m_treeViewEdit_Right->treeView()->setDragEnabled(true);
m_ui->m_treeViewEdit_Left->treeView()->setDragDropMode(QAbstractItemView::DropOnly);
m_ui->m_treeViewEdit_Left->treeView()->setAcceptDrops(true);
m_ui->m_treeViewEdit_Left->treeView()->setDropIndicatorShown(true);
}
MSDLEdit::~MSDLEdit()
{
delete m_pTreehandlerImport;
delete m_pTreehandlerSystem;
delete m_ui;
}
void MSDLEdit::retranslate()
{
translate(m_ui, tr("MSDL Import/Export"));
m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty, ForeignGuiComboboxInterface::CbxPartyFilter::Normal);
}
void MSDLEdit::onDistypeEditor()
{
ParticipantManagement::DistypeEditor dialog(this, m_ppmDtc, m_ppmFtc);
dialog.exec();
}
void MSDLEdit::onImport()
{
m_pModelImport->resetModel();
m_pModelImport->setMimeType(QStringLiteral("MSDLDialog"));
m_pModelSystem->setMimeType(QStringLiteral("MSDLDialog"));
msdl::ImportMsdl dialog(m_pModelImport, QModelIndex(), this, m_session);
dialog.exec(); // TODO: use show(), use signals & slots !
m_pTreehandlerImport->beautifyTreeView(false);
}
void MSDLEdit::onExport()
{
msdl::ExportMsdl dialog(m_session, this);
dialog.exec(); // TODO: use show(), use signals & slots !
}
bool MSDLEdit::init(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc,
const std::shared_ptr<ParticipantManagement::Interface::Ftc> &ftc,
const std::shared_ptr<ForeignGuiComboboxInterface> &ppmGuiCbxIfc)
{
if (!dtc || !ftc || !ppmGuiCbxIfc)
{
m_ui->m_pushButton_Import->setEnabled(false);
m_ui->m_pushButton_Export->setEnabled(false);
m_ui->m_pushButton_distypeEditor->setEnabled(false);
return false;
}
m_ppmDtc = dtc;
m_ppmFtc = ftc;
m_ppmGuiCbxIfc = ppmGuiCbxIfc;
m_session->getForeignDataInterface<AdvancedSymbology::DataInterface>(m_asb);
m_pModelImport = new ParticipantEditModel(this, m_ppmDtc, m_asb);
m_ui->m_treeViewEdit_Right->setModel(m_pModelImport);
m_pModelSystem = new ParticipantEditModel(this, m_ppmDtc, m_asb);
connect(m_pModelSystem, &ParticipantEditModel::internalDataChanged, this, &MSDLEdit::slotChangesMade);
m_ui->m_treeViewEdit_Left->setModel(m_pModelSystem);
m_ui->m_treeViewEdit_Left->setContextMenuPolicy(Qt::CustomContextMenu);
m_actionRemove = new QAction(QIcon(QLatin1String("icon:remove.svg")), tr("Remove"), this);
m_actionEdit = new QAction(QIcon(QLatin1String("icon:edit.svg")), tr("Edit"), this);
connect(m_ui->cbParty, static_cast<void (LtsWidgets::LtsComboBox::*)(int)>(&LtsWidgets::LtsComboBox::currentIndexChanged),
this, &MSDLEdit::onPartyChanged);
m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty, ForeignGuiComboboxInterface::CbxPartyFilter::Normal);
m_pTreehandlerSystem = new ParticipantTreeEditHandler(m_ui->m_treeViewEdit_Left, m_ppmDtc, m_ppmFtc, false);
connect(m_actionRemove, &QAction::triggered, m_pTreehandlerSystem, &ParticipantTreeEditHandler::onRemoveItem);
connect(m_actionEdit, &QAction::triggered, this, &MSDLEdit::onEditItem);
m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, m_pTreehandlerSystem, &ParticipantTreeEditHandler::onRemoveItem);
connect(m_pTreehandlerSystem, &ParticipantTreeEditHandler::signalDoubleClicked, this, &MSDLEdit::onEditItem);
connect(m_pTreehandlerSystem, &ParticipantTreeEditHandler::signalSelectionChanged, this, &MSDLEdit::onEnaDisa);
connect(m_pTreehandlerSystem, &ParticipantTreeEditHandler::signalChangesMade, this, &MSDLEdit::onEnaDisa);
// Editing not allowed, just enable context menu (Collapse/Expand item)
m_pTreehandlerImport = new ParticipantTreeEditHandler(m_ui->m_treeViewEdit_Right, m_ppmDtc, m_ppmFtc, false);
onPartyChanged();
onEnaDisa();
return true;
}
void MSDLEdit::onPartyChanged()
{
const int newPartyId = m_ui->cbParty->currentData().toInt();
if (hasUnsavedChanges())
{
switch (askApplyDiscardCancel())
{
case LtsWidgets::Button::Apply:
if (!apply())
return;
break;
case LtsWidgets::Button::Cancel:
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(m_pModelSystem->partyId(), Qt::UserRole));
return;
case LtsWidgets::Button::Discard:
__unchange__(); // can't call resetChanges() by myself :(
break;
default:
break;
}
}
// DEBUG_LOG(m_logger) << LOGFUNCTION << " onPartyChanged !!! -> newPartyId=" << newPartyId;
// m_ui->cbParty->setEnabled(false); // will be re-enabled with reply (::lock, ::unlock)
// tryLockTopicNew(QStringLiteral("LockParty"), newPartyId);
m_pTreehandlerSystem->partyHasChanged(newPartyId, false);
}
bool MSDLEdit::apply()
{
return m_pTreehandlerSystem->onApplyChanges();
}
void MSDLEdit::lock()
{
m_ui->cbParty->setEnabled(true); // true!!
}
void MSDLEdit::unlock()
{
m_ui->cbParty->setEnabled(true);
}
void MSDLEdit::tableColumnOrganiserSetting()
{
//LtsColumnOrganiser
m_ui->m_treeViewEdit_Left->setColumnsOrganiserEnabled(identifier(), true);
m_ui->m_treeViewEdit_Right->setColumnsOrganiserEnabled(identifier(), true);
}
void MSDLEdit::onEnaDisa()
{
bool enableAdd = false;
bool enableEdit = false;
bool enableRemove = false;
if (m_pTreehandlerSystem->isSelectedIndexValid())
{
if (m_pTreehandlerSystem->isContainer()) //only add to units
enableAdd = true;
if (m_pTreehandlerSystem->isSelectedIndexRemovable())
enableRemove = true;
enableEdit = true;
}
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, enableAdd);
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, enableEdit);
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, enableRemove);
m_actionRemove->setEnabled(enableRemove);
m_actionEdit->setEnabled(enableEdit);
}
void MSDLEdit::onAddItem()
{
ParticipantEditItem *newItemDlg = new ParticipantEditItem(false, m_session, this);
newItemDlg->setAttribute(Qt::WA_DeleteOnClose);
if (!newItemDlg->init(m_pTreehandlerSystem->selectedIndexView(),
m_ui->cbParty->currentData().toInt(),
m_ppmDtc, m_ppmGuiCbxIfc, m_asb))
{
newItemDlg->deleteLater();
return;
}
connect(newItemDlg, &ParticipantEditItem::addItem, m_pModelSystem, &ParticipantEditModel::onInsertRow);
newItemDlg->show();
onEnaDisa();
}
void MSDLEdit::onEditItem()
{
if (!m_pTreehandlerSystem->isSelectedIndexValid())
return;
ParticipantManagement::ParticipantData data = m_pTreehandlerSystem->getSelectedData();
ParticipantEditItem *newItemDlg = new ParticipantEditItem(false, m_session, this);
if (!newItemDlg->init(m_pTreehandlerSystem->selectedIndexView(),
m_ui->cbParty->currentData().toInt(),
m_ppmDtc, m_ppmGuiCbxIfc, m_asb, data))
{
newItemDlg->deleteLater();
return;
}
connect(newItemDlg, &ParticipantEditItem::updateItem, m_pModelSystem, &ParticipantEditModel::onUpdateRow);
newItemDlg->exec();
onEnaDisa();
}
} //namespace ParticipantManagement
+86
View File
@@ -0,0 +1,86 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Last, SLSE, 2017-10-26
*/
#pragma once
#include <ParticipantManagement/logger.h>
#include <Services/ParticipantManagement/ppm_dtc.h>
#include <Services/ParticipantManagement/ppm_ftc.h>
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
#include <LtsWidgets/lts_dialog.h>
#include <LtsSession/lts_session.h>
#include <LtsUtilsGuiDds/request_helper.h>
class QSortFilterProxyModel;
namespace AdvancedSymbology
{
class ForeignDataInterface;
}
namespace Ui
{
class MSDLDialog;
}
namespace ParticipantManagement
{
class ParticipantEditModel;
class ParticipantTreeEditHandler;
class MSDLEdit : public LtsWidgets::LtsDialog
{
Q_OBJECT
public:
MSDLEdit(LtsSession::LtsSession *session, QWidget *parent = nullptr);
~MSDLEdit();
bool init(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc,
const std::shared_ptr<ParticipantManagement::Interface::Ftc> &ftc,
const std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> &ppmGuiCbxIfc);
private:
void retranslate() override;
bool apply() override;
void lock() override;
void unlock() override;
void tableColumnOrganiserSetting() override;
protected slots:
void onEnaDisa(); // enable/disable the widgets
void onAddItem();
void onEditItem();
void onPartyChanged();
void onImport();
void onExport();
void onDistypeEditor();
private:
QAction *m_actionRemove;
QAction *m_actionEdit;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ppmFtc;
std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> m_ppmGuiCbxIfc;
std::shared_ptr<AdvancedSymbology::ForeignDataInterface> m_asb;
LtsSession::LtsSession *m_session;
ParticipantTreeEditHandler *m_pTreehandlerSystem;
ParticipantTreeEditHandler *m_pTreehandlerImport;
ParticipantEditModel *m_pModelSystem;
ParticipantEditModel *m_pModelImport;
Ui::MSDLDialog *m_ui;
NGL::INGLLogger &m_logger;
};
} //ParticipantManagement
+109
View File
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MSDLDialog</class>
<widget class="QWidget" name="MSDLDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1179</width>
<height>433</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string notr="true">setwindowtitle in source</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="LtsWidgets::LtsComboBox" name="cbParty">
<property name="const" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>346</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="m_pushButton_Import">
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QPushButton" name="m_pushButton_Export">
<property name="text">
<string>Export</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>346</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="m_pushButton_distypeEditor">
<property name="text">
<string>Edit DIS type mapping</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblParty">
<property name="text">
<string>Party:</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="8">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="LtsDataView::LtsDataView" name="m_treeViewEdit_Left" native="true"/>
<widget class="LtsDataView::LtsDataView" name="m_treeViewEdit_Right" native="true"/>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LtsWidgets::LtsComboBox</class>
<extends>QComboBox</extends>
<header>LtsWidgets/lts_combo_box.h</header>
</customwidget>
<customwidget>
<class>LtsDataView::LtsDataView</class>
<extends>QWidget</extends>
<header>LtsDataView/lts_data_view.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,100 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Last, SLSE, 2017-10-26
*/
#include "ppm_msdl_gui_plugin.h"
#include "ppm_msdl_edit.h"
#include <LtsSession/lts_session.h>
#include <Services/ParticipantManagement/ppm_operator_rights.h>
#include <LtsUtilsSettings/settings.h>
namespace ParticipantManagement
{
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
{
return std::make_shared<InterfaceImpl>(session);
}
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
: GuiPluginBase::Interface(session, getLogger("Plugins.Gui.Ppm.msdl"))
, m_pSession(session)
, m_dtc(nullptr)
, m_ftc(nullptr)
, m_ppmGuiCbxIfc(nullptr)
{}
bool InterfaceImpl::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_dtc))
return false;
if (!m_session->getFtc<ParticipantManagement::DataInterface>(m_ftc))
return false;
if (!m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(m_ppmGuiCbxIfc))
return false;
return true;
}
void InterfaceImpl::clearInterfaces()
{
m_dtc = nullptr;
m_ftc = nullptr;
m_ppmGuiCbxIfc = nullptr;
}
QString InterfaceImpl::menuGroup() const
{
return tr("Participants");
}
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
{
QVector<LtsWidgets::PluginData> ret;
/*
* Importing exercise data is only possible if
* the operator is actually operating within an exercise
*/
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
const bool enableMSDL_ImExport = ps->value(QStringLiteral("ppm"),
QStringLiteral("enableMSDL_ImExport")).toBool();
if ( (m_pSession->exerciseId() != 0) && enableMSDL_ImExport)
{
LtsWidgets::PluginData plData;
plData.menuGroup = menuGroup();
plData.menuText = tr("MSDL Import/Export");
plData.identifier = QLatin1String("ppmmsdlview");
plData.menuIcon = QIcon(QLatin1String("icon:import_msdl.svg"));
plData.operatorRight = OperatorRights::Msdl::MsdlImportExport; // OperatorRights::PartyEdit::PartiesShow
plData.exercisePart = LtsWidgets::ExercisePart::ePlanning;
plData.createWidgetFunc = [this](QWidget * parent)
{
return onShowMSDLEdit(parent);
};
ret.append(plData);
}
return ret;
}
LtsWidgets::LtsDialog *InterfaceImpl::onShowMSDLEdit(QWidget *parent)
{
return LtsWidgets::initDialog(new ParticipantManagement::MSDLEdit(m_session, parent),
m_dtc, m_ftc, m_ppmGuiCbxIfc);
}
} // namespace ParticipantManagement
@@ -0,0 +1,66 @@
/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Last, SLSE, 2017-10-26
*/
#pragma once
#include <ParticipantManagement/logger.h>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_msdl_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
namespace ParticipantManagement
{
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
{
Q_PLUGIN_METADATA(IID "gui:3:ppm.msdl")
Q_INTERFACES(GuiPluginBase::Plugin)
Q_OBJECT
public:
GuiPlugin() = default;
~GuiPlugin() = default;
QString pluginName() override { return QStringLiteral("ParticipantManagement.GuiPlugin.msdl"); }
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
bool availableInPartition(IDL::PartitionType partition) const override
{
return (partition == IDL::PartitionType::Global ||
partition == IDL::PartitionType::Exercise);
}
};
class InterfaceImpl final : public QObject, public ForeignMSDLGuiInterface, public GuiPluginBase::Interface
{
Q_OBJECT
public:
explicit InterfaceImpl(LtsSession::LtsSession *session);
bool fetchInterfaces() override;
void clearInterfaces() override;
QString menuGroup() const override;
QVector<LtsWidgets::PluginData> getActions() override;
bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise; }
private:
LtsWidgets::LtsDialog *onShowMSDLEdit(QWidget *parent);
LtsSession::LtsSession *m_pSession;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> m_ppmGuiCbxIfc;
};
} // namespace ParticipantManagement