• R/O
  • HTTP
  • SSH
  • HTTPS

A01c: Commit

OPC(Olympus Air)用撮影アプリ。


Commit MetaInfo

Révision6b0a6e3f13e0448ca5505a067ce3ba1bbe7b8217 (tree)
l'heure2021-01-20 00:10:12
AuteurMRSa <mrsa@myad...>
CommiterMRSa

Message de Log

Theta Vでの動作確認。

Change Summary

Modification

Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,7 +8,7 @@ android {
88 minSdkVersion 23
99 targetSdkVersion 30
1010 versionCode 37
11- versionName "1.3.3"
11+ versionName "1.4.0"
1212 }
1313 buildTypes {
1414 release {
--- a/wear/build.gradle
+++ b/wear/build.gradle
@@ -9,7 +9,7 @@ android {
99 minSdkVersion 23
1010 targetSdkVersion 30
1111 versionCode 38
12- versionName "1.3.3"
12+ versionName "1.4.0"
1313 }
1414 buildTypes {
1515 release {
--- a/wear/src/main/java/jp/sfjp/gokigen/a01c/thetacamerawrapper/status/ThetaCameraStatusWatcher.kt
+++ b/wear/src/main/java/jp/sfjp/gokigen/a01c/thetacamerawrapper/status/ThetaCameraStatusWatcher.kt
@@ -42,23 +42,32 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
4242 {
4343 val getOptionsUrl = "http://192.168.1.1/osc/commands/execute"
4444 val getStateUrl = "http://192.168.1.1/osc/state"
45- val postData = if (sessionIdProvider.sessionId.isEmpty()) "{\"name\":\"camera.getOptions\",\"parameters\":{\"timeout\":0, \"optionNames\" : [ \"aperture\",\"captureMode\",\"exposureCompensation\",\"exposureProgram\",\"iso\",\"shutterSpeed\",\"_filter\",\"whiteBalance\"] }" else "{\"name\":\"camera.getOptions\",\"parameters\":{\"sessionId\": \"" + sessionIdProvider.sessionId + "\", \"optionNames\" : [ \"aperture\",\"captureMode\",\"exposureCompensation\",\"exposureProgram\",\"iso\",\"shutterSpeed\",\"_filter\",\"whiteBalance\"] }}"
46- Log.v(TAG, " >>>>> START STATUS WATCH : $getOptionsUrl $postData")
45+
46+ val postDataCaptureMode = if (sessionIdProvider.sessionId.isEmpty()) "{\"name\":\"camera.getOptions\",\"parameters\":{\"timeout\":0, \"optionNames\" : [ \"captureMode\"] }}" else "{\"name\":\"camera.getOptions\",\"parameters\":{\"sessionId\": \"" + sessionIdProvider.sessionId + "\", \"optionNames\" : [ \"captureMode\" ] }}"
47+ val postDataImage = if (sessionIdProvider.sessionId.isEmpty()) "{\"name\":\"camera.getOptions\",\"parameters\":{\"timeout\":0, \"optionNames\" : [ \"aperture\",\"captureMode\",\"exposureCompensation\",\"exposureProgram\",\"iso\",\"shutterSpeed\",\"_filter\",\"whiteBalance\"] }}" else "{\"name\":\"camera.getOptions\",\"parameters\":{\"sessionId\": \"" + sessionIdProvider.sessionId + "\", \"optionNames\" : [ \"aperture\",\"captureMode\",\"exposureCompensation\",\"exposureProgram\",\"iso\",\"shutterSpeed\",\"_filter\",\"whiteBalance\"] }}"
48+ val postDataVideo = if (sessionIdProvider.sessionId.isEmpty()) "{\"name\":\"camera.getOptions\",\"parameters\":{\"timeout\":0, \"optionNames\" : [ \"aperture\",\"captureMode\",\"exposureCompensation\",\"exposureProgram\",\"iso\",\"shutterSpeed\",\"whiteBalance\"] }}" else "{\"name\":\"camera.getOptions\",\"parameters\":{\"sessionId\": \"" + sessionIdProvider.sessionId + "\", \"optionNames\" : [ \"aperture\",\"captureMode\",\"exposureCompensation\",\"exposureProgram\",\"iso\",\"shutterSpeed\",\"_filter\",\"whiteBalance\"] }}"
49+ Log.v(TAG, " >>>>> START STATUS WATCH : $getOptionsUrl")
4750 while (whileFetching)
4851 {
49- val response: String? = httpClient.httpPostWithHeader(getOptionsUrl, postData, null, "application/json;charset=utf-8", timeoutMs)
50- if (!(response.isNullOrEmpty()))
52+ val response0: String? = httpClient.httpPostWithHeader(getOptionsUrl, postDataCaptureMode, null, "application/json;charset=utf-8", timeoutMs)
53+ if (!(response0.isNullOrEmpty()))
5154 {
5255 // 設定データ受信、解析する
53- checkStatus1(response)
56+ checkStatus0(response0)
57+ }
58+ val postData = if (currentCaptureMode != "image") { postDataVideo } else { postDataImage }
59+ val response1: String? = httpClient.httpPostWithHeader(getOptionsUrl, postData, null, "application/json;charset=utf-8", timeoutMs)
60+ if (!(response1.isNullOrEmpty()))
61+ {
62+ // 設定データ受信、解析する
63+ checkStatus1(response1)
5464 }
5565 val response2: String? = httpClient.httpPostWithHeader(getStateUrl, "", null, "application/json;charset=utf-8", timeoutMs)
5666 if (!(response2.isNullOrEmpty()))
5767 {
5868 // ステータスデータ受信、解析する
59- checkStatus0(response2)
69+ checkStatus2(response2)
6070 }
61-
6271 try
6372 {
6473 // ちょっと休む
@@ -83,11 +92,39 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
8392 }
8493 }
8594
95+ private fun checkStatus0(response: String)
96+ {
97+ try
98+ {
99+ //Log.v(TAG, " STATUS0 : $response")
100+ val stateObject = JSONObject(response).getJSONObject("results").getJSONObject("options")
101+ try
102+ {
103+ val captureMode = stateObject.getString(THETA_CAPTURE_MODE)
104+ if (captureMode != currentCaptureMode)
105+ {
106+ Log.v(TAG, " CapMode : $currentCaptureMode -> $captureMode")
107+ currentCaptureMode = captureMode
108+ statusHolder.captureMode = captureMode
109+ showInformation.setMessage(IShowInformation.AREA_1, Color.WHITE, captureMode)
110+ }
111+ }
112+ catch (e: Exception)
113+ {
114+ e.printStackTrace()
115+ }
116+ }
117+ catch (e : Exception)
118+ {
119+ e.printStackTrace()
120+ }
121+ }
122+
86123 private fun checkStatus1(response: String)
87124 {
88125 try
89126 {
90- //Log.v(TAG, " STATUS : $response")
127+ //Log.v(TAG, " STATUS1 : $response")
91128 val stateObject = JSONObject(response).getJSONObject("results").getJSONObject("options")
92129 try
93130 {
@@ -136,22 +173,6 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
136173
137174 try
138175 {
139- val captureMode = stateObject.getString(THETA_CAPTURE_MODE)
140- if (captureMode != currentCaptureMode)
141- {
142- Log.v(TAG, " CapMode : $currentCaptureMode -> $captureMode")
143- currentCaptureMode = captureMode
144- statusHolder.captureMode = captureMode
145- showInformation.setMessage(IShowInformation.AREA_1, Color.WHITE, captureMode)
146- }
147- }
148- catch (e: Exception)
149- {
150- e.printStackTrace()
151- }
152-
153- try
154- {
155176 val exposureProgram = stateObject.getString(THETA_EXPOSURE_PROGRAM)
156177 if (exposureProgram != currentExposureProgram)
157178 {
@@ -174,26 +195,33 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
174195 e.printStackTrace()
175196 }
176197
177- try
198+ if (currentCaptureMode == "image")
178199 {
179- val filterValue = stateObject.getString(THETA_FILTER)
180- if (filterValue != currentFilter)
200+ try
181201 {
182- Log.v(TAG, " FILTER : $currentFilter -> $filterValue")
183- currentFilter = filterValue
184- if (currentFilter == "off")
202+ val filterValue = stateObject.getString(THETA_FILTER)
203+ if (filterValue != currentFilter)
185204 {
186- showInformation.setMessage(IShowInformation.AREA_5, Color.WHITE, "")
187- }
188- else
189- {
190- showInformation.setMessage(IShowInformation.AREA_5, Color.WHITE, currentFilter)
205+ Log.v(TAG, " FILTER : $currentFilter -> $filterValue")
206+ currentFilter = filterValue
207+ if (currentFilter == "off")
208+ {
209+ showInformation.setMessage(IShowInformation.AREA_5, Color.WHITE, "")
210+ }
211+ else
212+ {
213+ showInformation.setMessage(IShowInformation.AREA_5, Color.WHITE, currentFilter)
214+ }
191215 }
192216 }
217+ catch (e: Exception)
218+ {
219+ e.printStackTrace()
220+ }
193221 }
194- catch (e: Exception)
222+ else
195223 {
196- e.printStackTrace()
224+ currentFilter = ""
197225 }
198226
199227 try
@@ -311,11 +339,11 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
311339 return (stringValue)
312340 }
313341
314- private fun checkStatus0(response: String)
342+ private fun checkStatus2(response: String)
315343 {
316344 try
317345 {
318- //Log.v(TAG, " STATUS : $response")
346+ //Log.v(TAG, " STATUS2 : $response")
319347 val stateObject = JSONObject(response).getJSONObject("state")
320348 try
321349 {
@@ -392,6 +420,6 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
392420 {
393421 private val TAG = ThetaCameraStatusWatcher::class.java.simpleName
394422 private const val timeoutMs = 3300
395- private const val loopWaitMs : Long = 450
423+ private const val loopWaitMs : Long = 400
396424 }
397425 }
Afficher sur ancien navigateur de dépôt.