Bundle-Activator: org.simantics.fmu.Activator
Bundle-Vendor: Semantum Oy
Require-Bundle: org.eclipse.core.runtime,
- org.simantics.utils;bundle-version="1.1.0"
+ org.simantics.utils;bundle-version="1.1.0",
+ org.simantics;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.simantics.fmu
import org.eclipse.core.runtime.FileLocator;\r
import org.eclipse.core.runtime.Platform;\r
import org.osgi.framework.Bundle;\r
+import org.simantics.Simantics;\r
import org.simantics.utils.FileUtils;\r
\r
\r
private static int ERROR = 0;\r
private static int OK = 1;\r
private static String UNSATISFIED_LINK = "Method not found. DLL might not be loaded properly."; \r
- private static String TEMP_DIRECTORY;\r
private static String TEMP_FMU_DIRECTORY_NAME = "fmu"; \r
public static String TEMP_FMU_COMMON_DIRECTORY; \r
public static String LOCK_FILE_NAME = "fmu.lock";\r
* Static: initialize fmu temp folder\r
*/\r
static {\r
- try {\r
- // Create a temp directory marker. This shows the system temp directory.\r
- File temp = File.createTempFile("tempMarker", null);\r
- TEMP_DIRECTORY = temp.getParentFile().getAbsolutePath();\r
- // Delete the marker\r
- temp.delete();\r
-\r
- // Get common "fmu" directory in temp directory\r
- File tempCommonDir = new File(TEMP_DIRECTORY, TEMP_FMU_DIRECTORY_NAME);\r
- // If fmu is not a directory, create it\r
- if(!tempCommonDir.isDirectory()) {\r
- tempCommonDir.mkdir();\r
- }\r
- TEMP_FMU_COMMON_DIRECTORY = tempCommonDir.getAbsolutePath();\r
- } catch (IOException e) {\r
- e.printStackTrace();\r
- }\r
+ File dir = Simantics.getTemporaryDirectory(TEMP_FMU_DIRECTORY_NAME);\r
+ TEMP_FMU_COMMON_DIRECTORY = dir.getAbsolutePath(); \r
}\r
\r
\r
monitor.worked(1);\r
\r
int stepNumber = 1;\r
- while(control.getTime() < eTime && !canceled) {\r
- if(eTime - control.getTime() < stepLength)\r
- control.setStepLength(eTime - control.getTime());\r
+ while(time < eTime && !canceled) {\r
+ if(eTime - time < stepLength)\r
+ control.setStepLength(eTime - time);\r
\r
- monitor.subTask("Simulate step (time = " + control.getTime() + ")");\r
+ monitor.subTask("Simulate step (time = " + time + ")");\r
control.simulateStep();\r
monitor.worked(1);\r
\r
if(stepNumber % savePer == 0) {\r
- monitor.subTask("Get results (time = " + control.getTime() + ")");\r
+ monitor.subTask("Get results (time = " + time + ")");\r
currentValues = control.getSubscribedResults(currentValues);\r
monitor.worked(1);\r
\r
- monitor.subTask("Save results (time = " + control.getTime() + ")");\r
+ monitor.subTask("Save results (time = " + time + ")");\r
for(int k = 0; k < subscription.length; k++) {\r
SysdynGameExperiment.this.results.get(subscription[k]).add(currentValues[k]);\r
}\r
}\r
stepNumber++;\r
monitor.worked(1);\r
+ \r
+ time = control.getTime();\r
}\r
\r
monitor.subTask("Display results");\r