Browse Source

Added printSeparator method to PrismLog.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@4183 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 14 years ago
parent
commit
6eb375c441
  1. 8
      prism/src/prism/PrismCL.java
  2. 8
      prism/src/prism/PrismLog.java
  3. 1
      prism/src/userinterface/GUIComputationThread.java
  4. 7
      prism/src/userinterface/GUIPlugin.java
  5. 10
      prism/src/userinterface/log/GUILog.java
  6. 2
      prism/src/userinterface/model/computation/BuildModelThread.java
  7. 8
      prism/src/userinterface/properties/GUIExperiment.java
  8. 4
      prism/src/userinterface/properties/computation/ModelCheckThread.java
  9. 4
      prism/src/userinterface/properties/computation/SimulateModelCheckThread.java
  10. 3
      prism/src/userinterface/util/GUILogEvent.java

8
prism/src/prism/PrismCL.java

@ -357,7 +357,7 @@ public class PrismCL
// for simulation we can do multiple values of property constants simultaneously
if (simulate && undefinedConstants[j].getNumPropertyIterations() > 1) {
try {
mainLog.println("\n-------------------------------------------");
mainLog.printSeparator();
mainLog.println("\nSimulating: " + propertiesToCheck.get(j));
if (definedMFConstants != null)
if (definedMFConstants.getNumValues() > 0)
@ -391,7 +391,7 @@ public class PrismCL
}
// log output
mainLog.println("\n-------------------------------------------");
mainLog.printSeparator();
mainLog.println("\n" + (simulate ? "Simulating" : "Model checking") + ": " + propertiesToCheck.get(j));
if (definedMFConstants != null)
if (definedMFConstants.getNumValues() > 0)
@ -705,7 +705,7 @@ public class PrismCL
StateList states;
int i;
mainLog.println("\n-------------------------------------------");
mainLog.printSeparator();
// build model
if (!explicit) {
@ -1055,7 +1055,7 @@ public class PrismCL
// notify about any warnings
int numWarnings = mainLog.getNumberOfWarnings();
if (numWarnings > 0) {
mainLog.println("\n-------------------------------------------");
mainLog.printSeparator();
mainLog.print("\nNote: There ");
if (numWarnings == 1)
mainLog.print("was 1 warning");

8
prism/src/prism/PrismLog.java

@ -362,6 +362,14 @@ public abstract class PrismLog
println(arr);
}
/**
* Prints a separator between sections of log output.
*/
public void printSeparator()
{
println("\n---------------------------------------------------------------------");
}
/**
* Prints a warning message {@code s}, preceded by "\nWarning: " and followed by a newline character.
* <p/>

1
prism/src/userinterface/GUIComputationThread.java

@ -72,6 +72,7 @@ public class GUIComputationThread extends Thread
public void logln(short s) { plug.logln(s); }
public void logln(byte b) { plug.logln(b); }
public void logln(boolean b) { plug.logln(b); }
public void logSeparator() { plug.logSeparator(); }
public void logWarning(String s) { plug.logWarning(s); }
/** pop up an error dialog */

7
prism/src/userinterface/GUIPlugin.java

@ -543,6 +543,13 @@ public abstract class GUIPlugin extends JPanel implements GUIEventListener, Pris
gui.enableTab(this, enabled);
}
/** Method to add a separator to the log contained within the parent GUIPrism.
*/
public void logSeparator()
{
notifyEventListeners(new GUILogEvent(GUILogEvent.PRINTSEPARATOR, ""));
}
/** Method to add a warning message to the log contained within the parent GUIPrism.
* @param message The message to be added to the log
*/

10
prism/src/userinterface/log/GUILog.java

@ -114,15 +114,19 @@ public class GUILog extends GUIPlugin implements MouseListener, PrismSettingsLis
if(e instanceof GUILogEvent)
{
GUILogEvent le = (GUILogEvent)e;
if(le.getID() == le.PRINTLN)
if(le.getID() == GUILogEvent.PRINTLN)
{
theLog.println(le.getData());
}
else if(le.getID() == le.PRINT)
else if(le.getID() == GUILogEvent.PRINT)
{
theLog.print(le.getData());
}
else if(le.getID() == le.PRINTWARNING)
else if(le.getID() == GUILogEvent.PRINTSEPARATOR)
{
theLog.printSeparator();
}
else if(le.getID() == GUILogEvent.PRINTWARNING)
{
theLog.printWarning((String) le.getData());
}

2
prism/src/userinterface/model/computation/BuildModelThread.java

@ -190,7 +190,7 @@ public class BuildModelThread extends GUIComputationThread
// do build
try {
logln("\n-------------------------------------------");
logSeparator();
model = prism.buildModel(mod);
}
catch (PrismException e) {

8
prism/src/userinterface/properties/GUIExperiment.java

@ -264,7 +264,7 @@ public class GUIExperiment
// build model
try {
logln("\n-------------------------------------------");
logSeparator();
model = prism.buildModel(modulesFile);
clear = false;
} catch (PrismException e) {
@ -352,7 +352,7 @@ public class GUIExperiment
else if (useSimulation && prism.getSettings().getBoolean(PrismSettings.SIMULATOR_SIMULTANEOUS)
&& undefinedConstants.getNumPropertyIterations() > 1) {
try {
logln("\n-------------------------------------------");
logSeparator();
logln("\nSimulating: " + propertyToCheck);
if (definedMFConstants != null)
if (definedMFConstants.getNumValues() > 0)
@ -398,7 +398,7 @@ public class GUIExperiment
}
// log output
logln("\n-------------------------------------------");
logSeparator();
logln("\n" + (useSimulation ? "Simulating" : "Model checking") + ": " + propertyToCheck);
if (definedMFConstants != null)
if (definedMFConstants.getNumValues() > 0)
@ -415,7 +415,7 @@ public class GUIExperiment
modulesFileToCheck = dc.getNewModulesFile();
modulesFileToCheck.setUndefinedConstants(modulesFile.getConstantValues());
// build model
logln("\n-------------------------------------------");
logSeparator();
model = prism.buildModel(modulesFileToCheck);
clear = false;
// by construction, deadlocks can only occur from timelocks

4
prism/src/userinterface/properties/computation/ModelCheckThread.java

@ -129,7 +129,7 @@ public class ModelCheckThread extends GUIComputationThread
// Do model checking
try {
// Print info to log
logln("\n-------------------------------------------");
logSeparator();
logln("\nModel checking: " + propertiesFile.getProperty(i));
if (definedMFConstants != null)
if (definedMFConstants.getNumValues() > 0)
@ -145,7 +145,7 @@ public class ModelCheckThread extends GUIComputationThread
modulesFileToCheck = dc.getNewModulesFile();
modulesFileToCheck.setUndefinedConstants(modulesFile.getConstantValues());
// build model
logln("\n-------------------------------------------");
logSeparator();
model = prism.buildModel(modulesFileToCheck);
clear = false;
// by construction, deadlocks can only occur from timelocks

4
prism/src/userinterface/properties/computation/SimulateModelCheckThread.java

@ -114,7 +114,7 @@ public class SimulateModelCheckThread extends GUIComputationThread
try {
// display info
logln("\n-------------------------------------------");
logSeparator();
log("\nSimulating");
if (pf.getNumProperties() == 1) {
logln(": " + properties.get(0));
@ -179,7 +179,7 @@ public class SimulateModelCheckThread extends GUIComputationThread
ict.start();
// do model checking
try {
logln("\n-------------------------------------------");
logSeparator();
logln("\nSimulating" + ": " + pf.getProperty(i));
if (definedMFConstants != null)
if (definedMFConstants.getNumValues() > 0)

3
prism/src/userinterface/util/GUILogEvent.java

@ -31,7 +31,8 @@ public class GUILogEvent extends GUIEvent
{
public static final int PRINTLN = 0;
public static final int PRINT = 1;
public static final int PRINTWARNING = 2;
public static final int PRINTSEPARATOR = 2;
public static final int PRINTWARNING = 3;
/**
* Constructs an instance of <code>GUILogEvent</code> with the specified detail message.

Loading…
Cancel
Save