public abstract class AbstractSimulinkModel extends CachedModel<ISimulinkModelElement> implements IGenericSimulinkModel
Modifier and Type | Field and Description |
---|---|
protected boolean |
closeOnDispose |
protected boolean |
enableTryCatch |
protected MatlabEngine |
engine |
protected String |
engineJarPath |
protected Integer |
enginePoolSize |
static String |
ENV_ENGINE_JAR_PATH |
static String |
ENV_LIBRARY_PATH |
static String |
ENV_MATLAB_PATH |
protected File |
file |
protected String |
libraryPath |
protected String |
matlabPath |
protected boolean |
openOnLoad |
protected List<String> |
paths |
static String |
PROPERTY_CLOSE_ON_DISPOSE |
static String |
PROPERTY_CURRENT_SIMULINK_PROJECT |
static String |
PROPERTY_ENABLE_TRY_CATCH |
static String |
PROPERTY_ENGINE_JAR_PATH |
static String |
PROPERTY_ENGINE_POOL_SIZE |
static String |
PROPERTY_FILE |
static String |
PROPERTY_LIBRARY_PATH |
static String |
PROPERTY_MATLAB_PATH |
static String |
PROPERTY_OPEN_ON_LOAD |
static String |
PROPERTY_PATHS |
static String |
PROPERTY_SIMULINK_PROJECT |
static String |
PROPERTY_WORKING_DIR |
protected File |
simulinkProject |
protected boolean |
useCurrentProject |
protected File |
workingDir |
allContentsCache, kindCache, PROPERTY_CACHED, PROPERTY_CONCURRENT, typeCache
aliases, ENV_PREFIX, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_READONLY, PROPERTY_STOREONDISPOSAL, propertyGetter, propertySetter, readOnLoad, storeOnDisposal
Constructor and Description |
---|
AbstractSimulinkModel() |
Modifier and Type | Method and Description |
---|---|
void |
addPath(File path) |
void |
addPath(String path) |
protected abstract void |
closeMatlabModel() |
protected ISimulinkModelElement |
createInstanceInModel(String type) |
protected void |
disposeModel() |
protected Collection<String> |
getAllTypeNamesOf(Object instance)
Returns the fully qualified names of every type to which the
given object conforms.
|
protected Object |
getCacheKeyForType(String type)
Returns an identity for the given type,
which will be used by
CachedModel
as a key for the memoization of model elements
by type. |
MatlabEngine |
getEngine() |
String |
getEngineJarPath() |
Object |
getEnumerationValue(String enumeration,
String label) |
File |
getFile() |
String |
getLibraryPath() |
String |
getMatlabPath() |
List<String> |
getPaths() |
File |
getProject() |
File |
getWorkingDir() |
Object |
getWorkspaceVariable(String value) |
Boolean |
isCloseOnDispose() |
boolean |
isEnableTryCatch() |
boolean |
isInstantiable(String type) |
boolean |
isLoaded()
Convenience method for determining when a model has been loaded.
|
Boolean |
isOpenOnLoad() |
Boolean |
isUseCurrentProject() |
void |
load(StringProperties properties,
IRelativePathResolver resolver) |
protected void |
loadModel() |
boolean |
owns(Object instance)
Used to test whether an object is contained in this model.
|
Object |
parseMatlabEngineVariable(String variableName) |
protected boolean |
resolvePaths() |
void |
setCloseOnDispose(Boolean closeOnDispose) |
void |
setEnableTryCatch(boolean enableTryCatch) |
void |
setEngine(MatlabEngine engine) |
void |
setEngineJarPath(String engineJarPath) |
void |
setFile(File file) |
void |
setLibraryPath(String libraryPath) |
void |
setMatlabPath(String matlabPath) |
void |
setOpenOnLoad(Boolean openOnLoad) |
void |
setProject(File simulinkProject) |
void |
setProject(String simulinkProject) |
void |
setUseCurrentProject(Boolean currentSimulinkProject) |
void |
setWorkingDir(File workingDir) |
void |
statement(String statement) |
Object |
statementWithResult(String statement) |
addToCache, allContents, allContentsFromModel, clearCache, createInstance, deleteElement, deleteElementInModel, dispose, getAllOfKind, getAllOfKindFromModel, getAllOfKindOrType, getAllOfType, getAllOfTypeFromModel, initCaches, isCachingEnabled, isConcurrent, load, removeFromCache, setCachingEnabled, setConcurrent, wrap
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeOf, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allContents, close, createInstance, createInstance, deleteElement, dispose, getAliases, getAllOfKind, getAllOfType, getElementById, getElementId, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeNameOf, getTypeOf, hasType, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, setElementId, setName, setReadOnLoad, setStoredOnDisposal, store, store
public static final String PROPERTY_WORKING_DIR
public static final String PROPERTY_PATHS
public static final String PROPERTY_FILE
public static final String PROPERTY_MATLAB_PATH
public static final String PROPERTY_LIBRARY_PATH
public static final String PROPERTY_ENGINE_JAR_PATH
public static final String PROPERTY_SIMULINK_PROJECT
public static final String PROPERTY_OPEN_ON_LOAD
public static final String PROPERTY_CLOSE_ON_DISPOSE
public static final String PROPERTY_ENABLE_TRY_CATCH
public static final String PROPERTY_CURRENT_SIMULINK_PROJECT
public static final String PROPERTY_ENGINE_POOL_SIZE
public static final String ENV_MATLAB_PATH
public static final String ENV_LIBRARY_PATH
public static final String ENV_ENGINE_JAR_PATH
protected File file
protected String matlabPath
protected String libraryPath
protected String engineJarPath
protected MatlabEngine engine
protected File simulinkProject
protected boolean useCurrentProject
protected boolean openOnLoad
protected boolean closeOnDispose
protected boolean enableTryCatch
protected Integer enginePoolSize
protected File workingDir
protected void loadModel() throws EolModelLoadingException
loadModel
in class CachedModel<ISimulinkModelElement>
EolModelLoadingException
protected void disposeModel()
disposeModel
in class CachedModel<ISimulinkModelElement>
protected abstract void closeMatlabModel()
protected Object getCacheKeyForType(String type) throws EolModelElementTypeNotFoundException
CachedModel
CachedModel
as a key for the memoization of model elements
by type.getCacheKeyForType
in class CachedModel<ISimulinkModelElement>
EolModelElementTypeNotFoundException
protected Collection<String> getAllTypeNamesOf(Object instance)
CachedModel
CachedModel
for the memoization of
model elements by their kind (CachedModel.getAllOfKind(String)
).getAllTypeNamesOf
in class CachedModel<ISimulinkModelElement>
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException
getEnumerationValue
in interface IModel
EolEnumerationValueNotFoundException
public File getFile()
getFile
in interface IGenericSimulinkModel
public void setFile(File file)
setFile
in interface IGenericSimulinkModel
public MatlabEngine getEngine()
getEngine
in interface IGenericSimulinkModel
public void setEngine(MatlabEngine engine)
public String getLibraryPath()
getLibraryPath
in interface IGenericSimulinkModel
public void setLibraryPath(String libraryPath)
setLibraryPath
in interface IGenericSimulinkModel
public String getEngineJarPath()
getEngineJarPath
in interface IGenericSimulinkModel
public void setEngineJarPath(String engineJarPath)
setEngineJarPath
in interface IGenericSimulinkModel
public String getMatlabPath()
getMatlabPath
in interface IGenericSimulinkModel
public void setMatlabPath(String matlabPath)
setMatlabPath
in interface IGenericSimulinkModel
public File getProject()
getProject
in interface IGenericSimulinkModel
public void setProject(String simulinkProject)
setProject
in interface IGenericSimulinkModel
public void setProject(File simulinkProject)
public Boolean isUseCurrentProject()
isUseCurrentProject
in interface IGenericSimulinkModel
public void setUseCurrentProject(Boolean currentSimulinkProject)
setUseCurrentProject
in interface IGenericSimulinkModel
public void setCloseOnDispose(Boolean closeOnDispose)
setCloseOnDispose
in interface IGenericSimulinkModel
public void setOpenOnLoad(Boolean openOnLoad)
setOpenOnLoad
in interface IGenericSimulinkModel
public Boolean isCloseOnDispose()
isCloseOnDispose
in interface IGenericSimulinkModel
public Boolean isOpenOnLoad()
isOpenOnLoad
in interface IGenericSimulinkModel
public void setEnableTryCatch(boolean enableTryCatch)
public boolean isEnableTryCatch()
public Object parseMatlabEngineVariable(String variableName) throws MatlabException
MatlabException
public void statement(String statement) throws EolRuntimeException
EolRuntimeException
public Object statementWithResult(String statement) throws EolRuntimeException
EolRuntimeException
public boolean owns(Object instance)
IModel
public boolean isInstantiable(String type)
isInstantiable
in interface IModel
protected ISimulinkModelElement createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
createInstanceInModel
in class CachedModel<ISimulinkModelElement>
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
load
in interface IModel
load
in class CachedModel<ISimulinkModelElement>
EolModelLoadingException
public boolean isLoaded()
CachedModel
isLoaded
in class CachedModel<ISimulinkModelElement>
public File getWorkingDir()
getWorkingDir
in interface IGenericSimulinkModel
public void setWorkingDir(File workingDir)
setWorkingDir
in interface IGenericSimulinkModel
public void addPath(String path)
addPath
in interface IGenericSimulinkModel
public void addPath(File path)
addPath
in interface IGenericSimulinkModel
public List<String> getPaths()
getPaths
in interface IGenericSimulinkModel
protected boolean resolvePaths()
true
iff the paths were successfully resolved.Copyright © 2020. All rights reserved.