Small fixes

Added a 20 minute range to scrollers (common in some duty cycled data)
Fixed issue 194 of Source dialog crashing in Noise Monitor due to null pointer before first selection of a datablock.
Fixed issue 195: resetting of scrollers when datamap changes
This commit is contained in:
Douglas Gillespie 2025-02-14 14:38:14 +00:00
parent 8d392c18a9
commit f476a56bda
6 changed files with 25 additions and 7 deletions

View File

@ -22,5 +22,5 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=21

View File

@ -234,6 +234,9 @@ public class SourcePanel implements ActionListener{
if (channelBoxes == null) return;
int channels = 0;
PamDataBlock sb = getSource();
if (sb == null) {
return;
}
String chanOrSeqString = "Channel ";
channelListHeader.setText("Channel list ...");
@ -491,7 +494,11 @@ public class SourcePanel implements ActionListener{
* @param channelList bitmap of currently selected channels
*/
public void setChannelList(int channelList) {
var availableChannels = getSource().getSequenceMap();
PamDataBlock source = getSource();
if (source == null) {
return;
}
var availableChannels = source.getSequenceMap();
var toSelect = channelList & availableChannels;
if (toSelect != channelList) {

View File

@ -46,7 +46,7 @@ public class LoadOptionsDialog extends PamDialog {
private AbstractScrollManager scrollManager;
private long[] standardLoadTimes = {1000, 2000, 5000, 10000, 30000, 60*1000, 2*60*1000,
5*60*1000, 10*60*1000, 15*60*1000, 30*60*1000, 3600*1000, 3600*2*1000, 3600*6*1000,
5*60*1000, 10*60*1000, 15*60*1000, 20*60*1000, 30*60*1000, 3600*1000, 3600*2*1000, 3600*6*1000,
3600*12*1000, 3600*24*1000, 2*3600*24*1000, 7*3600*24*1000, 14L*3600L*24L*1000L, 30L*3600L*24L*1000L,
60L*3600L*24L*1000L, 365L*3600L*24L*1000L};

View File

@ -12,6 +12,11 @@ public class PamScrollerData implements Serializable, Cloneable {
*/
protected String name;
public PamScrollerData() {
super();
// TODO Auto-generated constructor stub
}
/**
* @return the name
*/

View File

@ -32,7 +32,7 @@ public class ViewerScrollerManager extends AbstractScrollManager implements PamS
private boolean initialisationComplete;
private boolean intialiseLoadDone;
private boolean intialiseLoadDone = false;
private StoredScrollerData oldScrollerData = new StoredScrollerData();
@ -542,12 +542,17 @@ public class ViewerScrollerManager extends AbstractScrollManager implements PamS
initialisationComplete = true;
break;
case PamControllerInterface.INITIALIZE_LOADDATA:
intialiseLoadDone = true;
case PamControllerInterface.CHANGED_OFFLINE_DATASTORE:
case PamControllerInterface.ADD_CONTROLLEDUNIT:
case PamControllerInterface.REMOVE_CONTROLLEDUNIT:
if (initialisationComplete && intialiseLoadDone) {
if (initialisationComplete && intialiseLoadDone == false) {
/*
* changed 20240114 so that this is only called once. Stops it
* from resetting every time the datamap is updated e.g. if the
* acquisition file map changes when user selects correct folder.
*/
initialiseScrollers();
intialiseLoadDone = true;
}
break;
}

View File

@ -405,7 +405,8 @@ public class Pamguard {
// System.out.println("Revision " + PamguardVersionInfo.getRevision());
System.out.println("Build Date " + PamguardVersionInfo.date);
writePropertyString("user.dir");
writePropertyString("java.home");
writePropertyString("user.home"); // where launched from.
writePropertyString("java.home"); // something in users, e.g. users/dg50
writePropertyString("java.name");
String javaV = writePropertyString("java.version");
writePropertyString("java.vendor");