opt to easily turn off restart debug output

This commit is contained in:
Douglas Gillespie 2024-03-07 11:24:20 +00:00
parent 48c5387291
commit c64fa8fe9d
2 changed files with 22 additions and 10 deletions

View File

@ -195,6 +195,8 @@ public class PamController implements PamControllerInterface, PamSettings {
private static PamController uniqueController;
private Timer diagnosticTimer;
private boolean debugDumpBufferAtRestart = false;
private NetworkController networkController;
private int nNetPrepared;
@ -1263,7 +1265,7 @@ public class PamController implements PamControllerInterface, PamSettings {
saveSettings(PamCalendar.getSessionStartTime());
}
if (++nStarts > 1) {
if (++nStarts > 1 && debugDumpBufferAtRestart) {
// do this here - all processses should have reset buffers to start again by now.
String msg = String.format("Starting PAMGuard go %d", nStarts);
dumpBufferStatus(msg, false);
@ -1382,7 +1384,8 @@ public class PamController implements PamControllerInterface, PamSettings {
* @param sayEmpties dump info even if a buffer is empty (otherwise, only ones that have stuff still)
*/
public void dumpBufferStatus(String message, boolean sayEmpties) {
//if (2 >1) return;
if (debugDumpBufferAtRestart == false) return;
System.out.println("**** Dumping process buffer status: " + message);
ArrayList<PamControlledUnit> pamControlledUnits = pamConfiguration.getPamControlledUnits();
for (PamControlledUnit aUnit : pamControlledUnits) {
@ -2066,8 +2069,10 @@ public class PamController implements PamControllerInterface, PamSettings {
/*
* This only get's called once when set idle at viewer mode startup.
*/
System.out.printf("******* PamController.setPamStatus to %d, real status is %d set in thread %s\n",
pamStatus, getRealStatus(), Thread.currentThread().toString());
if (debugDumpBufferAtRestart) {
System.out.printf("******* PamController.setPamStatus to %d, real status is %d set in thread %s\n",
pamStatus, getRealStatus(), Thread.currentThread().toString());
}
if (getRunMode() != RUN_PAMVIEW) {
TopToolBar.enableStartButton(pamStatus == PAM_IDLE);
TopToolBar.enableStopButton(pamStatus == PAM_RUNNING);

View File

@ -23,6 +23,7 @@ package PamModel;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
@ -1212,13 +1213,15 @@ final public class PamModel implements PamSettings {
if (intf[j].getName().equals("PamModel.PamPluginInterface")) {
// create an instance of the interface class.
PamPluginInterface pf = (PamPluginInterface) c.newInstance();
Constructor constructor = c.getDeclaredConstructor(null);
PamPluginInterface pf = (PamPluginInterface) constructor.newInstance(null);
if (getPluginBeingLoaded()==null) {
continue;
}
// Let the user know which valid plugins have been found
System.out.println(" Creating instance of " + pf.getDefaultName() + ": " + pf.getClassName());
System.out.printf(" Loading plugin interface for %s : %s version %s\n",
pf.getDefaultName(), pf.getClassName(), pf.getVersion());
if (getPluginBeingLoaded()==null) {
continue;
}
@ -1234,7 +1237,7 @@ final public class PamModel implements PamSettings {
pluginList.add(pf); // add it to the list
} else {
System.out.println(" Error: "+pf.getDefaultName()+" cannot run in this mode. Skipping module.");
System.out.println(" Error: " + pf.getDefaultName()+" cannot run in this mode. Skipping module.");
}
if (getPluginBeingLoaded()==null) {
continue;
@ -1243,12 +1246,16 @@ final public class PamModel implements PamSettings {
// now check for interfaces that implement DaqSystemInterface
if (intf[j].getName().equals("Acquisition.DaqSystemInterface")) {
DaqSystemInterface pf = (DaqSystemInterface) c.newInstance(); // create an instance of the interface class
Constructor constructor = c.getDeclaredConstructor(null);
DaqSystemInterface pf = (DaqSystemInterface) constructor.newInstance(null);
// DaqSystemInterface pf = (DaqSystemInterface) c.newInstance(); // create an instance of the interface class
if (getPluginBeingLoaded()==null) {
continue;
}
System.out.println(" Creating instance of " + pf.getDefaultName() + ": " + className);
System.out.printf(" Loading daq plugin interface for %s version %s\n",
pf.getDefaultName(), pf.getVersion());
// System.out.println(" Creating instance of " + pf.getDefaultName() + ": " + className);
if (getPluginBeingLoaded()==null) {
continue;
}