Qt定位Gypsy插件

Qt Positioning Gypsy plugin

Qt定位Gypsy插件

Overview

概述

The plugin is an interface to the Gypsy daemon. It requires the daemon to be installed and running on the system to function.

​该插件是Gypsy守护进程的接口。它需要在系统上安装并运行守护程序才能运行。

The plugin uses D-Bus and GLib to connect to GPS device and provide satellite information.

该插件使用D-Bus和GLib连接到GPS设备并提供卫星信息。

Currently the plugin does not provide positioning information.

目前,该插件不提供定位信息。

The plugin can be loaded using provider name gypsy.

可以使用提供者名称gypsy加载插件。

Parameters

参数

The following table lists parameters that can be passed to the gypsy plugin.

下表列出了可以传递给gypsy插件的参数。

ParameterDescription
deviceName

The name of the device (or path to the device file) that will be used to provide satellite information. The typical values can be /dev/ttyUSB0 or /dev/ttyACM0.

将用于提供卫星信息的设备名称(或设备文件的路径)。典型值可以是/dev/ttyUSB0或/dev/ttyACM0。

gconfKey

The key that will be used to extract device name from the GConf configuration system.

将用于从GConf配置系统中提取设备名称的密钥。

The plugin supports two ways of specifying the device name:

该插件支持两种指定设备名称的方式:

  • Specify the device name directly with the deviceName plugin parameter.
  • 直接使用deviceName插件参数指定设备名称。
  • Specify the configuration key using gconfKey plugin parameter and extract the device name from the GConf configuration system. This approach is useful when the device name is already specified for some other GConf-based application.
  • 使用gconfKey插件参数指定配置密钥,并从GConf配置系统中提取设备名称。当已经为其他基于GConf的应用程序指定了设备名称时,这种方法很有用。

By default, when none of the parameters is specified, the plugin will try to extract the device name from the GConf configuration system using the following hardcoded key:

默认情况下,当没有指定任何参数时,插件将尝试使用以下硬编码密钥从GConf配置系统中提取设备名称:

/apps/geoclue/master/org.freedesktop.Geoclue.GPSDevice

Using GConf to set parameters

使用GConf设置参数

To specify a value for a key in the GConf configuration system, use gconftool-2 as follows:

要为GConf配置系统中的键指定值,请使用gconftool-2,如下所示:

gconftool-2 -t string -s /apps/geoclue/master/org.freedesktop.Geoclue.GPSDevice /dev/ttyUSB0

Examples

示例

The following examples show how to create a gypsy satellite info source from C++.

以下示例显示了如何从C++创建gypsy卫星信息源。

Specifying device name directly:

直接指定设备名称:

QVariantMap parameters;
parameters["deviceName"] = "/dev/ttyACM0";
QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createSource("gypsy", parameters, this);

Using GConf key:

使用GConf键:

QVariantMap parameters;
parameters["gconfKey"] = "/apps/myapp/mykey";
QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createSource("gypsy", parameters, this);

GeoClue v2 pluginNMEA plugin

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值