Skip to content

Commit e987dab

Browse files
authored
Merge pull request #6 from dji-sdk/dji_uxsdk_5.0_beta_2
Dji UXSDK 5.0 beta 2
2 parents 14c0ba0 + 49bbde5 commit e987dab

File tree

467 files changed

+22204
-1232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

467 files changed

+22204
-1232
lines changed

DJI-UXSDK-iOS-Beta-Communication.podspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'DJI-UXSDK-iOS-Beta-Communication'
3-
s.version = '0.1.1'
3+
s.version = '0.2'
44
s.license = 'MIT'
55
s.summary = 'Intra-framework, and system communication infrastructure for DJI iOS UX SDK.'
66
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
@@ -15,5 +15,4 @@ Pod::Spec.new do |s|
1515
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES'}
1616
s.cocoapods_version = '>= 1.7.1'
1717
s.source_files = 'DJIUXSDKCommunication/**/*.{h,swift}'
18-
s.public_header_files = 'DJIUXSDKCommunication/**/*.h'
1918
end

DJI-UXSDK-iOS-Beta-Core.podspec

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
Pod::Spec.new do |s|
22
s.name = 'DJI-UXSDK-iOS-Beta-Core'
3-
s.version = '0.1.1'
3+
s.version = '0.2'
44
s.license = 'MIT'
55
s.summary = 'Core utilities for DJI iOS UX SDK.'
66
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
77
s.authors = { 'DJI' => 'dev@dji.com' }
8-
s.documentation_url = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
8+
s.documentation_url = 'https:/github.com//dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
99
s.ios.deployment_target = '11.0'
1010
s.requires_arc = true
1111
s.module_name = 'DJIUXSDKCore'
1212
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
1313
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
14-
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES', 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/'}
14+
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES'}
1515
s.cocoapods_version = '>= 1.7.1'
16-
s.source_files = 'DJIUXSDKCore/**/*.{h,m}'
17-
s.public_header_files = 'DJIUXSDKCore/**/*.h'
18-
s.dependency 'DJI-SDK-iOS', '~> 4.11'
19-
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.1.1'
20-
end
16+
s.source_files = 'DJIUXSDKCore/**/*.{h,m,swift}'
17+
s.dependency 'DJI-SDK-iOS', '~> 4.12'
18+
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.2'
19+
end

DJI-UXSDK-iOS-Beta-Widgets.podspec

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Pod::Spec.new do |s|
22
s.name = 'DJI-UXSDK-iOS-Beta-Widgets'
3-
s.version = '0.1.1'
3+
s.version = '0.2'
44
s.license = 'MIT'
5-
s.summary = 'A collection of widget, widget model, and related helpers for DJI iOS UX SDK.'
5+
s.summary = 'A collection of widget, widget model, and related helpers for DJI iOS UX SDK 5.0 Open Source (Beta 2).'
66
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
77
s.authors = { 'DJI' => 'dev@dji.com' }
88
s.documentation_url = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
@@ -11,11 +11,12 @@ Pod::Spec.new do |s|
1111
s.module_name = 'DJIUXSDKWidgets'
1212
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
1313
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
14-
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES', 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/'}
14+
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES' }
1515
s.cocoapods_version = '>= 1.7.1'
16-
s.source_files = 'DJIUXSDKWidgets/**/*.{h,m}'
17-
s.resource_bundle = { 'DUXBetaAssets' => 'DJIUXSDKWidgets/**/*.xcassets' }
18-
s.dependency 'DJI-SDK-iOS', '~> 4.11'
19-
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.1.1'
20-
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.1.1'
21-
end
16+
s.source_files = 'DJIUXSDKWidgets/**/*.{h,m,swift}'
17+
s.resource_bundle = { 'DUXBetaAssets' => 'DJIUXSDKWidgets/**/*.{xcassets,html,otf}' }
18+
s.dependency 'DJI-SDK-iOS', '~> 4.12'
19+
s.dependency 'DJIWidget', '~> 1.6.2'
20+
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.2'
21+
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.2'
22+
end

DJI-UXSDK-iOS-Beta.podspec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'DJI-UXSDK-iOS-Beta'
3-
s.version = '0.1.1'
3+
s.version = '0.2'
44
s.license = 'MIT'
55
s.summary = 'DJI iOS UX SDK'
66
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
@@ -11,10 +11,10 @@ Pod::Spec.new do |s|
1111
s.module_name = 'DJIUXSDKBeta'
1212
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
1313
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
14-
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES', 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/'}
14+
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES'}
1515
s.cocoapods_version = '>= 1.7.1'
16-
s.source_files = 'DJIUXSDKBeta/**/*.{h,m}'
17-
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.1.1'
18-
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.1.1'
19-
s.dependency 'DJI-UXSDK-iOS-Beta-Widgets', '0.1.1'
20-
end
16+
s.source_files = 'DJIUXSDKBeta/**/*.{h,m,swift}'
17+
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.2'
18+
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.2'
19+
s.dependency 'DJI-UXSDK-iOS-Beta-Widgets', '0.2'
20+
end

DJIUXSDKBeta/DJIUXSDK.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// DJIUXSDK.h
3+
// DJIUXSDK
4+
//
5+
// Copyright © 2018-2020 DJI. All rights reserved.
6+
//
7+
8+
#import <UIKit/UIKit.h>
9+
#import <DJISDK/DJISDK.h>
10+
11+
//! Project version number for DJIUXSDK.
12+
FOUNDATION_EXPORT double DJIUXSDKVersionNumber;
13+
14+
//! Project version string for DJIUXSDK.
15+
FOUNDATION_EXPORT const unsigned char DJIUXSDKVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <DJIUXSDK/PublicHeader.h>
18+
19+
#import <DJIUXSDKCore/DJIUXSDKCore.h>
20+
#import <DJIUXSDKCommunication/DJIUXSDKCommunication.h>
21+
#import <DJIUXSDKWidgets/DJIUXSDKWidgets.h>

DJIUXSDKBeta/DUXBetaSDKAttributes.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//
2-
// DUXBetaSample.h
2+
// DUXBetaSDKAttributes.h
33
// DJIUXSDK
44
//
55
// MIT License
6-
//
6+
//
77
// Copyright © 2018-2019 DJI
8-
//
8+
//
99
// Permission is hereby granted, free of charge, to any person obtaining a copy
1010
// of this software and associated documentation files (the "Software"), to deal
1111
// in the Software without restriction, including without limitation the rights
@@ -27,12 +27,14 @@
2727

2828
#import <Foundation/Foundation.h>
2929

30+
NS_ASSUME_NONNULL_BEGIN
31+
3032
@interface DUXBetaSDKAttributes : NSObject
3133

3234
+ (nonnull NSString *)sdkVersion;
33-
3435
+ (nonnull NSString *)sdkBuildNumber;
35-
3636
+ (nonnull NSArray <NSString *> *)availableWidgets;
3737

38-
@end
38+
@end
39+
40+
NS_ASSUME_NONNULL_END

DJIUXSDKBeta/DUXBetaSDKAttributes.m

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//
2-
// DUXBetaSample.m
2+
// DUXBetaSDKAttributes.m
33
// DJIUXSDK
44
//
55
// MIT License
6-
//
6+
//
77
// Copyright © 2018-2019 DJI
8-
//
8+
//
99
// Permission is hereby granted, free of charge, to any person obtaining a copy
1010
// of this software and associated documentation files (the "Software"), to deal
1111
// in the Software without restriction, including without limitation the rights
@@ -39,18 +39,25 @@ + (nonnull NSString *)sdkBuildNumber {
3939

4040
+ (nonnull NSArray <NSString *> *)availableWidgets {
4141
return @[
42+
@"AirSense Widget",
4243
@"Altitude Widget",
4344
@"Battery Widget",
4445
@"Compass Widget",
46+
@"Connection Widget",
4547
@"Dashboard Widget",
46-
@"Home Distance Widget",
47-
@"Horizontal Velocity Widget",
48+
@"Flight Mode Widget",
49+
@"FPV Widget",
50+
@"GPS Signal Widget",
4851
@"Map Widget",
49-
@"RC Distance Widget",
50-
@"Vertical Velocity Widget",
52+
@"Remaining Flight Time Widget",
53+
@"Remote Control Signal Widget",
54+
@"Simulator Indicator Widget",
55+
@"System Status Widget",
56+
@"System Status List Widget",
57+
@"Video Signal Widget",
5158
@"Vision Widget",
52-
@"VPS Widget",
59+
@"Top Bar Panel Widget"
5360
];
5461
}
5562

56-
@end
63+
@end

DJIUXSDKCommunication/DJIUXSDKCommunication.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// MIT License
66
//
7-
// Copyright © 2018-2019 DJI
7+
// Copyright © 2018-2020 DJI
88
//
99
// Permission is hereby granted, free of charge, to any person obtaining a copy
1010
// of this software and associated documentation files (the "Software"), to deal
@@ -32,3 +32,7 @@ FOUNDATION_EXPORT double DJIUXSDKCommunicationVersionNumber;
3232

3333
//! Project version string for DJIUXSDKCommunication.
3434
FOUNDATION_EXPORT const unsigned char DJIUXSDKCommunicationVersionString[];
35+
36+
// In this header, you should import all the public headers of your framework using statements like #import <DJIUXSDKCommunication/PublicHeader.h>
37+
38+

DJIUXSDKCommunication/GlobalPreferences.swift

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// MIT License
66
//
7-
// Copyright © 2018-2019 DJI
7+
// Copyright © 2018-2020 DJI
88
//
99
// Permission is hereby granted, free of charge, to any person obtaining a copy
1010
// of this software and associated documentation files (the "Software"), to deal
@@ -27,23 +27,41 @@
2727

2828
import Foundation
2929

30-
@objc(DUXBetaMeasureUnitType) public enum MeasureUnitType: Int {
30+
@objc(DUXMeasureUnitType) public enum MeasureUnitType: Int {
3131
case Metric = 1, Imperial = 2, Unknown = 3
3232
}
3333

34+
@objc(DUXFPVCenterViewType) public enum FPVCenterViewType: Int {
35+
case Standard = 1, Cross, NarrowCross, Frame, FrameAndCross, Square, SquareAndCross, Unknown
36+
}
37+
38+
@objc(DUXFPVCenterViewColor) public enum FPVCenterViewColor: Int {
39+
case White = 1, Yellow, Red, Green, Blue, Black, Unknown
40+
}
41+
42+
@objc(DUXFPVGridViewType) public enum FPVGridViewType: Int {
43+
case Parallel = 1, ParallelDiagonal, Unknown
44+
}
45+
3446
enum GlobalPreference: RawRepresentable {
3547
typealias RawValue = String
48+
49+
case MeasureUnitType, AFCEnabled, FPVCenterViewType, FPVCenterViewColor, FPVGridViewType, Unknown
3650

37-
case MeasureUnitType, AFCEnabled, Unknown
38-
39-
static let Prefix = "DUXBetaGlobalPreference"
51+
static let Prefix = "DUXGlobalPreference"
4052

4153
var rawValue: GlobalPreference.RawValue {
4254
switch self {
4355
case .MeasureUnitType:
4456
return GlobalPreference.Prefix + "MeasureUnitType"
4557
case .AFCEnabled:
4658
return GlobalPreference.Prefix + "AFCEnabled"
59+
case .FPVCenterViewType:
60+
return GlobalPreference.Prefix + "FPVCenterViewType"
61+
case .FPVCenterViewColor:
62+
return GlobalPreference.Prefix + "FPVCenterViewColor"
63+
case .FPVGridViewType:
64+
return GlobalPreference.Prefix + "FPVGridViewType"
4765
case .Unknown:
4866
return ""
4967
}
@@ -55,20 +73,35 @@ enum GlobalPreference: RawRepresentable {
5573
self = .MeasureUnitType
5674
case GlobalPreference.Prefix + "AFCEnabled":
5775
self = .AFCEnabled
76+
case GlobalPreference.Prefix + "FPVCenterViewType":
77+
self = .FPVCenterViewType
78+
case GlobalPreference.Prefix + "FPVCenterViewColor":
79+
self = .FPVCenterViewColor
80+
case GlobalPreference.Prefix + "FPVGridViewType":
81+
self = .FPVGridViewType
5882
default:
5983
self = .Unknown
6084
}
6185
}
6286
}
6387

6488
// To create a custom storage mechanism, implement this protocol then call setSharedGlobalPreferences:
65-
// on DUXBetaSingleton to replace the default implementation with a custom one
89+
// on DUXSingleton to replace the default implementation with a custom one
6690
@objc public protocol GlobalPreferences {
6791
func set(measureUnitType:MeasureUnitType)
6892
func measureUnitType() -> MeasureUnitType
6993

7094
func set(AFCEnabled:Bool)
7195
func afcEnabled() -> Bool
96+
97+
func set(centerViewType: FPVCenterViewType)
98+
func centerViewType() -> FPVCenterViewType
99+
100+
func set(centerViewColor: FPVCenterViewColor)
101+
func centerViewColor() -> FPVCenterViewColor
102+
103+
func set(gridViewType: FPVGridViewType)
104+
func gridViewType() -> FPVGridViewType
72105
}
73106

74107
public class DefaultGlobalPreferences: NSObject, GlobalPreferences {
@@ -101,8 +134,43 @@ public class DefaultGlobalPreferences: NSObject, GlobalPreferences {
101134
userDefaults.set(AFCEnabled, forKey: GlobalPreference.AFCEnabled.rawValue)
102135
}
103136

104-
105137
public func afcEnabled() -> Bool {
106138
return userDefaults.bool(forKey: GlobalPreference.AFCEnabled.rawValue)
107139
}
140+
141+
public func set(centerViewType: FPVCenterViewType) {
142+
userDefaults.set(centerViewType.rawValue, forKey: GlobalPreference.FPVCenterViewType.rawValue)
143+
}
144+
145+
public func centerViewType() -> FPVCenterViewType {
146+
let rawCenterViewType = userDefaults.integer(forKey: GlobalPreference.FPVCenterViewType.rawValue)
147+
if let centerViewType = FPVCenterViewType(rawValue: rawCenterViewType) {
148+
return centerViewType
149+
}
150+
return .Unknown
151+
}
152+
153+
public func set(centerViewColor: FPVCenterViewColor) {
154+
userDefaults.set(centerViewColor.rawValue, forKey: GlobalPreference.FPVCenterViewColor.rawValue)
155+
}
156+
157+
public func centerViewColor() -> FPVCenterViewColor {
158+
let rawCenterViewColor = userDefaults.integer(forKey: GlobalPreference.FPVCenterViewColor.rawValue)
159+
if let centerViewColor = FPVCenterViewColor(rawValue: rawCenterViewColor) {
160+
return centerViewColor
161+
}
162+
return .Unknown
163+
}
164+
165+
public func set(gridViewType:FPVGridViewType) {
166+
userDefaults.set(gridViewType.rawValue, forKey: GlobalPreference.FPVGridViewType.rawValue)
167+
}
168+
169+
public func gridViewType() -> FPVGridViewType {
170+
let rawGridViewType = userDefaults.integer(forKey: GlobalPreference.FPVGridViewType.rawValue)
171+
if let gridViewType = FPVGridViewType(rawValue: rawGridViewType) {
172+
return gridViewType
173+
}
174+
return .Unknown
175+
}
108176
}

0 commit comments

Comments
 (0)