Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CANManager, Mount, OpticalFlow, Proximity, SerialManager: alphabetise protocol and type param values #29075

Merged
merged 6 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Tools/autotest/param_metadata/xmlemit.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ def sorted_Values_keys(self, nv_pairs, zero_at_top=False):
keys = nv_pairs.keys()
def sort_key(value):
description = nv_pairs[value]
if zero_at_top and value == "0":
# make sure this item goes at the top of the list:
return "AAAAAAA"
if zero_at_top:
# make sure -1 and 0 appear at the top of the list
if value == "-1":
return "0000000"
if value == "0":
return "0000001"
return description
return sorted(keys, key=sort_key)

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_CANManager/AP_CANManager_CANDriver_Params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const AP_Param::GroupInfo AP_CANManager::CANDriver_Params::var_info[] = {
// @Param: PROTOCOL
// @DisplayName: Enable use of specific protocol over virtual driver
// @Description: Enabling this option starts selected protocol that will use this virtual driver
// @SortValues: AlphabeticalZeroAtTop
// @Values: 0:Disabled,1:DroneCAN,4:PiccoloCAN,6:EFI_NWPMU,7:USD1,8:KDECAN,10:Scripting,11:Benewake,12:Scripting2,13:TOFSenseP,14:NanoRadar
// @User: Advanced
// @RebootRequired: True
Expand All @@ -51,6 +52,7 @@ const AP_Param::GroupInfo AP_CANManager::CANDriver_Params::var_info[] = {
// @Param: PROTOCOL2
// @DisplayName: Secondary protocol with 11 bit CAN addressing
// @Description: Secondary protocol with 11 bit CAN addressing
// @SortValues: AlphabeticalZeroAtTop
// @Values: 0:Disabled,7:USD1,10:Scripting,11:Benewake,12:Scripting2,13:TOFSenseP,14:NanoRadar
// @User: Advanced
// @RebootRequired: True
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_Mount/AP_Mount_Params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const AP_Param::GroupInfo AP_Mount_Params::var_info[] = {
// @Param: _TYPE
// @DisplayName: Mount Type
// @Description: Mount Type
// @SortValues: AlphabeticalZeroAtTop
// @Values: 0:None, 1:Servo, 2:3DR Solo, 3:Alexmos Serial, 4:SToRM32 MAVLink, 5:SToRM32 Serial, 6:Gremsy, 7:BrushlessPWM, 8:Siyi, 9:Scripting, 10:Xacti, 11:Viewpro, 12:Topotek, 13:CADDX
// @RebootRequired: True
// @User: Standard
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_OpticalFlow/AP_OpticalFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const AP_Param::GroupInfo AP_OpticalFlow::var_info[] = {
// @Param: _TYPE
// @DisplayName: Optical flow sensor type
// @Description: Optical flow sensor type
// @SortValues: AlphabeticalZeroAtTop
// @Values: 0:None, 1:PX4Flow, 2:Pixart, 3:Bebop, 4:CXOF, 5:MAVLink, 6:DroneCAN, 7:MSP, 8:UPFLOW
// @User: Standard
// @RebootRequired: True
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_Proximity/AP_Proximity_Params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const AP_Param::GroupInfo AP_Proximity_Params::var_info[] = {
// @Param: _TYPE
// @DisplayName: Proximity type
// @Description: What type of proximity sensor is connected
// @SortValues: AlphabeticalZeroAtTop
// @Values: 0:None,7:LightwareSF40c,2:MAVLink,3:TeraRangerTower,4:RangeFinder,5:RPLidarA2,6:TeraRangerTowerEvo,8:LightwareSF45B,10:SITL,12:AirSimSITL,13:CygbotD1, 14:DroneCAN, 15:Scripting, 16:LD06, 17: MR72_CAN
// @RebootRequired: True
// @User: Standard
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_SerialManager/AP_SerialManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const AP_Param::GroupInfo AP_SerialManager::var_info[] = {
// @Param: 1_PROTOCOL
// @DisplayName: Telem1 protocol selection
// @Description: Control what protocol to use on the Telem1 port. Note that the Frsky options require external converter hardware. See the wiki for details.
// @SortValues: AlphabeticalZeroAtTop
// @Values: -1:None, 1:MAVLink1, 2:MAVLink2, 3:Frsky D, 4:Frsky SPort, 5:GPS, 7:Alexmos Gimbal Serial, 8:Gimbal, 9:Rangefinder, 10:FrSky SPort Passthrough (OpenTX), 11:Lidar360, 13:Beacon, 14:Volz servo out, 15:SBus servo out, 16:ESC Telemetry, 17:Devo Telemetry, 18:OpticalFlow, 19:RobotisServo, 20:NMEA Output, 21:WindVane, 22:SLCAN, 23:RCIN, 24:EFI Serial, 25:LTM, 26:RunCam, 27:HottTelem, 28:Scripting, 29:Crossfire VTX, 30:Generator, 31:Winch, 32:MSP, 33:DJI FPV, 34:AirSpeed, 35:ADSB, 36:AHRS, 37:SmartAudio, 38:FETtecOneWire, 39:Torqeedo, 40:AIS, 41:CoDevESC, 42:DisplayPort, 43:MAVLink High Latency, 44:IRC Tramp, 45:DDS XRCE, 46:IMUDATA, 48:PPP
// @User: Standard
// @RebootRequired: True
Expand Down
Loading