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:
java.lang.AutoCloseable,IGenericSimulinkModel,IOperationContributorProvider,IModel
- Direct Known Subclasses:
SimulinkModelInEclipse
public class SimulinkModel extends AbstractSimulinkModel implements IOperationContributorProvider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBLOCKprotected booleanfindOptimisationEnabledstatic java.lang.StringGET_PARAMprotected doublehandlestatic java.lang.StringLOAD_SYSTEMstatic java.lang.StringNEW_SYSTEMstatic java.lang.StringOPEN_SYSTEMstatic java.lang.StringPROPERTY_CURRENT_SIMULINK_MODELstatic java.lang.StringPROPERTY_FIND_OPTIMISATIONstatic java.lang.StringPROPERTY_FOLLOW_LINKSCONSTANTSstatic java.lang.StringPROPERTY_INCLUDE_COMMENTEDstatic java.lang.StringPROPERTY_LOOK_UNDER_MASKSstatic java.lang.StringPROPERTY_SHOW_IN_MATLAB_EDITORDeprecated.static java.lang.StringSAVE_SYSTEMprotected SearchPreferencessearchPreferencesFIELDSprotected booleanshowInMatlabEditorDeprecated.static java.lang.StringSIMULINKprotected java.lang.StringsimulinkModelNameprotected ModelOperationContributorsimulinkOperationContributorstatic java.lang.StringSTATEFLOWprotected booleanuseCurrentSimulinkModel-
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddToCache(java.lang.String type, ISimulinkModelElement instance)protected java.util.Collection<ISimulinkModelElement>allContentsFromModel()protected voidcloseMatlabModel()ISimulinkModelElementcreateInstance(java.lang.String type)java.lang.ObjectcreateInstance(java.lang.String type, java.util.Collection<java.lang.Object> parameters)protected ISimulinkModelElementcreateInstanceInModel(java.lang.String type)voiddeleteElement(java.lang.Object o)protected booleandeleteElementInModel(java.lang.Object instance)Returns true iff the given instance was deleted from the model.java.util.Collection<ISimulinkModelElement>findBlocks()java.util.Collection<ISimulinkModelElement>findBlocks(java.lang.Integer depth)protected java.util.Collection<ISimulinkModelElement>getAllOfKindFromModel(java.lang.String kind_)protected java.util.Collection<ISimulinkModelElement>getAllOfTypeFromModel(java.lang.String type)java.util.Collection<ISimulinkModelElement>getChildren()java.lang.ObjectgetElementById(java.lang.String id)java.lang.StringgetElementId(java.lang.Object instance)java.lang.DoublegetHandle()java.lang.StringgetLookUnderMasks()OperationContributorgetOperationContributor()SearchPreferencesgetSearchPreferences()java.lang.StringgetSimulinkModelName()java.lang.StringgetTypeNameOf(java.lang.Object instance)Returns a string representing the type of the instance object.booleanhasType(java.lang.String type)booleanisFindOptimisationEnabled()booleanisFollowLinks()booleanisIncludeCommented()booleanisInstantiable(java.lang.String type)booleanisShowInMatlabEditor()Deprecated.booleanisUseCurrentSimulinkModel()voidload(StringProperties properties, IRelativePathResolver resolver)protected voidloadModel()booleanowns(java.lang.Object instance)Used to test whether an object is contained in this model.protected voidremoveFromCache(ISimulinkModelElement instance)voidsetElementId(java.lang.Object instance, java.lang.String newId)voidsetFindOptimisationEnabled(boolean enabled)voidsetFollowLinks(boolean followLinks)If true, adds the 'Follow_Link' parameter to the 'find_system' method in MATLABvoidsetIncludeCommented(boolean includeCommented)voidsetLookUnderMasks(java.lang.String lookUnderMasks)voidsetSearchPreferences(SearchPreferences searchPreferences)voidsetShowInMatlabEditor(boolean openMatlabEditor)Deprecated.protected voidsetSimulinkModelName(java.io.File name)protected voidsetSimulinkModelName(java.lang.String name)voidsetUseCurrentSimulinkModel(boolean useCurrentSimulinkModel)voidsimulate()booleanstore()booleanstore(java.lang.String location)-
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, 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 java.lang.String PROPERTY_SHOW_IN_MATLAB_EDITOR
Deprecated.- See Also:
- Constant Field Values
-
PROPERTY_FOLLOW_LINKS
public static final java.lang.String PROPERTY_FOLLOW_LINKS
CONSTANTS- See Also:
- Constant Field Values
-
PROPERTY_LOOK_UNDER_MASKS
public static final java.lang.String PROPERTY_LOOK_UNDER_MASKS
- See Also:
- Constant Field Values
-
PROPERTY_INCLUDE_COMMENTED
public static final java.lang.String PROPERTY_INCLUDE_COMMENTED
- See Also:
- Constant Field Values
-
PROPERTY_CURRENT_SIMULINK_MODEL
public static final java.lang.String PROPERTY_CURRENT_SIMULINK_MODEL
- See Also:
- Constant Field Values
-
PROPERTY_FIND_OPTIMISATION
public static final java.lang.String PROPERTY_FIND_OPTIMISATION
- See Also:
- Constant Field Values
-
BLOCK
public static final java.lang.String BLOCK
- See Also:
- Constant Field Values
-
SIMULINK
public static final java.lang.String SIMULINK
- See Also:
- Constant Field Values
-
STATEFLOW
public static final java.lang.String STATEFLOW
- See Also:
- Constant Field Values
-
GET_PARAM
public static final java.lang.String GET_PARAM
- See Also:
- Constant Field Values
-
LOAD_SYSTEM
public static final java.lang.String LOAD_SYSTEM
- See Also:
- Constant Field Values
-
OPEN_SYSTEM
public static final java.lang.String OPEN_SYSTEM
- See Also:
- Constant Field Values
-
NEW_SYSTEM
public static final java.lang.String NEW_SYSTEM
- See Also:
- Constant Field Values
-
SAVE_SYSTEM
public static final java.lang.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 java.lang.String simulinkModelName
-
-
Method Detail
-
loadModel
protected void loadModel() throws EolModelLoadingException- Overrides:
loadModelin classAbstractSimulinkModel- Throws:
EolModelLoadingException
-
closeMatlabModel
protected void closeMatlabModel()
- Specified by:
closeMatlabModelin classAbstractSimulinkModel
-
createInstanceInModel
protected ISimulinkModelElement createInstanceInModel(java.lang.String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
- Overrides:
createInstanceInModelin classAbstractSimulinkModel- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
addToCache
protected void addToCache(java.lang.String type, ISimulinkModelElement instance) throws EolModelElementTypeNotFoundException- Overrides:
addToCachein classCachedModel<ISimulinkModelElement>- Throws:
EolModelElementTypeNotFoundException
-
removeFromCache
protected void removeFromCache(ISimulinkModelElement instance) throws EolModelElementTypeNotFoundException
- Overrides:
removeFromCachein classCachedModel<ISimulinkModelElement>- Throws:
EolModelElementTypeNotFoundException
-
deleteElement
public void deleteElement(java.lang.Object o) throws EolRuntimeException- Specified by:
deleteElementin interfaceIModel- Overrides:
deleteElementin classCachedModel<ISimulinkModelElement>- Throws:
EolRuntimeException
-
createInstance
public ISimulinkModelElement createInstance(java.lang.String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
- Specified by:
createInstancein interfaceIModel- Overrides:
createInstancein classCachedModel<ISimulinkModelElement>- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
createInstance
public java.lang.Object createInstance(java.lang.String type, java.util.Collection<java.lang.Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException- Specified by:
createInstancein interfaceIModel- Overrides:
createInstancein classModel- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
deleteElementInModel
protected boolean deleteElementInModel(java.lang.Object instance) throws EolRuntimeExceptionDescription copied from class:CachedModelReturns true iff the given instance was deleted from the model.- Specified by:
deleteElementInModelin classCachedModel<ISimulinkModelElement>- Throws:
EolRuntimeException
-
allContentsFromModel
protected java.util.Collection<ISimulinkModelElement> allContentsFromModel()
- Specified by:
allContentsFromModelin classCachedModel<ISimulinkModelElement>
-
getAllOfTypeFromModel
protected java.util.Collection<ISimulinkModelElement> getAllOfTypeFromModel(java.lang.String type) throws EolModelElementTypeNotFoundException
- Specified by:
getAllOfTypeFromModelin classCachedModel<ISimulinkModelElement>- Throws:
EolModelElementTypeNotFoundException
-
getAllOfKindFromModel
protected java.util.Collection<ISimulinkModelElement> getAllOfKindFromModel(java.lang.String kind_) throws EolModelElementTypeNotFoundException
- Specified by:
getAllOfKindFromModelin classCachedModel<ISimulinkModelElement>- Throws:
EolModelElementTypeNotFoundException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
- Specified by:
loadin interfaceIModel- Overrides:
loadin classAbstractSimulinkModel- Throws:
EolModelLoadingException
-
simulate
public void simulate() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
getTypeNameOf
public java.lang.String getTypeNameOf(java.lang.Object instance)
Description copied from interface:IModelReturns 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:
getTypeNameOfin 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 java.lang.Object getElementById(java.lang.String id)
- Specified by:
getElementByIdin interfaceIModel
-
setElementId
public void setElementId(java.lang.Object instance, java.lang.String newId)- Specified by:
setElementIdin interfaceIModel
-
getElementId
public java.lang.String getElementId(java.lang.Object instance)
- Specified by:
getElementIdin interfaceIModel
-
owns
public boolean owns(java.lang.Object instance)
Description copied from interface:IModelUsed to test whether an object is contained in this model.- Specified by:
ownsin interfaceIModel- Overrides:
ownsin classAbstractSimulinkModel- Parameters:
instance- the Java object to test.- Returns:
- true if and only if instance is contained by this model.
-
isInstantiable
public boolean isInstantiable(java.lang.String type)
- Specified by:
isInstantiablein interfaceIModel- Overrides:
isInstantiablein classAbstractSimulinkModel
-
getSimulinkModelName
public java.lang.String getSimulinkModelName()
-
setSimulinkModelName
protected void setSimulinkModelName(java.lang.String name)
-
setSimulinkModelName
protected void setSimulinkModelName(java.io.File name)
-
getOperationContributor
public OperationContributor getOperationContributor()
- Specified by:
getOperationContributorin interfaceIOperationContributorProvider
-
getHandle
public java.lang.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 java.lang.String getLookUnderMasks()
-
setLookUnderMasks
public void setLookUnderMasks(java.lang.String lookUnderMasks)
-
isIncludeCommented
public boolean isIncludeCommented()
-
setIncludeCommented
public void setIncludeCommented(boolean includeCommented)
-
isFindOptimisationEnabled
public boolean isFindOptimisationEnabled()
-
setFindOptimisationEnabled
public void setFindOptimisationEnabled(boolean enabled)
-
getChildren
public java.util.Collection<ISimulinkModelElement> getChildren() throws MatlabException
- Throws:
MatlabException
-
findBlocks
public java.util.Collection<ISimulinkModelElement> findBlocks() throws MatlabException
- Throws:
MatlabException
-
findBlocks
public java.util.Collection<ISimulinkModelElement> findBlocks(java.lang.Integer depth) throws MatlabException
- Throws:
MatlabException
-
-