</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
- <timeTargetWasSelectedWithDropDown value="2022-02-17T14:40:45.113298700Z" />
+ <timeTargetWasSelectedWithDropDown value="2022-02-18T12:36:26.894010400Z" />
</component>
</project>
\ No newline at end of file
import jp.osdn.gokigen.gokigenassets.camera.vendor.panasonic.IPanasonicCamera
import jp.osdn.gokigen.gokigenassets.camera.vendor.panasonic.status.ICameraEventObserver
import jp.osdn.gokigen.gokigenassets.liveview.image.CameraLiveViewListenerImpl
+import jp.osdn.gokigen.gokigenassets.scene.IInformationReceiver
import jp.osdn.gokigen.gokigenassets.utils.communication.SimpleHttpClient
import java.net.DatagramPacket
import java.net.DatagramSocket
-class PanasonicLiveViewControl(private val liveViewListener : CameraLiveViewListenerImpl, private val camera: IPanasonicCamera, private val eventObserver: ICameraEventObserver, number: Int)
+class PanasonicLiveViewControl(private val liveViewListener : CameraLiveViewListenerImpl, private val camera: IPanasonicCamera, private val eventObserver: ICameraEventObserver, private val informationReceiver: IInformationReceiver, private val portNumber: Int)
{
- private val liveViewPortNumber = 49151 + number // Base : 49152
+ private val liveViewPortNumber = 49151 + portNumber // Base port number : 49152
private var receiverSocket: DatagramSocket? = null
private var whileStreamReceive = false
private var errorOccur = 0
private const val ERROR_MAX = 30
private const val RECEIVE_BUFFER_SIZE = 1024 * 1024 * 4
private const val TIMEOUT_MS = 3500
- //private const val LIVEVIEW_PORT = 49152
- //private const val LIVEVIEW_START_REQUEST = "cam.cgi?mode=startstream&value=49152"
private const val LIVEVIEW_START_REQUEST = "cam.cgi?mode=startstream&value="
private const val LIVEVIEW_STOP_REQUEST = "cam.cgi?mode=stopstream"
}
}
}
+/*
fun changeLiveViewSize(size: String?) {}
fun updateDigitalZoom() {}
fun updateMagnifyingLiveViewScale(isChangeScale: Boolean) {}
fun getMagnifyingLiveViewScale(): Float { return 1.0f }
fun getDigitalZoomScale(): Float { return 1.0f }
+*/
private fun startReceiveStream()
{
}
catch (e: Exception)
{
+ showExceptionInformation()
exceptionCount++
e.printStackTrace()
if (exceptionCount > TIMEOUT_MAX)
{
Log.v(TAG, "LV : RETRY COMMAND FAIL...")
}
+ else
+ {
+ clearExceptionInformation()
+ }
}
catch (ee: Exception)
{
System.gc()
}
+ private fun showExceptionInformation()
+ {
+ try
+ {
+ val msgToShow = "l${portNumber}e"
+ if (!informationReceiver.getCurrentMessage().contains(msgToShow))
+ {
+ informationReceiver.appendMessage(" $msgToShow")
+ }
+ }
+ catch (e: Exception)
+ {
+ e.printStackTrace()
+ }
+ }
+
+ private fun clearExceptionInformation()
+ {
+ try
+ {
+ val msgToShow = "l${portNumber}e"
+ val currentMessage = informationReceiver.getCurrentMessage()
+ if (currentMessage.contains(msgToShow))
+ {
+ informationReceiver.updateMessage(currentMessage.replace(msgToShow, ""))
+ }
+ }
+ catch (e: Exception)
+ {
+ e.printStackTrace()
+ }
+ }
+
private fun closeReceiveSocket()
{
Log.v(TAG, "closeReceiveSocket()")
import jp.osdn.gokigen.gokigenassets.scene.IVibrator
import jp.osdn.gokigen.gokigenassets.utils.communication.SimpleHttpClient
-class PanasonicCameraControl(private val context: AppCompatActivity, private val vibrator : IVibrator, informationNotify: IInformationReceiver, private val preference: ICameraPreferenceProvider, provider: ICameraStatusReceiver, private val cameraCoordinator: ICameraControlCoordinator, private val number: Int) : IPanasonicCameraHolder, IDisplayInjector,ILiveViewController, ICameraControl, View.OnClickListener, View.OnLongClickListener, ICameraShutter, IKeyDown
+class PanasonicCameraControl(private val context: AppCompatActivity, private val vibrator : IVibrator, private val informationNotify: IInformationReceiver, private val preference: ICameraPreferenceProvider, provider: ICameraStatusReceiver, private val cameraCoordinator: ICameraControlCoordinator, private val number: Int) : IPanasonicCameraHolder, IDisplayInjector,ILiveViewController, ICameraControl, View.OnClickListener, View.OnLongClickListener, ICameraShutter, IKeyDown
{
private val cardSlotSelector = PanasonicCardSlotSelector()
private val liveViewListener = CameraLiveViewListenerImpl(context, informationNotify)
}
if (liveViewControl == null)
{
- liveViewControl = PanasonicLiveViewControl(liveViewListener, panasonicCamera, statusChecker.getCameraStatusEventObserver(), number)
+ liveViewControl = PanasonicLiveViewControl(liveViewListener, panasonicCamera, statusChecker.getCameraStatusEventObserver(), informationNotify, number)
}
focusControl?.setCamera(panasonicCamera)
captureControl?.setCamera(panasonicCamera)
interface IInformationReceiver
{
fun updateMessage(message: String = "", isBold: Boolean = false, isColor: Boolean = false, color: Int = Color.BLACK)
+ fun appendMessage(message: String = "", isBold: Boolean = false, isColor: Boolean = false, color: Int = Color.BLACK)
+ fun getCurrentMessage() : String
}
class ShowMessage(private val activity : AppCompatActivity) : IInformationReceiver
{
+ private var currentMessage : String = ""
override fun updateMessage(message: String, isBold: Boolean, isColor: Boolean, color: Int)
{
+ currentMessage = message
val messageArea = activity.findViewById<TextView>(ID_AREA_MESSAGE)
activity.runOnUiThread {
messageArea?.text = message
messageArea?.invalidate()
}
}
+
+ override fun appendMessage(message: String, isBold: Boolean, isColor: Boolean, color: Int)
+ {
+ updateMessage(currentMessage + message, isBold, isColor, color)
+ }
+
+ override fun getCurrentMessage(): String
+ {
+ return (currentMessage)
+ }
+
}