Skip to content

Commit

Permalink
v1.3.3 fixed multiple camera support and improved the multiple camera…
Browse files Browse the repository at this point in the history
… example
  • Loading branch information
serg3y committed Nov 22, 2018
1 parent 4f89d00 commit 5e9305a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
6 changes: 4 additions & 2 deletions CameraController.m
@@ -1,4 +1,4 @@
%Controller (v1.3.2) for tethered DSLR cameras using <a href=http://digicamcontrol.com/>digiCamControl</a> app.
%Controller (v1.3.3) for tethered DSLR cameras using <a href=http://digicamcontrol.com/>digiCamControl</a> app.
% C = CameraController -create class
% C = CameraController(dcc) -digiCamControl location
% C = CameraController(dcc,debug) -set debug level
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 14 additions & 9 deletions 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';
Expand All @@ -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"

Expand All @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 5e9305a

Please sign in to comment.