diff --git a/.classpath b/.classpath index 26c568d7..a8555a1f 100644 --- a/.classpath +++ b/.classpath @@ -6,7 +6,7 @@ - + diff --git a/.gitignore b/.gitignore index b2508ef1..471bf948 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ # eclipse project file .project +.hprof # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* diff --git a/src/Acquisition/offlineFuncs/OfflineWavFileServer.java b/src/Acquisition/offlineFuncs/OfflineWavFileServer.java index 29170ebe..fe449b34 100644 --- a/src/Acquisition/offlineFuncs/OfflineWavFileServer.java +++ b/src/Acquisition/offlineFuncs/OfflineWavFileServer.java @@ -24,6 +24,7 @@ import Acquisition.pamAudio.PamAudioSystem; import PamController.OfflineFileDataStore; import PamDetection.RawDataUnit; import PamUtils.PamAudioFileFilter; +import PamUtils.PamCalendar; import PamguardMVC.PamDataBlock; import PamguardMVC.PamRawDataBlock; import PamguardMVC.dataOffline.OfflineDataLoadInfo; @@ -384,6 +385,9 @@ public class OfflineWavFileServer extends OfflineFileServer { this.fileStream = fileStream; this.loadObserver = loadObserver; this.offlineDataLoadInfo=offlineDataLoadInfo; +// System.out.printf("New FLAC decoder %s working from %s to %s\n", offlineDataLoadInfo.toString(), +// PamCalendar.formatDBDateTime(offlineDataLoadInfo.getStartMillis()), +// PamCalendar.formatDBDateTime(offlineDataLoadInfo.getEndMillis())); } @Override @@ -392,6 +396,7 @@ public class OfflineWavFileServer extends OfflineFileServer { try { fileStream.close(); + ms = Math.max(offlineDataLoadInfo.getStartMillis(), ms); offlineDataLoadInfo.setLastLoadInfo(new AquisitionLoadPoint(ms, -1)); } catch (IOException e) { e.printStackTrace(); diff --git a/src/PamController/command/SummaryCommand.java b/src/PamController/command/SummaryCommand.java index 91185b8b..c9b0055e 100644 --- a/src/PamController/command/SummaryCommand.java +++ b/src/PamController/command/SummaryCommand.java @@ -35,6 +35,10 @@ public class SummaryCommand extends ExtCommand { } public String getModulesSummary(boolean clear) { + return getReturnString(); + } + + public String getReturnString() { PamController pamController = PamController.getInstance(); int nMod = pamController.getNumControlledUnits(); PamControlledUnit aModule; diff --git a/src/PamView/PamDetectionOverlayGraphics.java b/src/PamView/PamDetectionOverlayGraphics.java index 9b1cd451..78917ecc 100644 --- a/src/PamView/PamDetectionOverlayGraphics.java +++ b/src/PamView/PamDetectionOverlayGraphics.java @@ -700,11 +700,8 @@ public class PamDetectionOverlayGraphics extends PanelOverlayDraw { pamDetection.getSampleDuration() * 1000./parentDataBlock.getSampleRate(), frequency[0], 0); - boolean isWrapped = false; if (botRight.x < topLeft.x){ - // this means it's wrapped. - isWrapped = true; - botRight.x += g.getClipBounds().width; + botRight.x = g.getClipBounds().width; } if (generalProjector.isViewer()) { Coordinate3d middle = new Coordinate3d(); @@ -726,13 +723,8 @@ public class PamDetectionOverlayGraphics extends PanelOverlayDraw { // Not actually drawing on a spectrogramProjector, so don't have any info on the background color } - if (isWrapped) { - g.drawRect((int) topLeft.x-g.getClipBounds().width, (int) topLeft.y, - (int) botRight.x - (int) topLeft.x, (int) botRight.y - (int) topLeft.y); - } g.drawRect((int) topLeft.x, (int) topLeft.y, (int) botRight.x - (int) topLeft.x, (int) botRight.y - (int) topLeft.y); - return new Rectangle((int) topLeft.x, (int) topLeft.y, (int) botRight.x - (int) topLeft.x, (int) botRight.y - (int) topLeft.y); } diff --git a/src/PamguardMVC/dataOffline/OfflineDataLoadInfo.java b/src/PamguardMVC/dataOffline/OfflineDataLoadInfo.java index dc16b672..5e8198dc 100644 --- a/src/PamguardMVC/dataOffline/OfflineDataLoadInfo.java +++ b/src/PamguardMVC/dataOffline/OfflineDataLoadInfo.java @@ -1,5 +1,6 @@ package PamguardMVC.dataOffline; +import PamUtils.PamCalendar; import PamguardMVC.LoadObserver; import PamguardMVC.PamObserver; @@ -115,6 +116,7 @@ public class OfflineDataLoadInfo implements Cloneable { this.loadKeepLayers = 0; originalKeepLayers=0; this.allowRepeats = false; + checkLoadSize(); } public OfflineDataLoadInfo(PamObserver dataObserver, PamObserver endObserver, long startMillis, long endMillis, @@ -127,6 +129,7 @@ public class OfflineDataLoadInfo implements Cloneable { this.loadKeepLayers = loadKeepLayers; this.originalKeepLayers = loadKeepLayers; this.allowRepeats = allowRepeats; + checkLoadSize(); } public OfflineDataLoadInfo(PamObserver dataObserver, LoadObserver loadObserver, long startMillis, long endMillis, @@ -141,12 +144,24 @@ public class OfflineDataLoadInfo implements Cloneable { this.originalKeepLayers = loadKeepLayers; this.interrupt=interrupt; this.allowRepeats = allowRepeats; + checkLoadSize(); } + public OfflineDataLoadInfo() { // TODO Auto-generated constructor stub } + private boolean checkLoadSize() { +// if (getEndMillis()-getStartMillis() > 3600000L) { +// System.out.printf("Silly big load from %s or %s to %s\n", +// PamCalendar.formatDBDateTime(getStartMillis()), +// PamCalendar.formatDBDateTime(this.startMillis), +// PamCalendar.formatDBDateTime(getEndMillis())); +// return false; +// } + return true; + } /** * Resets the load data for another data load. */ @@ -173,7 +188,12 @@ public class OfflineDataLoadInfo implements Cloneable { * @return the startMillis */ public long getStartMillis() { - if (this.lastLoadInfo!=null) return lastLoadInfo.lastLoadMillis(); + if (this.lastLoadInfo!=null) { +// if (getEndMillis() - lastLoadInfo.lastLoadMillis() > 3600000L) { +// System.out.printf("Weird shit with lastLoadInfo: "); +// } + return lastLoadInfo.lastLoadMillis(); + } else return startMillis; } @@ -191,6 +211,7 @@ public class OfflineDataLoadInfo implements Cloneable { */ public void setStartMillis(long startMillis) { this.startMillis = startMillis; + checkLoadSize(); } /** @@ -205,6 +226,7 @@ public class OfflineDataLoadInfo implements Cloneable { */ public void setEndMillis(long endMillis) { this.endMillis = endMillis; + checkLoadSize(); } /** diff --git a/src/PamguardMVC/dataOffline/OfflineDataLoading.java b/src/PamguardMVC/dataOffline/OfflineDataLoading.java index 0aa5a33e..a342f357 100644 --- a/src/PamguardMVC/dataOffline/OfflineDataLoading.java +++ b/src/PamguardMVC/dataOffline/OfflineDataLoading.java @@ -175,6 +175,13 @@ public class OfflineDataLoading { long t4 = t2; // String orderDates = String.format(" %s to %s", // PamCalendar.formatDateTime(startMillis), PamCalendar.formatDateTime(endMillis)); +// System.out.printf("Offline data order in %s %s from %s to %s\n", pamDataBlock.getDataName(), offlineDataInfo.toString(), +// PamCalendar.formatDBDateTime(offlineDataInfo.getStartMillis()), +// PamCalendar.formatDBDateTime(offlineDataInfo.getEndMillis())); +// if (offlineDataInfo.getEndMillis()-offlineDataInfo.getStartMillis() > 3600000L) { +// System.out.printf("Stupid long load time !"); +// return; +// } try { if (orderData != null) { // System.out.println("order Data is not null"); diff --git a/src/soundPlayback/PlaybackControl.java b/src/soundPlayback/PlaybackControl.java index c9f67762..1af9673b 100644 --- a/src/soundPlayback/PlaybackControl.java +++ b/src/soundPlayback/PlaybackControl.java @@ -20,6 +20,7 @@ import PamController.PamControllerInterface; import PamController.PamGUIManager; import PamController.PamSettingManager; import PamController.PamSettings; +import PamUtils.PamCalendar; import PamView.MenuItemEnabler; import PamView.TopToolBar; import PamguardMVC.LoadObserver; @@ -298,6 +299,11 @@ public class PlaybackControl extends PamControlledUnit implements PamSettings { this.playbackEndMillis = endMillis; playbackProcess.prepareProcess(); playbackProcess.pamStart(); + +// System.out.printf("***Viewer playback request from %s to %s\n", PamCalendar.formatDBDateTime(startMillis), PamCalendar.formatDBDateTime(endMillis)); +// if (endMillis - startMillis > 600000) { +// System.out.println("Thats a stupidly big time period"); +// } dataBlock.orderOfflineData(playbackProcess, new PlayLoadObserver(), startMillis, endMillis, 0, OfflineDataLoading.OFFLINE_DATA_CANCEL, true);