theta-client-react-native 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -1
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +533 -33
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +201 -50
- package/ios/ConvertUtil.swift +573 -105
- package/ios/ThetaClientReactNative.m +25 -15
- package/ios/ThetaClientReactNative.swift +302 -121
- package/lib/commonjs/capture/capture.js +12 -1
- package/lib/commonjs/capture/capture.js.map +1 -1
- package/lib/commonjs/capture/continuous-capture.js +2 -1
- package/lib/commonjs/capture/continuous-capture.js.map +1 -1
- package/lib/commonjs/capture/index.js +11 -0
- package/lib/commonjs/capture/index.js.map +1 -1
- package/lib/commonjs/capture/multi-bracket-capture.js +13 -2
- package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -1
- package/lib/commonjs/capture/time-shift-manual-capture.js +168 -0
- package/lib/commonjs/capture/time-shift-manual-capture.js.map +1 -0
- package/lib/commonjs/theta-repository/access-point.js +5 -1
- package/lib/commonjs/theta-repository/access-point.js.map +1 -1
- package/lib/commonjs/theta-repository/libs/convert-utils.js +22 -0
- package/lib/commonjs/theta-repository/libs/convert-utils.js.map +1 -0
- package/lib/commonjs/theta-repository/libs/index.js +11 -0
- package/lib/commonjs/theta-repository/libs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/notify-controller.js +16 -7
- package/lib/commonjs/theta-repository/notify-controller.js.map +1 -1
- package/lib/commonjs/theta-repository/options/index.js +166 -12
- package/lib/commonjs/theta-repository/options/index.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-access-info.js +30 -0
- package/lib/commonjs/theta-repository/options/option-access-info.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js +2 -0
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-aperture.js +24 -0
- package/lib/commonjs/theta-repository/options/option-aperture.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js +2 -0
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-camera-lock-config.js +2 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock-config.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock.js +27 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-power.js +3 -0
- package/lib/commonjs/theta-repository/options/option-camera-power.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-compass-direction-ref.js +30 -0
- package/lib/commonjs/theta-repository/options/option-compass-direction-ref.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-exposure-compensation.js +64 -0
- package/lib/commonjs/theta-repository/options/option-exposure-compensation.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-file-format.js +29 -1
- package/lib/commonjs/theta-repository/options/option-file-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-gps-tag-recording.js +18 -0
- package/lib/commonjs/theta-repository/options/option-gps-tag-recording.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-microphone-noise-reduction.js +23 -0
- package/lib/commonjs/theta-repository/options/option-microphone-noise-reduction.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-mobile-network-setting.js +32 -0
- package/lib/commonjs/theta-repository/options/option-mobile-network-setting.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-network-type.js +18 -2
- package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-off-delay-usb.js +61 -0
- package/lib/commonjs/theta-repository/options/option-off-delay-usb.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-preview-format.js +12 -6
- package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation-support.js +6 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation-support.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-usb-connection.js +23 -0
- package/lib/commonjs/theta-repository/options/option-usb-connection.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-antenna-config.js +20 -0
- package/lib/commonjs/theta-repository/options/option-wlan-antenna-config.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency-cl-mode.js +2 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency-cl-mode.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +8 -2
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/commonjs/theta-repository/options/options.js +44 -62
- package/lib/commonjs/theta-repository/options/options.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-files.js +5 -1
- package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-info.js +3 -1
- package/lib/commonjs/theta-repository/theta-info.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-repository.js +116 -17
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js +6 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js.map +1 -1
- package/lib/module/capture/capture.js +12 -1
- package/lib/module/capture/capture.js.map +1 -1
- package/lib/module/capture/continuous-capture.js +2 -1
- package/lib/module/capture/continuous-capture.js.map +1 -1
- package/lib/module/capture/index.js +1 -0
- package/lib/module/capture/index.js.map +1 -1
- package/lib/module/capture/multi-bracket-capture.js +13 -2
- package/lib/module/capture/multi-bracket-capture.js.map +1 -1
- package/lib/module/capture/time-shift-manual-capture.js +160 -0
- package/lib/module/capture/time-shift-manual-capture.js.map +1 -0
- package/lib/module/theta-repository/access-point.js +5 -1
- package/lib/module/theta-repository/access-point.js.map +1 -1
- package/lib/module/theta-repository/libs/convert-utils.js +16 -0
- package/lib/module/theta-repository/libs/convert-utils.js.map +1 -0
- package/lib/module/theta-repository/libs/index.js +1 -0
- package/lib/module/theta-repository/libs/index.js.map +1 -1
- package/lib/module/theta-repository/notify-controller.js +16 -7
- package/lib/module/theta-repository/notify-controller.js.map +1 -1
- package/lib/module/theta-repository/options/index.js +16 -2
- package/lib/module/theta-repository/options/index.js.map +1 -1
- package/lib/module/theta-repository/options/option-access-info.js +24 -0
- package/lib/module/theta-repository/options/option-access-info.js.map +1 -0
- package/lib/module/theta-repository/options/option-ai-auto-thumbnail.js +2 -0
- package/lib/module/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/module/theta-repository/options/option-aperture.js +18 -0
- package/lib/module/theta-repository/options/option-aperture.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-control-source.js +2 -0
- package/lib/module/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/module/theta-repository/options/option-camera-lock-config.js +2 -0
- package/lib/module/theta-repository/options/option-camera-lock-config.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-lock.js +21 -0
- package/lib/module/theta-repository/options/option-camera-lock.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-power.js +3 -0
- package/lib/module/theta-repository/options/option-camera-power.js.map +1 -1
- package/lib/module/theta-repository/options/option-compass-direction-ref.js +24 -0
- package/lib/module/theta-repository/options/option-compass-direction-ref.js.map +1 -0
- package/lib/module/theta-repository/options/option-exposure-compensation.js +58 -0
- package/lib/module/theta-repository/options/option-exposure-compensation.js.map +1 -0
- package/lib/module/theta-repository/options/option-file-format.js +29 -1
- package/lib/module/theta-repository/options/option-file-format.js.map +1 -1
- package/lib/module/theta-repository/options/option-gps-tag-recording.js +12 -0
- package/lib/module/theta-repository/options/option-gps-tag-recording.js.map +1 -0
- package/lib/module/theta-repository/options/option-microphone-noise-reduction.js +17 -0
- package/lib/module/theta-repository/options/option-microphone-noise-reduction.js.map +1 -0
- package/lib/module/theta-repository/options/option-mobile-network-setting.js +26 -0
- package/lib/module/theta-repository/options/option-mobile-network-setting.js.map +1 -0
- package/lib/module/theta-repository/options/option-network-type.js +18 -2
- package/lib/module/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/module/theta-repository/options/option-off-delay-usb.js +54 -0
- package/lib/module/theta-repository/options/option-off-delay-usb.js.map +1 -0
- package/lib/module/theta-repository/options/option-preview-format.js +12 -6
- package/lib/module/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation-support.js +2 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation-support.js.map +1 -0
- package/lib/module/theta-repository/options/option-usb-connection.js +17 -0
- package/lib/module/theta-repository/options/option-usb-connection.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-antenna-config.js +14 -0
- package/lib/module/theta-repository/options/option-wlan-antenna-config.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-frequency-cl-mode.js +2 -0
- package/lib/module/theta-repository/options/option-wlan-frequency-cl-mode.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-frequency.js +8 -2
- package/lib/module/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/module/theta-repository/options/options.js +43 -61
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-files.js +5 -1
- package/lib/module/theta-repository/theta-files.js.map +1 -1
- package/lib/module/theta-repository/theta-info.js +3 -1
- package/lib/module/theta-repository/theta-info.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +115 -19
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/theta-state/capture-status.js +6 -1
- package/lib/module/theta-repository/theta-state/capture-status.js.map +1 -1
- package/lib/typescript/capture/capture.d.ts +11 -0
- package/lib/typescript/capture/capture.d.ts.map +1 -1
- package/lib/typescript/capture/continuous-capture.d.ts.map +1 -1
- package/lib/typescript/capture/index.d.ts +1 -0
- package/lib/typescript/capture/index.d.ts.map +1 -1
- package/lib/typescript/capture/multi-bracket-capture.d.ts +13 -2
- package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -1
- package/lib/typescript/capture/time-shift-manual-capture.d.ts +70 -0
- package/lib/typescript/capture/time-shift-manual-capture.d.ts.map +1 -0
- package/lib/typescript/theta-repository/access-point.d.ts +11 -3
- package/lib/typescript/theta-repository/access-point.d.ts.map +1 -1
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts +3 -0
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts.map +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts +3 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/index.d.ts +16 -2
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-access-info.d.ts +91 -0
- package/lib/typescript/theta-repository/options/option-access-info.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-ai-auto-thumbnail.d.ts +2 -0
- package/lib/typescript/theta-repository/options/option-ai-auto-thumbnail.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-aperture.d.ts +18 -0
- package/lib/typescript/theta-repository/options/option-aperture.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts +3 -1
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts +2 -0
- package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-camera-lock-config.d.ts +26 -0
- package/lib/typescript/theta-repository/options/option-camera-lock-config.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-camera-lock.d.ts +21 -0
- package/lib/typescript/theta-repository/options/option-camera-lock.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-camera-power.d.ts +3 -0
- package/lib/typescript/theta-repository/options/option-camera-power.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-compass-direction-ref.d.ts +24 -0
- package/lib/typescript/theta-repository/options/option-compass-direction-ref.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-ethernet-config.d.ts +8 -4
- package/lib/typescript/theta-repository/options/option-ethernet-config.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-exposure-compensation.d.ts +58 -0
- package/lib/typescript/theta-repository/options/option-exposure-compensation.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-file-format.d.ts +42 -0
- package/lib/typescript/theta-repository/options/option-file-format.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-gps-tag-recording.d.ts +12 -0
- package/lib/typescript/theta-repository/options/option-gps-tag-recording.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-microphone-noise-reduction.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-microphone-noise-reduction.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-mobile-network-setting.d.ts +34 -0
- package/lib/typescript/theta-repository/options/option-mobile-network-setting.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-network-type.d.ts +17 -1
- package/lib/typescript/theta-repository/options/option-network-type.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-off-delay-usb.d.ts +36 -0
- package/lib/typescript/theta-repository/options/option-off-delay-usb.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-preview-format.d.ts +12 -6
- package/lib/typescript/theta-repository/options/option-preview-format.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation-support.d.ts +19 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation-support.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-usb-connection.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-usb-connection.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-antenna-config.d.ts +14 -0
- package/lib/typescript/theta-repository/options/option-wlan-antenna-config.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency-cl-mode.d.ts +20 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency-cl-mode.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts +7 -1
- package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/options.d.ts +131 -63
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-files.d.ts +4 -0
- package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-info.d.ts +9 -1
- package/lib/typescript/theta-repository/theta-info.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts +54 -13
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts +5 -0
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capture/capture.ts +11 -0
- package/src/capture/continuous-capture.ts +2 -4
- package/src/capture/index.ts +1 -0
- package/src/capture/multi-bracket-capture.ts +13 -2
- package/src/capture/time-shift-manual-capture.ts +203 -0
- package/src/theta-repository/access-point.ts +11 -3
- package/src/theta-repository/libs/convert-utils.ts +27 -0
- package/src/theta-repository/libs/index.ts +1 -0
- package/src/theta-repository/notify-controller.ts +18 -8
- package/src/theta-repository/options/index.ts +16 -2
- package/src/theta-repository/options/option-access-info.ts +108 -0
- package/src/theta-repository/options/option-ai-auto-thumbnail.ts +2 -0
- package/src/theta-repository/options/option-aperture.ts +18 -0
- package/src/theta-repository/options/option-auto-bracket.ts +3 -7
- package/src/theta-repository/options/option-camera-control-source.ts +3 -0
- package/src/theta-repository/options/option-camera-lock-config.ts +25 -0
- package/src/theta-repository/options/option-camera-lock.ts +22 -0
- package/src/theta-repository/options/option-camera-power.ts +3 -0
- package/src/theta-repository/options/option-compass-direction-ref.ts +25 -0
- package/src/theta-repository/options/option-ethernet-config.ts +8 -4
- package/src/theta-repository/options/option-exposure-compensation.ts +59 -0
- package/src/theta-repository/options/option-file-format.ts +29 -0
- package/src/theta-repository/options/option-gps-tag-recording.ts +13 -0
- package/src/theta-repository/options/option-microphone-noise-reduction.ts +18 -0
- package/src/theta-repository/options/option-mobile-network-setting.ts +38 -0
- package/src/theta-repository/options/option-network-type.ts +17 -1
- package/src/theta-repository/options/option-off-delay-usb.ts +57 -0
- package/src/theta-repository/options/option-preview-format.ts +12 -6
- package/src/theta-repository/options/option-top-bottom-correction-rotation-support.ts +19 -0
- package/src/theta-repository/options/option-usb-connection.ts +18 -0
- package/src/theta-repository/options/option-wlan-antenna-config.ts +15 -0
- package/src/theta-repository/options/option-wlan-frequency-cl-mode.ts +19 -0
- package/src/theta-repository/options/option-wlan-frequency.ts +7 -1
- package/src/theta-repository/options/options.ts +133 -71
- package/src/theta-repository/theta-files.ts +4 -0
- package/src/theta-repository/theta-info.ts +9 -1
- package/src/theta-repository/theta-repository.ts +117 -30
- package/src/theta-repository/theta-state/capture-status.ts +5 -0
- package/theta-client-react-native.podspec +1 -1
package/ios/ConvertUtil.swift
CHANGED
|
@@ -20,7 +20,10 @@ let KEY_REQUEST_TIMEOUT = "requestTimeout"
|
|
|
20
20
|
let KEY_SOCKET_TIMEOUT = "socketTimeout"
|
|
21
21
|
let KEY_THETA_MODEL = "thetaModel"
|
|
22
22
|
let KEY_TIMESHIFT = "timeShift"
|
|
23
|
+
let KEY_AI_AUTO_THUMBNAIL_SUPPORT = "aiAutoThumbnailSupport"
|
|
23
24
|
let KEY_APERTURE = "aperture"
|
|
25
|
+
let KEY_CAMERA_CONTROL_SOURCE_SUPPORT = "cameraControlSourceSupport"
|
|
26
|
+
let KEY_CAMERA_POWER_SUPPORT = "cameraPowerSupport"
|
|
24
27
|
let KEY_CAPTURE_INTERVAL = "captureInterval"
|
|
25
28
|
let KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL = "compositeShootingOutputInterval"
|
|
26
29
|
let KEY_COLOR_TEMPERATURE = "colorTemperature"
|
|
@@ -68,10 +71,41 @@ let KEY_STATE_BOARD_TEMP = "boardTemp"
|
|
|
68
71
|
let KEY_STATE_BATTERY_TEMP = "batteryTemp"
|
|
69
72
|
let KEY_PROXY = "proxy"
|
|
70
73
|
let KEY_IP_ADDRESS = "ipAddress"
|
|
74
|
+
let KEY_MAC_ADDRESS = "macAddress"
|
|
75
|
+
let KEY_HOST_NAME = "hostName"
|
|
71
76
|
let KEY_SUBNET_MASK = "subnetMask"
|
|
72
77
|
let KEY_DEFAULT_GATEWAY = "defaultGateway"
|
|
78
|
+
let KEY_DNS1 = "dns1"
|
|
79
|
+
let KEY_DNS2 = "dns2"
|
|
73
80
|
let KEY_OPTIONS = "options"
|
|
74
81
|
let KEY_STATE = "state"
|
|
82
|
+
let KEY_SSID = "ssid"
|
|
83
|
+
let KEY_SSID_STEALTH = "ssidStealth"
|
|
84
|
+
let KEY_CONNECTION_PRIORITY = "connectionPriority"
|
|
85
|
+
let KEY_AUTH_MODE = "authMode"
|
|
86
|
+
let KEY_PASSWORD = "password"
|
|
87
|
+
let KEY_COLOR_TEMPERATURE_SUPPORT = "colorTemperatureSupport"
|
|
88
|
+
let KEY_WLAN_FREQUENCY_CL_MODE = "wlanFrequencyClMode"
|
|
89
|
+
let KEY_WLAN_FREQUENCY_CL_MODE_2_4 = "enable2_4"
|
|
90
|
+
let KEY_WLAN_FREQUENCY_CL_MODE_5_2 = "enable5_2"
|
|
91
|
+
let KEY_WLAN_FREQUENCY_CL_MODE_5_8 = "enable5_8"
|
|
92
|
+
let KEY_ROAMING = "roaming"
|
|
93
|
+
let KEY_PLAN = "plan"
|
|
94
|
+
let KEY_CAMERA_LOCK_CONFIG_IS_POWER_KEY_LOCKED = "isPowerKeyLocked"
|
|
95
|
+
let KEY_CAMERA_LOCK_CONFIG_IS_SHUTTER_KEY_LOCKED = "isShutterKeyLocked"
|
|
96
|
+
let KEY_CAMERA_LOCK_CONFIG_IS_MODE_KEY_LOCKED = "isModeKeyLocked"
|
|
97
|
+
let KEY_CAMERA_LOCK_CONFIG_IS_WLAN_KEY_LOCKED = "isWlanKeyLocked"
|
|
98
|
+
let KEY_CAMERA_LOCK_CONFIG_IS_FN_KEY_LOCKED = "isFnKeyLocked"
|
|
99
|
+
let KEY_CAMERA_LOCK_CONFIG_IS_PANEL_LOCKED = "isPanelLocked"
|
|
100
|
+
let KEY_DHCP_LEASE_ADDRESS = "dhcpLeaseAddress"
|
|
101
|
+
let KEY_TOP_BOTTOM_CORRECTION_ROTATION_SUPPORT = "topBottomCorrectionRotationSupport"
|
|
102
|
+
let KEY_MAX = "max"
|
|
103
|
+
let KEY_MIN = "min"
|
|
104
|
+
let KEY_STEP_SIZE = "stepSize"
|
|
105
|
+
let KEY_GPS_TAG_RECORDING_SUPPORT = "gpsTagRecordingSupport"
|
|
106
|
+
let KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL_SUPPORT = "compositeShootingOutputIntervalSupport"
|
|
107
|
+
let KEY_COMPOSITE_SHOOTING_TIME_SUPPORT = "compositeShootingTimeSupport"
|
|
108
|
+
let KEY_APERTURE_SUPPORT = "apertureSupport"
|
|
75
109
|
|
|
76
110
|
public class ConvertUtil: NSObject {}
|
|
77
111
|
|
|
@@ -79,67 +113,97 @@ public class ConvertUtil: NSObject {}
|
|
|
79
113
|
|
|
80
114
|
let optionItemNameToEnum = [
|
|
81
115
|
// TODO: Add items when adding options
|
|
116
|
+
"accessInfo": ThetaRepository.OptionNameEnum.accessinfo,
|
|
82
117
|
"aiAutoThumbnail": ThetaRepository.OptionNameEnum.aiautothumbnail,
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
KEY_AI_AUTO_THUMBNAIL_SUPPORT: ThetaRepository.OptionNameEnum.aiautothumbnailsupport,
|
|
119
|
+
KEY_APERTURE: ThetaRepository.OptionNameEnum.aperture,
|
|
120
|
+
KEY_APERTURE_SUPPORT: ThetaRepository.OptionNameEnum.aperturesupport,
|
|
121
|
+
KEY_AUTO_BRACKET: ThetaRepository.OptionNameEnum.autobracket,
|
|
85
122
|
"bitrate": ThetaRepository.OptionNameEnum.bitrate,
|
|
86
123
|
"bluetoothPower": ThetaRepository.OptionNameEnum.bluetoothpower,
|
|
87
124
|
"bluetoothRole": ThetaRepository.OptionNameEnum.bluetoothrole,
|
|
88
|
-
|
|
125
|
+
KEY_BURST_MODE: ThetaRepository.OptionNameEnum.burstmode,
|
|
89
126
|
"burstOption": ThetaRepository.OptionNameEnum.burstoption,
|
|
90
127
|
"cameraControlSource": ThetaRepository.OptionNameEnum.cameracontrolsource,
|
|
128
|
+
KEY_CAMERA_CONTROL_SOURCE_SUPPORT: ThetaRepository.OptionNameEnum.cameracontrolsourcesupport,
|
|
129
|
+
"cameraLock": ThetaRepository.OptionNameEnum.cameralock,
|
|
130
|
+
"cameraLockConfig": ThetaRepository.OptionNameEnum.cameralockconfig,
|
|
91
131
|
"cameraMode": ThetaRepository.OptionNameEnum.cameramode,
|
|
92
132
|
"cameraPower": ThetaRepository.OptionNameEnum.camerapower,
|
|
93
|
-
|
|
133
|
+
KEY_CAMERA_POWER_SUPPORT: ThetaRepository.OptionNameEnum.camerapowersupport,
|
|
134
|
+
KEY_CAPTURE_INTERVAL: ThetaRepository.OptionNameEnum.captureinterval,
|
|
94
135
|
"captureMode": ThetaRepository.OptionNameEnum.capturemode,
|
|
95
136
|
"captureNumber": ThetaRepository.OptionNameEnum.capturenumber,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
KEY_COLOR_TEMPERATURE: ThetaRepository.OptionNameEnum.colortemperature,
|
|
138
|
+
KEY_COLOR_TEMPERATURE_SUPPORT: ThetaRepository.OptionNameEnum.colortemperaturesupport,
|
|
139
|
+
KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL_SUPPORT: ThetaRepository.OptionNameEnum.compositeshootingoutputintervalsupport,
|
|
140
|
+
"compassDirectionRef": ThetaRepository.OptionNameEnum.compassdirectionref,
|
|
141
|
+
KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL: ThetaRepository.OptionNameEnum.compositeshootingoutputinterval,
|
|
99
142
|
"compositeShootingTime": ThetaRepository.OptionNameEnum.compositeshootingtime,
|
|
143
|
+
KEY_COMPOSITE_SHOOTING_TIME_SUPPORT: ThetaRepository.OptionNameEnum.compositeshootingtimesupport,
|
|
100
144
|
"continuousNumber": ThetaRepository.OptionNameEnum.continuousnumber,
|
|
101
|
-
|
|
145
|
+
KEY_GPS_DATE_TIME_ZONE: ThetaRepository.OptionNameEnum.datetimezone,
|
|
102
146
|
"ethernetConfig": ThetaRepository.OptionNameEnum.ethernetconfig,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
147
|
+
KEY_EXPOSURE_COMPENSATION: ThetaRepository.OptionNameEnum.exposurecompensation,
|
|
148
|
+
KEY_EXPOSURE_DELAY: ThetaRepository.OptionNameEnum.exposuredelay,
|
|
149
|
+
"exposureDelaySupport": ThetaRepository.OptionNameEnum.exposuredelaysupport,
|
|
150
|
+
KEY_EXPOSURE_PROGRAM: ThetaRepository.OptionNameEnum.exposureprogram,
|
|
106
151
|
"faceDetect": ThetaRepository.OptionNameEnum.facedetect,
|
|
107
|
-
|
|
108
|
-
|
|
152
|
+
KEY_FILE_FORMAT: ThetaRepository.OptionNameEnum.fileformat,
|
|
153
|
+
KEY_FILTER: ThetaRepository.OptionNameEnum.filter,
|
|
109
154
|
"function": ThetaRepository.OptionNameEnum.function,
|
|
110
155
|
"gain": ThetaRepository.OptionNameEnum.gain,
|
|
111
|
-
|
|
156
|
+
KEY_GPS_INFO: ThetaRepository.OptionNameEnum.gpsinfo,
|
|
157
|
+
KEY_GPS_TAG_RECORDING_SUPPORT: ThetaRepository.OptionNameEnum.gpstagrecordingsupport,
|
|
112
158
|
"imageStitching": ThetaRepository.OptionNameEnum.imagestitching,
|
|
113
159
|
"isGpsOn": ThetaRepository.OptionNameEnum.isgpson,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
160
|
+
KEY_ISO: ThetaRepository.OptionNameEnum.iso,
|
|
161
|
+
KEY_ISO_AUTO_HIGH_LIMIT: ThetaRepository.OptionNameEnum.isoautohighlimit,
|
|
162
|
+
KEY_LANGUAGE: ThetaRepository.OptionNameEnum.language,
|
|
117
163
|
"latestEnabledExposureDelayTime": ThetaRepository.OptionNameEnum.latestenabledexposuredelaytime,
|
|
118
|
-
|
|
164
|
+
KEY_MAX_RECORDABLE_TIME: ThetaRepository.OptionNameEnum.maxrecordabletime,
|
|
165
|
+
"microphoneNoiseReduction": ThetaRepository.OptionNameEnum.microphonenoisereduction,
|
|
166
|
+
"mobileNetworkSetting": ThetaRepository.OptionNameEnum.mobilenetworksetting,
|
|
119
167
|
"networkType": ThetaRepository.OptionNameEnum.networktype,
|
|
120
|
-
|
|
121
|
-
"
|
|
168
|
+
KEY_OFF_DELAY: ThetaRepository.OptionNameEnum.offdelay,
|
|
169
|
+
"offDelayUsb": ThetaRepository.OptionNameEnum.offdelayusb,
|
|
170
|
+
KEY_PROXY_PASSWORD: ThetaRepository.OptionNameEnum.password,
|
|
122
171
|
"powerSaving": ThetaRepository.OptionNameEnum.powersaving,
|
|
123
|
-
|
|
172
|
+
KEY_PRESET: ThetaRepository.OptionNameEnum.preset,
|
|
124
173
|
"previewFormat": ThetaRepository.OptionNameEnum.previewformat,
|
|
125
|
-
|
|
174
|
+
KEY_PROXY: ThetaRepository.OptionNameEnum.proxy,
|
|
126
175
|
"remainingPictures": ThetaRepository.OptionNameEnum.remainingpictures,
|
|
127
176
|
"remainingVideoSeconds": ThetaRepository.OptionNameEnum.remainingvideoseconds,
|
|
128
177
|
"remainingSpace": ThetaRepository.OptionNameEnum.remainingspace,
|
|
129
178
|
"shootingMethod": ThetaRepository.OptionNameEnum.shootingmethod,
|
|
130
179
|
"shutterSpeed": ThetaRepository.OptionNameEnum.shutterspeed,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
180
|
+
KEY_SHUTTER_VOLUME: ThetaRepository.OptionNameEnum.shuttervolume,
|
|
181
|
+
KEY_SLEEP_DELAY: ThetaRepository.OptionNameEnum.sleepdelay,
|
|
182
|
+
KEY_TIMESHIFT: ThetaRepository.OptionNameEnum.timeshift,
|
|
134
183
|
"topBottomCorrection": ThetaRepository.OptionNameEnum.topbottomcorrection,
|
|
135
184
|
"topBottomCorrectionRotation": ThetaRepository.OptionNameEnum.topbottomcorrectionrotation,
|
|
185
|
+
KEY_TOP_BOTTOM_CORRECTION_ROTATION_SUPPORT: ThetaRepository.OptionNameEnum.topbottomcorrectionrotationsupport,
|
|
136
186
|
"totalSpace": ThetaRepository.OptionNameEnum.totalspace,
|
|
187
|
+
"usbConnection": ThetaRepository.OptionNameEnum.usbconnection,
|
|
137
188
|
"username": ThetaRepository.OptionNameEnum.username,
|
|
138
189
|
"videoStitching": ThetaRepository.OptionNameEnum.videostitching,
|
|
139
190
|
"visibilityReduction": ThetaRepository.OptionNameEnum.visibilityreduction,
|
|
140
|
-
|
|
191
|
+
KEY_WHITE_BALANCE: ThetaRepository.OptionNameEnum.whitebalance,
|
|
141
192
|
"whiteBalanceAutoStrength": ThetaRepository.OptionNameEnum.whitebalanceautostrength,
|
|
193
|
+
"wlanAntennaConfig": ThetaRepository.OptionNameEnum.wlanantennaconfig,
|
|
142
194
|
"wlanFrequency": ThetaRepository.OptionNameEnum.wlanfrequency,
|
|
195
|
+
"wlanFrequencySupport": ThetaRepository.OptionNameEnum.wlanfrequencysupport,
|
|
196
|
+
KEY_WLAN_FREQUENCY_CL_MODE: ThetaRepository.OptionNameEnum.wlanfrequencyclmode,
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
let supportOptions: [ThetaRepository.OptionNameEnum: Any.Type] = [
|
|
200
|
+
ThetaRepository.OptionNameEnum.aiautothumbnailsupport: ThetaRepository.AiAutoThumbnailEnum.self,
|
|
201
|
+
ThetaRepository.OptionNameEnum.aperturesupport: ThetaRepository.ApertureEnum.self,
|
|
202
|
+
ThetaRepository.OptionNameEnum.cameracontrolsourcesupport: ThetaRepository.CameraControlSourceEnum.self,
|
|
203
|
+
ThetaRepository.OptionNameEnum.camerapowersupport: ThetaRepository.CameraPowerEnum.self,
|
|
204
|
+
ThetaRepository.OptionNameEnum.exposuredelaysupport: ThetaRepository.ExposureDelayEnum.self,
|
|
205
|
+
ThetaRepository.OptionNameEnum.gpstagrecordingsupport: ThetaRepository.GpsTagRecordingEnum.self,
|
|
206
|
+
ThetaRepository.OptionNameEnum.wlanfrequencysupport: ThetaRepository.WlanFrequencyEnum.self,
|
|
143
207
|
]
|
|
144
208
|
|
|
145
209
|
let optionNameEnumToItemName = {
|
|
@@ -174,6 +238,10 @@ func convertSetOptionsParam(params: [String: Any]) -> ThetaRepository.Options {
|
|
|
174
238
|
func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any) {
|
|
175
239
|
// TODO: Add items when adding options
|
|
176
240
|
switch name {
|
|
241
|
+
case ThetaRepository.OptionNameEnum.accessinfo.name:
|
|
242
|
+
if let params = value as? [String: Any?] {
|
|
243
|
+
options.accessInfo = toAccessInfo(params: params)
|
|
244
|
+
}
|
|
177
245
|
case ThetaRepository.OptionNameEnum.aiautothumbnail.name:
|
|
178
246
|
options.aiAutoThumbnail = getEnumValue(
|
|
179
247
|
values: ThetaRepository.AiAutoThumbnailEnum.values(), name: value as! String
|
|
@@ -208,6 +276,14 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
|
|
|
208
276
|
options.cameraControlSource = getEnumValue(
|
|
209
277
|
values: ThetaRepository.CameraControlSourceEnum.values(), name: value as! String
|
|
210
278
|
)!
|
|
279
|
+
case ThetaRepository.OptionNameEnum.cameralock.name:
|
|
280
|
+
options.cameraLock = getEnumValue(
|
|
281
|
+
values: ThetaRepository.CameraLockEnum.values(), name: value as! String
|
|
282
|
+
)!
|
|
283
|
+
case ThetaRepository.OptionNameEnum.cameralockconfig.name:
|
|
284
|
+
if let params = value as? [String: Any] {
|
|
285
|
+
options.cameraLockConfig = toCameraLockConfig(params: params)
|
|
286
|
+
}
|
|
211
287
|
case ThetaRepository.OptionNameEnum.cameramode.name:
|
|
212
288
|
options.cameraMode = getEnumValue(
|
|
213
289
|
values: ThetaRepository.CameraModeEnum.values(), name: value as! String
|
|
@@ -226,6 +302,10 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
|
|
|
226
302
|
options.captureNumber = KotlinInt(integerLiteral: value as! Int)
|
|
227
303
|
case ThetaRepository.OptionNameEnum.colortemperature.name:
|
|
228
304
|
options.colorTemperature = KotlinInt(integerLiteral: value as! Int)
|
|
305
|
+
case ThetaRepository.OptionNameEnum.compassdirectionref.name:
|
|
306
|
+
options.compassDirectionRef = getEnumValue(
|
|
307
|
+
values: ThetaRepository.CompassDirectionRefEnum.values(), name: value as! String
|
|
308
|
+
)!
|
|
229
309
|
case ThetaRepository.OptionNameEnum.compositeshootingoutputinterval.name:
|
|
230
310
|
options.compositeShootingOutputInterval = KotlinInt(integerLiteral: value as! Int)
|
|
231
311
|
case ThetaRepository.OptionNameEnum.compositeshootingtime.name:
|
|
@@ -300,12 +380,22 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
|
|
|
300
380
|
options.maxRecordableTime = getEnumValue(
|
|
301
381
|
values: ThetaRepository.MaxRecordableTimeEnum.values(), name: value as! String
|
|
302
382
|
)!
|
|
383
|
+
case ThetaRepository.OptionNameEnum.microphonenoisereduction.name:
|
|
384
|
+
options.microphoneNoiseReduction = getEnumValue(
|
|
385
|
+
values: ThetaRepository.MicrophoneNoiseReductionEnum.values(), name: value as! String
|
|
386
|
+
)!
|
|
387
|
+
case ThetaRepository.OptionNameEnum.mobilenetworksetting.name:
|
|
388
|
+
if let params = value as? [String: Any] {
|
|
389
|
+
options.mobileNetworkSetting = toMobileNetworkSetting(params: params)
|
|
390
|
+
}
|
|
303
391
|
case ThetaRepository.OptionNameEnum.networktype.name:
|
|
304
392
|
options.networkType = getEnumValue(
|
|
305
393
|
values: ThetaRepository.NetworkTypeEnum.values(), name: value as! String
|
|
306
394
|
)!
|
|
307
395
|
case ThetaRepository.OptionNameEnum.offdelay.name:
|
|
308
396
|
options.offDelay = toOffDelay(value: value)
|
|
397
|
+
case ThetaRepository.OptionNameEnum.offdelayusb.name:
|
|
398
|
+
options.offDelayUsb = toOffDelayUsb(value: value)
|
|
309
399
|
case ThetaRepository.OptionNameEnum.password.name:
|
|
310
400
|
options.password = value as? String
|
|
311
401
|
case ThetaRepository.OptionNameEnum.powersaving.name:
|
|
@@ -352,6 +442,10 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
|
|
|
352
442
|
options.topBottomCorrectionRotation = toTopBottomCorrectionRotation(params: value as! [String: Any])
|
|
353
443
|
case ThetaRepository.OptionNameEnum.totalspace.name:
|
|
354
444
|
options.totalSpace = KotlinLong(integerLiteral: value as! Int)
|
|
445
|
+
case ThetaRepository.OptionNameEnum.usbconnection.name:
|
|
446
|
+
options.usbConnection = getEnumValue(
|
|
447
|
+
values: ThetaRepository.UsbConnectionEnum.values(), name: value as! String
|
|
448
|
+
)!
|
|
355
449
|
case ThetaRepository.OptionNameEnum.username.name:
|
|
356
450
|
options.username = value as? String
|
|
357
451
|
case ThetaRepository.OptionNameEnum.videostitching.name:
|
|
@@ -370,16 +464,23 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
|
|
|
370
464
|
options.whiteBalanceAutoStrength = getEnumValue(
|
|
371
465
|
values: ThetaRepository.WhiteBalanceAutoStrengthEnum.values(), name: value as! String
|
|
372
466
|
)!
|
|
467
|
+
case ThetaRepository.OptionNameEnum.wlanantennaconfig.name:
|
|
468
|
+
options.wlanAntennaConfig = getEnumValue(
|
|
469
|
+
values: ThetaRepository.WlanAntennaConfigEnum.values(), name: value as! String
|
|
470
|
+
)!
|
|
373
471
|
case ThetaRepository.OptionNameEnum.wlanfrequency.name:
|
|
374
472
|
options.wlanFrequency = getEnumValue(
|
|
375
473
|
values: ThetaRepository.WlanFrequencyEnum.values(), name: value as! String
|
|
376
474
|
)!
|
|
475
|
+
case ThetaRepository.OptionNameEnum.wlanfrequencyclmode.name:
|
|
476
|
+
options.wlanFrequencyClMode = toWlanFrequencyClMode(params: value as! [String: Any])
|
|
377
477
|
default: break
|
|
378
478
|
}
|
|
379
479
|
}
|
|
380
480
|
|
|
381
481
|
func convertResult(options: ThetaRepository.Options) -> [String: Any] {
|
|
382
482
|
var result = [String: Any]()
|
|
483
|
+
var jsonResult = [String: Any]()
|
|
383
484
|
let nameList = ThetaRepository.OptionNameEnum.values()
|
|
384
485
|
for i in 0 ..< nameList.size {
|
|
385
486
|
if let name = nameList.get(index: i),
|
|
@@ -392,6 +493,10 @@ func convertResult(options: ThetaRepository.Options) -> [String: Any] {
|
|
|
392
493
|
result[key] = value as! Bool ? true : false
|
|
393
494
|
} else if value is NSNumber || value is String {
|
|
394
495
|
result[key] = value
|
|
496
|
+
} else if value is ThetaRepository.AccessInfo,
|
|
497
|
+
let accessInfo = value as? ThetaRepository.AccessInfo
|
|
498
|
+
{
|
|
499
|
+
result[key] = convertResult(accessInfo: accessInfo)
|
|
395
500
|
} else if value is ThetaRepository.BracketSettingList,
|
|
396
501
|
let autoBracket = value as? ThetaRepository.BracketSettingList
|
|
397
502
|
{
|
|
@@ -402,6 +507,10 @@ func convertResult(options: ThetaRepository.Options) -> [String: Any] {
|
|
|
402
507
|
let burstOption = value as? ThetaRepository.BurstOption
|
|
403
508
|
{
|
|
404
509
|
result[key] = convertResult(burstOption: burstOption)
|
|
510
|
+
} else if value is ThetaRepository.CameraLockConfig,
|
|
511
|
+
let config = value as? ThetaRepository.CameraLockConfig
|
|
512
|
+
{
|
|
513
|
+
result[key] = convertResult(cameraLockConfig: config)
|
|
405
514
|
} else if value is ThetaRepository.EthernetConfig,
|
|
406
515
|
let ethernetConfig = value as? ThetaRepository.EthernetConfig
|
|
407
516
|
{
|
|
@@ -409,6 +518,10 @@ func convertResult(options: ThetaRepository.Options) -> [String: Any] {
|
|
|
409
518
|
} else if value is ThetaRepository.GpsInfo {
|
|
410
519
|
let gpsInfo = value as! ThetaRepository.GpsInfo
|
|
411
520
|
result[key] = convertResult(gpsInfo: gpsInfo)
|
|
521
|
+
} else if value is ThetaRepository.MobileNetworkSetting,
|
|
522
|
+
let mobileNetworkSetting = value as? ThetaRepository.MobileNetworkSetting
|
|
523
|
+
{
|
|
524
|
+
result[key] = convertResult(mobileNetworkSetting: mobileNetworkSetting)
|
|
412
525
|
} else if value is ThetaRepository.Proxy,
|
|
413
526
|
let proxy = value as? ThetaRepository.Proxy
|
|
414
527
|
{
|
|
@@ -419,19 +532,38 @@ func convertResult(options: ThetaRepository.Options) -> [String: Any] {
|
|
|
419
532
|
result[key] = convertResult(timeshift: timeshift)
|
|
420
533
|
} else if value is ThetaRepository.TopBottomCorrectionRotation, let rotation = value as? ThetaRepository.TopBottomCorrectionRotation {
|
|
421
534
|
result[key] = convertResult(rotation: rotation)
|
|
535
|
+
} else if value is ThetaRepository.TopBottomCorrectionRotationSupport,
|
|
536
|
+
let support = value as? ThetaRepository.TopBottomCorrectionRotationSupport
|
|
537
|
+
{
|
|
538
|
+
jsonResult[key] = convertJson(topBottomCorrectionRotationSupport: support)
|
|
539
|
+
} else if let offDelay = value as? ThetaRepository.OffDelaySec {
|
|
540
|
+
result[key] = offDelay.sec_ == 0 ? ThetaRepository.OffDelayEnum.disable.name : offDelay.sec_
|
|
541
|
+
} else if let sleepDelay = value as? ThetaRepository.SleepDelaySec {
|
|
542
|
+
result[key] = sleepDelay.sec_ == 0 ? ThetaRepository.SleepDelayEnum.disable.name : sleepDelay.sec_
|
|
543
|
+
} else if let enumValue = value as? [AnyObject], let enumType = supportOptions[name] {
|
|
544
|
+
result[key] = convertSupportResult(supportValueList: enumValue, enumType: enumType)
|
|
545
|
+
} else if let valueRange = value as? ThetaRepositoryValueRange<NSNumber> {
|
|
546
|
+
result[key] = convertValueRangeSupportResult(valueRange: valueRange)
|
|
422
547
|
} else if let offDelay = value as? ThetaRepository.OffDelaySec {
|
|
423
|
-
result[key] =
|
|
424
|
-
|
|
548
|
+
result[key] = offDelay.sec_ == 0 ? ThetaRepository.OffDelayEnum.disable.name : offDelay.sec_
|
|
549
|
+
} else if let offDelayUsb = value as? ThetaRepository.OffDelayUsbSec {
|
|
550
|
+
result[key] = offDelayUsb.sec_ == 0 ? ThetaRepository.OffDelayUsbEnum.disable.name : offDelayUsb.sec_
|
|
425
551
|
} else if let sleepDelay = value as? ThetaRepository.SleepDelaySec {
|
|
426
|
-
result[key] =
|
|
427
|
-
|
|
428
|
-
|
|
552
|
+
result[key] = sleepDelay.sec_ == 0 ? ThetaRepository.SleepDelayEnum.disable.name : sleepDelay.sec_
|
|
553
|
+
} else if value is ThetaRepository.WlanFrequencyClMode, let wlanFrequencyClMode = value as? ThetaRepository.WlanFrequencyClMode {
|
|
554
|
+
result[key] = convertResult(wlanFrequencyClMode: wlanFrequencyClMode)
|
|
555
|
+
} else if let enumValue = value as? [AnyObject], let enumType = supportOptions[name] {
|
|
556
|
+
result[key] = convertSupportResult(supportValueList: enumValue, enumType: enumType)
|
|
429
557
|
}
|
|
430
558
|
// TODO: Add class item when adding options
|
|
431
559
|
}
|
|
432
560
|
}
|
|
433
561
|
}
|
|
434
|
-
|
|
562
|
+
|
|
563
|
+
var response = [String: Any]()
|
|
564
|
+
response[KEY_OPTIONS] = result
|
|
565
|
+
response["json"] = jsonResult
|
|
566
|
+
return response
|
|
435
567
|
}
|
|
436
568
|
|
|
437
569
|
// MARK: - Notify event
|
|
@@ -440,45 +572,45 @@ func toNotify(name: String, params: [String: Any]?) -> [String: Any] {
|
|
|
440
572
|
var result: [String: Any] = [
|
|
441
573
|
KEY_NOTIFY_NAME: name,
|
|
442
574
|
]
|
|
443
|
-
if let params
|
|
575
|
+
if let params {
|
|
444
576
|
result[KEY_NOTIFY_PARAMS] = params
|
|
445
577
|
}
|
|
446
578
|
return result
|
|
447
579
|
}
|
|
448
580
|
|
|
449
581
|
func toCaptureProgressNotifyParam(value: Float) -> [String: Any] {
|
|
450
|
-
|
|
582
|
+
[
|
|
451
583
|
KEY_NOTIFY_PARAM_COMPLETION: value,
|
|
452
584
|
]
|
|
453
585
|
}
|
|
454
586
|
|
|
455
587
|
func toEventWebSocketEventNotifyParam(value: CameraEvent) -> [String: Any] {
|
|
456
|
-
|
|
588
|
+
[
|
|
457
589
|
KEY_NOTIFY_PARAM_EVENT: convertResult(cameraEvent: value),
|
|
458
590
|
]
|
|
459
591
|
}
|
|
460
592
|
|
|
461
593
|
func toMessageNotifyParam(value: String) -> [String: Any] {
|
|
462
|
-
|
|
594
|
+
[
|
|
463
595
|
KEY_NOTIFY_PARAM_MESSAGE: value,
|
|
464
596
|
]
|
|
465
597
|
}
|
|
466
598
|
|
|
467
599
|
func toCapturingNotifyParam(value: CapturingStatusEnum) -> [String: Any] {
|
|
468
|
-
|
|
600
|
+
[
|
|
469
601
|
KEY_NOTIFY_PARAM_STATUS: value.name,
|
|
470
602
|
]
|
|
471
603
|
}
|
|
472
604
|
|
|
473
605
|
func toStartedNotifyParam(value: String) -> [String: Any] {
|
|
474
|
-
|
|
606
|
+
[
|
|
475
607
|
KEY_NOTIFY_PARAM_FILE_URL: value,
|
|
476
608
|
]
|
|
477
609
|
}
|
|
478
610
|
|
|
479
611
|
// MARK: - Capture builder
|
|
480
612
|
|
|
481
|
-
func setCaptureBuilderParams
|
|
613
|
+
func setCaptureBuilderParams(params: [String: Any], builder: CaptureBuilder<some Any>) {
|
|
482
614
|
if let value = params[KEY_APERTURE] as? String {
|
|
483
615
|
if let enumValue = getEnumValue(values: ThetaRepository.ApertureEnum.values(), name: value)
|
|
484
616
|
{
|
|
@@ -587,6 +719,26 @@ func setTimeShiftCaptureBuilderParams(params: [String: Any], builder: TimeShiftC
|
|
|
587
719
|
}
|
|
588
720
|
}
|
|
589
721
|
|
|
722
|
+
func setTimeShiftManualCaptureBuilderParams(params: [String: Any], builder: TimeShiftManualCapture.Builder) {
|
|
723
|
+
if let interval = params[KEY_TIMESHIFT_CAPTURE_INTERVAL] as? Int,
|
|
724
|
+
interval >= 0
|
|
725
|
+
{
|
|
726
|
+
builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
|
|
727
|
+
}
|
|
728
|
+
if let timeShiftParams = params[KEY_TIMESHIFT] as? [String: Any] {
|
|
729
|
+
let timeShift = toTimeShift(params: timeShiftParams)
|
|
730
|
+
if let isFrontFirst = timeShift.isFrontFirst {
|
|
731
|
+
builder.setIsFrontFirst(isFrontFirst: isFrontFirst.boolValue)
|
|
732
|
+
}
|
|
733
|
+
if let firstInterval = timeShift.firstInterval {
|
|
734
|
+
builder.setFirstInterval(interval: firstInterval)
|
|
735
|
+
}
|
|
736
|
+
if let secondInterval = timeShift.secondInterval {
|
|
737
|
+
builder.setSecondInterval(interval: secondInterval)
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
590
742
|
func setVideoCaptureBuilderParams(params: [String: Any], builder: VideoCapture.Builder) {
|
|
591
743
|
if let interval = params[KEY_TIMESHIFT_CAPTURE_INTERVAL] as? Int,
|
|
592
744
|
interval >= 0
|
|
@@ -657,11 +809,11 @@ func setBurstCaptureBuilderParams(params: [String: Any], builder: BurstCapture.B
|
|
|
657
809
|
}
|
|
658
810
|
}
|
|
659
811
|
|
|
660
|
-
func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBracketCapture.Builder) {
|
|
812
|
+
func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBracketCapture.Builder) throws {
|
|
661
813
|
if let autoBracket = params[KEY_AUTO_BRACKET] as? [[String: Any]] {
|
|
662
|
-
autoBracket.forEach { map in
|
|
814
|
+
try autoBracket.forEach { map in
|
|
663
815
|
let aperture = {
|
|
664
|
-
if let name = map[
|
|
816
|
+
if let name = map[KEY_APERTURE] as? String {
|
|
665
817
|
return getEnumValue(values: ThetaRepository.ApertureEnum.values(), name: name)
|
|
666
818
|
} else {
|
|
667
819
|
return nil
|
|
@@ -669,7 +821,7 @@ func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBr
|
|
|
669
821
|
}()
|
|
670
822
|
|
|
671
823
|
let colorTemperature = {
|
|
672
|
-
if let value = map[
|
|
824
|
+
if let value = map[KEY_COLOR_TEMPERATURE] as? Int {
|
|
673
825
|
return toKotlinInt(value: value)
|
|
674
826
|
} else {
|
|
675
827
|
return nil
|
|
@@ -677,7 +829,7 @@ func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBr
|
|
|
677
829
|
}()
|
|
678
830
|
|
|
679
831
|
let exposureCompensation = {
|
|
680
|
-
if let name = map[
|
|
832
|
+
if let name = map[KEY_EXPOSURE_COMPENSATION] as? String {
|
|
681
833
|
return getEnumValue(values: ThetaRepository.ExposureCompensationEnum.values(), name: name)
|
|
682
834
|
} else {
|
|
683
835
|
return nil
|
|
@@ -685,7 +837,7 @@ func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBr
|
|
|
685
837
|
}()
|
|
686
838
|
|
|
687
839
|
let exposureProgram = {
|
|
688
|
-
if let name = map[
|
|
840
|
+
if let name = map[KEY_EXPOSURE_PROGRAM] as? String {
|
|
689
841
|
return getEnumValue(values: ThetaRepository.ExposureProgramEnum.values(), name: name)
|
|
690
842
|
} else {
|
|
691
843
|
return nil
|
|
@@ -693,7 +845,7 @@ func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBr
|
|
|
693
845
|
}()
|
|
694
846
|
|
|
695
847
|
let iso = {
|
|
696
|
-
if let name = map[
|
|
848
|
+
if let name = map[KEY_ISO] as? String {
|
|
697
849
|
return getEnumValue(values: ThetaRepository.IsoEnum.values(), name: name)
|
|
698
850
|
} else {
|
|
699
851
|
return nil
|
|
@@ -709,14 +861,14 @@ func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBr
|
|
|
709
861
|
}()
|
|
710
862
|
|
|
711
863
|
let whiteBalance = {
|
|
712
|
-
if let name = map[
|
|
864
|
+
if let name = map[KEY_WHITE_BALANCE] as? String {
|
|
713
865
|
return getEnumValue(values: ThetaRepository.WhiteBalanceEnum.values(), name: name)
|
|
714
866
|
} else {
|
|
715
867
|
return nil
|
|
716
868
|
}
|
|
717
869
|
}()
|
|
718
870
|
|
|
719
|
-
builder.addBracketParameters(
|
|
871
|
+
try builder.addBracketParameters(
|
|
720
872
|
aperture: aperture,
|
|
721
873
|
colorTemperature: colorTemperature,
|
|
722
874
|
exposureCompensation: exposureCompensation,
|
|
@@ -757,7 +909,7 @@ func getEnumValue<T, E: KotlinEnum<T>>(values: KotlinArray<E>, name: String) ->
|
|
|
757
909
|
}
|
|
758
910
|
|
|
759
911
|
func convertKotlinBooleanToBool(value: Any?) -> Bool? {
|
|
760
|
-
guard let value
|
|
912
|
+
guard let value else { return nil }
|
|
761
913
|
guard value is KotlinBoolean, let numVal = value as? NSNumber else { return false }
|
|
762
914
|
|
|
763
915
|
return numVal.boolValue
|
|
@@ -779,6 +931,42 @@ func toKotlinBoolean(value: Any?) -> KotlinBoolean? {
|
|
|
779
931
|
|
|
780
932
|
// MARK: - Convert to react-native object
|
|
781
933
|
|
|
934
|
+
func convertResult(accessInfo: ThetaRepository.AccessInfo) -> [String: Any] {
|
|
935
|
+
var result: [String: Any] = [:]
|
|
936
|
+
result[KEY_SSID] = accessInfo.ssid
|
|
937
|
+
result[KEY_IP_ADDRESS] = accessInfo.ipAddress
|
|
938
|
+
result[KEY_SUBNET_MASK] = accessInfo.subnetMask
|
|
939
|
+
result[KEY_DEFAULT_GATEWAY] = accessInfo.defaultGateway
|
|
940
|
+
if let dns1 = accessInfo.dns1 {
|
|
941
|
+
result[KEY_DNS1] = dns1
|
|
942
|
+
}
|
|
943
|
+
if let dns2 = accessInfo.dns2 {
|
|
944
|
+
result[KEY_DNS2] = dns2
|
|
945
|
+
}
|
|
946
|
+
result["proxyURL"] = accessInfo.proxyURL
|
|
947
|
+
result["frequency"] = accessInfo.frequency.name
|
|
948
|
+
result["wlanSignalStrength"] = accessInfo.wlanSignalStrength
|
|
949
|
+
result["wlanSignalLevel"] = accessInfo.wlanSignalLevel
|
|
950
|
+
result["lteSignalStrength"] = accessInfo.lteSignalStrength
|
|
951
|
+
result["lteSignalLevel"] = accessInfo.lteSignalLevel
|
|
952
|
+
|
|
953
|
+
if let list = accessInfo.dhcpLeaseAddress {
|
|
954
|
+
let array = list.map { item in convertResult(dhcpLeaseAddress: item) }
|
|
955
|
+
if !array.isEmpty {
|
|
956
|
+
result[KEY_DHCP_LEASE_ADDRESS] = array
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return result
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
func convertResult(dhcpLeaseAddress: ThetaRepository.DhcpLeaseAddress) -> [String: Any] {
|
|
963
|
+
[
|
|
964
|
+
KEY_IP_ADDRESS: dhcpLeaseAddress.ipAddress,
|
|
965
|
+
KEY_MAC_ADDRESS: dhcpLeaseAddress.macAddress,
|
|
966
|
+
KEY_HOST_NAME: dhcpLeaseAddress.hostName,
|
|
967
|
+
]
|
|
968
|
+
}
|
|
969
|
+
|
|
782
970
|
func convertResult(fileInfoList: [ThetaRepository.FileInfo]) -> [[String: Any]] {
|
|
783
971
|
var resultList = [[String: Any]]()
|
|
784
972
|
fileInfoList.forEach { fileInfo in
|
|
@@ -786,11 +974,11 @@ func convertResult(fileInfoList: [ThetaRepository.FileInfo]) -> [[String: Any]]
|
|
|
786
974
|
"name": fileInfo.name,
|
|
787
975
|
"fileUrl": fileInfo.fileUrl,
|
|
788
976
|
"size": fileInfo.size,
|
|
789
|
-
|
|
977
|
+
KEY_DATETIME: fileInfo.dateTime,
|
|
790
978
|
"thumbnailUrl": fileInfo.thumbnailUrl,
|
|
791
979
|
]
|
|
792
980
|
if let dateTimeZone = fileInfo.dateTimeZone {
|
|
793
|
-
item[
|
|
981
|
+
item[KEY_GPS_DATE_TIME_ZONE] = dateTimeZone
|
|
794
982
|
}
|
|
795
983
|
if let lat = fileInfo.lat {
|
|
796
984
|
item["lat"] = lat.floatValue
|
|
@@ -849,7 +1037,7 @@ func convertResult(fileInfoList: [ThetaRepository.FileInfo]) -> [[String: Any]]
|
|
|
849
1037
|
}
|
|
850
1038
|
|
|
851
1039
|
func convertResult(thetaInfo: ThetaRepository.ThetaInfo) -> [String: Any?] {
|
|
852
|
-
|
|
1040
|
+
[
|
|
853
1041
|
"manufacturer": thetaInfo.manufacturer,
|
|
854
1042
|
"model": thetaInfo.model,
|
|
855
1043
|
"serialNumber": thetaInfo.serialNumber,
|
|
@@ -870,7 +1058,7 @@ func convertResult(thetaInfo: ThetaRepository.ThetaInfo) -> [String: Any?] {
|
|
|
870
1058
|
}
|
|
871
1059
|
|
|
872
1060
|
func convertResult(cameraErrorList: [ThetaRepository.CameraErrorEnum]?) -> [String]? {
|
|
873
|
-
guard let cameraErrorList
|
|
1061
|
+
guard let cameraErrorList else {
|
|
874
1062
|
return nil
|
|
875
1063
|
}
|
|
876
1064
|
var result: [String] = []
|
|
@@ -988,25 +1176,25 @@ func convertResult(autoBracket: ThetaRepository.BracketSettingList) -> [[String:
|
|
|
988
1176
|
var result: [String: Any] = [:]
|
|
989
1177
|
if let setting = bracketSetting as? ThetaRepository.BracketSetting {
|
|
990
1178
|
if let aperture = setting.aperture?.name {
|
|
991
|
-
result[
|
|
1179
|
+
result[KEY_APERTURE] = aperture
|
|
992
1180
|
}
|
|
993
1181
|
if let colorTemperature = setting.colorTemperature?.intValue {
|
|
994
|
-
result[
|
|
1182
|
+
result[KEY_COLOR_TEMPERATURE] = colorTemperature
|
|
995
1183
|
}
|
|
996
1184
|
if let exposureCompensation = setting.exposureCompensation?.name {
|
|
997
|
-
result[
|
|
1185
|
+
result[KEY_EXPOSURE_COMPENSATION] = exposureCompensation
|
|
998
1186
|
}
|
|
999
1187
|
if let exposureProgram = setting.exposureProgram?.name {
|
|
1000
|
-
result[
|
|
1188
|
+
result[KEY_EXPOSURE_PROGRAM] = exposureProgram
|
|
1001
1189
|
}
|
|
1002
1190
|
if let iso = setting.iso?.name {
|
|
1003
|
-
result[
|
|
1191
|
+
result[KEY_ISO] = iso
|
|
1004
1192
|
}
|
|
1005
1193
|
if let shutterSpeed = setting.shutterSpeed?.name {
|
|
1006
1194
|
result["shutterSpeed"] = shutterSpeed
|
|
1007
1195
|
}
|
|
1008
1196
|
if let whiteBalance = setting.whiteBalance?.name {
|
|
1009
|
-
result[
|
|
1197
|
+
result[KEY_WHITE_BALANCE] = whiteBalance
|
|
1010
1198
|
}
|
|
1011
1199
|
resultList.append(result)
|
|
1012
1200
|
}
|
|
@@ -1015,6 +1203,29 @@ func convertResult(autoBracket: ThetaRepository.BracketSettingList) -> [[String:
|
|
|
1015
1203
|
return resultList
|
|
1016
1204
|
}
|
|
1017
1205
|
|
|
1206
|
+
func convertResult(cameraLockConfig: ThetaRepository.CameraLockConfig) -> [String: Any] {
|
|
1207
|
+
var result: [String: Any] = [:]
|
|
1208
|
+
if let isPowerKeyLocked = cameraLockConfig.isPowerKeyLocked {
|
|
1209
|
+
result[KEY_CAMERA_LOCK_CONFIG_IS_POWER_KEY_LOCKED] = isPowerKeyLocked.boolValue
|
|
1210
|
+
}
|
|
1211
|
+
if let isShutterKeyLocked = cameraLockConfig.isShutterKeyLocked {
|
|
1212
|
+
result[KEY_CAMERA_LOCK_CONFIG_IS_SHUTTER_KEY_LOCKED] = isShutterKeyLocked.boolValue
|
|
1213
|
+
}
|
|
1214
|
+
if let isModeKeyLocked = cameraLockConfig.isModeKeyLocked {
|
|
1215
|
+
result[KEY_CAMERA_LOCK_CONFIG_IS_MODE_KEY_LOCKED] = isModeKeyLocked.boolValue
|
|
1216
|
+
}
|
|
1217
|
+
if let isWlanKeyLocked = cameraLockConfig.isWlanKeyLocked {
|
|
1218
|
+
result[KEY_CAMERA_LOCK_CONFIG_IS_WLAN_KEY_LOCKED] = isWlanKeyLocked.boolValue
|
|
1219
|
+
}
|
|
1220
|
+
if let isFnKeyLocked = cameraLockConfig.isFnKeyLocked {
|
|
1221
|
+
result[KEY_CAMERA_LOCK_CONFIG_IS_FN_KEY_LOCKED] = isFnKeyLocked.boolValue
|
|
1222
|
+
}
|
|
1223
|
+
if let isPanelLocked = cameraLockConfig.isPanelLocked {
|
|
1224
|
+
result[KEY_CAMERA_LOCK_CONFIG_IS_PANEL_LOCKED] = isPanelLocked.boolValue
|
|
1225
|
+
}
|
|
1226
|
+
return result
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1018
1229
|
func convertResult(ethernetConfig: ThetaRepository.EthernetConfig) -> [String: Any] {
|
|
1019
1230
|
var result: [String: Any] = ["usingDhcp": ethernetConfig.usingDhcp]
|
|
1020
1231
|
if let ipAddress = ethernetConfig.ipAddress {
|
|
@@ -1026,6 +1237,12 @@ func convertResult(ethernetConfig: ThetaRepository.EthernetConfig) -> [String: A
|
|
|
1026
1237
|
if let defaultGateway = ethernetConfig.defaultGateway {
|
|
1027
1238
|
result[KEY_DEFAULT_GATEWAY] = defaultGateway
|
|
1028
1239
|
}
|
|
1240
|
+
if let dns1 = ethernetConfig.dns1 {
|
|
1241
|
+
result[KEY_DNS1] = dns1
|
|
1242
|
+
}
|
|
1243
|
+
if let dns2 = ethernetConfig.dns2 {
|
|
1244
|
+
result[KEY_DNS2] = dns2
|
|
1245
|
+
}
|
|
1029
1246
|
if let proxy = ethernetConfig.proxy {
|
|
1030
1247
|
result[KEY_PROXY] = convertResult(proxy: proxy)
|
|
1031
1248
|
}
|
|
@@ -1033,11 +1250,11 @@ func convertResult(ethernetConfig: ThetaRepository.EthernetConfig) -> [String: A
|
|
|
1033
1250
|
}
|
|
1034
1251
|
|
|
1035
1252
|
func convertResult(gpsInfo: ThetaRepository.GpsInfo) -> [String: Any] {
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1253
|
+
[
|
|
1254
|
+
KEY_GPS_LATITUDE: gpsInfo.latitude,
|
|
1255
|
+
KEY_GPS_LONGITUDE: gpsInfo.longitude,
|
|
1256
|
+
KEY_GPS_ALTITUDE: gpsInfo.altitude,
|
|
1257
|
+
KEY_GPS_DATE_TIME_ZONE: gpsInfo.dateTimeZone,
|
|
1041
1258
|
]
|
|
1042
1259
|
}
|
|
1043
1260
|
|
|
@@ -1081,17 +1298,40 @@ func convertResult(timeshift: ThetaRepository.TimeShiftSetting) -> [String: Any]
|
|
|
1081
1298
|
}
|
|
1082
1299
|
|
|
1083
1300
|
func convertResult(rotation: ThetaRepository.TopBottomCorrectionRotation) -> [String: Any] {
|
|
1084
|
-
|
|
1301
|
+
[
|
|
1085
1302
|
KEY_TOP_BOTTOM_CORRECTION_ROTATION_PITCH: rotation.pitch,
|
|
1086
1303
|
KEY_TOP_BOTTOM_CORRECTION_ROTATION_ROLL: rotation.roll,
|
|
1087
1304
|
KEY_TOP_BOTTOM_CORRECTION_ROTATION_YAW: rotation.yaw,
|
|
1088
1305
|
]
|
|
1089
1306
|
}
|
|
1090
1307
|
|
|
1308
|
+
func convertJson(topBottomCorrectionRotationSupport: ThetaRepository.TopBottomCorrectionRotationSupport) -> String {
|
|
1309
|
+
let convertJson = """
|
|
1310
|
+
{
|
|
1311
|
+
"pitch": {
|
|
1312
|
+
"max": \(topBottomCorrectionRotationSupport.pitch.max),
|
|
1313
|
+
"min": \(topBottomCorrectionRotationSupport.pitch.min),
|
|
1314
|
+
"stepSize": \(topBottomCorrectionRotationSupport.pitch.stepSize)
|
|
1315
|
+
},
|
|
1316
|
+
"roll": {
|
|
1317
|
+
"max": \(topBottomCorrectionRotationSupport.roll.max),
|
|
1318
|
+
"min": \(topBottomCorrectionRotationSupport.roll.min),
|
|
1319
|
+
"stepSize": \(topBottomCorrectionRotationSupport.roll.stepSize)
|
|
1320
|
+
},
|
|
1321
|
+
"yaw": {
|
|
1322
|
+
"max": \(topBottomCorrectionRotationSupport.yaw.max),
|
|
1323
|
+
"min": \(topBottomCorrectionRotationSupport.yaw.min),
|
|
1324
|
+
"stepSize": \(topBottomCorrectionRotationSupport.yaw.stepSize)
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
"""
|
|
1328
|
+
return convertJson
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1091
1331
|
func convertResult(exif: ThetaRepository.Exif) -> [String: Any] {
|
|
1092
1332
|
var result = [String: Any]()
|
|
1093
1333
|
result["exifVersion"] = exif.exifVersion
|
|
1094
|
-
result[
|
|
1334
|
+
result[KEY_DATETIME] = exif.dateTime
|
|
1095
1335
|
if let imageWidth = exif.imageWidth {
|
|
1096
1336
|
result["imageWidth"] = imageWidth
|
|
1097
1337
|
}
|
|
@@ -1119,7 +1359,7 @@ func convertResult(xmp: ThetaRepository.Xmp) -> [String: Any] {
|
|
|
1119
1359
|
|
|
1120
1360
|
func convertResult(metadata: KotlinPair<ThetaRepository.Exif, ThetaRepository.Xmp>) -> [String: Any]
|
|
1121
1361
|
{
|
|
1122
|
-
|
|
1362
|
+
[
|
|
1123
1363
|
"exif": convertResult(exif: metadata.first!),
|
|
1124
1364
|
"xmp": convertResult(xmp: metadata.second!),
|
|
1125
1365
|
]
|
|
@@ -1129,10 +1369,10 @@ func convertResult(accessPointList: [ThetaRepository.AccessPoint]) -> [[String:
|
|
|
1129
1369
|
var resultList = [[String: Any]]()
|
|
1130
1370
|
accessPointList.forEach { accessPoint in
|
|
1131
1371
|
var result = [String: Any]()
|
|
1132
|
-
result[
|
|
1133
|
-
result[
|
|
1134
|
-
result[
|
|
1135
|
-
result[
|
|
1372
|
+
result[KEY_SSID] = accessPoint.ssid
|
|
1373
|
+
result[KEY_SSID_STEALTH] = accessPoint.ssidStealth
|
|
1374
|
+
result[KEY_AUTH_MODE] = accessPoint.authMode.name
|
|
1375
|
+
result[KEY_CONNECTION_PRIORITY] = accessPoint.connectionPriority
|
|
1136
1376
|
result["usingDhcp"] = accessPoint.usingDhcp
|
|
1137
1377
|
if let ipAddress = accessPoint.ipAddress {
|
|
1138
1378
|
result[KEY_IP_ADDRESS] = ipAddress
|
|
@@ -1143,6 +1383,12 @@ func convertResult(accessPointList: [ThetaRepository.AccessPoint]) -> [[String:
|
|
|
1143
1383
|
if let defaultGateway = accessPoint.defaultGateway {
|
|
1144
1384
|
result[KEY_DEFAULT_GATEWAY] = defaultGateway
|
|
1145
1385
|
}
|
|
1386
|
+
if let dns1 = accessPoint.dns1 {
|
|
1387
|
+
result[KEY_DNS1] = dns1
|
|
1388
|
+
}
|
|
1389
|
+
if let dns2 = accessPoint.dns2 {
|
|
1390
|
+
result[KEY_DNS2] = dns2
|
|
1391
|
+
}
|
|
1146
1392
|
if let proxy = accessPoint.proxy {
|
|
1147
1393
|
result[KEY_PROXY] = convertResult(proxy: proxy)
|
|
1148
1394
|
}
|
|
@@ -1151,11 +1397,22 @@ func convertResult(accessPointList: [ThetaRepository.AccessPoint]) -> [[String:
|
|
|
1151
1397
|
return resultList
|
|
1152
1398
|
}
|
|
1153
1399
|
|
|
1400
|
+
func convertResult(mobileNetworkSetting: ThetaRepository.MobileNetworkSetting) -> [String: Any] {
|
|
1401
|
+
var result: [String: Any] = [:]
|
|
1402
|
+
if let roaming = mobileNetworkSetting.roaming {
|
|
1403
|
+
result[KEY_ROAMING] = roaming.name
|
|
1404
|
+
}
|
|
1405
|
+
if let plan = mobileNetworkSetting.plan {
|
|
1406
|
+
result[KEY_PLAN] = plan.name
|
|
1407
|
+
}
|
|
1408
|
+
return result
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1154
1411
|
func toPluginInfosResult(pluginInfoList: [ThetaRepository.PluginInfo]) -> [[String: Any]] {
|
|
1155
1412
|
var resultList = [[String: Any]]()
|
|
1156
1413
|
pluginInfoList.forEach { pluginInfo in
|
|
1157
1414
|
let item = [
|
|
1158
|
-
|
|
1415
|
+
KEY_NOTIFY_NAME: pluginInfo.name,
|
|
1159
1416
|
"packageName": pluginInfo.packageName,
|
|
1160
1417
|
"version": pluginInfo.version,
|
|
1161
1418
|
"isPreInstalled": pluginInfo.isPreInstalled,
|
|
@@ -1164,15 +1421,14 @@ func toPluginInfosResult(pluginInfoList: [ThetaRepository.PluginInfo]) -> [[Stri
|
|
|
1164
1421
|
"isBoot": pluginInfo.isBoot,
|
|
1165
1422
|
"hasWebServer": pluginInfo.hasWebServer,
|
|
1166
1423
|
"exitStatus": pluginInfo.exitStatus,
|
|
1167
|
-
|
|
1424
|
+
KEY_NOTIFY_PARAM_MESSAGE: pluginInfo.message,
|
|
1168
1425
|
]
|
|
1169
1426
|
resultList.append(item)
|
|
1170
1427
|
}
|
|
1171
1428
|
return resultList
|
|
1172
1429
|
}
|
|
1173
1430
|
|
|
1174
|
-
func convertResult(cameraEvent: CameraEvent) -> [String: Any]
|
|
1175
|
-
{
|
|
1431
|
+
func convertResult(cameraEvent: CameraEvent) -> [String: Any] {
|
|
1176
1432
|
var result = [String: Any]()
|
|
1177
1433
|
if let value = cameraEvent.options {
|
|
1178
1434
|
result[KEY_OPTIONS] = convertResult(options: value)
|
|
@@ -1184,8 +1440,88 @@ func convertResult(cameraEvent: CameraEvent) -> [String: Any]
|
|
|
1184
1440
|
return result
|
|
1185
1441
|
}
|
|
1186
1442
|
|
|
1443
|
+
func convertResult(wlanFrequencyClMode: ThetaRepository.WlanFrequencyClMode) -> [String: Any] {
|
|
1444
|
+
[
|
|
1445
|
+
KEY_WLAN_FREQUENCY_CL_MODE_2_4: wlanFrequencyClMode.enable2_4,
|
|
1446
|
+
KEY_WLAN_FREQUENCY_CL_MODE_5_2: wlanFrequencyClMode.enable5_2,
|
|
1447
|
+
KEY_WLAN_FREQUENCY_CL_MODE_5_8: wlanFrequencyClMode.enable5_8,
|
|
1448
|
+
]
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Convert support values
|
|
1453
|
+
*
|
|
1454
|
+
* @param supportValueList Support values
|
|
1455
|
+
* @param enumType values type. e.g. ThetaRepository.WlanStandardInfoEnum.self , Int.self {class}.seff
|
|
1456
|
+
*/
|
|
1457
|
+
func convertSupportResult(supportValueList: [Any], enumType: Any.Type) -> [Any] {
|
|
1458
|
+
var result = [Any]()
|
|
1459
|
+
for item in supportValueList {
|
|
1460
|
+
// for enum value
|
|
1461
|
+
if let value = item as? KotlinEnum<AnyObject>,
|
|
1462
|
+
enumType is KotlinEnum<AnyObject>.Type
|
|
1463
|
+
{
|
|
1464
|
+
result.append(value.name)
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
return result
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
func convertValueRangeSupportResult(valueRange: ThetaRepositoryValueRange<some Any>) -> [String: Any] {
|
|
1471
|
+
var result: [String: Any] = [:]
|
|
1472
|
+
result[KEY_MAX] = valueRange.max
|
|
1473
|
+
result[KEY_MIN] = valueRange.min
|
|
1474
|
+
result[KEY_STEP_SIZE] = valueRange.stepSize
|
|
1475
|
+
return result
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1187
1478
|
// MARK: - Convert to theta-client object
|
|
1188
1479
|
|
|
1480
|
+
func toAccessInfo(params: [String: Any?]) -> ThetaRepository.AccessInfo {
|
|
1481
|
+
let frequency = getEnumValue(
|
|
1482
|
+
values: ThetaRepository.WlanFrequencyAccessInfoEnum.values(), name: params["frequency"] as! String
|
|
1483
|
+
)!
|
|
1484
|
+
|
|
1485
|
+
let dhcpLeaseAddress: [ThetaRepository.DhcpLeaseAddress]? = {
|
|
1486
|
+
guard let list = params[KEY_DHCP_LEASE_ADDRESS] as? [[String: Any?]] else {
|
|
1487
|
+
return nil
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
let array = list.compactMap { toDhcpLeaseAddress(value: $0) }
|
|
1491
|
+
return array.isEmpty ? nil : array
|
|
1492
|
+
}()
|
|
1493
|
+
|
|
1494
|
+
return ThetaRepository.AccessInfo(
|
|
1495
|
+
ssid: params[KEY_SSID] as! String,
|
|
1496
|
+
ipAddress: params[KEY_IP_ADDRESS] as! String,
|
|
1497
|
+
subnetMask: params[KEY_SUBNET_MASK] as! String,
|
|
1498
|
+
defaultGateway: params[KEY_DEFAULT_GATEWAY] as! String,
|
|
1499
|
+
dns1: params[KEY_DNS1] as? String,
|
|
1500
|
+
dns2: params[KEY_DNS2] as? String,
|
|
1501
|
+
proxyURL: params["proxyURL"] as! String,
|
|
1502
|
+
frequency: frequency,
|
|
1503
|
+
wlanSignalStrength: params["wlanSignalStrength"] as! Int32,
|
|
1504
|
+
wlanSignalLevel: params["wlanSignalLevel"] as! Int32,
|
|
1505
|
+
lteSignalStrength: params["lteSignalStrength"] as! Int32,
|
|
1506
|
+
lteSignalLevel: params["lteSignalLevel"] as! Int32,
|
|
1507
|
+
dhcpLeaseAddress: dhcpLeaseAddress
|
|
1508
|
+
)
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
func toDhcpLeaseAddress(value: [String: Any?]) -> ThetaRepository.DhcpLeaseAddress? {
|
|
1512
|
+
guard let ipAddress = value[KEY_IP_ADDRESS] as? String,
|
|
1513
|
+
let macAddress = value[KEY_MAC_ADDRESS] as? String,
|
|
1514
|
+
let hostName = value[KEY_HOST_NAME] as? String
|
|
1515
|
+
else {
|
|
1516
|
+
return nil
|
|
1517
|
+
}
|
|
1518
|
+
return ThetaRepository.DhcpLeaseAddress(
|
|
1519
|
+
ipAddress: ipAddress,
|
|
1520
|
+
macAddress: macAddress,
|
|
1521
|
+
hostName: hostName
|
|
1522
|
+
)
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1189
1525
|
func toBitrate(value: Any) -> ThetaRepositoryBitrate? {
|
|
1190
1526
|
if value is NSNumber, let intVal = value as? Int32 {
|
|
1191
1527
|
return ThetaRepository.BitrateNumber(value: intVal)
|
|
@@ -1212,6 +1548,18 @@ func toOffDelay(value: Any) -> ThetaRepositoryOffDelay? {
|
|
|
1212
1548
|
}
|
|
1213
1549
|
}
|
|
1214
1550
|
|
|
1551
|
+
func toOffDelayUsb(value: Any) -> ThetaRepositoryOffDelayUsb? {
|
|
1552
|
+
if value is NSNumber, let intVal = value as? Int32 {
|
|
1553
|
+
return ThetaRepository.OffDelayUsbSec(sec: intVal)
|
|
1554
|
+
} else if let name = value as? String,
|
|
1555
|
+
let enumValue = getEnumValue(values: ThetaRepository.OffDelayUsbEnum.values(), name: name)
|
|
1556
|
+
{
|
|
1557
|
+
return enumValue
|
|
1558
|
+
} else {
|
|
1559
|
+
return nil
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1215
1563
|
func toSleepDelay(value: Any) -> ThetaRepositorySleepDelay? {
|
|
1216
1564
|
if value is NSNumber, let intVal = value as? Int32 {
|
|
1217
1565
|
return ThetaRepository.SleepDelaySec(sec: intVal)
|
|
@@ -1226,42 +1574,42 @@ func toSleepDelay(value: Any) -> ThetaRepositorySleepDelay? {
|
|
|
1226
1574
|
|
|
1227
1575
|
func toBurstOption(params: [String: Any]) -> ThetaRepository.BurstOption {
|
|
1228
1576
|
var burstCaptureNum: ThetaRepository.BurstCaptureNumEnum? = nil
|
|
1229
|
-
if let name = params[
|
|
1577
|
+
if let name = params[KEY_BURST_CAPTURE_NUM] as? String {
|
|
1230
1578
|
burstCaptureNum = getEnumValue(
|
|
1231
1579
|
values: ThetaRepository.BurstCaptureNumEnum.values(), name: name
|
|
1232
1580
|
)
|
|
1233
1581
|
}
|
|
1234
1582
|
|
|
1235
1583
|
var burstBracketStep: ThetaRepository.BurstBracketStepEnum? = nil
|
|
1236
|
-
if let name = params[
|
|
1584
|
+
if let name = params[KEY_BURST_BRACKET_STEP] as? String {
|
|
1237
1585
|
burstBracketStep = getEnumValue(
|
|
1238
1586
|
values: ThetaRepository.BurstBracketStepEnum.values(), name: name
|
|
1239
1587
|
)
|
|
1240
1588
|
}
|
|
1241
1589
|
|
|
1242
1590
|
var burstCompensation: ThetaRepository.BurstCompensationEnum? = nil
|
|
1243
|
-
if let name = params[
|
|
1591
|
+
if let name = params[KEY_BURST_COMPENSATION] as? String {
|
|
1244
1592
|
burstCompensation = getEnumValue(
|
|
1245
1593
|
values: ThetaRepository.BurstCompensationEnum.values(), name: name
|
|
1246
1594
|
)
|
|
1247
1595
|
}
|
|
1248
1596
|
|
|
1249
1597
|
var burstMaxExposureTime: ThetaRepository.BurstMaxExposureTimeEnum? = nil
|
|
1250
|
-
if let name = params[
|
|
1598
|
+
if let name = params[KEY_BURST_MAX_EXPOSURE_TIME] as? String {
|
|
1251
1599
|
burstMaxExposureTime = getEnumValue(
|
|
1252
1600
|
values: ThetaRepository.BurstMaxExposureTimeEnum.values(), name: name
|
|
1253
1601
|
)
|
|
1254
1602
|
}
|
|
1255
1603
|
|
|
1256
1604
|
var burstEnableIsoControl: ThetaRepository.BurstEnableIsoControlEnum? = nil
|
|
1257
|
-
if let name = params[
|
|
1605
|
+
if let name = params[KEY_BURST_ENABLE_ISO_CONTROL] as? String {
|
|
1258
1606
|
burstEnableIsoControl = getEnumValue(
|
|
1259
1607
|
values: ThetaRepository.BurstEnableIsoControlEnum.values(), name: name
|
|
1260
1608
|
)
|
|
1261
1609
|
}
|
|
1262
1610
|
|
|
1263
1611
|
var burstOrder: ThetaRepository.BurstOrderEnum? = nil
|
|
1264
|
-
if let name = params[
|
|
1612
|
+
if let name = params[KEY_BURST_ORDER] as? String {
|
|
1265
1613
|
burstOrder = getEnumValue(values: ThetaRepository.BurstOrderEnum.values(), name: name)
|
|
1266
1614
|
}
|
|
1267
1615
|
|
|
@@ -1280,7 +1628,7 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1280
1628
|
|
|
1281
1629
|
params.forEach { map in
|
|
1282
1630
|
let aperture = {
|
|
1283
|
-
if let name = map[
|
|
1631
|
+
if let name = map[KEY_APERTURE] as? String {
|
|
1284
1632
|
return getEnumValue(values: ThetaRepository.ApertureEnum.values(), name: name)
|
|
1285
1633
|
} else {
|
|
1286
1634
|
return nil
|
|
@@ -1288,7 +1636,7 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1288
1636
|
}()
|
|
1289
1637
|
|
|
1290
1638
|
let colorTemperature = {
|
|
1291
|
-
if let value = map[
|
|
1639
|
+
if let value = map[KEY_COLOR_TEMPERATURE] as? Int {
|
|
1292
1640
|
return toKotlinInt(value: value)
|
|
1293
1641
|
} else {
|
|
1294
1642
|
return nil
|
|
@@ -1296,7 +1644,7 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1296
1644
|
}()
|
|
1297
1645
|
|
|
1298
1646
|
let exposureCompensation = {
|
|
1299
|
-
if let name = map[
|
|
1647
|
+
if let name = map[KEY_EXPOSURE_COMPENSATION] as? String {
|
|
1300
1648
|
return getEnumValue(values: ThetaRepository.ExposureCompensationEnum.values(), name: name)
|
|
1301
1649
|
} else {
|
|
1302
1650
|
return nil
|
|
@@ -1304,7 +1652,7 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1304
1652
|
}()
|
|
1305
1653
|
|
|
1306
1654
|
let exposureProgram = {
|
|
1307
|
-
if let name = map[
|
|
1655
|
+
if let name = map[KEY_EXPOSURE_PROGRAM] as? String {
|
|
1308
1656
|
return getEnumValue(values: ThetaRepository.ExposureProgramEnum.values(), name: name)
|
|
1309
1657
|
} else {
|
|
1310
1658
|
return nil
|
|
@@ -1312,7 +1660,7 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1312
1660
|
}()
|
|
1313
1661
|
|
|
1314
1662
|
let iso = {
|
|
1315
|
-
if let name = map[
|
|
1663
|
+
if let name = map[KEY_ISO] as? String {
|
|
1316
1664
|
return getEnumValue(values: ThetaRepository.IsoEnum.values(), name: name)
|
|
1317
1665
|
} else {
|
|
1318
1666
|
return nil
|
|
@@ -1328,7 +1676,7 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1328
1676
|
}()
|
|
1329
1677
|
|
|
1330
1678
|
let whiteBalance = {
|
|
1331
|
-
if let name = map[
|
|
1679
|
+
if let name = map[KEY_WHITE_BALANCE] as? String {
|
|
1332
1680
|
return getEnumValue(values: ThetaRepository.WhiteBalanceEnum.values(), name: name)
|
|
1333
1681
|
} else {
|
|
1334
1682
|
return nil
|
|
@@ -1349,17 +1697,30 @@ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingLis
|
|
|
1349
1697
|
return autoBracket
|
|
1350
1698
|
}
|
|
1351
1699
|
|
|
1700
|
+
func toCameraLockConfig(params: [String: Any]) -> ThetaRepository.CameraLockConfig {
|
|
1701
|
+
ThetaRepository.CameraLockConfig(
|
|
1702
|
+
isPowerKeyLocked: toKotlinBoolean(value: params[KEY_CAMERA_LOCK_CONFIG_IS_POWER_KEY_LOCKED]),
|
|
1703
|
+
isShutterKeyLocked: toKotlinBoolean(value: params[KEY_CAMERA_LOCK_CONFIG_IS_SHUTTER_KEY_LOCKED]),
|
|
1704
|
+
isModeKeyLocked: toKotlinBoolean(value: params[KEY_CAMERA_LOCK_CONFIG_IS_MODE_KEY_LOCKED]),
|
|
1705
|
+
isWlanKeyLocked: toKotlinBoolean(value: params[KEY_CAMERA_LOCK_CONFIG_IS_WLAN_KEY_LOCKED]),
|
|
1706
|
+
isFnKeyLocked: toKotlinBoolean(value: params[KEY_CAMERA_LOCK_CONFIG_IS_FN_KEY_LOCKED]),
|
|
1707
|
+
isPanelLocked: toKotlinBoolean(value: params[KEY_CAMERA_LOCK_CONFIG_IS_PANEL_LOCKED])
|
|
1708
|
+
)
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1352
1711
|
func toEthernetConfig(params: [String: Any]) -> ThetaRepository.EthernetConfig {
|
|
1353
1712
|
var proxy: ThetaRepository.Proxy? = nil
|
|
1354
1713
|
if let data = params[KEY_PROXY] as? [String: Any] {
|
|
1355
1714
|
proxy = toProxy(params: data)
|
|
1356
1715
|
}
|
|
1357
|
-
|
|
1716
|
+
|
|
1358
1717
|
return ThetaRepository.EthernetConfig(
|
|
1359
1718
|
usingDhcp: params["usingDhcp"] as? Bool ?? true,
|
|
1360
1719
|
ipAddress: params[KEY_IP_ADDRESS] as? String,
|
|
1361
1720
|
subnetMask: params[KEY_SUBNET_MASK] as? String,
|
|
1362
1721
|
defaultGateway: params[KEY_DEFAULT_GATEWAY] as? String,
|
|
1722
|
+
dns1: params[KEY_DNS1] as? String,
|
|
1723
|
+
dns2: params[KEY_DNS2] as? String,
|
|
1363
1724
|
proxy: proxy
|
|
1364
1725
|
)
|
|
1365
1726
|
}
|
|
@@ -1380,55 +1741,55 @@ func toGpsInfo(params: [String: Any]) -> ThetaRepository.GpsInfo? {
|
|
|
1380
1741
|
}
|
|
1381
1742
|
|
|
1382
1743
|
func toProxy(params: [String: Any]) -> ThetaRepository.Proxy {
|
|
1383
|
-
|
|
1384
|
-
use: params[
|
|
1385
|
-
url: params[
|
|
1386
|
-
port: toKotlinInt(value: params[
|
|
1387
|
-
userid: params[
|
|
1388
|
-
password: params[
|
|
1744
|
+
ThetaRepository.Proxy(
|
|
1745
|
+
use: params[KEY_PROXY_USE] as? Bool ?? false,
|
|
1746
|
+
url: params[KEY_PROXY_URL] as? String,
|
|
1747
|
+
port: toKotlinInt(value: params[KEY_PROXY_PORT]),
|
|
1748
|
+
userid: params[KEY_PROXY_USER_ID] as? String,
|
|
1749
|
+
password: params[KEY_PROXY_PASSWORD] as? String
|
|
1389
1750
|
)
|
|
1390
1751
|
}
|
|
1391
1752
|
|
|
1392
1753
|
func toTimeShift(params: [String: Any]) -> ThetaRepository.TimeShiftSetting {
|
|
1393
1754
|
var firstInterval: ThetaRepository.TimeShiftIntervalEnum? = nil
|
|
1394
|
-
if let name = params[
|
|
1755
|
+
if let name = params[KEY_TIMESHIFT_FIRST_INTERVAL] as? String {
|
|
1395
1756
|
firstInterval = getEnumValue(
|
|
1396
1757
|
values: ThetaRepository.TimeShiftIntervalEnum.values(), name: name
|
|
1397
1758
|
)
|
|
1398
1759
|
}
|
|
1399
1760
|
|
|
1400
1761
|
var secondInterval: ThetaRepository.TimeShiftIntervalEnum? = nil
|
|
1401
|
-
if let name = params[
|
|
1762
|
+
if let name = params[KEY_TIMESHIFT_SECOND_INTERVAL] as? String {
|
|
1402
1763
|
secondInterval = getEnumValue(
|
|
1403
1764
|
values: ThetaRepository.TimeShiftIntervalEnum.values(), name: name
|
|
1404
1765
|
)
|
|
1405
1766
|
}
|
|
1406
1767
|
|
|
1407
1768
|
return ThetaRepository.TimeShiftSetting(
|
|
1408
|
-
isFrontFirst: toKotlinBoolean(value: params[
|
|
1769
|
+
isFrontFirst: toKotlinBoolean(value: params[KEY_TIMESHIFT_IS_FRONT_FIRST]),
|
|
1409
1770
|
firstInterval: firstInterval,
|
|
1410
1771
|
secondInterval: secondInterval
|
|
1411
1772
|
)
|
|
1412
1773
|
}
|
|
1413
1774
|
|
|
1414
1775
|
func toTopBottomCorrectionRotation(params: [String: Any]) -> ThetaRepository.TopBottomCorrectionRotation? {
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1776
|
+
let pitch = Float(params[KEY_TOP_BOTTOM_CORRECTION_ROTATION_PITCH] as? Double ?? 0)
|
|
1777
|
+
let roll = Float(params[KEY_TOP_BOTTOM_CORRECTION_ROTATION_ROLL] as? Double ?? 0)
|
|
1778
|
+
let yaw = Float(params[KEY_TOP_BOTTOM_CORRECTION_ROTATION_YAW] as? Double ?? 0)
|
|
1418
1779
|
|
|
1419
1780
|
return ThetaRepository.TopBottomCorrectionRotation(
|
|
1420
|
-
pitch:
|
|
1421
|
-
roll:
|
|
1422
|
-
yaw:
|
|
1781
|
+
pitch: pitch,
|
|
1782
|
+
roll: roll,
|
|
1783
|
+
yaw: yaw
|
|
1423
1784
|
)
|
|
1424
1785
|
}
|
|
1425
1786
|
|
|
1426
1787
|
func toDigestAuth(params: [String: String?]?) -> DigestAuth? {
|
|
1427
|
-
guard let params
|
|
1788
|
+
guard let params,
|
|
1428
1789
|
let username = params["username"] as? String
|
|
1429
1790
|
else { return nil }
|
|
1430
1791
|
|
|
1431
|
-
let password = params[
|
|
1792
|
+
let password = params[KEY_PROXY_PASSWORD] as? String
|
|
1432
1793
|
return DigestAuth(username: username, password: password)
|
|
1433
1794
|
}
|
|
1434
1795
|
|
|
@@ -1470,3 +1831,110 @@ func toTimeout(params: [String: Any]) -> ThetaRepository.Timeout? {
|
|
|
1470
1831
|
socketTimeout: socketTimeout
|
|
1471
1832
|
)
|
|
1472
1833
|
}
|
|
1834
|
+
|
|
1835
|
+
struct SetAccessPointParams {
|
|
1836
|
+
let ssid: String
|
|
1837
|
+
let ssidStealth: KotlinBoolean?
|
|
1838
|
+
let authMode: ThetaRepository.AuthModeEnum
|
|
1839
|
+
let password: String?
|
|
1840
|
+
let connectionPriority: KotlinInt?
|
|
1841
|
+
let dns1: String?
|
|
1842
|
+
let dns2: String?
|
|
1843
|
+
let proxy: ThetaRepository.Proxy?
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
func toSetAccessPointParams(params: [String: Any?]) throws -> SetAccessPointParams {
|
|
1847
|
+
guard let ssid = params[KEY_SSID] as? String else {
|
|
1848
|
+
throw ThetaClientError.invalidArgument(KEY_SSID)
|
|
1849
|
+
}
|
|
1850
|
+
let ssidStealth = toKotlinBoolean(value: params[KEY_SSID_STEALTH] as? Bool)
|
|
1851
|
+
guard let authMode = params[KEY_AUTH_MODE] as? String else {
|
|
1852
|
+
throw ThetaClientError.invalidArgument(KEY_AUTH_MODE)
|
|
1853
|
+
}
|
|
1854
|
+
guard
|
|
1855
|
+
let authModeEnum = getEnumValue(
|
|
1856
|
+
values: ThetaRepository.AuthModeEnum.values(), name: authMode
|
|
1857
|
+
)
|
|
1858
|
+
else {
|
|
1859
|
+
throw ThetaClientError.invalidArgument(KEY_AUTH_MODE)
|
|
1860
|
+
}
|
|
1861
|
+
let password = params[KEY_PASSWORD] as? String
|
|
1862
|
+
let connectionPriority = toKotlinInt(value: params[KEY_CONNECTION_PRIORITY] as? Int)
|
|
1863
|
+
let dns1 = params[KEY_DNS1] as? String
|
|
1864
|
+
let dns2 = params[KEY_DNS2] as? String
|
|
1865
|
+
let proxy = params[KEY_PROXY]
|
|
1866
|
+
let proxyParam: ThetaRepository.Proxy? = {
|
|
1867
|
+
if let proxy = proxy as? [String: Any] {
|
|
1868
|
+
return toProxy(params: proxy)
|
|
1869
|
+
}
|
|
1870
|
+
return nil
|
|
1871
|
+
}()
|
|
1872
|
+
|
|
1873
|
+
return SetAccessPointParams(
|
|
1874
|
+
ssid: ssid,
|
|
1875
|
+
ssidStealth: ssidStealth,
|
|
1876
|
+
authMode: authModeEnum,
|
|
1877
|
+
password: password,
|
|
1878
|
+
connectionPriority: connectionPriority,
|
|
1879
|
+
dns1: dns1,
|
|
1880
|
+
dns2: dns2,
|
|
1881
|
+
proxy: proxyParam
|
|
1882
|
+
)
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
struct SetAccessPointStaticallyParams {
|
|
1886
|
+
let ipAddress: String
|
|
1887
|
+
let subnetMask: String
|
|
1888
|
+
let defaultGateway: String
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
func toSetAccessPointStaticallyParams(params: [String: Any?]) throws -> SetAccessPointStaticallyParams {
|
|
1892
|
+
guard let ipAddress = params[KEY_IP_ADDRESS] as? String else {
|
|
1893
|
+
throw ThetaClientError.invalidArgument(KEY_IP_ADDRESS)
|
|
1894
|
+
}
|
|
1895
|
+
guard let subnetMask = params[KEY_SUBNET_MASK] as? String else {
|
|
1896
|
+
throw ThetaClientError.invalidArgument(KEY_SUBNET_MASK)
|
|
1897
|
+
}
|
|
1898
|
+
guard let defaultGateway = params[KEY_DEFAULT_GATEWAY] as? String else {
|
|
1899
|
+
throw ThetaClientError.invalidArgument(KEY_DEFAULT_GATEWAY)
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
return SetAccessPointStaticallyParams(
|
|
1903
|
+
ipAddress: ipAddress,
|
|
1904
|
+
subnetMask: subnetMask,
|
|
1905
|
+
defaultGateway: defaultGateway
|
|
1906
|
+
)
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
func toWlanFrequencyClMode(params: [String: Any]) -> ThetaRepository.WlanFrequencyClMode? {
|
|
1910
|
+
guard let enable2_4 = params[KEY_WLAN_FREQUENCY_CL_MODE_2_4] as? Bool,
|
|
1911
|
+
let enable5_2 = params[KEY_WLAN_FREQUENCY_CL_MODE_5_2] as? Bool,
|
|
1912
|
+
let enable5_8 = params[KEY_WLAN_FREQUENCY_CL_MODE_5_8] as? Bool
|
|
1913
|
+
else { return nil }
|
|
1914
|
+
return ThetaRepository.WlanFrequencyClMode(
|
|
1915
|
+
enable2_4: enable2_4,
|
|
1916
|
+
enable5_2: enable5_2,
|
|
1917
|
+
enable5_8: enable5_8
|
|
1918
|
+
)
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
func toMobileNetworkSetting(params: [String: Any]) -> ThetaRepository.MobileNetworkSetting {
|
|
1922
|
+
var roaming: ThetaRepository.RoamingEnum? = nil
|
|
1923
|
+
if let name = params[KEY_ROAMING] as? String {
|
|
1924
|
+
roaming = getEnumValue(
|
|
1925
|
+
values: ThetaRepository.RoamingEnum.values(), name: name
|
|
1926
|
+
)
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
var plan: ThetaRepository.PlanEnum? = nil
|
|
1930
|
+
if let name = params[KEY_PLAN] as? String {
|
|
1931
|
+
plan = getEnumValue(
|
|
1932
|
+
values: ThetaRepository.PlanEnum.values(), name: name
|
|
1933
|
+
)
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
return ThetaRepository.MobileNetworkSetting(
|
|
1937
|
+
roaming: roaming,
|
|
1938
|
+
plan: plan
|
|
1939
|
+
)
|
|
1940
|
+
}
|