Retrieve the Epsilon Simulink preferences programatically [message #1793193] |
Wed, 01 August 2018 12:27 |
Stuart Hutchesson Messages: 9 Registered: September 2011 |
Junior Member |
|
|
I am successfully running an ETL transformation from an EMF model to Simulink as an Eclipse plug-in - however I have to provide the "Library Path" and "Engine Jar Path" properties programatically at the point I load the model. I have hard-coded them in my example and it works fine.
StringProperties properties = new StringProperties();
properties.put(SimulinkModel.PROPERTY_NAME, "Simulink");
properties.put(SimulinkModel.PROPERTY_FILE, genFolder+modelName+".slx");
properties.put(SimulinkModel.PROPERTY_READONLOAD, false + "");
properties.put(SimulinkModel.PROPERTY_STOREONDISPOSAL, true + "");
properties.put(SimulinkModel.PROPERTY_SHOW_IN_MATLAB_EDITOR, true + "");
properties.put(SimulinkModel.PROPERTY_CACHED, false+"");
properties.put(SimulinkModel.PROPERTY_LIBRARY_PATH,"C:\\matlab\\2016b\\bin\\win64");
properties.put(SimulinkModel.PROPERTY_ENGINE_JAR_PATH,"C:\\matlab\\2016b\\extern\\engines\\java\\jar\\engine.jar");
try {
simulinkModel.load(properties);
} catch (EolModelLoadingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
However I have now moved to a different machine where Matlab is installed on a different path, and the model load obviously fails. Rather then providing my own Preferences Dialog to store the machine configuration I would prefer to read the "Epsilon->Simulink" preference values.
I have tried the following without success :
IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode("org.eclipse.epsilon.common.dt");
String val = preferences.get("engine_jar_path", "default");
Would it be possible to provide a code snippet that shows how to retrieve the preferences?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10194 seconds