-
Notifications
You must be signed in to change notification settings - Fork 4
/
icm_set_uv_status.m
47 lines (38 loc) · 1.64 KB
/
icm_set_uv_status.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function icm_set_uv_status(onOrOff,uvLevel)
% result folder
global uv
global g_tImaqStart
global g_uvStatus
global hdvp
global DMDimage
if onOrOff == 1
%% Prepare DMD as a 2nd monitor to display the upcoming image
% Get monitors (including DMD which is also a monitor) information
% use get(0,'MonitorPosition') to get the locations and size of the monitors
% for details http://www.mathworks.com/help/vision/ref/vision.deployablevideoplayer-class.html
% a = [Left-bottom width, Left-bottom height, screen width, screen height]
a = get(0,'MonitorPosition');
hdvp = vision.DeployableVideoPlayer;
hdvp.Size = 'Full-Screen'; % this command set the video to be displayed in full-screen
hdvp.Location = a(2,1:2); % this defines the DMD location where the image should display.
% hdvp.Location = a(1,1:2); % this tests the code on primary monitor
%% Display DMD bitmap
step(hdvp,DMDimage);
%% UV lighting and exposure finally begins here
uv = UVConn('COM3');
UVSetIrisLevel(uv, uvLevel);
UVShutterOpen(uv);
g_tImaqStart = tic;
g_uvStatus = 1; % flag UV light is on
disp('open uv')
else
% Close UV Shutter
UVShutterClose(uv);
% flag UV light is off again after being "on", not "0" so that acquisition and measurement could go on to capture dark curing
g_uvStatus = 2;
disp('close uv');
% Disconnect UV
UVDisc(uv);
% update the Interferogram Status Bar for info
% set(handles.st_InterferogramStatusBar,'String','ON Target. Controller closed UV shutter. Stop measurement when ready.');
end