Class SimulinkModel
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.eol.models.CachedModel<ISimulinkModelElement>
-
- org.eclipse.epsilon.emc.simulink.model.AbstractSimulinkModel
-
- org.eclipse.epsilon.emc.simulink.model.SimulinkModel
-
- All Implemented Interfaces:
AutoCloseable
,IGenericSimulinkModel
,IOperationContributorProvider
,IModel
- Direct Known Subclasses:
SimulinkModelInEclipse
public class SimulinkModel extends AbstractSimulinkModel implements IOperationContributorProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult
-
-
Field Summary
Fields Modifier and Type Field Description static String
BLOCK
protected boolean
findOptimisationEnabled
static String
GET_PARAM
protected double
handle
static String
LOAD_SYSTEM
static String
NEW_SYSTEM
static String
OPEN_SYSTEM
static String
PROPERTY_CURRENT_SIMULINK_MODEL
static String
PROPERTY_FIND_OPTIMISATION
static String
PROPERTY_FOLLOW_LINKS
CONSTANTSstatic String
PROPERTY_INCLUDE_COMMENTED
static String
PROPERTY_LOOK_UNDER_MASKS
static String
PROPERTY_SHOW_IN_MATLAB_EDITOR
Deprecated.static String
SAVE_SYSTEM
protected SearchPreferences
searchPreferences
FIELDSprotected boolean
showInMatlabEditor
Deprecated.static String
SIMULINK
protected String
simulinkModelName
protected ModelOperationContributor
simulinkOperationContributor
static String
STATEFLOW
protected boolean
useCurrentSimulinkModel
-
Fields inherited from class org.eclipse.epsilon.emc.simulink.model.AbstractSimulinkModel
closeOnDispose, enableTryCatch, engine, engineJarPath, enginePoolSize, ENV_ENGINE_JAR_PATH, ENV_LIBRARY_PATH, ENV_MATLAB_PATH, file, libraryPath, matlabPath, openOnLoad, paths, PROPERTY_CLOSE_ON_DISPOSE, PROPERTY_CURRENT_SIMULINK_PROJECT, PROPERTY_ENABLE_TRY_CATCH, PROPERTY_ENGINE_JAR_PATH, PROPERTY_ENGINE_POOL_SIZE, PROPERTY_FILE, PROPERTY_LIBRARY_PATH, PROPERTY_MATLAB_PATH, PROPERTY_OPEN_ON_LOAD, PROPERTY_PATHS, PROPERTY_REDUCE_EXCHANGES, PROPERTY_SIMULINK_PROJECT, PROPERTY_TRACK_API, PROPERTY_WORKING_DIR, reduceExchanges, simulinkProject, useCurrentProject, workingDir
-
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 Constructor Description SimulinkModel()
-
Method Summary
-
Methods inherited from class org.eclipse.epsilon.emc.simulink.model.AbstractSimulinkModel
addPath, addPath, disposeModel, flush, getAllTypeNamesOf, getCacheKeyForType, getEngine, getEngineJarPath, getEnumerationValue, getFile, getLibraryPath, getMatlabPath, getPaths, getProject, getWorkingDir, getWorkspaceVariable, isCloseOnDispose, isEnableTryCatch, isLoaded, isOpenOnLoad, isReduceExchanges, isTrackApi, isUseCurrentProject, parseMatlabEngineVariable, resolvePaths, setCloseOnDispose, setEnableTryCatch, setEngine, setEngineJarPath, setFile, setLibraryPath, setMatlabPath, setOpenOnLoad, setProject, setProject, setReduceExchanges, setTrackApi, setUseCurrentProject, setWorkingDir, statement, statementWithResult
-
Methods inherited from class org.eclipse.epsilon.eol.models.CachedModel
allContents, clearCache, dispose, getAllOfKind, getAllOfKindOrType, getAllOfType, initCaches, isCachingEnabled, isConcurrent, load, setCachingEnabled, setConcurrent, wrap
-
Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, 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, dispose, getAliases, getAllOfKind, getAllOfType, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeOf, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
-
-
-
Field Detail
-
PROPERTY_SHOW_IN_MATLAB_EDITOR
@Deprecated public static final String PROPERTY_SHOW_IN_MATLAB_EDITOR
Deprecated.- See Also:
- Constant Field Values
-
PROPERTY_FOLLOW_LINKS
public static final String PROPERTY_FOLLOW_LINKS
CONSTANTS- See Also:
- Constant Field Values
-
PROPERTY_LOOK_UNDER_MASKS
public static final String PROPERTY_LOOK_UNDER_MASKS
- See Also:
- Constant Field Values
-
PROPERTY_INCLUDE_COMMENTED
public static final String PROPERTY_INCLUDE_COMMENTED
- See Also:
- Constant Field Values
-
PROPERTY_CURRENT_SIMULINK_MODEL
public static final String PROPERTY_CURRENT_SIMULINK_MODEL
- See Also:
- Constant Field Values
-
PROPERTY_FIND_OPTIMISATION
public static final String PROPERTY_FIND_OPTIMISATION
- See Also:
- Constant Field Values
-
BLOCK
public static final String BLOCK
- See Also:
- Constant Field Values
-
SIMULINK
public static final String SIMULINK
- See Also:
- Constant Field Values
-
STATEFLOW
public static final String STATEFLOW
- See Also:
- Constant Field Values
-
GET_PARAM
public static final String GET_PARAM
- See Also:
- Constant Field Values
-
LOAD_SYSTEM
public static final String LOAD_SYSTEM
- See Also:
- Constant Field Values
-
OPEN_SYSTEM
public static final String OPEN_SYSTEM
- See Also:
- Constant Field Values
-
NEW_SYSTEM
public static final String NEW_SYSTEM
- See Also:
- Constant Field Values
-
SAVE_SYSTEM
public static final String SAVE_SYSTEM
- See Also:
- Constant Field Values
-
searchPreferences
protected SearchPreferences searchPreferences
FIELDS
-
simulinkOperationContributor
protected ModelOperationContributor simulinkOperationContributor
-
useCurrentSimulinkModel
protected boolean useCurrentSimulinkModel
-
findOptimisationEnabled
protected boolean findOptimisationEnabled
-
showInMatlabEditor
@Deprecated protected boolean showInMatlabEditor
Deprecated.
-
handle
protected double handle
-
simulinkModelName
protected String simulinkModelName
-
-
Method Detail
-
loadModel
protected void loadModel() throws EolModelLoadingException
- Overrides:
loadModel
in classAbstractSimulinkModel
- Throws:
EolModelLoadingException
-
closeMatlabModel
protected void closeMatlabModel()
- Specified by:
closeMatlabModel
in classAbstractSimulinkModel
-
createInstanceInModel
protected ISimulinkModelElement createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
- Overrides:
createInstanceInModel
in classAbstractSimulinkModel
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
addToCache
protected void addToCache(String type, ISimulinkModelElement instance) throws EolModelElementTypeNotFoundException
- Overrides:
addToCache
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
-
removeFromCache
protected void removeFromCache(ISimulinkModelElement instance) throws EolModelElementTypeNotFoundException
- Overrides:
removeFromCache
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
-
deleteElement
public void deleteElement(Object o) throws EolRuntimeException
- Specified by:
deleteElement
in interfaceIModel
- Overrides:
deleteElement
in classCachedModel<ISimulinkModelElement>
- Throws:
EolRuntimeException
-
createInstance
public ISimulinkModelElement createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
- Specified by:
createInstance
in interfaceIModel
- Overrides:
createInstance
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
createInstance
public Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
- Specified by:
createInstance
in interfaceIModel
- Overrides:
createInstance
in classModel
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
deleteElementInModel
protected boolean deleteElementInModel(Object instance) throws EolRuntimeException
Description copied from class:CachedModel
Returns true iff the given instance was deleted from the model.- Specified by:
deleteElementInModel
in classCachedModel<ISimulinkModelElement>
- Throws:
EolRuntimeException
-
allContentsFromModel
protected Collection<ISimulinkModelElement> allContentsFromModel()
- Specified by:
allContentsFromModel
in classCachedModel<ISimulinkModelElement>
-
getAllOfTypeFromModel
protected Collection<ISimulinkModelElement> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException
- Specified by:
getAllOfTypeFromModel
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
-
getAllOfKindFromModel
protected Collection<ISimulinkModelElement> getAllOfKindFromModel(String kind_) throws EolModelElementTypeNotFoundException
- Specified by:
getAllOfKindFromModel
in classCachedModel<ISimulinkModelElement>
- Throws:
EolModelElementTypeNotFoundException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
- Specified by:
load
in interfaceIModel
- Overrides:
load
in classAbstractSimulinkModel
- Throws:
EolModelLoadingException
-
simulate
public void simulate() throws InterruptedException
- Throws:
InterruptedException
-
getTypeNameOf
public String getTypeNameOf(Object instance)
Description copied from interface:IModel
Returns a string representing the type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.- Specified by:
getTypeNameOf
in interfaceIModel
- Parameters:
instance
- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
getElementById
public Object getElementById(String id)
- Specified by:
getElementById
in interfaceIModel
-
setElementId
public void setElementId(Object instance, String newId)
- Specified by:
setElementId
in interfaceIModel
-
getElementId
public String getElementId(Object instance)
- Specified by:
getElementId
in interfaceIModel
-
owns
public boolean owns(Object instance)
Description copied from interface:IModel
Used to test whether an object is contained in this model.- Specified by:
owns
in interfaceIModel
- Overrides:
owns
in classAbstractSimulinkModel
- Parameters:
instance
- the Java object to test.- Returns:
- true if and only if instance is contained by this model.
-
isInstantiable
public boolean isInstantiable(String type)
- Specified by:
isInstantiable
in interfaceIModel
- Overrides:
isInstantiable
in classAbstractSimulinkModel
-
getSimulinkModelName
public String getSimulinkModelName()
-
setSimulinkModelName
protected void setSimulinkModelName(String name)
-
setSimulinkModelName
protected void setSimulinkModelName(File name)
-
getOperationContributor
public OperationContributor getOperationContributor()
- Specified by:
getOperationContributor
in interfaceIOperationContributorProvider
-
getHandle
public Double getHandle()
-
isUseCurrentSimulinkModel
public boolean isUseCurrentSimulinkModel()
-
setUseCurrentSimulinkModel
public void setUseCurrentSimulinkModel(boolean useCurrentSimulinkModel)
-
setShowInMatlabEditor
@Deprecated public void setShowInMatlabEditor(boolean openMatlabEditor)
Deprecated.If true, the model will be shown in the MATLAB Editor. If the model is already loaded, it will not open it again. If false, the model will not be open in the MATLAB editor, but won't close an already open model
-
isShowInMatlabEditor
@Deprecated public boolean isShowInMatlabEditor()
Deprecated.
-
getSearchPreferences
public SearchPreferences getSearchPreferences()
-
setSearchPreferences
public void setSearchPreferences(SearchPreferences searchPreferences)
-
isFollowLinks
public boolean isFollowLinks()
-
setFollowLinks
public void setFollowLinks(boolean followLinks)
If true, adds the 'Follow_Link' parameter to the 'find_system' method in MATLAB
-
getLookUnderMasks
public String getLookUnderMasks()
-
setLookUnderMasks
public void setLookUnderMasks(String lookUnderMasks)
-
isIncludeCommented
public boolean isIncludeCommented()
-
setIncludeCommented
public void setIncludeCommented(boolean includeCommented)
-
isFindOptimisationEnabled
public boolean isFindOptimisationEnabled()
-
setFindOptimisationEnabled
public void setFindOptimisationEnabled(boolean enabled)
-
getChildren
public Collection<ISimulinkModelElement> getChildren() throws MatlabException
- Throws:
MatlabException
-
findBlocks
public Collection<ISimulinkModelElement> findBlocks() throws MatlabException
- Throws:
MatlabException
-
findBlocks
public Collection<ISimulinkModelElement> findBlocks(Integer depth) throws MatlabException
- Throws:
MatlabException
-
-