Bug fixes to DL Symbol Pane

This commit is contained in:
Jamie Mac 2024-07-23 17:26:12 +01:00
parent 120b1eb56f
commit 3e59a11925
6 changed files with 40 additions and 14 deletions

View File

@ -595,7 +595,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
System.out.println("The current file was null"); System.out.println("The current file was null");
return false; return false;
} }
// System.out.printf("*********************************** Opening file %s\n", currentFile.getName()); System.out.printf("*********************************** Opening file %s\n", currentFile.getName());
try { try {
@ -639,6 +639,9 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
fileInputParameters.bitDepth = audioFormat.getSampleSizeInBits(); fileInputParameters.bitDepth = audioFormat.getSampleSizeInBits();
loadByteConverter(audioFormat); loadByteConverter(audioFormat);
// System.out.println("FileInputSystem - prepareInputFile done");
} catch (UnsupportedAudioFileException ex) { } catch (UnsupportedAudioFileException ex) {
ex.printStackTrace(); ex.printStackTrace();

View File

@ -933,6 +933,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
@Override @Override
public InputStoreInfo getStoreInfo(boolean detail) { public InputStoreInfo getStoreInfo(boolean detail) {
System.out.println("FolderInputSystem: Get store info start:");
if (allFiles == null || allFiles.size() == 0) { if (allFiles == null || allFiles.size() == 0) {
return null; return null;
} }
@ -962,6 +963,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
storeInfo.setLastFileEnd(lastFileEnd); // just incase changed storeInfo.setLastFileEnd(lastFileEnd); // just incase changed
storeInfo.setFileStartTimes(allFileStarts); storeInfo.setFileStartTimes(allFileStarts);
} }
System.out.println("FolderInputSystem: Get store info complete:");
return storeInfo; return storeInfo;
} }

View File

@ -172,7 +172,7 @@ public class ReprocessManager {
choiceSummary.addChoice(ReprocessStoreChoice.STARTNORMAL); choiceSummary.addChoice(ReprocessStoreChoice.STARTNORMAL);
return choiceSummary; return choiceSummary;
} }
choiceSummary.addChoice(ReprocessStoreChoice.STARTNORMAL); choiceSummary.addChoice(ReprocessStoreChoice.STARTNORMAL);
ArrayList<PamControlledUnit> outputStores = PamController.getInstance().findControlledUnits(DataOutputStore.class, true); ArrayList<PamControlledUnit> outputStores = PamController.getInstance().findControlledUnits(DataOutputStore.class, true);

View File

@ -269,7 +269,10 @@ public class DataStreamPaneFX extends PamBorderPane {
}); });
canvasHolder.setOnScroll(e->{ canvasHolder.setOnScroll(e->{
wheelMoved(e); //only change colours of the control key is down.
if (e.isControlDown()) {
wheelMoved(e);
}
}); });
} }

View File

@ -21,6 +21,7 @@ import pamViewFX.fxNodes.PamColorsFX;
import pamViewFX.fxNodes.PamScrollPane; import pamViewFX.fxNodes.PamScrollPane;
import pamViewFX.fxNodes.PamVBox; import pamViewFX.fxNodes.PamVBox;
import pamViewFX.fxNodes.pamAxis.PamDateAxis; import pamViewFX.fxNodes.pamAxis.PamDateAxis;
import pamViewFX.fxNodes.pamScrollers.acousticScroller.ScrollBarPane;
public class ScrollingDataPaneFX extends PamBorderPane { public class ScrollingDataPaneFX extends PamBorderPane {
@ -77,7 +78,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
/** /**
* Scroll bar for time (horizontal) * Scroll bar for time (horizontal)
*/ */
private ScrollBar timeScrollBar; private ScrollBarPane timeScrollBar;
/** /**
* Settings strip at top of the display. Shows all sorts of detailed info such cursor position and start and end times. * Settings strip at top of the display. Shows all sorts of detailed info such cursor position and start and end times.
@ -145,7 +146,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
// ////////// // //////////
holder.setCenter(mainScrollPane); holder.setCenter(mainScrollPane);
holder.setBottom(createScrollBar()); holder.setTop(createScrollBar());
// PamButton test = new PamButton("Test"); // PamButton test = new PamButton("Test");
// test.setOnAction((action)->{ // test.setOnAction((action)->{
@ -208,13 +209,15 @@ public class ScrollingDataPaneFX extends PamBorderPane {
//create the scroll bar and listeners. //create the scroll bar and listeners.
timeScrollBar=new ScrollBar(); timeScrollBar=new ScrollBarPane();
timeScrollBar.valueProperty().addListener((obs_val, old_val, new_val)->{ timeScrollBar.addValueListener((obs_val, old_val, new_val)->{
calcStartEndMillis(); calcStartEndMillis();
updateScrollBarText(); updateScrollBarText();
notifyScrollChange(); notifyScrollChange();
}); });
timeScrollBar.setPrefHeight(20); timeScrollBar.setPrefHeight(20);
holder.setCenter(timeScrollBar); holder.setCenter(timeScrollBar);
@ -228,7 +231,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
*/ */
private void calcStartEndMillis(){ private void calcStartEndMillis(){
screenStartMillis = (long) (dataMapControl.getFirstTime() + screenStartMillis = (long) (dataMapControl.getFirstTime() +
timeScrollBar.getValue() * 1000L); timeScrollBar.getCurrentValue() * 1000L);
screenEndMillis = screenStartMillis + (long) (screenSeconds * 1000); screenEndMillis = screenStartMillis + (long) (screenSeconds * 1000);
} }
@ -347,7 +350,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
* Do scrolling in seconds - will give up to 68 years with a * Do scrolling in seconds - will give up to 68 years with a
* 32 bit integer control of scroll bar. milliseconds would give < 1 year ! * 32 bit integer control of scroll bar. milliseconds would give < 1 year !
*/ */
double currentPos = timeScrollBar.getValue(); double currentPos = timeScrollBar.getCurrentValue();
long dataStart = dataMapControl.getFirstTime(); long dataStart = dataMapControl.getFirstTime();
long dataEnd = dataMapControl.getLastTime(); long dataEnd = dataMapControl.getLastTime();
double dataSeconds = ((dataEnd-dataStart)/1000) + 1; double dataSeconds = ((dataEnd-dataStart)/1000) + 1;
@ -367,12 +370,12 @@ public class ScrollingDataPaneFX extends PamBorderPane {
else { else {
//System.out.println("dataSeconds: "+dataSeconds+ " pixsPerHour: " +pixsPerHour+" screenWidth: "+screenWidth+" screenSeconds "+screenSeconds+" holder width: "+holder.getWidth()); //System.out.println("dataSeconds: "+dataSeconds+ " pixsPerHour: " +pixsPerHour+" screenWidth: "+screenWidth+" screenSeconds "+screenSeconds+" holder width: "+holder.getWidth());
timeScrollBar.setVisible(true); timeScrollBar.setVisible(true);
timeScrollBar.setMax(0); timeScrollBar.setMinVal(0);
timeScrollBar.setMax(Math.ceil(dataSeconds)); timeScrollBar.setMaxVal(Math.ceil(dataSeconds));
timeScrollBar.setBlockIncrement(Math.max(1, screenSeconds * 4/5)); timeScrollBar.setBlockIncrement(Math.max(1, screenSeconds * 4/5));
timeScrollBar.setUnitIncrement(Math.max(1, screenSeconds / 20)); // timeScrollBar.setUnitIncrement(Math.max(1, screenSeconds / 20));
timeScrollBar.setVisibleAmount(screenSeconds); timeScrollBar.setVisibleAmount(screenSeconds);
timeScrollBar.setValue(currentPos); timeScrollBar.setCurrentValue(currentPos);
} }
} }
@ -394,7 +397,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
public void scrollToData(PamDataBlock dataBlock) { public void scrollToData(PamDataBlock dataBlock) {
long startTime = dataBlock.getCurrentViewDataStart(); long startTime = dataBlock.getCurrentViewDataStart();
int val = (int) ((startTime - getScreenStartMillis())/1000 - getScreenSeconds()/5) ; int val = (int) ((startTime - getScreenStartMillis())/1000 - getScreenSeconds()/5) ;
timeScrollBar.setValue(val); timeScrollBar.setCurrentValue(val);
} }
/** /**

View File

@ -6,6 +6,8 @@ import javafx.beans.property.BooleanProperty;
import javafx.beans.property.DoubleProperty; import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Point2D; import javafx.geometry.Point2D;
import javafx.scene.Cursor; import javafx.scene.Cursor;
import javafx.scene.Node; import javafx.scene.Node;
@ -844,5 +846,18 @@ public class ScrollBarPane extends PamBorderPane {
this.showMillis = showMillis; this.showMillis = showMillis;
} }
/**
* Convenience function which adds a change listener to the current value and visible amount prooperty.
* @param val - the change listener to add.
*/
public void addValueListener(ChangeListener val) {
//add listener to visible amount property.
visibleAmountProperty.addListener(val);
//add listener to current value amount property.
currentValueProperty.addListener(val);
}
} }