]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Start and stop times for simulation
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 16 Feb 2010 13:22:51 +0000 (13:22 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 16 Feb 2010 13:22:51 +0000 (13:22 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14151 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java
org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Configuration.java

index d61054222036e3262b40ab9cfc1f0dd1d7e9f6b5..9cf036a70238c1e738130a3530bfedd64e5ba6c2 100644 (file)
@@ -65,6 +65,8 @@ public class SysdynProject extends AbstractProjectFeature {
                 g.claimValue(model, b.HasName, GraphUtils.findFreshName(g, "Configuration", library));\r
                 g.claim(model, b.InstanceOf, sr.Configuration);\r
                 g.claim(model, b.PartOf, library);\r
+                g.claimValue(model, sr.HasStartTime, 0.0);\r
+                g.claimValue(model, sr.HasStopTime, 10.0);\r
 \r
             } catch(Exception e) {\r
                 errorCallback.run(e);\r
index e05b06da416c8bc77ab5eb7a7cc8283efead3eae..da13092196ca0f4cad5ee2be131eca14fbae7c08 100644 (file)
@@ -32,6 +32,8 @@ public class SysdynResource {
     public final Resource HasHead;\r
     public final Resource HasInitialEquation;\r
     public final Resource HasLookup;\r
+    public final Resource HasStartTime;\r
+    public final Resource HasStopTime;\r
     public final Resource HasTail;\r
     public final Resource HasType;\r
     public final Resource HasUnit;\r
@@ -65,6 +67,8 @@ public class SysdynResource {
         public static final String HasHead = "http://www.simantics.org/Sysdyn#HasHead";\r
         public static final String HasInitialEquation = "http://www.simantics.org/Sysdyn#HasInitialEquation";\r
         public static final String HasLookup = "http://www.simantics.org/Sysdyn#HasLookup";\r
+        public static final String HasStartTime = "http://www.simantics.org/Sysdyn#HasStartTime";\r
+        public static final String HasStopTime = "http://www.simantics.org/Sysdyn#HasStopTime";\r
         public static final String HasTail = "http://www.simantics.org/Sysdyn#HasTail";\r
         public static final String HasType = "http://www.simantics.org/Sysdyn#HasType";\r
         public static final String HasUnit = "http://www.simantics.org/Sysdyn#HasUnit";\r
@@ -108,6 +112,8 @@ public class SysdynResource {
         HasHead = getResourceOrNull(graph, URIs.HasHead);\r
         HasInitialEquation = getResourceOrNull(graph, URIs.HasInitialEquation);\r
         HasLookup = getResourceOrNull(graph, URIs.HasLookup);\r
+        HasStartTime = getResourceOrNull(graph, URIs.HasStartTime);\r
+        HasStopTime = getResourceOrNull(graph, URIs.HasStopTime);\r
         HasTail = getResourceOrNull(graph, URIs.HasTail);\r
         HasType = getResourceOrNull(graph, URIs.HasType);\r
         HasUnit = getResourceOrNull(graph, URIs.HasUnit);\r
index c591b12cb8c4575d385570d9d5783abd7d42eced..e1eca4306b2515ee13183f3fdbe88c22e0d982dc 100644 (file)
@@ -70,7 +70,9 @@ public class SysdynModel implements IMappingListener {
             \r
             result = ModelicaManager.runModelica(\r
                     configuration.name,\r
-                    writer.toString());            \r
+                    writer.toString(),\r
+                    configuration.startTime,\r
+                    configuration.stopTime);            \r
         } catch(Exception e) {\r
             e.printStackTrace();\r
             result = null;\r
index d2213134e450b15c84fb7f3e83d90b3498f70172..8fef48c351475e97f91b3fe9cc8ba95dd7b61c39 100644 (file)
@@ -14,6 +14,12 @@ public class Configuration {
     @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName")\r
     public String name = "Unnamed";\r
     \r
+    @RelatedValue("http://www.simantics.org/Sysdyn#HasStartTime")\r
+    public Double startTime = 0.0;\r
+    \r
+    @RelatedValue("http://www.simantics.org/Sysdyn#HasStopTime")\r
+    public Double stopTime = 10.0;\r
+    \r
     @RelatedElements(\r
          value = "http://www.vtt.fi/Simantics/Layer0/1.0/Relations#ConsistsOf",\r
          composition = true)\r