Commit 0b18e94e authored by Bruno Bonte's avatar Bruno Bonte
Browse files

Add a debug mode for J2KCoupling

* new jams components J2K_couplage_cowat.jar
* Adding an attribute debugMode to Coupling communicaiton
modules of jams files set to "true"
* -> effect: if set to true, jams keep listening for One hour
instead of 2 minutes which allows to start and stop simulation at will
parent ef530bb3
No related merge requests found
Showing with 14 additions and 2 deletions
+14 -2
...@@ -196,6 +196,7 @@ ...@@ -196,6 +196,7 @@
<var attribute="HRUS" context="J2K_RHONE" name="hrus"/> <var attribute="HRUS" context="J2K_RHONE" name="hrus"/>
<var attribute="time" context="J2K_RHONE" name="time"/> <var attribute="time" context="J2K_RHONE" name="time"/>
<var attribute="Runoff" context="TimeLoop" name="catchmentSimRunoff"/> <var attribute="Runoff" context="TimeLoop" name="catchmentSimRunoff"/>
<var name="debugMode" value="true"/>
</component> </component>
<component class="jams.components.gui.JAMSExecInfo" enabled="true" name="JAMSExecInfo" version="1.1_0"/> <component class="jams.components.gui.JAMSExecInfo" enabled="true" name="JAMSExecInfo" version="1.1_0"/>
<component class="org.unijena.j2k.DoubleSetter" enabled="true" name="DoubleSetter" version="1.0_0"> <component class="org.unijena.j2k.DoubleSetter" enabled="true" name="DoubleSetter" version="1.0_0">
......
...@@ -104,6 +104,12 @@ public class CouplingCommunication extends JAMSComponent { ...@@ -104,6 +104,12 @@ public class CouplingCommunication extends JAMSComponent {
) )
public Attribute.Double catchmentSimRunoff; public Attribute.Double catchmentSimRunoff;
@JAMSVarDescription(
access = JAMSVarDescription.AccessType.READ,
description = "Tell if we run in debug mode (no timeout)"
)
public Attribute.Boolean debugMode;
public void init() { public void init() {
singleton = this; singleton = this;
//double t = 1; //double t = 1;
...@@ -919,8 +925,13 @@ public class CouplingCommunication extends JAMSComponent { ...@@ -919,8 +925,13 @@ public class CouplingCommunication extends JAMSComponent {
client.close(); // Close the socket itself client.close(); // Close the socket itself
// launch timeout // launch timeout
startTimeout(120); System.err.println("debug mode is: " + debugMode.getValue() + "\n");
if (debugMode.getValue() == true)
{
startTimeout(3600);
} else {
startTimeout(120);
}
} // Now loop again, waiting for the next connection } // Now loop again, waiting for the next connection
} // If anything goes wrong, print an error message } // If anything goes wrong, print an error message
catch (Exception e) { catch (Exception e) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment