Skip to content

Commit

Permalink
Rework Remote ID settings to new style
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Mar 10, 2024
1 parent 506b673 commit 18f857e
Show file tree
Hide file tree
Showing 7 changed files with 399 additions and 83 deletions.
1 change: 1 addition & 0 deletions src/FactSystem/FactControls/LabelledFactTextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RowLayout {
property alias textFieldUnitsLabel: _factTextField.unitsLabel
property alias textFieldShowUnits: _factTextField.showUnits
property alias textFieldShowHelp: _factTextField.showHelp
property alias textField: _factTextField

spacing: ScreenTools.defaultFontPixelWidth * 2

Expand Down
12 changes: 6 additions & 6 deletions src/QmlControls/ParameterEditorDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ QGCPopupDialog {
}

Component.onCompleted: {
console.log("ParameterEditor")
if (validate) {
valueField.text = validateValue
validationError.text = fact.validate(validateValue, false /* convertOnly */)
Expand Down Expand Up @@ -116,11 +115,12 @@ QGCPopupDialog {
}

QGCComboBox {
id: factCombo
width: _editFieldWidth
model: fact.enumStrings
visible: _showCombo
focus: setFocus && visible
id: factCombo
width: _editFieldWidth
model: fact.enumStrings
sizeToContents: true
visible: _showCombo
focus: setFocus && visible

Component.onCompleted: {
// We can't bind directly to fact.enumIndex since that would add an unknown value
Expand Down
8 changes: 4 additions & 4 deletions src/QmlControls/SettingsGroupLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import QGroundControl.ScreenTools
import QGroundControl.Palette

ColumnLayout {
id: control
spacing: _margins / 2
implicitWidth: _contentLayout.implicitWidth + (_margins * 2)
implicitHeight: _contentLayout.implicitHeight + (_margins * 2)
id: control
spacing: _margins / 2
implicitWidth: _contentLayout.implicitWidth + (_margins * 2)
implicitHeight: _contentLayout.implicitHeight + (_margins * 2)

default property alias contentItem: _contentLayout.data

Expand Down
68 changes: 36 additions & 32 deletions src/Settings/RemoteID.SettingsGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@
},
{
"name": "selfIDFree",
"shortDesc": "Self ID",
"shortDesc": "Flight Purpose",
"longDesc": "Optional plain text for operator to specify operations data (Free Text). Maximum 23 characters.",
"type": "string",
"default": ""
},
{
"name": "selfIDEmergency",
"shortDesc": "Self ID",
"shortDesc": "Emergency Text",
"longDesc": "Optional plain text for operator to specify operations data (Emergency Text). Maximum 23 characters.",
"type": "string",
"default": "Pilot Emergency Status"
},
{
"name": "selfIDExtended",
"shortDesc": "Self ID",
"shortDesc": "Extended Status",
"longDesc": "Optional plain text for operator to specify operations data (Extended Text). Maximum 23 characters.",
"type": "string",
"default": ""
Expand All @@ -57,7 +57,7 @@
"name": "selfIDType",
"shortDesc": "Self ID type",
"type": "uint8",
"enumStrings": "Free Text,Emergency,Extended Status",
"enumStrings": "Flight Purpose,Emergency,Extended Status",
"enumValues": "0,1,2",
"default": 0
},
Expand All @@ -78,15 +78,15 @@
"name": "basicIDType",
"shortDesc": "Basic ID Type",
"type": "uint8",
"enumStrings": "None, SerialNumber(ANSI/CTA-2063), CAA, UTM(RFC4122), Specific",
"enumStrings": "None,SerialNumber (ANSI/CTA-2063),CAA,UTM (RFC4122),Specific",
"enumValues": "0,1,2,3,4",
"default": 2
},
{
"name": "basicIDUaType",
"shortDesc": "UA type",
"type": "uint8",
"enumStrings": "Undefined,Airplane/FixedWing,Helicopter/Multirrotor, Gyroplane, VTOL, Ornithopter, Glider, Kite, Free Ballon, Captive Ballon, Airship, Parachute, Rocket, Tethered powered aircraft, Ground Obstacle, Other",
"enumStrings": "Undefined,Airplane/FixedWing,Helicopter/Multirrotor,Gyroplane,VTOL,Ornithopter,Glider,Kite,Free Ballon,Captive Ballon,Airship,Parachute,Rocket,Tethered powered aircraft,Ground Obstacle,Other",
"enumValues": "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15",
"default": 0
},
Expand All @@ -111,58 +111,62 @@
"shortDesc": "Location Type",
"longDesc": "Operator location Type",
"type": "uint8",
"enumStrings": "Takeoff(Not Supported),Live GNNS, Fixed",
"enumValues": "0,1,2",
"enumStrings": "Live,Fixed",
"enumValues": "1,2",
"default": 1
},
{
"name": "latitudeFixed",
"shortDesc": "Latitude Fixed",
"longDesc": "Fixed latitude to send on SYSTEM message",
"type": "double",
"decimalPlaces":7,
"default": 0
"name": "latitudeFixed",
"shortDesc": "Latitude Fixed",
"longDesc": "Fixed latitude to send on SYSTEM message",
"type": "double",
"minValue": "-90",
"maxValue": "90",
"decimalPlaces": 7,
"default": 0
},
{
"name": "longitudeFixed",
"shortDesc": "Longitude Fixed",
"longDesc": "Fixed Longitude to send on SYSTEM message",
"type": "double",
"decimalPlaces":7,
"default": 0
"name": "longitudeFixed",
"shortDesc": "Longitude Fixed",
"longDesc": "Fixed Longitude to send on SYSTEM message",
"type": "double",
"minValue": "-180",
"maxValue": "180",
"decimalPlaces": 7,
"default": 0
},
{
"name": "altitudeFixed",
"shortDesc": "Altitude Fixed",
"longDesc": "Fixed Altitude to send on SYSTEM message",
"type": "double",
"decimalPlaces":7,
"default": 0
"name": "altitudeFixed",
"shortDesc": "Altitude Fixed",
"longDesc": "Fixed Altitude to send on SYSTEM message",
"type": "double",
"decimalPlaces": 7,
"default": 0
},
{
"name": "classificationType",
"shortDesc": "Classification Type",
"longDesc": "Classification Type of UA",
"longDesc": "Classification Type of UAS",
"type": "uint8",
"enumStrings": "Undefined,EU",
"enumStrings": "Undeclared,EU",
"enumValues": "0,1",
"default": 0
},
{
"name": "categoryEU",
"shortDesc": "Category EU",
"shortDesc": "Category",
"longDesc": "Category of the UAS in the EU region",
"type": "uint8",
"enumStrings": "Undeclared,Open, Specific, Certified",
"enumStrings": "Undeclared,Open,Specific,Certified",
"enumValues": "0,1,2,3",
"default": 0
},
{
"name": "classEU",
"shortDesc": "Class EU",
"shortDesc": "Class",
"longDesc": "Class of the UAS in the EU region",
"type": "uint8",
"enumStrings": "Undeclared,Class 0, Class 1, Class 2, Class 3, Class 4, Class 5, Class 6",
"enumStrings": "Undeclared,Class 0,Class 1,Class 2,Class 3,Class 4,Class 5,Class 6",
"enumValues": "0,1,2,3,4,5,6,7",
"default": 0
}
Expand Down
13 changes: 8 additions & 5 deletions src/Vehicle/RemoteIDManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ QGC_LOGGING_CATEGORY(RemoteIDManagerLog, "RemoteIDManagerLog")

#define AREA_COUNT 1
#define AREA_RADIUS 0
#define MAVLINK_UNKNOWN_METERS -1000.0f
#define MAVLINK_UNKNOWN_LAT 0
#define MAVLINK_UNKNOWN_LON 0
#define SENDING_RATE_MSEC 1000
#define ALLOWED_GPS_DELAY 5000
#define RID_TIMEOUT 2500 // Messages should be arriving at 1 Hz, so we set a 2 second timeout
Expand Down Expand Up @@ -342,15 +345,15 @@ void RemoteIDManager::_sendSystem()
_id_or_mac_unknown,
_settings->locationType()->rawValue().toUInt(),
_settings->classificationType()->rawValue().toUInt(),
_gcsGPSGood ? ( gcsPosition.latitude() * 1.0e7 ) : 0, // If position not valid, send a 0
_gcsGPSGood ? ( gcsPosition.longitude() * 1.0e7 ) : 0, // If position not valid, send a 0
_gcsGPSGood ? ( gcsPosition.latitude() * 1.0e7 ) : MAVLINK_UNKNOWN_LAT,
_gcsGPSGood ? ( gcsPosition.longitude() * 1.0e7 ) : MAVLINK_UNKNOWN_LON,
AREA_COUNT,
AREA_RADIUS,
-1000.0f,
-1000.0f,
MAVLINK_UNKNOWN_METERS,
MAVLINK_UNKNOWN_METERS,
_settings->categoryEU()->rawValue().toUInt(),
_settings->classEU()->rawValue().toUInt(),
_gcsGPSGood ? gcsPosition.altitude() : 0, // If position not valid, send a 0
_gcsGPSGood ? gcsPosition.altitude() : MAVLINK_UNKNOWN_METERS,
_timestamp2019()), // Time stamp needs to be since 00:00:00 1/1/2019
_vehicle->sendMessageOnLinkThreadSafe(sharedLink.get(), msg);
}
Expand Down
Loading

0 comments on commit 18f857e

Please sign in to comment.