You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
541 B
34 lines
541 B
|
11 months ago
|
function [] = matlab_static()
|
||
|
|
|
||
|
|
cleanup = onCleanup(@() exit() );
|
||
|
|
|
||
|
|
traxserver('setup', 'polygon', {'path', 'memory', 'buffer'});
|
||
|
|
|
||
|
|
memory = [0 0 0 0];
|
||
|
|
|
||
|
|
timeout = 0;
|
||
|
|
|
||
|
|
while 1
|
||
|
|
|
||
|
|
[image, region, properties] = traxserver('wait', 'PropStruct', true);
|
||
|
|
|
||
|
|
if isempty(image)
|
||
|
|
break;
|
||
|
|
end;
|
||
|
|
|
||
|
|
if ~isempty(region)
|
||
|
|
if isfield(properties, 'time_wait')
|
||
|
|
timeout = str2double(properties.time_wait);
|
||
|
|
end;
|
||
|
|
memory = region;
|
||
|
|
end;
|
||
|
|
|
||
|
|
if timeout > 0
|
||
|
|
pause(timeout);
|
||
|
|
end;
|
||
|
|
|
||
|
|
traxserver('status', memory);
|
||
|
|
end;
|
||
|
|
|
||
|
|
traxserver('quit');
|