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 { public enum ModuleIcon {
DATAMAP, NMEA, GPS, MAP, SOUND_AQ, SOUND_OUTPUT, FFT, FILTER, CLICK, CLICK_TRAIN, RECORDER, WHISTLE_MOAN, 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--------"); //System.out.println("------GET THE SVG ICON FOR DEEP LEARNING--------");
iconNode = getSVGIcon("/Resources/modules/noun_Deep Learning_2486374.svg"); iconNode = getSVGIcon("/Resources/modules/noun_Deep Learning_2486374.svg");
break; break;
case DECIMATOR:
iconNode = getSVGIcon("/Resources/modules/decimator.svg");
break;
default: default:
break; break;
} }

View File

@ -34,15 +34,19 @@ import org.w3c.dom.Element;
import dataGram.DatagramManager; import dataGram.DatagramManager;
import dataMap.OfflineDataMapPoint; import dataMap.OfflineDataMapPoint;
import dataMap.filemaps.OfflineFileServer; import dataMap.filemaps.OfflineFileServer;
import decimator.layoutFX.DecimatorUIFX;
import pamScrollSystem.ViewLoadObserver; import pamScrollSystem.ViewLoadObserver;
import Acquisition.filedate.FileDate; import Acquisition.filedate.FileDate;
import Acquisition.filedate.StandardFileDate; import Acquisition.filedate.StandardFileDate;
import Acquisition.layoutFX.AquisitionGUIFX;
import Acquisition.offlineFuncs.OfflineWavFileServer; import Acquisition.offlineFuncs.OfflineWavFileServer;
import PamController.OfflineFileDataStore; import PamController.OfflineFileDataStore;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitGUI;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamController;
import PamController.PamControllerInterface; import PamController.PamControllerInterface;
import PamController.PamGUIManager;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamController.fileprocessing.StoreStatus; import PamController.fileprocessing.StoreStatus;
@ -71,6 +75,11 @@ public class DecimatorControl extends PamControlledUnit implements PamSettings,
private FileDate fileDate; private FileDate fileDate;
/**
* JavaFX GUI components for the decimator.
*/
private DecimatorUIFX decimatorGUIFX;
public DecimatorControl(String name) { public DecimatorControl(String name) {
super("Decimator", name); super("Decimator", name);
@ -264,4 +273,22 @@ public class DecimatorControl extends PamControlledUnit implements PamSettings,
} }
@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();
}
}