From 0e96d72d8eefb4956e2ecf1ebe45b4d3c4a7df7a Mon Sep 17 00:00:00 2001 From: lempinen Date: Tue, 5 Mar 2013 13:19:36 +0000 Subject: [PATCH] Version updates to plugins (refs #3646) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches@27008 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../META-INF/MANIFEST.MF | 2 +- .../FMUSimulator/src/fmu_control.cpp | 37 +++++++++++++------ .../org.simantics.fmu/META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../org.simantics.sysdyn.feature/feature.xml | 8 +++- .../META-INF/MANIFEST.MF | 2 +- .../org.simantics.sysdyn.ui/sysdyn.product | 17 +++++++-- .../org.simantics.sysdyn/META-INF/MANIFEST.MF | 2 +- 8 files changed, 50 insertions(+), 22 deletions(-) diff --git a/simantics-1.9/org.simantics.fmu.me.win32/META-INF/MANIFEST.MF b/simantics-1.9/org.simantics.fmu.me.win32/META-INF/MANIFEST.MF index 79b713ee..a08acbbf 100644 --- a/simantics-1.9/org.simantics.fmu.me.win32/META-INF/MANIFEST.MF +++ b/simantics-1.9/org.simantics.fmu.me.win32/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Win32 binaries for FMI model exchange Bundle-SymbolicName: org.simantics.fmu.me.win32 -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-Vendor: Semantum Oy Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", diff --git a/simantics-1.9/org.simantics.fmu/FMUSolution/FMUSimulator/src/fmu_control.cpp b/simantics-1.9/org.simantics.fmu/FMUSolution/FMUSimulator/src/fmu_control.cpp index 43a1be98..67ddd478 100644 --- a/simantics-1.9/org.simantics.fmu/FMUSolution/FMUSimulator/src/fmu_control.cpp +++ b/simantics-1.9/org.simantics.fmu/FMUSolution/FMUSimulator/src/fmu_control.cpp @@ -59,8 +59,9 @@ struct FMUControlStruct { bool initialized; // has the fmu been initialized - vector subscription; // result subscriptions + vector subscription; // result subscriptions vector allVariables; // all variables in an initialized model + vector fmiValueReferences; // all value references string lastErrorMessage; @@ -127,10 +128,19 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmu_FMUControlJNI_loadFMUFile_1 FMUControlStruct& fmuStruct = fmus[fmuId]; // Extract fmu from fmuPath to fmuTempDir and load it to fmuStruct.fmu int ret = loadFMU(&fmuStruct.fmu, fmuPath, fmuTempDir); - if(fmuStruct.fmu.modelDescription != NULL) + if(fmuStruct.fmu.modelDescription != NULL) { fmuStruct.vars = fmuStruct.fmu.modelDescription->modelVariables; - else + + fmuStruct.fmiValueReferences.clear(); + + int i; + for (i=0; fmuStruct.vars[i]; i++) { + fmuStruct.fmiValueReferences.push_back(getValueReference(fmuStruct.vars[i])); + } + + } else { fmuStruct.vars = NULL; + } if(module != NULL) { /* @@ -209,7 +219,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmu_FMUControlJNI_subscribe_1 if(it != fmuStruct.indexes.end()) { // Found the subscribed element - fmuStruct.subscription.push_back(fmuStruct.indexes[name]); + fmuStruct.subscription.push_back(fmuStruct.fmiValueReferences[fmuStruct.indexes[name]]); } else { // Element not found, use index -1 fmuStruct.subscription.push_back(-1); @@ -225,10 +235,6 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmu_FMUControlJNI_subscribe_1 } } -fmiValueReference getReference(ScalarVariable **vars, int index) { - return getValueReference(vars[index]); -} - bool referenceExists(FMUControlStruct fmuStruct, string variable) { map::iterator it = fmuStruct.indexes.find(variable); if(it != fmuStruct.indexes.end()) { @@ -240,7 +246,7 @@ bool referenceExists(FMUControlStruct fmuStruct, string variable) { // Remember to check if reference exists fmiValueReference getReference(FMUControlStruct fmuStruct, string variable) { - return getReference(fmuStruct.vars, fmuStruct.indexes[variable]); + return fmuStruct.fmiValueReferences[fmuStruct.indexes[variable]]; } // Get string representation of a scalar variable type @@ -418,8 +424,9 @@ JNIEXPORT jdouble JNICALL Java_org_simantics_fmu_FMUControlJNI_getTime_1 } } -double getRealValue(FMUControlStruct fmuStruct, ScalarVariable *sv) { - fmiValueReference vr = getValueReference(sv); +double getRealValue(FMUControlStruct fmuStruct, int index) { + ScalarVariable *sv = fmuStruct.vars[index]; + fmiValueReference vr = fmuStruct.fmiValueReferences[index]; double real; fmiInteger integer; fmiBoolean fmibool; @@ -455,6 +462,8 @@ JNIEXPORT jdoubleArray JNICALL Java_org_simantics_fmu_FMUControlJNI_getSubscribe jboolean isCopy; jdouble* resultElements = env -> GetDoubleArrayElements(result, &isCopy); jsize n = env -> GetArrayLength(result); + + /* int i; for (i = 0; i < n; i++) { if(fmuStruct.subscription.empty() || fmuStruct.fmu.modelDescription == NULL) { @@ -465,9 +474,13 @@ JNIEXPORT jdoubleArray JNICALL Java_org_simantics_fmu_FMUControlJNI_getSubscribe resultElements[i] = 0; } else { // Get value - resultElements[i] = getRealValue(fmuStruct, fmuStruct.vars[fmuStruct.subscription[i]]); + resultElements[i] = getRealValue(fmuStruct, fmuStruct.subscription[i]); } } + */ + + fmuStruct.fmu.getReal(fmuStruct.c, &fmuStruct.subscription[0], n, resultElements); + if (isCopy == JNI_TRUE) { env -> ReleaseDoubleArrayElements(result, resultElements, 0); } diff --git a/simantics-1.9/org.simantics.fmu/META-INF/MANIFEST.MF b/simantics-1.9/org.simantics.fmu/META-INF/MANIFEST.MF index e40cac95..525a0185 100644 --- a/simantics-1.9/org.simantics.fmu/META-INF/MANIFEST.MF +++ b/simantics-1.9/org.simantics.fmu/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: FMU Simulator Bundle-SymbolicName: org.simantics.fmu -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-Activator: org.simantics.fmu.Activator Bundle-Vendor: Semantum Oy Require-Bundle: org.eclipse.core.runtime, diff --git a/simantics-1.9/org.simantics.modelica/META-INF/MANIFEST.MF b/simantics-1.9/org.simantics.modelica/META-INF/MANIFEST.MF index 88a27ec5..48ba713d 100644 --- a/simantics-1.9/org.simantics.modelica/META-INF/MANIFEST.MF +++ b/simantics-1.9/org.simantics.modelica/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Modelica Bundle-SymbolicName: org.simantics.modelica;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: gnu.trove2;bundle-version="2.0.4", org.eclipse.osgi;bundle-version="3.6.0", diff --git a/simantics-1.9/org.simantics.sysdyn.feature/feature.xml b/simantics-1.9/org.simantics.sysdyn.feature/feature.xml index 855e54a1..52528821 100644 --- a/simantics-1.9/org.simantics.sysdyn.feature/feature.xml +++ b/simantics-1.9/org.simantics.sysdyn.feature/feature.xml @@ -13,7 +13,7 @@ @@ -55,7 +55,11 @@ - + - + + + + + Simantics system dynamics + +Version 1.7.0 + +Copyright (c) 2013 Association for Decentralized Information Management in Industry THTH ry. + + - -fixerrors + -fixerrors --launcher.XXMaxPermSize 192m -ea -Xmx768M -XX:MaxPermSize=192m -Xshare:off -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts @@ -24,6 +34,7 @@ + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6 @@ -108,7 +119,7 @@ This Agreement is governed by the laws of the State of New York and the intellec - + diff --git a/simantics-1.9/org.simantics.sysdyn/META-INF/MANIFEST.MF b/simantics-1.9/org.simantics.sysdyn/META-INF/MANIFEST.MF index 640aac4b..8e6fd2e3 100644 --- a/simantics-1.9/org.simantics.sysdyn/META-INF/MANIFEST.MF +++ b/simantics-1.9/org.simantics.sysdyn/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Simantics System Dynamics Bundle-SymbolicName: org.simantics.sysdyn;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.7.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.simantics.objmap;bundle-version="0.1.0", org.simantics.db;bundle-version="0.6.2", -- 2.47.1