Skip to content

Commit 18f857e

Browse files
committed
Rework Remote ID settings to new style
1 parent 506b673 commit 18f857e

File tree

7 files changed

+399
-83
lines changed

7 files changed

+399
-83
lines changed

src/FactSystem/FactControls/LabelledFactTextField.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RowLayout {
2222
property alias textFieldUnitsLabel: _factTextField.unitsLabel
2323
property alias textFieldShowUnits: _factTextField.showUnits
2424
property alias textFieldShowHelp: _factTextField.showHelp
25+
property alias textField: _factTextField
2526

2627
spacing: ScreenTools.defaultFontPixelWidth * 2
2728

src/QmlControls/ParameterEditorDialog.qml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ QGCPopupDialog {
7575
}
7676

7777
Component.onCompleted: {
78-
console.log("ParameterEditor")
7978
if (validate) {
8079
valueField.text = validateValue
8180
validationError.text = fact.validate(validateValue, false /* convertOnly */)
@@ -116,11 +115,12 @@ QGCPopupDialog {
116115
}
117116

118117
QGCComboBox {
119-
id: factCombo
120-
width: _editFieldWidth
121-
model: fact.enumStrings
122-
visible: _showCombo
123-
focus: setFocus && visible
118+
id: factCombo
119+
width: _editFieldWidth
120+
model: fact.enumStrings
121+
sizeToContents: true
122+
visible: _showCombo
123+
focus: setFocus && visible
124124

125125
Component.onCompleted: {
126126
// We can't bind directly to fact.enumIndex since that would add an unknown value

src/QmlControls/SettingsGroupLayout.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import QGroundControl.ScreenTools
66
import QGroundControl.Palette
77

88
ColumnLayout {
9-
id: control
10-
spacing: _margins / 2
11-
implicitWidth: _contentLayout.implicitWidth + (_margins * 2)
12-
implicitHeight: _contentLayout.implicitHeight + (_margins * 2)
9+
id: control
10+
spacing: _margins / 2
11+
implicitWidth: _contentLayout.implicitWidth + (_margins * 2)
12+
implicitHeight: _contentLayout.implicitHeight + (_margins * 2)
1313

1414
default property alias contentItem: _contentLayout.data
1515

src/Settings/RemoteID.SettingsGroup.json

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@
3434
},
3535
{
3636
"name": "selfIDFree",
37-
"shortDesc": "Self ID",
37+
"shortDesc": "Flight Purpose",
3838
"longDesc": "Optional plain text for operator to specify operations data (Free Text). Maximum 23 characters.",
3939
"type": "string",
4040
"default": ""
4141
},
4242
{
4343
"name": "selfIDEmergency",
44-
"shortDesc": "Self ID",
44+
"shortDesc": "Emergency Text",
4545
"longDesc": "Optional plain text for operator to specify operations data (Emergency Text). Maximum 23 characters.",
4646
"type": "string",
4747
"default": "Pilot Emergency Status"
4848
},
4949
{
5050
"name": "selfIDExtended",
51-
"shortDesc": "Self ID",
51+
"shortDesc": "Extended Status",
5252
"longDesc": "Optional plain text for operator to specify operations data (Extended Text). Maximum 23 characters.",
5353
"type": "string",
5454
"default": ""
@@ -57,7 +57,7 @@
5757
"name": "selfIDType",
5858
"shortDesc": "Self ID type",
5959
"type": "uint8",
60-
"enumStrings": "Free Text,Emergency,Extended Status",
60+
"enumStrings": "Flight Purpose,Emergency,Extended Status",
6161
"enumValues": "0,1,2",
6262
"default": 0
6363
},
@@ -78,15 +78,15 @@
7878
"name": "basicIDType",
7979
"shortDesc": "Basic ID Type",
8080
"type": "uint8",
81-
"enumStrings": "None, SerialNumber(ANSI/CTA-2063), CAA, UTM(RFC4122), Specific",
81+
"enumStrings": "None,SerialNumber (ANSI/CTA-2063),CAA,UTM (RFC4122),Specific",
8282
"enumValues": "0,1,2,3,4",
8383
"default": 2
8484
},
8585
{
8686
"name": "basicIDUaType",
8787
"shortDesc": "UA type",
8888
"type": "uint8",
89-
"enumStrings": "Undefined,Airplane/FixedWing,Helicopter/Multirrotor, Gyroplane, VTOL, Ornithopter, Glider, Kite, Free Ballon, Captive Ballon, Airship, Parachute, Rocket, Tethered powered aircraft, Ground Obstacle, Other",
89+
"enumStrings": "Undefined,Airplane/FixedWing,Helicopter/Multirrotor,Gyroplane,VTOL,Ornithopter,Glider,Kite,Free Ballon,Captive Ballon,Airship,Parachute,Rocket,Tethered powered aircraft,Ground Obstacle,Other",
9090
"enumValues": "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15",
9191
"default": 0
9292
},
@@ -111,58 +111,62 @@
111111
"shortDesc": "Location Type",
112112
"longDesc": "Operator location Type",
113113
"type": "uint8",
114-
"enumStrings": "Takeoff(Not Supported),Live GNNS, Fixed",
115-
"enumValues": "0,1,2",
114+
"enumStrings": "Live,Fixed",
115+
"enumValues": "1,2",
116116
"default": 1
117117
},
118118
{
119-
"name": "latitudeFixed",
120-
"shortDesc": "Latitude Fixed",
121-
"longDesc": "Fixed latitude to send on SYSTEM message",
122-
"type": "double",
123-
"decimalPlaces":7,
124-
"default": 0
119+
"name": "latitudeFixed",
120+
"shortDesc": "Latitude Fixed",
121+
"longDesc": "Fixed latitude to send on SYSTEM message",
122+
"type": "double",
123+
"minValue": "-90",
124+
"maxValue": "90",
125+
"decimalPlaces": 7,
126+
"default": 0
125127
},
126128
{
127-
"name": "longitudeFixed",
128-
"shortDesc": "Longitude Fixed",
129-
"longDesc": "Fixed Longitude to send on SYSTEM message",
130-
"type": "double",
131-
"decimalPlaces":7,
132-
"default": 0
129+
"name": "longitudeFixed",
130+
"shortDesc": "Longitude Fixed",
131+
"longDesc": "Fixed Longitude to send on SYSTEM message",
132+
"type": "double",
133+
"minValue": "-180",
134+
"maxValue": "180",
135+
"decimalPlaces": 7,
136+
"default": 0
133137
},
134138
{
135-
"name": "altitudeFixed",
136-
"shortDesc": "Altitude Fixed",
137-
"longDesc": "Fixed Altitude to send on SYSTEM message",
138-
"type": "double",
139-
"decimalPlaces":7,
140-
"default": 0
139+
"name": "altitudeFixed",
140+
"shortDesc": "Altitude Fixed",
141+
"longDesc": "Fixed Altitude to send on SYSTEM message",
142+
"type": "double",
143+
"decimalPlaces": 7,
144+
"default": 0
141145
},
142146
{
143147
"name": "classificationType",
144148
"shortDesc": "Classification Type",
145-
"longDesc": "Classification Type of UA",
149+
"longDesc": "Classification Type of UAS",
146150
"type": "uint8",
147-
"enumStrings": "Undefined,EU",
151+
"enumStrings": "Undeclared,EU",
148152
"enumValues": "0,1",
149153
"default": 0
150154
},
151155
{
152156
"name": "categoryEU",
153-
"shortDesc": "Category EU",
157+
"shortDesc": "Category",
154158
"longDesc": "Category of the UAS in the EU region",
155159
"type": "uint8",
156-
"enumStrings": "Undeclared,Open, Specific, Certified",
160+
"enumStrings": "Undeclared,Open,Specific,Certified",
157161
"enumValues": "0,1,2,3",
158162
"default": 0
159163
},
160164
{
161165
"name": "classEU",
162-
"shortDesc": "Class EU",
166+
"shortDesc": "Class",
163167
"longDesc": "Class of the UAS in the EU region",
164168
"type": "uint8",
165-
"enumStrings": "Undeclared,Class 0, Class 1, Class 2, Class 3, Class 4, Class 5, Class 6",
169+
"enumStrings": "Undeclared,Class 0,Class 1,Class 2,Class 3,Class 4,Class 5,Class 6",
166170
"enumValues": "0,1,2,3,4,5,6,7",
167171
"default": 0
168172
}

src/Vehicle/RemoteIDManager.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ QGC_LOGGING_CATEGORY(RemoteIDManagerLog, "RemoteIDManagerLog")
2020

2121
#define AREA_COUNT 1
2222
#define AREA_RADIUS 0
23+
#define MAVLINK_UNKNOWN_METERS -1000.0f
24+
#define MAVLINK_UNKNOWN_LAT 0
25+
#define MAVLINK_UNKNOWN_LON 0
2326
#define SENDING_RATE_MSEC 1000
2427
#define ALLOWED_GPS_DELAY 5000
2528
#define RID_TIMEOUT 2500 // Messages should be arriving at 1 Hz, so we set a 2 second timeout
@@ -342,15 +345,15 @@ void RemoteIDManager::_sendSystem()
342345
_id_or_mac_unknown,
343346
_settings->locationType()->rawValue().toUInt(),
344347
_settings->classificationType()->rawValue().toUInt(),
345-
_gcsGPSGood ? ( gcsPosition.latitude() * 1.0e7 ) : 0, // If position not valid, send a 0
346-
_gcsGPSGood ? ( gcsPosition.longitude() * 1.0e7 ) : 0, // If position not valid, send a 0
348+
_gcsGPSGood ? ( gcsPosition.latitude() * 1.0e7 ) : MAVLINK_UNKNOWN_LAT,
349+
_gcsGPSGood ? ( gcsPosition.longitude() * 1.0e7 ) : MAVLINK_UNKNOWN_LON,
347350
AREA_COUNT,
348351
AREA_RADIUS,
349-
-1000.0f,
350-
-1000.0f,
352+
MAVLINK_UNKNOWN_METERS,
353+
MAVLINK_UNKNOWN_METERS,
351354
_settings->categoryEU()->rawValue().toUInt(),
352355
_settings->classEU()->rawValue().toUInt(),
353-
_gcsGPSGood ? gcsPosition.altitude() : 0, // If position not valid, send a 0
356+
_gcsGPSGood ? gcsPosition.altitude() : MAVLINK_UNKNOWN_METERS,
354357
_timestamp2019()), // Time stamp needs to be since 00:00:00 1/1/2019
355358
_vehicle->sendMessageOnLinkThreadSafe(sharedLink.get(), msg);
356359
}

0 commit comments

Comments
 (0)