forked from UASResearchLaboratory/GCSNetworkPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDjiActivateUI.qml
201 lines (184 loc) · 5.21 KB
/
DjiActivateUI.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import QtQuick 2.0
import QtQml 2.2
import QtQml.Models 2.2
import QtQuick.Controls 1.5
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.2
import QtQuick.Extras 1.4
import QtQuick.Dialogs 1.2
Item {
id: djiActivate
signal activateDjiUav(var list)
property var parentWin
height: 280
width: 285
Rectangle {
id: rectangleDjiActivate
height: 285
color: "#80ffffff"
radius: 5
anchors.topMargin: 0
anchors.fill: parent
TextField {
id: textFieldID
x: 247
text: "1042403"
anchors.bottom: parent.bottom
anchors.bottomMargin: 220
width: 106
anchors.top: textName.bottom
anchors.topMargin: 4
anchors.left: textID.right
anchors.leftMargin: 6
placeholderText: qsTr("Text Field")
}
TextField {
id: textFieldKEY
y: 64
text: "8cb2ae9a083219473aa648ff54bd99ad8ec6b198953243d661f31b8b9929fa59"
anchors.bottom: buttonObtainControl.top
anchors.bottomMargin: 4
anchors.right: parent.right
anchors.rightMargin: 8
height: 25
anchors.left: textKey.right
anchors.leftMargin: 6
placeholderText: qsTr("Text Field")
}
Text {
id: textKey
y: 66
width: 50
height: 25
text: qsTr("KEY")
anchors.bottom: buttonObtainControl.top
anchors.bottomMargin: 4
anchors.left: parent.left
anchors.leftMargin: 8
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: 15
}
Text {
id: textID
y: 35
width: 50
height: 25
text: qsTr("UAV ID")
anchors.bottom: textKey.top
anchors.bottomMargin: 4
anchors.left: parent.left
anchors.leftMargin: 8
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 15
}
Button {
id: buttonActivate
y: 34
height: 27
text: qsTr("Activate")
anchors.right: parent.right
anchors.rightMargin: 8
anchors.left: textFieldID.right
anchors.leftMargin: 1
onClicked:
{
var argumentsList = []
argumentsList.push(textFieldID.text)
argumentsList.push(textFieldKEY.text)
activateDjiUav(argumentsList)
}
}
Button {
id: buttonVersion
x: 171
width: 106
height: 27
text: qsTr("Version")
anchors.top: parent.top
anchors.topMargin: 8
anchors.right: parent.right
anchors.rightMargin: 8
onClicked:
{
functionButtonVersionClicked()
}
}
TextArea {
id: textAreaDjiDisplay
y: 124
height: 150
anchors.bottom: parent.bottom
anchors.bottomMargin: 6
anchors.right: parent.right
anchors.rightMargin: 8
anchors.left: parent.left
anchors.leftMargin: 8
}
Button {
id: buttonObtainControl
x: 8
y: 91
width: 269
height: 27
text: qsTr("Obtain Control")
anchors.bottom: textAreaDjiDisplay.top
anchors.bottomMargin: 4
onClicked:
{
if(buttonObtainControl==="Release Control")
functionDjiObatainControl(false)
else
functionDjiObatainControl(true)
}
}
Text {
id: textName
x: -2
width: 130
height: 25
text: qsTr("DJI Control Panel")
anchors.top: parent.top
anchors.topMargin: 8
anchors.left: parent.left
anchors.leftMargin: 40
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 15
verticalAlignment: Text.AlignVCenter
}
ToolButton {
id: toolButtonClose
text: "X"
anchors.left: parent.left
anchors.leftMargin: 8
anchors.top: parent.top
anchors.topMargin: 8
onClicked:
{
djiActivate.visible = false
}
}
}
function appendDjiApiLogQML(log)
{
textAreaDjiDisplay.append(log)
}
function functionButtonVersionClicked()
{
parentWin.functionButtonVersionClicked()
}
function functionDjiObatainControl(state)
{
parentWin.functionDjiObatainControl(state)
}
function updateObtainControlButton(status)
{
buttonObtainControl.text = status
}
function updateActivateButton(status)
{
buttonActivate.text = status
}
}
//8cb2aae9a083219473aa648ff54bd99ad8ec6b198953243d661f31b8b9929fa59