-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexperimentEnd.m
More file actions
38 lines (30 loc) · 1.08 KB
/
experimentEnd.m
File metadata and controls
38 lines (30 loc) · 1.08 KB
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
function [fhandle, runInfo, trialInfo, expInfo] = experimentEnd(rigInfo, ~, expInfo, runInfo, trialInfo, ~)
% cleans up and exits state system
fprintf('<stateSystem> endOfExperiment\n'); % debug
Priority(0);
VRmessage = ['VR_ExpEnd ' expInfo.animalName ' ' expInfo.dateStr ' ' expInfo.sessionName];
rigInfo = rigInfo.sendUDPmessage(rigInfo, VRmessage);
VRLogMessage(expInfo, VRmessage);
VRmessage = ['ExpEnd ' expInfo.animalName ' ' expInfo.dateStr ' ' expInfo.sessionName];
rigInfo = rigInfo.sendUDPmessage(rigInfo, VRmessage);
VRLogMessage(expInfo, VRmessage);
VRLogMessage(expInfo);
VRLogMessage(expInfo);
rigInfo.closeUDPports;
try
disp(['Copy data from ' expInfo.LocalDir ' to ' expInfo.ServerDir])
copyfile(expInfo.LocalDir, expInfo.ServerDir)
catch ME
disp(ME)
end
Screen('CloseAll');
heapTotalMemory = java.lang.Runtime.getRuntime.totalMemory;
heapFreeMemory = java.lang.Runtime.getRuntime.freeMemory;
if(heapFreeMemory < (heapTotalMemory*0.1))
java.lang.Runtime.getRuntime.gc;
fprintf('\n garbage collection \n');
end
fhandle = []; % exit state system
clear mex;
sca
end