mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-24 08:02:22 +00:00
Merge from DG (#148)
* Localization output * update localiser output * Start effort management system * Start of Effort plotting Strat of effort plotting on map. Framework for using Effort data in other areas (such as Tethys output). * Logger forms update Effort and Symbol selectors working with Logger forms. Also functions to add, edit and delete form rows in Viewer mode. * Update LoggerFormGraphics.java add in correct symbol managemet to forms graphics. * Effort lines on map Sort of working OK in real time mode. * Working effort system Currently only for map, but seems to work OK * Update Tethys to latest nilus schema * Raven importer Start of a system for a raven importer. Not quite working yet. * Raven import Basic functionality working. Not nice to use though. * Tethys Localization work Abstracting out writing of localization objects and document header information so that individual localisers can give fine scale control of this stuff. * updated Nilus A few updates around track and target motion measures. * FX Plot for raven data Also sorted out symbols a bit and improved symbol selector in Generic plots.
This commit is contained in:
parent
51757499d4
commit
507ff9e28d
@ -2,6 +2,7 @@ package PamView.symbol;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import PamUtils.PamArrayUtils;
|
||||
@ -131,6 +132,12 @@ public class StandardSymbolOptions extends PamSymbolOptions implements Serializa
|
||||
* @param i - the index of the symbol modifier (not modified).
|
||||
*/
|
||||
public void setEnabled(boolean enabled, int i) {
|
||||
if (isEnabled == null) {
|
||||
isEnabled = new boolean[i+1];
|
||||
}
|
||||
else if (isEnabled.length < i+1) {
|
||||
isEnabled = Arrays.copyOf(isEnabled, i+1);
|
||||
}
|
||||
isEnabled[i] = enabled;
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,13 @@ import dataPlotsFX.data.TDDataInfoFX;
|
||||
import dataPlotsFX.data.TDDataProviderFX;
|
||||
import dataPlotsFX.data.TDScaleInfo;
|
||||
import dataPlotsFX.layout.TDGraphFX;
|
||||
import dataPlotsFX.layout.TDSettingsPane;
|
||||
import dataPlotsFX.projector.TDProjectorFX;
|
||||
import javafx.geometry.Point2D;
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.shape.Polygon;
|
||||
import pamViewFX.fxNodes.PamSymbolFX;
|
||||
|
||||
/**
|
||||
* Generic data plot info which can work for a wide variety of data types. May still
|
||||
@ -57,7 +59,7 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
|
||||
private TDSymbolChooserFX managedSymbolChooser;
|
||||
|
||||
|
||||
private GenericSettingsPane genericSettingsPane;
|
||||
/**
|
||||
* The frequency info
|
||||
*/
|
||||
@ -76,10 +78,10 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
bearingScaleInfo.setReverseAxis(true); //set the axis to be reverse so 0 is at top of graph
|
||||
ampScaleInfo = new GenericScaleInfo(100, 200, ParameterType.AMPLITUDE, ParameterUnits.DB);
|
||||
slantScaleInfo = new GenericScaleInfo(0, 180, ParameterType.SLANTBEARING, ParameterUnits.DEGREES);
|
||||
|
||||
frequencyInfo = new GenericScaleInfo(0, 1, ParameterType.FREQUENCY, ParameterUnits.HZ);
|
||||
Arrays.fill(frequencyInfo.getPlotChannels(),1); //TODO-manage plot pane channels somehow.
|
||||
frequencyInfo.setMaxVal(pamDataBlock.getSampleRate()/2);
|
||||
genericSettingsPane = new GenericSettingsPane(this);
|
||||
|
||||
addScaleInfo(bearingScaleInfo);
|
||||
addScaleInfo(slantScaleInfo);
|
||||
@ -118,6 +120,11 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
|
||||
g.setLineDashes(null);
|
||||
g.setLineWidth(2);
|
||||
TDSymbolChooserFX symbolChooser = getSymbolChooser();
|
||||
PamSymbolFX symbol = null;
|
||||
if (symbolChooser != null) {
|
||||
symbol = symbolChooser.getPamSymbol(pamDataUnit, type);
|
||||
}
|
||||
|
||||
double[] f = pamDataUnit.getFrequency();
|
||||
if (f == null) {
|
||||
@ -131,10 +138,14 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
double y1 = tdProjector.getYPix(f[1]);
|
||||
double x0 = tdProjector.getTimePix(pamDataUnit.getTimeMilliseconds()-scrollStart);
|
||||
double x1 = tdProjector.getTimePix(pamDataUnit.getEndTimeInMilliseconds()-scrollStart);
|
||||
g.setStroke(getSymbolChooser().getPamSymbol(pamDataUnit, type).getLineColor());
|
||||
if (symbol != null) {
|
||||
g.setStroke(symbol.getLineColor());
|
||||
g.setLineWidth(symbol.getLineThickness());
|
||||
Color fillCol = symbol.getFillColor();
|
||||
double alpha = fillCol.getOpacity();
|
||||
g.setFill(Color.color(fillCol.getRed(), fillCol.getGreen(), fillCol.getBlue(), alpha)); //add alpha
|
||||
}
|
||||
|
||||
Color fillCol = getSymbolChooser().getPamSymbol(pamDataUnit, type).getFillColor();
|
||||
g.setFill(Color.color(fillCol.getRed(), fillCol.getGreen(), fillCol.getBlue(), 0.4)); //add alpha
|
||||
|
||||
double y = Math.min(y0, y1);
|
||||
double h = Math.abs(y1-y0);
|
||||
@ -174,6 +185,11 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TDSettingsPane getGraphSettingsPane() {
|
||||
return genericSettingsPane;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getDataValue(PamDataUnit pamDataUnit) {
|
||||
|
||||
@ -261,9 +277,9 @@ public class GenericDataPlotInfo extends TDDataInfoFX {
|
||||
|
||||
@Override
|
||||
public TDSymbolChooserFX getSymbolChooser() {
|
||||
if (managedSymbolChooser == null) {
|
||||
// if (managedSymbolChooser == null) {
|
||||
managedSymbolChooser = createSymbolChooser();
|
||||
}
|
||||
// }
|
||||
return managedSymbolChooser;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,9 @@ import PamView.symbol.StandardSymbolManager;
|
||||
import PamView.symbol.SymbolData;
|
||||
import PamguardMVC.PamProcess;
|
||||
import dataMap.OfflineDataMap;
|
||||
import dataPlotsFX.data.TDDataProviderRegisterFX;
|
||||
import generalDatabase.DBControlUnit;
|
||||
import ravendata.fx.RavenPlotProviderFX;
|
||||
import ravendata.swing.RavenGraphics;
|
||||
|
||||
public class RavenProcess extends PamProcess {
|
||||
@ -34,6 +36,8 @@ public class RavenProcess extends PamProcess {
|
||||
ravenDataBlock.SetLogging(ravenLogging);
|
||||
ravenDataBlock.setOverlayDraw(new RavenGraphics(ravenDataBlock));
|
||||
ravenDataBlock.setPamSymbolManager(new StandardSymbolManager(ravenDataBlock, standardSymbol));
|
||||
|
||||
TDDataProviderRegisterFX.getInstance().registerDataInfo(new RavenPlotProviderFX(ravenDataBlock));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
28
src/ravendata/fx/RavenDataPlotInfo.java
Normal file
28
src/ravendata/fx/RavenDataPlotInfo.java
Normal file
@ -0,0 +1,28 @@
|
||||
package ravendata.fx;
|
||||
|
||||
import PamDetection.AbstractLocalisation;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import dataPlotsFX.data.generic.GenericDataPlotInfo;
|
||||
import dataPlotsFX.layout.TDGraphFX;
|
||||
|
||||
public class RavenDataPlotInfo extends GenericDataPlotInfo {
|
||||
|
||||
public RavenDataPlotInfo(RavenPlotProviderFX tdDataProvider, TDGraphFX tdGraph, PamDataBlock pamDataBlock) {
|
||||
super(tdDataProvider, tdGraph, pamDataBlock);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public Double getBearingValue(PamDataUnit pamDataUnit) {
|
||||
AbstractLocalisation locData = pamDataUnit.getLocalisation();
|
||||
if (locData == null) {
|
||||
return null;
|
||||
}
|
||||
double[] angles = locData.getAngles();
|
||||
if (angles != null) {
|
||||
return Math.toDegrees(angles[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
21
src/ravendata/fx/RavenPlotProviderFX.java
Normal file
21
src/ravendata/fx/RavenPlotProviderFX.java
Normal file
@ -0,0 +1,21 @@
|
||||
package ravendata.fx;
|
||||
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import dataPlotsFX.data.TDDataInfoFX;
|
||||
import dataPlotsFX.data.TDDataProviderFX;
|
||||
import dataPlotsFX.data.generic.GenericDataPlotProvider;
|
||||
import dataPlotsFX.layout.TDGraphFX;
|
||||
import ravendata.RavenDataBlock;
|
||||
|
||||
public class RavenPlotProviderFX extends GenericDataPlotProvider {
|
||||
|
||||
public RavenPlotProviderFX(RavenDataBlock parentDataBlock) {
|
||||
super(parentDataBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TDDataInfoFX createDataInfo(TDGraphFX tdGraph) {
|
||||
return new RavenDataPlotInfo(this, tdGraph, getDataBlock());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user