Class AbstractSimulinkModel
java.lang.Object
org.eclipse.epsilon.eol.models.Model
org.eclipse.epsilon.eol.models.CachedModel<ISimulinkModelElement>
org.eclipse.epsilon.emc.simulink.model.AbstractSimulinkModel
- All Implemented Interfaces:
AutoCloseable
,IGenericSimulinkModel
,IModel
- Direct Known Subclasses:
SimulinkDictionaryModel
,SimulinkModel
,SimulinkRequirementModel
public abstract class AbstractSimulinkModel
extends CachedModel<ISimulinkModelElement>
implements IGenericSimulinkModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected boolean
protected MatlabEngine
protected String
protected Integer
static final String
static final String
static final String
protected File
protected String
protected String
protected boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected boolean
protected File
protected boolean
protected File
Fields inherited from class org.eclipse.epsilon.eol.models.CachedModel
allContentsCache, kindCache, PROPERTY_CACHED, PROPERTY_CONCURRENT, typeCache
Fields inherited from class org.eclipse.epsilon.eol.models.Model
aliases, ENV_PREFIX, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_READONLY, PROPERTY_STOREONDISPOSAL, propertyGetter, propertySetter, readOnLoad, storeOnDisposal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected abstract void
protected ISimulinkModelElement
createInstanceInModel
(String type) protected void
void
flush()
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 byCachedModel
as a key for the memoization of model elements by type.getEnumerationValue
(String enumeration, String label) getFile()
getPaths()
getWorkspaceVariable
(String value) boolean
boolean
isInstantiable
(String type) boolean
isLoaded()
Convenience method for determining when a model has been loaded.boolean
boolean
void
load
(StringProperties properties, IRelativePathResolver resolver) protected void
boolean
Used to test whether an object is contained in this model.parseMatlabEngineVariable
(String variableName) protected boolean
void
setCloseOnDispose
(Boolean closeOnDispose) void
setEnableTryCatch
(boolean enableTryCatch) void
setEngine
(MatlabEngine engine) void
setEngineJarPath
(String engineJarPath) void
void
setLibraryPath
(String libraryPath) void
setMatlabPath
(String matlabPath) void
setOpenOnLoad
(Boolean openOnLoad) void
setProject
(File simulinkProject) void
setProject
(String simulinkProject) void
setReduceExchanges
(boolean reduceExchanges) void
setTrackApi
(boolean track) void
setUseCurrentProject
(Boolean currentSimulinkProject) void
setWorkingDir
(File workingDir) void
statementWithResult
(String statement) Methods inherited from class org.eclipse.epsilon.eol.models.CachedModel
addToCache, allContents, allContentsFromModel, clearCache, createInstance, deleteElement, deleteElementInModel, dispose, getAllOfKind, getAllOfKindFromModel, getAllOfKindOrType, getAllOfType, getAllOfTypeFromModel, initCaches, isCachingEnabled, isConcurrent, load, removeFromCache, setCachingEnabled, setConcurrent, wrap
Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeOf, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposal
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.epsilon.eol.models.IModel
allContents, checkAmbiguity, 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
-
Field Details
-
PROPERTY_WORKING_DIR
- See Also:
-
PROPERTY_PATHS
- See Also:
-
PROPERTY_FILE
- See Also:
-
PROPERTY_MATLAB_PATH
- See Also:
-
PROPERTY_LIBRARY_PATH
- See Also:
-
PROPERTY_ENGINE_JAR_PATH
- See Also:
-
PROPERTY_SIMULINK_PROJECT
- See Also:
-
PROPERTY_OPEN_ON_LOAD
- See Also:
-
PROPERTY_CLOSE_ON_DISPOSE
- See Also:
-
PROPERTY_ENABLE_TRY_CATCH
- See Also:
-
PROPERTY_CURRENT_SIMULINK_PROJECT
- See Also:
-
PROPERTY_ENGINE_POOL_SIZE
- See Also:
-
PROPERTY_TRACK_API
- See Also:
-
PROPERTY_REDUCE_EXCHANGES
- See Also:
-
ENV_MATLAB_PATH
- See Also:
-
ENV_LIBRARY_PATH
- See Also:
-
ENV_ENGINE_JAR_PATH
- See Also:
-
file
-
matlabPath
-
libraryPath
-
engineJarPath
-
engine
-
simulinkProject
-
useCurrentProject
protected boolean useCurrentProject -
openOnLoad
protected boolean openOnLoad -
closeOnDispose
protected boolean closeOnDispose -
enableTryCatch
protected boolean enableTryCatch -
enginePoolSize
-
workingDir
-
paths
-
reduceExchanges
protected boolean reduceExchanges
-
-
Constructor Details
-
AbstractSimulinkModel
public AbstractSimulinkModel()
-
-
Method Details
-
flush
- Throws:
EolRuntimeException
-
loadModel
- Specified by:
loadModel
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelLoadingException
-
disposeModel
protected void disposeModel()- Specified by:
disposeModel
in classCachedModel<ISimulinkModelElement>
-
closeMatlabModel
protected abstract void closeMatlabModel() -
getCacheKeyForType
Description copied from class:CachedModel
Returns an identity for the given type, which will be used byCachedModel
as a key for the memoization of model elements by type.- Specified by:
getCacheKeyForType
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
-
getAllTypeNamesOf
Description copied from class:CachedModel
Returns the fully qualified names of every type to which the given object conforms. The values are used by byCachedModel
for the memoization of model elements by their kind (CachedModel.getAllOfKind(String)
).- Specified by:
getAllTypeNamesOf
in classCachedModel<ISimulinkModelElement>
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException - Specified by:
getEnumerationValue
in interfaceIModel
- Throws:
EolEnumerationValueNotFoundException
-
getFile
- Specified by:
getFile
in interfaceIGenericSimulinkModel
-
setFile
- Specified by:
setFile
in interfaceIGenericSimulinkModel
-
getEngine
- Specified by:
getEngine
in interfaceIGenericSimulinkModel
-
setEngine
-
getLibraryPath
- Specified by:
getLibraryPath
in interfaceIGenericSimulinkModel
-
setLibraryPath
- Specified by:
setLibraryPath
in interfaceIGenericSimulinkModel
-
getEngineJarPath
- Specified by:
getEngineJarPath
in interfaceIGenericSimulinkModel
-
setEngineJarPath
- Specified by:
setEngineJarPath
in interfaceIGenericSimulinkModel
-
getMatlabPath
- Specified by:
getMatlabPath
in interfaceIGenericSimulinkModel
-
setMatlabPath
- Specified by:
setMatlabPath
in interfaceIGenericSimulinkModel
-
setTrackApi
public void setTrackApi(boolean track) - Specified by:
setTrackApi
in interfaceIGenericSimulinkModel
-
isTrackApi
public boolean isTrackApi()- Specified by:
isTrackApi
in interfaceIGenericSimulinkModel
-
getProject
- Specified by:
getProject
in interfaceIGenericSimulinkModel
-
setProject
- Specified by:
setProject
in interfaceIGenericSimulinkModel
-
setProject
-
isUseCurrentProject
- Specified by:
isUseCurrentProject
in interfaceIGenericSimulinkModel
-
setUseCurrentProject
- Specified by:
setUseCurrentProject
in interfaceIGenericSimulinkModel
-
setCloseOnDispose
- Specified by:
setCloseOnDispose
in interfaceIGenericSimulinkModel
-
setOpenOnLoad
- Specified by:
setOpenOnLoad
in interfaceIGenericSimulinkModel
-
isCloseOnDispose
- Specified by:
isCloseOnDispose
in interfaceIGenericSimulinkModel
-
isOpenOnLoad
- Specified by:
isOpenOnLoad
in interfaceIGenericSimulinkModel
-
setEnableTryCatch
public void setEnableTryCatch(boolean enableTryCatch) -
isEnableTryCatch
public boolean isEnableTryCatch() -
parseMatlabEngineVariable
- Throws:
MatlabException
-
statement
- Throws:
EolRuntimeException
-
statementWithResult
- Throws:
EolRuntimeException
-
getWorkspaceVariable
-
owns
Description copied from interface:IModel
Used to test whether an object is contained in this model. -
isInstantiable
- Specified by:
isInstantiable
in interfaceIModel
-
createInstanceInModel
protected ISimulinkModelElement createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstanceInModel
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
load
in interfaceIModel
- Overrides:
load
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelLoadingException
-
isLoaded
public boolean isLoaded()Description copied from class:CachedModel
Convenience method for determining when a model has been loaded.- Overrides:
isLoaded
in classCachedModel<ISimulinkModelElement>
- Returns:
- Whether the cache has been populated.
- Since:
- 1.6
-
getWorkingDir
- Specified by:
getWorkingDir
in interfaceIGenericSimulinkModel
-
setWorkingDir
- Specified by:
setWorkingDir
in interfaceIGenericSimulinkModel
-
addPath
- Specified by:
addPath
in interfaceIGenericSimulinkModel
-
addPath
- Specified by:
addPath
in interfaceIGenericSimulinkModel
-
getPaths
- Specified by:
getPaths
in interfaceIGenericSimulinkModel
-
resolvePaths
protected boolean resolvePaths()- Returns:
true
iff the paths were successfully resolved.
-
isReduceExchanges
public boolean isReduceExchanges() -
setReduceExchanges
public void setReduceExchanges(boolean reduceExchanges)
-