Skip to content

Commit

Permalink
Merge pull request #77 from ricohapi/dev/1.9.0
Browse files Browse the repository at this point in the history
Dev/1.9.0
  • Loading branch information
simago authored May 7, 2024
2 parents 3aae4f3 + 0097f94 commit 46a3dd3
Show file tree
Hide file tree
Showing 78 changed files with 3,731 additions and 777 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ jobs:
with:
arguments: dokkaHtml -Pversion=${{ github.event.release.name }} -Pworkspace=${{ github.workspace }}
build-root-directory: ${{ github.workspace }}/main
- name: Add CNAME file
run: |
echo "docs-theta-sdk.ricoh360.com" > ${{ github.workspace }}/gh-pages/docs/CNAME
- name: Push to GitHub pages
run: |
cd ${{ github.workspace }}/gh-pages
git config --local user.email github-actions
git config --local user.name [email protected]
git add .
git commit -m "Release version ${{ github.event.release.name }}"
git push origin gh-pages
git push origin gh-pages
2 changes: 1 addition & 1 deletion demos/demo-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies {
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'io.coil-kt:coil-compose:2.2.2'
implementation "io.ktor:ktor-client-cio:2.3.9"
implementation "com.ricoh360.thetaclient:theta-client:1.8.0"
implementation "com.ricoh360.thetaclient:theta-client:1.9.0"

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ target 'SdkSample' do
use_frameworks!

# Pods for SdkSample
pod 'THETAClient', '1.8.0'
pod 'THETAClient', '1.9.0'
end
2 changes: 1 addition & 1 deletion demos/demo-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@react-navigation/native": "^6.1.0",
"@react-navigation/native-stack": "^6.9.5",
"theta-client-react-native": "1.8.0",
"theta-client-react-native": "1.9.0",
"react": "18.2.0",
"react-native": "0.71.14",
"react-native-safe-area-context": "^4.4.1",
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-android.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- モジュールの`build.gradle``dependencies`に次を追加します。
```
implementation "com.ricoh360.thetaclient:theta-client:1.8.0"
implementation "com.ricoh360.thetaclient:theta-client:1.9.0"
```
- 本 SDK を使用したアプリケーションが動作するスマートフォンと THETA を無線 LAN 接続しておきます。

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Add following descriptions to the `dependencies` of your module's `build.gradle`.

```
implementation "com.ricoh360.thetaclient:theta-client:1.8.0"
implementation "com.ricoh360.thetaclient:theta-client:1.9.0"
```

- Connect the wireless LAN between THETA and the smartphone that runs on the application using this SDK.
Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ dependencies {
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.9")
implementation("com.soywiz.korlibs.krypto:krypto:4.0.10")

implementation("com.ricoh360.thetaclient:theta-client:1.8.0")
implementation("com.ricoh360.thetaclient:theta-client:1.9.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,69 @@ fun toCameraErrorList(cameraErrorList: List<CameraErrorEnum>?): List<String>? {
}

fun toResult(thetaState: ThetaState): Map<String, Any?> {
val result = mutableMapOf(
"fingerprint" to thetaState.fingerprint,
"batteryLevel" to thetaState.batteryLevel,
"storageUri" to thetaState.storageUri,
"storageID" to thetaState.storageID,
"captureStatus" to thetaState.captureStatus.name,
"recordedTime" to thetaState.recordedTime,
"recordableTime" to thetaState.recordableTime,
"capturedPictures" to thetaState.capturedPictures,
"compositeShootingElapsedTime" to thetaState.compositeShootingElapsedTime,
"latestFileUrl" to thetaState.latestFileUrl,
"chargingState" to thetaState.chargingState.name,
"apiVersion" to thetaState.apiVersion,
"isPluginRunning" to thetaState.isPluginRunning,
"isPluginWebServer" to thetaState.isPluginWebServer,
"function" to thetaState.function?.name,
"isMySettingChanged" to thetaState.isMySettingChanged,
"currentMicrophone" to thetaState.currentMicrophone?.name,
"isSdCard" to thetaState.isSdCard,
"cameraError" to toCameraErrorList(thetaState.cameraError),
"isBatteryInsert" to thetaState.isBatteryInsert,
)
val result = mutableMapOf<String, Any>()
thetaState.fingerprint?.let {
result.put("fingerprint", it)
}
thetaState.batteryLevel?.let {
result.put("batteryLevel", it)
}
thetaState.storageUri?.let {
result.put("storageUri", it)
}
thetaState.storageID?.let {
result.put("storageID", it)
}
thetaState.captureStatus?.let {
result.put("captureStatus", it.name)
}
thetaState.recordedTime?.let {
result.put("recordedTime", it)
}
thetaState.recordableTime?.let {
result.put("recordableTime", it)
}
thetaState.capturedPictures?.let {
result.put("capturedPictures", it)
}
thetaState.compositeShootingElapsedTime?.let {
result.put("compositeShootingElapsedTime", it)
}
thetaState.latestFileUrl?.let {
result.put("latestFileUrl", it)
}
thetaState.chargingState?.let {
result.put("chargingState", it.name)
}
thetaState.apiVersion?.let {
result.put("apiVersion", it)
}
thetaState.isPluginRunning?.let {
result.put("isPluginRunning", it)
}
thetaState.isPluginWebServer?.let {
result.put("isPluginWebServer", it)
}
thetaState.function?.let {
result.put("function", it.name)
}
thetaState.isMySettingChanged?.let {
result.put("isMySettingChanged", it)
}
thetaState.currentMicrophone?.let {
result.put("currentMicrophone", it.name)
}
thetaState.isSdCard?.let {
result.put("isSdCard", it)
}
thetaState.cameraError?.let {
toCameraErrorList(it)?.let { list ->
result.put("cameraError", list)
}
}
thetaState.isBatteryInsert?.let {
result.put("isBatteryInsert", it)
}
thetaState.externalGpsInfo?.let {
result.put(KEY_STATE_EXTERNAL_GPS_INFO, toResult(it))
}
Expand Down Expand Up @@ -174,6 +215,22 @@ fun toResult(burstOption: BurstOption): Map<String, Any?> {
)
}

fun toEthernetConfig(map: Map<String, Any>): EthernetConfig {
val proxy = map["proxy"]?.let {
@Suppress("UNCHECKED_CAST")
(it as? Map<String, Any>)?.let{ map ->
toProxy(map)
}
}
return EthernetConfig(
usingDhcp = map["usingDhcp"] as? Boolean ?: true,
ipAddress = map["ipAddress"] as? String,
subnetMask = map["subnetMask"] as? String,
defaultGateway = map["defaultGateway"] as? String,
proxy = proxy
)
}

fun toGpsInfo(map: Map<String, Any>): GpsInfo {
return GpsInfo(
latitude = (map["latitude"] as Double).toFloat(),
Expand Down Expand Up @@ -423,6 +480,26 @@ fun toGetOptionsParam(data: List<String>): List<OptionNameEnum> {
return optionNames
}

fun toResult(ethernetConfig: EthernetConfig): Map<String, Any?> {
val result = mutableMapOf<String, Any>()

result["usingDhcp"] = ethernetConfig.usingDhcp

ethernetConfig.ipAddress?.let { value ->
result["ipAddress"] = value
}
ethernetConfig.subnetMask?.let { value ->
result["subnetMask"] = value
}
ethernetConfig.defaultGateway?.let { value ->
result["defaultGateway"] = value
}
ethernetConfig.proxy?.let {
result["proxy"] = toResult(proxy = it)
}
return result
}

fun toResult(gpsInfo: GpsInfo): Map<String, Any> {
return mapOf(
"latitude" to gpsInfo.latitude,
Expand Down Expand Up @@ -506,6 +583,10 @@ fun toResult(options: Options): Map<String, Any> {
options.getValue<BurstOption>(OptionNameEnum.BurstOption)?.let { burstOption ->
result[OptionNameEnum.BurstOption.name] = toResult(burstOption)
}
} else if (name == OptionNameEnum.EthernetConfig) {
options.getValue<EthernetConfig>(OptionNameEnum.EthernetConfig)?.let { ethernetConfig ->
result[OptionNameEnum.EthernetConfig.name] = toResult(ethernetConfig = ethernetConfig)
}
} else if (name == OptionNameEnum.GpsInfo) {
options.getValue<GpsInfo>(OptionNameEnum.GpsInfo)?.let { gpsInfo ->
result[OptionNameEnum.GpsInfo.name] = toResult(gpsInfo)
Expand Down Expand Up @@ -598,6 +679,9 @@ fun setOptionValue(options: Options, name: OptionNameEnum, value: Any) {
} else if (name == OptionNameEnum.BurstOption) {
@Suppress("UNCHECKED_CAST")
options.setValue(name, toBurstOption(value as Map<String, Any>))
} else if (name == OptionNameEnum.EthernetConfig) {
@Suppress("UNCHECKED_CAST")
options.setValue(name, toEthernetConfig(value as Map<String, Any>))
} else if (name == OptionNameEnum.GpsInfo) {
@Suppress("UNCHECKED_CAST")
options.setValue(name, toGpsInfo(value as Map<String, Any>))
Expand Down
135 changes: 110 additions & 25 deletions flutter/ios/Classes/ConvertUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,31 +128,73 @@ func convertResult(cameraErrorList: [ThetaRepository.CameraErrorEnum]?) -> [Stri
}

func convertResult(thetaState: ThetaRepository.ThetaState) -> [String: Any?] {
var result = [
"fingerprint": thetaState.fingerprint,
"batteryLevel": thetaState.batteryLevel,
"storageUri": thetaState.storageUri,
"storageID": thetaState.storageID,
"captureStatus": thetaState.captureStatus.name,
"recordedTime": thetaState.recordedTime,
"recordableTime": thetaState.recordableTime,
"capturedPictures": thetaState.capturedPictures,
"compositeShootingElapsedTime": thetaState.compositeShootingElapsedTime,
"latestFileUrl": thetaState.latestFileUrl,
"chargingState": thetaState.chargingState.name,
"apiVersion": thetaState.apiVersion,
"isPluginRunning": convertKotlinBooleanToBool(value: thetaState.isPluginRunning),
"isPluginWebServer": convertKotlinBooleanToBool(value: thetaState.isPluginWebServer),
"function": thetaState.function?.name,
"isMySettingChanged": convertKotlinBooleanToBool(value: thetaState.isMySettingChanged),
"currentMicrophone": thetaState.currentMicrophone?.name,
"isSdCard": convertKotlinBooleanToBool(value: thetaState.isSdCard),
"cameraError": convertResult(cameraErrorList: thetaState.cameraError),
"isBatteryInsert": convertKotlinBooleanToBool(value: thetaState.isBatteryInsert),
KEY_STATE_BOARD_TEMP: thetaState.boardTemp,
KEY_STATE_BATTERY_TEMP: thetaState.batteryTemp,
] as [String: Any?]

var result: [String: Any] = [:]
if let value = thetaState.fingerprint {
result["fingerprint"] = value
}
if let value = thetaState.batteryLevel {
result["batteryLevel"] = value
}
if let value = thetaState.storageUri {
result["storageUri"] = value
}
if let value = thetaState.storageID {
result["storageID"] = value
}
if let value = thetaState.captureStatus {
result["captureStatus"] = value.name
}
if let value = thetaState.recordedTime {
result["recordedTime"] = value
}
if let value = thetaState.recordableTime {
result["recordableTime"] = value
}
if let value = thetaState.capturedPictures {
result["capturedPictures"] = value
}
if let value = thetaState.compositeShootingElapsedTime {
result["compositeShootingElapsedTime"] = value
}
if let value = thetaState.latestFileUrl {
result["latestFileUrl"] = value
}
if let value = thetaState.chargingState {
result["chargingState"] = value.name
}
if let value = thetaState.apiVersion {
result["apiVersion"] = value
}
if let value = thetaState.isPluginRunning {
result["isPluginRunning"] = convertKotlinBooleanToBool(value: value)
}
if let value = thetaState.isPluginWebServer {
result["isPluginWebServer"] = convertKotlinBooleanToBool(value: value)
}
if let value = thetaState.function {
result["function"] = value.name
}
if let value = thetaState.isMySettingChanged {
result["isMySettingChanged"] = convertKotlinBooleanToBool(value: value)
}
if let value = thetaState.currentMicrophone {
result["currentMicrophone"] = value.name
}
if let value = thetaState.isSdCard {
result["isSdCard"] = convertKotlinBooleanToBool(value: value)
}
if let value = thetaState.cameraError {
result["cameraError"] = convertResult(cameraErrorList: value)
}
if let value = thetaState.isBatteryInsert {
result["isBatteryInsert"] = convertKotlinBooleanToBool(value: value)
}
if let value = thetaState.boardTemp {
result[KEY_STATE_BOARD_TEMP] = value
}
if let value = thetaState.batteryTemp {
result[KEY_STATE_BATTERY_TEMP] = value
}
if let externalGpsInfo = thetaState.externalGpsInfo {
result[KEY_STATE_EXTERNAL_GPS_INFO] = convertResult(stateGpsInfo: externalGpsInfo)
}
Expand Down Expand Up @@ -551,6 +593,24 @@ func convertResult(burstOption: ThetaRepository.BurstOption) -> [String: Any?] {
]
}

func toEthernetConfig(params: [String: Any]) -> ThetaRepository.EthernetConfig {
let proxy: ThetaRepository.Proxy? = {
if let proxyMap = params["proxy"] as? [String: Any] {
toProxy(params: proxyMap)
} else {
nil
}
}()

return ThetaRepository.EthernetConfig(
usingDhcp: params["usingDhcp"] as? Bool ?? true,
ipAddress: params["ipAddress"] as? String,
subnetMask: params["subnetMask"] as? String,
defaultGateway: params["defaultGateway"] as? String,
proxy: proxy
)
}

func toGpsInfo(params: [String: Any]) -> ThetaRepository.GpsInfo {
return ThetaRepository.GpsInfo(
latitude: Float(params["latitude"] as? Double ?? 0),
Expand Down Expand Up @@ -623,6 +683,25 @@ func convertGetOptionsParam(params: [String]) -> [ThetaRepository.OptionNameEnum
return array
}

func convertResult(ethernetConfig: ThetaRepository.EthernetConfig) -> [String: Any] {
var result: [String: Any] = [
"usingDhcp": ethernetConfig.usingDhcp
]
if let ipAddress = ethernetConfig.ipAddress {
result["ipAddress"] = ipAddress
}
if let subnetMask = ethernetConfig.subnetMask {
result["subnetMask"] = subnetMask
}
if let defaultGateway = ethernetConfig.defaultGateway {
result["defaultGateway"] = defaultGateway
}
if let proxy = ethernetConfig.proxy {
result["proxy"] = convertResult(proxy: proxy)
}
return result
}

func convertResult(gpsInfo: ThetaRepository.GpsInfo) -> [String: Any] {
return [
"latitude": gpsInfo.latitude,
Expand Down Expand Up @@ -684,6 +763,8 @@ func convertResult(options: ThetaRepository.Options) -> [String: Any] {
result[name.name] = convertResult(autoBracket: autoBracket)
} else if value is ThetaRepository.BurstOption, let burstOption = value as? ThetaRepository.BurstOption {
result[name.name] = convertResult(burstOption: burstOption)
} else if value is ThetaRepository.EthernetConfig, let ethernetConfig = value as? ThetaRepository.EthernetConfig {
result[name.name] = convertResult(ethernetConfig: ethernetConfig)
} else if value is ThetaRepository.GpsInfo {
let gpsInfo = value as! ThetaRepository.GpsInfo
result[name.name] = convertResult(gpsInfo: gpsInfo)
Expand Down Expand Up @@ -782,6 +863,10 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
options.continuousNumber = getEnumValue(values: ThetaRepository.ContinuousNumberEnum.values(), name: value as! String)!
case ThetaRepository.OptionNameEnum.datetimezone.name:
options.dateTimeZone = value as? String
case ThetaRepository.OptionNameEnum.ethernetconfig.name:
if let params = value as? [String: Any] {
options.ethernetConfig = toEthernetConfig(params: params)
}
case ThetaRepository.OptionNameEnum.exposurecompensation.name:
options.exposureCompensation = getEnumValue(values: ThetaRepository.ExposureCompensationEnum.values(), name: value as! String)!
case ThetaRepository.OptionNameEnum.exposuredelay.name:
Expand Down
Loading

0 comments on commit 46a3dd3

Please sign in to comment.