Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7a0feac0
Commit
7a0feac0
authored
Jun 23, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
seg. fault on startup
parent
a110c7f5
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2208 additions
and
106 deletions
+2208
-106
Klingenbach.wima
SaveFiles/Klingenbach.wima
+2003
-0
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+13
-2
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+2
-2
QGCApplication.cc
src/QGCApplication.cc
+2
-0
WimaController.cc
src/Wima/WimaController.cc
+112
-65
WimaController.h
src/Wima/WimaController.h
+18
-9
WimaDataContainer.cc
src/Wima/WimaDataContainer.cc
+9
-0
WimaDataContainer.h
src/Wima/WimaDataContainer.h
+28
-0
WimaView.qml
src/WimaView/WimaView.qml
+3
-1
MainWindowInner.qml
src/ui/MainWindowInner.qml
+14
-25
No files found.
SaveFiles/Klingenbach.wima
0 → 100644
View file @
7a0feac0
{
"AreaItems": [
{
"AreaType": "Operation Area",
"BorderPolygonOffset": 5,
"BottomLayerAltitude": 10,
"LayerDistance": 2,
"NumberOfLayers": 1,
"maxAltitude": 30,
"polygon": [
[
47.76814130285164,
16.530347986094483
],
[
47.768405048556495,
16.530985979841546
],
[
47.76804190441199,
16.531139778691
],
[
47.76780598957649,
16.53043671316874
]
]
},
{
"AreaType": "Service Area",
"maxAltitude": 30,
"polygon": [
[
47.76775534116353,
16.53042897362141
],
[
47.76780537519892,
16.530588940000627
],
[
47.76771276042304,
16.530596856755835
],
[
47.767657403517816,
16.530447977233962
]
]
},
{
"AreaType": "Corridor",
"maxAltitude": 30,
"polygon": [
[
47.76777556807082,
16.53055092911842
],
[
47.76781389199906,
16.530691889469182
],
[
47.76790225054143,
16.53064278774005
],
[
47.76792886425493,
16.530728315200577
],
[
47.7677888758332,
16.53078295757672
],
[
47.767725534701874,
16.530560429265805
]
]
}
],
"MissionItems": {
"fileType": "Plan",
"geoFence": {
"circles": [
],
"polygons": [
],
"version": 2
},
"groundStation": "QGroundControl",
"mission": {
"cruiseSpeed": 15,
"firmwareType": 12,
"hoverSpeed": 5,
"items": [
{
"autoContinue": true,
"command": 530,
"doJumpId": 1,
"frame": 2,
"params": [
0,
2,
null,
null,
null,
null,
null
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": null,
"Altitude": 50,
"AltitudeMode": 1,
"autoContinue": true,
"command": 22,
"doJumpId": 2,
"frame": 3,
"params": [
15,
0,
0,
null,
47.76773272010195,
16.53051568687008,
50
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": null,
"Altitude": 50,
"AltitudeMode": 1,
"autoContinue": true,
"command": 16,
"doJumpId": 3,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76781389199906,
16.530691889469182,
50
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": null,
"Altitude": 50,
"AltitudeMode": 1,
"autoContinue": true,
"command": 16,
"doJumpId": 4,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76787939989352,
16.530655486091632,
50
],
"type": "SimpleItem"
},
{
"TransectStyleComplexItem": {
"CameraCalc": {
"AdjustedFootprintFrontal": 25,
"AdjustedFootprintSide": 2,
"CameraName": "Manual (no camera specs)",
"DistanceToSurface": 50,
"DistanceToSurfaceRelative": true,
"version": 1
},
"CameraShots": 47,
"CameraTriggerInTurnAround": true,
"FollowTerrain": false,
"HoverAndCapture": false,
"Items": [
{
"autoContinue": true,
"command": 16,
"doJumpId": 5,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76781102855973,
16.530451729978072,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 6,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 7,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 8,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76787704224262,
16.53041791205613,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 9,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76799131139914,
16.530387675399677,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 10,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 11,
"frame": 3,
"params": [
0,
0,
0,
null,
47.7678191324091,
16.530475880495707,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 12,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76782723625342,
16.53050003102087,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 13,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 14,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76810558054772,
16.530357438610363,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 15,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76814793980895,
16.530364040530976,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 16,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 17,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76783534009267,
16.530524181553563,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 18,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76784344392685,
16.530548332093776,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 19,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 20,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76815759518296,
16.530387396369257,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 21,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768167250552246,
16.530410752216213,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 22,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 23,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76785154775597,
16.530572482641514,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 24,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76785965158001,
16.53059663319678,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 25,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 26,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76817690591679,
16.530434108071837,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 27,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768186561276586,
16.530457463936134,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 28,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 29,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76786775539899,
16.530620783759574,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 30,
"frame": 3,
"params": [
0,
0,
0,
null,
47.767875859212914,
16.53064493432989,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 31,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 32,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768196216631665,
16.530480819809103,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 33,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76820587198199,
16.53050417569074,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 34,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 35,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76788396302177,
16.530669084907732,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 36,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76789206682555,
16.530693235493104,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 37,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 38,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768215527327584,
16.53052753158105,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 39,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76822518266844,
16.530550887480036,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 40,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 41,
"frame": 3,
"params": [
0,
0,
0,
null,
47.767900170624266,
16.530717386085996,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 42,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76790827441793,
16.530741536686417,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 43,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 44,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76823483800455,
16.530574243387694,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 45,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768244493335935,
16.53059759930402,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 46,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 47,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76791637820651,
16.530765687294366,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 48,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76792448199002,
16.530789837909836,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 49,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 50,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768254148662564,
16.530620955229015,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 51,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76826380398446,
16.53064431116269,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 52,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 53,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76793258576849,
16.530813988532834,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 54,
"frame": 3,
"params": [
0,
0,
0,
null,
47.767940689541874,
16.530838139163357,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 55,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 56,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768273459301625,
16.530667667105032,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 57,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76828311461405,
16.530691023056043,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 58,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 59,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76794879331019,
16.53086228980141,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 60,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76795689707344,
16.53088644044698,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 61,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 62,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768292769921736,
16.53071437901573,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 63,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76830242522469,
16.530737734984086,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 64,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 65,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76796500083164,
16.530910591100085,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 66,
"frame": 3,
"params": [
0,
0,
0,
null,
47.767973104584755,
16.530934741760714,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 67,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 68,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76831208052289,
16.530761090961114,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 69,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768321735816365,
16.530784446946814,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 70,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 71,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76798120833281,
16.530958892428863,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 72,
"frame": 3,
"params": [
0,
0,
0,
null,
47.7679893120758,
16.53098304310454,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 73,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 74,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76833139110509,
16.530807802941187,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 75,
"frame": 3,
"params": [
0,
0,
0,
null,
47.7683410463891,
16.53083115894423,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 76,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 77,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76799741581374,
16.531007193787744,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 78,
"frame": 3,
"params": [
0,
0,
0,
null,
47.7680055195466,
16.531031344478475,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 79,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 80,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768350701668346,
16.530854514955948,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 81,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768360356942864,
16.530877870976333,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 82,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 83,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768013623274385,
16.53105549517673,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 84,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76802172699712,
16.531079645882514,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 85,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 86,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768370012212635,
16.53090122700539,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 87,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76837966747768,
16.530924583043124,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 88,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 89,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76802983071477,
16.53110379659582,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 90,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76803793442736,
16.53112794731665,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 91,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 92,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76838932273799,
16.530947939089526,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 93,
"frame": 3,
"params": [
0,
0,
0,
null,
47.768398977993556,
16.5309712951446,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 94,
"frame": 2,
"params": [
25,
0,
1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 16,
"doJumpId": 95,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76820456269355,
16.531070889913362,
50
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 206,
"doJumpId": 96,
"frame": 2,
"params": [
0,
0,
0,
0,
0,
0,
0
],
"type": "SimpleItem"
}
],
"Refly90Degrees": false,
"TurnAroundDistance": 0,
"VisualTransectPoints": [
[
47.76781102855973,
16.530451729978072
],
[
47.76787704224262,
16.53041791205613
],
[
47.76799131139914,
16.530387675399677
],
[
47.7678191324091,
16.530475880495707
],
[
47.76782723625342,
16.53050003102087
],
[
47.76810558054772,
16.530357438610363
],
[
47.76814793980895,
16.530364040530976
],
[
47.76783534009267,
16.530524181553563
],
[
47.76784344392685,
16.530548332093776
],
[
47.76815759518296,
16.530387396369257
],
[
47.768167250552246,
16.530410752216213
],
[
47.76785154775597,
16.530572482641514
],
[
47.76785965158001,
16.53059663319678
],
[
47.76817690591679,
16.530434108071837
],
[
47.768186561276586,
16.530457463936134
],
[
47.76786775539899,
16.530620783759574
],
[
47.767875859212914,
16.53064493432989
],
[
47.768196216631665,
16.530480819809103
],
[
47.76820587198199,
16.53050417569074
],
[
47.76788396302177,
16.530669084907732
],
[
47.76789206682555,
16.530693235493104
],
[
47.768215527327584,
16.53052753158105
],
[
47.76822518266844,
16.530550887480036
],
[
47.767900170624266,
16.530717386085996
],
[
47.76790827441793,
16.530741536686417
],
[
47.76823483800455,
16.530574243387694
],
[
47.768244493335935,
16.53059759930402
],
[
47.76791637820651,
16.530765687294366
],
[
47.76792448199002,
16.530789837909836
],
[
47.768254148662564,
16.530620955229015
],
[
47.76826380398446,
16.53064431116269
],
[
47.76793258576849,
16.530813988532834
],
[
47.767940689541874,
16.530838139163357
],
[
47.768273459301625,
16.530667667105032
],
[
47.76828311461405,
16.530691023056043
],
[
47.76794879331019,
16.53086228980141
],
[
47.76795689707344,
16.53088644044698
],
[
47.768292769921736,
16.53071437901573
],
[
47.76830242522469,
16.530737734984086
],
[
47.76796500083164,
16.530910591100085
],
[
47.767973104584755,
16.530934741760714
],
[
47.76831208052289,
16.530761090961114
],
[
47.768321735816365,
16.530784446946814
],
[
47.76798120833281,
16.530958892428863
],
[
47.7679893120758,
16.53098304310454
],
[
47.76833139110509,
16.530807802941187
],
[
47.7683410463891,
16.53083115894423
],
[
47.76799741581374,
16.531007193787744
],
[
47.7680055195466,
16.531031344478475
],
[
47.768350701668346,
16.530854514955948
],
[
47.768360356942864,
16.530877870976333
],
[
47.768013623274385,
16.53105549517673
],
[
47.76802172699712,
16.531079645882514
],
[
47.768370012212635,
16.53090122700539
],
[
47.76837966747768,
16.530924583043124
],
[
47.76802983071477,
16.53110379659582
],
[
47.76803793442736,
16.53112794731665
],
[
47.76838932273799,
16.530947939089526
],
[
47.768398977993556,
16.5309712951446
],
[
47.76820456269355,
16.531070889913362
]
],
"version": 1
},
"angle": 161,
"complexItemType": "survey",
"entryLocation": 0,
"flyAlternateTransects": false,
"polygon": [
[
47.76814130285164,
16.530347986094483
],
[
47.768405048556495,
16.530985979841546
],
[
47.76804190441199,
16.531139778691
],
[
47.76780598957649,
16.53043671316874
]
],
"splitConcavePolygons": false,
"type": "ComplexItem",
"version": 5
},
{
"AMSLAltAboveTerrain": null,
"Altitude": 50,
"AltitudeMode": 1,
"autoContinue": true,
"command": 16,
"doJumpId": 97,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76790673620743,
16.53073695257154,
50
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": null,
"Altitude": 50,
"AltitudeMode": 1,
"autoContinue": true,
"command": 16,
"doJumpId": 98,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76781389199906,
16.530691889469182,
50
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": null,
"Altitude": 0,
"AltitudeMode": 1,
"autoContinue": true,
"command": 21,
"doJumpId": 99,
"frame": 3,
"params": [
0,
0,
0,
null,
47.76773272010195,
16.53051568687008,
0
],
"type": "SimpleItem"
}
],
"plannedHomePosition": [
47.76773272010195,
16.53051568687008,
178
],
"vehicleType": 2,
"version": 2
},
"rallyPoints": {
"points": [
],
"version": 2
},
"version": 1
}
}
qgroundcontrol.pro
View file @
7a0feac0
...
@@ -413,7 +413,8 @@ HEADERS += \
...
@@ -413,7 +413,8 @@ HEADERS += \
src
/
Wima
/
WimaVCorridor
.
h
\
src
/
Wima
/
WimaVCorridor
.
h
\
src
/
Wima
/
WimaTrackerPolyline
.
h
\
src
/
Wima
/
WimaTrackerPolyline
.
h
\
src
/
Wima
/
WimaController
.
h
\
src
/
Wima
/
WimaController
.
h
\
src
/
Wima
/
WimaVehicle
.
h
src
/
Wima
/
WimaVehicle
.
h
\
src
/
Wima
/
WimaDataContainer
.
h
SOURCES
+=
\
SOURCES
+=
\
src
/
api
/
QGCCorePlugin
.
cc
\
src
/
api
/
QGCCorePlugin
.
cc
\
src
/
api
/
QGCOptions
.
cc
\
src
/
api
/
QGCOptions
.
cc
\
...
@@ -426,7 +427,8 @@ SOURCES += \
...
@@ -426,7 +427,8 @@ SOURCES += \
src
/
Wima
/
WimaVCorridor
.
cc
\
src
/
Wima
/
WimaVCorridor
.
cc
\
src
/
Wima
/
WimaTrackerPolyline
.
cc
\
src
/
Wima
/
WimaTrackerPolyline
.
cc
\
src
/
Wima
/
WimaController
.
cc
\
src
/
Wima
/
WimaController
.
cc
\
src
/
Wima
/
WimaVehicle
.
cc
src
/
Wima
/
WimaVehicle
.
cc
\
src
/
Wima
/
WimaDataContainer
.
cc
#
#
#
Unit
Test
specific
configuration
goes
here
(
requires
full
debug
build
with
all
plugins
)
#
Unit
Test
specific
configuration
goes
here
(
requires
full
debug
build
with
all
plugins
)
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
7a0feac0
...
@@ -28,14 +28,13 @@ import QGroundControl.FlightMap 1.0
...
@@ -28,14 +28,13 @@ import QGroundControl.FlightMap 1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
Vehicle
1.0
import
Wima
1.0
/// Flight Display View
/// Flight Display View
QGCView
{
QGCView
{
id
:
root
id
:
root
viewPanel
:
_panel
viewPanel
:
_panel
property
var
wimaController
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
property
alias
guidedController
:
guidedActionsController
property
alias
guidedController
:
guidedActionsController
...
@@ -115,6 +114,13 @@ QGCView {
...
@@ -115,6 +114,13 @@ QGCView {
Component.onCompleted
:
start
(
true
/* flyView */
)
Component.onCompleted
:
start
(
true
/* flyView */
)
}
}
WimaController
{
id
:
wimaController
Component.onCompleted
:
{
startWimaController
(
true
/* flyView */
)
}
}
BuiltInPreFlightCheckModel
{
BuiltInPreFlightCheckModel
{
id
:
preFlightCheckModel
id
:
preFlightCheckModel
}
}
...
@@ -129,6 +135,10 @@ QGCView {
...
@@ -129,6 +135,10 @@ QGCView {
if
(
QGroundControl
.
corePlugin
.
options
.
flyViewOverlay
.
toString
().
length
)
{
if
(
QGroundControl
.
corePlugin
.
options
.
flyViewOverlay
.
toString
().
length
)
{
flyViewOverlay
.
source
=
QGroundControl
.
corePlugin
.
options
.
flyViewOverlay
flyViewOverlay
.
source
=
QGroundControl
.
corePlugin
.
options
.
flyViewOverlay
}
}
wimaController
.
masterController
=
masterController
wimaController
.
missionController
=
masterController
.
missionController
wimaController
.
dataContainer
=
dataContainer
}
}
// The following code is used to track vehicle states such that we prompt to remove mission from vehicle when mission completes
// The following code is used to track vehicle states such that we prompt to remove mission from vehicle when mission completes
...
@@ -331,6 +341,7 @@ QGCView {
...
@@ -331,6 +341,7 @@ QGCView {
id
:
_flightMap
id
:
_flightMap
anchors.fill
:
parent
anchors.fill
:
parent
planMasterController
:
masterController
planMasterController
:
masterController
wimaController
:
wimaController
guidedActionsController
:
_guidedController
guidedActionsController
:
_guidedController
flightWidgets
:
flightDisplayViewWidgets
flightWidgets
:
flightDisplayViewWidgets
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
7a0feac0
...
@@ -37,12 +37,12 @@ FlightMap {
...
@@ -37,12 +37,12 @@ FlightMap {
// The following properties must be set by the consumer
// The following properties must be set by the consumer
property
var
planMasterController
property
var
planMasterController
property
var
wimaController
property
var
guidedActionsController
property
var
guidedActionsController
property
var
flightWidgets
property
var
flightWidgets
property
var
rightPanelWidth
property
var
rightPanelWidth
property
var
qgcView
///< QGCView control which contains this map
property
var
qgcView
///< QGCView control which contains this map
property
var
multiVehicleView
///< true: multi-vehicle view, false: single vehicle view
property
var
multiVehicleView
///< true: multi-vehicle view, false: single vehicle view
property
var
wimaController
property
rect
centerViewport
:
Qt
.
rect
(
0
,
0
,
width
,
height
)
property
rect
centerViewport
:
Qt
.
rect
(
0
,
0
,
width
,
height
)
...
@@ -196,7 +196,7 @@ FlightMap {
...
@@ -196,7 +196,7 @@ FlightMap {
// Add wima Areas to the Map
// Add wima Areas to the Map
WimaMapPolygonVisuals
{
WimaMapPolygonVisuals
{
mapControl
:
flightMap
mapControl
:
flightMap
mapPolygon
:
wimaController
?
wimaController
.
joinedArea
:
undefined
mapPolygon
:
wimaController
.
joinedArea
borderWidth
:
1
borderWidth
:
1
borderColor
:
"
transparent
"
borderColor
:
"
transparent
"
interiorColor
:
"
gray
"
interiorColor
:
"
gray
"
...
...
src/QGCApplication.cc
View file @
7a0feac0
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
#include "CoordinateVector.h"
#include "CoordinateVector.h"
#include "PlanMasterController.h"
#include "PlanMasterController.h"
#include "Wima/WimaController.h" //custom
#include "Wima/WimaController.h" //custom
#include "Wima/WimaDataContainer.h" //custom
#include "VideoManager.h"
#include "VideoManager.h"
#include "VideoSurface.h"
#include "VideoSurface.h"
#include "VideoReceiver.h"
#include "VideoReceiver.h"
...
@@ -465,6 +466,7 @@ void QGCApplication::_initCommon(void)
...
@@ -465,6 +466,7 @@ void QGCApplication::_initCommon(void)
#endif
#endif
// Wima
// Wima
qmlRegisterType
<
WimaController
>
(
"Wima"
,
1
,
0
,
"WimaController"
);
//custom
qmlRegisterType
<
WimaController
>
(
"Wima"
,
1
,
0
,
"WimaController"
);
//custom
qmlRegisterType
<
WimaDataContainer
>
(
"Wima"
,
1
,
0
,
"WimaDataContainer"
);
//custom
// Register Qml Singletons
// Register Qml Singletons
...
...
src/Wima/WimaController.cc
View file @
7a0feac0
...
@@ -6,9 +6,9 @@ const char* WimaController::missionItemsName = "MissionItems";
...
@@ -6,9 +6,9 @@ const char* WimaController::missionItemsName = "MissionItems";
WimaController
::
WimaController
(
QObject
*
parent
)
:
WimaController
::
WimaController
(
QObject
*
parent
)
:
QObject
(
parent
)
QObject
(
parent
)
,
_planView
(
true
)
,
_flyView
(
true
)
,
_visualItems
(
new
QmlObjectListModel
(
parent
))
,
_currentPolygonIndex
(
-
1
)
,
_currentPolygonIndex
(
-
1
)
,
_container
(
nullptr
)
{
{
connect
(
this
,
&
WimaController
::
currentPolygonIndexChanged
,
this
,
&
WimaController
::
recalcPolygonInteractivity
);
connect
(
this
,
&
WimaController
::
currentPolygonIndexChanged
,
this
,
&
WimaController
::
recalcPolygonInteractivity
);
}
}
...
@@ -44,36 +44,48 @@ void WimaController::setMissionController(MissionController *missionC)
...
@@ -44,36 +44,48 @@ void WimaController::setMissionController(MissionController *missionC)
void
WimaController
::
setCurrentPolygonIndex
(
int
index
)
void
WimaController
::
setCurrentPolygonIndex
(
int
index
)
{
{
if
(
index
>=
0
&&
index
<
_visualItems
->
count
()
&&
index
!=
_currentPolygonIndex
){
if
(
_container
!=
nullptr
&&
index
>=
0
&&
index
<
_container
->
visualItems
()
->
count
()
&&
index
!=
_currentPolygonIndex
){
_currentPolygonIndex
=
index
;
_currentPolygonIndex
=
index
;
emit
currentPolygonIndexChanged
(
index
);
emit
currentPolygonIndexChanged
(
index
);
}
}
}
}
void
WimaController
::
setDataContainer
(
WimaDataContainer
*
container
)
{
if
(
container
!=
nullptr
&&
_container
!=
container
)
{
_container
=
container
;
emit
dataContainerChanged
();
}
}
void
WimaController
::
startWimaController
(
bool
flyView
)
{
_flyView
=
flyView
;
}
void
WimaController
::
removeArea
(
int
index
)
void
WimaController
::
removeArea
(
int
index
)
{
{
if
(
index
>=
0
&&
index
<
_visualItems
->
count
()){
if
(
_container
!=
nullptr
&&
index
>=
0
&&
index
<
_container
->
visualItems
()
->
count
()){
WimaArea
*
area
=
qobject_cast
<
WimaArea
*>
(
_
visualItems
->
removeAt
(
index
));
WimaArea
*
area
=
qobject_cast
<
WimaArea
*>
(
_
container
->
visualItems
()
->
removeAt
(
index
));
if
(
area
==
nullptr
)
{
if
(
area
==
nullptr
)
{
qWarning
(
"WimaController::removeArea(): nullptr catched, internal error."
);
qWarning
(
"WimaController::removeArea(): nullptr catched, internal error."
);
return
;
return
;
}
}
disconnect
(
area
,
&
WimaArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
if
(
_
visualItems
->
count
()
==
0
)
{
if
(
_
container
->
visualItems
()
->
count
()
==
0
)
{
// this branch is reached if all items are removed
// this branch is reached if all items are removed
// to guarentee proper behavior, _currentPolygonIndex must be set to a invalid value, as on constructor init.
// to guarentee proper behavior, _currentPolygonIndex must be set to a invalid value, as on constructor init.
_currentPolygonIndex
=
-
1
;
_currentPolygonIndex
=
-
1
;
return
;
return
;
}
}
if
(
_currentPolygonIndex
>=
_
visualItems
->
count
()){
if
(
_currentPolygonIndex
>=
_
container
->
visualItems
()
->
count
()){
setCurrentPolygonIndex
(
_
visualItems
->
count
()
-
1
);
setCurrentPolygonIndex
(
_
container
->
visualItems
()
->
count
()
-
1
);
}
else
{
}
else
{
recalcPolygonInteractivity
(
_currentPolygonIndex
);
recalcPolygonInteractivity
(
_currentPolygonIndex
);
}
}
...
@@ -85,10 +97,15 @@ void WimaController::removeArea(int index)
...
@@ -85,10 +97,15 @@ void WimaController::removeArea(int index)
bool
WimaController
::
addGOperationArea
()
bool
WimaController
::
addGOperationArea
()
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
false
;
}
// check if opArea exists already
// check if opArea exists already
WimaGOperationArea
*
opArea
=
nullptr
;
WimaGOperationArea
*
opArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_
visualItems
->
get
(
i
));
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
)
{
if
(
currentArea
!=
nullptr
)
{
opArea
=
currentArea
;
opArea
=
currentArea
;
return
false
;
return
false
;
...
@@ -97,10 +114,8 @@ bool WimaController::addGOperationArea()
...
@@ -97,10 +114,8 @@ bool WimaController::addGOperationArea()
// create one if no opArea available
// create one if no opArea available
opArea
=
new
WimaGOperationArea
(
this
);
opArea
=
new
WimaGOperationArea
(
this
);
connect
(
opArea
,
&
WimaGOperationArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
_container
->
visualItems
()
->
append
(
opArea
);
int
newIndex
=
_container
->
visualItems
()
->
count
()
-
1
;
_visualItems
->
append
(
opArea
);
int
newIndex
=
_visualItems
->
count
()
-
1
;
setCurrentPolygonIndex
(
newIndex
);
setCurrentPolygonIndex
(
newIndex
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
...
@@ -109,10 +124,15 @@ bool WimaController::addGOperationArea()
...
@@ -109,10 +124,15 @@ bool WimaController::addGOperationArea()
bool
WimaController
::
addServiceArea
()
bool
WimaController
::
addServiceArea
()
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
false
;
}
// check if serArea exists already
// check if serArea exists already
WimaServiceArea
*
serArea
=
nullptr
;
WimaServiceArea
*
serArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_
visualItems
->
get
(
i
));
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
)
{
if
(
currentArea
!=
nullptr
)
{
serArea
=
currentArea
;
serArea
=
currentArea
;
return
false
;
return
false
;
...
@@ -121,10 +141,9 @@ bool WimaController::addServiceArea()
...
@@ -121,10 +141,9 @@ bool WimaController::addServiceArea()
// create one if no serArea available
// create one if no serArea available
serArea
=
new
WimaServiceArea
(
this
);
serArea
=
new
WimaServiceArea
(
this
);
connect
(
serArea
,
&
WimaServiceArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
_
visualItems
->
append
(
serArea
);
_
container
->
visualItems
()
->
append
(
serArea
);
int
newIndex
=
_
visualItems
->
count
()
-
1
;
int
newIndex
=
_
container
->
visualItems
()
->
count
()
-
1
;
setCurrentPolygonIndex
(
newIndex
);
setCurrentPolygonIndex
(
newIndex
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
...
@@ -133,10 +152,15 @@ bool WimaController::addServiceArea()
...
@@ -133,10 +152,15 @@ bool WimaController::addServiceArea()
bool
WimaController
::
addVehicleCorridor
()
bool
WimaController
::
addVehicleCorridor
()
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
false
;
}
// check if corridor exists already
// check if corridor exists already
WimaVCorridor
*
corridor
=
nullptr
;
WimaVCorridor
*
corridor
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_
visualItems
->
get
(
i
));
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
)
{
if
(
currentArea
!=
nullptr
)
{
corridor
=
currentArea
;
corridor
=
currentArea
;
return
false
;
return
false
;
...
@@ -145,10 +169,9 @@ bool WimaController::addVehicleCorridor()
...
@@ -145,10 +169,9 @@ bool WimaController::addVehicleCorridor()
// create one if no corridor available
// create one if no corridor available
corridor
=
new
WimaVCorridor
(
this
);
corridor
=
new
WimaVCorridor
(
this
);
connect
(
corridor
,
&
WimaVCorridor
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
_
visualItems
->
append
(
corridor
);
_
container
->
visualItems
()
->
append
(
corridor
);
int
newIndex
=
_
visualItems
->
count
()
-
1
;
int
newIndex
=
_
container
->
visualItems
()
->
count
()
-
1
;
setCurrentPolygonIndex
(
newIndex
);
setCurrentPolygonIndex
(
newIndex
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
...
@@ -157,8 +180,13 @@ bool WimaController::addVehicleCorridor()
...
@@ -157,8 +180,13 @@ bool WimaController::addVehicleCorridor()
void
WimaController
::
removeAll
()
void
WimaController
::
removeAll
()
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
;
}
bool
changesApplied
=
false
;
bool
changesApplied
=
false
;
while
(
_
visualItems
->
count
()
>
0
)
{
while
(
_
container
->
visualItems
()
->
count
()
>
0
)
{
removeArea
(
0
);
removeArea
(
0
);
changesApplied
=
true
;
changesApplied
=
true
;
}
}
...
@@ -194,11 +222,16 @@ void WimaController::resumeMission()
...
@@ -194,11 +222,16 @@ void WimaController::resumeMission()
bool
WimaController
::
updateMission
()
bool
WimaController
::
updateMission
()
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
false
;
}
#define debug 0
#define debug 0
// pick first WimaGOperationArea
// pick first WimaGOperationArea
WimaGOperationArea
*
opArea
=
nullptr
;
WimaGOperationArea
*
opArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_
visualItems
->
get
(
i
));
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
if
(
currentArea
!=
nullptr
){
opArea
=
currentArea
;
opArea
=
currentArea
;
break
;
break
;
...
@@ -209,8 +242,8 @@ bool WimaController::updateMission()
...
@@ -209,8 +242,8 @@ bool WimaController::updateMission()
// pick first WimaServiceArea
// pick first WimaServiceArea
WimaServiceArea
*
serArea
=
nullptr
;
WimaServiceArea
*
serArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_
visualItems
->
get
(
i
));
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
if
(
currentArea
!=
nullptr
){
serArea
=
currentArea
;
serArea
=
currentArea
;
break
;
break
;
...
@@ -221,8 +254,8 @@ bool WimaController::updateMission()
...
@@ -221,8 +254,8 @@ bool WimaController::updateMission()
// pick first WimaVCorridor
// pick first WimaVCorridor
WimaVCorridor
*
corridor
=
nullptr
;
WimaVCorridor
*
corridor
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_
visualItems
->
get
(
i
));
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
if
(
currentArea
!=
nullptr
){
corridor
=
currentArea
;
corridor
=
currentArea
;
break
;
break
;
...
@@ -230,11 +263,13 @@ bool WimaController::updateMission()
...
@@ -230,11 +263,13 @@ bool WimaController::updateMission()
}
}
updateJoinedArea
();
#if debug
#if debug
WimaArea
*
joinedAreaPt
=
new
WimaArea
(
joinedArea
,
this
);
_container
->
visualItems
()
->
append
(
&
_joinedArea
);
_visualItems
->
append
(
joinedAreaPt
);
#endif
#endif
// reset visual items
// reset visual items
_missionController
->
removeAll
();
_missionController
->
removeAll
();
QmlObjectListModel
*
missionItems
=
_missionController
->
visualItems
();
QmlObjectListModel
*
missionItems
=
_missionController
->
visualItems
();
...
@@ -280,7 +315,7 @@ bool WimaController::updateMission()
...
@@ -280,7 +315,7 @@ bool WimaController::updateMission()
QGeoCoordinate
start
=
serArea
->
center
();
QGeoCoordinate
start
=
serArea
->
center
();
QGeoCoordinate
end
=
survey
->
visualTransectPoints
().
first
().
value
<
QGeoCoordinate
>
();
QGeoCoordinate
end
=
survey
->
visualTransectPoints
().
first
().
value
<
QGeoCoordinate
>
();
QList
<
QGeoCoordinate
>
path
;
QList
<
QGeoCoordinate
>
path
;
WimaArea
::
dijkstraPath
(
start
,
end
,
_joinedArea
,
path
);
WimaArea
::
dijkstraPath
(
start
,
end
,
*
_container
->
joinedArea
()
,
path
);
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
sequenceNumber
=
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
missionItems
->
count
()
-
1
);
sequenceNumber
=
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
missionItems
->
count
()
-
1
);
_missionController
->
setCurrentPlanViewIndex
(
sequenceNumber
,
true
);
_missionController
->
setCurrentPlanViewIndex
(
sequenceNumber
,
true
);
...
@@ -290,7 +325,7 @@ bool WimaController::updateMission()
...
@@ -290,7 +325,7 @@ bool WimaController::updateMission()
start
=
survey
->
visualTransectPoints
().
last
().
value
<
QGeoCoordinate
>
();
start
=
survey
->
visualTransectPoints
().
last
().
value
<
QGeoCoordinate
>
();
end
=
serArea
->
center
();
end
=
serArea
->
center
();
path
.
clear
();
path
.
clear
();
WimaArea
::
dijkstraPath
(
start
,
end
,
_joinedArea
,
path
);
WimaArea
::
dijkstraPath
(
start
,
end
,
*
_container
->
joinedArea
()
,
path
);
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
sequenceNumber
=
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
missionItems
->
count
());
sequenceNumber
=
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
missionItems
->
count
());
_missionController
->
setCurrentPlanViewIndex
(
sequenceNumber
,
true
);
_missionController
->
setCurrentPlanViewIndex
(
sequenceNumber
,
true
);
...
@@ -366,6 +401,11 @@ bool WimaController::loadFromCurrent()
...
@@ -366,6 +401,11 @@ bool WimaController::loadFromCurrent()
bool
WimaController
::
loadFromFile
(
const
QString
&
filename
)
bool
WimaController
::
loadFromFile
(
const
QString
&
filename
)
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
false
;
}
#define debug 0
#define debug 0
QString
errorString
;
QString
errorString
;
QString
errorMessage
=
tr
(
"Error loading Plan file (%1). %2"
).
arg
(
filename
).
arg
(
"%1"
);
QString
errorMessage
=
tr
(
"Error loading Plan file (%1). %2"
).
arg
(
filename
).
arg
(
"%1"
);
...
@@ -396,7 +436,7 @@ bool WimaController::loadFromFile(const QString &filename)
...
@@ -396,7 +436,7 @@ bool WimaController::loadFromFile(const QString &filename)
// AreaItems
// AreaItems
QJsonArray
areaArray
=
json
[
areaItemsName
].
toArray
();
QJsonArray
areaArray
=
json
[
areaItemsName
].
toArray
();
_
visualItems
->
clear
();
_
container
->
visualItems
()
->
clear
();
for
(
int
i
=
0
;
i
<
areaArray
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
areaArray
.
size
();
i
++
)
{
QJsonObject
jsonArea
=
areaArray
[
i
].
toObject
();
QJsonObject
jsonArea
=
areaArray
[
i
].
toObject
();
...
@@ -411,7 +451,7 @@ bool WimaController::loadFromFile(const QString &filename)
...
@@ -411,7 +451,7 @@ bool WimaController::loadFromFile(const QString &filename)
return
false
;
return
false
;
}
}
_
visualItems
->
append
(
area
);
_
container
->
visualItems
()
->
append
(
area
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
}
else
if
(
jsonArea
[
WimaArea
::
areaTypeName
]
==
WimaGOperationArea
::
wimaGOperationAreaName
)
{
}
else
if
(
jsonArea
[
WimaArea
::
areaTypeName
]
==
WimaGOperationArea
::
wimaGOperationAreaName
)
{
WimaGOperationArea
*
opArea
=
new
WimaGOperationArea
(
this
);
WimaGOperationArea
*
opArea
=
new
WimaGOperationArea
(
this
);
...
@@ -422,7 +462,7 @@ bool WimaController::loadFromFile(const QString &filename)
...
@@ -422,7 +462,7 @@ bool WimaController::loadFromFile(const QString &filename)
return
false
;
return
false
;
}
}
_
visualItems
->
append
(
opArea
);
_
container
->
visualItems
()
->
append
(
opArea
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
}
else
if
(
jsonArea
[
WimaArea
::
areaTypeName
]
==
WimaServiceArea
::
wimaServiceAreaName
)
{
}
else
if
(
jsonArea
[
WimaArea
::
areaTypeName
]
==
WimaServiceArea
::
wimaServiceAreaName
)
{
WimaServiceArea
*
serArea
=
new
WimaServiceArea
(
this
);
WimaServiceArea
*
serArea
=
new
WimaServiceArea
(
this
);
...
@@ -433,7 +473,7 @@ bool WimaController::loadFromFile(const QString &filename)
...
@@ -433,7 +473,7 @@ bool WimaController::loadFromFile(const QString &filename)
return
false
;
return
false
;
}
}
_
visualItems
->
append
(
serArea
);
_
container
->
visualItems
()
->
append
(
serArea
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
}
else
if
(
jsonArea
[
WimaArea
::
areaTypeName
]
==
WimaVCorridor
::
wimaVCorridorName
)
{
}
else
if
(
jsonArea
[
WimaArea
::
areaTypeName
]
==
WimaVCorridor
::
wimaVCorridorName
)
{
WimaVCorridor
*
corridor
=
new
WimaVCorridor
(
this
);
WimaVCorridor
*
corridor
=
new
WimaVCorridor
(
this
);
...
@@ -444,7 +484,7 @@ bool WimaController::loadFromFile(const QString &filename)
...
@@ -444,7 +484,7 @@ bool WimaController::loadFromFile(const QString &filename)
return
false
;
return
false
;
}
}
_
visualItems
->
append
(
corridor
);
_
container
->
visualItems
()
->
append
(
corridor
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
}
else
{
}
else
{
errorString
+=
QString
(
tr
(
"%s not supported.
\n
"
).
arg
(
WimaArea
::
areaTypeName
));
errorString
+=
QString
(
tr
(
"%s not supported.
\n
"
).
arg
(
WimaArea
::
areaTypeName
));
...
@@ -529,19 +569,24 @@ void WimaController::recalcAll()
...
@@ -529,19 +569,24 @@ void WimaController::recalcAll()
void
WimaController
::
recalcPolygonInteractivity
(
int
index
)
void
WimaController
::
recalcPolygonInteractivity
(
int
index
)
{
{
if
(
index
>=
0
&&
index
<
_visualItems
->
count
())
{
if
(
_container
!=
nullptr
&&
index
>=
0
&&
index
<
_container
->
visualItems
()
->
count
())
{
resetAllInteractive
();
resetAllInteractive
();
WimaArea
*
interactivePoly
=
qobject_cast
<
WimaArea
*>
(
_
visualItems
->
get
(
index
));
WimaArea
*
interactivePoly
=
qobject_cast
<
WimaArea
*>
(
_
container
->
visualItems
()
->
get
(
index
));
interactivePoly
->
setInteractive
(
true
);
interactivePoly
->
setInteractive
(
true
);
}
}
}
}
void
WimaController
::
updateJoinedArea
()
void
WimaController
::
updateJoinedArea
()
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
;
}
// pick first WimaGOperationArea
// pick first WimaGOperationArea
WimaGOperationArea
*
opArea
=
nullptr
;
WimaGOperationArea
*
opArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_
visualItems
->
get
(
i
));
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
if
(
currentArea
!=
nullptr
){
opArea
=
currentArea
;
opArea
=
currentArea
;
break
;
break
;
...
@@ -552,8 +597,8 @@ void WimaController::updateJoinedArea()
...
@@ -552,8 +597,8 @@ void WimaController::updateJoinedArea()
// pick first WimaServiceArea
// pick first WimaServiceArea
WimaServiceArea
*
serArea
=
nullptr
;
WimaServiceArea
*
serArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_
visualItems
->
get
(
i
));
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
if
(
currentArea
!=
nullptr
){
serArea
=
currentArea
;
serArea
=
currentArea
;
break
;
break
;
...
@@ -564,8 +609,8 @@ void WimaController::updateJoinedArea()
...
@@ -564,8 +609,8 @@ void WimaController::updateJoinedArea()
// pick first WimaVCorridor
// pick first WimaVCorridor
WimaVCorridor
*
corridor
=
nullptr
;
WimaVCorridor
*
corridor
=
nullptr
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_
visualItems
->
get
(
i
));
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
if
(
currentArea
!=
nullptr
){
corridor
=
currentArea
;
corridor
=
currentArea
;
break
;
break
;
...
@@ -574,10 +619,10 @@ void WimaController::updateJoinedArea()
...
@@ -574,10 +619,10 @@ void WimaController::updateJoinedArea()
// join service area, op area and corridor
// join service area, op area and corridor
if
(
corridor
!=
nullptr
)
{
if
(
corridor
!=
nullptr
)
{
WimaArea
::
join
(
*
serArea
,
*
corridor
,
_joinedArea
);
WimaArea
::
join
(
*
serArea
,
*
corridor
,
*
_container
->
joinedArea
()
);
_
joinedArea
.
join
(
*
opArea
);
_
container
->
joinedArea
()
->
join
(
*
opArea
);
}
else
{
}
else
{
WimaArea
::
join
(
*
serArea
,
*
opArea
,
_joinedArea
);
WimaArea
::
join
(
*
serArea
,
*
opArea
,
*
_container
->
joinedArea
()
);
}
}
emit
joinedAreaChanged
()
;
emit
joinedAreaChanged
()
;
...
@@ -585,10 +630,15 @@ void WimaController::updateJoinedArea()
...
@@ -585,10 +630,15 @@ void WimaController::updateJoinedArea()
void
WimaController
::
resetAllInteractive
()
void
WimaController
::
resetAllInteractive
()
{
{
int
itemCount
=
_visualItems
->
count
();
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
;
}
int
itemCount
=
_container
->
visualItems
()
->
count
();
if
(
itemCount
>
0
){
if
(
itemCount
>
0
){
for
(
int
i
=
0
;
i
<
itemCount
;
i
++
)
{
for
(
int
i
=
0
;
i
<
itemCount
;
i
++
)
{
WimaArea
*
iteratorPoly
=
qobject_cast
<
WimaArea
*>
(
_
visualItems
->
get
(
i
));
WimaArea
*
iteratorPoly
=
qobject_cast
<
WimaArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
iteratorPoly
->
setInteractive
(
false
);
iteratorPoly
->
setInteractive
(
false
);
}
}
}
}
...
@@ -601,15 +651,20 @@ void WimaController::setInteractive()
...
@@ -601,15 +651,20 @@ void WimaController::setInteractive()
QJsonDocument
WimaController
::
saveToJson
(
FileType
fileType
)
QJsonDocument
WimaController
::
saveToJson
(
FileType
fileType
)
{
{
if
(
_container
==
nullptr
)
{
qWarning
(
"WimaController::addGOperationArea(): container not initialized!"
);
return
QJsonDocument
();
}
QJsonObject
json
;
QJsonObject
json
;
if
(
fileType
==
FileType
::
WimaFile
)
{
if
(
fileType
==
FileType
::
WimaFile
)
{
QJsonArray
jsonArray
;
QJsonArray
jsonArray
;
for
(
int
i
=
0
;
i
<
_
visualItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_
container
->
visualItems
()
->
count
();
i
++
)
{
QJsonObject
json
;
QJsonObject
json
;
WimaArea
*
area
=
qobject_cast
<
WimaArea
*>
(
_
visualItems
->
get
(
i
));
WimaArea
*
area
=
qobject_cast
<
WimaArea
*>
(
_
container
->
visualItems
()
->
get
(
i
));
if
(
area
==
nullptr
)
{
if
(
area
==
nullptr
)
{
qWarning
(
"WimaController::saveToJson(): Internal error, area == nullptr!"
);
qWarning
(
"WimaController::saveToJson(): Internal error, area == nullptr!"
);
...
@@ -650,14 +705,6 @@ QJsonDocument WimaController::saveToJson(FileType fileType)
...
@@ -650,14 +705,6 @@ QJsonDocument WimaController::saveToJson(FileType fileType)
return
_masterController
->
saveToJson
();
return
_masterController
->
saveToJson
();
}
}
return
QJsonDocument
(
json
);
return
QJsonDocument
(
json
);
}
}
...
...
src/Wima/WimaController.h
View file @
7a0feac0
...
@@ -8,22 +8,23 @@
...
@@ -8,22 +8,23 @@
#include "WimaGOperationArea.h"
#include "WimaGOperationArea.h"
#include "WimaServiceArea.h"
#include "WimaServiceArea.h"
#include "WimaVCorridor.h"
#include "WimaVCorridor.h"
#include "WimaDataContainer.h"
#include "PlanMasterController.h"
#include "PlanMasterController.h"
#include "MissionController.h"
#include "MissionController.h"
#include "SurveyComplexItem.h"
#include "SurveyComplexItem.h"
#include "SimpleMissionItem.h"
#include "SimpleMissionItem.h"
#include "MissionSettingsItem.h"
#include "MissionSettingsItem.h"
#include "JsonHelper.h"
#include "JsonHelper.h"
#include "QGCApplication.h"
#include "QGCApplication.h"
class
WimaController
:
public
QObject
class
WimaController
:
public
QObject
{
{
Q_OBJECT
enum
FileType
{
WimaFile
,
PlanFile
};
enum
FileType
{
WimaFile
,
PlanFile
};
Q_OBJECT
public:
public:
WimaController
(
QObject
*
parent
=
nullptr
);
WimaController
(
QObject
*
parent
=
nullptr
);
...
@@ -37,20 +38,25 @@ public:
...
@@ -37,20 +38,25 @@ public:
Q_PROPERTY
(
QStringList
saveNameFilters
READ
saveNameFilters
CONSTANT
)
Q_PROPERTY
(
QStringList
saveNameFilters
READ
saveNameFilters
CONSTANT
)
Q_PROPERTY
(
QString
fileExtension
READ
fileExtension
CONSTANT
)
Q_PROPERTY
(
QString
fileExtension
READ
fileExtension
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
joinedAreaCenter
READ
joinedAreaCenter
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
joinedAreaCenter
READ
joinedAreaCenter
CONSTANT
)
Q_PROPERTY
(
QGCMapPolygon
joinedArea
READ
joinedArea
NOTIFY
joinedAreaChanged
)
Q_PROPERTY
(
WimaArea
*
joinedArea
READ
joinedArea
NOTIFY
joinedAreaChanged
)
Q_PROPERTY
(
bool
flyView
READ
flyView
CONSTANT
)
Q_PROPERTY
(
WimaDataContainer
*
dataContainer
READ
dataContainer
WRITE
setDataContainer
NOTIFY
dataContainerChanged
)
// Property accessors
// Property accessors
PlanMasterController
*
masterController
(
void
)
const
{
return
_masterController
;
}
PlanMasterController
*
masterController
(
void
)
const
{
return
_masterController
;
}
MissionController
*
missionController
(
void
)
const
{
return
_missionController
;
}
MissionController
*
missionController
(
void
)
const
{
return
_missionController
;
}
QmlObjectListModel
*
visualItems
(
void
)
const
{
return
_
visualItems
;
}
QmlObjectListModel
*
visualItems
(
void
)
const
{
return
_
container
->
visualItems
()
;
}
int
currentPolygonIndex
(
void
)
const
{
return
_currentPolygonIndex
;
}
int
currentPolygonIndex
(
void
)
const
{
return
_currentPolygonIndex
;
}
QString
currentFile
(
void
)
const
{
return
_currentFile
;
}
QString
currentFile
(
void
)
const
{
return
_currentFile
;
}
QStringList
loadNameFilters
(
void
)
const
;
QStringList
loadNameFilters
(
void
)
const
;
QStringList
saveNameFilters
(
void
)
const
;
QStringList
saveNameFilters
(
void
)
const
;
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QGeoCoordinate
joinedAreaCenter
(
void
)
const
{
return
_joinedArea
.
center
();
}
QGeoCoordinate
joinedAreaCenter
(
void
)
const
{
return
_container
->
joinedArea
()
->
center
();
}
QGCMapPolygon
joinedArea
(
void
)
const
{
return
_joinedArea
.
toQGCPolygon
();
}
WimaArea
*
joinedArea
(
void
)
const
{
return
_container
->
joinedArea
();
}
WimaDataContainer
*
dataContainer
(
void
)
const
{
return
_container
;
}
bool
flyView
(
void
)
const
{
return
_flyView
;
}
...
@@ -59,7 +65,9 @@ public:
...
@@ -59,7 +65,9 @@ public:
void
setMissionController
(
MissionController
*
missionController
);
void
setMissionController
(
MissionController
*
missionController
);
/// Sets the integer index pointing to the current polygon. Current polygon is set interactive.
/// Sets the integer index pointing to the current polygon. Current polygon is set interactive.
void
setCurrentPolygonIndex
(
int
index
);
void
setCurrentPolygonIndex
(
int
index
);
void
setDataContainer
(
WimaDataContainer
*
container
);
Q_INVOKABLE
void
startWimaController
(
bool
flyView
);
Q_INVOKABLE
bool
addGOperationArea
();
Q_INVOKABLE
bool
addGOperationArea
();
/// Removes an area from _visualItems
/// Removes an area from _visualItems
/// @param index Index of the area to be removed
/// @param index Index of the area to be removed
...
@@ -103,6 +111,7 @@ signals:
...
@@ -103,6 +111,7 @@ signals:
void
currentPolygonIndexChanged
(
int
index
);
void
currentPolygonIndexChanged
(
int
index
);
void
currentFileChanged
();
void
currentFileChanged
();
void
joinedAreaChanged
();
void
joinedAreaChanged
();
void
dataContainerChanged
();
private
slots
:
private
slots
:
void
recalcVehicleCorridor
();
void
recalcVehicleCorridor
();
...
@@ -113,12 +122,12 @@ private slots:
...
@@ -113,12 +122,12 @@ private slots:
private:
private:
bool
_planView
;
bool
_flyView
;
QmlObjectListModel
*
_visualItems
;
WimaArea
_joinedArea
;
PlanMasterController
*
_masterController
;
PlanMasterController
*
_masterController
;
MissionController
*
_missionController
;
MissionController
*
_missionController
;
int
_currentPolygonIndex
;
int
_currentPolygonIndex
;
QString
_currentFile
;
QString
_currentFile
;
WimaDataContainer
*
_container
;
};
};
src/Wima/WimaDataContainer.cc
0 → 100644
View file @
7a0feac0
#include "WimaDataContainer.h"
WimaDataContainer
::
WimaDataContainer
(
QObject
*
parent
)
:
QObject
(
parent
)
,
_visualItems
(
this
)
,
_joinedArea
(
this
)
{
}
src/Wima/WimaDataContainer.h
0 → 100644
View file @
7a0feac0
#ifndef WIMADATACONTAINER_H
#define WIMADATACONTAINER_H
#include <QObject>
#include "QmlObjectListModel.h"
#include "WimaArea.h"
class
WimaDataContainer
:
public
QObject
{
Q_OBJECT
public:
explicit
WimaDataContainer
(
QObject
*
parent
=
nullptr
);
QmlObjectListModel
*
visualItems
(
void
)
{
return
&
_visualItems
;
}
WimaArea
*
joinedArea
(
void
)
{
return
&
_joinedArea
;
}
signals:
public
slots
:
private:
QmlObjectListModel
_visualItems
;
WimaArea
_joinedArea
;
};
#endif // WIMADATACONTAINER_H
src/WimaView/WimaView.qml
View file @
7a0feac0
...
@@ -68,7 +68,7 @@ QGCView {
...
@@ -68,7 +68,7 @@ QGCView {
property
var
_appSettings
:
QGroundControl
.
settingsManager
.
appSettings
property
var
_appSettings
:
QGroundControl
.
settingsManager
.
appSettings
readonly
property
int
_layerMission
:
1
readonly
property
int
_layerMission
:
1
readonly
property
int
_layerWima
:
2
readonly
property
int
_layerWima
:
2
readonly
property
string
_armedVehicleUploadPrompt
:
qsTr
(
"
Vehicle is currently armed. Do you want to upload the mission to the vehicle?
"
)
readonly
property
string
_armedVehicleUploadPrompt
:
qsTr
(
"
Vehicle is currently armed. Do you want to upload the mission to the vehicle?
"
)
Component.onCompleted
:
{
Component.onCompleted
:
{
...
@@ -76,6 +76,7 @@ QGCView {
...
@@ -76,6 +76,7 @@ QGCView {
toolbar
.
currentMissionItem
=
Qt
.
binding
(
function
()
{
return
_missionController
.
currentPlanViewItem
})
toolbar
.
currentMissionItem
=
Qt
.
binding
(
function
()
{
return
_missionController
.
currentPlanViewItem
})
_wimaController
.
masterController
=
_planMasterController
_wimaController
.
masterController
=
_planMasterController
_wimaController
.
missionController
=
_planMasterController
.
missionController
_wimaController
.
missionController
=
_planMasterController
.
missionController
_wimaController
.
dataContainer
=
dataContainer
;
}
}
function
addComplexItem
(
complexItemName
)
{
function
addComplexItem
(
complexItemName
)
{
...
@@ -194,6 +195,7 @@ QGCView {
...
@@ -194,6 +195,7 @@ QGCView {
Component.onCompleted
:
{
Component.onCompleted
:
{
wimaController
.
masterController
=
Qt
.
binding
(
function
()
{
return
masterController
})
wimaController
.
masterController
=
Qt
.
binding
(
function
()
{
return
masterController
})
wimaController
.
missionController
=
Qt
.
binding
(
function
()
{
return
masterController
.
missionController
})
wimaController
.
missionController
=
Qt
.
binding
(
function
()
{
return
masterController
.
missionController
})
startWimaController
(
false
/* flyView */
)
}
}
function
addComplexItem
(
complexItemName
)
{
function
addComplexItem
(
complexItemName
)
{
var
coordinate
=
editorMap
.
center
var
coordinate
=
editorMap
.
center
...
...
src/ui/MainWindowInner.qml
View file @
7a0feac0
...
@@ -19,6 +19,7 @@ import QGroundControl.Controls 1.0
...
@@ -19,6 +19,7 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
FlightDisplay
1.0
import
QGroundControl
.
FlightDisplay
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
Wima
1.0
/// Inner common QML for mainWindow
/// Inner common QML for mainWindow
Item
{
Item
{
...
@@ -28,8 +29,6 @@ Item {
...
@@ -28,8 +29,6 @@ Item {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
property
var
wimaController
property
bool
wimaAvailable
:
wimaViewLoader
.
wimaController
!==
undefined
property
var
currentPopUp
:
null
property
var
currentPopUp
:
null
property
real
currentCenterX
:
0
property
real
currentCenterX
:
0
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
...
@@ -50,16 +49,6 @@ Item {
...
@@ -50,16 +49,6 @@ Item {
}
}
}
}
onWimaAvailableChanged
:
{
if
(
available
)
{
wimaController
=
wimaViewLoader
.
wimaController
console
.
log
(
"
WimaController connected
"
);
}
else
{
wimaController
=
undefined
}
}
function
disableToolbar
()
{
function
disableToolbar
()
{
toolbarBlocker
.
enabled
=
true
toolbarBlocker
.
enabled
=
true
...
@@ -88,7 +77,7 @@ Item {
...
@@ -88,7 +77,7 @@ Item {
if
(
settingsViewLoader
.
source
!=
_settingsViewSource
)
{
if
(
settingsViewLoader
.
source
!=
_settingsViewSource
)
{
settingsViewLoader
.
source
=
_settingsViewSource
settingsViewLoader
.
source
=
_settingsViewSource
}
}
settingsViewLoader
.
visible
=
true
,
wimaFlightView
settingsViewLoader
.
visible
=
true
toolBar
.
checkSettingsButton
()
toolBar
.
checkSettingsButton
()
}
}
...
@@ -182,6 +171,11 @@ Item {
...
@@ -182,6 +171,11 @@ Item {
}
}
}
}
// Wima Data Container
WimaDataContainer
{
id
:
wimaDataContainer
}
MessageDialog
{
MessageDialog
{
id
:
unsavedMissionCloseDialog
id
:
unsavedMissionCloseDialog
title
:
qsTr
(
"
%1 close
"
).
arg
(
QGroundControl
.
appName
)
title
:
qsTr
(
"
%1 close
"
).
arg
(
QGroundControl
.
appName
)
...
@@ -192,15 +186,6 @@ Item {
...
@@ -192,15 +186,6 @@ Item {
onYes
:
activeConnectionsCloseDialog
.
check
()
onYes
:
activeConnectionsCloseDialog
.
check
()
// here what to do?
// here what to do?
function
check
()
{
function
check
()
{
if
(
planViewLoader
.
item
&&
planViewLoader
.
item
.
dirty
)
{
if
(
planViewLoader
.
item
&&
planViewLoader
.
item
.
dirty
)
{
...
@@ -397,8 +382,9 @@ Item {
...
@@ -397,8 +382,9 @@ Item {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
false
visible
:
false
property
var
planToolBar
:
planToolBar
property
var
planToolBar
:
planToolBar
}
wimaController
:
wimaViewLoader
.
wimaController
?
wimaViewLoader
.
wimaController
:
undefined
property
var
dataContainer
:
wimaDataContainer
}
Loader
{
Loader
{
...
@@ -414,7 +400,8 @@ Item {
...
@@ -414,7 +400,8 @@ Item {
anchors.fill
:
parent
anchors.fill
:
parent
visible
:
false
visible
:
false
property
var
toolbar
:
wimaToolBar
property
var
toolbar
:
wimaToolBar
property
var
dataContainer
:
wimaDataContainer
}
}
...
@@ -422,6 +409,8 @@ Item {
...
@@ -422,6 +409,8 @@ Item {
id
:
flightView
id
:
flightView
anchors.fill
:
parent
anchors.fill
:
parent
visible
:
true
visible
:
true
property
var
dataContainer
:
wimaDataContainer
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-- Loader helper for any child, no matter how deep can display an element
//-- Loader helper for any child, no matter how deep can display an element
// on top of the video window.
// on top of the video window.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment