首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用DJI UXSDKDemo (iOS)记录数据的最佳方法

使用DJI UXSDKDemo (iOS)记录数据的最佳方法
EN

Stack Overflow用户
提问于 2018-06-09 03:32:23
回答 1查看 110关注 0票数 1

我想从下面的两个类中提取值,并将它们记录在一个文件中。提取这些值的最佳方法是什么?一个属性观察者会工作并且有效吗?有没有一个主循环或时钟可以用来一致地调用和记录这些数据?任何帮助都将不胜感激。谢谢

    //IMU
EXTERN_KEY NSString *const DJIFlightControllerParamIMUState;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUsCount;

EXTERN_KEY NSString *const DJIFlightControllerParamIMUStateGyroscopeState;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUAccelerometerState;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUStateCalibrationProgress;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUStateCalibrationState;

这是相关的吗?

 @class DJIFlightHubManager;


/**
 *  Delegate to receive updated states related to DJI FlightHub.
 */
@protocol DJIFlightHubManagerDelegate <NSObject>


/**
 *  Updates states for the uploading progress of flight data.
 *  
 *  @param flightHubManager The FlightHub Manager updates the state.
 *  @param state The updated state. When it is `DJIFlightHubUploadStateRejectedByServer`, refer to error for more detail.
 *  @param error The returned error when the upload request is rejected by the server. Use the error to check the reason.
 */
- (void)flightHubManager:(DJIFlightHubManager *)flightHubManager didUpdateUploadState:(DJIFlightHubUploadState)state error:(nullable NSError *)error;

@end
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-09 05:04:54

在这种情况下,DJIFlighthubManager是不相关的-它对应于我们的FlightHub device

对于要写入文件的每个密钥,您需要首先获取并侦听状态,然后将数据写入文件。下面是一个示例:

DJIFlightControllerKey *exampleKey = [DJIFlightControllerKey keyWithParam:DJIFlightControllerParamIMUState];

// Will get called once to get current value of the key
[[DJISDKManager keyManager] getValueForKey:exampleKey withCompletion:^(DJIKeyedValue * _Nullable value, NSError * _Nullable error) {

}];

// Called only when the value for the key changes
[[DJISDKManager keyManager] startListeningForChangesOnKey:exampleKey withListener:self andUpdateBlock:^(DJIKeyedValue * _Nullable oldValue, DJIKeyedValue * _Nullable newValue) {

}];

`

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50767318

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档