mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +00:00
Bug fixes to DL Symbol Pane
This commit is contained in:
parent
120b1eb56f
commit
3e59a11925
@ -595,7 +595,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
System.out.println("The current file was null");
|
||||
return false;
|
||||
}
|
||||
// System.out.printf("*********************************** Opening file %s\n", currentFile.getName());
|
||||
System.out.printf("*********************************** Opening file %s\n", currentFile.getName());
|
||||
|
||||
try {
|
||||
|
||||
@ -639,6 +639,9 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
fileInputParameters.bitDepth = audioFormat.getSampleSizeInBits();
|
||||
|
||||
loadByteConverter(audioFormat);
|
||||
|
||||
// System.out.println("FileInputSystem - prepareInputFile done");
|
||||
|
||||
|
||||
} catch (UnsupportedAudioFileException ex) {
|
||||
ex.printStackTrace();
|
||||
|
@ -933,6 +933,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
|
||||
@Override
|
||||
public InputStoreInfo getStoreInfo(boolean detail) {
|
||||
System.out.println("FolderInputSystem: Get store info start:");
|
||||
if (allFiles == null || allFiles.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
@ -962,6 +963,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
storeInfo.setLastFileEnd(lastFileEnd); // just incase changed
|
||||
storeInfo.setFileStartTimes(allFileStarts);
|
||||
}
|
||||
System.out.println("FolderInputSystem: Get store info complete:");
|
||||
return storeInfo;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class ReprocessManager {
|
||||
choiceSummary.addChoice(ReprocessStoreChoice.STARTNORMAL);
|
||||
return choiceSummary;
|
||||
}
|
||||
|
||||
|
||||
choiceSummary.addChoice(ReprocessStoreChoice.STARTNORMAL);
|
||||
|
||||
ArrayList<PamControlledUnit> outputStores = PamController.getInstance().findControlledUnits(DataOutputStore.class, true);
|
||||
|
@ -269,7 +269,10 @@ public class DataStreamPaneFX extends PamBorderPane {
|
||||
});
|
||||
|
||||
canvasHolder.setOnScroll(e->{
|
||||
wheelMoved(e);
|
||||
//only change colours of the control key is down.
|
||||
if (e.isControlDown()) {
|
||||
wheelMoved(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import pamViewFX.fxNodes.PamColorsFX;
|
||||
import pamViewFX.fxNodes.PamScrollPane;
|
||||
import pamViewFX.fxNodes.PamVBox;
|
||||
import pamViewFX.fxNodes.pamAxis.PamDateAxis;
|
||||
import pamViewFX.fxNodes.pamScrollers.acousticScroller.ScrollBarPane;
|
||||
|
||||
public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
|
||||
@ -77,7 +78,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
/**
|
||||
* 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.
|
||||
@ -145,7 +146,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
// //////////
|
||||
|
||||
holder.setCenter(mainScrollPane);
|
||||
holder.setBottom(createScrollBar());
|
||||
holder.setTop(createScrollBar());
|
||||
|
||||
// PamButton test = new PamButton("Test");
|
||||
// test.setOnAction((action)->{
|
||||
@ -208,13 +209,15 @@ public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
|
||||
|
||||
//create the scroll bar and listeners.
|
||||
timeScrollBar=new ScrollBar();
|
||||
timeScrollBar.valueProperty().addListener((obs_val, old_val, new_val)->{
|
||||
timeScrollBar=new ScrollBarPane();
|
||||
timeScrollBar.addValueListener((obs_val, old_val, new_val)->{
|
||||
calcStartEndMillis();
|
||||
updateScrollBarText();
|
||||
notifyScrollChange();
|
||||
});
|
||||
|
||||
|
||||
|
||||
timeScrollBar.setPrefHeight(20);
|
||||
|
||||
holder.setCenter(timeScrollBar);
|
||||
@ -228,7 +231,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
*/
|
||||
private void calcStartEndMillis(){
|
||||
screenStartMillis = (long) (dataMapControl.getFirstTime() +
|
||||
timeScrollBar.getValue() * 1000L);
|
||||
timeScrollBar.getCurrentValue() * 1000L);
|
||||
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
|
||||
* 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 dataEnd = dataMapControl.getLastTime();
|
||||
double dataSeconds = ((dataEnd-dataStart)/1000) + 1;
|
||||
@ -367,12 +370,12 @@ public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
else {
|
||||
//System.out.println("dataSeconds: "+dataSeconds+ " pixsPerHour: " +pixsPerHour+" screenWidth: "+screenWidth+" screenSeconds "+screenSeconds+" holder width: "+holder.getWidth());
|
||||
timeScrollBar.setVisible(true);
|
||||
timeScrollBar.setMax(0);
|
||||
timeScrollBar.setMax(Math.ceil(dataSeconds));
|
||||
timeScrollBar.setMinVal(0);
|
||||
timeScrollBar.setMaxVal(Math.ceil(dataSeconds));
|
||||
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.setValue(currentPos);
|
||||
timeScrollBar.setCurrentValue(currentPos);
|
||||
}
|
||||
|
||||
}
|
||||
@ -394,7 +397,7 @@ public class ScrollingDataPaneFX extends PamBorderPane {
|
||||
public void scrollToData(PamDataBlock dataBlock) {
|
||||
long startTime = dataBlock.getCurrentViewDataStart();
|
||||
int val = (int) ((startTime - getScreenStartMillis())/1000 - getScreenSeconds()/5) ;
|
||||
timeScrollBar.setValue(val);
|
||||
timeScrollBar.setCurrentValue(val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,6 +6,8 @@ import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.DoubleProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.geometry.Point2D;
|
||||
import javafx.scene.Cursor;
|
||||
import javafx.scene.Node;
|
||||
@ -844,5 +846,18 @@ public class ScrollBarPane extends PamBorderPane {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user