Skip to content

Commit

Permalink
use of delegates to keep the connection non blocking and alive; bug f…
Browse files Browse the repository at this point in the history
…ix in the resolutions; send of 25C temp; better error handling in the retries to download the image
  • Loading branch information
totoantibes committed Mar 30, 2020
1 parent 36f34cf commit f13ea33
Show file tree
Hide file tree
Showing 13 changed files with 443 additions and 187 deletions.
22 changes: 12 additions & 10 deletions LumixCamera.sln
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion LumixCamera/ASCOM.LumixG80.Camera Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ AppPublisherURL=mailto:[email protected]
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
Expand Down
126 changes: 126 additions & 0 deletions LumixCamera/ASCOM.LumixG80.Camera Setup32.iss
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
AppPublisherURL=mailto:[email protected]
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;
Loading

0 comments on commit f13ea33

Please sign in to comment.