Add FX GUI for decimator module

This commit is contained in:
Jamie Mac 2024-02-09 14:02:12 +00:00
parent 9fb40b055c
commit c9d9b9fb70
4 changed files with 148 additions and 1 deletions

View File

@ -34,7 +34,8 @@ public class ModuleIconFactory {
*/
public enum ModuleIcon {
DATAMAP, NMEA, GPS, MAP, SOUND_AQ, SOUND_OUTPUT, FFT, FILTER, CLICK, CLICK_TRAIN, RECORDER, WHISTLE_MOAN,
NOISE_BAND, NOISE_FILT, DATABASE, BINARY, TIME_DISPLAY, DETECTION_DISPLAY, ARRAY, DEEP_LEARNING, MATCHED_CLICK_CLASSIFIER
NOISE_BAND, NOISE_FILT, DATABASE, BINARY, TIME_DISPLAY, DETECTION_DISPLAY, ARRAY, DEEP_LEARNING, MATCHED_CLICK_CLASSIFIER,
DECIMATOR
}
/**
@ -122,6 +123,9 @@ public class ModuleIconFactory {
//System.out.println("------GET THE SVG ICON FOR DEEP LEARNING--------");
iconNode = getSVGIcon("/Resources/modules/noun_Deep Learning_2486374.svg");
break;
case DECIMATOR:
iconNode = getSVGIcon("/Resources/modules/decimator.svg");
break;
default:
break;
}

View File

@ -34,15 +34,19 @@ import org.w3c.dom.Element;
import dataGram.DatagramManager;
import dataMap.OfflineDataMapPoint;
import dataMap.filemaps.OfflineFileServer;
import decimator.layoutFX.DecimatorUIFX;
import pamScrollSystem.ViewLoadObserver;
import Acquisition.filedate.FileDate;
import Acquisition.filedate.StandardFileDate;
import Acquisition.layoutFX.AquisitionGUIFX;
import Acquisition.offlineFuncs.OfflineWavFileServer;
import PamController.OfflineFileDataStore;
import PamController.PamControlledUnit;
import PamController.PamControlledUnitGUI;
import PamController.PamControlledUnitSettings;
import PamController.PamController;
import PamController.PamControllerInterface;
import PamController.PamGUIManager;
import PamController.PamSettingManager;
import PamController.PamSettings;
import PamController.fileprocessing.StoreStatus;
@ -70,6 +74,11 @@ public class DecimatorControl extends PamControlledUnit implements PamSettings,
private OfflineFileServer offlineFileServer;
private FileDate fileDate;
/**
* JavaFX GUI components for the decimator.
*/
private DecimatorUIFX decimatorGUIFX;
public DecimatorControl(String name) {
@ -262,6 +271,24 @@ public class DecimatorControl extends PamControlledUnit implements PamSettings,
double m = fbig % fsmall;
return m == 0;
}
@Override
public PamControlledUnitGUI getGUI(int flag) {
if (flag==PamGUIManager.FX) {
if (decimatorGUIFX ==null) {
decimatorGUIFX= new DecimatorUIFX(this);
}
return decimatorGUIFX;
}
//TODO swing
return null;
}
public void setDecimatorParams(DecimatorParams newParams) {
this.decimatorParams=newParams;
}
}

View File

@ -0,0 +1,59 @@
package decimator.layoutFX;
import PamController.SettingsPane;
import decimator.DecimatorControl;
import decimator.DecimatorParams;
import javafx.scene.Node;
import javafx.scene.control.Label;
import pamViewFX.fxNodes.PamBorderPane;
/**
*
* Settings for the decimator.
*
* @author Jamie Macaulay
*/
public class DecimatorSettingsPane extends SettingsPane<DecimatorParams> {
private PamBorderPane mainPane;
public DecimatorSettingsPane(DecimatorControl aquisitionControl) {
super(null);
mainPane= new PamBorderPane();
mainPane.setCenter(new Label("Hello Decimator Pane"));
}
@Override
public DecimatorParams getParams(DecimatorParams currParams) {
// TODO Auto-generated method stub
return null;
}
@Override
public void setParams(DecimatorParams input) {
// TODO Auto-generated method stub
}
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Node getContentNode() {
return mainPane;
}
@Override
public void paneInitialized() {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,57 @@
package decimator.layoutFX;
import PamController.SettingsPane;
import decimator.DecimatorControl;
import decimator.DecimatorParams;
import pamViewFX.PamControlledGUIFX;
/**
* FX GUI for the SoundAquisition module.
* @author Jamie Macaulay
*
*/
public class DecimatorUIFX extends PamControlledGUIFX {
/**
* The main settings pane for the aquisition control.
*/
private DecimatorSettingsPane decimatorPane;
/**
* Reference to the Sound Aquisition control.
*/
private DecimatorControl decimatorControl;
public DecimatorUIFX(DecimatorControl aquisitionControl) {
this.decimatorControl=aquisitionControl;
}
@Override
public SettingsPane<DecimatorParams> getSettingsPane(){
if (decimatorPane==null){
decimatorPane=new DecimatorSettingsPane(decimatorControl);
}
decimatorPane.setParams(decimatorControl.getDecimatorParams());
return decimatorPane;
}
/**
* This is called whenever a settings pane is closed. If a pamControlledUnit has
* settings pane then this should be used to update settings based on info input
* into settings pane.
*/
@Override
public void updateParams() {
DecimatorParams newParams=decimatorPane.getParams(decimatorControl.getDecimatorParams());
if (newParams!=null) {
decimatorControl.setDecimatorParams(newParams);
}
//setup the controlled unit.
decimatorControl.setupControlledUnit();
}
}