From 5e9305aa495e29df1b275843c2c248dea7707b92 Mon Sep 17 00:00:00 2001 From: Serge Date: Fri, 23 Nov 2018 00:18:30 +1030 Subject: [PATCH] v1.3.3 fixed multiple camera support and improved the multiple camera example --- CameraController.m | 6 ++++-- CameraController_Examples.m | 23 ++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CameraController.m b/CameraController.m index 46a4836..0070af8 100644 --- a/CameraController.m +++ b/CameraController.m @@ -1,4 +1,4 @@ -%Controller (v1.3.2) for tethered DSLR cameras using digiCamControl app. +%Controller (v1.3.3) for tethered DSLR cameras using digiCamControl app. % C = CameraController -create class % C = CameraController(dcc) -digiCamControl location % C = CameraController(dcc,debug) -set debug level @@ -107,6 +107,8 @@ %-Still needs a lot more testing, especially on Linux. %Change Log: +%v1.3.3 (2018-11-23) +%-fixed multiple camera support and improved the multiple camera example %v1.3.2 (2018-08-05) %-webserver IP can include a port number (default: 'localhost:5513') %-capture "lag" now a property rather then input to Capture method @@ -341,7 +343,7 @@ % [SN,err] = Cameras(..) -catch error messeges %Use property.serialnumber to get current camera's serial [serials,err] = C.List('cameras'); %all cameras serial numbers - if isempty(serials) || strcmpi(serials,'OK') + if isempty(serials) || isequal(serials,'OK') err = 'No camera detected'; out = ''; elseif nargin>1 %select a specific camera diff --git a/CameraController_Examples.m b/CameraController_Examples.m index 8728652..c915e78 100644 --- a/CameraController_Examples.m +++ b/CameraController_Examples.m @@ -1,4 +1,4 @@ - %% Example: download settings +%% Example: download settings % best to set "Transfer" mode in bottom left of GUI to Camera and Computer C = CameraController; C.session.folder = 'C:\DSLR'; @@ -7,7 +7,7 @@ C.session.downloadthumbonly = 0; %not working (v2.0.72.9) C.session.downloadonlyjpg = 0; %only used if "PC+CAM" C.session.deletefileaftertransfer = 1; %only has affect if Transfer="Cam+PC" and affectively converts it to "PC only" -C.session.asksavepath = 0; %dialog popup for after capture +C.session.asksavepath = 0; %dialogue pop-up for after capture C.session.allowoverwrite = 0; %overwrite if file exists C.session.lowercaseextension = 1; %use "*.jpg" instead of "*.JPG" @@ -33,12 +33,18 @@ C.Capture(file,time); %capture datestr(time) -%% Example: two cameras +%% Example: multiple cameras C = CameraController; -C.Cameras(1), C.property.devicename = 'Cam1'; %camera name -C.Cameras(2), C.property.devicename = 'Cam2'; +serials = C.Cameras; %list of connected camera serial numbers +for k = 1:numel(C.Cameras) %step through cameras + C.Cameras(serials{k}); %switch to camera + C.property.devicename = num2str(k,'C%g'); %set camera name: C# + fprintf('ID:%-2g Serial:%-15s Name:"%s"\n',k,serials{k},C.property.devicename) %display +end C.session.filenametemplate = '[Camera Name]\[Time hh-mm-ss]'; %filename -C.Cmd('CaptureAll') +C.Cmd('CaptureAll') %capture using all cameras +C.Capture([],-2,'all') %capture using all cameras after a 2 sec delay +%file = C.lastfile %returns file name only and for one camera only %% Example: focus stacking C = CameraController; @@ -65,9 +71,8 @@ C.Cmd('LiveViewWnd_Hide'); %stop live view %% Example: debugging -C = CameraController; -C.Clock %show clock (take timed photo of clock to measure capture delay) -C.debug = 2; %display commands and replies +C = CameraController([],3); %start with debug on +C.Clock %show clock (usefull for taking timed photos of computer clock to measure capture delay) %% Example webserver commands: % http://localhost:5513 %primitive http GUI