Skip to content

Commit

Permalink
Load block library after adding JARs to path
Browse files Browse the repository at this point in the history
see #30
  • Loading branch information
t-sommer committed Jun 3, 2019
1 parent 187f502 commit 9a868d5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions +FMIKit/initialize.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ function initialize()

info = what('+FMIKit');
[folder, ~, ~] = fileparts(info(1).path);

% add repository information to avoid "fix" message in library browser
if ~verLessThan('matlab', '8.4') % R2014b
try
h = load_system('FMIKit_blocks');
if (strcmp(get_param(h, 'EnableLBRepository'), 'off'))
set_param(h, 'Lock', 'off');
set_param(h, 'EnableLBRepository', 'on');
set_param(h, 'Lock', 'on');
save_system(h);
end
close_system(h);
catch
end
end

% initialize the RTWSFCNFMI
if isempty(which('rtwsfcnfmi_init'))
Expand Down Expand Up @@ -62,6 +47,21 @@ function initialize()
msg = true;
end

% add repository information to avoid "fix" message in library browser
if ~verLessThan('matlab', '8.4') % R2014b
try
h = load_system('FMIKit_blocks');
if (strcmp(get_param(h, 'EnableLBRepository'), 'off'))
set_param(h, 'Lock', 'off');
set_param(h, 'EnableLBRepository', 'on');
set_param(h, 'Lock', 'on');
save_system(h);
end
close_system(h);
catch
end
end

if msg
disp(['Initializing FMI Kit ' [num2str(FMIKit.majorVersion) '.' ...
num2str(FMIKit.minorVersion) '.' num2str(FMIKit.patchVersion)]])
Expand Down

0 comments on commit 9a868d5

Please sign in to comment.