mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2025-05-13 10:07:47 +00:00
Tidy data mapping
Stop DAQ doing two datamaps at once in Viewer mode. Ensure that all notify messages are in AWT thread to try to reduce lockup.
This commit is contained in:
parent
514b398a10
commit
3a799486b1
src
Acquisition
PamController
PamUtils/worker
dataMap
pamScrollSystem
@ -50,7 +50,7 @@ public class AcquisitionParameters implements Serializable, Cloneable, ManagedPa
|
||||
|
||||
private PPSParameters ppsParameters;
|
||||
|
||||
public boolean subtractDC;
|
||||
public boolean subtractDC = true;
|
||||
|
||||
public double dcTimeConstant; // time constant for DC subtraction in seconds.
|
||||
|
||||
|
@ -380,6 +380,14 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
* @return flag to indicate...nothing?
|
||||
*/
|
||||
public int makeSelFileList() {
|
||||
|
||||
/**
|
||||
* This is only for real time operation. In Viewer mode, the list is entirely
|
||||
* handled in the OfflinefileServer object.
|
||||
*/
|
||||
if (acquisitionControl.isViewer()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
String[] selection = checkComandLineFolder();
|
||||
|
||||
@ -409,6 +417,9 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
// String folderName = fileInputParameters.recentFiles.get(0);
|
||||
|
||||
//Swing calls a dialog with progress bar from the wavListWorker
|
||||
if (acquisitionControl.isViewer()) {
|
||||
return 0;
|
||||
}
|
||||
wavListStart = System.currentTimeMillis();
|
||||
|
||||
if (folderInputPane==null) {
|
||||
|
@ -45,7 +45,7 @@ public class SUDFileTime {
|
||||
// return Long.MIN_VALUE;
|
||||
// }
|
||||
// long t = sudMap.getFirstChunkTimeMillis();
|
||||
System.out.println("Error getting time from SUD file: " + file==null? null : (file.getName() + " size: " + file.length() / (1024 * 1024) + " MB"));
|
||||
// System.out.println("Getting time from SUD file: " + file==null? null : (file.getName() + " size: " + file.length() / (1024 * 1024) + " MB"));
|
||||
|
||||
long t = SudAudioInputStream.quickFileTime(file);
|
||||
t=t/1000; //turn to milliseconds.
|
||||
|
@ -2030,6 +2030,13 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
@Override
|
||||
public void notifyModelChanged(int changeType) {
|
||||
|
||||
// see what thread the message is arriving on
|
||||
Thread currentThread = Thread.currentThread();
|
||||
Boolean isEvDT = SwingUtilities.isEventDispatchThread();
|
||||
if (isEvDT == false) {
|
||||
System.out.printf("***** notify %d on thread %s is EventDispatch = %s\n", changeType, currentThread.getName(), isEvDT.toString());
|
||||
}
|
||||
|
||||
// System.out.println("PamController: notify model changed: " +changeType );
|
||||
if (changeType == CHANGED_MULTI_THREADING) {
|
||||
changedThreading();
|
||||
|
@ -111,4 +111,9 @@ public class PamWorkDialog extends PamDialog {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean visible) {
|
||||
super.setVisible(visible);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -154,13 +154,16 @@ public class DataMapControl extends PamControlledUnit implements PamSettings {
|
||||
super.notifyModelChanged(changeType);
|
||||
switch (changeType) {
|
||||
case PamControllerInterface.INITIALIZATION_COMPLETE:
|
||||
// System.out.println("DataMap notification " + changeType);
|
||||
initialisationComplete = true;
|
||||
break;
|
||||
case PamControllerInterface.CHANGED_OFFLINE_DATASTORE:
|
||||
case PamControllerInterface.ADD_CONTROLLEDUNIT:
|
||||
case PamControllerInterface.REMOVE_CONTROLLEDUNIT:
|
||||
case PamControllerInterface.INITIALIZE_LOADDATA:
|
||||
case PamControllerInterface.EXTERNAL_DATA_IMPORTED:
|
||||
if (initialisationComplete) {
|
||||
// System.out.println("DataMap notification " + changeType);
|
||||
if (getDataMapGUI() == null) {
|
||||
break;
|
||||
}
|
||||
@ -169,8 +172,9 @@ public class DataMapControl extends PamControlledUnit implements PamSettings {
|
||||
getDataMapGUI().createDataGraphs();
|
||||
dataMapPanel.repaintAll();
|
||||
}
|
||||
// break;
|
||||
break;
|
||||
case PamControllerInterface.OFFLINE_DATA_LOADED:
|
||||
// System.out.println("DataMap notification " + changeType);
|
||||
dataMapPanel.repaintAll();
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,6 @@ public class ViewerScrollerManager extends AbstractScrollManager implements PamS
|
||||
"Data Load Complete, updating displays",
|
||||
dataLoadQueue.size(), dataLoadQueue.size(), 0, 0, 0, 0, 0);
|
||||
publish(lpd);
|
||||
PamController.getInstance().notifyModelChanged(PamControllerInterface.DATA_LOAD_COMPLETE);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -468,6 +467,7 @@ public class ViewerScrollerManager extends AbstractScrollManager implements PamS
|
||||
}
|
||||
}
|
||||
loadDone();
|
||||
PamController.getInstance().notifyModelChanged(PamControllerInterface.DATA_LOAD_COMPLETE);
|
||||
PamController.getInstance().notifyTaskProgress(new LoadQueueProgressData(PamTaskUpdate.STATUS_DONE));
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user