Improving itaVA setup

parent 5fb00573
...@@ -47,12 +47,14 @@ classdef itaVA < handle ...@@ -47,12 +47,14 @@ classdef itaVA < handle
function [ ok ] = check_for_mex_file() function [ ok ] = check_for_mex_file()
% Checks if VAMatlab executable can be found. % Checks if VAMatlab executable can be found.
if ~exist( 'VAMatlab', 'var' ) if ~exist( 'VAMatlab', 'file' )
disp( 'Matlab binding for VA not complete (missing VAMatlab executable).' ) disp( 'Matlab binding for VA not complete (missing VAMatlab executable).' )
ok = false;
% file dialog % file dialog
itaVA_setup()
% Re-check
ok = exist( 'VAMatlab', 'file' ) > 0;
else else
ok = true; ok = true;
end end
......
...@@ -58,15 +58,27 @@ handles.output = hObject; ...@@ -58,15 +58,27 @@ handles.output = hObject;
% Update handles structure % Update handles structure
guidata(hObject, handles); guidata(hObject, handles);
% VAMatlab
current_va_mex_dir = which( 'VAMatlab' ); current_va_mex_dir = which( 'VAMatlab' );
if ~isempty( current_va_mex_dir ) if ~isempty( current_va_mex_dir )
[ va_mex_path, ~, ~ ] = fileparts( current_va_mex_dir ); [ va_mex_path, ~, ~ ] = fileparts( current_va_mex_dir );
set( handles.va_search_dir, 'String', fullfile( va_mex_path, '..' ) ); [ va_path, ~, ~ ] = fileparts( va_mex_path );
set( handles.va_search_dir, 'String', fullfile( va_path ) );
set( handles.edit_vamatlab_full_path, 'String', current_va_mex_dir )
v = VAMatlab( 'getVersion' );
set( handles.edit_vamatlab_version, 'String', v )
end
% VAServer
current_va_server_dir = which( 'VAServer.exe' );
if ~isempty( current_va_server_dir )
set( handles.edit_vaserver_full_path, 'String', current_va_server_dir )
[ ~, v ] = system( [ current_va_server_dir ' --version' ] );
set( handles.edit_vaserver_version, 'String', strcat( v ) )
end end
% UIWAIT makes itaVA_setup wait for user response (see UIRESUME) uiwait( handles.figure1 );
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. % --- Outputs from this function are returned to the command line.
...@@ -77,7 +89,9 @@ function varargout = itaVA_setup_OutputFcn(hObject, eventdata, handles) ...@@ -77,7 +89,9 @@ function varargout = itaVA_setup_OutputFcn(hObject, eventdata, handles)
% handles structure with handles and user data (see GUIDATA) % handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure % Get default command line output from handles structure
varargout{1} = handles.output; if ~isempty( handles )
varargout{1} = handles.output;
end
% --- Executes on button press in pushbutton_close. % --- Executes on button press in pushbutton_close.
...@@ -197,8 +211,8 @@ if vaserver_found ...@@ -197,8 +211,8 @@ if vaserver_found
end end
vaserver_path = fullfile( vaserver_dir, 'VAServer.exe' ); vaserver_path = fullfile( vaserver_dir, 'VAServer.exe' );
set( handles.edit_vaserver_full_path, 'String', vaserver_path ) set( handles.edit_vaserver_full_path, 'String', vaserver_path )
v = system( [ vaserver_path ' --version' ] ); [ ~, v ] = system( [ vaserver_path ' --version' ] );
set( handles.edit_vamatlab_version, 'String', v ) set( handles.edit_vaserver_version, 'String', strcat( v ) )
else else
set( handles.edit_vaserver_full_path, 'String', 'not found' ) set( handles.edit_vaserver_full_path, 'String', 'not found' )
end end
...@@ -212,6 +226,10 @@ if exist( fullfile( va_search_dir, component ), 'file' ) ...@@ -212,6 +226,10 @@ if exist( fullfile( va_search_dir, component ), 'file' )
va_component_dir = fullfile( va_search_dir ); % Base path is one folder up va_component_dir = fullfile( va_search_dir ); % Base path is one folder up
end end
if isempty( va_search_dir )
return % something went wrong
end
if ~found && recursive if ~found && recursive
listing = dir( va_search_dir ); listing = dir( va_search_dir );
for idx = 1:length( listing ) for idx = 1:length( listing )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment