• R/O
  • HTTP
  • SSH
  • HTTPS

A01d: Commit

OPC(Olympus Air)用望遠鏡アプリ。


Commit MetaInfo

Revisão9db045c2386984e95f686d6abed7af29e4fb561b (tree)
Hora2020-03-08 21:35:38
AutorMRSa <mrsa@myad...>
CommiterMRSa

Mensagem de Log

とりあえずこれで。

Mudança Sumário

Diff

--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/operation/NikonCaptureControl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/operation/NikonCaptureControl.java
@@ -19,7 +19,6 @@ public class NikonCaptureControl implements ICaptureControl, IPtpIpCommandCallba
1919 private final String TAG = this.toString();
2020 private final PtpIpCommandPublisher commandPublisher;
2121 //private final IAutoFocusFrameDisplay frameDisplayer;
22- private boolean isDumpLog = false;
2322
2423 public NikonCaptureControl(@NonNull PtpIpCommandPublisher commandPublisher, IAutoFocusFrameDisplay frameDisplayer)
2524 {
@@ -30,6 +29,7 @@ public class NikonCaptureControl implements ICaptureControl, IPtpIpCommandCallba
3029 @Override
3130 public void doCapture(int kind)
3231 {
32+ boolean isDumpLog = false;
3333 try
3434 {
3535 // シャッター
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/operation/NikonFocusingControl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/operation/NikonFocusingControl.java
@@ -35,7 +35,7 @@ public class NikonFocusingControl implements IFocusingControl, IPtpIpCommandCall
3535 private float maxPointLimitHeight;
3636 private RectF preFocusFrameRect = null;
3737 private boolean not_support_focus_lock = false;
38- private boolean isDumpLog = true;
38+ private boolean isDumpLog = false;
3939
4040 public NikonFocusingControl(@NonNull Activity context, @NonNull PtpIpCommandPublisher commandPublisher, IAutoFocusFrameDisplay frameDisplayer, IIndicatorControl indicator)
4141 {
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java
@@ -110,14 +110,14 @@ public class NikonCameraConnectSequence implements Runnable, IPtpIpCommandCallba
110110 break;
111111
112112 case SEQ_EVENT_INITIALIZE:
113- interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting1), false, false, 0);
113+ interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.nikon_connect_connecting1), false, false, 0);
114114 commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_INIT_SESSION, 50, isDumpLog, 0, 0x1001, 0, 0, 0, 0, 0)); // GetDeviceInfo
115115 break;
116116
117117 case SEQ_INIT_SESSION:
118118 if (checkEventInitialize(rx_body))
119119 {
120- interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting2), false, false, 0);
120+ interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.nikon_connect_connecting2), false, false, 0);
121121 commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_OPEN_SESSION, 50, isDumpLog, 0, 0x1002, 4, 0x41, 0, 0, 0)); // OpenSession
122122 }
123123 else
@@ -126,14 +126,12 @@ public class NikonCameraConnectSequence implements Runnable, IPtpIpCommandCallba
126126 }
127127 break;
128128 case SEQ_OPEN_SESSION:
129- interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting3), false, false, 0);
129+ interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.nikon_connect_connecting3), false, false, 0);
130130 commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_CHANGE_REMOTE, 50, isDumpLog, 0, 0x902c, 4, 0x01, 0, 0, 0)); //
131131 break;
132132
133133 case SEQ_CHANGE_REMOTE:
134134 case SEQ_SET_EVENT_MODE:
135- interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting4), false, false, 0);
136- interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting5), false, false, 0);
137135 interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_connect_finished), false, false, 0);
138136 connectFinished();
139137 Log.v(TAG, " CONNECT TO CAMERA : DONE.");
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonConnection.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonConnection.java
@@ -212,7 +212,7 @@ public class NikonConnection implements ICameraConnection
212212 */
213213 private void disconnectFromCamera(final boolean powerOff)
214214 {
215- Log.v(TAG, " disconnectFromCamera()");
215+ Log.v(TAG, " disconnectFromCamera() : " + powerOff);
216216 try
217217 {
218218 cameraExecutor.execute(disconnectSequence);
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java
@@ -14,7 +14,6 @@ import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.IPtpIpCommunication;
1414 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.PtpIpResponseReceiver;
1515 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.messages.PtpIpCommandGeneric;
1616 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.liveview.IPtpIpLiveViewImageCallback;
17-import net.osdn.gokigen.a01d.camera.utils.SimpleLogDumper;
1817 import net.osdn.gokigen.a01d.liveview.liveviewlistener.IImageDataReceiver;
1918 import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
2019
@@ -37,7 +36,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
3736 private NikonLiveViewImageReceiver imageReceiver;
3837 private IImageDataReceiver dataReceiver = null;
3938 private boolean liveViewIsReceiving = false;
40- private boolean commandIssued = false;
39+ //private boolean commandIssued = false;
4140 private boolean isDumpLog = false;
4241
4342 public NikonLiveViewControl(@NonNull Activity context, @NonNull IPtpIpInterfaceProvider interfaceProvider, int delayMs)
@@ -64,7 +63,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
6463 Log.v(TAG, " startLiveView() ");
6564 try
6665 {
67- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_START_LIVEVIEW, 30, isDumpLog, 0, 0x9201, 0, 0x00, 0x00, 0x00, 0x00));
66+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_START_LIVEVIEW, delayMs, isDumpLog, 0, 0x9201, 0, 0x00, 0x00, 0x00, 0x00));
6867 }
6968 catch (Exception e)
7069 {
@@ -81,7 +80,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
8180 if (liveViewIsReceiving)
8281 {
8382 liveViewIsReceiving = false;
84- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(new PtpIpResponseReceiver(null), SEQ_STOP_LIVEVIEW, 30, isDumpLog, 0, 0x9202, 0, 0x00, 0x00, 0x00, 0x00));
83+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(new PtpIpResponseReceiver(null), SEQ_STOP_LIVEVIEW, delayMs, isDumpLog, 0, 0x9202, 0, 0x00, 0x00, 0x00, 0x00));
8584 }
8685 }
8786 catch (Exception e)
@@ -90,6 +89,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
9089 }
9190 }
9291
92+/*
9393 private void startLiveviewImpl()
9494 {
9595 liveViewIsReceiving = true;
@@ -131,6 +131,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
131131 e.printStackTrace();
132132 }
133133 }
134+*/
134135
135136 @Override
136137 public void updateDigitalZoom()
@@ -199,7 +200,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
199200 {
200201 e.printStackTrace();
201202 }
202- commandIssued = false;
203+ //commandIssued = false;
203204 sendNextMessage();
204205 }
205206
@@ -210,7 +211,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
210211 Thread.sleep(delayMs);
211212 //commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP1, 30, isDumpLog, 0, 0x1015, 4, 0x5007, 0x00, 0x00, 0x00));
212213 //commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_CHECK_EVENT, 30, isDumpLog, 0, 0x90c7, 0, 0x00, 0x00, 0x00, 0x00));
213- commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, 35, isDumpLog));
214+ commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, delayMs, isDumpLog));
214215 }
215216 catch (Exception e)
216217 {
@@ -249,7 +250,7 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
249250 public void onErrorOccurred(Exception e)
250251 {
251252 Log.v(TAG, " onErrorOccurred () : " + e.getLocalizedMessage());
252- commandIssued = false;
253+ //commandIssued = false;
253254 }
254255
255256 @Override
@@ -285,29 +286,29 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
285286 Log.v(TAG, String.format(" ----- OK REPLY (ID : %d) ----- ", id));
286287 if (id == SEQ_START_LIVEVIEW)
287288 {
288- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_DEVICE_READY, 30, isDumpLog, 0, 0x90c8, 0, 0x00, 0x00, 0x00, 0x00));
289+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_DEVICE_READY, delayMs, isDumpLog, 0, 0x90c8, 0, 0x00, 0x00, 0x00, 0x00));
289290 }
290291 else if (id == SEQ_DEVICE_READY)
291292 {
292- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_AFDRIVE, 30, isDumpLog, 0, 0x90c1, 0, 0x00, 0x00, 0x00, 0x00));
293+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_AFDRIVE, delayMs, isDumpLog, 0, 0x90c1, 0, 0x00, 0x00, 0x00, 0x00));
293294 }
294295 else if (id == SEQ_CHECK_EVENT)
295296 {
296- commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, 35, isDumpLog));
297+ commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, delayMs, isDumpLog));
297298 }
298299 else if (id == SEQ_GET_DEVICE_PROP1)
299300 {
300- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP2, 30, isDumpLog, 0, 0x1015, 4, 0xd100, 0x00, 0x00, 0x00));
301+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP2, delayMs, isDumpLog, 0, 0x1015, 4, 0xd100, 0x00, 0x00, 0x00));
301302 }
302303 else if (id == SEQ_GET_DEVICE_PROP2)
303304 {
304- commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, 35, isDumpLog));
305+ commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, delayMs, isDumpLog));
305306 }
306307 else // SEQ_AFDRIVE
307308 {
308309 // ライブビューの開始。
309310 //startLiveviewImpl();
310- commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, 80, isDumpLog));
311+ commandIssuer.enqueueCommand(new NikonLiveViewRequestMessage(imageReceiver, delayMs, isDumpLog));
311312 }
312313 }
313314 catch (Exception e)
@@ -335,27 +336,27 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListene
335336 waitSleep();
336337 if (id == SEQ_START_LIVEVIEW)
337338 {
338- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_START_LIVEVIEW, 30, isDumpLog, 0, 0x9201, 0, 0x00, 0x00, 0x00, 0x00));
339+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_START_LIVEVIEW, delayMs, isDumpLog, 0, 0x9201, 0, 0x00, 0x00, 0x00, 0x00));
339340 }
340341 else if (id == SEQ_DEVICE_READY)
341342 {
342- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_DEVICE_READY, 30, isDumpLog, 0, 0x90c8, 0, 0x00, 0x00, 0x00, 0x00));
343+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_DEVICE_READY, delayMs, isDumpLog, 0, 0x90c8, 0, 0x00, 0x00, 0x00, 0x00));
343344 }
344345 else if (id == SEQ_CHECK_EVENT)
345346 {
346- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_CHECK_EVENT, 30, isDumpLog, 0, 0x90c7, 0, 0x00, 0x00, 0x00, 0x00));
347+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_CHECK_EVENT, delayMs, isDumpLog, 0, 0x90c7, 0, 0x00, 0x00, 0x00, 0x00));
347348 }
348349 else if (id == SEQ_GET_DEVICE_PROP1)
349350 {
350- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP1, 30, isDumpLog, 0, 0x5007, 4, 0x5007, 0x00, 0x00, 0x00));
351+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP1, delayMs, isDumpLog, 0, 0x5007, 4, 0x5007, 0x00, 0x00, 0x00));
351352 }
352353 else if (id == SEQ_GET_DEVICE_PROP2)
353354 {
354- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP2, 30, isDumpLog, 0, 0x1015, 4, 0xd100, 0x00, 0x00, 0x00));
355+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_DEVICE_PROP2, delayMs, isDumpLog, 0, 0x1015, 4, 0xd100, 0x00, 0x00, 0x00));
355356 }
356357 else
357358 {
358- commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_AFDRIVE, 30, isDumpLog, 0, 0x90c1, 0, 0x00, 0x00, 0x00, 0x00));
359+ commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_AFDRIVE, delayMs, isDumpLog, 0, 0x90c1, 0, 0x00, 0x00, 0x00, 0x00));
359360 }
360361 }
361362 catch (Exception e)
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/PtpIpCommandPublisher.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/PtpIpCommandPublisher.java
@@ -73,13 +73,13 @@ public class PtpIpCommandPublisher implements IPtpIpCommandPublisher, IPtpIpComm
7373 if (tcpNoDelay)
7474 {
7575 socket.setKeepAlive(false);
76- socket.setPerformancePreferences(0, 1, 0);
77- //socket.setSoLinger(true, 3000);
76+ socket.setPerformancePreferences(0, 2, 0);
7877 socket.setOOBInline(true);
7978 socket.setReuseAddress(false);
79+ socket.setTrafficClass(0x80);
80+ //socket.setSoLinger(true, 3000);
8081 //socket.setReceiveBufferSize(2097152);
8182 //socket.setSendBufferSize(524288);
82- socket.setTrafficClass(0x80);
8383 }
8484 socket.connect(new InetSocketAddress(ipAddress, portNumber), 0);
8585 return (true);
@@ -393,7 +393,7 @@ public class PtpIpCommandPublisher implements IPtpIpCommandPublisher, IPtpIpComm
393393 {
394394 delayMs = COMMAND_SEND_RECEIVE_DURATION_MS;
395395 }
396-
396+/*
397397 try
398398 {
399399 if (socket != null)
@@ -405,6 +405,7 @@ public class PtpIpCommandPublisher implements IPtpIpCommandPublisher, IPtpIpComm
405405 {
406406 e.printStackTrace();
407407 }
408+*/
408409
409410 if ((callback != null)&&(callback.isReceiveMulti()))
410411 {
@@ -518,11 +519,11 @@ public class PtpIpCommandPublisher implements IPtpIpCommandPublisher, IPtpIpComm
518519 }
519520 }
520521
521- boolean read_retry = false;
522- int target_length = 0;
523- int received_length = 0;
522+ int target_length;
523+ int received_length;
524524
525- do
525+ //boolean read_retry = false;
526+ //do
526527 {
527528 // 初回データの読み込み...
528529 read_bytes = is.read(byte_array, 0, receive_message_buffer_size);
@@ -540,7 +541,7 @@ public class PtpIpCommandPublisher implements IPtpIpCommandPublisher, IPtpIpComm
540541 return (false);
541542 }
542543
543- } while (read_retry);
544+ } //while (read_retry);
544545
545546 // 一時的な処理
546547 if (callback != null)
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -241,6 +241,10 @@
241241 <string name="canon_connect_connecting11">接続中&#8230;(11/12)</string>
242242 <string name="canon_connect_connecting12">接続中&#8230;(12/12)</string>
243243
244+ <string name="nikon_connect_connecting1">接続中&#8230;(1/5)</string>
245+ <string name="nikon_connect_connecting2">接続中&#8230;(2/5)</string>
246+ <string name="nikon_connect_connecting3">接続中&#8230;(3/5)</string>
247+
244248 <string name="connect_error_message">接続失敗</string>
245249
246250 <string name="connect_error_message_olympus">接続失敗 (OLYMPUS)</string>
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -246,6 +246,10 @@
246246 <string name="canon_connect_connecting11">Connecting&#8230;(11/12)</string>
247247 <string name="canon_connect_connecting12">Connecting&#8230;(12/12)</string>
248248
249+ <string name="nikon_connect_connecting1">Connecting&#8230;(1/5)</string>
250+ <string name="nikon_connect_connecting2">Connecting&#8230;(2/5)</string>
251+ <string name="nikon_connect_connecting3">Connecting&#8230;(3/5)</string>
252+
249253 <string name="connect_error_message">CONNECTION ERROR</string>
250254
251255 <string name="connect_error_message_olympus">CONNECTION ERROR (OLYMPUS)</string>
Show on old repository browser