Skip to content

Commit

Permalink
Merge pull request #8 from dji-sdk/dji-sdk/dji_uxsdk_5.0_beta_3
Browse files Browse the repository at this point in the history
UXSDK 5.0b3 release code
  • Loading branch information
cristina-suciu authored Aug 1, 2020
2 parents e987dab + 2eccdf4 commit 35f2ae6
Show file tree
Hide file tree
Showing 325 changed files with 11,386 additions and 4,533 deletions.
4 changes: 2 additions & 2 deletions DJI-UXSDK-iOS-Beta-Communication.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'DJI-UXSDK-iOS-Beta-Communication'
s.version = '0.2'
s.version = '0.3'
s.license = 'MIT'
s.summary = 'Intra-framework, and system communication infrastructure for DJI iOS UX SDK.'
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
s.authors = { 'DJI' => 'dev@dji.com' }
s.documentation_url = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
s.ios.deployment_target = '11.0'
s.swift_version = '5.0'
s.requires_arc = true
s.swift_version = '5.0'
s.module_name = 'DJIUXSDKCommunication'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
Expand Down
9 changes: 5 additions & 4 deletions DJI-UXSDK-iOS-Beta-Core.podspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
Pod::Spec.new do |s|
s.name = 'DJI-UXSDK-iOS-Beta-Core'
s.version = '0.2'
s.version = '0.3'
s.license = 'MIT'
s.summary = 'Core utilities for DJI iOS UX SDK.'
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
s.authors = { 'DJI' => 'dev@dji.com' }
s.documentation_url = 'https:/github.com//dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
s.documentation_url = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
s.ios.deployment_target = '11.0'
s.requires_arc = true
s.swift_version = '5.0'
s.module_name = 'DJIUXSDKCore'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES'}
s.cocoapods_version = '>= 1.7.1'
s.source_files = 'DJIUXSDKCore/**/*.{h,m,swift}'
s.dependency 'DJI-SDK-iOS', '~> 4.12'
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.2'
s.dependency 'DJI-SDK-iOS', '~> 4.13'
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.3'
end
13 changes: 7 additions & 6 deletions DJI-UXSDK-iOS-Beta-Widgets.podspec
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
Pod::Spec.new do |s|
s.name = 'DJI-UXSDK-iOS-Beta-Widgets'
s.version = '0.2'
s.version = '0.3'
s.license = 'MIT'
s.summary = 'A collection of widget, widget model, and related helpers for DJI iOS UX SDK 5.0 Open Source (Beta 2).'
s.summary = 'A collection of widget, widget model, and related helpers for DJI iOS UX SDK.'
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
s.authors = { 'DJI' => 'dev@dji.com' }
s.documentation_url = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
s.ios.deployment_target = '11.0'
s.requires_arc = true
s.swift_version = '5.0'
s.module_name = 'DJIUXSDKWidgets'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES' }
s.cocoapods_version = '>= 1.7.1'
s.source_files = 'DJIUXSDKWidgets/**/*.{h,m,swift}'
s.resource_bundle = { 'DUXBetaAssets' => 'DJIUXSDKWidgets/**/*.{xcassets,html,otf}' }
s.dependency 'DJI-SDK-iOS', '~> 4.12'
s.dependency 'DJIWidget', '~> 1.6.2'
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.2'
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.2'
s.dependency 'DJI-SDK-iOS', '~> 4.13'
s.dependency 'DJIWidget', '~> 1.6.3'
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.3'
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.3'
end
9 changes: 5 additions & 4 deletions DJI-UXSDK-iOS-Beta.podspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
Pod::Spec.new do |s|
s.name = 'DJI-UXSDK-iOS-Beta'
s.version = '0.2'
s.version = '0.3'
s.license = 'MIT'
s.summary = 'DJI iOS UX SDK'
s.homepage = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS'
s.authors = { 'DJI' => 'dev@dji.com' }
s.documentation_url = 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS/wiki'
s.ios.deployment_target = '11.0'
s.requires_arc = true
s.swift_version = '5.0'
s.module_name = 'DJIUXSDKBeta'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load' }
s.source = { :git => 'https://github.com/dji-sdk/Mobile-UXSDK-Beta-iOS.git', :tag => s.version.to_s }
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'DEFINES_MODULE' => 'YES'}
s.cocoapods_version = '>= 1.7.1'
s.source_files = 'DJIUXSDKBeta/**/*.{h,m,swift}'
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.2'
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.2'
s.dependency 'DJI-UXSDK-iOS-Beta-Widgets', '0.2'
s.dependency 'DJI-UXSDK-iOS-Beta-Core', '0.3'
s.dependency 'DJI-UXSDK-iOS-Beta-Communication', '0.3'
s.dependency 'DJI-UXSDK-iOS-Beta-Widgets', '0.3'
end
22 changes: 21 additions & 1 deletion DJIUXSDKBeta/DJIUXSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@
// DJIUXSDK.h
// DJIUXSDK
//
// Copyright © 2018-2020 DJI. All rights reserved.
// MIT License
//
// Copyright © 2018-2020 DJI
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

#import <UIKit/UIKit.h>
Expand Down
2 changes: 1 addition & 1 deletion DJIUXSDKBeta/DUXBetaSDKAttributes.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2018-2019 DJI
// Copyright © 2018-2020 DJI
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 9 additions & 9 deletions DJIUXSDKCommunication/GlobalPreferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@

import Foundation

@objc(DUXMeasureUnitType) public enum MeasureUnitType: Int {
@objc(DUXBetaMeasureUnitType) public enum MeasureUnitType: Int {
case Metric = 1, Imperial = 2, Unknown = 3
}

@objc(DUXFPVCenterViewType) public enum FPVCenterViewType: Int {
case Standard = 1, Cross, NarrowCross, Frame, FrameAndCross, Square, SquareAndCross, Unknown
@objc(DUXBetaFPVCenterViewType) public enum FPVCenterViewType: Int {
case None = 0, Standard, Cross, NarrowCross, Frame, FrameAndCross, Square, SquareAndCross, Unknown
}

@objc(DUXFPVCenterViewColor) public enum FPVCenterViewColor: Int {
case White = 1, Yellow, Red, Green, Blue, Black, Unknown
@objc(DUXBetaFPVCenterViewColor) public enum FPVCenterViewColor: Int {
case None = 0, White, Yellow, Red, Green, Blue, Black, Unknown
}

@objc(DUXFPVGridViewType) public enum FPVGridViewType: Int {
case Parallel = 1, ParallelDiagonal, Unknown
@objc(DUXBetaFPVGridViewType) public enum FPVGridViewType: Int {
case None = 0, Parallel, ParallelDiagonal, Unknown
}

enum GlobalPreference: RawRepresentable {
typealias RawValue = String

case MeasureUnitType, AFCEnabled, FPVCenterViewType, FPVCenterViewColor, FPVGridViewType, Unknown

static let Prefix = "DUXGlobalPreference"
static let Prefix = "DUXBetaGlobalPreference"

var rawValue: GlobalPreference.RawValue {
switch self {
Expand Down Expand Up @@ -86,7 +86,7 @@ enum GlobalPreference: RawRepresentable {
}

// To create a custom storage mechanism, implement this protocol then call setSharedGlobalPreferences:
// on DUXSingleton to replace the default implementation with a custom one
// on DUXBetaSingleton to replace the default implementation with a custom one
@objc public protocol GlobalPreferences {
func set(measureUnitType:MeasureUnitType)
func measureUnitType() -> MeasureUnitType
Expand Down
18 changes: 9 additions & 9 deletions DJIUXSDKCommunication/ObservableInMemoryKeyedStore.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DUXBroadcaster.swift
// DUXBetaBroadcaster.swift
// DJIUXSDK
//
// MIT License
Expand Down Expand Up @@ -141,7 +141,7 @@ enum Type {
}

// ExternalKey bridges to the Key / ConcreteKey types that cannot be used in obj-c
@objc(DUXKey) public class ExternalKey : NSObject {
@objc(DUXBetaKey) public class ExternalKey : NSObject {
var concreteKey:ConcreteKey {
get {
return ConcreteKey(index:self.index, parameter:self.internalParameter)
Expand Down Expand Up @@ -179,12 +179,12 @@ enum Type {
// 4. Make sure it is mapped by the appropriate conversion method back to the public type
// 5. You're done!

@objc(DUXCameraParameter) public enum CameraParameter : UInt {
@objc(DUXBetaCameraParameter) public enum CameraParameter : UInt {
case AFCEnabled = 1,
Unknown = 2
}

@objc(DUXCameraKey) public class CameraKey : ExternalKey {
@objc(DUXBetaCameraKey) public class CameraKey : ExternalKey {
public var param:CameraParameter {
return self.internalParameter.cameraParameter()
}
Expand All @@ -195,13 +195,13 @@ enum Type {
}
}

@objc(DUXVideoParameter) public enum VideoParameter : UInt {
@objc(DUXBetaVideoParameter) public enum VideoParameter : UInt {
case DecoderStatus = 1,
PeakingThreshold = 2,
Unknown = 3
}

@objc(DUXVideoKey) public class VideoKey : ExternalKey {
@objc(DUXBetaVideoKey) public class VideoKey : ExternalKey {
@objc public init(index: Int, parameter: VideoParameter) {
super.init(index: index,
param: Parameter(videoParameter: parameter))
Expand All @@ -228,12 +228,12 @@ enum Type {
}
}

@objc(DUXVoiceNotificationParameter) public enum VoiceNotificationParameter : UInt {
@objc(DUXBetaVoiceNotificationParameter) public enum VoiceNotificationParameter : UInt {
case Attitude = 1,
Unknown = 3
}

@objc(DUXVoiceNotificationKey) public class VoiceNotificationKey : ExternalKey {
@objc(DUXBetaVoiceNotificationKey) public class VoiceNotificationKey : ExternalKey {
@objc public init(index: Int, parameter: VoiceNotificationParameter) {
super.init(index: index,
param: Parameter(voiceNotificationParameter: parameter))
Expand Down Expand Up @@ -268,7 +268,7 @@ typealias ModelValueCompletionBlock = (ModelValue?) -> Void

class FlatStore: NSObject {
var underlyingStore:[ConcreteKey:ModelValue] = [:]
var queue:DispatchQueue = DispatchQueue(label: "DUXFlatStoreSerialQueue")
var queue:DispatchQueue = DispatchQueue(label: "DUXBetaFlatStoreSerialQueue")

func update(modelValue:ModelValue?, for key:ConcreteKey) {
self.queue.async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DUXStateChangeBaseData.h
// DUXBetaStateChangeBaseData.h
// DJIUXSDKCore
//
// Copyright © 2018-2020 DJI
Expand Down Expand Up @@ -27,14 +27,14 @@

NS_ASSUME_NONNULL_BEGIN
/**
* This is DUXStateChangeBaseData, the base class for data transmitted by the UI and Model hooks supplied throughtout the UX SDK code base
* This is DUXBetaStateChangeBaseData, the base class for data transmitted by the UI and Model hooks supplied throughtout the UX SDK code base
* to notify developer of chaniging events.
* Each instance of this class or it's descendents contains a key and a value for that key. It is dependent on the receiver to know what kind of data to expect
* with the hook. Convenience methods have been supplied in this class for easy access to the contents.
*
* The key can be retrieved as a string, using the key method.
*/
@interface DUXStateChangeBaseData : NSObject
@interface DUXBetaStateChangeBaseData : NSObject
/**
* Initialization methods for each of the types of data to be delivered.
*/
Expand All @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithKey:(NSString*)key object:(id)object;

/**
* Accessors for the contents of the DUXStateChangeBaseData instance.
* Accessors for the contents of the DUXBetaStateChangeBaseData instance.
*/
- (NSString*)key;
- (NSValue*)value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DUXStateChangeBaseData.m
// DUXBetaStateChangeBaseData.m
// DJIUXSDKCore
//
// Copyright © 2018-2020 DJI
Expand All @@ -23,13 +23,13 @@
// SOFTWARE.
//

#import "DUXStateChangeBaseData.h"
#import "DUXBetaStateChangeBaseData.h"

@interface DUXStateChangeBaseData ()
@interface DUXBetaStateChangeBaseData ()
@property (nonatomic, strong) NSMutableDictionary *dict;
@end

@implementation DUXStateChangeBaseData
@implementation DUXBetaStateChangeBaseData

- (instancetype)initWithKey:(NSString*)key {
if (self = [super init]) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DUXStateChangeBroadcaster.h
// DUXBetaStateChangeBroadcaster.h
// DJIUXSDKCore
//
// Copyright © 2018-2020 DJI
Expand All @@ -24,20 +24,20 @@
//

#import <Foundation/Foundation.h>
#import "DUXStateChangeBaseData.h"
#import "DUXBetaStateChangeBaseData.h"
NS_ASSUME_NONNULL_BEGIN

typedef void(^AnalyticsHandler)(DUXStateChangeBaseData *analyticsData);
typedef void(^AnalyticsHandler)(DUXBetaStateChangeBaseData *analyticsData);

@interface DUXStateChangeBroadcaster : NSObject
+ (DUXStateChangeBroadcaster*) instance;
+ (void)send:(DUXStateChangeBaseData*)analyticsData; // Convenience method to just send
@interface DUXBetaStateChangeBroadcaster : NSObject
+ (DUXBetaStateChangeBroadcaster *)instance;
+ (void)send:(DUXBetaStateChangeBaseData*)analyticsData; // Convenience method to just send

- (void)registerListener:(id)listener analyticsClassName:(NSString*)analyticsClassName handler:(AnalyticsHandler)block;
- (void)unregisterListener:(id)listener;
- (void)unregisterListener:(id)listener forClassName:(NSString*)analyticsClassNane;

- (void)send:(DUXStateChangeBaseData*)analyticsData;
- (void)send:(DUXBetaStateChangeBaseData*)analyticsData;
@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 35f2ae6

Please sign in to comment.