diff --git a/src/Acquisition/layoutFX/CheckWavHeadersPane.java b/src/Acquisition/layoutFX/CheckWavHeadersPane.java index 83607217..60638bae 100644 --- a/src/Acquisition/layoutFX/CheckWavHeadersPane.java +++ b/src/Acquisition/layoutFX/CheckWavHeadersPane.java @@ -7,6 +7,7 @@ import Acquisition.FolderInputSystem; import Acquisition.WavFileFuncs; import PamUtils.PamAudioFileFilter; import javafx.geometry.Insets; +import javafx.application.Platform; import javafx.beans.property.SimpleDoubleProperty; import javafx.concurrent.Task; import javafx.geometry.Pos; @@ -89,6 +90,8 @@ public class CheckWavHeadersPane extends PamBorderPane { */ private SimpleDoubleProperty progressProperty = new SimpleDoubleProperty(0); + private PamButton runButton; + /** * Constructor for the CheckWavHeadersPane * @param folderInputSystem - the folder input system. @@ -102,20 +105,19 @@ public class CheckWavHeadersPane extends PamBorderPane { this.folderInputSystem=folderInputSystem; folderName = new Label(" "); - PamGuiManagerFX.titleFont2style(folderName); + //PamGuiManagerFX.titleFont2style(folderName); textArea = new TextArea(); textArea.setEditable(false); ScrollPane scrollPane = new ScrollPane(textArea); scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); //scrollPane.setPrefSize(322, 300); - this.setCenter(scrollPane); PamHBox pamHBox = new PamHBox(); pamHBox.setAlignment(Pos.CENTER_LEFT); pamHBox.setSpacing(5); - PamButton runButton = new PamButton(); + runButton = new PamButton(); runButton.setGraphic(PamGlyphDude.createPamIcon("mdi2p-play")); runButton.setOnAction((action)->{ checkFiles(); @@ -128,15 +130,15 @@ public class CheckWavHeadersPane extends PamBorderPane { pamHBox.getChildren().addAll(runButton, progressBar); progressBar.setMaxWidth(Double.MAX_VALUE); - mainPane.getChildren().addAll(folderName, textArea, pamHBox); - - this.setPadding(new Insets(5,0,5,15)); + this.setCenter(mainPane); + + this.setPadding(new Insets(5,0,5,15)); } - private void setParams() { + void setParams() { running = ran = false; subFolders = folderInputSystem.getFolderInputParameters().subFolders; if (subFolders) { @@ -149,7 +151,7 @@ public class CheckWavHeadersPane extends PamBorderPane { textArea.setText(" "); allFiles.clear(); nFiles = countFiles(folder); - progressBar.setProgress(0); + progressProperty.setValue(0); progressBar.progressProperty().bind(progressProperty); //progressBar.setMaximum(Math.max(nFiles, 1)); enableControls(); @@ -213,6 +215,10 @@ public class CheckWavHeadersPane extends PamBorderPane { nErrors = 0; enableControls(); checkFilesWorker = new CheckFiles(); + + Thread th = new Thread(checkFilesWorker); + th.setDaemon(true); + th.start(); } @@ -245,10 +251,16 @@ public class CheckWavHeadersPane extends PamBorderPane { * for each file, report on progress with it's name and * whether or not it had an error */ - int error; File aFile; + System.out.println("Analaysing files: Start: " + allFiles.size() ); for (int i = 0; i < allFiles.size(); i++) { - error = checkFile(aFile = allFiles.get(i)); + System.out.println("Analaysing files: " + i); + final int error = checkFile(aFile = allFiles.get(i)); + final File aFile1 = aFile; + Platform.runLater(()->{ + textArea.appendText(String.format("\n File %s %s" , aFile1.getName() , + error == AudioFileFuncs.FILE_OK ? "OK" : ("Error " + error))); + }); //progressBar.progressProperty().bind(null); progressProperty.setValue(100*i/(double) allFiles.size()); } diff --git a/src/Acquisition/layoutFX/FolderInputPane.java b/src/Acquisition/layoutFX/FolderInputPane.java index 963890a5..b6602e92 100644 --- a/src/Acquisition/layoutFX/FolderInputPane.java +++ b/src/Acquisition/layoutFX/FolderInputPane.java @@ -304,6 +304,7 @@ public class FolderInputPane extends DAQSettingsPane{ wavFix.setOnAction((action)->{ acquisitionPaneFX.getAdvancedLabel().setText("Fix Wave Files"); acquisitionPaneFX.getAdvancedPane().setCenter(this.fixWavPane); + fixWavPane.setParams(); acquisitionPaneFX.getFlipPane().flipToBack(); }); diff --git a/src/Resources/css/pamSettingsCSS.css b/src/Resources/css/pamSettingsCSS.css index 605da31c..d635ea5b 100644 --- a/src/Resources/css/pamSettingsCSS.css +++ b/src/Resources/css/pamSettingsCSS.css @@ -35,8 +35,8 @@ -fx-font-color: -fx-text; -fx-font-family: "Ubuntu"; - -fx-border-radius: 5 5 5 5; - -fx-background-radius: 5 5 5 5; + -fx-border-radius: 5 5 5 5; + -fx-background-radius: 5 5 5 5; -icons-color: -fx-icon_col; } @@ -615,7 +615,7 @@ -fx-background: -fx-darkbackground; -fx-background-color: -fx-darkbackground; -fx-border-radius: 0 0 0 0; - -fx-padding: 7 0 7 0; + -fx-padding: 5 0 5 0; -fx-border-color: transparent; } @@ -623,9 +623,9 @@ -fx-text-fill: white; -fx-background-color: -fx-darkbackground; -fx-border-color: -fx-border_col; - -fx-background-radius: 6 6 0 0; - -fx-border-radius: 6 6 0 0; - -fx-padding: 7 0 7 0; + -fx-background-radius: 5 5 0 0; + -fx-border-radius: 5 5 0 0; + -fx-padding: 5 0 5 0; } .spinner .increment-arrow { @@ -635,16 +635,16 @@ .spinner .increment-arrow-button:hover { -fx-background-color: -fx-highlight; -fx-border-color: -fx-highlight_border; - -fx-background-radius: 6 6 0 0; - -fx-border-radius: 6 6 0 0; + -fx-background-radius: 5 5 0 0; + -fx-border-radius: 5 5 0 0; } .spinner .decrement-arrow-button { -fx-text-fill: white; -fx-background-color: -fx-darkbackground; -fx-border-color: -fx-border_col; - -fx-background-radius: 0 0 6 6; - -fx-border-radius: 0 0 6 6 + -fx-background-radius: 0 0 5 5; + -fx-border-radius: 0 0 5 5 } .spinner .decrement-arrow { @@ -654,8 +654,8 @@ .spinner .decrement-arrow-button:hover { -fx-background-color: -fx-highlight; -fx-border-color: -fx-highlight_border; - -fx-background-radius: 0 0 6 6; - -fx-border-radius: 0 0 6 6; + -fx-background-radius: 0 0 5 5; + -fx-border-radius: 0 0 5 5; } /*Arrows are horizontal either side of text box*/ @@ -663,7 +663,7 @@ -fx-text-fill: white; -fx-background-color: -fx-darkbackground; -fx-border-color: -fx-border_col; - -fx-border-radius: 0 6 6 0 + -fx-border-radius: 0 5 5 0 } @@ -671,22 +671,22 @@ -fx-text-fill: white; -fx-background-color: -fx-darkbackground; -fx-border-color: -fx-border_col; - -fx-border-radius: 6 0 0 6 + -fx-border-radius: 5 0 0 5 } .spinner.split-arrows-horizontal .increment-arrow-button:hover { -fx-background-color: -fx-highlight; -fx-border-color: -fx-highlight_border; - -fx-background-radius: 0 6 6 0; - -fx-border-radius: 0 6 6 0; + -fx-background-radius: 0 5 5 0; + -fx-border-radius: 0 5 5 0; } .spinner.split-arrows-horizontal .decrement-arrow-button:hover { -fx-background-color: -fx-highlight; -fx-border-color: -fx-highlight_border; - -fx-background-radius: 6 0 0 6; - -fx-border-radius: 6 0 0 6; + -fx-background-radius: 5 0 0 5; + -fx-border-radius: 5 0 0 5; } .spinner.split-arrows-horizontal .text-field { diff --git a/src/pamViewFX/fxNodes/utilityPanes/MinMaxPane.java b/src/pamViewFX/fxNodes/utilityPanes/MinMaxPane.java index 82f64c6d..b4942247 100644 --- a/src/pamViewFX/fxNodes/utilityPanes/MinMaxPane.java +++ b/src/pamViewFX/fxNodes/utilityPanes/MinMaxPane.java @@ -1,7 +1,6 @@ package pamViewFX.fxNodes.utilityPanes; import java.io.Serializable; - import javafx.geometry.Pos; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; diff --git a/src/spectrogramNoiseReduction/layoutFX/SpectrogramNoisePaneFX.java b/src/spectrogramNoiseReduction/layoutFX/SpectrogramNoisePaneFX.java index cdc4d836..60f67120 100644 --- a/src/spectrogramNoiseReduction/layoutFX/SpectrogramNoisePaneFX.java +++ b/src/spectrogramNoiseReduction/layoutFX/SpectrogramNoisePaneFX.java @@ -3,12 +3,10 @@ package spectrogramNoiseReduction.layoutFX; import java.util.ArrayList; -import org.controlsfx.control.ToggleSwitch; - import pamViewFX.PamGuiManagerFX; -import pamViewFX.fxNodes.PamBorderPane; import pamViewFX.fxNodes.PamHBox; import pamViewFX.fxNodes.PamVBox; +import pamViewFX.fxNodes.utilityPanes.PamToggleSwitch; import pamViewFX.fxNodes.utilityPanes.SourcePaneFX; import spectrogramNoiseReduction.SpecNoiseMethod; import spectrogramNoiseReduction.SpectrogramNoiseProcess; @@ -16,10 +14,8 @@ import spectrogramNoiseReduction.SpectrogramNoiseSettings; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Node; -import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.control.Tooltip; -import javafx.scene.layout.Pane; import PamController.SettingsPane; import PamguardMVC.PamDataBlock; @@ -39,7 +35,7 @@ public class SpectrogramNoisePaneFX extends SettingsPane