Author: chatellier Date: 2010-01-22 12:49:25 +0000 (Fri, 22 Jan 2010) New Revision: 2929 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java Log: Restore simulation control auto save features (usefull for remote simulation monitoring) Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2010-01-22 10:20:57 UTC (rev 2928) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2010-01-22 12:49:25 UTC (rev 2929) @@ -1,5 +1,5 @@ /* *##% - * Copyright (C) 2002 - 2009 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin + * Copyright (C) 2002 - 2010 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -58,7 +58,11 @@ protected long progress = 0; protected String text = ""; + /** Control save mecanism each time a property is changed (default to false). */ + protected transient boolean autoSaveState = false; + /** + * Init simulation control with simulation id. * * @param id simulation id */ @@ -68,6 +72,26 @@ } /** + * Change auto save state on property change. + * + * Usefull to disable autosave in simulation monitoring. + * + * @param autoSaveState new state + */ + public void setAutoSaveState(boolean autoSaveState) { + this.autoSaveState = autoSaveState; + } + + /** + * Get current auto save state. + * + * @return auto save state + */ + public boolean isAutoSaveState() { + return autoSaveState; + } + + /** * Reset control values for job restart. */ public void reset() { @@ -347,7 +371,7 @@ */ public void propertyChange(PropertyChangeEvent e) { if (!inUpdateFromProperties) { - if (getSimulation() != null) { + if (isAutoSaveState() && getSimulation() != null) { getSimulation().saveControl(this); } }