Azzera filtri
Azzera filtri

if found exe file eye tracker

1 visualizzazione (ultimi 30 giorni)
Tota
Tota il 16 Feb 2023
السلام عليكم عندي مشكلة اريد افحص داخل while اذا كان file exe مفتوح اولا
في حال كان مفتوح يدخل ينفذ كود يجلب بيانات من جهاز eye tracker x,y, time stmp
----
myex('connect')
% open tracking window, set axes to screen size
%pause(10)
b=system('E:\master\project\Matlab Code\myex-master\myex-master\pictureShow2.exe');
% clear any data in buffer
myex('getdata');
% allow to track until window closed
x_all = [];
%while size(findobj(b))>0
%while ishandle(b) % check if exe still open احاول تشغل احد هذي
%while exist('pictureShow2.exe', 'file')
%[~,b] = system('tasklist');
%IsRunning = contains(b, 'pictureShow2.exe'); %1, if is running / 0, if not
%while IsRunning==1
j=0;
while (j<30) % check if figure still open
% get data
x = myex('getdata');
% pause(1);
%if data returned
if ~isempty(x)
% determine eyeball distance
z_mm = x(end,[8 11]);
isvalid = x(end,[4 5])==1;
isvalid = isvalid & (z_mm>0.001); % defensive (shouldn't be necessary)
z_mm = z_mm(isvalid);
z_mm = nanmean(z_mm);
% add data to store
x_all = [x_all; x]; %#ok<AGROW> This is innefficient memory-allocation, but ok for present purposes
else
%set(hTxt, 'String', 'Waiting for data');
end
pause(1/50); % run at 50 Hz
j=j+1;
end

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by