| 包: | dji.sdk.keyvalue.key |
classSince MSDK 5.0.0
KeyTools
Key工具类。DJI封装了一系列更加简洁易用的方法创建DJIKey实例。
描述:
method
method
createKey
Since MSDK 5.0.0@NonNull |
创建Key实例的默认方法。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIKeyInfo | DJIKey中某个Key接口。例如CameraKey.KeyCameraType,表示相机类型的Key。 |
productId | int | 当前连接上的设备的产品ID,默认为0。 |
componentIndex | int | 云台负载位置。请参考ComponentIndexType设置相应的int值。 |
subComponentType | int | 相机镜头类型。请参考CameraLensType设置相应的int值。 |
subComponentIndex | int | 预留参数。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createKey
Since MSDK 5.0.0@NonNull |
传入某个Key接口的DJIKeyInfo实例的方式创建Key实例。此方法适用于跟云台负载和相机无关的Key的实例创建。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIKeyInfo | DJIKey中某个Key接口。例如FlightControllerKey.KeyAircraftAttitude,表示获取飞行器姿态的Key。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createKey
Since MSDK 5.0.0@NonNull |
传入某个Key接口的DJIKeyInfo实例和云台负载位置的方式创建Key实例。此方法适用于跟云台负载相关的Key的实例创建。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIKeyInfo | DJIKey中某个Key接口。例如GimbalKey.KeyGimbalReset,表示云台重置的Key。 |
componentIndexType | @NonNull | 云台负载位置。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createCameraKey
@NonNull |
传入某个Key接口的DJIKeyInfo实例、云台负载位置和相机镜头类型的方式创建Key实例。此方法适用于跟相机相关的Key的实例创建。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIKeyInfo | DJIKey中某个Key接口。例如CameraKey.KeyCameraType,表示相机类型的Key。 |
componentIndexType | ComponentIndexType | 云台负载位置。 |
cameraLensType | CameraLensType | 相机镜头类型。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createKey
Since MSDK 5.0.0@NonNull |
创建ActionKey实例的默认方法。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIActionKeyInfo | DJIKey中某个Key接口。例如CameraKey.KeyCameraType,表示相机类型的Key。 |
productId | int | 当前连接上的设备的产品ID,默认为0。 |
componentIndex | int | 云台负载位置。请参考ComponentIndexType设置相应的int值。 |
subComponentType | int | 相机镜头类型。请参考CameraLensType设置相应的int值。 |
subComponentIndex | int | 预留参数。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createKey
Since MSDK 5.0.0@NonNull |
传入某个Key接口的DJIKeyInfo实例的方式创建ActionKey实例。此方法适用于跟云台负载和相机无关的ActionKey的实例创建。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIActionKeyInfo | DJIKey中某个Key接口。例如CameraKey.KeyCameraType,表示相机类型的Key。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createKey
Since MSDK 5.0.0static |
传入某个ActionKey接口的DJIKeyInfo实例和云台负载位置的方式创建Key实例。此方法适用于跟云台负载相关的ActionKey的实例创建。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIActionKeyInfo | DJIKey中某个Key接口。例如CameraKey.KeyCameraType,表示相机类型的Key。 |
componentIndexType | ComponentIndexType | 云台负载位置。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
method
method
createCameraKey
@NonNull |
传入某个ActionKey接口的DJIKeyInfo实例、云台负载位置和相机镜头类型的方式创建Key实例。此方法适用于跟相机相关的ActionKey的实例创建。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
mKeyInfo | DJIActionKeyInfo | DJIKey中某个Key接口。例如CameraKey.KeyCameraType,表示相机类型的Key。 |
componentIndexType | ComponentIndexType | 云台负载位置。 |
cameraLensType | CameraLensType | 相机镜头类型。 |
返回值
| 类型 | 说明 |
|---|---|
static | 返回DJIKey实例。 |
Related:
class
class
DJIKeyInfo
Since MSDK 5.0.0class DJIKeyInfo |
Key信息类,定义了Key的能力。
enum
ComponentIndexType
云台负载位置。
枚举成员
| 名称 | 说明 |
|---|---|
LEFT_OR_MAIN | 位于飞行器左舷侧(主)。 |
RIGHT | 位于飞行器右舷侧。 |
UP | 位于飞行器上侧。 |
FPV | 位于飞行器机头侧,一般是FPV的位置。 |
PORT_1 | 位于飞机端口1。 |
PORT_2 | 位于飞机端口2。 |
PORT_3 | 位于飞机端口3。 |
PORT_4 | 位于飞机端口4。 |
PORT_5 | 位于飞机端口5。 |
PORT_6 | 位于飞机端口6。 |
PORT_7 | 位于飞机端口7。 |
PORT_8 | 位于飞机端口8。 |
enum
enum
CameraLensType
相机镜头类型。