org.eclipse.ui;bundle-version="3.5.0",
org.eclipse.core.runtime;bundle-version="3.5.0",
org.simantics.objmap;bundle-version="0.1.0",
- org.simantics.sysdyn;bundle-version="1.0.0"
+ org.simantics.sysdyn;bundle-version="1.0.0",
+ org.simantics.project;bundle-version="1.0.0"
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<adapters>\r
+ <target\r
+ interface="org.simantics.project.features.IProjectFeature">\r
+ <resource\r
+ uri="http://www.simantics.org/Sysdyn#SysdynProject"\r
+ class="org.simantics.sysdyn.ui.project.SysdynProject" />\r
+ </target>\r
+</adapters>
\ No newline at end of file
restorable="true">\r
</view>\r
</extension>\r
+ <extension\r
+ point="org.eclipse.ui.perspectives">\r
+ <perspective\r
+ class="org.simantics.sysdyn.ui.project.SysdynPerspectiveFactory"\r
+ id="org.simantics.sysdyn.ui.perspective"\r
+ name="System dynamics">\r
+ </perspective>\r
+ </extension>\r
\r
</plugin>\r
public void run(ReadGraph g) throws DatabaseException {\r
SysdynResource sr = SysdynResource.getInstance(g);\r
Builtins b = g.getBuiltins();\r
- if(g.isInstanceOf(resource, sr.Auxiliary)) {\r
+ if(g.isInstanceOf(resource, sr.Auxiliary) || g.isInstanceOf(resource, sr.Valve)) {\r
auxiliary = resource;\r
final String name = g.getRelatedValue(resource, b.HasName);\r
final String value = g.getPossibleRelatedValue(resource, sr.HasValue);\r
else\r
originalText = value;\r
text.setText(originalText);\r
- setPartName(name + " equation");\r
+ setPartName("Value of " + name);\r
+ }\r
+ \r
+ });\r
+ }\r
+ else if(g.isInstanceOf(resource, sr.Stock)) {\r
+ auxiliary = resource;\r
+ final String name = g.getRelatedValue(resource, b.HasName);\r
+ final String value = g.getPossibleRelatedValue(resource, sr.HasValue);\r
+ text.getDisplay().asyncExec(new Runnable() {\r
+\r
+ @Override\r
+ public void run() {\r
+ if(value == null)\r
+ originalText = "";\r
+ else\r
+ originalText = value;\r
+ text.setText(originalText);\r
+ setPartName("Initial value of " + name);\r
}\r
\r
});\r
--- /dev/null
+package org.simantics.sysdyn.ui.project;\r
+\r
+import org.eclipse.ui.IFolderLayout;\r
+import org.eclipse.ui.IPageLayout;\r
+import org.eclipse.ui.IPerspectiveFactory;\r
+\r
+public class SysdynPerspectiveFactory implements IPerspectiveFactory {\r
+\r
+ @Override\r
+ public void createInitialLayout(IPageLayout layout) {\r
+ layout.setEditorAreaVisible(true);\r
+ String editorArea = layout.getEditorArea();\r
+\r
+ IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.25f, editorArea);\r
+ left.addView("org.simantics.ode.views.ontologyBrowser");\r
+ \r
+ IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.75f, editorArea);\r
+ bottom.addView("org.simantics.sysdyn.ui.equation.view");\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.project;\r
+\r
+import org.simantics.project.ProjectKeys;\r
+import org.simantics.project.exception.ProjectException;\r
+import org.simantics.project.features.AbstractProjectFeature;\r
+\r
+public class SysdynProject extends AbstractProjectFeature {\r
+ private static final String DEFAULT_PERSPECTIVE = "org.simantics.sysdyn.ui.perspective";\r
+ \r
+ @Override\r
+ public void configure() throws ProjectException {\r
+ addToCollectionHint(ProjectKeys.PERSPECTIVES, DEFAULT_PERSPECTIVE);\r
+ addToCollectionHint(ProjectKeys.OPEN_PERSPECTIVES, DEFAULT_PERSPECTIVE);\r
+ getProjectElement().setHint(ProjectKeys.DEFAULT_PERSPECTIVE, DEFAULT_PERSPECTIVE);\r
+ }\r
+\r
+ @Override\r
+ public void deconfigure() throws ProjectException {\r
+ }\r
+\r
+}\r
public final Resource IsHeadOf;\r
public final Resource IsTailOf;\r
public final Resource Stock;\r
- public final Resource TestConfiguration;\r
+ public final Resource SysdynProject;\r
public final Resource Valve;\r
public final Resource Variable;\r
\r
public static final String IsHeadOf = "http://www.simantics.org/Sysdyn#IsHeadOf";\r
public static final String IsTailOf = "http://www.simantics.org/Sysdyn#IsTailOf";\r
public static final String Stock = "http://www.simantics.org/Sysdyn#Stock";\r
- public static final String TestConfiguration = "http://www.simantics.org/Sysdyn#TestConfiguration";\r
+ public static final String SysdynProject = "http://www.simantics.org/Sysdyn#SysdynProject";\r
public static final String Valve = "http://www.simantics.org/Sysdyn#Valve";\r
public static final String Variable = "http://www.simantics.org/Sysdyn#Variable";\r
}\r
IsHeadOf = getResourceOrNull(graph, URIs.IsHeadOf);\r
IsTailOf = getResourceOrNull(graph, URIs.IsTailOf);\r
Stock = getResourceOrNull(graph, URIs.Stock);\r
- TestConfiguration = getResourceOrNull(graph, URIs.TestConfiguration);\r
+ SysdynProject = getResourceOrNull(graph, URIs.SysdynProject);\r
Valve = getResourceOrNull(graph, URIs.Valve);\r
Variable = getResourceOrNull(graph, URIs.Variable);\r
}\r
-copy=org/simantics/sysdyn=../org.simantics.sysdyn.ui/src\r
+copy=org/simantics/sysdyn=../org.simantics.sysdyn/src\r
%import "layer0.graph" L0\r
%import "structural2.graph" ST\r
+%import "project.graph" PROJ\r
\r
%deflib L0.Type Sysdyn\r
%deflib L0.Relation Sysdyn\r
######################################################################\r
\r
Sysdyn @ "Sysdyn-1.0" : L0.Ontology\r
- L0.PartOf L0.TypeSystemProject\r
- L0.PartOf L0.SimanticsDomain\r
- L0.HasNamespace "http://www.simantics.org/Sysdyn" : L0.URI\r
- L0.HasVersion "1.0" : L0.Version\r
- L0.HasResourceClass "org.simantics.sysdyn.SysdynResource" : L0.String\r
- L0.HasPackageName "sysdyn" : L0.String \r
+ L0.PartOf L0.TypeSystemProject\r
+ L0.PartOf L0.SimanticsDomain\r
+ L0.HasNamespace "http://www.simantics.org/Sysdyn" : L0.URI\r
+ L0.HasVersion "1.0" : L0.Version\r
+ L0.HasResourceClass "org.simantics.sysdyn.SysdynResource" : L0.String\r
+ L0.HasPackageName "sysdyn" : L0.String \r
SysdynNamespace : L0.Namespace\r
- L0.PartOf L0.TypeSystemNamespaces\r
- L0.HasNamespace "http://www.simantics.org/Sysdyn" : L0.URI\r
- L0.HasNamespaceRoot Sysdyn\r
+ L0.PartOf L0.TypeSystemNamespaces\r
+ L0.HasNamespace "http://www.simantics.org/Sysdyn" : L0.URI\r
+ L0.HasNamespaceRoot Sysdyn\r
\r
+SysdynProject : PROJ.Feature\r
+ L0.PartOf Sysdyn\r
+ L0.PartOf PROJ.PublishedProjectFeatures\r
+ \r
+SysdynTest : PROJ.Project2\r
+ PROJ.HasFeature SysdynProject \r
+ L0.PartOf L0.Projects \r
+ \r
######################################################################\r
# Configuration\r
######################################################################\r
######################################################################\r
\r
TestConfiguration : Configuration\r
- L0.PartOf Sysdyn \r
- L0.ConsistsOf\r
- Foo : Auxiliary\r
- HasX "200.0" : L0.Double\r
- HasY "100.0" : L0.Double\r
- Bar : Auxiliary\r
- HasX "100.0" : L0.Double\r
- HasY "200.0" : L0.Double\r
- _ : Dependency\r
- HasTail Foo\r
- HasHead Bar\r
- HasAngle "0.5" : L0.Double\r
+ L0.PartOf SysdynTest\r
\r
\r
\r