-
Notifications
You must be signed in to change notification settings - Fork 2
/
pathNeqSim.m
42 lines (34 loc) · 1.36 KB
/
pathNeqSim.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function pathNeqSim()
% Add neqsim functions and jar to path, initialize processOperations object
% function pathNeqSim()
% Add NeqSim funtions to path, setup database and call resetProcessOperations
%
% DESCRIPTION:
% Add neqsim jar file to dynamic classpath and matlab neqsim lib functions
% to matlab path.
% Initialize processOperations object
global processOperations
appDataName = 'NeqSimLoaded';
if ~isappdata(0,appDataName) || ~getappdata(0,appDataName)
baseFol = fileparts(mfilename('fullpath'));
addpath(fullfile(fileparts(mfilename('fullpath')),'lib'));
librarypath = fullfile(baseFol,'ext');
jarFiles = cellstr(ls(fullfile(librarypath,'*.jar')));
for k = numel(jarFiles):-1:1
dynamicJavaPath = javaclasspath('-dynamic');
currJar = fullfile(librarypath,jarFiles(k));
if ~isfile(fullfile(librarypath,jarFiles(k)))
currJar = jarFiles(k);
end
if ~any(contains(dynamicJavaPath,currJar))
javaclasspath(currJar);
end
end
% neqsim.util.database.NeqSimDataBase.setDataBaseType("Derby");
% neqsim.util.database.NeqSimDataBase.setConnectionString("jdbc:derby:classpath:data/neqsimthermodatabase");
setappdata(0,appDataName,true);
resetProcessOperations();
end
if isempty(processOperations)
processOperations = neqsim.processsimulation.processsystem.ProcessSystem;
end