fix continual restart

Stop it not stopping when processing folders of files.
This commit is contained in:
Douglas Gillespie 2024-04-21 16:33:56 +01:00
parent 209dea47ca
commit 8537a2ddec
3 changed files with 6 additions and 3 deletions

View File

@ -690,7 +690,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
} }
if (currentFile < allFiles.size()) { if (currentFile < allFiles.size()) {
// only restart if the file ended - not if it stopped // only restart if the file ended - not if it stopped
if (getStreamStatus() == STREAM_ENDED) { if (getStreamStatus() == STREAM_ENDED && PamController.getInstance().isManualStop() == false) {
// System.out.println(String.format("Start new file timer (file %d/%d)",currentFile+1,allFiles.size())); // System.out.println(String.format("Start new file timer (file %d/%d)",currentFile+1,allFiles.size()));
newFileTimer.start(); newFileTimer.start();
} }

View File

@ -214,7 +214,7 @@ public class PairBearingLocaliser implements BearingLocaliser {
private boolean resetArray(long timeMillis){ private boolean resetArray(long timeMillis){
if (this.timeMillis!=timeMillis && currentArray.getHydrophoneLocator().isChangeable()){ if (this.timeMillis!=timeMillis && currentArray.getHydrophoneLocator().isChangeable()){
System.out.println("Reset PairBearingLocaliser"); // System.out.println("Reset PairBearingLocaliser");
prepare(this.arrayElements, timeMillis, this.timingError); prepare(this.arrayElements, timeMillis, this.timingError);
return true; return true;
} }

View File

@ -1099,7 +1099,8 @@ public class PamController implements PamControllerInterface, PamSettings {
* later in the AWT event queue. * later in the AWT event queue.
*/ */
public void startLater() { public void startLater() {
SwingUtilities.invokeLater(new StartLater(true)); // SwingUtilities.invokeLater(new StartLater(true));
startLater(true);
} }
public void startLater(boolean saveSettings) { public void startLater(boolean saveSettings) {
@ -1173,6 +1174,7 @@ public class PamController implements PamControllerInterface, PamSettings {
@Override @Override
public void manualStop() { public void manualStop() {
lastStartStopButton = BUTTON_STOP; lastStartStopButton = BUTTON_STOP;
setManualStop(true);
pamStop(); pamStop();
} }
@ -1186,6 +1188,7 @@ public class PamController implements PamControllerInterface, PamSettings {
@Override @Override
public boolean pamStart() { public boolean pamStart() {
// Debug.println("PAMController: pamStart"); // Debug.println("PAMController: pamStart");
setManualStop(false);
return pamStart(true); return pamStart(true);
} }