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, typeCachealiases, 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, wrapallInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeOf, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposalclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallContents, 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, storepublic 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>EolModelLoadingExceptionprotected void disposeModel()
disposeModel in class CachedModel<ISimulinkModelElement>protected abstract void closeMatlabModel()
protected Object getCacheKeyForType(String type) throws EolModelElementTypeNotFoundException
CachedModelCachedModel
as a key for the memoization of model elements
by type.getCacheKeyForType in class CachedModel<ISimulinkModelElement>EolModelElementTypeNotFoundExceptionprotected Collection<String> getAllTypeNamesOf(Object instance)
CachedModelCachedModel 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 IModelEolEnumerationValueNotFoundExceptionpublic File getFile()
getFile in interface IGenericSimulinkModelpublic void setFile(File file)
setFile in interface IGenericSimulinkModelpublic MatlabEngine getEngine()
getEngine in interface IGenericSimulinkModelpublic void setEngine(MatlabEngine engine)
public String getLibraryPath()
getLibraryPath in interface IGenericSimulinkModelpublic void setLibraryPath(String libraryPath)
setLibraryPath in interface IGenericSimulinkModelpublic String getEngineJarPath()
getEngineJarPath in interface IGenericSimulinkModelpublic void setEngineJarPath(String engineJarPath)
setEngineJarPath in interface IGenericSimulinkModelpublic String getMatlabPath()
getMatlabPath in interface IGenericSimulinkModelpublic void setMatlabPath(String matlabPath)
setMatlabPath in interface IGenericSimulinkModelpublic File getProject()
getProject in interface IGenericSimulinkModelpublic void setProject(String simulinkProject)
setProject in interface IGenericSimulinkModelpublic void setProject(File simulinkProject)
public Boolean isUseCurrentProject()
isUseCurrentProject in interface IGenericSimulinkModelpublic void setUseCurrentProject(Boolean currentSimulinkProject)
setUseCurrentProject in interface IGenericSimulinkModelpublic void setCloseOnDispose(Boolean closeOnDispose)
setCloseOnDispose in interface IGenericSimulinkModelpublic void setOpenOnLoad(Boolean openOnLoad)
setOpenOnLoad in interface IGenericSimulinkModelpublic Boolean isCloseOnDispose()
isCloseOnDispose in interface IGenericSimulinkModelpublic Boolean isOpenOnLoad()
isOpenOnLoad in interface IGenericSimulinkModelpublic void setEnableTryCatch(boolean enableTryCatch)
public boolean isEnableTryCatch()
public Object parseMatlabEngineVariable(String variableName) throws MatlabException
MatlabExceptionpublic void statement(String statement) throws EolRuntimeException
EolRuntimeExceptionpublic Object statementWithResult(String statement) throws EolRuntimeException
EolRuntimeExceptionpublic boolean owns(Object instance)
IModelpublic boolean isInstantiable(String type)
isInstantiable in interface IModelprotected ISimulinkModelElement createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
createInstanceInModel in class CachedModel<ISimulinkModelElement>EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeExceptionpublic void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
load in interface IModelload in class CachedModel<ISimulinkModelElement>EolModelLoadingExceptionpublic boolean isLoaded()
CachedModelisLoaded in class CachedModel<ISimulinkModelElement>public File getWorkingDir()
getWorkingDir in interface IGenericSimulinkModelpublic void setWorkingDir(File workingDir)
setWorkingDir in interface IGenericSimulinkModelpublic void addPath(String path)
addPath in interface IGenericSimulinkModelpublic void addPath(File path)
addPath in interface IGenericSimulinkModelpublic List<String> getPaths()
getPaths in interface IGenericSimulinkModelprotected boolean resolvePaths()
true iff the paths were successfully resolved.Copyright © 2020. All rights reserved.