mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2025-04-28 19:17:23 +00:00
null traps in TD display
This commit is contained in:
parent
bb7888ff33
commit
56375bd4c0
@ -16,12 +16,15 @@ import d3.calibration.CalFileReader;
|
|||||||
import d3.calibration.CalibrationInfo;
|
import d3.calibration.CalibrationInfo;
|
||||||
import d3.calibration.CalibrationSet;
|
import d3.calibration.CalibrationSet;
|
||||||
import d3.plots.D3DataPlotProvider;
|
import d3.plots.D3DataPlotProvider;
|
||||||
|
import d3.plots.D3DataProviderFX;
|
||||||
import dataPlots.data.TDDataProviderRegister;
|
import dataPlots.data.TDDataProviderRegister;
|
||||||
|
import dataPlotsFX.data.TDDataProviderRegisterFX;
|
||||||
import fileOfflineData.OfflineFileControl;
|
import fileOfflineData.OfflineFileControl;
|
||||||
import fileOfflineData.OfflineFileMapPoint;
|
import fileOfflineData.OfflineFileMapPoint;
|
||||||
import fileOfflineData.OfflineFileProcess;
|
import fileOfflineData.OfflineFileProcess;
|
||||||
//import au.com.bytecode.opencsv.CSVReader;
|
//import au.com.bytecode.opencsv.CSVReader;
|
||||||
import pamScrollSystem.ViewLoadObserver;
|
import pamScrollSystem.ViewLoadObserver;
|
||||||
|
import userDisplay.UserDisplayControl;
|
||||||
import wavFiles.WavFileReader;
|
import wavFiles.WavFileReader;
|
||||||
import wavFiles.WavHeader;
|
import wavFiles.WavHeader;
|
||||||
|
|
||||||
@ -35,13 +38,14 @@ public class D3Control extends OfflineFileControl {
|
|||||||
private D3DataPlotProvider d3DataPlotProvider;
|
private D3DataPlotProvider d3DataPlotProvider;
|
||||||
private float[] oldAccell = new float[3];
|
private float[] oldAccell = new float[3];
|
||||||
private D3DataUnit previousJerkUnit;
|
private D3DataUnit previousJerkUnit;
|
||||||
|
private D3DataProviderFX d3PlotProvider;
|
||||||
|
|
||||||
|
|
||||||
public D3Control(String unitName) {
|
public D3Control(String unitName) {
|
||||||
super(unitType, unitName);
|
super(unitType, unitName);
|
||||||
|
|
||||||
TDDataProviderRegister.getInstance().registerDataInfo(d3DataPlotProvider = new D3DataPlotProvider(this, getD3DataBlock()));
|
TDDataProviderRegister.getInstance().registerDataInfo(d3DataPlotProvider = new D3DataPlotProvider(this, getD3DataBlock()));
|
||||||
// UserDisplayControl.addUserDisplayProvider(d3PlotProvider = new D3PlotProvider(this));
|
TDDataProviderRegisterFX.getInstance().registerDataInfo(d3PlotProvider = new D3DataProviderFX(this, getD3DataBlock()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -321,6 +325,9 @@ public class D3Control extends OfflineFileControl {
|
|||||||
float[] calulateDepth(D3DataUnit dataUnit) {
|
float[] calulateDepth(D3DataUnit dataUnit) {
|
||||||
|
|
||||||
// find the pressure calibration and make a depth line.
|
// find the pressure calibration and make a depth line.
|
||||||
|
if (calibrations == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
CalibrationInfo depthCal = calibrations.findCalibrationInfo("press");
|
CalibrationInfo depthCal = calibrations.findCalibrationInfo("press");
|
||||||
CalibrationInfo tempCal = calibrations.findCalibrationInfo("press:bridge");
|
CalibrationInfo tempCal = calibrations.findCalibrationInfo("press:bridge");
|
||||||
int pressInd = findSensorIndex("press");
|
int pressInd = findSensorIndex("press");
|
||||||
|
43
src/d3/plots/D3DataProviderFX.java
Normal file
43
src/d3/plots/D3DataProviderFX.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package d3.plots;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import PamView.GeneralProjector.ParameterType;
|
||||||
|
import PamView.GeneralProjector.ParameterUnits;
|
||||||
|
import d3.D3Control;
|
||||||
|
import d3.D3DataBlock;
|
||||||
|
import d3.D3SensorInfo;
|
||||||
|
import dataPlotsFX.data.TDDataInfoFX;
|
||||||
|
import dataPlotsFX.data.TDDataProviderFX;
|
||||||
|
import dataPlotsFX.data.TDScaleInfo;
|
||||||
|
import dataPlotsFX.layout.TDGraphFX;
|
||||||
|
|
||||||
|
public class D3DataProviderFX extends TDDataProviderFX {
|
||||||
|
|
||||||
|
private D3DataBlock d3DataBlock;
|
||||||
|
private D3Control d3Control;
|
||||||
|
|
||||||
|
public D3DataProviderFX(D3Control d3Control, D3DataBlock d3DataBlock) {
|
||||||
|
super(d3DataBlock);
|
||||||
|
this.d3Control = d3Control;
|
||||||
|
this.d3DataBlock = d3DataBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TDDataInfoFX createDataInfo(TDGraphFX tdGraph) {
|
||||||
|
D3PlotInfoFX dataInfo = new D3PlotInfoFX(d3Control, this, tdGraph, d3DataBlock);
|
||||||
|
createDataChannels(dataInfo);
|
||||||
|
return dataInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int createDataChannels(D3PlotInfoFX dataInfo) {
|
||||||
|
int ind = 0;
|
||||||
|
ArrayList<D3SensorInfo> sensorInfos = d3Control.getD3SensorInfos();
|
||||||
|
for (D3SensorInfo sensInfo:sensorInfos) {
|
||||||
|
// need min max type units.
|
||||||
|
dataInfo.addScaleInfo(new TDScaleInfo(-1, 1, ParameterType.AMPLITUDE, ParameterUnits.NONE));
|
||||||
|
}
|
||||||
|
return ind;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
60
src/d3/plots/D3PlotInfoFX.java
Normal file
60
src/d3/plots/D3PlotInfoFX.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package d3.plots;
|
||||||
|
|
||||||
|
import PamController.PamControllerInterface;
|
||||||
|
import PamguardMVC.PamDataBlock;
|
||||||
|
import PamguardMVC.PamDataUnit;
|
||||||
|
import d3.D3Control;
|
||||||
|
import d3.D3DataBlock;
|
||||||
|
import dataPlotsFX.TDSymbolChooserFX;
|
||||||
|
import dataPlotsFX.data.TDDataInfoFX;
|
||||||
|
import dataPlotsFX.data.TDDataProviderFX;
|
||||||
|
import dataPlotsFX.layout.TDGraphFX;
|
||||||
|
import dataPlotsFX.projector.TDProjectorFX;
|
||||||
|
import javafx.scene.canvas.GraphicsContext;
|
||||||
|
import javafx.scene.shape.Polygon;
|
||||||
|
|
||||||
|
public class D3PlotInfoFX extends TDDataInfoFX {
|
||||||
|
|
||||||
|
private D3Control d3Control;
|
||||||
|
private D3DataBlock d3DataBlock;
|
||||||
|
private int dataChannels;
|
||||||
|
private D3DataProviderFX d3DataProvider;
|
||||||
|
|
||||||
|
public D3PlotInfoFX(D3Control d3Control, D3DataProviderFX d3DataProvider, TDGraphFX tdGraph, D3DataBlock pamDataBlock) {
|
||||||
|
super(d3DataProvider, tdGraph, pamDataBlock);
|
||||||
|
this.d3Control = d3Control;
|
||||||
|
this.d3DataProvider = d3DataProvider;
|
||||||
|
this.d3DataBlock = pamDataBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Polygon drawDataUnit(int plotNumber, PamDataUnit pamDataUnit, GraphicsContext g, double scrollStart,
|
||||||
|
TDProjectorFX tdProjector, int type) {
|
||||||
|
// need to draw a line for this.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double getDataValue(PamDataUnit pamDataUnit) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TDSymbolChooserFX getSymbolChooser() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void notifyChange(int changeType) {
|
||||||
|
if (changeType == PamControllerInterface.OFFLINE_DATA_LOADED && dataChannels == 0) {
|
||||||
|
dataChannels = d3DataProvider.createDataChannels(this);
|
||||||
|
if (dataChannels > 0) {
|
||||||
|
// getTdGraph().listAvailableAxisNames();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -143,6 +143,11 @@ public abstract class TDDataInfoFX {
|
|||||||
|
|
||||||
scaleInfoIndex = -1;
|
scaleInfoIndex = -1;
|
||||||
for (int i = 0; i < scaleInfos.size(); i++) {
|
for (int i = 0; i < scaleInfos.size(); i++) {
|
||||||
|
TDScaleInfo scaleInfo = scaleInfos.get(i);
|
||||||
|
ParameterType scaleDataType = scaleInfo.getDataType();
|
||||||
|
if (scaleDataType == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (scaleInfos.get(i).getDataType().equals(dataType) && scaleInfos.get(i).getDataUnit().equals(dataUnits)) {
|
if (scaleInfos.get(i).getDataType().equals(dataType) && scaleInfos.get(i).getDataUnit().equals(dataUnits)) {
|
||||||
scaleInfoIndex = i;
|
scaleInfoIndex = i;
|
||||||
return true;
|
return true;
|
||||||
@ -167,7 +172,15 @@ public abstract class TDDataInfoFX {
|
|||||||
*/
|
*/
|
||||||
public boolean hasAxisName(ParameterType dataType, ParameterUnits dataUnits) {
|
public boolean hasAxisName(ParameterType dataType, ParameterUnits dataUnits) {
|
||||||
for (int i = 0; i < scaleInfos.size(); i++) {
|
for (int i = 0; i < scaleInfos.size(); i++) {
|
||||||
if (scaleInfos.get(i).getDataType().equals(dataType)
|
TDScaleInfo scaleInfo = scaleInfos.get(i);
|
||||||
|
if (scaleInfo == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ParameterType scaleDataType = scaleInfo.getDataType();
|
||||||
|
if (scaleDataType == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (scaleInfo.getDataType().equals(dataType)
|
||||||
&& scaleInfos.get(i).getDataUnit().equals(dataUnits)) {
|
&& scaleInfos.get(i).getDataUnit().equals(dataUnits)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -291,6 +304,9 @@ public abstract class TDDataInfoFX {
|
|||||||
*/
|
*/
|
||||||
public TDScaleInfo getScaleInfo() {
|
public TDScaleInfo getScaleInfo() {
|
||||||
if (scaleInfoIndex==-1 && scaleInfos.size()>0) scaleInfoIndex=0;
|
if (scaleInfoIndex==-1 && scaleInfos.size()>0) scaleInfoIndex=0;
|
||||||
|
if (scaleInfoIndex < 0 || scaleInfoIndex >= scaleInfos.size()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return scaleInfos.get(this.scaleInfoIndex);
|
return scaleInfos.get(this.scaleInfoIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,6 +257,9 @@ public class TDProjectorFX extends TimeProjectorFX {
|
|||||||
* @return the axis type string.
|
* @return the axis type string.
|
||||||
*/
|
*/
|
||||||
public static String getUnitName(ParameterUnits axisType){
|
public static String getUnitName(ParameterUnits axisType){
|
||||||
|
if (axisType == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return axisType.toString();
|
return axisType.toString();
|
||||||
|
|
||||||
// String axisUnits="";
|
// String axisUnits="";
|
||||||
@ -301,6 +304,9 @@ public class TDProjectorFX extends TimeProjectorFX {
|
|||||||
* @return the axis type string.
|
* @return the axis type string.
|
||||||
*/
|
*/
|
||||||
public static String getAxisName(ParameterType axisType){
|
public static String getAxisName(ParameterType axisType){
|
||||||
|
if (axisType == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return axisType.toString();
|
return axisType.toString();
|
||||||
|
|
||||||
// String axisName="";
|
// String axisName="";
|
||||||
|
@ -12,10 +12,12 @@ import PamView.symbol.StandardSymbolManager;
|
|||||||
import PamView.symbol.SymbolData;
|
import PamView.symbol.SymbolData;
|
||||||
import PamguardMVC.PamProcess;
|
import PamguardMVC.PamProcess;
|
||||||
import dataMap.OfflineDataMap;
|
import dataMap.OfflineDataMap;
|
||||||
|
import dataPlots.data.TDDataProviderRegister;
|
||||||
import dataPlotsFX.data.TDDataProviderRegisterFX;
|
import dataPlotsFX.data.TDDataProviderRegisterFX;
|
||||||
import generalDatabase.DBControlUnit;
|
import generalDatabase.DBControlUnit;
|
||||||
import ravendata.fx.RavenPlotProviderFX;
|
import ravendata.fx.RavenPlotProviderFX;
|
||||||
import ravendata.swing.RavenGraphics;
|
import ravendata.swing.RavenGraphics;
|
||||||
|
import ravendata.swing.RavenPlotProvider;
|
||||||
|
|
||||||
public class RavenProcess extends PamProcess {
|
public class RavenProcess extends PamProcess {
|
||||||
|
|
||||||
@ -38,6 +40,7 @@ public class RavenProcess extends PamProcess {
|
|||||||
ravenDataBlock.setPamSymbolManager(new StandardSymbolManager(ravenDataBlock, standardSymbol));
|
ravenDataBlock.setPamSymbolManager(new StandardSymbolManager(ravenDataBlock, standardSymbol));
|
||||||
|
|
||||||
TDDataProviderRegisterFX.getInstance().registerDataInfo(new RavenPlotProviderFX(ravenDataBlock));
|
TDDataProviderRegisterFX.getInstance().registerDataInfo(new RavenPlotProviderFX(ravenDataBlock));
|
||||||
|
// TDDataProviderRegister.getInstance().registerDataInfo(new RavenPlotProvider(ravenDataBlock));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
27
src/ravendata/swing/RavenDataInfo.java
Normal file
27
src/ravendata/swing/RavenDataInfo.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package ravendata.swing;
|
||||||
|
|
||||||
|
import PamguardMVC.PamDataBlock;
|
||||||
|
import PamguardMVC.PamDataUnit;
|
||||||
|
import dataPlots.data.TDDataInfo;
|
||||||
|
import dataPlots.data.TDDataProvider;
|
||||||
|
import dataPlots.data.TDSymbolChooser;
|
||||||
|
import dataPlots.layout.TDGraph;
|
||||||
|
|
||||||
|
public class RavenDataInfo extends TDDataInfo {
|
||||||
|
|
||||||
|
public RavenDataInfo(TDDataProvider tdDataProvider, TDGraph tdGraph, PamDataBlock dataBlock) {
|
||||||
|
super(tdDataProvider, tdGraph, dataBlock);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double getDataValue(PamDataUnit pamDataUnit) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TDSymbolChooser getSymbolChooser() {
|
||||||
|
return null;//getDataBlock().getPamSymbolManager().getSymbolChooser("TDPlot" + getTdGraph().getGraphNumber(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
21
src/ravendata/swing/RavenPlotProvider.java
Normal file
21
src/ravendata/swing/RavenPlotProvider.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package ravendata.swing;
|
||||||
|
|
||||||
|
import PamguardMVC.PamDataBlock;
|
||||||
|
import dataPlots.data.TDDataInfo;
|
||||||
|
import dataPlots.data.TDDataProvider;
|
||||||
|
import dataPlots.layout.TDGraph;
|
||||||
|
|
||||||
|
public class RavenPlotProvider extends TDDataProvider {
|
||||||
|
|
||||||
|
public RavenPlotProvider(PamDataBlock parentDataBlock) {
|
||||||
|
super(parentDataBlock);
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TDDataInfo createDataInfo(TDGraph tdGraph) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return new RavenDataInfo(this, tdGraph, getDataBlock());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user