QGroundControl 自定义命令小工具的使用
2018-03-07 17:36
232 查看
Custom Command Widgets
不用编译qgc的源码,仅仅需要编写一个QML UIs文件这个小工具窗口可以被加载,并且从重启之后仍然可以使用,而且不受操作系统的限制
主要有两个用途 1查询显示(接收) 2自定义发送命令(mavlink message)
编写QML文件
import QtQuick 2.2 import QGroundControl.Controls 1.0 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 import QGroundControl.Palette 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controllers 1.0 Rectangle { anchors.fill: parent color: qgcPal.window CustomCommandWidgetController { id: controller factPanel: panel } QGCPalette { id: qgcPal; colorGroupEnabled: enabled } Column { spacing: ScreenTools.defaultFontPixelHeight //Sending custom command(standarder custom) //定义一个按钮 用于发送命令 QGCButton { //neme text: "Set Home to current position" // Arguments to CustomCommandWidgetController::sendCommand (MAVLink COMMAND_LONG) // command id // component id // confirmation // param 1-7 onClicked: controller.sendCommand(179, 50, 0, 1, 0, 0, 0, 0, 0, 0) //send mavlink } //Parameter editors //设置一个文本框 用于设置参数 // The FactTextField control is bound to the specified parameter. Note that there is no validation. FactTextField { // The -1 signals default component id. // You can replace it with a specific component id if you like fact: controller.getParameterFact(-1, "MAV_SYS_ID") } } }
参考文档
QGroundControl Developers Guide相关文章推荐
- 自定义 WebSphere Studio 以将 Struts 脚本工具与 Jython 中的 ActionClass 一起使用
- ★ AjaxControlToolkit 微软出的ajax.net 工具使用教程一
- AjaxControlToolkit 微软出的ajax.net 工具使用教程二 Accordion(折叠)控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程三 AlwaysVisibleControlExtender(浮动)控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程六 使用UpdatePanel控件(一)
- AjaxControlToolkit 微软出的ajax.net 工具使用教程四 CollapsiblePanelExtender(隐藏)控件的使用
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- AjaxControlToolkit 微软出的ajax.net 工具使用教程九 DragPanelExtender(拖拉)控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十四 PopupControlExtender(弹出) 控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十二 HoverMenuExtender(滑出菜单) 控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十五 RoundedCornersExtender(圆角) 控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十七 使用CascadingDropDown(联动) 控件
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十九 AnimationExtender (动态)控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程七 使用UpdatePanel控件(二)
- ★ AjaxControlToolkit 微软出的ajax.net 工具使用教程四 CollapsiblePanelExtender控件的使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十六 TextBoxWatermarkExtender(水印) 控件的使用
- 使用java的native2ascii工具命令来转换编码gbk,gb2312,utf-8
- AjaxControlToolkit 微软出的ajax.net 工具使用教程十一 FilteredTextBoxExtender(筛选) 控件的使用
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍 推荐
- AjaxControlToolkit 微软出的ajax.net 工具使用教程一