import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import org.simantics.simulation.ui.Activator;
+import org.simantics.simulation.ui.preferences.SimulationPreferences.StepMode;
/**
public static SimulationPreferences getPrefs(IScopeContext context) {
IEclipsePreferences node = context.getNode(Activator.PLUGIN_ID);
double stepDuration = node.getDouble(SimulationPreferences.P_SIMULATION_STEP_DURATION, SimulationPreferences.DEFAULT_SIMULATION_STEP_DURATION);
+ double stepEndTime = node.getDouble(SimulationPreferences.P_SIMULATION_STEP_END_TIME, SimulationPreferences.DEFAULT_SIMULATION_STEP_END_TIME);
+ int stepMode = node.getInt(SimulationPreferences.P_SIMULATION_STEP_MODE, SimulationPreferences.DEFAULT_SIMULATION_STEP_MODE.ordinal());
- return new SimulationPreferences(node, stepDuration);
+ return new SimulationPreferences(node, stepDuration, stepEndTime, StepMode.fromInt(stepMode));
}
/**
private static IEclipsePreferences _setPrefs(IScopeContext context, SimulationPreferences prefs) {
IEclipsePreferences node = context.getNode(Activator.PLUGIN_ID);
node.putDouble(SimulationPreferences.P_SIMULATION_STEP_DURATION, prefs.stepDuration);
+ node.putDouble(SimulationPreferences.P_SIMULATION_STEP_END_TIME, prefs.stepEndTime);
+ node.putInt(SimulationPreferences.P_SIMULATION_STEP_MODE, prefs.stepMode.ordinal());
return node;
}