OPC(Olympus Air)用望遠鏡アプリ。
Revision | bcc5e5ad7a9c4781d97f830d67bf38abffe95fa8 (tree) |
---|---|
Zeit | 2018-06-21 00:46:21 |
Autor | MRSa <mrsa@myad...> |
Commiter | MRSa |
カメラパラメータに key & valueも指定できるようにした。
@@ -340,7 +340,23 @@ public class SonyCameraApiListFragment extends ListFragment implements SendReque | ||
340 | 340 | { |
341 | 341 | for (int index = 0; index < parameterItems.length; index++) |
342 | 342 | { |
343 | - params.put(parameterItems[index]); | |
343 | + String oneItem = parameterItems[index]; | |
344 | + if (oneItem.contains(":")) | |
345 | + { | |
346 | + // key & value と判断 | |
347 | + try | |
348 | + { | |
349 | + String[] keyValue = oneItem.split(":"); | |
350 | + params.put(new JSONObject().put(keyValue[0], keyValue[1])); | |
351 | + } | |
352 | + catch (Exception e) | |
353 | + { | |
354 | + e.printStackTrace(); | |
355 | + params.put(oneItem); | |
356 | + } | |
357 | + } else { | |
358 | + params.put(oneItem); | |
359 | + } | |
344 | 360 | } |
345 | 361 | } |
346 | 362 | receivedReply(interfaceProvider.getSonyInterface().getCameraApi().callGenericSonyApiMethod(service, apiName, params, version)); |