1 /*******************************************************************************
\r
2 * Copyright (c) 2010 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.sysdyn.ui.handlers.sensitivityAnalysis;
\r
14 import org.eclipse.core.commands.AbstractHandler;
\r
15 import org.eclipse.core.commands.ExecutionEvent;
\r
16 import org.eclipse.core.commands.ExecutionException;
\r
17 import org.simantics.simulation.experiment.IDynamicExperiment;
\r
18 import org.simantics.simulation.experiment.IExperiment;
\r
19 import org.simantics.simulation.project.IExperimentManager;
\r
20 import org.simantics.sysdyn.ui.utils.HandlerUtils;
\r
21 import org.simantics.ui.SimanticsUI;
\r
24 * Save the results of a sensitivity analysis experiment
\r
25 * @author Tuomas Miettinen
\r
28 public class SaveResultsHandler extends AbstractHandler {
\r
31 public Object execute(ExecutionEvent event) throws ExecutionException {
\r
32 // Current functionality is normal run experiment
\r
34 HandlerUtils.saveBeforeExperimentRun(event);
\r
36 IExperimentManager manager =
\r
37 SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
\r
38 IExperiment experiment = manager.getActiveExperiment();
\r
39 if(experiment instanceof IDynamicExperiment) {
\r
40 ((IDynamicExperiment)experiment).saveState();
\r