amap_map_fluttify
This commit is contained in:
59
ios/Classes/SubHandler/Custom/PathSmooth/MASmoothPathTool.h
Normal file
59
ios/Classes/SubHandler/Custom/PathSmooth/MASmoothPathTool.h
Normal file
@ -0,0 +1,59 @@
|
||||
//
|
||||
// MASmoothPathTool.h
|
||||
// iOS-path-smooth
|
||||
//
|
||||
// Created by shaobin on 2017/10/12.
|
||||
// Copyright © 2017年 autonavi. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface MALonLatPoint : NSObject
|
||||
@property (nonatomic, assign) double lat;
|
||||
@property (nonatomic, assign) double lon;
|
||||
@end
|
||||
|
||||
@interface MASmoothPathTool : NSObject
|
||||
|
||||
@property (nonatomic, assign) int intensity;
|
||||
@property (nonatomic, assign) float threshHold;
|
||||
@property (nonatomic, assign) int noiseThreshhold;
|
||||
|
||||
/**
|
||||
* 轨迹平滑优化
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @return 优化后轨迹list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)pathOptimize:(NSArray<MALonLatPoint*>*)originlist;
|
||||
|
||||
/**
|
||||
* 轨迹线路滤波
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @return 滤波处理后的轨迹list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)kalmanFilterPath:(NSArray<MALonLatPoint*>*)originlist;
|
||||
|
||||
|
||||
/**
|
||||
* 轨迹去噪,删除垂距大于20m的点
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @return 去燥后的list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)removeNoisePoint:(NSArray<MALonLatPoint*>*)originlist;
|
||||
|
||||
/**
|
||||
* 单点滤波
|
||||
* @param lastLoc 上次定位点坐标
|
||||
* @param curLoc 本次定位点坐标
|
||||
* @return 滤波后本次定位点坐标值
|
||||
*/
|
||||
- (MALonLatPoint*)kalmanFilterPoint:(MALonLatPoint*)lastLoc curLoc:(MALonLatPoint*)curLoc;
|
||||
|
||||
/**
|
||||
* 轨迹抽稀
|
||||
* @param inPoints 待抽稀的轨迹list,至少包含两个点,删除垂距小于mThreshhold的点
|
||||
* @return 抽稀后的轨迹list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)reducerVerticalThreshold:(NSArray<MALonLatPoint*>*)inPoints;
|
||||
|
||||
@end
|
297
ios/Classes/SubHandler/Custom/PathSmooth/MASmoothPathTool.m
Normal file
297
ios/Classes/SubHandler/Custom/PathSmooth/MASmoothPathTool.m
Normal file
@ -0,0 +1,297 @@
|
||||
//
|
||||
// MASmoothPathTool.m
|
||||
// iOS-path-smooth
|
||||
//
|
||||
// Created by shaobin on 2017/10/12.
|
||||
// Copyright © 2017年 autonavi. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MASmoothPathTool.h"
|
||||
#import <MAMapKit/MAMapKit.h>
|
||||
|
||||
@implementation MALonLatPoint
|
||||
@end
|
||||
|
||||
@implementation MASmoothPathTool
|
||||
{
|
||||
double lastLocation_x; //上次位置
|
||||
double currentLocation_x;//这次位置
|
||||
double lastLocation_y; //上次位置
|
||||
double currentLocation_y;//这次位置
|
||||
double estimate_x; //修正后数据
|
||||
double estimate_y; //修正后数据
|
||||
double pdelt_x; //自预估偏差
|
||||
double pdelt_y; //自预估偏差
|
||||
double mdelt_x; //上次模型偏差
|
||||
double mdelt_y; //上次模型偏差
|
||||
double gauss_x; //高斯噪音偏差
|
||||
double gauss_y; //高斯噪音偏差
|
||||
double kalmanGain_x; //卡尔曼增益
|
||||
double kalmanGain_y; //卡尔曼增益
|
||||
|
||||
double m_R;
|
||||
double m_Q;
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
|
||||
if(self) {
|
||||
self.intensity = 3;
|
||||
self.threshHold = 0.3f;
|
||||
self.noiseThreshhold = 10;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
/**
|
||||
* 轨迹平滑优化
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @return 优化后轨迹list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)pathOptimize:(NSArray<MALonLatPoint*>*)originlist {
|
||||
|
||||
NSArray<MALonLatPoint*>* list = [self removeNoisePoint:originlist];//去噪
|
||||
NSArray<MALonLatPoint*>* afterList = [self kalmanFilterPath:list intensity:self.intensity];//滤波
|
||||
NSArray<MALonLatPoint*>* pathoptimizeList = [self reducerVerticalThreshold:afterList threshHold:self.threshHold];//抽稀
|
||||
return pathoptimizeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 轨迹线路滤波
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @return 滤波处理后的轨迹list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)kalmanFilterPath:(NSArray<MALonLatPoint*>*)originlist {
|
||||
return [self kalmanFilterPath:originlist intensity:self.intensity];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 轨迹去噪,删除垂距大于20m的点
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @return 去燥后的list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)removeNoisePoint:(NSArray<MALonLatPoint*>*)originlist{
|
||||
return [self reduceNoisePoint:originlist threshHold:self.noiseThreshhold];
|
||||
}
|
||||
|
||||
/**
|
||||
* 单点滤波
|
||||
* @param lastLoc 上次定位点坐标
|
||||
* @param curLoc 本次定位点坐标
|
||||
* @return 滤波后本次定位点坐标值
|
||||
*/
|
||||
- (MALonLatPoint*)kalmanFilterPoint:(MALonLatPoint*)lastLoc curLoc:(MALonLatPoint*)curLoc {
|
||||
return [self kalmanFilterPoint:lastLoc curLoc:curLoc intensity:self.intensity];
|
||||
}
|
||||
|
||||
/**
|
||||
* 轨迹抽稀
|
||||
* @param inPoints 待抽稀的轨迹list,至少包含两个点,删除垂距小于mThreshhold的点
|
||||
* @return 抽稀后的轨迹list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)reducerVerticalThreshold:(NSArray<MALonLatPoint*>*)inPoints {
|
||||
return [self reducerVerticalThreshold:inPoints threshHold:self.threshHold];
|
||||
}
|
||||
|
||||
/********************************************************************************************************/
|
||||
/**
|
||||
* 轨迹线路滤波
|
||||
* @param originlist 原始轨迹list,list.size大于2
|
||||
* @param intensity 滤波强度(1—5)
|
||||
* @return 滤波后的list
|
||||
*/
|
||||
- (NSArray<MALonLatPoint*>*)kalmanFilterPath:(NSArray<MALonLatPoint*>*)originlist intensity:(int)intensity {
|
||||
if (!originlist || originlist.count <= 2) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSMutableArray<MALonLatPoint*>* kalmanFilterList = [NSMutableArray array];
|
||||
|
||||
[self initial];//初始化滤波参数
|
||||
|
||||
MALonLatPoint* point = nil;
|
||||
MALonLatPoint* lastLoc = [[MALonLatPoint alloc] init];
|
||||
lastLoc.lat = [originlist objectAtIndex:0].lat;
|
||||
lastLoc.lon = [originlist objectAtIndex:0].lon;
|
||||
[kalmanFilterList addObject:lastLoc];
|
||||
|
||||
for (int i = 1; i < originlist.count; i++) {
|
||||
MALonLatPoint* curLoc = [originlist objectAtIndex:i];
|
||||
point = [self kalmanFilterPoint:lastLoc curLoc:curLoc intensity:intensity];
|
||||
if (point) {
|
||||
[kalmanFilterList addObject:point];
|
||||
lastLoc = point;
|
||||
}
|
||||
}
|
||||
return kalmanFilterList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单点滤波
|
||||
* @param lastLoc 上次定位点坐标
|
||||
* @param curLoc 本次定位点坐标
|
||||
* @param intensity 滤波强度(1—5)
|
||||
* @return 滤波后本次定位点坐标值
|
||||
*/
|
||||
- (MALonLatPoint*)kalmanFilterPoint:(MALonLatPoint*)lastLoc curLoc:(MALonLatPoint*)curLoc intensity:(int)intensity {
|
||||
if (!lastLoc || !curLoc){
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (pdelt_x == 0 || pdelt_y == 0 ){
|
||||
[self initial];
|
||||
}
|
||||
|
||||
MALonLatPoint* point = nil;
|
||||
if (intensity < 1){
|
||||
intensity = 1;
|
||||
} else if (intensity > 5){
|
||||
intensity = 5;
|
||||
}
|
||||
for (int j = 0; j < intensity; j++){
|
||||
point = [self kalmanFilter:lastLoc.lon value_x:curLoc.lon oldValue_y:lastLoc.lat value_y:curLoc.lat];
|
||||
curLoc = point;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
|
||||
/***************************卡尔曼滤波开始********************************/
|
||||
|
||||
//初始模型
|
||||
- (void)initial {
|
||||
pdelt_x = 0.001;
|
||||
pdelt_y = 0.001;
|
||||
// mdelt_x = 0;
|
||||
// mdelt_y = 0;
|
||||
mdelt_x = 5.698402909980532E-4;
|
||||
mdelt_y = 5.698402909980532E-4;
|
||||
}
|
||||
|
||||
- (MALonLatPoint*)kalmanFilter:(double)oldValue_x value_x:(double)value_x oldValue_y:(double)oldValue_y value_y:(double)value_y{
|
||||
lastLocation_x = oldValue_x;
|
||||
currentLocation_x= value_x;
|
||||
|
||||
gauss_x = sqrt(pdelt_x * pdelt_x + mdelt_x * mdelt_x)+m_Q; //计算高斯噪音偏差
|
||||
kalmanGain_x = sqrt((gauss_x * gauss_x)/(gauss_x * gauss_x + pdelt_x * pdelt_x)) +m_R; //计算卡尔曼增益
|
||||
estimate_x = kalmanGain_x * (currentLocation_x - lastLocation_x) + lastLocation_x; //修正定位点
|
||||
mdelt_x = sqrt((1-kalmanGain_x) * gauss_x *gauss_x); //修正模型偏差
|
||||
|
||||
lastLocation_y = oldValue_y;
|
||||
currentLocation_y = value_y;
|
||||
gauss_y = sqrt(pdelt_y * pdelt_y + mdelt_y * mdelt_y)+m_Q; //计算高斯噪音偏差
|
||||
kalmanGain_y = sqrt((gauss_y * gauss_y)/(gauss_y * gauss_y + pdelt_y * pdelt_y)) +m_R; //计算卡尔曼增益
|
||||
estimate_y = kalmanGain_y * (currentLocation_y - lastLocation_y) + lastLocation_y; //修正定位点
|
||||
mdelt_y = sqrt((1-kalmanGain_y) * gauss_y * gauss_y); //修正模型偏差
|
||||
|
||||
MALonLatPoint *point = [[MALonLatPoint alloc] init];
|
||||
point.lon = estimate_x;
|
||||
point.lat = estimate_y;
|
||||
|
||||
return point;
|
||||
}
|
||||
/***************************卡尔曼滤波结束**********************************/
|
||||
|
||||
/***************************抽稀算法*************************************/
|
||||
- (NSArray<MALonLatPoint*>*)reducerVerticalThreshold:(NSArray<MALonLatPoint*>*)inPoints threshHold:(float)threshHold {
|
||||
if(inPoints.count < 2) {
|
||||
return inPoints;
|
||||
}
|
||||
|
||||
NSMutableArray *ret = [NSMutableArray arrayWithCapacity:inPoints.count];
|
||||
|
||||
for(int i = 0; i < inPoints.count; ++i) {
|
||||
MALonLatPoint *pre = ret.lastObject;
|
||||
MALonLatPoint *cur = [inPoints objectAtIndex:i];
|
||||
|
||||
|
||||
if (!pre || i == inPoints.count - 1) {
|
||||
[ret addObject:[inPoints objectAtIndex:i]];
|
||||
continue;
|
||||
}
|
||||
|
||||
MALonLatPoint *next = [inPoints objectAtIndex:(i + 1)];
|
||||
|
||||
MAMapPoint curP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(cur.lat, cur.lon));
|
||||
MAMapPoint prevP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(pre.lat, pre.lon));
|
||||
MAMapPoint nextP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(next.lat, next.lon));
|
||||
double distance = [self calculateDistanceFromPoint:curP lineBegin:prevP lineEnd:nextP];
|
||||
if (distance >= threshHold) {
|
||||
[ret addObject:cur];
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (MALonLatPoint*)getLastLocation:(NSArray<MALonLatPoint*>*)oneGraspList {
|
||||
if (!oneGraspList || oneGraspList.count == 0) {
|
||||
return nil;
|
||||
}
|
||||
NSInteger locListSize = oneGraspList.count;
|
||||
MALonLatPoint* lastLocation = [oneGraspList objectAtIndex:(locListSize - 1)];
|
||||
return lastLocation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算当前点到线的垂线距离
|
||||
* @param pt 当前点
|
||||
* @param begin 线的起点
|
||||
* @param end 线的终点
|
||||
*
|
||||
*/
|
||||
- (double)calculateDistanceFromPoint:(MAMapPoint)pt
|
||||
lineBegin:(MAMapPoint)begin
|
||||
lineEnd:(MAMapPoint)end {
|
||||
|
||||
MAMapPoint mappedPoint;
|
||||
double dx = begin.x - end.x;
|
||||
double dy = begin.y - end.y;
|
||||
if(fabs(dx) < 0.00000001 && fabs(dy) < 0.00000001 ) {
|
||||
mappedPoint = begin;
|
||||
} else {
|
||||
double u = (pt.x - begin.x)*(begin.x - end.x) +
|
||||
(pt.y - begin.y)*(begin.y - end.y);
|
||||
u = u/((dx*dx)+(dy*dy));
|
||||
|
||||
mappedPoint.x = begin.x + u*dx;
|
||||
mappedPoint.y = begin.y + u*dy;
|
||||
}
|
||||
|
||||
return MAMetersBetweenMapPoints(pt, mappedPoint);
|
||||
}
|
||||
/***************************抽稀算法结束*********************************/
|
||||
|
||||
- (NSArray<MALonLatPoint*>*)reduceNoisePoint:(NSArray<MALonLatPoint*>*)inPoints threshHold:(float)threshHold {
|
||||
if (!inPoints) {
|
||||
return nil;
|
||||
}
|
||||
if (inPoints.count <= 2) {
|
||||
return inPoints;
|
||||
}
|
||||
|
||||
NSMutableArray<MALonLatPoint*>* ret = [NSMutableArray array];
|
||||
for (int i = 0; i < inPoints.count; i++) {
|
||||
MALonLatPoint* pre = [self getLastLocation:ret];
|
||||
MALonLatPoint* cur = [inPoints objectAtIndex:i];
|
||||
if (!pre || i == inPoints.count - 1) {
|
||||
[ret addObject:cur];
|
||||
continue;
|
||||
}
|
||||
MALonLatPoint* next = [inPoints objectAtIndex:(i + 1)];
|
||||
|
||||
MAMapPoint curP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(cur.lat, cur.lon));
|
||||
MAMapPoint prevP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(pre.lat, pre.lon));
|
||||
MAMapPoint nextP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(next.lat, next.lon));
|
||||
double distance = [self calculateDistanceFromPoint:curP lineBegin:prevP lineEnd:nextP];
|
||||
if (distance < threshHold){
|
||||
[ret addObject:cur];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@end
|
13
ios/Classes/SubHandler/Custom/SubHandlerCustom.h
Normal file
13
ios/Classes/SubHandler/Custom/SubHandlerCustom.h
Normal file
@ -0,0 +1,13 @@
|
||||
//////////////////////////////////////////////////////////
|
||||
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
#import "AmapMapFluttifyPlugin.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface AmapMapFluttifyPlugin (SubHandlerCustom)
|
||||
- (NSDictionary<NSString*, Handler>*) getSubHandlerCustom;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
777
ios/Classes/SubHandler/Custom/SubHandlerCustom.m
Normal file
777
ios/Classes/SubHandler/Custom/SubHandlerCustom.m
Normal file
@ -0,0 +1,777 @@
|
||||
//////////////////////////////////////////////////////////
|
||||
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
#import "SubHandlerCustom.h"
|
||||
#import "PathSmooth/MASmoothPathTool.h"
|
||||
#import <MAMapKit/MAMapKit.h>
|
||||
|
||||
// Dart端一次方法调用所存在的栈, 只有当MethodChannel传递参数受限时, 再启用这个容器
|
||||
extern NSMutableDictionary<NSString*, NSObject*>* STACK;
|
||||
// Dart端随机存取对象的容器
|
||||
extern NSMutableDictionary<NSNumber*, NSObject*>* HEAP;
|
||||
// 日志打印开关
|
||||
extern BOOL enableLog;
|
||||
|
||||
@implementation AmapMapFluttifyPlugin (SubHandlerCustom)
|
||||
- (NSDictionary<NSString*, Handler>*) getSubHandlerCustom {
|
||||
return @{
|
||||
@"MAMapRectIsEmpty::MAMapRectIsEmpty": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// args
|
||||
// struct arg
|
||||
NSValue* rectValue = (NSValue*) args[@"rect"];
|
||||
MAMapRect rect;
|
||||
[rectValue getValue:&rect];
|
||||
|
||||
// ref
|
||||
|
||||
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"fluttify-objc: MAMapRectIsEmpty::MAMapRectIsEmpty(%@)", args[@"rect"]);
|
||||
}
|
||||
|
||||
// invoke native method
|
||||
BOOL result = MAMapRectIsEmpty(rect);
|
||||
|
||||
// result
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
|
||||
@"MALonLatPoint::set_lat_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
double lat = [args[@"lat"] doubleValue];
|
||||
|
||||
// ref
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
ref.lat = lat;
|
||||
methodResult(@"success");
|
||||
}
|
||||
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MALonLatPoint::set_lon_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
double lon = [args[@"lon"] doubleValue];
|
||||
|
||||
// ref
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
ref.lon = lon;
|
||||
methodResult(@"success");
|
||||
}
|
||||
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::set_intensity_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
int intensity = [args[@"intensity"] intValue];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
ref.intensity = intensity;
|
||||
methodResult(@"success");
|
||||
}
|
||||
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::set_threshHold_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
float threshHold = [args[@"threshHold"] floatValue];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
ref.threshHold = threshHold;
|
||||
methodResult(@"success");
|
||||
}
|
||||
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::set_noiseThreshhold_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
int noiseThreshhold = [args[@"noiseThreshhold"] intValue];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
ref.noiseThreshhold = noiseThreshhold;
|
||||
methodResult(@"success");
|
||||
}
|
||||
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MALonLatPoint::get_lat_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// ref object
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
double result = ref.lat;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
|
||||
@"MALonLatPoint::get_lon_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// ref object
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
double result = ref.lon;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::get_intensity_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// ref object
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
int result = ref.intensity;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::get_threshHold_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// ref object
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
float result = ref.threshHold;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::get_noiseThreshhold_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// ref object
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
int result = ref.noiseThreshhold;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::pathOptimize": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"fluttify-objc: MASmoothPathTool@%@::pathOptimize(%@)", args[@"refId"], args[@"originlist"]);
|
||||
}
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref pathOptimize: originlist];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
@"MASmoothPathTool::kalmanFilterPath": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"fluttify-objc: MASmoothPathTool@%@::kalmanFilterPath(%@)", args[@"refId"], args[@"originlist"]);
|
||||
}
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref kalmanFilterPath: originlist];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
@"MASmoothPathTool::removeNoisePoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"fluttify-objc: MASmoothPathTool@%@::removeNoisePoint(%@)", args[@"refId"], args[@"originlist"]);
|
||||
}
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref removeNoisePoint: originlist];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
@"MASmoothPathTool::kalmanFilterPoint_curLoc": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// args
|
||||
// ref arg
|
||||
MALonLatPoint* lastLoc = (MALonLatPoint*) args[@"lastLoc"];
|
||||
// ref arg
|
||||
MALonLatPoint* curLoc = (MALonLatPoint*) args[@"curLoc"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"fluttify-objc: MASmoothPathTool@%@::kalmanFilterPoint(%@, %@)", args[@"refId"], args[@"lastLoc"], args[@"curLoc"]);
|
||||
}
|
||||
|
||||
// invoke native method
|
||||
MALonLatPoint* result = [ref kalmanFilterPoint: lastLoc curLoc: curLoc];
|
||||
|
||||
// result
|
||||
// return a ref
|
||||
id __result__ = result;
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
@"MASmoothPathTool::reducerVerticalThreshold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* inPoints = (NSArray<MALonLatPoint*>*) args[@"inPoints"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"fluttify-objc: MASmoothPathTool@%@::reducerVerticalThreshold(%@)", args[@"refId"], args[@"inPoints"]);
|
||||
}
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref reducerVerticalThreshold: inPoints];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
@"ObjectFactory::createMALonLatPoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"ObjectFactory::createMALonLatPoint");
|
||||
}
|
||||
|
||||
MALonLatPoint* __this__;
|
||||
if ([((NSDictionary<NSString*, id>*) args)[@"init"] boolValue]) {
|
||||
__this__ = [[MALonLatPoint alloc] init];
|
||||
} else {
|
||||
__this__ = [MALonLatPoint alloc];
|
||||
}
|
||||
|
||||
methodResult(__this__);
|
||||
|
||||
if (enableLog) NSLog(@"HEAP: %@", HEAP);
|
||||
},
|
||||
|
||||
@"ObjectFactory::createMASmoothPathTool": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"ObjectFactory::createMASmoothPathTool");
|
||||
}
|
||||
|
||||
MASmoothPathTool* __this__;
|
||||
if ([((NSDictionary<NSString*, id>*) args)[@"init"] boolValue]) {
|
||||
__this__ = [[MASmoothPathTool alloc] init];
|
||||
} else {
|
||||
__this__ = [MASmoothPathTool alloc];
|
||||
}
|
||||
|
||||
methodResult(__this__);
|
||||
|
||||
if (enableLog) NSLog(@"HEAP: %@", HEAP);
|
||||
},
|
||||
|
||||
@"RefClass::isKindOfMALonLatPoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// 引用对象
|
||||
NSObject* __this__ = ((NSDictionary<NSString*, NSObject*>*) args)[@"__this__"];
|
||||
|
||||
BOOL isTargetType = [__this__ isKindOfClass:[MALonLatPoint class]];
|
||||
methodResult(@(isTargetType));
|
||||
},
|
||||
|
||||
@"RefClass::isKindOfMASmoothPathTool": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// 引用对象
|
||||
NSObject* __this__ = ((NSDictionary<NSString*, NSObject*>*) args)[@"__this__"];
|
||||
|
||||
BOOL isTargetType = [__this__ isKindOfClass:[MASmoothPathTool class]];
|
||||
methodResult(@(isTargetType));
|
||||
},
|
||||
|
||||
@"ObjectFactory::create_batchMALonLatPoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray<NSObject*>* resultList = [NSMutableArray array];
|
||||
|
||||
NSNumber* length = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"length"];
|
||||
NSNumber* init = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"init"];
|
||||
for (int __i__ = 0; __i__ < [length integerValue]; __i__++) {
|
||||
MALonLatPoint* __this__;
|
||||
if ([init boolValue]) {
|
||||
__this__ = [[MALonLatPoint alloc] init];
|
||||
} else {
|
||||
__this__ = [MALonLatPoint alloc];
|
||||
}
|
||||
[resultList addObject:__this__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
|
||||
if (enableLog) NSLog(@"HEAP: %@", HEAP);
|
||||
},
|
||||
|
||||
@"ObjectFactory::create_batchMASmoothPathTool": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray<NSObject*>* resultList = [NSMutableArray array];
|
||||
|
||||
NSNumber* length = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"length"];
|
||||
NSNumber* init = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"init"];
|
||||
for (int __i__ = 0; __i__ < [length integerValue]; __i__++) {
|
||||
MASmoothPathTool* __this__;
|
||||
if ([init boolValue]) {
|
||||
__this__ = [[MASmoothPathTool alloc] init];
|
||||
} else {
|
||||
__this__ = [MASmoothPathTool alloc];
|
||||
}
|
||||
[resultList addObject:__this__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
|
||||
if (enableLog) NSLog(@"HEAP: %@", HEAP);
|
||||
},
|
||||
|
||||
|
||||
@"MALonLatPoint::get_lat": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MALonLatPoint::get_lat");
|
||||
}
|
||||
|
||||
// ref object
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
double result = ref.lat;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
|
||||
@"MALonLatPoint::get_lon": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MALonLatPoint::get_lon");
|
||||
}
|
||||
|
||||
// ref object
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
double result = ref.lon;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::get_intensity": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MASmoothPathTool::get_intensity");
|
||||
}
|
||||
|
||||
// ref object
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
int result = ref.intensity;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::get_threshHold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MASmoothPathTool::get_threshHold");
|
||||
}
|
||||
|
||||
// ref object
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
float result = ref.threshHold;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::get_noiseThreshhold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MASmoothPathTool::get_noiseThreshhold");
|
||||
}
|
||||
|
||||
// ref object
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
int result = ref.noiseThreshhold;
|
||||
|
||||
// 返回值: Value
|
||||
NSObject* __result__ = @(result);
|
||||
|
||||
methodResult(__result__);
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::pathOptimize_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref pathOptimize: originlist];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
@"MASmoothPathTool::kalmanFilterPath_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref kalmanFilterPath: originlist];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
@"MASmoothPathTool::removeNoisePoint_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref removeNoisePoint: originlist];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
@"MASmoothPathTool::kalmanFilterPoint_curLoc_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// ref arg
|
||||
MALonLatPoint* lastLoc = (MALonLatPoint*) args[@"lastLoc"];
|
||||
// ref arg
|
||||
MALonLatPoint* curLoc = (MALonLatPoint*) args[@"curLoc"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
MALonLatPoint* result = [ref kalmanFilterPoint: lastLoc curLoc: curLoc];
|
||||
|
||||
// result
|
||||
// return a ref
|
||||
id __result__ = result;
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
@"MASmoothPathTool::reducerVerticalThreshold_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
|
||||
NSMutableArray* resultList = [NSMutableArray array];
|
||||
|
||||
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
|
||||
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
|
||||
|
||||
// args
|
||||
// list arg
|
||||
NSArray<MALonLatPoint*>* inPoints = (NSArray<MALonLatPoint*>*) args[@"inPoints"];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
// invoke native method
|
||||
NSArray<MALonLatPoint*>* result = [ref reducerVerticalThreshold: inPoints];
|
||||
|
||||
// result
|
||||
// 返回值: 列表
|
||||
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
|
||||
for (int __i__ = 0; __i__ < result.count; __i__++) {
|
||||
NSObject* object = [result objectAtIndex:__i__];
|
||||
[__result__ addObject: object];
|
||||
}
|
||||
|
||||
[resultList addObject:__result__];
|
||||
}
|
||||
|
||||
methodResult(resultList);
|
||||
},
|
||||
|
||||
@"MALonLatPoint::set_lat": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MALonLatPoint::set_lat");
|
||||
}
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
double lat = [args[@"lat"] doubleValue];
|
||||
|
||||
// ref
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
ref.lat = lat;
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MALonLatPoint::set_lon": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MALonLatPoint::set_lon");
|
||||
}
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
double lon = [args[@"lon"] doubleValue];
|
||||
|
||||
// ref
|
||||
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
|
||||
|
||||
ref.lon = lon;
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::set_intensity": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MASmoothPathTool::set_intensity");
|
||||
}
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
int intensity = [args[@"intensity"] intValue];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
ref.intensity = intensity;
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::set_threshHold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MASmoothPathTool::set_threshHold");
|
||||
}
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
float threshHold = [args[@"threshHold"] floatValue];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
ref.threshHold = threshHold;
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
@"MASmoothPathTool::set_noiseThreshhold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
|
||||
// print log
|
||||
if (enableLog) {
|
||||
NSLog(@"MASmoothPathTool::set_noiseThreshhold");
|
||||
}
|
||||
|
||||
// args
|
||||
// jsonable arg
|
||||
int noiseThreshhold = [args[@"noiseThreshhold"] intValue];
|
||||
|
||||
// ref
|
||||
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
|
||||
|
||||
ref.noiseThreshhold = noiseThreshhold;
|
||||
methodResult(@"success");
|
||||
},
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user