Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Philipp Last, SLSE, 2017-10-26
|
||||
#
|
||||
|
||||
|
||||
ADD_SUBDIRECTORY(saab)
|
||||
|
||||
SET(ppm_saab_SRCS
|
||||
ppm_saab_gui_plugin.cpp
|
||||
ppm_saab_gui_plugin.h
|
||||
ppm_saab_edit.cpp
|
||||
ppm_saab_edit.h
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(ppm_saab_SRCS
|
||||
ppm_saab_edit.ui
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS PpmSAABGuiPlugin MODULE ${ppm_saab_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(PpmSAABGuiPlugin
|
||||
AsbDataPluginInterface
|
||||
NGLLogger
|
||||
LtsSession
|
||||
PpmGuiPartyPluginInterface
|
||||
PpmDataPluginInterface
|
||||
PpmGuiComboboxPluginInterface
|
||||
Qt5::Widgets
|
||||
LtsWidgets
|
||||
LtsDataView
|
||||
LtsUtilsGuiDds
|
||||
PpmCommon
|
||||
zwmssaab
|
||||
LtsUtilsSettings
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(PpmSAABGuiPlugin)
|
||||
@@ -0,0 +1,584 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ExerciseOrbat xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.saab.se/training/schemas/ExerciseOrbat/1.1.1">
|
||||
<Exercise ID="9a15ba5e-3f9f-4ddc-bad5-d8d78f7e81ce">
|
||||
<ChangeInfo ChangeType="Update" ChangeTime="2019-03-26T12:41:48.0972152Z" ChangedBy="DESKTOP-B7B1L48\SiteAdmin" ChangedBySID="S-1-5-21-3817606406-1570288480-3641748261-1001" />
|
||||
<ExportTime>2019-03-26T12:41:48.1Z</ExportTime>
|
||||
<PlannedStartTime>2017-02-20T15:15:00Z</PlannedStartTime>
|
||||
<PlannedStopTime>2017-02-21T15:15:00Z</PlannedStopTime>
|
||||
<StartTime>2017-03-07T15:37:15Z</StartTime>
|
||||
<StopTime>2017-03-28T06:58:29Z</StopTime>
|
||||
<Designation>WE ARE</Designation>
|
||||
<Description>Exercise 6</Description>
|
||||
<WindSpeed>0</WindSpeed>
|
||||
<WindDirection>0</WindDirection>
|
||||
<EvaluationPackageFileName />
|
||||
<ExerciseState>0</ExerciseState>
|
||||
<MultiNational>false</MultiNational>
|
||||
</Exercise>
|
||||
<Orbat>
|
||||
<Unit ID="f404a7d8-04bd-4d56-8e85-5b23a1a075d9">
|
||||
<Designation>O/C</Designation>
|
||||
<OriginalCreationID>f404a7d8-04bd-4d56-8e85-5b23a1a075d9</OriginalCreationID>
|
||||
<Force>NT</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UC</Symbol>
|
||||
<UnitSize>UNK</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<OCPlayer ID="cf2fbc57-ff24-4132-8eb5-e60906813889">
|
||||
<Designation>ME</Designation>
|
||||
<Longitude>0</Longitude>
|
||||
<Latitude>0</Latitude>
|
||||
<Force>NT</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>O/C</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>9511</SystemID>
|
||||
<SimulatorID>9511</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</OCPlayer>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
<Unit ID="e782ff2b-7b82-4573-918e-8a129f5fc2f7">
|
||||
<Designation>Opfor</Designation>
|
||||
<OriginalCreationID>e782ff2b-7b82-4573-918e-8a129f5fc2f7</OriginalCreationID>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCI</Symbol>
|
||||
<UnitSize>PLT</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<Unit ID="2727ab2d-01fa-4d20-8540-397f4a90a7c4">
|
||||
<Designation>2nd team</Designation>
|
||||
<OriginalCreationID>2727ab2d-01fa-4d20-8540-397f4a90a7c4</OriginalCreationID>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCI</Symbol>
|
||||
<UnitSize>TEAM</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<PersonPlayer ID="464e3b9e-1ffe-4d4e-b1ef-1effd2974824">
|
||||
<Designation>Soldier_214</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>214</SystemID>
|
||||
<SimulatorID>214</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<VehiclePlayer ID="bb6b8367-2ebb-4671-9cfb-31707aed2411">
|
||||
<Designation>Vehicle_201</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>201</SystemID>
|
||||
<SimulatorID>201</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="cd3c1c08-bc08-4810-a4bf-4b1e18e49629">
|
||||
<Designation>Vehicle_202</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>202</SystemID>
|
||||
<SimulatorID>202</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="ce758ebc-0d0e-449e-b963-fb370f9a042a">
|
||||
<Designation>Vehicle_203</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>203</SystemID>
|
||||
<SimulatorID>203</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
<Unit ID="449f32f2-e4a4-4bb1-9932-72686f3537b4">
|
||||
<Designation>3rd team</Designation>
|
||||
<OriginalCreationID>449f32f2-e4a4-4bb1-9932-72686f3537b4</OriginalCreationID>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCI</Symbol>
|
||||
<UnitSize>TEAM</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<PersonPlayer ID="ea2efe21-7f09-4418-a08e-659e0642430b">
|
||||
<Designation>Soldier_221</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>221</SystemID>
|
||||
<SimulatorID>221</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="3698a756-8d72-43f8-9d35-a137267ca98e">
|
||||
<Designation>Soldier_222</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>222</SystemID>
|
||||
<SimulatorID>222</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="50870d88-daea-466a-bfd5-e7f9ed19c430">
|
||||
<Designation>Soldier_224</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>224</SystemID>
|
||||
<SimulatorID>224</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="cfed5e78-59a4-4ec4-b1ca-f98ee679843e">
|
||||
<Designation>Soldier_223</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>223</SystemID>
|
||||
<SimulatorID>223</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<VehiclePlayer ID="479a3276-bcbf-4f19-af5c-5255b3670d18">
|
||||
<Designation>Vehicle_262</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>262</SystemID>
|
||||
<SimulatorID>262</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="2871474c-5e2f-4632-aab4-6d1ab877b06f">
|
||||
<Designation>Vehicle_264</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>264</SystemID>
|
||||
<SimulatorID>264</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="57f4a92e-61e6-4841-b0a6-d8b85a05d14a">
|
||||
<Designation>Vehicle_261</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>261</SystemID>
|
||||
<SimulatorID>261</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="c979e546-6da4-4cc2-926e-d94cdba7c11b">
|
||||
<Designation>Vehicle_263</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>263</SystemID>
|
||||
<SimulatorID>263</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
<Unit ID="f7131c1b-2f33-484d-b5d6-a6a40d5e2297">
|
||||
<Designation>1st team</Designation>
|
||||
<OriginalCreationID>f7131c1b-2f33-484d-b5d6-a6a40d5e2297</OriginalCreationID>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCI</Symbol>
|
||||
<UnitSize>TEAM</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<PersonPlayer ID="fc2471a4-6fc3-49bd-a819-ef0859f3d866">
|
||||
<Designation>Soldier_212</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>212</SystemID>
|
||||
<SimulatorID>212</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="eaeea533-d914-4adf-9dca-f2fb8ac31bf8">
|
||||
<Designation>Soldier_213</Designation>
|
||||
<Longitude>0</Longitude>
|
||||
<Latitude>0</Latitude>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>213</SystemID>
|
||||
<SimulatorID>213</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
<PersonRefID>a12ef200-855e-11e6-9738-5891cf9dccdf</PersonRefID>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="0fb8b003-87b7-4edf-a316-fe29582293a0">
|
||||
<Designation>Soldier_211</Designation>
|
||||
<Longitude>0</Longitude>
|
||||
<Latitude>0</Latitude>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>211</SystemID>
|
||||
<SimulatorID>211</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
<PersonRefID>a12fc000-855e-11e6-9738-5891cf9dccdf</PersonRefID>
|
||||
</PersonPlayer>
|
||||
<VehiclePlayer ID="a1ab4b8e-38d7-4bfc-b8fe-6a32025b941f">
|
||||
<Designation>Vehicle_252</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>252</SystemID>
|
||||
<SimulatorID>252</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="452a4a61-c144-45fb-bde1-88561831b568">
|
||||
<Designation>Vehicle_251</Designation>
|
||||
<Force>HO</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>251</SystemID>
|
||||
<SimulatorID>251</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
<Unit ID="2048c7a8-e2cc-453b-a914-8ff7bac59a23">
|
||||
<Designation>Bluefor</Designation>
|
||||
<OriginalCreationID>2048c7a8-e2cc-453b-a914-8ff7bac59a23</OriginalCreationID>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCIM</Symbol>
|
||||
<UnitSize>COY</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<Unit ID="caa3f108-6e3c-480a-a6b5-00e8a0bf5a08">
|
||||
<Designation>Bravo</Designation>
|
||||
<OriginalCreationID>caa3f108-6e3c-480a-a6b5-00e8a0bf5a08</OriginalCreationID>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCIM</Symbol>
|
||||
<UnitSize>PLT</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<PersonPlayer ID="35a52413-286b-47ba-92a7-760270a37df0">
|
||||
<Designation>Soldier_102</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>102</SystemID>
|
||||
<SimulatorID>102</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="bb11987b-574e-4ef5-94f9-7667feecf89e">
|
||||
<Designation>Soldier_103</Designation>
|
||||
<Longitude>0</Longitude>
|
||||
<Latitude>0</Latitude>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>103</SystemID>
|
||||
<SimulatorID>103</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
<PersonRefID>a12e2d00-855e-11e6-9738-5891cf9dccdf</PersonRefID>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="71632a4b-3ae1-4adf-b2fc-a988fd1d594d">
|
||||
<Designation>Soldier_101</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>101</SystemID>
|
||||
<SimulatorID>101</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="a1dfbc9c-2d5f-4f9c-a524-fd9922efe5e7">
|
||||
<Designation>Soldier_104</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>104</SystemID>
|
||||
<SimulatorID>104</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<VehiclePlayer ID="c8f66e3e-1fb9-44ce-b72a-0a8376f7025d">
|
||||
<Designation>Vehicle_154</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>154</SystemID>
|
||||
<SimulatorID>154</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="39556b2e-6ae0-498d-bec4-1e1d6511812f">
|
||||
<Designation>Vehicle_153</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>153</SystemID>
|
||||
<SimulatorID>153</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="b45dc8bd-31c3-4d38-a0d7-6948e93b6f91">
|
||||
<Designation>Vehicle_152</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>152</SystemID>
|
||||
<SimulatorID>152</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="e88e7d4b-7ab8-4802-a075-bf60a1d5c7a9">
|
||||
<Designation>Vehicle_151</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>151</SystemID>
|
||||
<SimulatorID>151</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
<Unit ID="f1812c7e-d745-46fb-a42a-f909594b0434">
|
||||
<Designation>Delta</Designation>
|
||||
<OriginalCreationID>f1812c7e-d745-46fb-a42a-f909594b0434</OriginalCreationID>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>UCIM</Symbol>
|
||||
<UnitSize>PLT</UnitSize>
|
||||
<Trashcan>false</Trashcan>
|
||||
<OrbatEntities>
|
||||
<PersonPlayer ID="8aae89b8-7efa-4a2c-bdc3-32cdb053911f">
|
||||
<Designation>Soldier_105</Designation>
|
||||
<Longitude>0</Longitude>
|
||||
<Latitude>0</Latitude>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>105</SystemID>
|
||||
<SimulatorID>105</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
<PersonRefID>a12f8400-855e-11e6-9738-5891cf9dccdf</PersonRefID>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="1dadcc91-6c4d-4ff4-aa2e-4070037e791d">
|
||||
<Designation>Soldier_108</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>108</SystemID>
|
||||
<SimulatorID>108</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="3f2c05cf-d250-4081-9257-7eeabb206d0c">
|
||||
<Designation>Soldier_106</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>106</SystemID>
|
||||
<SimulatorID>106</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<PersonPlayer ID="912ae795-8568-4821-8fb8-b8312e0cb378">
|
||||
<Designation>Soldier_107</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>PSOLD1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>107</SystemID>
|
||||
<SimulatorID>107</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Rank>OF1</Rank>
|
||||
</PersonPlayer>
|
||||
<VehiclePlayer ID="0f02bd50-6b5d-4322-9aef-11aa7be4d406">
|
||||
<Designation>Vehicle_156</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>156</SystemID>
|
||||
<SimulatorID>156</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="21c0e1eb-143d-4a9d-b459-62d4ebb472c2">
|
||||
<Designation>Vehicle_158</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>158</SystemID>
|
||||
<SimulatorID>158</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="0fe1e724-a5a7-4faf-a7a6-9aac99b6f427">
|
||||
<Designation>Vehicle_155</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>155</SystemID>
|
||||
<SimulatorID>155</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
<VehiclePlayer ID="001d6b5f-d285-4187-8667-ef83b27acc72">
|
||||
<Designation>Vehicle_157</Designation>
|
||||
<Force>FR</Force>
|
||||
<Color>0</Color>
|
||||
<Symbol>VCAR1</Symbol>
|
||||
<FixedPosition>false</FixedPosition>
|
||||
<SystemID>157</SystemID>
|
||||
<SimulatorID>157</SimulatorID>
|
||||
<ArticleNumber />
|
||||
<Trashcan>false</Trashcan>
|
||||
<ExternalPlayer>false</ExternalPlayer>
|
||||
<Orientation>0</Orientation>
|
||||
</VehiclePlayer>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
</OrbatEntities>
|
||||
</Unit>
|
||||
</Orbat>
|
||||
<Persons>
|
||||
<Person ID="a12ef200-855e-11e6-9738-5891cf9dccdf">
|
||||
<PersonalID>225</PersonalID>
|
||||
<Name>Peter Creutz</Name>
|
||||
</Person>
|
||||
<Person ID="a12fc000-855e-11e6-9738-5891cf9dccdf">
|
||||
<PersonalID>322</PersonalID>
|
||||
<Name>Björn Linderö</Name>
|
||||
</Person>
|
||||
<Person ID="a12e2d00-855e-11e6-9738-5891cf9dccdf">
|
||||
<PersonalID>203</PersonalID>
|
||||
<Name>Pär Blomqvist</Name>
|
||||
</Person>
|
||||
<Person ID="a12f8400-855e-11e6-9738-5891cf9dccdf">
|
||||
<PersonalID>312</PersonalID>
|
||||
<Name>Anders Landin</Name>
|
||||
</Person>
|
||||
</Persons>
|
||||
<Vehicles />
|
||||
<Helicopters />
|
||||
</ExerciseOrbat>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,884 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Config>
|
||||
<Symbols>
|
||||
<Symbol>
|
||||
<Code>1000LB</Code>
|
||||
<Text>Air Strike 1000lb</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>120HEG</Code>
|
||||
<Text>120 mm</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>155HEA</Code>
|
||||
<Text>PzH 155 mm HE DP-ICM</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>155HEG</Code>
|
||||
<Text>PzH 155 mm HE</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>2000LB</Code>
|
||||
<Text>Air Strike 2000lb</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>500LB</Code>
|
||||
<Text>Air Strike 500lb</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>81HEG</Code>
|
||||
<Text>81 mm</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>ABATIS</Code>
|
||||
<Text>Out of bounds Obstacle</Text>
|
||||
<SymbolID>G*M*OS</SymbolID>
|
||||
<ModelID>10101</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0000FF00</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>ANTOBS</Code>
|
||||
<Text>Surmountable Obstacle</Text>
|
||||
<SymbolID>G*M*OAOF</SymbolID>
|
||||
<ModelID>10101</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0000FF00</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>ANTWAL</Code>
|
||||
<Text>Insurmountable Obstacle</Text>
|
||||
<SymbolID>G*M*OAW</SymbolID>
|
||||
<ModelID>10101</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0000FF00</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>ASCB</Code>
|
||||
<Text>Air Strike Cluster Bomb</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>Dummy1</Code>
|
||||
<Text>Dummy</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>10151</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x00FFFFFF</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>DUMMY2</Code>
|
||||
<Text>Dummy</Text>
|
||||
<SymbolID>G*F*PTS</SymbolID>
|
||||
<ModelID>10201</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>Dummy3</Code>
|
||||
<Text>Dummy - shown when artillery simulation is running</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x00FBFB43</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>Dummy4</Code>
|
||||
<Text>Dummy</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>10251</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x00000064</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>Dummy5</Code>
|
||||
<Text>Dummy</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x00FFFFFF</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>D_BS</Code>
|
||||
<Text>Base Station</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>60000</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>D_MDAN</Code>
|
||||
<Text>MDAN</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>60000</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>D_NC</Code>
|
||||
<Text>Network Controller</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>60000</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVAB</Code>
|
||||
<Text>Ambulance</Text>
|
||||
<SymbolID>S*G*EVUA</SymbolID>
|
||||
<ModelID>2</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVAC</Code>
|
||||
<Text>Command</Text>
|
||||
<SymbolID>S*G*EVAC</SymbolID>
|
||||
<ModelID>4</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVAIFV</Code>
|
||||
<Text>IFV</Text>
|
||||
<SymbolID>S*G*EVAI</SymbolID>
|
||||
<ModelID>1</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>21</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVAPC</Code>
|
||||
<Text>APC</Text>
|
||||
<SymbolID>S*G*EVAA</SymbolID>
|
||||
<ModelID>4</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVAT</Code>
|
||||
<Text>Tank</Text>
|
||||
<SymbolID>S*G*EVAT</SymbolID>
|
||||
<ModelID>3</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>11</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVATMR</Code>
|
||||
<Text>Recovery</Text>
|
||||
<SymbolID>S*G*EVATMR</SymbolID>
|
||||
<ModelID>8</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVCE</Code>
|
||||
<Text>Armored CasEvac</Text>
|
||||
<SymbolID>S*G*EVAAC</SymbolID>
|
||||
<ModelID>4</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVCIV</Code>
|
||||
<Text>Civilian</Text>
|
||||
<SymbolID>S*G*EVC</SymbolID>
|
||||
<ModelID>6</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVCSS</Code>
|
||||
<Text>Armored Combat Service</Text>
|
||||
<SymbolID>S*G*EVAS</SymbolID>
|
||||
<ModelID>4</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVEB</Code>
|
||||
<Text>Engineer Bridge</Text>
|
||||
<SymbolID>S*G*EVEB</SymbolID>
|
||||
<ModelID>7</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVEML</Code>
|
||||
<Text>Engineer Mine</Text>
|
||||
<SymbolID>S*G*EVEM</SymbolID>
|
||||
<ModelID>4</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVGP</Code>
|
||||
<Text>General Purpose</Text>
|
||||
<SymbolID>S*G*EV</SymbolID>
|
||||
<ModelID>2</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>EVU</Code>
|
||||
<Text>Utility</Text>
|
||||
<SymbolID>S*G*EVU</SymbolID>
|
||||
<ModelID>5</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>31</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>F/MMW</Code>
|
||||
<Text>Fire Marker Manworn</Text>
|
||||
<SymbolID>S*G*PFM</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>F/MV</Code>
|
||||
<Text>Fire Marker Vehicle</Text>
|
||||
<SymbolID>S*G*PFM</SymbolID>
|
||||
<ModelID>2</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>GAS1</Code>
|
||||
<Text>Chemical</Text>
|
||||
<SymbolID>G*M*NC</SymbolID>
|
||||
<ModelID>10051</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0000FFFF</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>HOWBTL</Code>
|
||||
<Text>Howitzer Battalion</Text>
|
||||
<SymbolID>S*G*UCF</SymbolID>
|
||||
<ModelID>251</ModelID>
|
||||
<EchelonID>8</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>HOWCOY</Code>
|
||||
<Text>Howitzer Company</Text>
|
||||
<SymbolID>S*G*UCF</SymbolID>
|
||||
<ModelID>251</ModelID>
|
||||
<EchelonID>6</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>HOWPLT</Code>
|
||||
<Text>Howitzer Platoon</Text>
|
||||
<SymbolID>S*G*UCF</SymbolID>
|
||||
<ModelID>251</ModelID>
|
||||
<EchelonID>4</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>JAM20M</Code>
|
||||
<Text>Jammer Small (20m)</Text>
|
||||
<SymbolID>S*G*UUMS</SymbolID>
|
||||
<ModelID>687</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Radius>20</Radius>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>JAM40M</Code>
|
||||
<Text>Jammer Medium (40m)</Text>
|
||||
<SymbolID>S*G*UUMS</SymbolID>
|
||||
<ModelID>687</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Radius>40</Radius>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>JAM80M</Code>
|
||||
<Text>Jammer Large (80m)</Text>
|
||||
<SymbolID>S*G*UUMS</SymbolID>
|
||||
<ModelID>687</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Radius>80</Radius>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>MINEAP</Code>
|
||||
<Text>Anti-Personnel</Text>
|
||||
<SymbolID>G*M*OMP</SymbolID>
|
||||
<ModelID>10001</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0000FF00</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>MINEAT</Code>
|
||||
<Text>Anti-Tank</Text>
|
||||
<SymbolID>G*M*OMT</SymbolID>
|
||||
<ModelID>10002</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0000FF00</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>MLRS</Code>
|
||||
<Text>MLRS</Text>
|
||||
<SymbolID>S*G*UCFRM</SymbolID>
|
||||
<ModelID>353</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>MRTCOY</Code>
|
||||
<Text>Mortar Company</Text>
|
||||
<SymbolID>S*G*UCFM</SymbolID>
|
||||
<ModelID>251</ModelID>
|
||||
<EchelonID>6</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>MRTPLT</Code>
|
||||
<Text>Mortar Platoon</Text>
|
||||
<SymbolID>S*G*UCFM</SymbolID>
|
||||
<ModelID>251</ModelID>
|
||||
<EchelonID>4</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>O/CMW</Code>
|
||||
<Text>Observer/Trainer Manworn</Text>
|
||||
<SymbolID>S*G*POT</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>O/CV</Code>
|
||||
<Text>Observer/Trainer Vehicle</Text>
|
||||
<SymbolID>S*G*POT</SymbolID>
|
||||
<ModelID>2</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>PARTOB</Code>
|
||||
<Text>Artillery Observer</Text>
|
||||
<SymbolID>S*G*PFO</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>1</EchelonID>
|
||||
<PlayerTypeID>61</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>PCOY</Code>
|
||||
<Text>Company Leader</Text>
|
||||
<SymbolID>S*G*P</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>6</EchelonID>
|
||||
<PlayerTypeID>61</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>PMEDIC</Code>
|
||||
<Text>Medic</Text>
|
||||
<SymbolID>S*G*PM</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>1</EchelonID>
|
||||
<PlayerTypeID>61</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>PPLT</Code>
|
||||
<Text>Platoon Leader</Text>
|
||||
<SymbolID>S*G*P</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>4</EchelonID>
|
||||
<PlayerTypeID>61</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>PSOLD</Code>
|
||||
<Text>Soldier</Text>
|
||||
<SymbolID>S*G*P</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>1</EchelonID>
|
||||
<PlayerTypeID>61</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>PSQ</Code>
|
||||
<Text>Squad Leader</Text>
|
||||
<SymbolID>S*G*P</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>2</EchelonID>
|
||||
<PlayerTypeID>61</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>SFM</Code>
|
||||
<Text>SFM</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>0</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>SMOKE</Code>
|
||||
<Text>Smokescreen</Text>
|
||||
<SymbolID>S*G*UUACS</SymbolID>
|
||||
<ModelID>10300</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x00FFB668</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>STTMW</Code>
|
||||
<Text>Support Team Terminal Manworn</Text>
|
||||
<SymbolID>S*G*PTS</SymbolID>
|
||||
<ModelID>51</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>STTVEH</Code>
|
||||
<Text>Support Team Terminal Vehicle</Text>
|
||||
<SymbolID>S*G*PTS</SymbolID>
|
||||
<ModelID>2</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UC</Code>
|
||||
<Text>Unit</Text>
|
||||
<SymbolID>S*G*U</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCA</Code>
|
||||
<Text>Armor</Text>
|
||||
<SymbolID>S*G*UCA</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCAA</Code>
|
||||
<Text>Anti Armor</Text>
|
||||
<SymbolID>S*G*UCAA</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCAAA</Code>
|
||||
<Text>PR-MRAT</Text>
|
||||
<SymbolID>S*G*UCAAA</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCAAAA</Code>
|
||||
<Text>MRAT</Text>
|
||||
<SymbolID>S*G*UCAAS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCAAMA</Code>
|
||||
<Text>LSV-MRAT</Text>
|
||||
<SymbolID>S*G*UCAAOS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCAD</Code>
|
||||
<Text>Air Defense</Text>
|
||||
<SymbolID>S*G*UCD</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCATR</Code>
|
||||
<Text>PRBDR</Text>
|
||||
<SymbolID>S*G*UCATR</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCE</Code>
|
||||
<Text>GN</Text>
|
||||
<SymbolID>S*G*UCE</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCEAA</Code>
|
||||
<Text>GN LMB</Text>
|
||||
<SymbolID>S*G*UCECS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCEM</Code>
|
||||
<Text>PAGN</Text>
|
||||
<SymbolID>S*G*UCECT</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFA</Code>
|
||||
<Text>Artillery</Text>
|
||||
<SymbolID>S*G*UCF</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFAAS</Code>
|
||||
<Text>WRN</Text>
|
||||
<SymbolID>S*G*UCFS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFAHS</Code>
|
||||
<Text>ART</Text>
|
||||
<SymbolID>S*G*UCFHE</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFAM</Code>
|
||||
<Text>Mortar</Text>
|
||||
<SymbolID>S*G*UCFM</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFAMT</Code>
|
||||
<Text>PRMR</Text>
|
||||
<SymbolID>S*G*UCFMT</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFASA</Code>
|
||||
<Text>WRN LMB</Text>
|
||||
<SymbolID>S*G*UCFSS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFATA</Code>
|
||||
<Text>MR LMB</Text>
|
||||
<SymbolID>S*G*UCFMTS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFATD</Code>
|
||||
<Text>WRN D</Text>
|
||||
<SymbolID>S*G*UCFTCD</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCFATT</Code>
|
||||
<Text>WRN T</Text>
|
||||
<SymbolID>S*G*UCFTCM</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCI</Code>
|
||||
<Text>Infantry</Text>
|
||||
<SymbolID>S*G*UCI</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCIAA</Code>
|
||||
<Text>INF LMB</Text>
|
||||
<SymbolID>S*G*UCIS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCIM</Code>
|
||||
<Text>Infantry Mech.</Text>
|
||||
<SymbolID>S*G*UCIZ</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCR</Code>
|
||||
<Text>Recon.</Text>
|
||||
<SymbolID>S*G*UCR</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCRA</Code>
|
||||
<Text>Recon. Mech.</Text>
|
||||
<SymbolID>S*G*UCRVA</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCRAA</Code>
|
||||
<Text>VERK LMB</Text>
|
||||
<SymbolID>S*G*UCRS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSM</Code>
|
||||
<Text>GNK</Text>
|
||||
<SymbolID>S*G*USM</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSMI</Code>
|
||||
<Text>HRST</Text>
|
||||
<SymbolID>S*G*USX</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSMR</Code>
|
||||
<Text>BDR</Text>
|
||||
<SymbolID>S*G*USXR</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSMT</Code>
|
||||
<Text>HP</Text>
|
||||
<SymbolID>S*G*USMM</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSQ</Code>
|
||||
<Text>BEVO</Text>
|
||||
<SymbolID>S*G*USA</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSS</Code>
|
||||
<Text>LOG</Text>
|
||||
<SymbolID>S*G*USS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSS1</Code>
|
||||
<Text>KL I</Text>
|
||||
<SymbolID>S*G*USS1</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSS2</Code>
|
||||
<Text>KL II</Text>
|
||||
<SymbolID>S*G*USS2</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSS3</Code>
|
||||
<Text>KL III</Text>
|
||||
<SymbolID>S*G*USS3</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UCSSS5</Code>
|
||||
<Text>KL V</Text>
|
||||
<SymbolID>S*G*USS5</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UNK</Code>
|
||||
<Text>Unknown</Text>
|
||||
<SymbolID>
|
||||
</SymbolID>
|
||||
<ModelID>301</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
<Color>0x0080FFFF</Color>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>USC2HQ</Code>
|
||||
<Text>CP</Text>
|
||||
<SymbolID>S*G*UH</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>UUS</Code>
|
||||
<Text>Signalist</Text>
|
||||
<SymbolID>S*G*UUS</SymbolID>
|
||||
<ModelID>252</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>WCLAY</Code>
|
||||
<Text>HEW</Text>
|
||||
<SymbolID>S*G*EXMC</SymbolID>
|
||||
<ModelID>111</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
<Symbol>
|
||||
<Code>WIED</Code>
|
||||
<Text>IED</Text>
|
||||
<SymbolID>S*G*EXMC</SymbolID>
|
||||
<ModelID>707</ModelID>
|
||||
<EchelonID>0</EchelonID>
|
||||
<PlayerTypeID>0</PlayerTypeID>
|
||||
</Symbol>
|
||||
</Symbols>
|
||||
<Echelons>
|
||||
<Echelon>
|
||||
<ID>0</ID>
|
||||
<Code>UNK</Code>
|
||||
<Text>Unknown</Text>
|
||||
</Echelon>
|
||||
<Echelon>
|
||||
<ID>1</ID>
|
||||
<Code>TEAM</Code>
|
||||
<Text>Team/Crew</Text>
|
||||
</Echelon>
|
||||
<Echelon>
|
||||
<ID>2</ID>
|
||||
<Code>SQUAD</Code>
|
||||
<Text>Squad</Text>
|
||||
</Echelon>
|
||||
<Echelon>
|
||||
<ID>3</ID>
|
||||
<Code>SECT</Code>
|
||||
<Text>Section</Text>
|
||||
</Echelon>
|
||||
<Echelon>
|
||||
<ID>4</ID>
|
||||
<Code>PLT</Code>
|
||||
<Text>Platoon</Text>
|
||||
</Echelon>
|
||||
<Echelon>
|
||||
<ID>6</ID>
|
||||
<Code>COY</Code>
|
||||
<Text>Company</Text>
|
||||
</Echelon>
|
||||
<Echelon>
|
||||
<ID>8</ID>
|
||||
<Code>BN</Code>
|
||||
<Text>Battalion</Text>
|
||||
</Echelon>
|
||||
</Echelons>
|
||||
<Forces>
|
||||
<Force>
|
||||
<Code>UNK</Code>
|
||||
<Text>Unknown</Text>
|
||||
</Force>
|
||||
<Force>
|
||||
<Code>FR</Code>
|
||||
<Text>Bluefor</Text>
|
||||
</Force>
|
||||
<Force>
|
||||
<Code>HO</Code>
|
||||
<Text>Opfor</Text>
|
||||
</Force>
|
||||
<Force>
|
||||
<Code>NT</Code>
|
||||
<Text>Neutral</Text>
|
||||
</Force>
|
||||
</Forces>
|
||||
</Config>
|
||||
@@ -0,0 +1,281 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Last, SLSE, 2017-10-26
|
||||
*/
|
||||
#include "ppm_saab_edit.h"
|
||||
#include "ui_ppm_saab_edit.h"
|
||||
#include "saab/saab_import.h"
|
||||
#include "saab/saab_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
|
||||
{
|
||||
SAABEdit::SAABEdit(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_exmDtc(nullptr)
|
||||
, m_session(session)
|
||||
, m_pTreehandlerSystem(nullptr)
|
||||
, m_pTreehandlerImport(nullptr)
|
||||
, m_pModelSystem(nullptr)
|
||||
, m_pModelImport(nullptr)
|
||||
, m_ui(new Ui::SAABDialog)
|
||||
, m_logger(getLogger("SAABEdit"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &SAABEdit::onAddItem);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &SAABEdit::onEditItem);
|
||||
connect(m_ui->m_pushButton_Import, &QPushButton::clicked, this, &SAABEdit::onImport);
|
||||
connect(m_ui->m_pushButton_distypeEditor, &QPushButton::clicked, this, &SAABEdit::onDistypeEditor);
|
||||
connect(m_ui->m_pushButton_Export, &QPushButton::clicked, this, &SAABEdit::onExport);
|
||||
|
||||
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);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Import-Export_SAAB"));
|
||||
}
|
||||
|
||||
|
||||
SAABEdit::~SAABEdit()
|
||||
{
|
||||
delete m_pTreehandlerImport;
|
||||
delete m_pTreehandlerSystem;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
|
||||
void SAABEdit::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("SAAB Import/Export"));
|
||||
m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty, ForeignGuiComboboxInterface::CbxPartyFilter::NormalOc);
|
||||
}
|
||||
|
||||
|
||||
void SAABEdit::onDistypeEditor()
|
||||
{
|
||||
ParticipantManagement::DistypeEditor dialog(this, m_ppmDtc, m_ppmFtc);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void SAABEdit::onExport()
|
||||
{
|
||||
saab::ExportSaab dialog(m_session, m_ppmDtc, m_exmDtc->exercise(m_session->exerciseId()), this);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void SAABEdit::lock()
|
||||
{
|
||||
m_ui->cbParty->setEnabled(true); // true!!
|
||||
}
|
||||
|
||||
void SAABEdit::unlock()
|
||||
{
|
||||
m_ui->cbParty->setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
void SAABEdit::onImport()
|
||||
{
|
||||
m_pModelImport->resetModel();
|
||||
m_pModelImport->setMimeType(QStringLiteral("SAABDialog"));
|
||||
m_pModelSystem->setMimeType(QStringLiteral("SAABDialog"));
|
||||
saab::ImportSaab dialog(m_pModelImport, QModelIndex(), this, m_session);
|
||||
dialog.exec(); // TODO: use show(), use signals & slots !
|
||||
|
||||
m_pTreehandlerImport->beautifyTreeView(false);
|
||||
}
|
||||
|
||||
bool SAABEdit::init(const std::shared_ptr<ExerciseManagement::Interface::Dtc> &exmDtc,
|
||||
const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<ForeignGuiComboboxInterface> &ppmGuiCbxIfc)
|
||||
{
|
||||
if (!exmDtc || !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;
|
||||
}
|
||||
|
||||
if (!exmDtc->isExerciseEnabled())
|
||||
{
|
||||
if (!exmDtc->enableExercise())
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
m_exmDtc = exmDtc;
|
||||
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, &SAABEdit::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, &SAABEdit::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, &SAABEdit::onEditItem);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, m_pTreehandlerSystem, &ParticipantTreeEditHandler::onRemoveItem);
|
||||
connect(m_pTreehandlerSystem, &ParticipantTreeEditHandler::signalDoubleClicked, this, &SAABEdit::onEditItem);
|
||||
connect(m_pTreehandlerSystem, &ParticipantTreeEditHandler::signalSelectionChanged, this, &SAABEdit::onEnaDisa);
|
||||
connect(m_pTreehandlerSystem, &ParticipantTreeEditHandler::signalChangesMade, this, &SAABEdit::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 SAABEdit::onPartyChanged()
|
||||
{
|
||||
const int newPartyId = m_ui->cbParty->currentData().toInt();
|
||||
|
||||
if (hasUnsavedChanges())
|
||||
{
|
||||
switch (askApplyDiscardCancel())
|
||||
{
|
||||
case LtsWidgets::Button::Apply:
|
||||
if (!apply())
|
||||
return;
|
||||
__unchange__();
|
||||
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 SAABEdit::apply()
|
||||
{
|
||||
return m_pTreehandlerSystem->onApplyChanges();
|
||||
}
|
||||
|
||||
void SAABEdit::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->m_treeViewEdit_Left->setColumnsOrganiserEnabled(identifier(), true);
|
||||
m_ui->m_treeViewEdit_Right->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
|
||||
|
||||
void SAABEdit::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 SAABEdit::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 SAABEdit::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
|
||||
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Last, SLSE, 2017-10-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#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 SAABDialog;
|
||||
}
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
class ParticipantEditModel;
|
||||
class ParticipantTreeEditHandler;
|
||||
|
||||
class SAABEdit : public LtsWidgets::LtsDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SAABEdit(LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~SAABEdit();
|
||||
|
||||
bool init(const std::shared_ptr<ExerciseManagement::Interface::Dtc> &exmDtc,
|
||||
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 tableColumnOrganiserSetting() override;
|
||||
|
||||
protected slots:
|
||||
void onEnaDisa(); // enable/disable the widgets
|
||||
void onAddItem();
|
||||
void onEditItem();
|
||||
void onPartyChanged();
|
||||
void onImport();
|
||||
void onDistypeEditor();
|
||||
void onExport();
|
||||
void lock() override;
|
||||
void unlock() override;
|
||||
|
||||
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<ExerciseManagement::Interface::Dtc> m_exmDtc;
|
||||
std::shared_ptr<AdvancedSymbology::ForeignDataInterface> m_asb;
|
||||
LtsSession::LtsSession *m_session;
|
||||
|
||||
ParticipantTreeEditHandler *m_pTreehandlerSystem;
|
||||
ParticipantTreeEditHandler *m_pTreehandlerImport;
|
||||
|
||||
ParticipantEditModel *m_pModelSystem;
|
||||
ParticipantEditModel *m_pModelImport;
|
||||
|
||||
Ui::SAABDialog *m_ui;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} //ParticipantManagement
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SAABDialog</class>
|
||||
<widget class="QWidget" name="SAABDialog">
|
||||
<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="1" column="0" colspan="7">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="left" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="LtsDataView::LtsDataView" name="m_treeViewEdit_Left" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="right" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="LtsDataView::LtsDataView" name="m_treeViewEdit_Right" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<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="0" column="5">
|
||||
<widget class="QPushButton" name="m_pushButton_Export">
|
||||
<property name="text">
|
||||
<string>Export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<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_Import">
|
||||
<property name="text">
|
||||
<string>Import</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbParty">
|
||||
<property name="const" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</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,102 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Last, SLSE, 2017-10-26
|
||||
*/
|
||||
|
||||
#include "ppm_saab_gui_plugin.h"
|
||||
#include "ppm_saab_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.saab"))
|
||||
, m_pSession(session)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_ppmGuiCbxIfc(nullptr)
|
||||
, m_exmDtc(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;
|
||||
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void InterfaceImpl::clearInterfaces()
|
||||
{
|
||||
m_dtc = nullptr;
|
||||
m_ftc = nullptr;
|
||||
m_ppmGuiCbxIfc = nullptr;
|
||||
m_exmDtc = 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 enableSAAB_ImExport = ps->value(QStringLiteral("ppm"),
|
||||
QStringLiteral("enableMSDL_ImExport")).toBool();
|
||||
|
||||
if ((m_pSession->exerciseId() != 0) && enableSAAB_ImExport)
|
||||
{
|
||||
LtsWidgets::PluginData plData;
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("SAAB Import/Export");
|
||||
plData.identifier = QLatin1String("ppmsaabview");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:import_saab.svg"));
|
||||
plData.operatorRight = OperatorRights::Msdl::MsdlImportExport; // TODO!
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::ePlanning;
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowSAABEdit(parent);
|
||||
};
|
||||
ret.append(plData);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowSAABEdit(QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new ParticipantManagement::SAABEdit(m_session, parent),
|
||||
m_exmDtc, m_dtc, m_ftc, m_ppmGuiCbxIfc);
|
||||
}
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Fritsche, NLE, 2019-05-27
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ExerciseManagement/exm_data_plugin_interface.h>
|
||||
|
||||
#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_saab_import_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.saab")
|
||||
Q_INTERFACES(GuiPluginBase::Plugin)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
|
||||
QString pluginName() override { return QStringLiteral("ParticipantManagement.GuiPlugin.saab"); }
|
||||
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 ForeignSaabImportGuiInterface, 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 *onShowSAABEdit(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;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
|
||||
};
|
||||
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
@@ -0,0 +1,66 @@
|
||||
#
|
||||
# @RDE_HEADER@
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
|
||||
SET(zwmssaab_SRCS
|
||||
saab_export.cpp
|
||||
saab_export.h
|
||||
saab_import.cpp
|
||||
saab_import.h
|
||||
saab_import_show.cpp
|
||||
saab_import_show.h
|
||||
saab_logging.cpp
|
||||
saab_logging.h
|
||||
saab_mapping_dialog.cpp
|
||||
saab_mapping_dialog.h
|
||||
saab_map_type.cpp
|
||||
saab_map_type.h
|
||||
saab_map_party.cpp
|
||||
saab_map_party.h
|
||||
saab_types.cpp
|
||||
saab_types.h
|
||||
saab_xml_strings.h
|
||||
zwmssaab_export.h
|
||||
)
|
||||
|
||||
SET(zwmssaab_UICS
|
||||
ui/saab_import_show.ui
|
||||
ui/saab_export.ui
|
||||
ui/saab_map_type.ui
|
||||
ui/saab_map_party.ui
|
||||
ui/saab_import.ui
|
||||
ui/saab_mapping_dialog.ui
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(zwmssaab_SRCS ${zwmssaab_UICS})
|
||||
NGL_ADD_LIBRARY(WS zwmssaab SHARED ${zwmssaab_SRCS} ${zwmssaab_UICS} ${zwmssaab_IDLS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(zwmssaab
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
NGL_TARGET_LINK_LIBRARIES(zwmssaab
|
||||
PRIVATE
|
||||
Qt5::Gui
|
||||
Qt5::Xml
|
||||
Qt5::XmlPatterns
|
||||
PUBLIC
|
||||
svcPpmCommon
|
||||
LtsUtilsSettings
|
||||
LtsUtilsGuiDds
|
||||
LtsSession
|
||||
PpmDataPluginInterface
|
||||
PpmCommon
|
||||
ExmDataPluginInterface
|
||||
OpmDataPluginInterface
|
||||
LtsSessionData
|
||||
ngltools
|
||||
NGLLogger
|
||||
LtsWidgets
|
||||
Qt5::Core
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(zwmssaab)
|
||||
@@ -0,0 +1,620 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Exportieren von SAAB-Dateien
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_export.h"
|
||||
#include "ui_saab_export.h"
|
||||
#include "saab_xml_strings.h"
|
||||
#include "saab_map_type.h"
|
||||
#include "saab_map_party.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QDateTime>
|
||||
#include <QUuid>
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsUtils/LtsUtilsSettings/settings.h>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
|
||||
/*
|
||||
* QUuid::QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8)
|
||||
* Creates a UUID with the value specified by the parameters, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8.
|
||||
* General QUuid format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
* The vaues will be visualized in HEX-Code.
|
||||
|
||||
* Used QUuid Format: aaaaaaaa-bbbb-xxxx-ccxx-xxxxxxxxxxdd
|
||||
* a = Participant ID, Parameter: l
|
||||
* b = Exercise ID, Parameter: w1
|
||||
* c = Party ID, Parameter: b1
|
||||
* d = GUID Context, Parameter: b8
|
||||
* 1 = Exercise
|
||||
* 2 = Party
|
||||
* 3 = Participant
|
||||
* x = Unused, curretly filled with '0'
|
||||
*
|
||||
* Exercise format: xxxxxxxx-bbbb-xxxx-xxxx-xxxxxxxxxx01
|
||||
* Party format: xxxxxxxx-bbbb-xxxx-ccxx-xxxxxxxxxx02
|
||||
* Participant format: aaaaaaaa-bbbb.xxxx.ccxx-xxxxxxxxxx03
|
||||
*/
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
static const QString xmlnsValue(QStringLiteral("http://www.saab.se/training/schemas/ExerciseOrbat/1.1.1"));
|
||||
static const uint l = 0;
|
||||
static const ushort w1 = 0;
|
||||
static const ushort w2 = 0x88;
|
||||
static const uchar b1 = 0;
|
||||
static const uchar b2 = 0xde;
|
||||
static const uchar b3 = 0xad;
|
||||
static const uchar b4 = 0xbe;
|
||||
static const uchar b5 = 0xef;
|
||||
static const uchar b6 = 0x33;
|
||||
static const uchar b7 = 0x44;
|
||||
static const uchar b8 = 0;
|
||||
|
||||
ExportSaab::ExportSaab(LtsSession::LtsSession *session, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc, const ExerciseManagement::Exercise &exercise, QWidget *parent)
|
||||
: LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_currentExercise(exercise)
|
||||
, m_ppmDtc(ppmDtc)
|
||||
, m_session(session)
|
||||
, m_configFile(nullptr)
|
||||
, m_ui(new Ui_SAABExport)
|
||||
, m_logger(getLogger("ExportSaab"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->m_pushbutton_SelectConfig, &QToolButton::clicked,
|
||||
this, &ExportSaab::onSelectConfigFile);
|
||||
connect(m_ui->m_pushbutton_SelectFile, &QToolButton::clicked,
|
||||
this, &ExportSaab::onSelectExportFile);
|
||||
connect(m_ui->m_pushButton_StartImport, &QPushButton::clicked,
|
||||
this, &ExportSaab::onStartExport);
|
||||
|
||||
QString strExportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedExportFile"), QString()).toString();
|
||||
QString strConfigFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QString()).toString();
|
||||
|
||||
m_ui->m_lineedit_ExportFile->setText(strExportFile);
|
||||
m_ui->m_lineedit_ConfigFile->setText(strConfigFile);
|
||||
|
||||
m_ui->m_pushButton_StartImport->setEnabled(strExportFile.size() && strConfigFile.size());
|
||||
|
||||
m_parties = m_ppmDtc->partys();
|
||||
m_types = m_ppmDtc->types();
|
||||
}
|
||||
|
||||
ExportSaab::~ExportSaab()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void ExportSaab::onStartExport()
|
||||
{
|
||||
QString strExportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedExportFile"), QString()).toString();
|
||||
QString strConfigFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QString()).toString();
|
||||
|
||||
QFile file(strExportFile);
|
||||
|
||||
if (m_configFile)
|
||||
{
|
||||
m_configFile->close();
|
||||
delete m_configFile;
|
||||
m_configFile = nullptr;
|
||||
}
|
||||
|
||||
m_configFile = new QFile(strConfigFile, this);
|
||||
|
||||
if (!file.open(QIODevice::WriteOnly))
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. You do not have the permission to write the selected file."));
|
||||
ERROR_LOG(m_logger) << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidConfigFile())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. Config file invalid."));
|
||||
ERROR_LOG(m_logger) << "Could not export exercise: \"" << strConfigFile << "\" invalid";
|
||||
return;
|
||||
}
|
||||
|
||||
importConfig();
|
||||
|
||||
QXmlStreamWriter writer(&file);
|
||||
|
||||
writer.setAutoFormatting(true);
|
||||
writer.writeStartDocument();
|
||||
writer.writeStartElement(XmlStrings::SAAB_EXERCISE_ORBAT());
|
||||
writer.writeAttribute(XmlStrings::SAAB_XMLNS_XSI(), QStringLiteral("http://www.w3.org/2001/XMLSchema-instance"));
|
||||
writer.writeAttribute(XmlStrings::SAAB_XMLNS_XSD(), QStringLiteral("http://www.w3.org/2001/XMLSchema"));
|
||||
writer.writeAttribute(XmlStrings::SAAB_XMLNS(), xmlnsValue);
|
||||
|
||||
writeExercise(&writer);
|
||||
writeOrbat(&writer);
|
||||
writeFooter(&writer);
|
||||
|
||||
writer.writeEndElement();
|
||||
writer.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Export finished"));
|
||||
close();
|
||||
}
|
||||
|
||||
void ExportSaab::onSelectConfigFile()
|
||||
{
|
||||
QString strPathSelectedConfigFolder = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFolder"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
|
||||
QString strPathSelectedConfigFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
|
||||
|
||||
QList<QUrl> urls;
|
||||
urls << QUrl::fromLocalFile(strPathSelectedConfigFile);
|
||||
|
||||
QFileDialog fileDialog(this, tr("Select File"), strPathSelectedConfigFolder, tr("XML files (*.xml)"));
|
||||
fileDialog.setSidebarUrls(urls);
|
||||
fileDialog.setOptions(QFileDialog::ReadOnly);
|
||||
fileDialog.setFileMode(QFileDialog::ExistingFile);
|
||||
|
||||
if (fileDialog.exec()) // TODO: use show(), use signals & slots !
|
||||
{
|
||||
strPathSelectedConfigFile = fileDialog.selectedFiles().constFirst();
|
||||
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFolder"), strPathSelectedConfigFolder);
|
||||
|
||||
if (!strPathSelectedConfigFile.size())
|
||||
return;
|
||||
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), strPathSelectedConfigFile);
|
||||
m_ui->m_lineedit_ConfigFile->setText(strPathSelectedConfigFile);
|
||||
m_ui->m_pushButton_StartImport->setEnabled(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedExportFile"), QString()).toString().size());
|
||||
}
|
||||
}
|
||||
|
||||
void ExportSaab::onSelectExportFile()
|
||||
{
|
||||
QString strPathSelectedExportFolder = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedExportFolder"), QStringLiteral("/tmp")).toString();
|
||||
QString strPathSelectedExportFile = QFileDialog::getSaveFileName(this, tr("Export file"),
|
||||
strPathSelectedExportFolder,
|
||||
tr("XML files (*.xml)"));
|
||||
if (strPathSelectedExportFile.isEmpty())
|
||||
return;
|
||||
|
||||
strPathSelectedExportFolder = strPathSelectedExportFile.mid(0, strPathSelectedExportFile.lastIndexOf(QLatin1Char('/')));
|
||||
|
||||
QString suffix = QStringLiteral(".xml");
|
||||
|
||||
if (!strPathSelectedExportFile.endsWith(suffix))
|
||||
strPathSelectedExportFile += suffix;
|
||||
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedExportFolder"), strPathSelectedExportFolder);
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedExportFile"), strPathSelectedExportFile);
|
||||
|
||||
m_ui->m_lineedit_ExportFile->setText(strPathSelectedExportFile);
|
||||
m_ui->m_pushButton_StartImport->setEnabled(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QString()).toString().size());
|
||||
}
|
||||
|
||||
bool ExportSaab::isValidConfigFile()
|
||||
{
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return false;
|
||||
}
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
QXmlStreamReader reader(m_configFile);
|
||||
|
||||
bool hasSymbols = false;
|
||||
bool hasEchelons = false;
|
||||
bool hasForces = false;
|
||||
|
||||
while (!reader.atEnd() && !(hasSymbols && hasEchelons && hasForces))
|
||||
{
|
||||
if (reader.readNextStartElement())
|
||||
{
|
||||
if (reader.name() == SAAB_SYMBOLS())
|
||||
hasSymbols = true;
|
||||
else if (reader.name() == SAAB_ECHELONS())
|
||||
hasEchelons = true;
|
||||
else if (reader.name() == SAAB_FORCES())
|
||||
hasForces = true;
|
||||
}
|
||||
}
|
||||
|
||||
m_configFile->close();
|
||||
|
||||
if (!hasEchelons)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
if (!hasSymbols)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
if (!hasForces)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
|
||||
return hasEchelons && hasSymbols && hasForces;
|
||||
}
|
||||
|
||||
void ExportSaab::importConfig()
|
||||
{
|
||||
if (!m_mapSymbols.isEmpty() || !m_mapEchelons.isEmpty())
|
||||
{
|
||||
using namespace LtsWidgets;
|
||||
|
||||
Button b = LtsMessageDialog::showMessage(this,
|
||||
tr("A config is already imported. Overwrite?"),
|
||||
tr("Overwrite config?"),
|
||||
Behaviour::Modal,
|
||||
Button::Yes | Button::No);
|
||||
if (b != Button::Yes)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
}
|
||||
|
||||
m_mapSymbols.clear();
|
||||
m_mapEchelons.clear();
|
||||
m_mapTypeToSaabSymbol.clear();
|
||||
m_mapPartyToForce.clear();
|
||||
m_mapForces.clear();
|
||||
|
||||
QXmlStreamReader reader(m_configFile);
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (!reader.atEnd())
|
||||
{
|
||||
if (reader.readNextStartElement())
|
||||
{
|
||||
if (reader.name() == SAAB_SYMBOL())
|
||||
{
|
||||
SaabSymbol newSymbol = readSymbol(&reader);
|
||||
m_mapSymbols.insert(newSymbol.code, newSymbol);
|
||||
}
|
||||
else if (reader.name() == SAAB_ECHELON())
|
||||
{
|
||||
SaabEchelon newEchelon = readEchelon(&reader);
|
||||
m_mapEchelons.insert(newEchelon.code, newEchelon);
|
||||
}
|
||||
else if (reader.name() == SAAB_FORCE())
|
||||
{
|
||||
SaabForce newForce = readForce(&reader);
|
||||
m_mapForces.insert(newForce.text, newForce.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_configFile->close();
|
||||
|
||||
for (auto it = m_parties.constBegin(); it != m_parties.constEnd(); ++it)
|
||||
{
|
||||
if (m_mapForces.isEmpty())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("All Forces are mapped."));
|
||||
break;
|
||||
}
|
||||
|
||||
mapPartyToForce(it.value());
|
||||
}
|
||||
}
|
||||
|
||||
SaabSymbol ExportSaab::readSymbol(QXmlStreamReader *reader) const
|
||||
{
|
||||
SaabSymbol result;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (reader->readNext() != QXmlStreamReader::EndElement && reader->name() != SAAB_SYMBOL())
|
||||
{
|
||||
if (reader->name() == SAAB_CODE())
|
||||
result.code = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TEXT())
|
||||
result.text = reader->readElementText();
|
||||
else if (reader->name() == SAAB_SYMBOL_ID())
|
||||
result.symbolId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_MODEL_ID())
|
||||
result.modelId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_ECHELON_ID())
|
||||
result.echelonId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_PLAYER_TYPE_ID())
|
||||
result.playerTypeId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_COLOR())
|
||||
result.color = reader->readElementText();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabEchelon ExportSaab::readEchelon(QXmlStreamReader *reader) const
|
||||
{
|
||||
SaabEchelon result;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (reader->readNext() != QXmlStreamReader::EndElement && reader->name() != SAAB_ECHELON())
|
||||
{
|
||||
if (reader->name() == SAAB_CODE())
|
||||
result.code = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TEXT())
|
||||
result.text = reader->readElementText();
|
||||
else if (reader->name() == SAAB_ID())
|
||||
result.id = reader->readElementText();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabForce ExportSaab::readForce(QXmlStreamReader *reader) const
|
||||
{
|
||||
SaabForce result;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (reader->readNext() != QXmlStreamReader::EndElement && reader->name() != SAAB_FORCE())
|
||||
{
|
||||
if (reader->name() == SAAB_CODE())
|
||||
result.code = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TEXT())
|
||||
result.text = reader->readElementText();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void ExportSaab::writeExercise(QXmlStreamWriter *writer) const
|
||||
{
|
||||
using namespace XmlStrings;
|
||||
|
||||
writer->writeStartElement(SAAB_EXERCISE());
|
||||
writer->writeAttribute(SAAB_ID(), QUuid(l, m_currentExercise.id(), w2, b1, b2, b3, b4, b5, b6, b7, GuidContext::GuidExercise).toString(QUuid::WithoutBraces));
|
||||
|
||||
writer->writeTextElement(SAAB_EXPORT_TIME(), toSaabTime(m_session->partitionTime()));
|
||||
writer->writeTextElement(SAAB_PLANNED_START_TIME(), toSaabTime(m_currentExercise.beginTime()));
|
||||
writer->writeTextElement(SAAB_PLANNED_STOP_TIME(), toSaabTime(m_currentExercise.endTime()));
|
||||
writer->writeTextElement(SAAB_DESIGNATION(), QString::fromStdString(m_currentExercise.name()));
|
||||
writer->writeTextElement(SAAB_DESCRIPTION(), QString::fromStdString(m_currentExercise.description()));
|
||||
writer->writeTextElement(SAAB_WIND_SPEED(), QStringLiteral("0"));
|
||||
writer->writeTextElement(SAAB_WIND_DIRECTION(), QStringLiteral("0"));
|
||||
writer->writeEmptyElement(SAAB_EVALUATION_PACKAGE_FILE_NAME());
|
||||
writer->writeTextElement(SAAB_EXERCISE_STATE(), QStringLiteral("0"));
|
||||
|
||||
writer->writeEndElement();
|
||||
}
|
||||
|
||||
void ExportSaab::writeOrbat(QXmlStreamWriter *writer)
|
||||
{
|
||||
using namespace XmlStrings;
|
||||
|
||||
writer->writeStartElement(SAAB_ORBAT());
|
||||
|
||||
QMap<int, ParticipantManagement::Participant> participants = m_ppmDtc->participants();
|
||||
|
||||
for (auto it = m_mapPartyToForce.constBegin(); it != m_mapPartyToForce.constEnd(); ++it)
|
||||
{
|
||||
SaabPlayer *player = toSaabPlayer(m_parties.value(it.key()), participants);
|
||||
|
||||
player->writeToXml(writer);
|
||||
|
||||
delete player;
|
||||
player = nullptr;
|
||||
}
|
||||
|
||||
writer->writeEndElement();
|
||||
}
|
||||
|
||||
void ExportSaab::writeFooter(QXmlStreamWriter *writer) const
|
||||
{
|
||||
using namespace XmlStrings;
|
||||
|
||||
writer->writeEmptyElement(SAAB_PERSONS());
|
||||
writer->writeEmptyElement(SAAB_VEHICLES());
|
||||
writer->writeEmptyElement(SAAB_HELICOPTERS());
|
||||
}
|
||||
|
||||
SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Party &party, QMap<int, ParticipantManagement::Participant> &remainingParticipants)
|
||||
{
|
||||
SaabPlayer *result;
|
||||
|
||||
result = new SaabUnit;
|
||||
|
||||
result->symbol = m_mapPartyToForce.value(party.id()).symbolCode;
|
||||
static_cast<SaabUnit *>(result)->unitSize = m_mapPartyToForce.value(party.id()).echelonCode;
|
||||
result->designation = QString::fromStdString(party.name());
|
||||
result->trashcan = false;
|
||||
result->isExternalPlayer = true;
|
||||
result->force = m_mapPartyToForce.value(party.id()).forceCode;
|
||||
result->guid = QUuid(l, m_currentExercise.id(), w2, static_cast<uchar>(party.id()), b2, b3, b4, b5, b6, b7, GuidContext::GuidParty).toString(QUuid::WithoutBraces);
|
||||
|
||||
QList<int> keys = remainingParticipants.keys();
|
||||
|
||||
// add the root units/participants
|
||||
for (int key : qAsConst(keys))
|
||||
{
|
||||
if (!remainingParticipants.contains(key))
|
||||
continue;
|
||||
|
||||
ParticipantManagement::Participant participant = remainingParticipants.value(key);
|
||||
|
||||
if (!(participant.partyId() == party.id() && participant.superiorId() == 0))
|
||||
continue;
|
||||
|
||||
SaabPlayer *player = toSaabPlayer(participant, remainingParticipants);
|
||||
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
static_cast<SaabUnit *>(result)->inferiors.append(player);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &participant, QMap<int, ParticipantManagement::Participant> &remainingParticipants)
|
||||
{
|
||||
if (participant.isDeleted())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participant.id() << " id deleted --> skipping";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (participant.externalId())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SaabPlayer *result;
|
||||
|
||||
ParticipantManagement::Type type = m_types.value(participant.typeId());
|
||||
|
||||
if (!m_mapTypeToSaabSymbol.contains(type.id()))
|
||||
mapType(type);
|
||||
|
||||
switch (type.typeClass().underlying())
|
||||
{
|
||||
case ParticipantManagement::TypeClass::SupportEntity: // OC Player
|
||||
result = new SaabOcPlayer;
|
||||
break;
|
||||
case ParticipantManagement::TypeClass::Human: // Person Player
|
||||
result = new SaabPersonPlayer;
|
||||
break;
|
||||
case ParticipantManagement::TypeClass::GroundVehicle: // Vehicle Player
|
||||
case ParticipantManagement::TypeClass::VehicleWithGear:
|
||||
case ParticipantManagement::TypeClass::WeaponSystem:
|
||||
result = new SaabVehiclePlayer;
|
||||
break;
|
||||
case ParticipantManagement::TypeClass::Unit: // Unit
|
||||
case ParticipantManagement::TypeClass::SupportUnit:
|
||||
{
|
||||
result = new SaabUnit;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Reading unit with " << participant.inferiorIds().size() << " inferiors";
|
||||
|
||||
for (int32_t id : participant.inferiorIds())
|
||||
{
|
||||
SaabPlayer *player = toSaabPlayer(remainingParticipants.value(id), remainingParticipants);
|
||||
|
||||
if (player == nullptr)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Skipping inferior with id " << id;
|
||||
continue;
|
||||
}
|
||||
|
||||
static_cast<SaabUnit *>(result)->inferiors.append(player);
|
||||
}
|
||||
|
||||
// do not export empty units
|
||||
if (!static_cast<SaabUnit *>(result)->inferiors.size())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Unit " << participant.id() << " has no inferiors.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ParticipantManagement::TypeClass::Vessel: // we do not support that for export atm
|
||||
case ParticipantManagement::TypeClass::Aircraft:
|
||||
case ParticipantManagement::TypeClass::Unknown:
|
||||
default:
|
||||
DEBUG_LOG(m_logger) << "Type " << participant.typeId() << " is not supported.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString symbol = m_mapTypeToSaabSymbol.value(type.id());
|
||||
|
||||
if (typeid(*result) == typeid(SaabUnit))
|
||||
{
|
||||
QStringList symbolUnitSize = symbol.split(QLatin1Char(';'));
|
||||
|
||||
result->symbol = symbolUnitSize.at(0);
|
||||
static_cast<SaabUnit *>(result)->unitSize = symbolUnitSize.at(1);
|
||||
}
|
||||
else
|
||||
result->symbol = symbol;
|
||||
|
||||
result->designation = QString::fromStdString(participant.designator());
|
||||
result->trashcan = participant.isDeleted();
|
||||
result->rank = QStringLiteral("OF1");
|
||||
result->isExternalPlayer = true;
|
||||
if (participant.equipmentNumber().is_set())
|
||||
result->simulatorId = participant.equipmentNumber().get();
|
||||
result->force = m_mapPartyToForce.value(participant.partyId()).forceCode;
|
||||
result->guid = QUuid(participant.id(), m_currentExercise.id(), w2, static_cast<uchar>(participant.partyId()), b2, b3, b4, b5, b6, b7, GuidContext::GuidParticipant).toString(QUuid::WithoutBraces);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ParticipantManagement::Participant ExportSaab::rootParticipant(const ParticipantManagement::Participant &participant, const QMap<int, ParticipantManagement::Participant> &participants) const
|
||||
{
|
||||
if (participant.superiorId())
|
||||
return rootParticipant(participants.value(participant.superiorId()), participants);
|
||||
return participant;
|
||||
}
|
||||
|
||||
QString ExportSaab::toSaabTime(qint64 msecs) const
|
||||
{
|
||||
return QDateTime::fromMSecsSinceEpoch(msecs).toString(QStringLiteral("yyyy-MM-ddThh:mm:ssZ"));
|
||||
}
|
||||
|
||||
void ExportSaab::mapType(const ParticipantManagement::Type &type)
|
||||
{
|
||||
using namespace ParticipantManagement;
|
||||
|
||||
MapType dialog(ParticipantManagement::trTypeName(type.name()),
|
||||
m_mapEchelons,
|
||||
m_mapSymbols,
|
||||
type.typeClass() == TypeClass::Unit || type.typeClass() == TypeClass::SupportUnit,
|
||||
this);
|
||||
|
||||
dialog.exec();
|
||||
|
||||
QString saabTypeStr = dialog.symbolCode();
|
||||
|
||||
if (!dialog.echelonCode().isEmpty())
|
||||
{
|
||||
saabTypeStr.append(QLatin1Char(';'));
|
||||
saabTypeStr.append(dialog.echelonCode());
|
||||
}
|
||||
|
||||
m_mapTypeToSaabSymbol.insert(type.id(), saabTypeStr);
|
||||
}
|
||||
|
||||
void ExportSaab::mapPartyToForce(const ParticipantManagement::Party &party)
|
||||
{
|
||||
MapParty dialog(QString::fromStdString(party.name()), m_mapForces, m_mapEchelons, m_mapSymbols, this);
|
||||
|
||||
dialog.exec();
|
||||
|
||||
if (dialog.isSkipped())
|
||||
return;
|
||||
|
||||
m_mapPartyToForce.insert(party.id(), { m_mapForces.take(dialog.force()), dialog.echelonCode(), dialog.symbolCode() });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Exportieren von SAAB-Dateien
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "saab_logging.h"
|
||||
#include "zwmssaab_export.h"
|
||||
#include "saab_types.h"
|
||||
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <ExerciseManagement/exm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
|
||||
#include <QFile>
|
||||
|
||||
class QXmlStreamWriter;
|
||||
class QXmlStreamReader;
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
class Ui_SAABExport;
|
||||
|
||||
namespace saab
|
||||
{
|
||||
class ZWMSSAAB_EXPORT ExportSaab
|
||||
: public LtsWidgets::LtsFramelessDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ExportSaab(LtsSession::LtsSession *session,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
|
||||
const ExerciseManagement::Exercise &exercise,
|
||||
QWidget *parent = nullptr);
|
||||
virtual ~ExportSaab();
|
||||
|
||||
public Q_SLOTS:
|
||||
void onStartExport();
|
||||
void onSelectConfigFile();
|
||||
void onSelectExportFile();
|
||||
|
||||
private: // other
|
||||
struct MappedPartyInfo
|
||||
{
|
||||
QString forceCode;
|
||||
QString echelonCode;
|
||||
QString symbolCode;
|
||||
};
|
||||
|
||||
enum GuidContext
|
||||
{
|
||||
GuidExercise = 1,
|
||||
GuidParty = 2,
|
||||
GuidParticipant = 3
|
||||
};
|
||||
|
||||
private: // methods
|
||||
bool isValidConfigFile();
|
||||
void importConfig();
|
||||
SaabSymbol readSymbol(QXmlStreamReader *reader) const;
|
||||
SaabEchelon readEchelon(QXmlStreamReader *reader) const;
|
||||
SaabForce readForce(QXmlStreamReader *reader) const;
|
||||
void writeExercise(QXmlStreamWriter *writer) const;
|
||||
void writeOrbat(QXmlStreamWriter *writer);
|
||||
void writeFooter(QXmlStreamWriter *writer) const;
|
||||
SaabPlayer *toSaabPlayer(const ParticipantManagement::Party &party,
|
||||
QMap<int, ParticipantManagement::Participant> &remainingParticipants);
|
||||
SaabPlayer *toSaabPlayer(const ParticipantManagement::Participant &participant,
|
||||
QMap<int, ParticipantManagement::Participant> &remainingParticipants);
|
||||
ParticipantManagement::Participant rootParticipant(const ParticipantManagement::Participant &participant,
|
||||
const QMap<int, ParticipantManagement::Participant> &participants) const;
|
||||
QString toSaabTime(qint64 msecs) const;
|
||||
void mapType(const ParticipantManagement::Type &type);
|
||||
void mapPartyToForce(const ParticipantManagement::Party &party);
|
||||
|
||||
private: // attributes
|
||||
QMap<int32_t, MappedPartyInfo> m_mapPartyToForce;
|
||||
QMap<int32_t, QString> m_mapTypeToSaabSymbol; // <SAAB symbol.code, type.id>
|
||||
QMap<QString, SaabSymbol> m_mapSymbols;
|
||||
QMap<QString, SaabEchelon> m_mapEchelons;
|
||||
QMap<int, ParticipantManagement::Type> m_types;
|
||||
QMap<int, ParticipantManagement::Party> m_parties;
|
||||
QMap<QString, QString> m_mapForces;
|
||||
ExerciseManagement::Exercise m_currentExercise;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
LtsSession::LtsSession *m_session;
|
||||
QFile *m_configFile;
|
||||
Ui_SAABExport *m_ui;
|
||||
saab::LOGGER_T m_logger;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,790 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Importieren von SAAB-Dateien
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_import.h"
|
||||
#include "ui_saab_import.h"
|
||||
#include "saab_logging.h"
|
||||
#include "saab_import_show.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
#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 "saab_mapping_dialog.h"
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
ImportSaab::ImportSaab(ParticipantManagement::ParticipantEditModel *pModel, const QModelIndex &index, QWidget *parent, LtsSession::LtsSession *pSession)
|
||||
: NGLDialog(parent)
|
||||
, m_xmlFile(nullptr)
|
||||
, m_configFile(nullptr)
|
||||
, m_indexRoot(index)
|
||||
, m_pModel(pModel)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_pUi(new Ui_SAABImport)
|
||||
, m_logger(saab::getLogger("ImportSaab"))
|
||||
{
|
||||
m_pUi->setupUi(this);
|
||||
setWindowTitle(tr("Import SAAB Orbat"));
|
||||
|
||||
if (!pSession->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) || !pSession->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Fetching m_ppmDtc or m_ppmFtc failed!";
|
||||
setEnabled(false);
|
||||
}
|
||||
else
|
||||
m_mapTypes = m_ppmDtc->types();
|
||||
|
||||
connect(m_pUi->m_pushbutton_SelectFile, &QToolButton::clicked,
|
||||
this, &ImportSaab::slotOpenImportDialog);
|
||||
connect(m_pUi->m_pushbutton_SelectConfig, &QToolButton::clicked,
|
||||
this, &ImportSaab::slotOpenConfigDialog);
|
||||
connect(m_pUi->m_pushButton_StartImport, &QPushButton::clicked,
|
||||
this, &ImportSaab::slotStartImport);
|
||||
|
||||
QString strImportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedImportFile"), QString()).toString();
|
||||
QString strConfigFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QString()).toString();
|
||||
|
||||
m_pUi->m_lineedit_ImportFile->setText(strImportFile);
|
||||
m_pUi->m_lineedit_configFile->setText(strConfigFile);
|
||||
|
||||
m_pUi->m_pushButton_StartImport->setEnabled(strImportFile.size() && strConfigFile.size());
|
||||
}
|
||||
|
||||
|
||||
ImportSaab::~ImportSaab()
|
||||
{
|
||||
delete m_pUi;
|
||||
}
|
||||
|
||||
|
||||
void ImportSaab::slotOpenImportDialog()
|
||||
{
|
||||
QString strPathSelectedImportFolder = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedImportFolder"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
|
||||
QString strPathSelectedImportFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), 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("SAAB"), QStringLiteral("pathSelectedImportFolder"), strPathSelectedImportFolder);
|
||||
|
||||
if (!strPathSelectedImportFile.size())
|
||||
return;
|
||||
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedImportFile"), strPathSelectedImportFile);
|
||||
m_pUi->m_lineedit_ImportFile->setText(strPathSelectedImportFile);
|
||||
m_pUi->m_pushButton_StartImport->setEnabled(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QString()).toString().size());
|
||||
}
|
||||
}
|
||||
|
||||
void ImportSaab::slotOpenConfigDialog()
|
||||
{
|
||||
QString strPathSelectedConfigFolder = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFolder"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
|
||||
QString strPathSelectedConfigFile = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), QStringLiteral("/shd/CTC/TOOLS/TDS/")).toString();
|
||||
|
||||
QList<QUrl> urls;
|
||||
urls << QUrl::fromLocalFile(strPathSelectedConfigFile);
|
||||
|
||||
QFileDialog fileDialog(this, tr("Select File"), strPathSelectedConfigFolder, tr("XML files (*.xml)"));
|
||||
fileDialog.setSidebarUrls(urls);
|
||||
fileDialog.setOptions(QFileDialog::ReadOnly);
|
||||
fileDialog.setFileMode(QFileDialog::ExistingFile);
|
||||
|
||||
if (fileDialog.exec()) // TODO: use show(), use signals & slots !
|
||||
{
|
||||
strPathSelectedConfigFile = fileDialog.selectedFiles().constFirst();
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFolder"), strPathSelectedConfigFolder);
|
||||
|
||||
if (!strPathSelectedConfigFile.size())
|
||||
return;
|
||||
|
||||
LtsUtils::OperatorSettings::getInstance()->setValue(QStringLiteral("SAAB"), QStringLiteral("pathSelectedConfigFile"), strPathSelectedConfigFile);
|
||||
m_pUi->m_lineedit_configFile->setText(strPathSelectedConfigFile);
|
||||
m_pUi->m_pushButton_StartImport->setEnabled(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("SAAB"), QStringLiteral("pathSelectedImportFile"), QString()).toString().size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ImportSaab::slotStartImport()
|
||||
{
|
||||
if (m_xmlFile)
|
||||
{
|
||||
m_xmlFile->close();
|
||||
delete m_xmlFile;
|
||||
m_xmlFile = nullptr;
|
||||
}
|
||||
|
||||
if (m_configFile)
|
||||
{
|
||||
m_configFile->close();
|
||||
delete m_configFile;
|
||||
m_configFile = nullptr;
|
||||
}
|
||||
|
||||
m_pModel->resetModel();
|
||||
|
||||
QString fileName = m_pUi->m_lineedit_ImportFile->text();
|
||||
QString configFileName = m_pUi->m_lineedit_configFile->text();
|
||||
|
||||
m_xmlFile = new QFile(fileName, this);
|
||||
m_configFile = new QFile(configFileName, this);
|
||||
|
||||
if (!isValidSaabOrbatFile())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error while reading file \"%1\".").arg(fileName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidConfigFile())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error while reading file \"%1\".").arg(configFileName));
|
||||
return;
|
||||
}
|
||||
|
||||
importExerciseScenario();
|
||||
}
|
||||
|
||||
ParticipantManagement::ParticipantData ImportSaab::createParticipant(SaabPlayer *player)
|
||||
{
|
||||
ParticipantManagement::ParticipantData p;
|
||||
|
||||
// Note: According to Uli D., in GÜZ, TactId shall be static and
|
||||
// received from SAAB and designator shall be freely changeable.
|
||||
|
||||
// Designator
|
||||
p.tacticalIdentifier(player->designation.toStdString());
|
||||
|
||||
// State and Equipment
|
||||
p.equipmentNumber(player->simulatorId != INT_MIN ? player->simulatorId : 0);
|
||||
p.assignState() = ParticipantManagement::ParticipantAssignState::HandoutExcon;
|
||||
|
||||
if (player->simulatorId != INT_MIN)
|
||||
p.externalId(player->simulatorId);
|
||||
|
||||
p.symbol(m_mapTypes[player->mappedTypeId].symbol());
|
||||
p.typeId(player->mappedTypeId); // Class type is internally derived from typeid, no need (and possibility) to set it here
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void ImportSaab::insertParticipant(SaabPlayer *player, const QModelIndex &index)
|
||||
{
|
||||
ParticipantManagement::ParticipantData newParticipant = createParticipant(player);
|
||||
createNode(newParticipant, index, player);
|
||||
}
|
||||
|
||||
// Parties are the root units (m_rootUnits)
|
||||
void ImportSaab::insertParty(SaabUnit *party)
|
||||
{
|
||||
// Create "Force"-Node -> No symbol, no tact. identifier, no classtype
|
||||
ParticipantManagement::ParticipantData newParty;
|
||||
newParty.designator(party->designation.toStdString());
|
||||
createNode(newParty, m_indexRoot, party);
|
||||
}
|
||||
|
||||
|
||||
void ImportSaab::createNode(const ParticipantManagement::ParticipantData &participant, const QModelIndex &index, SaabPlayer *parent)
|
||||
{
|
||||
int newRow = m_pModel->onInsertRow(index, participant);
|
||||
QModelIndex newIdx = m_pModel->index(newRow, 0, index);
|
||||
m_parentIndexCache[parent] = newIdx;
|
||||
}
|
||||
|
||||
SaabPerson ImportSaab::saabPersonByGUID(const QString &guid) const
|
||||
{
|
||||
for (const auto ¤t : qAsConst(m_saabPersons))
|
||||
{
|
||||
if (current.guid == guid)
|
||||
return current;
|
||||
}
|
||||
|
||||
return SaabPerson();
|
||||
}
|
||||
|
||||
SaabVehicle ImportSaab::saabVehicleByGUID(const QString &guid) const
|
||||
{
|
||||
for (const auto ¤t : qAsConst(m_saabVehicles))
|
||||
{
|
||||
if (current.guid == guid)
|
||||
return current;
|
||||
}
|
||||
|
||||
return SaabVehicle();
|
||||
}
|
||||
|
||||
void ImportSaab::importOrbat()
|
||||
{
|
||||
if (!m_xmlFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_xmlFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \""
|
||||
<< m_xmlFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
}
|
||||
|
||||
QXmlStreamReader reader(m_xmlFile);
|
||||
|
||||
qDeleteAll(m_rootUnits);
|
||||
m_rootUnits.clear();
|
||||
m_unknownTypes.clear();
|
||||
|
||||
while (!(reader.readNext() == QXmlStreamReader::EndElement && reader.name() == XmlStrings::SAAB_ORBAT()))
|
||||
{
|
||||
if (reader.atEnd())
|
||||
break;
|
||||
|
||||
if (reader.tokenType() == QXmlStreamReader::StartElement && reader.name() == XmlStrings::SAAB_UNIT())
|
||||
{
|
||||
SaabUnit *unit = static_cast<SaabUnit *>(readUnit(&reader));
|
||||
|
||||
if (unit->isDeletedByDefault)
|
||||
continue;
|
||||
|
||||
m_rootUnits.append(unit);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
for (SaabUnit *u : qAsConst(m_rootUnits))
|
||||
DEBUG_LOG(m_logger) << u->toString();
|
||||
}
|
||||
|
||||
m_xmlFile->close();
|
||||
}
|
||||
|
||||
void ImportSaab::importConfig()
|
||||
{
|
||||
if (!m_mapSymbols.isEmpty() || !m_mapEchelons.isEmpty())
|
||||
{
|
||||
using namespace LtsWidgets;
|
||||
|
||||
Button b = LtsMessageDialog::showMessage(this,
|
||||
tr("A config is already imported. Overwrite?"),
|
||||
tr("Overwrite config?"),
|
||||
Behaviour::Modal,
|
||||
Button::Yes | Button::No);
|
||||
if (b != Button::Yes)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
}
|
||||
|
||||
m_mapSymbols.clear();
|
||||
m_mapEchelons.clear();
|
||||
m_mapSaabSymbolToType.clear();
|
||||
|
||||
QXmlStreamReader reader(m_configFile);
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (!reader.atEnd())
|
||||
{
|
||||
if (reader.readNextStartElement())
|
||||
{
|
||||
if (reader.name() == SAAB_SYMBOL())
|
||||
{
|
||||
SaabSymbol newSymbol = readSymbol(&reader);
|
||||
m_mapSymbols.insert(newSymbol.code, newSymbol);
|
||||
}
|
||||
else if (reader.name() == SAAB_ECHELON())
|
||||
{
|
||||
SaabEchelon newEchelon = readEchelon(&reader);
|
||||
m_mapEchelons.insert(newEchelon.code, newEchelon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_configFile->close();
|
||||
}
|
||||
|
||||
QVector<SaabPlayer *> ImportSaab::flattenedPlayersWithoutRootUnits() const
|
||||
{
|
||||
QVector<SaabPlayer *> result;
|
||||
|
||||
for (SaabUnit *p : qAsConst(m_rootUnits))
|
||||
{
|
||||
QVector<SaabPlayer *> inferiorInferiors = inferiors(p);
|
||||
|
||||
for (SaabPlayer *infInf : qAsConst(inferiorInferiors))
|
||||
result.append(infInf);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QVector<SaabPlayer *> ImportSaab::inferiors(SaabPlayer *player) const
|
||||
{
|
||||
QVector<SaabPlayer *> result;
|
||||
|
||||
if (typeid(*player) != typeid(SaabUnit))
|
||||
{
|
||||
result.append(player);
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabUnit *unit = static_cast<SaabUnit *>(player);
|
||||
|
||||
if (!m_rootUnits.contains(unit))
|
||||
result.append(player);
|
||||
|
||||
for (SaabPlayer *inf : qAsConst(unit->inferiors))
|
||||
{
|
||||
QVector<SaabPlayer *> inferiorInferiors = inferiors(inf);
|
||||
for (SaabPlayer *infInf : qAsConst(inferiorInferiors))
|
||||
result.append(infInf);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
SaabUnit *result = new SaabUnit;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
QMap<QString, SaabPlayer*(ImportSaab::*)(QXmlStreamReader *)const> funcMap;
|
||||
funcMap.insert(SAAB_PERSON_PLAYER(), &ImportSaab::readPersonPlayer);
|
||||
funcMap.insert(SAAB_OC_PLAYER(), &ImportSaab::readOcPlayer);
|
||||
funcMap.insert(SAAB_VEHICLE_PLAYER(), &ImportSaab::readVehiclePlayer);
|
||||
funcMap.insert(SAAB_UNIT(), &ImportSaab::readUnit);
|
||||
|
||||
result->guid = reader->attributes().value(SAAB_ID()).toString();
|
||||
|
||||
while (!(reader->readNext() == QXmlStreamReader::EndElement && reader->name() == SAAB_UNIT()))
|
||||
{
|
||||
if (reader->tokenType() == QXmlStreamReader::StartElement)
|
||||
{
|
||||
if (reader->name() == SAAB_DESIGNATION())
|
||||
result->designation = reader->readElementText();
|
||||
else if (reader->name() == SAAB_FORCE())
|
||||
result->force = reader->readElementText();
|
||||
else if (reader->name() == SAAB_SYMBOL())
|
||||
result->symbol = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TRASHCAN())
|
||||
result->trashcan = reader->readElementText() == SAAB_TRUE();
|
||||
else if (reader->name() == SAAB_POSITION_BY_PLAYER_ID())
|
||||
result->positionByPlayerId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_UNIT_SIZE())
|
||||
result->unitSize = reader->readElementText();
|
||||
else if (reader->name() == SAAB_CHANGE_INFO())
|
||||
result->isDeletedByDefault = reader->attributes().value(SAAB_CHANGE_TYPE()).toString() == SAAB_DELETE();
|
||||
else if (reader->name() == SAAB_ORBAT_ENTITIES())
|
||||
{
|
||||
while (!(reader->readNext() == QXmlStreamReader::EndElement && reader->name() == SAAB_ORBAT_ENTITIES()))
|
||||
{
|
||||
QString tagName = reader->name().toString();
|
||||
if (reader->tokenType() == QXmlStreamReader::StartElement && funcMap.contains(tagName))
|
||||
{
|
||||
SaabPlayer *newParticipant = (this->*funcMap.value(tagName))(reader);
|
||||
|
||||
if (newParticipant->isDeletedByDefault || newParticipant->isExternalPlayer)
|
||||
continue;
|
||||
|
||||
newParticipant->superior = result;
|
||||
result->inferiors.append(newParticipant);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if the unit has to take the position of a specific participant,
|
||||
// take the participant to the top of the inferiors
|
||||
if (!result->positionByPlayerId.isEmpty())
|
||||
{
|
||||
int index = playerIndexByGuid(result->guid, result->inferiors);
|
||||
|
||||
if (index < 0)
|
||||
WARNING_LOG(m_logger) << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found.";
|
||||
else
|
||||
result->inferiors.prepend(result->inferiors.takeAt(index));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabPlayer *ImportSaab::readOcPlayer(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
return readPersonOcPlayer<SaabOcPlayer>(reader, XmlStrings::SAAB_OC_PLAYER());;
|
||||
}
|
||||
|
||||
SaabPlayer *ImportSaab::readPersonPlayer(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
return readPersonOcPlayer<SaabPersonPlayer>(reader, XmlStrings::SAAB_PERSON_PLAYER());
|
||||
}
|
||||
|
||||
SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
SaabVehiclePlayer *result = readPlayerBaseData<SaabVehiclePlayer>(reader, SAAB_VEHICLE_PLAYER(), SAAB_VEHICLE_REF_ID());
|
||||
|
||||
if (!result->refId.isEmpty())
|
||||
{
|
||||
SaabVehicle vehicle = saabVehicleByGUID(reader->readElementText());
|
||||
|
||||
if (vehicle.guid.isEmpty())
|
||||
WARNING_LOG(m_logger) << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found.";
|
||||
else
|
||||
{
|
||||
result->registrationNumber = vehicle.registrationNumber;
|
||||
result->description = vehicle.description;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabSymbol ImportSaab::readSymbol(QXmlStreamReader *reader) const
|
||||
{
|
||||
SaabSymbol result;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (reader->readNext() != QXmlStreamReader::EndElement && reader->name() != SAAB_SYMBOL())
|
||||
{
|
||||
if (reader->name() == SAAB_CODE())
|
||||
result.code = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TEXT())
|
||||
result.text = reader->readElementText();
|
||||
else if (reader->name() == SAAB_SYMBOL_ID())
|
||||
result.symbolId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_MODEL_ID())
|
||||
result.modelId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_ECHELON_ID())
|
||||
result.echelonId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_PLAYER_TYPE_ID())
|
||||
result.playerTypeId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_COLOR())
|
||||
result.color = reader->readElementText();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SaabEchelon ImportSaab::readEchelon(QXmlStreamReader *reader) const
|
||||
{
|
||||
SaabEchelon result;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (reader->readNext() != QXmlStreamReader::EndElement && reader->name() != SAAB_ECHELON())
|
||||
{
|
||||
if (reader->name() == SAAB_CODE())
|
||||
result.code = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TEXT())
|
||||
result.text = reader->readElementText();
|
||||
else if (reader->name() == SAAB_ID())
|
||||
result.id = reader->readElementText();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int ImportSaab::playerIndexByGuid(const QString &guid, const QVector<SaabPlayer *> &vec)
|
||||
{
|
||||
for (int i = 0; i < vec.size(); ++i)
|
||||
{
|
||||
if (vec.at(i)->guid == guid)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ImportSaab::importExerciseScenario()
|
||||
{
|
||||
using namespace XmlStrings;
|
||||
|
||||
importConfig();
|
||||
importRefData(m_saabPersons, SAAB_PERSONS(), SAAB_PERSON(), SAAB_PERSONAL_ID(), SAAB_NAME()); // import persons
|
||||
importRefData(m_saabVehicles, SAAB_VEHICLES(), SAAB_VEHICLE(), SAAB_REGISTRATION_NUMBER(), SAAB_DESCRIPTION()); // import vehicles
|
||||
importOrbat();
|
||||
|
||||
for (SaabUnit *party : qAsConst(m_rootUnits))
|
||||
insertParty(party);
|
||||
|
||||
QVector<SaabPlayer *> vecUnitsWithValidDISTypes = resolveImportMapping(flattenedPlayersWithoutRootUnits());
|
||||
|
||||
if (!vecUnitsWithValidDISTypes.size())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("There are no units or participants which can be imported."), tr("Import Warning"));
|
||||
return;
|
||||
}
|
||||
|
||||
buildImportTreeView(vecUnitsWithValidDISTypes);
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
void ImportSaab::buildImportTreeView(const QVector<SaabPlayer *> &vecUnitsWithValidDISTypes)
|
||||
{
|
||||
QVector<SaabPlayer *> tmp;
|
||||
QVector<SaabPlayer *> current = vecUnitsWithValidDISTypes;
|
||||
do
|
||||
{
|
||||
for (SaabPlayer *player : current)
|
||||
{
|
||||
auto it = m_parentIndexCache.find(player->superior);
|
||||
|
||||
if (it == m_parentIndexCache.end())
|
||||
{
|
||||
// check if the parent exists in vecUnitsWithValidDISTypes for the next approach
|
||||
if (vecUnitsWithValidDISTypes.contains(player->superior))
|
||||
tmp.append(player);
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Parent missing: Could not import player " << player->designation;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
QModelIndex &parentIdx = (*it);
|
||||
insertParticipant(player, parentIdx);
|
||||
}
|
||||
|
||||
current = tmp;
|
||||
tmp.clear();
|
||||
} while (!current.isEmpty());
|
||||
}
|
||||
|
||||
bool ImportSaab::isValidSaabOrbatFile() const
|
||||
{
|
||||
if (!m_xmlFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_xmlFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \""
|
||||
<< m_xmlFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasExerciseOrbatRoot = false;
|
||||
bool hasExercise = false;
|
||||
bool hasOrbat = false;
|
||||
|
||||
QXmlStreamReader reader(m_xmlFile);
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
while (!(hasExerciseOrbatRoot && hasExercise && hasOrbat) && !reader.atEnd())
|
||||
{
|
||||
if (reader.readNextStartElement())
|
||||
{
|
||||
if (reader.name() == SAAB_EXERCISE_ORBAT())
|
||||
hasExerciseOrbatRoot = true;
|
||||
else if (reader.name() == SAAB_EXERCISE())
|
||||
hasExercise = true;
|
||||
else if (reader.name() == SAAB_ORBAT())
|
||||
hasOrbat = true;
|
||||
}
|
||||
}
|
||||
|
||||
m_xmlFile->close();
|
||||
|
||||
if (!hasExerciseOrbatRoot)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
if (!hasExercise)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
if (!hasOrbat)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
|
||||
return hasExerciseOrbatRoot && hasExercise && hasOrbat;
|
||||
}
|
||||
|
||||
bool ImportSaab::isValidConfigFile() const
|
||||
{
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return false;
|
||||
}
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
QXmlStreamReader reader(m_configFile);
|
||||
|
||||
bool hasSymbols = false;
|
||||
bool hasEchelons = false;
|
||||
|
||||
while (!reader.atEnd() && !(hasSymbols && hasEchelons))
|
||||
{
|
||||
if (reader.readNextStartElement())
|
||||
{
|
||||
if (reader.name() == SAAB_SYMBOLS())
|
||||
hasSymbols = true;
|
||||
else if (reader.name() == SAAB_ECHELONS())
|
||||
hasEchelons = true;
|
||||
}
|
||||
}
|
||||
|
||||
m_configFile->close();
|
||||
|
||||
if (!hasEchelons)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
if (!hasSymbols)
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
|
||||
return hasEchelons && hasSymbols;
|
||||
}
|
||||
|
||||
bool ImportSaab::hasValidType(SaabPlayer *player) const
|
||||
{
|
||||
return m_mapSymbols.value(player->symbol).mappedTypeId > -1;
|
||||
}
|
||||
|
||||
QVector<SaabPlayer *> ImportSaab::resolveImportMapping(const QVector<SaabPlayer *> &playerVec)
|
||||
{
|
||||
QVector<SaabPlayer *> vecObjectsWithValidTypes;
|
||||
QMap<QString, QVector<SaabPlayer *>> mapParticipantsWithUnknownType, mapUnitsWithUnknownType;
|
||||
|
||||
// first perform a mapping of saab type to rme type
|
||||
for (SaabPlayer *player : playerVec)
|
||||
{
|
||||
if (!hasValidType(player))
|
||||
{
|
||||
if (typeid(*player) == typeid(SaabUnit))
|
||||
{
|
||||
QString text = m_mapSymbols.contains(player->symbol) ? m_mapSymbols.value(player->symbol).text : player->symbol;
|
||||
QString unitSize = static_cast<SaabUnit *>(player)->unitSize;
|
||||
text.append(tr(" - Size: %1").arg(m_mapEchelons.contains(unitSize) ? m_mapEchelons.value(unitSize).text : unitSize));
|
||||
mapUnitsWithUnknownType[text].append(player);
|
||||
}
|
||||
else
|
||||
mapParticipantsWithUnknownType[m_mapSymbols.contains(player->symbol) ? m_mapSymbols.value(player->symbol).text : player->symbol].append(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
// A match between the imported unit (its DIS id) and one of the database types exists: Perform mapping, everything is fine.
|
||||
vecObjectsWithValidTypes.append(player);
|
||||
}
|
||||
}
|
||||
|
||||
if (mapUnitsWithUnknownType.size())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("<b>Units</b> exist whose external type is unknown.<br/>You have to solve this by manually mapping<br/> the external types to existing <b>unit types</b>."), tr("Import Error"));
|
||||
vecObjectsWithValidTypes.append(showMappingDialog(mapUnitsWithUnknownType, true));
|
||||
}
|
||||
|
||||
if (mapParticipantsWithUnknownType.size())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("<b>Participants</b> exist whose external type is unknown.<br/>You have to solve this by manually mapping<br/> the external types to existing <b>participant types</b>."), tr("Import Error"));
|
||||
vecObjectsWithValidTypes.append(showMappingDialog(mapParticipantsWithUnknownType, false));
|
||||
}
|
||||
|
||||
return vecObjectsWithValidTypes;
|
||||
}
|
||||
|
||||
|
||||
QVector<SaabPlayer *> ImportSaab::showMappingDialog(const QMap<QString, QVector<SaabPlayer *>> &mapConflictMap, bool typeClassIsUnit)
|
||||
{
|
||||
QVector<SaabPlayer *> vecUnitsWithValidSymbols;
|
||||
|
||||
int32_t mappedTypeId = 0;
|
||||
|
||||
for (auto it = mapConflictMap.begin(); it != mapConflictMap.end(); ++it)
|
||||
{
|
||||
const QString &strSaabSymbol = it.key();
|
||||
const QVector<SaabPlayer *> &vecData = it.value();
|
||||
|
||||
QString strReason;
|
||||
bool offerDatabaseEntriesWithoutDISType;
|
||||
|
||||
if (!strSaabSymbol.size())
|
||||
{
|
||||
strReason = QString(tr("No 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 type \"%1\" is unknown.")).arg(strSaabSymbol);
|
||||
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);
|
||||
|
||||
saab::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.mappingApplied())
|
||||
{
|
||||
m_mapSaabSymbolToType.insert(strSaabSymbol, mappedTypeId);
|
||||
|
||||
for (SaabPlayer *participant : qAsConst(vecData))
|
||||
{
|
||||
participant->mappedTypeId = mappedTypeId;
|
||||
vecUnitsWithValidSymbols.push_back(participant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return vecUnitsWithValidSymbols;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Klasse fuer das Importieren von SAAB-Dateien
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nglwidgets/ngldialog.h>
|
||||
#include "saab_logging.h"
|
||||
#include "saab_types.h"
|
||||
#include "zwmssaab_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>
|
||||
|
||||
#include <QXmlStreamReader>
|
||||
#include <QFile>
|
||||
#include "saab_xml_strings.h"
|
||||
|
||||
class QXmlStreamReader;
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
class Ui_SAABImport;
|
||||
|
||||
namespace saab
|
||||
{
|
||||
class ImportSaabShow;
|
||||
|
||||
class ZWMSSAAB_EXPORT ImportSaab : public NGLDialog, protected ParticipantManagement::Interface::Ftc::ModifyTypeReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ImportSaab(ParticipantManagement::ParticipantEditModel *pModel, const QModelIndex &index, QWidget *parent, LtsSession::LtsSession *pSession);
|
||||
virtual ~ImportSaab();
|
||||
|
||||
private slots:
|
||||
void slotOpenImportDialog();
|
||||
void slotOpenConfigDialog();
|
||||
void slotStartImport();
|
||||
|
||||
private: // methods
|
||||
void onModifyTypeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
ParticipantManagement::ParticipantData createParticipant(SaabPlayer *player);
|
||||
void insertParticipant(SaabPlayer *player, const QModelIndex &index);
|
||||
void insertParty(SaabUnit *party);
|
||||
void createNode(const ParticipantManagement::ParticipantData &participant, const QModelIndex &index, SaabPlayer *parent);
|
||||
SaabPerson saabPersonByGUID(const QString &guid) const;
|
||||
SaabVehicle saabVehicleByGUID(const QString &guid) const;
|
||||
void importOrbat();
|
||||
void importConfig();
|
||||
QVector<SaabPlayer *> flattenedPlayersWithoutRootUnits() const;
|
||||
QVector<SaabPlayer *> inferiors(SaabPlayer *player) const;
|
||||
SaabPlayer *readUnit(QXmlStreamReader *reader) const;
|
||||
SaabPlayer *readOcPlayer(QXmlStreamReader *reader) const;
|
||||
SaabPlayer *readPersonPlayer(QXmlStreamReader *reader) const;
|
||||
SaabPlayer *readVehiclePlayer(QXmlStreamReader *reader) const;
|
||||
SaabSymbol readSymbol(QXmlStreamReader *reader) const;
|
||||
SaabEchelon readEchelon(QXmlStreamReader *reader) const;
|
||||
static int playerIndexByGuid(const QString &guid, const QVector<SaabPlayer *> &vec);
|
||||
void importExerciseScenario();
|
||||
QVector<SaabPlayer *> resolveImportMapping(const QVector<SaabPlayer *> &playerVec);
|
||||
QVector<SaabPlayer *> showMappingDialog(const QMap<QString, QVector<SaabPlayer *> > &mapConflictMap, bool typeClassIsUnit);
|
||||
void buildImportTreeView(const QVector<SaabPlayer *> &vecUnitsWithValidDISTypes);
|
||||
bool isValidSaabOrbatFile() const;
|
||||
bool isValidConfigFile() const;
|
||||
bool hasValidType(SaabPlayer *player) const;
|
||||
|
||||
// import vehicles and persons
|
||||
template <typename T>
|
||||
void importRefData(QVector<T> &vec,
|
||||
const QString &parentTag,
|
||||
const QString &childTag,
|
||||
const QString &firstDataTag,
|
||||
const QString &secondDataTag) // TODO: better naming
|
||||
{
|
||||
vec.clear();
|
||||
|
||||
if (!m_xmlFile)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to import " << parentTag << ": No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_xmlFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to import " << parentTag << ": Could not open file \""
|
||||
<< m_xmlFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
}
|
||||
|
||||
QXmlStreamReader reader(m_xmlFile);
|
||||
|
||||
while (!reader.atEnd())
|
||||
{
|
||||
if (reader.readNextStartElement() && reader.name() == parentTag)
|
||||
{
|
||||
QXmlStreamReader::TokenType currentToken;
|
||||
|
||||
do
|
||||
{
|
||||
currentToken = reader.readNext();
|
||||
|
||||
if (reader.name() == childTag && currentToken == QXmlStreamReader::StartElement)
|
||||
{
|
||||
QString guid = reader.attributes().value(XmlStrings::SAAB_ID()).toString();
|
||||
|
||||
do
|
||||
{
|
||||
if (!reader.readNextStartElement())
|
||||
break;
|
||||
|
||||
}
|
||||
while (reader.name().toString() != firstDataTag);
|
||||
|
||||
QString value = reader.readElementText();
|
||||
|
||||
do
|
||||
{
|
||||
if (!reader.readNextStartElement())
|
||||
break;
|
||||
|
||||
}
|
||||
while (reader.name().toString() != secondDataTag);
|
||||
|
||||
vec.append({ guid, value, reader.readElementText() });
|
||||
}
|
||||
|
||||
}
|
||||
while (currentToken != QXmlStreamReader::EndElement || reader.name() != parentTag);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
for (const T ¤t : qAsConst(vec))
|
||||
DEBUG_LOG(m_logger) << childTag << ": " << current.toString();
|
||||
}
|
||||
|
||||
m_xmlFile->close();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *readPlayerBaseData(QXmlStreamReader *reader, const QString &mainTag, const QString &refTag) const
|
||||
{
|
||||
T *result = new T;
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
result->guid = reader->attributes().value(SAAB_ID()).toString();
|
||||
|
||||
while (!(reader->readNext() == QXmlStreamReader::EndElement && reader->name() == mainTag))
|
||||
{
|
||||
if (reader->tokenType() != QXmlStreamReader::StartElement)
|
||||
continue;
|
||||
|
||||
if (reader->name() == SAAB_DESIGNATION())
|
||||
result->designation = reader->readElementText();
|
||||
else if (reader->name() == SAAB_FORCE())
|
||||
result->force = reader->readElementText();
|
||||
else if (reader->name() == SAAB_SYMBOL())
|
||||
result->symbol = reader->readElementText();
|
||||
else if (reader->name() == SAAB_TRASHCAN())
|
||||
result->trashcan = reader->readElementText() == SAAB_TRUE();
|
||||
else if (reader->name() == refTag)
|
||||
result->refId = reader->readElementText();
|
||||
else if (reader->name() == SAAB_CHANGE_INFO())
|
||||
result->isDeletedByDefault = reader->attributes().value(SAAB_CHANGE_TYPE()).toString() == SAAB_DELETE();
|
||||
else if (reader->name() == SAAB_SIMULATOR_ID())
|
||||
result->simulatorId = reader->readElementText().toInt();
|
||||
else if (reader->name() == SAAB_EXTERNAL_PLAYER())
|
||||
result->isExternalPlayer = reader->readElementText() == SAAB_TRUE();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *readPersonOcPlayer(QXmlStreamReader *reader, const QString &mainTag) const
|
||||
{
|
||||
T *result = readPlayerBaseData<T>(reader, mainTag, XmlStrings::SAAB_PERSON_REF_ID());
|
||||
|
||||
if (!result->refId.isEmpty())
|
||||
{
|
||||
SaabPerson person = saabPersonByGUID(result->refId);
|
||||
|
||||
if (person.guid.isEmpty())
|
||||
WARNING_LOG(m_logger) << XmlStrings::SAAB_PERSON_REF_ID() << " set, but GUID " << result->refId << " could not be found.";
|
||||
else
|
||||
{
|
||||
result->personalID = person.personalID;
|
||||
result->name = person.name;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private: // attributes
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ppmFtc;
|
||||
QVector<SaabPerson> m_saabPersons;
|
||||
QVector<SaabVehicle> m_saabVehicles;
|
||||
QVector<SaabUnit *> m_rootUnits;
|
||||
QFile *m_xmlFile;
|
||||
QFile *m_configFile;
|
||||
QMap<QString, int32_t> m_mapSaabSymbolToType; // <SAAB symbol.code, type.id>
|
||||
QMap<QString, QVector<SaabPlayer *> > m_unknownTypes; // <Symbol (from SAAB xml), saab players with the symbol Symbol>
|
||||
QMap<qint32, ParticipantManagement::Type> m_mapTypes; // E.g. participant id "47" to type id
|
||||
QMap<QString, SaabSymbol> m_mapSymbols;
|
||||
QMap<QString, SaabEchelon> m_mapEchelons;
|
||||
QMap<SaabPlayer *, QModelIndex> m_parentIndexCache; // Used to create the treeview with the imported participants
|
||||
QModelIndex m_indexRoot; // Used to append parties/forces to the tree
|
||||
ParticipantManagement::ParticipantEditModel *m_pModel;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
Ui_SAABImport *m_pUi;
|
||||
saab::LOGGER_T m_logger;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Den Inhalt von SAAB-Dateien anzeigen
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_import_show.h"
|
||||
#include "ui_saab_import_show.h"
|
||||
#include <QMenu>
|
||||
#include <QFile>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
|
||||
#include <nglwidgets/nglstandardbutton.h>
|
||||
|
||||
using namespace saab;
|
||||
|
||||
ImportSaabShow::ImportSaabShow(QWidget *parent, const QString &xmlFile)
|
||||
: NGLDialog(parent)
|
||||
, mImportFile(xmlFile)
|
||||
, mCollapsedAll(true)
|
||||
, mExpandedAll(false)
|
||||
, mLogger(getLogger("ImportSaabShow"))
|
||||
{
|
||||
mUi.setupUi(this);
|
||||
|
||||
setWindowTitle(tr("Exercise Scenario"));
|
||||
move(50, 50);
|
||||
|
||||
// ButtonBox
|
||||
connect(mUi.buttonBox, &NGLDialogButtonBox::onClose,
|
||||
this, &ImportSaabShow::onClose);
|
||||
|
||||
mUi.treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(mUi.treeWidget, &QTreeWidget::customContextMenuRequested,
|
||||
this, &ImportSaabShow::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 ImportSaabShow::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 ImportSaabShow::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 ImportSaabShow::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 ImportSaabShow::onClose()
|
||||
{
|
||||
INFO_LOG(mLogger) << "ON close() ";
|
||||
accept();
|
||||
emit signalDialogClose(this);
|
||||
}
|
||||
|
||||
|
||||
void ImportSaabShow::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, &ImportSaabShow::slotCustomContextMenuActionTriggered);
|
||||
menu->exec(mUi.treeWidget->mapToGlobal(p));
|
||||
delete menu;
|
||||
}
|
||||
|
||||
|
||||
void ImportSaabShow::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,67 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Klasse zum Anzeigen von SAAB-Dateien
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtXml/QDomDocument>
|
||||
#include <QtXmlPatterns/QAbstractMessageHandler>
|
||||
#include <nglwidgets/ngldialog.h>
|
||||
#include "saab_logging.h"
|
||||
|
||||
#include "ui_saab_import_show.h"
|
||||
|
||||
|
||||
namespace saab
|
||||
{
|
||||
class SchemaMessageHandler : public QAbstractMessageHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SchemaMessageHandler(QObject *parent = nullptr)
|
||||
: QAbstractMessageHandler(parent)
|
||||
, mLogger(getLogger("SchemaMessageHandler"))
|
||||
{}
|
||||
~SchemaMessageHandler()
|
||||
{}
|
||||
protected:
|
||||
void handleMessage(QtMsgType type,
|
||||
const QString &description,
|
||||
const QUrl &identifier = QUrl(),
|
||||
const QSourceLocation &sourceLocation = QSourceLocation());
|
||||
private:
|
||||
LOGGER_T mLogger;
|
||||
};
|
||||
|
||||
class ImportSaabShow : public NGLDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ImportSaabShow(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_SAABImportShow mUi;
|
||||
QString mImportFile;
|
||||
bool mCollapsedAll;
|
||||
bool mExpandedAll;
|
||||
LOGGER_T &mLogger;
|
||||
};
|
||||
} // namespace ZWMSSAAB
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "saab_logging.h"
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
LOGGER_T getLogger(const char *name)
|
||||
{
|
||||
static const QLatin1String zwmssaab("NGL.ZWMSSAAB.");
|
||||
std::string loggerName;
|
||||
const size_t len = strlen(name);
|
||||
loggerName.reserve(zwmssaab.size() + len);
|
||||
loggerName.append(zwmssaab.data(), zwmssaab.size());
|
||||
loggerName.append(name, len);
|
||||
|
||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().
|
||||
getNGLLogger(loggerName);
|
||||
}
|
||||
|
||||
} // namespace ZWMSSAAB
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* WiSi - logging facility
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
typedef NGL::INGLLogger &LOGGER_T;
|
||||
|
||||
LOGGER_T getLogger(const char *name);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_map_party.h"
|
||||
#include "ui_saab_map_party.h"
|
||||
|
||||
#include "saab_map_type.h"
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
MapParty::MapParty(const QString &partyName,
|
||||
const QMap<QString, QString> &forces, const QMap<QString, SaabEchelon> &echelons, const QMap<QString, SaabSymbol> &symbols,
|
||||
QWidget *parent)
|
||||
: LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_skipped(false)
|
||||
, m_ui(new Ui_MapParty)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->lblText->setText(tr("Party <b>%1</b> needs to be mapped:").arg(partyName));
|
||||
|
||||
QList<QString> forcesList = forces.keys();
|
||||
|
||||
std::sort(forcesList.begin(), forcesList.end());
|
||||
|
||||
for (const QString ¤t : qAsConst(forcesList))
|
||||
m_ui->cbForce->addItem(current);
|
||||
|
||||
QList<SaabEchelon> echelonList = echelons.values();
|
||||
|
||||
sortList(echelonList);
|
||||
|
||||
for (const SaabEchelon ¤t : qAsConst(echelonList))
|
||||
m_ui->cbEchelon->addItem(current.text, current.code);
|
||||
|
||||
QList<SaabSymbol> symbolList = symbols.values();
|
||||
|
||||
sortList(symbolList);
|
||||
|
||||
for (const SaabSymbol ¤t : qAsConst(symbolList))
|
||||
m_ui->cbSymbol->addItem(current.text, current.code);
|
||||
|
||||
connect(m_ui->pbApply, &QPushButton::clicked,
|
||||
this, &MapParty::close);
|
||||
connect(m_ui->pbSkip, &QPushButton::clicked,
|
||||
this, [this]()
|
||||
{
|
||||
m_skipped = true;
|
||||
close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
MapParty::~MapParty()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
QString MapParty::force() const
|
||||
{
|
||||
if (!m_ui->cbForce->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbForce->currentText();
|
||||
}
|
||||
|
||||
QString MapParty::echelonCode() const
|
||||
{
|
||||
if (!m_ui->cbEchelon->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbEchelon->currentData().toString();
|
||||
}
|
||||
|
||||
QString MapParty::symbolCode() const
|
||||
{
|
||||
if (!m_ui->cbSymbol->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbSymbol->currentData().toString();
|
||||
}
|
||||
|
||||
bool saab::MapParty::isSkipped() const
|
||||
{
|
||||
return m_skipped;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "zwmssaab_export.h"
|
||||
#include "saab_types.h"
|
||||
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
|
||||
class Ui_MapParty;
|
||||
|
||||
namespace saab
|
||||
{
|
||||
class ZWMSSAAB_EXPORT MapParty
|
||||
: public LtsWidgets::LtsFramelessDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MapParty(const QString &partyName,
|
||||
const QMap<QString, QString> &forces,
|
||||
const QMap<QString, SaabEchelon> &echelons,
|
||||
const QMap<QString, SaabSymbol> &symbols,
|
||||
QWidget *parent = nullptr);
|
||||
virtual ~MapParty();
|
||||
|
||||
bool isSkipped() const;
|
||||
|
||||
QString force() const;
|
||||
QString echelonCode() const;
|
||||
QString symbolCode() const;
|
||||
|
||||
private: // methods
|
||||
template <typename T>
|
||||
void sortList(QList<T> &list)
|
||||
{
|
||||
std::sort(list.begin(), list.end(), [](const T &a, const T& b){ return (a.text < b.text); });
|
||||
}
|
||||
|
||||
private: // attributes
|
||||
bool m_skipped;
|
||||
Ui_MapParty *m_ui;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_map_type.h"
|
||||
#include "ui_saab_map_type.h"
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
MapType::MapType(const QString &text, const QMap<QString, SaabEchelon> &echelons, const QMap<QString, SaabSymbol> &symbols, bool isUnit, QWidget *parent)
|
||||
: LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_ui(new Ui_MapType)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
if (isUnit)
|
||||
m_ui->lblText->setText(tr("The Unit-type <b>%2</b> needs to be mapped:").arg(text));
|
||||
else
|
||||
m_ui->lblText->setText(tr("The Participant-type <b>%2</b> needs to be mapped:").arg(text));
|
||||
|
||||
if (!isUnit)
|
||||
{
|
||||
m_ui->cbEchelon->hide();
|
||||
m_ui->label_2->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
QList<SaabEchelon> echelonList = echelons.values();
|
||||
|
||||
sortList(echelonList);
|
||||
|
||||
for (const SaabEchelon ¤t : qAsConst(echelonList))
|
||||
m_ui->cbEchelon->addItem(current.text, current.code);
|
||||
}
|
||||
|
||||
QList<SaabSymbol> symbolList = symbols.values();
|
||||
|
||||
sortList(symbolList);
|
||||
|
||||
for (const SaabSymbol ¤t : qAsConst(symbolList))
|
||||
m_ui->cbSymbol->addItem(current.text, current.code);
|
||||
|
||||
connect(m_ui->pbApply, &QPushButton::clicked,
|
||||
this, &MapType::close);
|
||||
}
|
||||
|
||||
|
||||
MapType::~MapType()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
QString MapType::echelonCode() const
|
||||
{
|
||||
if (!m_ui->cbEchelon->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbEchelon->currentData().toString();
|
||||
}
|
||||
|
||||
QString MapType::symbolCode() const
|
||||
{
|
||||
if (!m_ui->cbSymbol->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbSymbol->currentData().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "zwmssaab_export.h"
|
||||
#include "saab_types.h"
|
||||
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
|
||||
class Ui_MapType;
|
||||
|
||||
namespace saab
|
||||
{
|
||||
class ZWMSSAAB_EXPORT MapType
|
||||
: public LtsWidgets::LtsFramelessDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MapType(const QString &typeName,
|
||||
const QMap<QString, SaabEchelon> &echelons,
|
||||
const QMap<QString, SaabSymbol> &symbols,
|
||||
bool isUnit,
|
||||
QWidget *parent = nullptr);
|
||||
virtual ~MapType();
|
||||
|
||||
QString echelonCode() const;
|
||||
QString symbolCode() const;
|
||||
|
||||
private: // methods
|
||||
template <typename T>
|
||||
void sortList(QList<T> &list)
|
||||
{
|
||||
std::sort(list.begin(), list.end(), [](const T &a, const T& b){ return (a.text < b.text); });
|
||||
}
|
||||
|
||||
private: // attributes
|
||||
Ui_MapType *m_ui;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_mapping_dialog.h"
|
||||
#include "ui_saab_mapping_dialog.h"
|
||||
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <set>
|
||||
|
||||
namespace saab
|
||||
{
|
||||
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(saab::getLogger("SAABMappingDialog"))
|
||||
, m_ppmDtc(ppmDtc)
|
||||
, mUi(new Ui_SAABMappingDialog)
|
||||
{
|
||||
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 SAAB data!";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (type.isDeleted())
|
||||
continue;
|
||||
|
||||
const ParticipantManagement::TypeClass typeClassId = type.typeClass();
|
||||
|
||||
if (typeClassId == ParticipantManagement::TypeClass::Unknown ||
|
||||
typeClassId == ParticipantManagement::TypeClass::Vessel ||
|
||||
typeClassId == ParticipantManagement::TypeClass::Aircraft)
|
||||
continue;
|
||||
|
||||
if (typeClassIsUnit)
|
||||
{
|
||||
if (typeClassId != ParticipantManagement::TypeClass::Unit && typeClassId != ParticipantManagement::TypeClass::SupportUnit)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeClassId == ParticipantManagement::TypeClass::Unit || typeClassId == ParticipantManagement::TypeClass::SupportUnit)
|
||||
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.isDeleted())
|
||||
continue;
|
||||
|
||||
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 SAAB 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;
|
||||
}
|
||||
|
||||
int32_t MappingDialog::getMappedTypeId() const
|
||||
{
|
||||
int index = mUi->m_ltsComboBox_type->currentData().toInt();
|
||||
return m_mapTypes[index].id();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "saab_logging.h"
|
||||
|
||||
#include <memory>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
|
||||
class Ui_SAABMappingDialog;
|
||||
|
||||
namespace saab
|
||||
{
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
saab::LOGGER_T mLogger;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
Ui_SAABMappingDialog *mUi;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#include "saab_types.h"
|
||||
#include <QRegularExpression>
|
||||
#include <QStringList>
|
||||
#include <QXmlStreamWriter>
|
||||
#include "saab_xml_strings.h"
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
bool SaabPlayer::hasDisType() const
|
||||
{
|
||||
return !disType.isEmpty();
|
||||
}
|
||||
|
||||
QString SaabPlayer::attrs() const
|
||||
{
|
||||
return QStringLiteral("guid: %1 | designation: %2 | force: %3 | symbol: %4 | trashcan: %5")
|
||||
.arg(guid, designation, force, symbol, trashcan ? QStringLiteral("true") : QStringLiteral("false"));
|
||||
}
|
||||
|
||||
void SaabPlayer::writeBaseInfo(const QString &startTag, QXmlStreamWriter *writer, bool isUnit) const
|
||||
{
|
||||
using namespace XmlStrings;
|
||||
|
||||
writer->writeStartElement(startTag);
|
||||
writer->writeAttribute(SAAB_ID(), guid);
|
||||
|
||||
writer->writeTextElement(SAAB_DESIGNATION(), designation);
|
||||
writer->writeTextElement(SAAB_FORCE(), force);
|
||||
writer->writeTextElement(SAAB_COLOR(), QStringLiteral("0"));
|
||||
writer->writeTextElement(SAAB_SYMBOL(), symbol);
|
||||
if (!isUnit)
|
||||
{
|
||||
if (simulatorId != INT_MIN)
|
||||
writer->writeTextElement(SAAB_SIMULATOR_ID(), QString::number(simulatorId));
|
||||
writer->writeTextElement(SAAB_FIXED_POSITION(), SAAB_FALSE());
|
||||
writer->writeTextElement(SAAB_EXTERNAL_PLAYER(), SAAB_FALSE());
|
||||
writer->writeTextElement(SAAB_RANK(), rank);
|
||||
}
|
||||
writer->writeTextElement(SAAB_TRASHCAN(), trashcan ? SAAB_TRUE() : SAAB_FALSE());
|
||||
}
|
||||
|
||||
QString SaabPersonPlayer::toString() const
|
||||
{
|
||||
return QStringLiteral("Person Player: ( %1 | personalID: %2 | name: %3)").arg(attrs(), personalID, name);
|
||||
}
|
||||
|
||||
void SaabPersonPlayer::writeToXml(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writeBaseInfo(XmlStrings::SAAB_PERSON_PLAYER(), writer);
|
||||
|
||||
writer->writeEndElement();
|
||||
}
|
||||
|
||||
QString SaabVehiclePlayer::toString() const
|
||||
{
|
||||
return QStringLiteral("Vehicle Player: ( %1 | registrationNumber: %2 | description: %3)").arg(attrs(), registrationNumber, description);
|
||||
}
|
||||
|
||||
void SaabVehiclePlayer::writeToXml(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writeBaseInfo(XmlStrings::SAAB_VEHICLE_PLAYER(), writer);
|
||||
|
||||
writer->writeTextElement(XmlStrings::SAAB_ORIENTATION(), QStringLiteral("0"));
|
||||
writer->writeEndElement();
|
||||
}
|
||||
|
||||
QString SaabUnit::toString() const
|
||||
{
|
||||
return toStringWithDepth(1);
|
||||
}
|
||||
|
||||
QString SaabUnit::toStringWithDepth(int depth) const
|
||||
{
|
||||
QString result = QStringLiteral("Unit: ( %1 | unitSize: %2 | positionByPlayerID: %3 | inferiors:\n").arg(attrs(), unitSize, positionByPlayerId);
|
||||
QString spaces;
|
||||
|
||||
for (int i = 0; i <= depth; ++i)
|
||||
spaces.append(QStringLiteral(" "));
|
||||
|
||||
for (SaabPlayer *current : qAsConst(inferiors))
|
||||
{
|
||||
SaabUnit *unit = dynamic_cast<SaabUnit *>(current);
|
||||
QString line = QStringLiteral("%1|\n%1+-- %2\n")
|
||||
.arg(spaces, (unit ? unit->toStringWithDepth(depth + 1) : current->toString()));
|
||||
|
||||
result.append(line);
|
||||
}
|
||||
|
||||
result.append(spaces + QLatin1Char(')'));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void SaabUnit::writeToXml(QXmlStreamWriter *writer) const
|
||||
{
|
||||
using namespace XmlStrings;
|
||||
|
||||
writeBaseInfo(SAAB_UNIT(), writer);
|
||||
|
||||
writer->writeTextElement(SAAB_ORIGINAL_CREATION_ID(), guid);
|
||||
writer->writeTextElement(SAAB_UNIT_SIZE(), unitSize);
|
||||
writer->writeStartElement(SAAB_ORBAT_ENTITIES());
|
||||
|
||||
if (!inferiors.isEmpty())
|
||||
{
|
||||
for (SaabPlayer *player : qAsConst(inferiors))
|
||||
player->writeToXml(writer);
|
||||
}
|
||||
|
||||
writer->writeEndElement();
|
||||
writer->writeEndElement();
|
||||
}
|
||||
|
||||
QString SaabOcPlayer::toString() const
|
||||
{
|
||||
QString result = SaabPersonPlayer::toString();
|
||||
|
||||
result.remove(0, 6);
|
||||
result.prepend(QStringLiteral("OC"));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void SaabOcPlayer::writeToXml(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writeBaseInfo(XmlStrings::SAAB_OC_PLAYER(), writer);
|
||||
|
||||
writer->writeEndElement();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Typen fuer das Importieren von SAAB-Dateien
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
#include <QString>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <QVector>
|
||||
|
||||
class QXmlStreamWriter;
|
||||
|
||||
namespace saab
|
||||
{
|
||||
struct SaabSymbol
|
||||
{
|
||||
QString code;
|
||||
QString text;
|
||||
QString symbolId;
|
||||
QString modelId;
|
||||
QString echelonId;
|
||||
QString playerTypeId;
|
||||
QString color;
|
||||
qint32 mappedTypeId = -1;
|
||||
};
|
||||
|
||||
struct SaabForce
|
||||
{
|
||||
QString code;
|
||||
QString text;
|
||||
};
|
||||
|
||||
|
||||
struct SaabEchelon
|
||||
{
|
||||
QString id;
|
||||
QString code;
|
||||
QString text;
|
||||
};
|
||||
|
||||
struct SAABParty
|
||||
{
|
||||
QString m_ownHandle;
|
||||
QString m_forceSideName;
|
||||
};
|
||||
|
||||
struct SaabVehicle
|
||||
{
|
||||
QString guid;
|
||||
QString registrationNumber;
|
||||
QString description;
|
||||
|
||||
SaabVehicle() = default;
|
||||
SaabVehicle(const QString &guid, const QString ®istrationNumber, const QString &description)
|
||||
: guid(guid)
|
||||
, registrationNumber(registrationNumber)
|
||||
, description(description)
|
||||
{}
|
||||
|
||||
QString toString() const
|
||||
{
|
||||
return QStringLiteral("GUID: %1 | RegistrationNumber: %2 | Description: %3")
|
||||
.arg(guid, registrationNumber, description);
|
||||
}
|
||||
};
|
||||
|
||||
struct SaabPerson
|
||||
{
|
||||
QString guid;
|
||||
QString personalID;
|
||||
QString name;
|
||||
|
||||
SaabPerson() = default;
|
||||
SaabPerson(const QString &guid, const QString &personalID, const QString &name)
|
||||
: guid(guid)
|
||||
, personalID(personalID)
|
||||
, name(name)
|
||||
{}
|
||||
|
||||
QString toString() const
|
||||
{
|
||||
return QStringLiteral("GUID: %1 | PersonalID: %2 | Name: %3")
|
||||
.arg(guid, personalID, name);
|
||||
}
|
||||
};
|
||||
|
||||
class SaabPlayer
|
||||
{
|
||||
public:
|
||||
qint32 mappedTypeId = 0;
|
||||
int32_t articleNumber = 0;
|
||||
QString disType;
|
||||
QString guid;
|
||||
QString designation;
|
||||
QString refId; // personRefID or vehicleRefID
|
||||
QString rank;
|
||||
QString force;
|
||||
QString symbol; // code attribute of SaabSymbol
|
||||
bool trashcan;
|
||||
SaabPlayer *superior = nullptr;
|
||||
bool isDeletedByDefault = false;
|
||||
int simulatorId = INT_MIN;
|
||||
bool isExternalPlayer = false;
|
||||
|
||||
bool hasDisType() const;
|
||||
|
||||
virtual ~SaabPlayer() = default;
|
||||
virtual QString toString() const = 0;
|
||||
virtual void writeToXml(QXmlStreamWriter *writer) const = 0;
|
||||
|
||||
protected:
|
||||
QString attrs() const;
|
||||
void writeBaseInfo(const QString &startTag, QXmlStreamWriter *writer, bool isUnit = false) const;
|
||||
};
|
||||
|
||||
class SaabPersonPlayer
|
||||
: public SaabPlayer
|
||||
{
|
||||
public:
|
||||
QString personalID;
|
||||
QString name;
|
||||
|
||||
QString toString() const override;
|
||||
void writeToXml(QXmlStreamWriter *writer) const override;
|
||||
};
|
||||
|
||||
class SaabOcPlayer final
|
||||
: public SaabPersonPlayer
|
||||
{
|
||||
public:
|
||||
QString toString() const override final;
|
||||
void writeToXml(QXmlStreamWriter *writer) const override final;
|
||||
};
|
||||
|
||||
class SaabVehiclePlayer final
|
||||
: public SaabPlayer
|
||||
{
|
||||
public:
|
||||
QString registrationNumber;
|
||||
QString description;
|
||||
|
||||
QString toString() const override final;
|
||||
void writeToXml(QXmlStreamWriter *writer) const override final;
|
||||
};
|
||||
|
||||
class SaabUnit final
|
||||
: public SaabPlayer
|
||||
{
|
||||
public:
|
||||
QString positionByPlayerId;
|
||||
QString unitSize;
|
||||
QVector<SaabPlayer *> inferiors;
|
||||
|
||||
~SaabUnit()
|
||||
{
|
||||
qDeleteAll(inferiors);
|
||||
}
|
||||
|
||||
QString toString() const override final;
|
||||
QString toStringWithDepth(int depth) const;
|
||||
void writeToXml(QXmlStreamWriter *writer) const override final;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* occurring tag and attribute strings in saab xml
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace saab
|
||||
{
|
||||
namespace XmlStrings
|
||||
{
|
||||
inline QString SAAB_APPLICATION_ID() { return QStringLiteral("ApplicationID"); }
|
||||
inline QString SAAB_APPLICATION_TYPE() { return QStringLiteral("ApplicationType"); }
|
||||
inline QString SAAB_ARTICLE_NUMBER() { return QStringLiteral("ArticleNumber"); }
|
||||
inline QString SAAB_CHANGE_INFO() { return QStringLiteral("ChangeInfo"); }
|
||||
inline QString SAAB_CHANGE_TYPE() { return QStringLiteral("ChangeType"); }
|
||||
inline QString SAAB_CODE() { return QStringLiteral("Code"); }
|
||||
inline QString SAAB_COLOR() { return QStringLiteral("Color"); }
|
||||
inline QString SAAB_DELETE() { return QStringLiteral("Delete"); }
|
||||
inline QString SAAB_DESCRIPTION() { return QStringLiteral("Description"); }
|
||||
inline QString SAAB_DESIGNATION() { return QStringLiteral("Designation"); }
|
||||
inline QString SAAB_ECHELON() { return QStringLiteral("Echelon"); }
|
||||
inline QString SAAB_ECHELONS() { return QStringLiteral("Echelons"); }
|
||||
inline QString SAAB_ECHELON_ID() { return QStringLiteral("EchelonID"); }
|
||||
inline QString SAAB_EVALUATION_PACKAGE_FILE_NAME() { return QStringLiteral("EvaluationPackageFileName"); }
|
||||
inline QString SAAB_EXERCISE() { return QStringLiteral("Exercise"); }
|
||||
inline QString SAAB_EXERCISE_ORBAT() { return QStringLiteral("ExerciseOrbat"); }
|
||||
inline QString SAAB_EXERCISE_STATE() { return QStringLiteral("ExerciseState"); }
|
||||
inline QString SAAB_EXPORT_TIME() { return QStringLiteral("ExportTime"); }
|
||||
inline QString SAAB_EXTERNAL_PLAYER() { return QStringLiteral("ExternalPlayer"); }
|
||||
inline QString SAAB_FALSE() { return QStringLiteral("false"); }
|
||||
inline QString SAAB_FIXED_POSITION() { return QStringLiteral("FixedPosition"); }
|
||||
inline QString SAAB_FORCE() { return QStringLiteral("Force"); }
|
||||
inline QString SAAB_FORCES() { return QStringLiteral("Forces"); }
|
||||
inline QString SAAB_HELICOPTERS() { return QStringLiteral("Helicopters"); }
|
||||
inline QString SAAB_ID() { return QStringLiteral("ID"); }
|
||||
inline QString SAAB_MODEL_ID() { return QStringLiteral("ModelID"); }
|
||||
inline QString SAAB_NAME() { return QStringLiteral("Name"); }
|
||||
inline QString SAAB_OC_PLAYER() { return QStringLiteral("OCPlayer"); }
|
||||
inline QString SAAB_ORBAT() { return QStringLiteral("Orbat"); }
|
||||
inline QString SAAB_ORBAT_ENTITIES() { return QStringLiteral("OrbatEntities"); }
|
||||
inline QString SAAB_ORIENTATION() { return QStringLiteral("Orientation"); }
|
||||
inline QString SAAB_ORIGINAL_CREATION_ID() { return QStringLiteral("OriginalCreationID"); }
|
||||
inline QString SAAB_PERSON() { return QStringLiteral("Person"); }
|
||||
inline QString SAAB_PERSONS() { return QStringLiteral("Persons"); }
|
||||
inline QString SAAB_PERSON_PLAYER() { return QStringLiteral("PersonPlayer"); }
|
||||
inline QString SAAB_PERSON_REF_ID() { return QStringLiteral("PersonRefID"); }
|
||||
inline QString SAAB_PERSONAL_ID() { return QStringLiteral("PersonalID"); }
|
||||
inline QString SAAB_PLANNED_START_TIME() { return QStringLiteral("PlannedStartTime"); }
|
||||
inline QString SAAB_PLANNED_STOP_TIME() { return QStringLiteral("PlannedStopTime"); }
|
||||
inline QString SAAB_PLAYER_TYPE_ID() { return QStringLiteral("PlayerTypeID"); }
|
||||
inline QString SAAB_POSITION_BY_PLAYER_ID() { return QStringLiteral("PositionByPlayerID"); }
|
||||
inline QString SAAB_RANK() { return QStringLiteral("Rank"); }
|
||||
inline QString SAAB_REGISTRATION_NUMBER() { return QStringLiteral("RegistrationNumber"); }
|
||||
inline QString SAAB_SYMBOL_ID() { return QStringLiteral("SymbolID"); }
|
||||
inline QString SAAB_SIMULATOR_ID() { return QStringLiteral("SimulatorID"); }
|
||||
inline QString SAAB_SYMBOL() { return QStringLiteral("Symbol"); }
|
||||
inline QString SAAB_SYMBOLS() { return QStringLiteral("Symbols"); }
|
||||
inline QString SAAB_SYSTEM_ID() { return QStringLiteral("SystemID"); }
|
||||
inline QString SAAB_TEXT() { return QStringLiteral("Text"); }
|
||||
inline QString SAAB_TRUE() { return QStringLiteral("true"); }
|
||||
inline QString SAAB_UNIT() { return QStringLiteral("Unit"); }
|
||||
inline QString SAAB_UNIT_SIZE() { return QStringLiteral("UnitSize"); }
|
||||
inline QString SAAB_TRASHCAN() { return QStringLiteral("Trashcan"); }
|
||||
inline QString SAAB_VEHICLE() { return QStringLiteral("Vehicle"); }
|
||||
inline QString SAAB_VEHICLES() { return QStringLiteral("Vehicles"); }
|
||||
inline QString SAAB_VEHICLE_PLAYER() { return QStringLiteral("VehiclePlayer"); }
|
||||
inline QString SAAB_VEHICLE_REF_ID() { return QStringLiteral("VehicleRefID"); }
|
||||
inline QString SAAB_WIND_DIRECTION() { return QStringLiteral("WindDirection"); }
|
||||
inline QString SAAB_WIND_SPEED() { return QStringLiteral("WindSpeed"); }
|
||||
inline QString SAAB_XMLNS_XSI() { return QStringLiteral("xmlns:xsi"); }
|
||||
inline QString SAAB_XMLNS_XSD() { return QStringLiteral("xmlns:xsd"); }
|
||||
inline QString SAAB_XMLNS() { return QStringLiteral("xmlns"); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SAABExport</class>
|
||||
<widget class="QWidget" name="SAABExport">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>110</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="1">
|
||||
<widget class="QLineEdit" name="m_lineedit_ExportFile">
|
||||
<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="0">
|
||||
<widget class="QLabel" name="m_label_Import">
|
||||
<property name="text">
|
||||
<string>Selected Output File:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</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="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Selected Config File:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="m_pushbutton_SelectConfig">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<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>
|
||||
<widget class="QPushButton" name="m_pushButton_StartImport">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start Export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="m_lineedit_ConfigFile"/>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<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>
|
||||
<tabstops>
|
||||
<tabstop>m_lineedit_ExportFile</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SAABImport</class>
|
||||
<widget class="NGLDialog" name="SAABImport">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>110</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="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="0">
|
||||
<widget class="QLabel" name="m_label_Import">
|
||||
<property name="text">
|
||||
<string>Selected ORBAT File:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</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="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Selected config File:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="m_pushbutton_SelectConfig">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<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>
|
||||
<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>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="m_lineedit_configFile"/>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<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>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>SAABImportShow</class>
|
||||
<widget class="NGLDialog" name="SAABImportShow">
|
||||
<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,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MapParty</class>
|
||||
<widget class="QWidget" name="MapParty">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>164</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Map Type</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbForce"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Symbol:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Force:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbSymbol"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbEchelon"/>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<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>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<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>
|
||||
<widget class="QPushButton" name="pbApply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbSkip">
|
||||
<property name="text">
|
||||
<string>Skip</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Echelon:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblText">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</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,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MapType</class>
|
||||
<widget class="QWidget" name="MapType">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>133</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Map Type</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<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>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Symbol:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbSymbol"/>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<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>
|
||||
<widget class="QPushButton" name="pbApply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbEchelon"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Echelon:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblText">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</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,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SAABMappingDialog</class>
|
||||
<widget class="QDialog" name="SAABMappingDialog">
|
||||
<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="1">
|
||||
<widget class="QPushButton" name="m_pushButton_Apply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<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>
|
||||
</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,17 @@
|
||||
/**
|
||||
* Export definitions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef ZWMSSAAB_EXPORT
|
||||
# ifdef MAKE_ZWMSSAAB_LIB
|
||||
# define ZWMSSAAB_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define ZWMSSAAB_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
Reference in new issue
Block a user