From f13ea33a5bdabc9db2078ca1be4c78af1cfc133f Mon Sep 17 00:00:00 2001 From: robert hasson Date: Mon, 30 Mar 2020 23:47:46 +0200 Subject: [PATCH] use of delegates to keep the connection non blocking and alive; bug fix in the resolutions; send of 25C temp; better error handling in the retries to download the image --- LumixCamera.sln | 22 +- LumixCamera/ASCOM.LumixG80.Camera Setup.iss | 3 +- LumixCamera/ASCOM.LumixG80.Camera Setup32.iss | 126 +++++++ LumixCamera/Driver.vb | 308 ++++++++++++------ LumixCamera/LumixCamera.vbproj | 4 +- LumixCamera/My Project/Resources.Designer.vb | 2 +- LumixCamera/My Project/Settings.Designer.vb | 2 +- LumixCamera/SetupDialogForm.Designer.vb | 114 +++---- LumixCamera/SetupDialogForm.resx | 5 +- LumixCamera/SetupDialogForm.vb | 4 +- LumixCamera/app.config | 18 +- LumixDriverTest/Form1.vb | 2 +- LumixDriverTest/LumixDriverTest.vbproj | 20 +- 13 files changed, 443 insertions(+), 187 deletions(-) create mode 100644 LumixCamera/ASCOM.LumixG80.Camera Setup32.iss diff --git a/LumixCamera.sln b/LumixCamera.sln index 29c511f..99ad53b 100644 --- a/LumixCamera.sln +++ b/LumixCamera.sln @@ -1,11 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2036 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29009.5 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "LumixCamera", "LumixCamera\LumixCamera.vbproj", "{71BB4DA7-4092-416D-89FE-97CD15207371}" EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "LumixDriverTest", "LumixDriverTest\LumixDriverTest.vbproj", "{D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}" + ProjectSection(ProjectDependencies) = postProject + {71BB4DA7-4092-416D-89FE-97CD15207371} = {71BB4DA7-4092-416D-89FE-97CD15207371} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2D106DD4-5E01-4FFA-89D6-184B6A89556C}" EndProject @@ -31,14 +34,13 @@ Global {71BB4DA7-4092-416D-89FE-97CD15207371}.Release|x64.Build.0 = Release|x64 {71BB4DA7-4092-416D-89FE-97CD15207371}.Release|x86.ActiveCfg = Release|x86 {71BB4DA7-4092-416D-89FE-97CD15207371}.Release|x86.Build.0 = Release|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|Any CPU.ActiveCfg = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|Any CPU.Build.0 = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x64.ActiveCfg = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x64.Build.0 = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x86.ActiveCfg = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x86.Build.0 = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|Any CPU.ActiveCfg = Debug|x86 - {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|Any CPU.Build.0 = Debug|x86 + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|Any CPU.Build.0 = Release|Any CPU + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x64.ActiveCfg = Release|x86 + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x86.ActiveCfg = Release|x86 + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Debug|x86.Build.0 = Release|x86 + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|Any CPU.Build.0 = Release|Any CPU {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|x64.ActiveCfg = Release|x86 {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|x64.Build.0 = Release|x86 {D1747C8D-F0CC-4B20-A0E4-517EBA497FA4}.Release|x86.ActiveCfg = Release|x86 diff --git a/LumixCamera/ASCOM.LumixG80.Camera Setup.iss b/LumixCamera/ASCOM.LumixG80.Camera Setup.iss index 7406515..fc2c6b8 100644 --- a/LumixCamera/ASCOM.LumixG80.Camera Setup.iss +++ b/LumixCamera/ASCOM.LumixG80.Camera Setup.iss @@ -12,7 +12,8 @@ AppPublisherURL=mailto:robert_hasson@yahoo.com AppSupportURL=http://tech.groups.yahoo.com/group/ASCOM-Talk/ AppUpdatesURL=http://ascom-standards.org/ VersionInfoVersion=1.0.0 -MinVersion=0,5.0.2195sp4 +;MinVersion=0,5.0.2195sp4 +MinVersion=0,6.0 DefaultDirName="{cf}\ASCOM\Camera" DisableDirPage=yes DisableProgramGroupPage=yes diff --git a/LumixCamera/ASCOM.LumixG80.Camera Setup32.iss b/LumixCamera/ASCOM.LumixG80.Camera Setup32.iss new file mode 100644 index 0000000..d746ab9 --- /dev/null +++ b/LumixCamera/ASCOM.LumixG80.Camera Setup32.iss @@ -0,0 +1,126 @@ +; +; Script generated by the ASCOM Driver Installer Script Generator 6.4.0.0 +; Generated by robert hasson on 3/14/2019 (UTC) +; +[Setup] +AppID={{77b4d898-3116-40a5-91d4-4c41ff123d93} +AppName=ASCOM ASCOM.LumixG80.Camera Camera Driver +AppVerName=ASCOM ASCOM.LumixG80.Camera Camera Driver 0.1 +AppVersion=0.1 +AppPublisher=robert hasson +AppPublisherURL=mailto:robert_hasson@yahoo.com +AppSupportURL=http://tech.groups.yahoo.com/group/ASCOM-Talk/ +AppUpdatesURL=http://ascom-standards.org/ +VersionInfoVersion=1.0.0 +MinVersion=0,5.0.2195sp4 +DefaultDirName="{cf}\ASCOM\Camera" +DisableDirPage=yes +DisableProgramGroupPage=yes +;OutputDir="." +OutputBaseFilename="ASCOM.LumixG80.Camera Setup32" +Compression=lzma +SolidCompression=yes +; Put there by Platform if Driver Installer Support selected +WizardImageFile="C:\Program Files (x86)\ASCOM\Platform 6 Developer Components\Installer Generator\Resources\WizardImage.bmp" +LicenseFile="C:\Program Files (x86)\ASCOM\Platform 6 Developer Components\Installer Generator\Resources\CreativeCommons.txt" +; {cf}\ASCOM\Uninstall\Camera folder created by Platform, always +UninstallFilesDir="{cf}\ASCOM\Uninstall\Camera\ASCOM.LumixG80.Camera" +OutputDir=Z:\ + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Dirs] +Name: "{cf}\ASCOM\Uninstall\Camera\ASCOM.LumixG80.Camera" +; TODO: Add subfolders below {app} as needed (e.g. Name: "{app}\MyFolder") +;C:\Users\robert.hasson\source\repos\LumixCamera\LumixCamera\bin\x86\Release +[Files] +Source: "C:\Users\robert.hasson\source\repos\LumixCamera\LumixCamera\bin\x86\Release\ASCOM.LumixG80.Camera.dll"; DestDir: "{app}" +; Require a read-me HTML to appear after installation, maybe driver's Help doc +Source: "C:\Users\robert.hasson\source\repos\LumixCamera\readme.md"; DestDir: "{app}"; Flags: isreadme +; TODO: Add other files needed by your driver here (add subfolders above) +Source: "C:\Users\robert.hasson\source\repos\LumixCamera\readme_files\*"; DestDir: "{app}\readme_files\"; +Source: "C:\Users\robert.hasson\source\repos\LumixCamera\packages\NDCRaw.0.5.2\lib\net461\dcraw.exe"; DestDir: "{app}"; +Source: "C:\Users\robert.hasson\source\repos\LumixCamera\packages\NDCRaw.0.5.2\lib\net461\NDCRaw.dll"; DestDir: "{app}"; +Source: "C:\Users\robert.hasson\source\repos\LumixCamera\packages\MedallionShell.1.5.1\lib\net45\MedallionShell.dll"; DestDir: "{app}"; + + +; Only if driver is .NET +[Run] +; Only for .NET assembly/in-proc drivers +Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.LumixG80.Camera.dll"""; Flags: runhidden 32bit +Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\NDCRaw.dll""";Flags: runhidden 32bit +Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\MedallionShell.dll""";Flags: runhidden 32bit + + +; Only if driver is .NET +[UninstallRun] +; Only for .NET assembly/in-proc drivers +Filename: "{dotnet4032}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.LumixG80.Camera.dll"""; Flags: runhidden 32bit +; This helps to give a clean uninstall + + + + +[Code] +const + REQUIRED_PLATFORM_VERSION = 6.2; // Set this to the minimum required ASCOM Platform version for this application + +// +// Function to return the ASCOM Platform's version number as a double. +// +function PlatformVersion(): Double; +var + PlatVerString : String; +begin + Result := 0.0; // Initialise the return value in case we can't read the registry + try + if RegQueryStringValue(HKEY_LOCAL_MACHINE_32, 'Software\ASCOM','PlatformVersion', PlatVerString) then + begin // Successfully read the value from the registry + Result := StrToFloat(PlatVerString); // Create a double from the X.Y Platform version string + end; + except + ShowExceptionMessage; + Result:= -1.0; // Indicate in the return value that an exception was generated + end; +end; + +// +// Before the installer UI appears, verify that the required ASCOM Platform version is installed. +// +function InitializeSetup(): Boolean; +var + PlatformVersionNumber : double; + begin + Result := FALSE; // Assume failure + PlatformVersionNumber := PlatformVersion(); // Get the installed Platform version as a double + If PlatformVersionNumber >= REQUIRED_PLATFORM_VERSION then // Check whether we have the minimum required Platform or newer + Result := TRUE + else + if PlatformVersionNumber = 0.0 then + MsgBox('No ASCOM Platform is installed. Please install Platform ' + Format('%3.1f', [REQUIRED_PLATFORM_VERSION]) + ' or later from http://www.ascom-standards.org', mbCriticalError, MB_OK) + else + MsgBox('ASCOM Platform ' + Format('%3.1f', [REQUIRED_PLATFORM_VERSION]) + ' or later is required, but Platform '+ Format('%3.1f', [PlatformVersionNumber]) + ' is installed. Please install the latest Platform before continuing; you will find it at http://www.ascom-standards.org', mbCriticalError, MB_OK); +end; + +// Code to enable the installer to uninstall previous versions of itself when a new version is installed +procedure CurStepChanged(CurStep: TSetupStep); +var + ResultCode: Integer; + UninstallExe: String; + UninstallRegistry: String; +begin + if (CurStep = ssInstall) then // Install step has started + begin + // Create the correct registry location name, which is based on the AppId + UninstallRegistry := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}' + '_is1'); + // Check whether an extry exists + if RegQueryStringValue(HKLM, UninstallRegistry, 'UninstallString', UninstallExe) then + begin // Entry exists and previous version is installed so run its uninstaller quietly after informing the user + MsgBox('Setup will now remove the previous version.', mbInformation, MB_OK); + Exec(RemoveQuotes(UninstallExe), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); + sleep(1000); //Give enough time for the install screen to be repainted before continuing + end + end; +end; + diff --git a/LumixCamera/Driver.vb b/LumixCamera/Driver.vb index fbad68e..bc96980 100644 --- a/LumixCamera/Driver.vb +++ b/LumixCamera/Driver.vb @@ -1,6 +1,4 @@ ' -------------------------------------------------------------------------------- -' TODO fill in this information for your driver, then remove this line! - ' ASCOM Camera driver for LumixG80 'This driver provides an interface to the Lumix http over wifi remote control protocol @@ -121,6 +119,8 @@ Public Class Camera 'list of html commads to talk to the lumix camera 'Cam Info + Public Shared DEVICE As String = "cam.cgi??mode=setsetting&type=device_name&value=SM-G9350" + Public Shared SECURITY As String = "cam.cgi?mode=accctrl&type=req_acc&value=4D454930-0100-1000-8001-024500021C98&value2=SM-G903F" Public Shared STATE As String = "cam.cgi?mode=getstate" Public Shared CAPABILITY As String = "cam.cgi?mode=getinfo&type=capability" Public Shared ALLMENU As String = "cam.cgi?mode=getinfo&type=allmenu" @@ -155,6 +155,8 @@ Public Class Camera 'Cam Commands Public Shared NUMPIX As String = "cam.cgi?mode=get_content_info" + Public Shared GETSTATE As String = "cam.cgi?mode=getstate" + Private RECMODE As String = "cam.cgi?mode=camcmd&value=recmode" Public Shared PLAYMODE As String = "cam.cgi?mode=camcmd&value=playmode" Private SHUTTERSTART As String = "cam.cgi?mode=camcmd&value=capture" @@ -191,63 +193,125 @@ Public Class Camera Public Shared ISOTable = {"auto", "i_iso", "80", "100", "125", "160", "200", "250", "320", "400", "500", "640", "800", "1000", "1250", "1600", "2000", "2500", "3200", "4000", "5000", "6400", "8000", "10000", "12800", "16000", "20000", "25600"} Public Shared ShutterTable = - {{"3072/256", 4000}, - {"2987/256", 3200}, - {"2902/256", 2500}, - {"2816/256", 2000}, - {"2731/256", 1600}, - {"2646/256", 1300}, - {"2560/256", 1000}, - {"2475/256", 800}, - {"2390/256", 640}, - {"2304/256", 500}, - {"2219/256", 400}, - {"2134/256", 320}, - {"2048/256", 250}, - {"1963/256", 200}, - {"1878/256", 160}, - {"1792/256", 125}, - {"1707/256", 100}, - {"1622/256", 80}, - {"1536/256", 60}, - {"1451/256", 50}, - {"1366/256", 40}, - {"1280/256", 30}, - {"1195/256", 25}, - {"1110/256", 20}, - {"1024/256", 15}, - {"939/256", 13}, - {"854/256", 10}, - {"768/256", 8}, - {"683/256", 6}, - {"598/256", 5}, - {"512/256", 4}, - {"427/256", 3.2}, - {"342/256", 2.5}, - {"256/256", 2}, - {"171/256", 1.6}, - {"86/256", 1.3}, - {"0/256", 1}, - {"-85/256", "1.3s"}, - {"-170/256", "1.6s"}, - {"-256/256", "2s"}, - {"-341/256", "2.5s"}, - {"-426/256", "3.2s"}, - {"-512/256", "4s"}, - {"-512/256", "5s"}, - {"-682/256", "6s"}, - {"-768/256", "8s"}, - {"-853/256", "10s"}, - {"-938/256", "13s"}, - {"-1024/256", "15s"}, - {"-1109/256", "20s"}, - {"-1194/256", "25s"}, - {"-1280/256", "30s"}, - {"-1365/256", "40s"}, - {"-1450/256", "50s"}, - {"-1536/256", "60s"}, - {"16384/256", "B"} -} + {{"3328/256", "8000"}, + {"3243/256", "6400"}, + {"3158/256", "5000"}, + {"3072/256", "4000"}, + {"2987/256", "3200"}, + {"2902/256", "2500"}, + {"2816/256", "2000"}, + {"2731/256", "1600"}, + {"2646/256", "1300"}, + {"2560/256", "1000"}, + {"2475/256", "800"}, + {"2390/256", "640"}, + {"2304/256", "500"}, + {"2219/256", "400"}, + {"2134/256", "320"}, + {"2048/256", "250"}, + {"1963/256", "200"}, + {"1878/256", "160"}, + {"1792/256", "125"}, + {"1707/256", "100"}, + {"1622/256", "80"}, + {"1536/256", "60"}, + {"1451/256", "50"}, + {"1366/256", "40"}, + {"1280/256", "30"}, + {"1195/256", "25"}, + {"1110/256", "20"}, + {"1024/256", "15"}, + {"939/256", "13"}, + {"854/256", "10"}, + {"768/256", "8"}, + {"683/256", "6"}, + {"598/256", "5"}, + {"512/256", "4"}, + {"427/256", "3.2"}, + {"342/256", "2.5"}, + {"256/256", "2"}, + {"171/256", "1.6"}, + {"86/256", "1.3"}, + {"0/256", "1"}, + {"-85/256", "1.3s"}, + {"-170/256", "1.6s"}, + {"-256/256", "2s"}, + {"-341/256", "2.5s"}, + {"-426/256", "3.2s"}, + {"-512/256", "4s"}, + {"-512/256", "5s"}, + {"-682/256", "6s"}, + {"-768/256", "8s"}, + {"-853/256", "10s"}, + {"-938/256", "13s"}, + {"-1024/256", "15s"}, + {"-1109/256", "20s"}, + {"-1194/256", "25s"}, + {"-1280/256", "30s"}, + {"-1365/256", "40s"}, + {"-1450/256", "50s"}, + {"-1536/256", "60s"}, + {"16384/256", "B"} + } + + + ' {{"3072/256", 4000}, + ' {"2987/256", 3200}, + ' {"2902/256", 2500}, + ' {"2816/256", 2000}, + ' {"2731/256", 1600}, + ' {"2646/256", 1300}, + ' {"2560/256", 1000}, + ' {"2475/256", 800}, + ' {"2390/256", 640}, + ' {"2304/256", 500}, + ' {"2219/256", 400}, + ' {"2134/256", 320}, + ' {"2048/256", 250}, + ' {"1963/256", 200}, + ' {"1878/256", 160}, + ' {"1792/256", 125}, + ' {"1707/256", 100}, + ' {"1622/256", 80}, + ' {"1536/256", 60}, + ' {"1451/256", 50}, + ' {"1366/256", 40}, + ' {"1280/256", 30}, + ' {"1195/256", 25}, + ' {"1110/256", 20}, + ' {"1024/256", 15}, + ' {"939/256", 13}, + ' {"854/256", 10}, + ' {"768/256", 8}, + ' {"683/256", 6}, + ' {"598/256", 5}, + ' {"512/256", 4}, + ' {"427/256", 3.2}, + ' {"342/256", 2.5}, + ' {"256/256", 2}, + ' {"171/256", 1.6}, + ' {"86/256", 1.3}, + ' {"0/256", 1}, + ' {"-85/256", "1.3s"}, + ' {"-170/256", "1.6s"}, + ' {"-256/256", "2s"}, + ' {"-341/256", "2.5s"}, + ' {"-426/256", "3.2s"}, + ' {"-512/256", "4s"}, + ' {"-512/256", "5s"}, + ' {"-682/256", "6s"}, + ' {"-768/256", "8s"}, + ' {"-853/256", "10s"}, + ' {"-938/256", "13s"}, + ' {"-1024/256", "15s"}, + ' {"-1109/256", "20s"}, + ' {"-1194/256", "25s"}, + ' {"-1280/256", "30s"}, + ' {"-1365/256", "40s"}, + ' {"-1450/256", "50s"}, + ' {"-1536/256", "60s"}, + ' {"16384/256", "B"} + '} Public Shared ResolutionTable = {"10.2", "12.1", "16.0", "16.05", "20.0", "20.3", "24.2", "47.3"} @@ -363,9 +427,9 @@ Public Class Camera Resolutions(6)._X = 6000 Resolutions(6)._Y = 4000 - Resolutions(6)._resolution = "47.3" - Resolutions(6)._X = 8368 - Resolutions(6)._Y = 5584 + Resolutions(7)._resolution = "47.3" + Resolutions(7)._X = 8368 + Resolutions(7)._Y = 5584 ResolutionsJPG(0)._resolution = "12.1" @@ -397,14 +461,9 @@ Public Class Camera ResolutionsJPG(6)._X = 6000 ResolutionsJPG(6)._Y = 4000 - ResolutionsJPG(6)._resolution = "47.3" - ResolutionsJPG(6)._X = 8368 - ResolutionsJPG(6)._Y = 5584 - - - - - + ResolutionsJPG(7)._resolution = "47.3" + ResolutionsJPG(7)._X = 8368 + ResolutionsJPG(7)._Y = 5584 ResolutionsThumb(0)._resolution = "12.1" @@ -435,9 +494,9 @@ Public Class Camera ResolutionsThumb(6)._X = 1440 ResolutionsThumb(6)._Y = 1080 - ResolutionsThumb(6)._resolution = "47.3" - ResolutionsThumb(6)._X = 1440 - ResolutionsThumb(6)._Y = 1080 + ResolutionsThumb(7)._resolution = "47.3" + ResolutionsThumb(7)._X = 1440 + ResolutionsThumb(7)._Y = 1080 'TODO: Implement your additional construction here TL.LogMessage("Camera", "Completed initialisation") @@ -517,6 +576,8 @@ Public Class Camera End Get Set(value As Boolean) TL.LogMessage("Connected Set", value.ToString()) + Dim d As MyDelegate2 = AddressOf Polling + If value Then connectedState = True TL.LogMessage("Connected Set", "Connecting to IP Address " + IPAddress) @@ -529,6 +590,10 @@ Public Class Camera Gain = Math.Max(0, ISOTableAL.IndexOf(My.Settings.ISO)) SendLumixMessage(SHUTTERSPEED + CurrentSpeed) + '' SendLumixMessage(Camera.SECURITY) + ' SendLumixMessage(Camera.DEVICE) + + If Camera.MODEL.Contains("S1") Then 'full frame bodies. sensormmx = 36 sensormmy = 24 @@ -554,7 +619,7 @@ Public Class Camera cameraNumX = ccdWidth cameraNumY = ccdHeight - + d.BeginInvoke(True, Nothing, Nothing) @@ -562,10 +627,38 @@ Public Class Camera connectedState = False TL.LogMessage("Connected Set", "Disconnecting from IP Address " + IPAddress) ' TODO disconnect from the device + 'd.EndInvoke(Nothing) + d.Invoke(False) End If End Set End Property + + + Private Delegate Function MyDelegate2(ByVal Bool As Boolean) As Boolean + + Function Polling(Bool As Boolean) As Boolean + + While Bool + System.Threading.Thread.Sleep(10000) ' Sleep for 10 sec + SendLumixMessage(STATE) + ' System.Threading.Thread.Sleep(1000) ' Sleep for 1s after the capture so the camera can breath a bit. + End While + Return True + End Function + + + + + + + + + + + + + Public ReadOnly Property Description As String Implements ICameraV2.Description Get ' this pattern seems to be needed to allow a public property to return a private field @@ -579,7 +672,7 @@ Public Class Camera Get Dim m_version As Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version ' TODO customise this driver description - Dim s_driverInfo As String = "Information about the driver itself. Version: " + m_version.Major.ToString() + "." + m_version.Minor.ToString() + Dim s_driverInfo As String = "Lumix Wifi Ascom driver. Version: " + m_version.Major.ToString() + "." + m_version.Minor.ToString() TL.LogMessage("DriverInfo Get", s_driverInfo) Return s_driverInfo End Get @@ -707,8 +800,9 @@ Public Class Camera Public ReadOnly Property CCDTemperature() As Double Implements ICameraV2.CCDTemperature Get - TL.LogMessage("CCDTemperature Get", "Not implemented") - Throw New ASCOM.PropertyNotImplementedException("CCDTemperature", False) + 'TL.LogMessage("CCDTemperature Get", "Not implemented") + 'Throw New ASCOM.PropertyNotImplementedException("CCDTemperature", False) + Return 25 End Get End Property @@ -1314,6 +1408,11 @@ Public Class Camera Pictures = New XmlDocument Dim PictureString As String Dim LookupImgtag As String = "" + Dim tries As Int16 = 5 + Dim temp As String = "" + + + Select Case ReadoutMode Case 0 'jpg @@ -1324,6 +1423,13 @@ Public Class Camera LookupImgtag = "CAM_LRGTN" End Select Try + Do + temp = SendLumixMessage(PLAYMODE) 'making sure the camera is in Playmode + If temp.Contains("err") Then + Thread.Sleep(1000) + End If + tries -= 1 + Loop While (tries > 0 And temp.Contains("err")) PictureString = GetPix(1) If PictureString IsNot "" Then @@ -1346,8 +1452,6 @@ Public Class Camera End If Next - 'Images = (From it In items. Where it.@protocolInfo.EndsWith(LookupImgtag)).Value - If Images = "" Then Throw New ASCOM.DriverException @@ -1362,6 +1466,9 @@ Public Class Camera Dim theResponse As HttpWebResponse Dim theRequest As HttpWebRequest Dim bytesread As Integer = 0 + Dim start_time As DateTime = Now + Dim stop_time As DateTime + Dim elapsed_time As TimeSpan Do theRequest = HttpWebRequest.Create(Images) TL.LogMessage("reading stream ", Images & " position " & nRead) @@ -1404,10 +1511,21 @@ Public Class Camera End If writeStream.Write(readBytes, 0, bytesread) writeStream.Flush() + stop_time = Now + elapsed_time = stop_time.Subtract(start_time) + If elapsed_time.TotalSeconds > 30 Then + Throw New ASCOM.DriverException + End If + Loop theResponse.GetResponseStream.Close() writeStream.Flush() writeStream.Close() + stop_time = Now + elapsed_time = stop_time.Subtract(start_time) + If elapsed_time.TotalSeconds > 30 Then + Throw New ASCOM.DriverException + End If Catch e As System.IO.IOException TL.LogMessage("camera stopped streaming ", Images & " position " & nRead) @@ -1416,7 +1534,11 @@ Public Class Camera writeStream.Flush() writeStream.Close() End Try - + stop_time = Now + elapsed_time = stop_time.Subtract(start_time) + If elapsed_time.TotalSeconds > 30 Then + Throw New ASCOM.DriverException + End If Loop While bytesread > 0 If ReadoutMode = 1 Then 'RAW . needs dcraw conversion @@ -1430,23 +1552,23 @@ Public Class Camera End Try Else 'JPG image. VB can translate into TIFF natively Try - Dim myEncoder As System.Drawing.Imaging.Encoder - Dim myImageCodecInfo As ImageCodecInfo - Dim myEncoderParameter As EncoderParameter - Dim myEncoderParameters As EncoderParameters + 'Dim myEncoder As System.Drawing.Imaging.Encoder + 'Dim myImageCodecInfo As ImageCodecInfo + 'Dim myEncoderParameter As EncoderParameter + 'Dim myEncoderParameters As EncoderParameters Dim imagepath = TempPath & Images.Substring(Images.Length - 13) Dim jpg = Image.FromFile(imagepath) - myImageCodecInfo = GetEncoderInfo("image/tiff") + 'myImageCodecInfo = GetEncoderInfo("image/tiff") TiffFileName = imagepath.Substring(0, imagepath.Length() - 3) + "tif" - myEncoder = System.Drawing.Imaging.Encoder.ColorDepth - myEncoderParameters = New EncoderParameters(1) + 'myEncoder = System.Drawing.Imaging.Encoder.ColorDepth + 'myEncoderParameters = New EncoderParameters(1) ' Save the image with a color depth of 24 bits per pixel. - myEncoderParameter = New EncoderParameter(myEncoder, CType(24L, Int32)) - myEncoderParameters.Param(0) = myEncoderParameter + 'myEncoderParameter = New EncoderParameter(myEncoder, CType(24L, Int32)) - jpg.Save(TiffFileName, myImageCodecInfo, myEncoderParameters) + 'jpg.Save(TiffFileName, myImageCodecInfo, myEncoderParameters) + jpg.Save(TiffFileName, System.Drawing.Imaging.ImageFormat.Tiff) jpg.Dispose() 'cleaning up aftermyself and removing the jpg file once it is used and transformed into a tiff My.Computer.FileSystem.DeleteFile(imagepath) @@ -1457,15 +1579,15 @@ Public Class Camera Catch ex As Exception TL.LogMessage("error in reading image", "error in reading image") - cameraImageReady = False - TL.LogMessage("ïmageready", "true") + cameraImageReady = True + TL.LogMessage("Imageready", "True") CurrentState = CameraStates.cameraIdle Exit Sub End Try CurrentState = CameraStates.cameraIdle cameraImageReady = True - TL.LogMessage("ïmageready", "true") + TL.LogMessage("Imageready", "true") End Sub diff --git a/LumixCamera/LumixCamera.vbproj b/LumixCamera/LumixCamera.vbproj index ef3a0f5..dea5e57 100644 --- a/LumixCamera/LumixCamera.vbproj +++ b/LumixCamera/LumixCamera.vbproj @@ -17,7 +17,7 @@ 3.5 false ASCOMDriverTemplate.snk - v4.6.1 + v4.7.2 publish\ true Disk @@ -68,7 +68,7 @@ On - Binary + Text Off diff --git a/LumixCamera/My Project/Resources.Designer.vb b/LumixCamera/My Project/Resources.Designer.vb index 5e7b7a7..8145eba 100644 --- a/LumixCamera/My Project/Resources.Designer.vb +++ b/LumixCamera/My Project/Resources.Designer.vb @@ -22,7 +22,7 @@ Namespace My.Resources ''' ''' A strongly-typed resource class, for looking up localized strings, etc. ''' - _ diff --git a/LumixCamera/My Project/Settings.Designer.vb b/LumixCamera/My Project/Settings.Designer.vb index 821d47e..59fff23 100644 --- a/LumixCamera/My Project/Settings.Designer.vb +++ b/LumixCamera/My Project/Settings.Designer.vb @@ -15,7 +15,7 @@ Option Explicit On Namespace My _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase diff --git a/LumixCamera/SetupDialogForm.Designer.vb b/LumixCamera/SetupDialogForm.Designer.vb index aae0ea8..8d67a1d 100644 --- a/LumixCamera/SetupDialogForm.Designer.vb +++ b/LumixCamera/SetupDialogForm.Designer.vb @@ -56,27 +56,24 @@ Partial Class SetupDialogForm ' 'TableLayoutPanel1 ' - Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TableLayoutPanel1.ColumnCount = 2 Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) - Me.TableLayoutPanel1.Location = New System.Drawing.Point(219, 470) - Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(4) + Me.TableLayoutPanel1.Location = New System.Drawing.Point(133, 393) Me.TableLayoutPanel1.Name = "TableLayoutPanel1" Me.TableLayoutPanel1.RowCount = 1 Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.Size = New System.Drawing.Size(195, 36) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(171, 29) Me.TableLayoutPanel1.TabIndex = 0 ' 'OK_Button ' Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None - Me.OK_Button.Location = New System.Drawing.Point(4, 4) - Me.OK_Button.Margin = New System.Windows.Forms.Padding(4) + Me.OK_Button.Location = New System.Drawing.Point(3, 3) Me.OK_Button.Name = "OK_Button" - Me.OK_Button.Size = New System.Drawing.Size(89, 28) + Me.OK_Button.Size = New System.Drawing.Size(79, 23) Me.OK_Button.TabIndex = 0 Me.OK_Button.Text = "OK" ' @@ -84,10 +81,9 @@ Partial Class SetupDialogForm ' Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.Cancel_Button.Location = New System.Drawing.Point(101, 4) - Me.Cancel_Button.Margin = New System.Windows.Forms.Padding(4) + Me.Cancel_Button.Location = New System.Drawing.Point(94, 3) Me.Cancel_Button.Name = "Cancel_Button" - Me.Cancel_Button.Size = New System.Drawing.Size(89, 28) + Me.Cancel_Button.Size = New System.Drawing.Size(67, 23) Me.Cancel_Button.TabIndex = 1 Me.Cancel_Button.Text = "Cancel" ' @@ -96,8 +92,7 @@ Partial Class SetupDialogForm Me.PictureBox1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.PictureBox1.Cursor = System.Windows.Forms.Cursors.Hand Me.PictureBox1.Image = Global.ASCOM.LumixG80.My.Resources.Resources.ASCOM - Me.PictureBox1.Location = New System.Drawing.Point(341, 393) - Me.PictureBox1.Margin = New System.Windows.Forms.Padding(4) + Me.PictureBox1.Location = New System.Drawing.Point(256, 319) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(48, 56) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize @@ -107,19 +102,19 @@ Partial Class SetupDialogForm 'Label3 ' Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 76) - Me.Label3.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label3.Location = New System.Drawing.Point(7, 62) Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(143, 17) + Me.Label3.Size = New System.Drawing.Size(108, 13) Me.Label3.TabIndex = 0 Me.Label3.Text = "IP Address of camera" ' 'Label4 ' Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 18) + Me.Label4.Location = New System.Drawing.Point(9, 15) + Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(333, 34) + Me.Label4.Size = New System.Drawing.Size(254, 26) Me.Label4.TabIndex = 0 Me.Label4.Text = "Set the Camera to Manual" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Connect to the WIFI network in remote control mode" ' @@ -128,9 +123,10 @@ Partial Class SetupDialogForm Me.ButtonTemp.AccessibleDescription = "this is where the files from the camera are stored (JPGor RAW) while trnasorming " & "to tiff and then passed on to the calling program as an imagearray. the files ar" & "e automatically deleted after each step" - Me.ButtonTemp.Location = New System.Drawing.Point(12, 334) + Me.ButtonTemp.Location = New System.Drawing.Point(9, 271) + Me.ButtonTemp.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.ButtonTemp.Name = "ButtonTemp" - Me.ButtonTemp.Size = New System.Drawing.Size(146, 23) + Me.ButtonTemp.Size = New System.Drawing.Size(110, 19) Me.ButtonTemp.TabIndex = 6 Me.ButtonTemp.Text = "Path to temp folder" Me.ToolTip1.SetToolTip(Me.ButtonTemp, "this is where the files from the camera are stored (JPGor RAW) while trnasorming " & @@ -142,9 +138,10 @@ Partial Class SetupDialogForm ' Me.ButtonRaw.AccessibleDescription = "point to a valid DCRaw.exe. try http://www.centrostudiprogressofotografico.it/e" & "n/dcraw/" - Me.ButtonRaw.Location = New System.Drawing.Point(13, 398) + Me.ButtonRaw.Location = New System.Drawing.Point(10, 323) + Me.ButtonRaw.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.ButtonRaw.Name = "ButtonRaw" - Me.ButtonRaw.Size = New System.Drawing.Size(146, 23) + Me.ButtonRaw.Size = New System.Drawing.Size(110, 19) Me.ButtonRaw.TabIndex = 8 Me.ButtonRaw.Text = "Path to DCRaw.exe" Me.ToolTip1.SetToolTip(Me.ButtonRaw, "point to a valid DCRaw.exe. try http://www.centrostudiprogressofotografico.it/e" & @@ -158,30 +155,27 @@ Partial Class SetupDialogForm 'Label1 ' Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 205) - Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label1.Location = New System.Drawing.Point(8, 166) Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(31, 17) + Me.Label1.Size = New System.Drawing.Size(25, 13) Me.Label1.TabIndex = 0 Me.Label1.Text = "ISO" ' 'Label2 ' Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 248) - Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label2.Location = New System.Drawing.Point(9, 201) Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(99, 17) + Me.Label2.Size = New System.Drawing.Size(75, 13) Me.Label2.TabIndex = 0 Me.Label2.Text = "Shutter Speed" ' 'Label5 ' Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 291) - Me.Label5.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label5.Location = New System.Drawing.Point(9, 237) Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(106, 17) + Me.Label5.Size = New System.Drawing.Size(78, 13) Me.Label5.TabIndex = 0 Me.Label5.Text = "TransferFormat" ' @@ -194,10 +188,9 @@ Partial Class SetupDialogForm 'Label6 ' Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(9, 162) - Me.Label6.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label6.Location = New System.Drawing.Point(7, 132) Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(75, 17) + Me.Label6.Size = New System.Drawing.Size(57, 13) Me.Label6.TabIndex = 0 Me.Label6.Text = "Resolution" ' @@ -209,27 +202,30 @@ Partial Class SetupDialogForm Me.CBResolution.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.CBResolution.FormattingEnabled = True Me.CBResolution.ImeMode = System.Windows.Forms.ImeMode.Disable - Me.CBResolution.Location = New System.Drawing.Point(162, 155) + Me.CBResolution.Location = New System.Drawing.Point(122, 126) + Me.CBResolution.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.CBResolution.Name = "CBResolution" - Me.CBResolution.Size = New System.Drawing.Size(121, 24) + Me.CBResolution.Size = New System.Drawing.Size(92, 21) Me.CBResolution.TabIndex = 2 Me.CBResolution.Text = Global.ASCOM.LumixG80.My.MySettings.Default.Resolution ' 'TBTempPath ' Me.TBTempPath.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.ASCOM.LumixG80.My.MySettings.Default, "TempPath", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) - Me.TBTempPath.Location = New System.Drawing.Point(12, 363) + Me.TBTempPath.Location = New System.Drawing.Point(9, 295) + Me.TBTempPath.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.TBTempPath.Name = "TBTempPath" - Me.TBTempPath.Size = New System.Drawing.Size(267, 22) + Me.TBTempPath.Size = New System.Drawing.Size(201, 20) Me.TBTempPath.TabIndex = 7 Me.TBTempPath.Text = Global.ASCOM.LumixG80.My.MySettings.Default.TempPath ' 'TBDCRawPath ' Me.TBDCRawPath.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.ASCOM.LumixG80.My.MySettings.Default, "DCRawPath", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) - Me.TBDCRawPath.Location = New System.Drawing.Point(12, 427) + Me.TBDCRawPath.Location = New System.Drawing.Point(9, 347) + Me.TBDCRawPath.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.TBDCRawPath.Name = "TBDCRawPath" - Me.TBDCRawPath.Size = New System.Drawing.Size(267, 22) + Me.TBDCRawPath.Size = New System.Drawing.Size(201, 20) Me.TBDCRawPath.TabIndex = 9 Me.TBDCRawPath.Text = Global.ASCOM.LumixG80.My.MySettings.Default.DCRawPath ' @@ -239,9 +235,10 @@ Partial Class SetupDialogForm Me.CBReadoutMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.CBReadoutMode.FormattingEnabled = True Me.CBReadoutMode.Items.AddRange(New Object() {"JPG", "RAW", "Thumb"}) - Me.CBReadoutMode.Location = New System.Drawing.Point(162, 287) + Me.CBReadoutMode.Location = New System.Drawing.Point(122, 233) + Me.CBReadoutMode.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.CBReadoutMode.Name = "CBReadoutMode" - Me.CBReadoutMode.Size = New System.Drawing.Size(121, 24) + Me.CBReadoutMode.Size = New System.Drawing.Size(92, 21) Me.CBReadoutMode.TabIndex = 5 Me.CBReadoutMode.Text = Global.ASCOM.LumixG80.My.MySettings.Default.TransferFormat ' @@ -250,9 +247,10 @@ Partial Class SetupDialogForm Me.CBShutterSpeed.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.ASCOM.LumixG80.My.MySettings.Default, "Speed", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) Me.CBShutterSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.CBShutterSpeed.FormattingEnabled = True - Me.CBShutterSpeed.Location = New System.Drawing.Point(162, 243) + Me.CBShutterSpeed.Location = New System.Drawing.Point(122, 198) + Me.CBShutterSpeed.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.CBShutterSpeed.Name = "CBShutterSpeed" - Me.CBShutterSpeed.Size = New System.Drawing.Size(121, 24) + Me.CBShutterSpeed.Size = New System.Drawing.Size(92, 21) Me.CBShutterSpeed.TabIndex = 4 Me.CBShutterSpeed.Text = Global.ASCOM.LumixG80.My.MySettings.Default.Speed ' @@ -261,9 +259,10 @@ Partial Class SetupDialogForm Me.CBISO.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.ASCOM.LumixG80.My.MySettings.Default, "ISO", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) Me.CBISO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.CBISO.FormattingEnabled = True - Me.CBISO.Location = New System.Drawing.Point(162, 199) + Me.CBISO.Location = New System.Drawing.Point(122, 162) + Me.CBISO.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.CBISO.Name = "CBISO" - Me.CBISO.Size = New System.Drawing.Size(121, 24) + Me.CBISO.Size = New System.Drawing.Size(92, 21) Me.CBISO.TabIndex = 3 Me.CBISO.Text = Global.ASCOM.LumixG80.My.MySettings.Default.ISO ' @@ -271,9 +270,10 @@ Partial Class SetupDialogForm ' Me.CBCameraIPAddress.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.ASCOM.LumixG80.My.MySettings.Default, "IPAddress", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) Me.CBCameraIPAddress.FormattingEnabled = True - Me.CBCameraIPAddress.Location = New System.Drawing.Point(161, 74) + Me.CBCameraIPAddress.Location = New System.Drawing.Point(121, 60) + Me.CBCameraIPAddress.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.CBCameraIPAddress.Name = "CBCameraIPAddress" - Me.CBCameraIPAddress.Size = New System.Drawing.Size(121, 24) + Me.CBCameraIPAddress.Size = New System.Drawing.Size(92, 21) Me.CBCameraIPAddress.TabIndex = 1 Me.CBCameraIPAddress.Text = Global.ASCOM.LumixG80.My.MySettings.Default.IPAddress ' @@ -283,10 +283,9 @@ Partial Class SetupDialogForm Me.chkTrace.Checked = Global.ASCOM.LumixG80.My.MySettings.Default.TraceEnabled Me.chkTrace.CheckState = System.Windows.Forms.CheckState.Checked Me.chkTrace.DataBindings.Add(New System.Windows.Forms.Binding("Checked", Global.ASCOM.LumixG80.My.MySettings.Default, "TraceEnabled", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) - Me.chkTrace.Location = New System.Drawing.Point(12, 472) - Me.chkTrace.Margin = New System.Windows.Forms.Padding(4) + Me.chkTrace.Location = New System.Drawing.Point(9, 383) Me.chkTrace.Name = "chkTrace" - Me.chkTrace.Size = New System.Drawing.Size(87, 21) + Me.chkTrace.Size = New System.Drawing.Size(69, 17) Me.chkTrace.TabIndex = 10 Me.chkTrace.Text = "Trace on" Me.chkTrace.UseVisualStyleBackColor = True @@ -294,27 +293,29 @@ Partial Class SetupDialogForm 'Label7 ' Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(9, 119) + Me.Label7.Location = New System.Drawing.Point(7, 97) + Me.Label7.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(99, 17) + Me.Label7.Size = New System.Drawing.Size(75, 13) Me.Label7.TabIndex = 11 Me.Label7.Text = "Camera Model" ' 'Label8 ' Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(159, 118) + Me.Label8.Location = New System.Drawing.Point(119, 96) + Me.Label8.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(0, 17) + Me.Label8.Size = New System.Drawing.Size(0, 13) Me.Label8.TabIndex = 11 ' 'SetupDialogForm ' Me.AcceptButton = Me.OK_Button - Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.Cancel_Button - Me.ClientSize = New System.Drawing.Size(427, 519) + Me.ClientSize = New System.Drawing.Size(320, 438) Me.Controls.Add(Me.Label8) Me.Controls.Add(Me.Label7) Me.Controls.Add(Me.CBResolution) @@ -336,7 +337,6 @@ Partial Class SetupDialogForm Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.TableLayoutPanel1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog - Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "SetupDialogForm" diff --git a/LumixCamera/SetupDialogForm.resx b/LumixCamera/SetupDialogForm.resx index 2951d72..298ffa2 100644 --- a/LumixCamera/SetupDialogForm.resx +++ b/LumixCamera/SetupDialogForm.resx @@ -120,6 +120,9 @@ 393, 17 + + 393, 17 + 17, 17 @@ -127,6 +130,6 @@ 509, 17 - 57 + 25 \ No newline at end of file diff --git a/LumixCamera/SetupDialogForm.vb b/LumixCamera/SetupDialogForm.vb index d865f0a..82e3028 100644 --- a/LumixCamera/SetupDialogForm.vb +++ b/LumixCamera/SetupDialogForm.vb @@ -11,6 +11,8 @@ Public Class SetupDialogForm Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click ' OK button event handler If Camera.IPAddress IsNot Camera.IPAddressDefault Then + ' Camera.SendLumixMessage(Camera.SECURITY) + ' Camera.SendLumixMessage(Camera.DEVICE) Camera.SendLumixMessage(Camera.ISO + CBISO.SelectedItem) Camera.SendLumixMessage(Camera.SHUTTERSPEED + Camera.ShutterTable(CBShutterSpeed.SelectedIndex, 0)) Camera.SendLumixMessage(Camera.QUALITY + "raw_fine") 'that way we get all the format all the time. drawback is that the SD cards has now both RAW+JPG @@ -52,7 +54,7 @@ Public Class SetupDialogForm ' Add any initialization after the InitializeComponent() call. CBResolution.DataSource = New BindingSource(Camera.ResolutionTable, Nothing) CBISO.DataSource = New BindingSource(Camera.ISOTable, Nothing) - For i = 0 To 55 + For i = 0 To 58 CBShutterSpeed.Items.Add(Camera.ShutterTable(i, 1)) Next End Sub diff --git a/LumixCamera/app.config b/LumixCamera/app.config index 777bb1b..4e21ee8 100644 --- a/LumixCamera/app.config +++ b/LumixCamera/app.config @@ -1,8 +1,8 @@ - -
+ +
@@ -25,31 +25,31 @@ - + - + - + - + - + True - + dcraw.exe - + diff --git a/LumixDriverTest/Form1.vb b/LumixDriverTest/Form1.vb index 842d5aa..39bdff9 100644 --- a/LumixDriverTest/Form1.vb +++ b/LumixDriverTest/Form1.vb @@ -82,7 +82,7 @@ Private Sub Button1_Click(sender As Object, e As EventArgs) Handles GetImageArray.Click If Me.driver.ImageReady() Then - Dim currentimagearray(driver.CameraXSize, driver.CameraYSize) As Integer + Dim currentimagearray(Me.driver.CameraXSize, Me.driver.CameraYSize) As Integer currentimagearray = Me.driver.ImageArray() End If End Sub diff --git a/LumixDriverTest/LumixDriverTest.vbproj b/LumixDriverTest/LumixDriverTest.vbproj index a290f93..44a968b 100644 --- a/LumixDriverTest/LumixDriverTest.vbproj +++ b/LumixDriverTest/LumixDriverTest.vbproj @@ -16,16 +16,6 @@ v4.0 - - x86 - true - full - true - true - bin\Debug\ - ASCOM.LumixG80.Test.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - x86 pdbonly @@ -51,6 +41,16 @@ My Project\app.manifest + + true + bin\Release\ + ASCOM.LumixG80.Test.xml + true + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + pdbonly + AnyCPU + MinimumRecommendedRules.ruleset +