-// /**
-// * Set a new (integer) value for a variable. If the variable is a
-// * parameter, the change is effective immediately.
-// *
-// * @param name Variable
-// * @param value New (integer) value
-// * @throws FMILException
-// */
-// public void setIntegerValue(String name, int value) throws FMILException {
-// synchronized(syncObject) {
-//
-// try {
-//
-// int ret = setIntegerValue_(getModelID(), name, value);
-// if(ret == ERROR)
-// throw new FMILException(getLastErrorMessage());
-//
-// } catch (UnsatisfiedLinkError err) {
-// throw new FMILException(UNSATISFIED_LINK);
-// } catch (Exception e) {
-// throw new FMILException(e.getMessage());
-// }
-// }
-// }
-// private native int setIntegerValue_(String id, String name, int value);
-//
-// /**
-// * Set a new (boolean) value for a variable. If the variable is a
-// * parameter, the change is effective immediately.
-// *
-// * @param name Variable
-// * @param value New (boolean) value
-// * @throws FMILException
-// */
-// public void setBooleanValue(String name, boolean value) throws FMILException {
-// synchronized(syncObject) {
-//
-// try {
-//
-// int ret = setBooleanValue_(getModelID(), name, value);
-// if(ret == ERROR)
-// throw new FMILException(getLastErrorMessage());
-//
-// } catch (UnsatisfiedLinkError err) {
-// throw new FMILException(UNSATISFIED_LINK);
-// } catch (Exception e) {
-// throw new FMILException(e.getMessage());
-// }
-// }
-// }
-// private native int setBooleanValue_(String id, String name, boolean value);
-//
-// public void setTime(double time) throws FMILException {
-// synchronized(syncObject) {
-//
-// try {
-//
-// int ret = setTime_(getModelID(), time);
-// if(ret == ERROR)
-// throw new FMILException(getLastErrorMessage());
-//
-// } catch (UnsatisfiedLinkError err) {
-// throw new FMILException(UNSATISFIED_LINK);
-// } catch (Exception e) {
-// throw new FMILException(e.getMessage());
-// }
-// }
-// }
-// private native int setTime_(String id, double time);
+
+ /**
+ * Set value of a string variable. If the variable is a
+ * parameter, the change is effective immediately.
+ *
+ * @param name Variable name
+ * @param value New value
+ * @throws FMILException
+ */
+ public void setStringValue(String name, String value) throws FMILException {
+ setStringValue(variableMap.get(name), value);
+ }
+
+ /**
+ * Set value of a string variable. If the variable is a
+ * parameter, the change is effective immediately.
+ *
+ * @param name Variable id
+ * @param value New value
+ * @throws FMILException
+ */
+ public void setStringValue(int variableReference, String value) throws FMILException {
+ synchronized(syncObject) {
+ try {
+ int ret = setStringValue_(getModelIDNew(), variableReference, value);
+ if(ret != OK)
+ LOGGER.warn("Function return value != OK, an exception should have been thrown from native code!");
+ } catch (FMILException e) {
+ throw e;
+ } catch (UnsatisfiedLinkError err) {
+ throw new FMILException(UNSATISFIED_LINK);
+ } catch (Exception e) {
+ throw new FMILException(e.getMessage());
+ }
+ }
+ }
+
+ private native int setStringValue_(int id, int variableReference, String value) throws FMILException;
+