mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 08:32:32 +00:00
Bug fixes to CPOD stuff
This commit is contained in:
parent
6314c90467
commit
66fed778a3
@ -163,7 +163,7 @@
|
||||
*/
|
||||
/** top-left, top-right, bottom-right, and bottom-left corners, in that order. */
|
||||
.close-button-right{
|
||||
-fx-background-color: transparent;
|
||||
-fx-background-color: -fx-darkbackground-trans;
|
||||
-fx-background-radius: 0 10 10 0;
|
||||
-fx-border-color: transparent;
|
||||
-fx-border-radius: 0 10 10 0;
|
||||
@ -171,7 +171,7 @@
|
||||
|
||||
|
||||
.close-button-left{
|
||||
-fx-background-color: transparent;
|
||||
-fx-background-color: -fx-darkbackground-trans;
|
||||
-fx-background-radius: 10 0 0 10;
|
||||
-fx-border-color: transparent;
|
||||
-fx-border-radius: 10 0 0 10;
|
||||
@ -179,17 +179,17 @@
|
||||
|
||||
|
||||
.close-button-top{
|
||||
-fx-background-color: transparent;
|
||||
-fx-background-color: -fx-darkbackground-trans;
|
||||
-fx-background-radius: 10 10 0 0;
|
||||
-fx-border-color: transparent;
|
||||
-fx-border-color: transparent;
|
||||
-fx-border-radius: 10 10 0 0;
|
||||
}
|
||||
|
||||
|
||||
.close-button-bottom{
|
||||
-fx-background-color: transparent;
|
||||
-fx-background-color: -fx-darkbackground-trans;
|
||||
-fx-background-radius: 0 0 10 10;
|
||||
-fx-border-color: transparent;
|
||||
-fx-border-color: transparent;
|
||||
-fx-border-radius: 0 0 10 10;
|
||||
}
|
||||
|
||||
|
@ -382,6 +382,8 @@ public class CPODImporter {
|
||||
|
||||
cpodDataBlock.clearAll();
|
||||
|
||||
System.err.println("There are already data units from CP1 or FP1 files " + cpodDataBlock.getUnitsCount());
|
||||
|
||||
//load the view from the data block for that day.
|
||||
long millisDayStart = roundToDay(click.getTimeMilliseconds());
|
||||
cpodDataBlock.loadViewerData(millisDayStart, millisDayStart+24*60*60*1000L-1, null);
|
||||
|
@ -1,11 +1,13 @@
|
||||
package cpod;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import PamController.PamControlledUnit;
|
||||
import PamView.PamSymbolType;
|
||||
import PamView.symbol.PamSymbolChooser;
|
||||
import PamView.symbol.StandardSymbolManager;
|
||||
import PamView.symbol.SymbolData;
|
||||
import PamView.symbol.modifier.PeakFreqModifier;
|
||||
import PamView.symbol.modifier.SuperDetSymbolModifier;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
|
||||
public class CPODSymbolManager extends StandardSymbolManager {
|
||||
@ -15,6 +17,9 @@ public class CPODSymbolManager extends StandardSymbolManager {
|
||||
*/
|
||||
private PamControlledUnit cpodControl;
|
||||
|
||||
|
||||
private static SymbolData defaultSymbol = new SymbolData(PamSymbolType.SYMBOL_CIRCLE, 10, 10, true, Color.BLACK, Color.BLACK);
|
||||
|
||||
// /**
|
||||
// * Flag to colour clicks by their frequency. It has to be one higher than the other options.
|
||||
// *
|
||||
@ -22,7 +27,7 @@ public class CPODSymbolManager extends StandardSymbolManager {
|
||||
// public static final int COLOUR_BY_FREQ= 6;
|
||||
|
||||
public CPODSymbolManager(PamControlledUnit cpodControl, PamDataBlock pamDataBlock) {
|
||||
super(pamDataBlock, new SymbolData());
|
||||
super(pamDataBlock, defaultSymbol);
|
||||
this.cpodControl = cpodControl;
|
||||
addSymbolOption(HAS_SYMBOL);
|
||||
}
|
||||
@ -44,7 +49,6 @@ public class CPODSymbolManager extends StandardSymbolManager {
|
||||
@Override
|
||||
public void addSymbolModifiers(PamSymbolChooser psc) {
|
||||
|
||||
|
||||
super.addSymbolModifiers(psc);
|
||||
|
||||
//add the peak frequency modifier that allows clicks to be coloured by peak frequency.
|
||||
@ -53,7 +57,7 @@ public class CPODSymbolManager extends StandardSymbolManager {
|
||||
//add the peak frequency modifier that allows clicks to be coloured by peak frequency.
|
||||
psc.addSymbolModifier(new CPODSpeciesModifier(psc));
|
||||
|
||||
// we can also add some default behaviour here to match the old behaviourzz
|
||||
// we can also add some default behaviour here to match the old behaviours
|
||||
// these will get overridden once user options are set, but it's good to give defaults.
|
||||
// SymbolModifier eventMod = psc.hasSymbolModifier(SuperDetSymbolModifier.class);
|
||||
// if (eventMod != null) {
|
||||
|
@ -140,7 +140,7 @@ public class CPODPlotInfoFX extends GenericDataPlotInfo {
|
||||
path2D = drawStemClick( plotNumber, pamDataUnit,g , scrollStart, tdProjector, type, paramType);
|
||||
break;
|
||||
default:
|
||||
return super.drawDataUnit(plotNumber, pamDataUnit, g, scrollStart, tdProjector, type);
|
||||
return super.drawDataUnit(plotNumber, pamDataUnit, g, scrollStart, tdProjector, type);
|
||||
}
|
||||
|
||||
//add to hover list if special data units.
|
||||
@ -272,9 +272,9 @@ public class CPODPlotInfoFX extends GenericDataPlotInfo {
|
||||
// System.out.println("Draw amplitude: min y : " + tdProjector.getYPix(1) + " max y: "
|
||||
// +tdProjector.getYPix(pamDataUnit.getAmplitudeDB()) + " tC: " + tC + " true amplitude: " + pamDataUnit.getAmplitudeDB());
|
||||
x1=tC;
|
||||
y1=tdProjector.getYPix(1);
|
||||
y2=tdProjector.getYPix(pamDataUnit.getAmplitudeDB());
|
||||
x2=tC;
|
||||
y2= tdProjector.getYPix(pamDataUnit.getAmplitudeDB());
|
||||
y1= tdProjector.getHeight();//always draw from bottom of graph
|
||||
break;
|
||||
|
||||
case AMPLITUDE_LIN:
|
||||
@ -324,10 +324,14 @@ public class CPODPlotInfoFX extends GenericDataPlotInfo {
|
||||
|
||||
//now we need to inform he user if a detectrion has waveform info
|
||||
if (clk.getWaveData()!=null) {
|
||||
System.out.print("Time millis: " + pamDataUnit.getTimeMilliseconds());
|
||||
//System.out.print("Time millis: " + pamDataUnit.getTimeMilliseconds());
|
||||
g.setFill(ffColor);
|
||||
g.fillOval(x1-5, Math.abs(y2-y1)/2, 10,10);
|
||||
path2D.lineTo(x1-5, Math.abs(y2-y1)/2);
|
||||
|
||||
//set the location of the circle which indicates which detectins have waveforms.
|
||||
double ypath = y2;
|
||||
|
||||
g.fillOval(x1-5,ypath + Math.abs(y2-y1)/2, 10,10);
|
||||
path2D.lineTo(x1-5, ypath + Math.abs(y2-y1)/2);
|
||||
}
|
||||
|
||||
return path2D;
|
||||
|
@ -222,7 +222,7 @@ public class CPODSettingsPane extends SettingsPane<CPODParams> {
|
||||
});
|
||||
progressPane.setCenter(progressBar);
|
||||
progressPane.setRight(importButton);
|
||||
progressPane.setBottom(progressLabel = new Label("Hello"));
|
||||
progressPane.setBottom(progressLabel = new Label(""));
|
||||
|
||||
|
||||
PamVBox mainHolder = new PamVBox();
|
||||
|
@ -99,6 +99,7 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
}
|
||||
else {
|
||||
return super.drawDataUnit(plotNumber, pamDataUnit, g, scrollStart, tdProjector, type);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -349,6 +349,7 @@ public class TDGraphFX extends PamBorderPane {
|
||||
// set the default overlay style.
|
||||
setOverlayColour(LIGHT_TD_DISPLAY);
|
||||
|
||||
|
||||
//show the left hiding pane byu default.
|
||||
stackPane.getLeftHidingPane().showHidePane(true);
|
||||
}
|
||||
@ -417,6 +418,8 @@ public class TDGraphFX extends PamBorderPane {
|
||||
Text chevronRight = null;
|
||||
Text settingsRight = null;
|
||||
switch (displayCol) {
|
||||
//Note that this is now redundant as the buttons have a dark background - keeping for now just incase.
|
||||
case LIGHT_TD_DISPLAY:
|
||||
case DARK_TD_DISPLAY:
|
||||
// System.out.println("SET DARK THEME FOR HIDING BUTTONS");
|
||||
// chevronRight = PamGlyphDude.createPamGlyph(FontAwesomeIcon.CHEVRON_RIGHT, Color.WHITE,
|
||||
@ -424,13 +427,13 @@ public class TDGraphFX extends PamBorderPane {
|
||||
// settingsRight = PamGlyphDude.createPamGlyph(MaterialIcon.SETTINGS, Color.WHITE, PamGuiManagerFX.iconSize);
|
||||
settingsRight = PamGlyphDude.createPamIcon("mdi2c-cog", Color.WHITE, PamGuiManagerFX.iconSize);
|
||||
break;
|
||||
case LIGHT_TD_DISPLAY:
|
||||
//System.out.println("SET LIGHT THEME FOR HIDING BUTTONS");
|
||||
// chevronRight = PamGlyphDude.createPamGlyph(FontAwesomeIcon.CHEVRON_RIGHT, PamGuiManagerFX.iconColor,
|
||||
chevronRight = PamGlyphDude.createPamIcon("mdi2c-chevron-right", PamGuiManagerFX.iconColor, PamGuiManagerFX.iconSize);
|
||||
// settingsRight = PamGlyphDude.createPamGlyph(MaterialIcon.SETTINGS, PamGuiManagerFX.iconColor,
|
||||
settingsRight = PamGlyphDude.createPamIcon("mdi2c-cog", PamGuiManagerFX.iconColor, PamGuiManagerFX.iconSize);
|
||||
break;
|
||||
// case LIGHT_TD_DISPLAY:
|
||||
// //System.out.println("SET LIGHT THEME FOR HIDING BUTTONS");
|
||||
//// chevronRight = PamGlyphDude.createPamGlyph(FontAwesomeIcon.CHEVRON_RIGHT, PamGuiManagerFX.iconColor,
|
||||
// chevronRight = PamGlyphDude.createPamIcon("mdi2c-chevron-right", PamGuiManagerFX.iconColor, PamGuiManagerFX.iconSize);
|
||||
//// settingsRight = PamGlyphDude.createPamGlyph(MaterialIcon.SETTINGS, PamGuiManagerFX.iconColor,
|
||||
// settingsRight = PamGlyphDude.createPamIcon("mdi2c-cog", PamGuiManagerFX.iconColor, PamGuiManagerFX.iconSize);
|
||||
// break;
|
||||
default:
|
||||
setOverlayColour(LIGHT_TD_DISPLAY);
|
||||
break;
|
||||
|
@ -194,28 +194,29 @@ public class PamHiddenSidePane extends PamStackPane {
|
||||
|
||||
PamButton showButton=hidingPane.getShowButton();
|
||||
showButton.getStylesheets().addAll(PamStylesManagerFX.getPamStylesManagerFX().getCurStyle().getSlidingDialogCSS());
|
||||
showButton.setPrefHeight(60);
|
||||
|
||||
//style show button
|
||||
showButton.setGraphic(icon);
|
||||
switch(side){
|
||||
case LEFT:
|
||||
StackPane.setAlignment(hidingPane, Pos.TOP_LEFT);
|
||||
StackPane.setAlignment(showButton, Pos.TOP_LEFT);
|
||||
showButton.getStyleClass().add("close-button-right-trans");
|
||||
showButton.getStyleClass().add("close-button-right");
|
||||
break;
|
||||
case RIGHT:
|
||||
StackPane.setAlignment(hidingPane, Pos.TOP_RIGHT);
|
||||
StackPane.setAlignment(showButton, Pos.TOP_RIGHT);
|
||||
showButton.getStyleClass().add("close-button-left-trans");
|
||||
showButton.getStyleClass().add("close-button-left");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//make show button same height as hide button
|
||||
showButton.prefHeightProperty().bind(hidingPane.getHideButton().heightProperty());
|
||||
// showButton.prefHeightProperty().bind(hidingPane.getHideButton().heightProperty());
|
||||
//translate it so it sits slightly below the top of the pane.
|
||||
showButton.translateYProperty().setValue(yPos);
|
||||
showButton.prefHeightProperty().bind(hidingPane.getHideButton().heightProperty());
|
||||
showButton.translateYProperty().bind(displayPane.heightProperty().divide(2).subtract(showButton.heightProperty().divide(2)));
|
||||
|
||||
hidingPane.getHideButton().translateYProperty().setValue(yPos);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user