Setting a parameter via custom dropdown in toolbar

Hi,

I am trying to add a combobox on the toolbar of QgroundControl, where user selected value will be set as BATT2_CAPACITY parameter in ardupilot. So far, I have been able to put the dropdown and figured out that probably I need to call “sendCommand” function from Vehicle module. I might be wrong too, so please help.

I created a QML file inside src/ui/toolbar folder, and added it to _toolIndicatorList inside FirmwarePlugin.cc. I got the dropdown on toolbar, but unable to set the parameter via that.

Below is my code from qml file.

 import QtQuick                              2.11
 import QtQuick.Controls                     2.4

 import QGroundControl                       1.0
 import QGroundControl.Controls              1.0
 import QGroundControl.MultiVehicleManager   1.0
 import QGroundControl.ScreenTools           1.0
 import QGroundControl.Palette               1.0

 QGCComboBox {
     anchors.verticalCenter: parent.verticalCenter
     model:                  ["1000","2000","5000","10000"]
     font.pointSize:         ScreenTools.mediumFontPointSize
     sizeToContents:         true
     property var _activeVehicle:    QGroundControl.multiVehicleManager.activeVehicle
     onActivated: {
         _activeVehicle.sendCommand(...) //ID <-- No idea what to pass here or is this even the correct way.
     }
 }

Please help. Since this is a just a parameter set on ardupilot via simple user input, it should probably be easy. Apologies, if I am being dumb here. Very new.