Updating itaVA handling when no VAMatlab executable available. Improving protos.

parent dde969e8
...@@ -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
...@@ -68,6 +70,11 @@ classdef itaVA < handle ...@@ -68,6 +70,11 @@ classdef itaVA < handle
% Return values: % Return values:
% %
% version [string] Version string % version [string] Version string
if ~itaVA.check_for_mex_file()
error( 'Matlab binding for VA requires VAMatlab executable.' );
end
version = VAMatlab('getVersion'); version = VAMatlab('getVersion');
end end
...@@ -87,6 +94,11 @@ classdef itaVA < handle ...@@ -87,6 +94,11 @@ classdef itaVA < handle
% - If you do not want any messages from the extension % - If you do not want any messages from the extension
% set the verbose mode to 'quiet' % set the verbose mode to 'quiet'
% %
if ~itaVA.check_for_mex_file()
error( 'Matlab binding for VA requires VAMatlab executable.' );
end
VAMatlab('setVerboseMode', mode); VAMatlab('setVerboseMode', mode);
end end
end end
...@@ -113,7 +125,7 @@ classdef itaVA < handle ...@@ -113,7 +125,7 @@ classdef itaVA < handle
% core = itaVA('localhost:12340'); % core = itaVA('localhost:12340');
% %
if ~check_for_mex_file() ) if ~itaVA.check_for_mex_file()
error( 'Matlab binding for VA requires VAMatlab executable.' ); error( 'Matlab binding for VA requires VAMatlab executable.' );
end end
......
% THIS FILE WILL BE OVERWRITTEN BY CMAKE WITHOUT WARNING
% %
% Code generator for the VA Matlab interface facade class % Code generator for the VA Matlab interface facade class
% %
...@@ -8,23 +9,9 @@ ...@@ -8,23 +9,9 @@
% interface. These are derived using the reflexion % interface. These are derived using the reflexion
% mechanism ('enumerateFunctions') % mechanism ('enumerateFunctions')
% %
% Author: Frank Wefers (fwefers@akustik.rwth-aachen.de)
% Version: $Id: $
%
% Clear everything first, so that no inconsistens
% class instances can exist
clear all
% Uncomment the path you are building your matlab executable against. It is script_dir = '@VAMATLAB_SCRIPT_DIR@'; % Matlab scripts target directory
% sufficient to execute this once for a matlab session. It is always recommended deploy_dir = '@VAMATLAB_DEPLOY_DIR@'; % Deploy directory, i.e. 'C:/dev/VA/dist/win32-x64.vc12'
% to build against a release executable, use debug mode only if you actually
% want to debug the mex library. There is a 3rdParty/Matlab if you want to
% link the executable against a Matlab version/platform that is not installed
% on your machine.
script_dir = '@VAMATLAB_SCRIPT_DIR@';
deploy_dir = '@VAMATLAB_DEPLOY_DIR@';
lib_dir = '@VAMATLAB_LIB_DIR@'; lib_dir = '@VAMATLAB_LIB_DIR@';
if exist( deploy_dir, 'dir' ) ~= 7 if exist( deploy_dir, 'dir' ) ~= 7
...@@ -34,9 +21,13 @@ end ...@@ -34,9 +21,13 @@ end
if exist( 'VAMatlab', 'file' ) if exist( 'VAMatlab', 'file' )
warning( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) ) warning( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
else else
% Add to PATH temporarily and move lib to bin dir % Add to PATH temporarily and attempt to move lib to bin dir
movefile( fullfile( lib_dir, 'VAMatlab*' ), deploy_dir ); addpath( script_dir, bin_dir )
addpath( script_dir, deploy_dir )
[ s ] = movefile( fullfile( lib_dir, 'VAMatlab*' ), bin_dir );
if ~s && ~exist( 'VAMatlab', 'file' )
error( 'Could locate VAMatlab executable. Please make sure that it can be found.' )
end
end end
% Parameters % Parameters
......
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