Major code cleanup

Cleanup of imports, whitespace, etc. across all of PAMGuard. No other changes to code apart from this automatic cleanup.
This commit is contained in:
Douglas Gillespie 2024-08-27 12:48:16 +01:00
parent b9c613ea1b
commit b420fd9f9d
964 changed files with 5890 additions and 5952 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.pamguard</groupId> <groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId> <artifactId>Pamguard</artifactId>
<version>2.02.13</version> <version>2.02.13a</version>
<name>Pamguard</name> <name>Pamguard</name>
<description>Pamguard using Maven to control dependencies</description> <description>Pamguard using Maven to control dependencies</description>
<url>www.pamguard.org</url> <url>www.pamguard.org</url>

View File

@ -13,7 +13,6 @@ import binaryFileStorage.BinaryHeader;
import binaryFileStorage.BinaryObjectData; import binaryFileStorage.BinaryObjectData;
import binaryFileStorage.ModuleFooter; import binaryFileStorage.ModuleFooter;
import binaryFileStorage.ModuleHeader; import binaryFileStorage.ModuleHeader;
import binaryFileStorage.PackedBinaryObject;
public class AISBinaryDataSource extends BinaryDataSource { public class AISBinaryDataSource extends BinaryDataSource {

View File

@ -32,7 +32,7 @@ public class AISBugSearch {
// first comma separates date and NMEA data // first comma separates date and NMEA data
int chPos = line.indexOf(","); int chPos = line.indexOf(",");
String nmeaData = line.substring(chPos+1); String nmeaData = line.substring(chPos+1);
if (nmeaData.contains("AIVDM") == false) { if (!nmeaData.contains("AIVDM")) {
continue; continue;
} }
System.out.println(nmeaData); System.out.println(nmeaData);

View File

@ -44,6 +44,7 @@ public class AISControl extends PamControlledUnit implements PamSettings {
super(); super();
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
AISStringsTable.show(aisControl); AISStringsTable.show(aisControl);
} }
@ -55,6 +56,7 @@ public class AISControl extends PamControlledUnit implements PamSettings {
super(); super();
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
AISParameters newParams = AISDisplayDialog.showDialog(parentFrame, aisParameters); AISParameters newParams = AISDisplayDialog.showDialog(parentFrame, aisParameters);
@ -70,6 +72,7 @@ public class AISControl extends PamControlledUnit implements PamSettings {
super(); super();
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
AISParameters newParams = AISSettingsDialog.showDialog(parentFrame, aisParameters); AISParameters newParams = AISSettingsDialog.showDialog(parentFrame, aisParameters);
if (newParams != null) { if (newParams != null) {
@ -115,14 +118,17 @@ public class AISControl extends PamControlledUnit implements PamSettings {
aisProcess.noteNewSettings(); aisProcess.noteNewSettings();
} }
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return aisParameters; return aisParameters;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return AISParameters.serialVersionUID; return AISParameters.serialVersionUID;
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
this.aisParameters = ((AISParameters) pamControlledUnitSettings.getSettings()).clone(); this.aisParameters = ((AISParameters) pamControlledUnitSettings.getSettings()).clone();

View File

@ -1,18 +1,16 @@
package AIS; package AIS;
import generalDatabase.DBControlUnit;
import generalDatabase.SQLTypes;
import java.util.ListIterator; import java.util.ListIterator;
import pamScrollSystem.ViewLoadObserver;
import nmeaEmulator.EmulatedData;
import nmeaEmulator.NMEAEmulator;
import NMEA.AcquireNmeaData; import NMEA.AcquireNmeaData;
import PamController.masterReference.MasterReferencePoint; import PamController.masterReference.MasterReferencePoint;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import generalDatabase.DBControlUnit;
import generalDatabase.SQLTypes;
import nmeaEmulator.EmulatedData;
import nmeaEmulator.NMEAEmulator;
public class AISDataBlock extends PamDataBlock<AISDataUnit> implements NMEAEmulator { public class AISDataBlock extends PamDataBlock<AISDataUnit> implements NMEAEmulator {
@ -76,7 +74,7 @@ public class AISDataBlock extends PamDataBlock<AISDataUnit> implements NMEAEmula
} }
private boolean wantData(AISDataUnit existingUnit, AISDataUnit newUnit) { private boolean wantData(AISDataUnit existingUnit, AISDataUnit newUnit) {
if (aisControl.aisParameters.limitRange == false) { if (!aisControl.aisParameters.limitRange) {
return true; return true;
} }
double range = 0; double range = 0;
@ -133,7 +131,7 @@ public class AISDataBlock extends PamDataBlock<AISDataUnit> implements NMEAEmula
@Override @Override
public EmulatedData getNextData() { public EmulatedData getNextData() {
SQLTypes sqlTypes = DBControlUnit.findConnection().getSqlTypes(); SQLTypes sqlTypes = DBControlUnit.findConnection().getSqlTypes();
if (getLogging().readNextEmulation(sqlTypes) == false) { if (!getLogging().readNextEmulation(sqlTypes)) {
return null; return null;
} }
// now all data should be in the loggers table definition. // now all data should be in the loggers table definition.

View File

@ -5,7 +5,6 @@ import java.util.ArrayList;
import NMEA.NMEABitArray; import NMEA.NMEABitArray;
import NMEA.NMEADataBlock; import NMEA.NMEADataBlock;
import PamDetection.AbstractLocalisation;
import PamDetection.LocContents; import PamDetection.LocContents;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;

View File

@ -7,8 +7,6 @@ import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import radardisplay.RadarProjector;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit; import GPS.GpsDataUnit;
import Map.MapRectProjector; import Map.MapRectProjector;
@ -20,14 +18,14 @@ import PamUtils.Coordinate3d;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.GeneralProjector; import PamView.GeneralProjector;
import PamView.GeneralProjector.ParameterType;
import PamView.PamDetectionOverlayGraphics; import PamView.PamDetectionOverlayGraphics;
import PamView.PamKeyItem; import PamView.PamKeyItem;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.PamSymbolType; import PamView.PamSymbolType;
import PamView.GeneralProjector.ParameterType;
import PamView.symbol.SymbolData; import PamView.symbol.SymbolData;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.debug.Debug; import radardisplay.RadarProjector;
public class AISGraphics extends PamDetectionOverlayGraphics { public class AISGraphics extends PamDetectionOverlayGraphics {
@ -73,12 +71,12 @@ public class AISGraphics extends PamDetectionOverlayGraphics {
AISStaticData staticData = aisDataUnit.getStaticData(); AISStaticData staticData = aisDataUnit.getStaticData();
AISPositionReport positionReport = aisDataUnit.getPositionReport(); AISPositionReport positionReport = aisDataUnit.getPositionReport();
if (aisDataUnit.isComplete() == false) { if (!aisDataUnit.isComplete()) {
return null; return null;
} }
AbstractLocalisation localisation = pamDataUnit.getLocalisation(); AbstractLocalisation localisation = pamDataUnit.getLocalisation();
if (localisation == null || localisation.hasLocContent(LocContents.HAS_BEARING | LocContents.HAS_RANGE) == false) return null; if (localisation == null || !localisation.hasLocContent(LocContents.HAS_BEARING | LocContents.HAS_RANGE)) return null;
double bearing = localisation.getBearing(0) * 180 / Math.PI; double bearing = localisation.getBearing(0) * 180 / Math.PI;
double range = localisation.getRange(0); double range = localisation.getRange(0);
Coordinate3d c3d = generalProjector.getCoord3d(bearing, range, 0); Coordinate3d c3d = generalProjector.getCoord3d(bearing, range, 0);

View File

@ -1,22 +1,19 @@
package AIS; package AIS;
import generalDatabase.DBProcess;
import generalDatabase.PamConnection;
import generalDatabase.PamTableDefinition;
import generalDatabase.PamTableItem;
import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.sql.Types; import java.sql.Types;
import javax.naming.ldap.HasControls;
import PamController.PamController; import PamController.PamController;
import PamView.dialog.warn.WarnOnce; import PamView.dialog.warn.WarnOnce;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import generalDatabase.DBProcess;
import generalDatabase.PamConnection;
import generalDatabase.PamTableDefinition;
import generalDatabase.PamTableItem;
import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes;
public class AISLogger extends SQLLogging { public class AISLogger extends SQLLogging {
@ -167,7 +164,7 @@ public class AISLogger extends SQLLogging {
acallSign = (String) callSign.getValue(); acallSign = (String) callSign.getValue();
ashipName = (String) shipName.getValue(); ashipName = (String) shipName.getValue();
ashipType = (String) shipType.getValue(); ashipType = (String) shipType.getValue();
aetaMillis = sqlTypes.millisFromTimeStamp(eta.getValue()); aetaMillis = SQLTypes.millisFromTimeStamp(eta.getValue());
// aetaMillis = (Long) eta.getValue(); // aetaMillis = (Long) eta.getValue();
adraught = (Double) draft.getValue(); adraught = (Double) draft.getValue();
adestination = (String) destination.getValue(); adestination = (String) destination.getValue();

View File

@ -199,7 +199,7 @@ public class AISStaticData extends AISReport implements Serializable, ManagedPar
} }
switch(stationType) { switch(stationType) {
case BASESTATION: case BASESTATION:
return stationType.BASESTATION.toString(); return StationType.BASESTATION.toString();
case A: case A:
case B: case B:
return getVesselTypeAndCargo(type); return getVesselTypeAndCargo(type);

View File

@ -109,12 +109,13 @@ public class AISStringsTable {
class TimerListener implements ActionListener { class TimerListener implements ActionListener {
boolean doneLayout; boolean doneLayout;
@Override
public void actionPerformed(ActionEvent ev) { public void actionPerformed(ActionEvent ev) {
// table. // table.
// nmeaTableData.fireTableRowsUpdated(0, 10); // nmeaTableData.fireTableRowsUpdated(0, 10);
aisTableData.fireTableDataChanged(); aisTableData.fireTableDataChanged();
if (doneLayout == false && aisTableData.getRowCount() > 0) { if (!doneLayout && aisTableData.getRowCount() > 0) {
doneLayout = true; doneLayout = true;
} }
} }
@ -134,6 +135,7 @@ public class AISStringsTable {
/* (non-Javadoc) /* (non-Javadoc)
* @see javax.swing.table.TableModel#getColumnCount() * @see javax.swing.table.TableModel#getColumnCount()
*/ */
@Override
public int getColumnCount() { public int getColumnCount() {
return tableColumns.length; return tableColumns.length;
} }
@ -141,6 +143,7 @@ public class AISStringsTable {
/* (non-Javadoc) /* (non-Javadoc)
* @see javax.swing.table.TableModel#getRowCount() * @see javax.swing.table.TableModel#getRowCount()
*/ */
@Override
public int getRowCount() { public int getRowCount() {
if (aisDataBlock == null) return 0; if (aisDataBlock == null) return 0;
//System.out.println(aisDataBlock.getUnitsCount() + " rows in AIS data"); //System.out.println(aisDataBlock.getUnitsCount() + " rows in AIS data");
@ -150,6 +153,7 @@ public class AISStringsTable {
/* (non-Javadoc) /* (non-Javadoc)
* @see javax.swing.table.TableModel#getValueAt(int, int) * @see javax.swing.table.TableModel#getValueAt(int, int)
*/ */
@Override
public Object getValueAt(int rowIndex, int columnIndex) { public Object getValueAt(int rowIndex, int columnIndex) {
AISDataUnit aisDataUnit = aisDataBlock.getDataUnit(rowIndex, PamDataBlock.REFERENCE_CURRENT); AISDataUnit aisDataUnit = aisDataBlock.getDataUnit(rowIndex, PamDataBlock.REFERENCE_CURRENT);

View File

@ -3,7 +3,6 @@ package AIS;
import NMEA.NMEADataBlock; import NMEA.NMEADataBlock;
import NMEA.NMEADataUnit; import NMEA.NMEADataUnit;
import PamController.PamController; import PamController.PamController;
import PamDetection.AbstractLocalisation;
import PamDetection.LocContents; import PamDetection.LocContents;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.symbol.StandardSymbolManager; import PamView.symbol.StandardSymbolManager;
@ -11,7 +10,6 @@ import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamObservable; import PamguardMVC.PamObservable;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import autecPhones.AutecGraphics;
/** /**
* Process NMEA data to extract AIS information * Process NMEA data to extract AIS information

View File

@ -21,10 +21,6 @@
package Acquisition; package Acquisition;
import hfDaqCard.SmruDaqSystem;
//import mcc.mccacquisition.MCCDaqSystem;
import mcc.mccacquisition.MCCDaqSystem;
import java.awt.Component; import java.awt.Component;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Window; import java.awt.Window;
@ -38,20 +34,6 @@ import javax.swing.JMenuItem;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import org.pamguard.x3.sud.Chunk;
import org.pamguard.x3.sud.SudFileListener;
import dataGram.DatagramManager;
import dataMap.OfflineDataMapPoint;
import dataMap.filemaps.OfflineFileServer;
import dataPlotsFX.data.TDDataProviderRegisterFX;
import dataPlotsFX.rawDataPlotFX.RawSoundProviderFX;
import pamScrollSystem.ViewLoadObserver;
import simulatedAcquisition.SimProcess;
//import xarraydaq.XArrayDaq;
import asiojni.ASIOSoundSystem;
import asiojni.NewAsioSoundSystem;
import nidaqdev.NIDAQProcess;
import Acquisition.filedate.FileDate; import Acquisition.filedate.FileDate;
import Acquisition.filedate.StandardFileDate; import Acquisition.filedate.StandardFileDate;
import Acquisition.filetypes.SoundFileTypes; import Acquisition.filetypes.SoundFileTypes;
@ -74,8 +56,6 @@ import PamController.PamGUIManager;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamController.RawInputControlledUnit; import PamController.RawInputControlledUnit;
import PamController.fileprocessing.StoreStatus;
import PamModel.PamModel;
import PamModel.SMRUEnable; import PamModel.SMRUEnable;
import PamUtils.FrequencyFormat; import PamUtils.FrequencyFormat;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
@ -91,6 +71,20 @@ import PamguardMVC.PamDataBlock;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import PamguardMVC.PamRawDataBlock; import PamguardMVC.PamRawDataBlock;
import PamguardMVC.dataOffline.OfflineDataLoadInfo; import PamguardMVC.dataOffline.OfflineDataLoadInfo;
//import xarraydaq.XArrayDaq;
import asiojni.ASIOSoundSystem;
import asiojni.NewAsioSoundSystem;
import dataGram.DatagramManager;
import dataMap.OfflineDataMapPoint;
import dataMap.filemaps.OfflineFileServer;
import dataPlotsFX.data.TDDataProviderRegisterFX;
import dataPlotsFX.rawDataPlotFX.RawSoundProviderFX;
import hfDaqCard.SmruDaqSystem;
//import mcc.mccacquisition.MCCDaqSystem;
import mcc.mccacquisition.MCCDaqSystem;
import nidaqdev.NIDAQProcess;
import pamScrollSystem.ViewLoadObserver;
import simulatedAcquisition.SimProcess;
/** /**
* Main data acquisition control to get audio data from sound cards, * Main data acquisition control to get audio data from sound cards,
@ -178,13 +172,13 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
registerDaqSystem(new ASIOSoundSystem(this)); registerDaqSystem(new ASIOSoundSystem(this));
toc = System.currentTimeMillis(); toc = System.currentTimeMillis();
if (toc-tic>1000) { if (toc-tic>1000) {
System.out.printf("Registering ASIOSoundSystem took %3.1fs\n", (double)(toc-tic)/1000.); System.out.printf("Registering ASIOSoundSystem took %3.1fs\n", (toc-tic)/1000.);
} }
tic = System.currentTimeMillis(); tic = System.currentTimeMillis();
registerDaqSystem(new NewAsioSoundSystem(this)); registerDaqSystem(new NewAsioSoundSystem(this));
toc = System.currentTimeMillis(); toc = System.currentTimeMillis();
if (toc-tic>1000) { if (toc-tic>1000) {
System.out.printf("Registering NewAsioSoundSystem took %3.1fs\n", (double)(toc-tic)/1000.); System.out.printf("Registering NewAsioSoundSystem took %3.1fs\n", (toc-tic)/1000.);
} }
} }
registerDaqSystem(new FileInputSystem(this)); registerDaqSystem(new FileInputSystem(this));
@ -275,7 +269,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
*/ */
public void registerDaqSystem(DaqSystem daqSystem){ public void registerDaqSystem(DaqSystem daqSystem){
if (systemList == null) { if (systemList == null) {
systemList = new ArrayList<DaqSystem>(); systemList = new ArrayList<>();
} }
systemList.add(daqSystem); systemList.add(daqSystem);
//daqSystem.getItemsList(); //daqSystem.getItemsList();
@ -283,7 +277,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
} }
public static ArrayList<AcquisitionControl> getControllers() { public static ArrayList<AcquisitionControl> getControllers() {
ArrayList<AcquisitionControl> daqControllers = new ArrayList<AcquisitionControl>(); ArrayList<AcquisitionControl> daqControllers = new ArrayList<>();
PamControlledUnit pcu; PamControlledUnit pcu;
for (int i = 0; i < PamController.getInstance().getNumControlledUnits(); i++) { for (int i = 0; i < PamController.getInstance().getNumControlledUnits(); i++) {
pcu = PamController.getInstance().getControlledUnit(i); pcu = PamController.getInstance().getControlledUnit(i);
@ -323,8 +317,8 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
if (systemType == null) systemType = acquisitionParameters.daqSystemType; if (systemType == null) systemType = acquisitionParameters.daqSystemType;
for (int i = 0; i < systemList.size(); i++) { for (DaqSystem element : systemList) {
if (systemList.get(i).getSystemType().equals(systemType)) return systemList.get(i); if (element.getSystemType().equals(systemType)) return element;
} }
return null; return null;
@ -347,6 +341,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
AcquisitionParameters newParameters = AcquisitionDialog.showDialog(parentFrame, acquisitionControl, acquisitionParameters); AcquisitionParameters newParameters = AcquisitionDialog.showDialog(parentFrame, acquisitionControl, acquisitionParameters);
if (newParameters != null) { if (newParameters != null) {
@ -526,14 +521,17 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
* (non-Javadoc) * (non-Javadoc)
* @see PamController.PamSettings#GetSettingsReference() * @see PamController.PamSettings#GetSettingsReference()
*/ */
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return acquisitionParameters; return acquisitionParameters;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return AcquisitionParameters.serialVersionUID; return AcquisitionParameters.serialVersionUID;
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
// if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) { // if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) {
@ -568,10 +566,10 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
// converts a list of ADC channels to a list of hydrophones // converts a list of ADC channels to a list of hydrophones
public int ChannelsToHydrophones(int channels) { public int ChannelsToHydrophones(int channels) {
int[] hydrophoneList = getHydrophoneList(); int[] hydrophoneList = getHydrophoneList();
if (hydrophoneList == null) return channels; // they are the same by default // they are the same by default
//In viewer mode sometimes the number of channels in sound aquisition can be lost i.e. //In viewer mode sometimes the number of channels in sound aquisition can be lost i.e.
//there are 0 channels. This causes bugs so if occurs return standard list. //there are 0 channels. This causes bugs so if occurs return standard list.
if (acquisitionParameters.nChannels==0) return channels; if ((hydrophoneList == null) || (acquisitionParameters.nChannels==0)) return channels;
int hydrophones = 0; int hydrophones = 0;
int channelListIndex; int channelListIndex;
@ -679,6 +677,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
/** /**
* @return the offlineFileServer * @return the offlineFileServer
*/ */
@Override
public OfflineFileServer getOfflineFileServer() { public OfflineFileServer getOfflineFileServer() {
return offlineFileServer; return offlineFileServer;
} }
@ -766,7 +765,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
public void loadExternalDaqSystems() { public void loadExternalDaqSystems() {
// get a list of plugins // get a list of plugins
List<DaqSystemInterface> daqList = ((PamModel) PamController.getInstance().getModelInterface()).getDaqList(); List<DaqSystemInterface> daqList = PamController.getInstance().getModelInterface().getDaqList();
// if there are no plugins, return // if there are no plugins, return
if (daqList.isEmpty()) { if (daqList.isEmpty()) {
@ -900,6 +899,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
* with the folderinputSystem. * with the folderinputSystem.
* @return * @return
*/ */
@Override
public String getBatchStatus() { public String getBatchStatus() {
DaqSystem runningSystem = getAcquisitionProcess().getRunningSystem(); DaqSystem runningSystem = getAcquisitionProcess().getRunningSystem();
if (runningSystem instanceof FolderInputSystem) { if (runningSystem instanceof FolderInputSystem) {

View File

@ -295,7 +295,7 @@ public class AcquisitionDialog extends PamDialog {
int nP = getNumChannels(); int nP = getNumChannels();
if (getCurrentDaqSystem().supportsChannelLists() && currentChannelListPanel != null) { if (getCurrentDaqSystem().supportsChannelLists() && currentChannelListPanel != null) {
if (currentChannelListPanel.isDataOk() == false) { if (!currentChannelListPanel.isDataOk()) {
return false; return false;
} }
int[] chL = currentChannelListPanel.getChannelList(); int[] chL = currentChannelListPanel.getChannelList();
@ -376,11 +376,13 @@ public class AcquisitionDialog extends PamDialog {
} }
private class NewDeviceType implements ActionListener { private class NewDeviceType implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
newDeviceType(); newDeviceType();
} }
} }
private class NumChannels implements ActionListener { private class NumChannels implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
sortChannelLists(); sortChannelLists();
} }

View File

@ -1,18 +1,14 @@
package Acquisition; package Acquisition;
import java.sql.Types;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import generalDatabase.PamTableDefinition; import generalDatabase.PamTableDefinition;
import generalDatabase.PamTableItem; import generalDatabase.PamTableItem;
import generalDatabase.SQLLogging; import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes; import generalDatabase.SQLTypes;
import java.sql.Types;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import PamguardMVC.debug.Debug;
import clickTrainDetector.CTDataUnit;
/** /**
* Very simple concrete implementation of SQLLogging to log the starts * Very simple concrete implementation of SQLLogging to log the starts
* and stops of PAMGUARD in the database. * and stops of PAMGUARD in the database.
@ -68,8 +64,8 @@ public class AcquisitionLogging extends SQLLogging {
adcClockMillis.setValue((int)(ds.getAdcMilliseconds()%1000)); adcClockMillis.setValue((int)(ds.getAdcMilliseconds()%1000));
rawADCTime.setValue(sqlTypes.getTimeStamp(ds.getRawADCMillis())); rawADCTime.setValue(sqlTypes.getTimeStamp(ds.getRawADCMillis()));
long s = ds.getSamples(); long s = ds.getSamples();
gSamples.setValue((long)(s/1000000000)); gSamples.setValue(s/1000000000);
samples.setValue((long) (s%1000000000)); samples.setValue(s%1000000000);
Long gT = ds.getGpsPPSMilliseconds(); Long gT = ds.getGpsPPSMilliseconds();
if (gT == null) { if (gT == null) {
GPSPPSTime.setValue(null); GPSPPSTime.setValue(null);

View File

@ -1,7 +1,5 @@
package Acquisition; package Acquisition;
import hfDaqCard.SmruDaqSystem;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -13,6 +11,7 @@ import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
import hfDaqCard.SmruDaqSystem;
public class AcquisitionParameters implements Serializable, Cloneable, ManagedParameters { public class AcquisitionParameters implements Serializable, Cloneable, ManagedParameters {
@ -146,15 +145,12 @@ public class AcquisitionParameters implements Serializable, Cloneable, ManagedPa
if (channel < 0) { if (channel < 0) {
return channel; return channel;
} }
if (channelListIndexes.length <= channel) return -1;
// this line no longer needed now that software channels are alwasy 0,1,2,3 // this line no longer needed now that software channels are alwasy 0,1,2,3
// even if hardware channels are more random. // even if hardware channels are more random.
// channel = this.channelListIndexes[channel]; // channel = this.channelListIndexes[channel];
//channel = this.channelListIndexes[channel]; //channel = this.channelListIndexes[channel];
if (channel < 0) { if ((channelListIndexes.length <= channel) || (channel < 0) || (hydrophoneList.length <= channel)) return -1;
return -1;
}
if (hydrophoneList.length <= channel) return -1;
return hydrophoneList[channel]; return hydrophoneList[channel];
} }

View File

@ -1,19 +1,13 @@
package Acquisition; package Acquisition;
import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import javax.swing.Timer; import javax.swing.Timer;
import Acquisition.gpstiming.PPSDetector; import Acquisition.gpstiming.PPSDetector;
import Acquisition.gpstiming.PPSParameters; import Acquisition.gpstiming.PPSParameters;
import Array.ArrayManager; import Array.ArrayManager;
import Array.Hydrophone;
import Array.PamArray; import Array.PamArray;
import Array.Preamplifier; import Array.Preamplifier;
import Filters.Filter; import Filters.Filter;
@ -23,31 +17,20 @@ import Filters.FilterType;
import Filters.IirfFilter; import Filters.IirfFilter;
import PamController.DataInputStore; import PamController.DataInputStore;
import PamController.InputStoreInfo; import PamController.InputStoreInfo;
import PamController.OfflineDataStore;
import PamController.PamControlledUnit;
import PamController.PamController; import PamController.PamController;
import PamController.fileprocessing.ReprocessManager;
import PamController.fileprocessing.StoreStatus;
import PamController.status.BaseProcessCheck; import PamController.status.BaseProcessCheck;
import PamController.status.ProcessCheck; import PamController.status.ProcessCheck;
import PamDetection.RawDataUnit; import PamDetection.RawDataUnit;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import PamUtils.time.ntp.PamNTPTime;
import PamUtils.time.ntp.PamNTPTimeException;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamObservable; import PamguardMVC.PamObservable;
import PamguardMVC.PamObserver;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import PamguardMVC.PamRawDataBlock; import PamguardMVC.PamRawDataBlock;
import PamguardMVC.RequestCancellationObject;
import PamguardMVC.dataOffline.OfflineDataLoadInfo; import PamguardMVC.dataOffline.OfflineDataLoadInfo;
import dataGram.DatagramManager;
import dataMap.OfflineDataMapPoint;
import pamScrollSystem.AbstractScrollManager; import pamScrollSystem.AbstractScrollManager;
import pamScrollSystem.ViewLoadObserver;
/** /**
* Data acquisition process for all types of input device. * Data acquisition process for all types of input device.
@ -208,7 +191,7 @@ public class AcquisitionProcess extends PamProcess {
// called by PamController. Don't actually start if // called by PamController. Don't actually start if
// we're in network receive mode. // we're in network receive mode.
if (systemPrepared == false) return; if (!systemPrepared) return;
newDataQueue.clearList(); // clear this first to make sure nothing new comes in. newDataQueue.clearList(); // clear this first to make sure nothing new comes in.
@ -225,7 +208,7 @@ public class AcquisitionProcess extends PamProcess {
boolean netRX = PamController.getInstance().getRunMode() == PamController.RUN_NETWORKRECEIVER; boolean netRX = PamController.getInstance().getRunMode() == PamController.RUN_NETWORKRECEIVER;
if (!netRX) { if (!netRX) {
if (runningSystem.startSystem(acquisitionControl) == false) return; if (!runningSystem.startSystem(acquisitionControl)) return;
} }
// Log a data unit asap to get the start time // Log a data unit asap to get the start time
long daqStartedTime = PamCalendar.getTimeInMillis(); long daqStartedTime = PamCalendar.getTimeInMillis();
@ -272,7 +255,7 @@ public class AcquisitionProcess extends PamProcess {
} }
private boolean addServerTime(DaqStatusDataUnit daqStatusDataUnit) { private boolean addServerTime(DaqStatusDataUnit daqStatusDataUnit) {
if (runningSystem.isRealTime() == false) { if (!runningSystem.isRealTime()) {
return false; return false;
} }
// PamNTPTime pamNTPTime = PamNTPTime.getInstance(); // PamNTPTime pamNTPTime = PamNTPTime.getInstance();
@ -429,7 +412,7 @@ public class AcquisitionProcess extends PamProcess {
// call acquireData one last time to make sure that // call acquireData one last time to make sure that
// all data have been flushed from the buffer. // all data have been flushed from the buffer.
if (bufferOverflow == false) { if (!bufferOverflow) {
acquireData(); acquireData();
} }
else { else {
@ -585,6 +568,7 @@ public class AcquisitionProcess extends PamProcess {
class BufferTimerTest implements ActionListener { class BufferTimerTest implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
acquisitionControl.fillStatusBarText(); acquisitionControl.fillStatusBarText();
@ -609,7 +593,7 @@ public class AcquisitionProcess extends PamProcess {
e.printStackTrace(); e.printStackTrace();
} }
if (acquireData() == false) { if (!acquireData()) {
break; break;
} }
} }
@ -647,6 +631,7 @@ public class AcquisitionProcess extends PamProcess {
*/ */
class RestartTimerFunction implements ActionListener { class RestartTimerFunction implements ActionListener {
@Override
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
System.out.println("PAMGUARD cannot process data at the required rate and is restarting"); System.out.println("PAMGUARD cannot process data at the required rate and is restarting");
@ -675,7 +660,7 @@ public class AcquisitionProcess extends PamProcess {
int channel = PamUtils.getSingleChannel(threadDataUnit.getChannelBitmap()); int channel = PamUtils.getSingleChannel(threadDataUnit.getChannelBitmap());
// long unitMillis = absSamplesToMilliseconds(threadDataUnit.getStartSample()) - millisecondSampleOffset; // long unitMillis = absSamplesToMilliseconds(threadDataUnit.getStartSample()) - millisecondSampleOffset;
long unitMillis = (long) simpleSamplesToMilliseconds(threadDataUnit.getStartSample()) + millisecondSampleOffset; long unitMillis = simpleSamplesToMilliseconds(threadDataUnit.getStartSample()) + millisecondSampleOffset;
newDataUnit = new RawDataUnit(unitMillis, newDataUnit = new RawDataUnit(unitMillis,
threadDataUnit.getChannelBitmap(), threadDataUnit.getStartSample(), threadDataUnit.getChannelBitmap(), threadDataUnit.getStartSample(),
threadDataUnit.getSampleDuration()); threadDataUnit.getSampleDuration());
@ -697,8 +682,8 @@ public class AcquisitionProcess extends PamProcess {
addData(null, newDataUnit); addData(null, newDataUnit);
rawData = newDataUnit.getRawData(); rawData = newDataUnit.getRawData();
dataBlockLength = rawData.length; dataBlockLength = rawData.length;
for (int i = 0; i < rawData.length; i++) { for (double element : rawData) {
maxLevel = Math.max(maxLevel, Math.abs(rawData[i])); maxLevel = Math.max(maxLevel, Math.abs(element));
} }
levelSamples += rawData.length; levelSamples += rawData.length;
if (bufferOverflow) { if (bufferOverflow) {
@ -1216,7 +1201,7 @@ public class AcquisitionProcess extends PamProcess {
if (runTime < stallCheckSecs * 2000 && samples == 0) { if (runTime < stallCheckSecs * 2000 && samples == 0) {
return false; // give it plenty of time to get started. return false; // give it plenty of time to get started.
} }
if (now - lastStallCheckTime < (stallCheckSecs*1000) && lastStallState == false) { if (now - lastStallCheckTime < (stallCheckSecs*1000) && !lastStallState) {
return lastStallState; return lastStallState;
} }
double aveSR = (double) (samples - lastStallCheckSamples) / (double) (now-lastStallCheckTime) * 1000.; double aveSR = (double) (samples - lastStallCheckSamples) / (double) (now-lastStallCheckTime) * 1000.;

View File

@ -42,7 +42,7 @@ public class CheckWavFileHeaders extends PamDialog {
private CheckFiles checkFilesWorker; private CheckFiles checkFilesWorker;
private ArrayList<File> allFiles = new ArrayList<File>(); private ArrayList<File> allFiles = new ArrayList<>();
private CheckWavFileHeaders(Window parentFrame) { private CheckWavFileHeaders(Window parentFrame) {
super(parentFrame, "Check File Headers", false); super(parentFrame, "Check File Headers", false);
@ -89,8 +89,8 @@ public class CheckWavFileHeaders extends PamDialog {
} }
private void enableControls() { private void enableControls() {
getOkButton().setEnabled(nFiles > 0 & running == false && ran == false); getOkButton().setEnabled(nFiles > 0 & !running && !ran);
getCancelButton().setEnabled(running == false); getCancelButton().setEnabled(!running);
} }
private int countFiles(File folder) { private int countFiles(File folder) {
@ -98,8 +98,8 @@ public class CheckWavFileHeaders extends PamDialog {
File[] files = folder.listFiles(new PamAudioFileFilter()); File[] files = folder.listFiles(new PamAudioFileFilter());
if (files == null) return 0; if (files == null) return 0;
File file; File file;
for (int i = 0; i < files.length; i++) { for (File file2 : files) {
file = files[i]; file = file2;
if (file.isDirectory() && subFolders) { if (file.isDirectory() && subFolders) {
System.out.println(file.getAbsoluteFile()); System.out.println(file.getAbsoluteFile());
nF += countFiles(file.getAbsoluteFile()); nF += countFiles(file.getAbsoluteFile());
@ -164,7 +164,7 @@ public class CheckWavFileHeaders extends PamDialog {
* @return true if there is an error * @return true if there is an error
*/ */
private int checkFile(File aFile) { private int checkFile(File aFile) {
if (aFile.exists() == false || aFile.isDirectory() == true) { if (!aFile.exists() || aFile.isDirectory()) {
return AudioFileFuncs.FILE_DOESNTEXIST; return AudioFileFuncs.FILE_DOESNTEXIST;
} }
String fileName = aFile.getName(); String fileName = aFile.getName();
@ -203,8 +203,8 @@ public class CheckWavFileHeaders extends PamDialog {
*/ */
int error; int error;
File aFile; File aFile;
for (int i = 0; i < allFiles.size(); i++) { for (File file : allFiles) {
error = checkFile(aFile = allFiles.get(i)); error = checkFile(aFile = file);
publish(new ProgressData(aFile, error)); publish(new ProgressData(aFile, error));
} }
return null; return null;
@ -220,8 +220,8 @@ public class CheckWavFileHeaders extends PamDialog {
@Override @Override
protected void process(List<ProgressData> progressData) { protected void process(List<ProgressData> progressData) {
for (int i = 0; i < progressData.size(); i++) { for (ProgressData element : progressData) {
setProgressInfo(progressData.get(i)); setProgressInfo(element);
} }
} }

View File

@ -13,7 +13,6 @@ import binaryFileStorage.BinaryHeader;
import binaryFileStorage.BinaryObjectData; import binaryFileStorage.BinaryObjectData;
import binaryFileStorage.ModuleFooter; import binaryFileStorage.ModuleFooter;
import binaryFileStorage.ModuleHeader; import binaryFileStorage.ModuleHeader;
import binaryFileStorage.PackedBinaryObject;
public class DaqStatusBinaryStore extends BinaryDataSource { public class DaqStatusBinaryStore extends BinaryDataSource {

View File

@ -2,7 +2,6 @@ package Acquisition;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import dataMap.OfflineDataMap;
import effort.EffortProvider; import effort.EffortProvider;
import effort.binary.DataMapEffortProvider; import effort.binary.DataMapEffortProvider;
import generalDatabase.DBControlUnit; import generalDatabase.DBControlUnit;

View File

@ -1,7 +1,6 @@
package Acquisition; package Acquisition;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.PamUtils;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
/** /**
@ -100,8 +99,8 @@ public class DaqStatusDataUnit extends PamDataUnit {
trueSampleRate = null; trueSampleRate = null;
return null; return null;
} }
double samples = (double) (this.samples - previousUnit.getSamples()); double samples = this.samples - previousUnit.getSamples();
double tDiff = (double) (this.gpsPPSMilliseconds - previousUnit.getGpsPPSMilliseconds()) / 1000.; double tDiff = (this.gpsPPSMilliseconds - previousUnit.getGpsPPSMilliseconds()) / 1000.;
if (tDiff > 0 && tDiff < 900 && samples > 0) { if (tDiff > 0 && tDiff < 900 && samples > 0) {
trueSampleRate = samples/tDiff; trueSampleRate = samples/tDiff;
} }

View File

@ -6,9 +6,7 @@ import javax.swing.JComponent;
import Acquisition.layoutFX.AcquisitionPaneFX; import Acquisition.layoutFX.AcquisitionPaneFX;
import Acquisition.layoutFX.DAQSettingsPane; import Acquisition.layoutFX.DAQSettingsPane;
import PamController.SettingsPane;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import javafx.scene.Node;
import soundPlayback.FilePlayback; import soundPlayback.FilePlayback;
import soundPlayback.PlaybackControl; import soundPlayback.PlaybackControl;
import soundPlayback.PlaybackSystem; import soundPlayback.PlaybackSystem;

View File

@ -1,8 +1,6 @@
package Acquisition; package Acquisition;
import PamModel.CommonPluginInterface; import PamModel.CommonPluginInterface;
import PamModel.PamModel;
import PamModel.PamModuleInfo;
/** /**
* Interface for External DAQ Systems * Interface for External DAQ Systems

View File

@ -30,8 +30,8 @@ public class DaqSystemXMLManager {
if (daqs == null) { if (daqs == null) {
return false; return false;
} }
for (int i = 0; i < daqs.size(); i++) { for (PamControlledUnit daq2 : daqs) {
AcquisitionControl daq = (AcquisitionControl) daqs.get(i); AcquisitionControl daq = (AcquisitionControl) daq2;
AcquisitionParameters daqParams = daq.getAcquisitionParameters(); AcquisitionParameters daqParams = daq.getAcquisitionParameters();
if (daqParams.daqSystemType.equals(daqSystemType)) { if (daqParams.daqSystemType.equals(daqSystemType)) {
return true; return true;

View File

@ -22,7 +22,7 @@ public class FileInputParameters implements Serializable, Cloneable, ManagedPara
/** /**
* A list of the recent files or folders selected. * A list of the recent files or folders selected.
*/ */
public ArrayList<String> recentFiles = new ArrayList<String>(); public ArrayList<String> recentFiles = new ArrayList<>();
public boolean realTime; public boolean realTime;

View File

@ -7,8 +7,6 @@ import java.awt.GridBagLayout;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -20,9 +18,9 @@ import java.util.Calendar;
import java.util.List; import java.util.List;
import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioFormat.Encoding;
import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.UnsupportedAudioFileException;
import javax.sound.sampled.AudioFormat.Encoding;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
@ -32,33 +30,24 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import javax.swing.filechooser.FileFilter;
import org.jflac.FLACDecoder; import org.jflac.FLACDecoder;
import org.jflac.PCMProcessor;
import org.jflac.frame.Frame; import org.jflac.frame.Frame;
import org.jflac.metadata.StreamInfo;
import org.jflac.sound.spi.FlacEncoding;
import org.jflac.util.ByteData; import org.jflac.util.ByteData;
import org.pamguard.x3.sud.Chunk; import org.pamguard.x3.sud.Chunk;
import org.pamguard.x3.sud.SudAudioInputStream; import org.pamguard.x3.sud.SudAudioInputStream;
import org.pamguard.x3.sud.SudFileListener; import org.pamguard.x3.sud.SudFileListener;
import org.pamguard.x3.sud.SudParams;
import org.jflac.PCMProcessor;
import org.jflac.metadata.StreamInfo;
import org.jflac.sound.spi.FlacEncoding;
//import org.kc7bfi.jflac.FLACDecoder;
//import org.kc7bfi.jflac.PCMProcessor;
//import org.kc7bfi.jflac.frame.Frame;
//import org.kc7bfi.jflac.metadata.SeekPoint;
//import org.kc7bfi.jflac.metadata.StreamInfo;
//import org.kc7bfi.jflac.sound.spi.FlacEncoding;
//import org.kc7bfi.jflac.util.ByteData;
import wavFiles.ByteConverter;
import Acquisition.filedate.FileDate; import Acquisition.filedate.FileDate;
import Acquisition.filedate.FileDateDialogStrip; import Acquisition.filedate.FileDateDialogStrip;
import Acquisition.filedate.FileDateObserver; import Acquisition.filedate.FileDateObserver;
import Acquisition.filetypes.SoundFileType; import Acquisition.filetypes.SoundFileType;
import Acquisition.pamAudio.PamAudioFileManager;
import Acquisition.pamAudio.PamAudioFileFilter; import Acquisition.pamAudio.PamAudioFileFilter;
import Acquisition.pamAudio.PamAudioFileManager;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamController;
import PamController.PamSettingManager; import PamController.PamSettingManager;
@ -73,6 +62,16 @@ import PamView.panel.PamProgressBar;
import pamguard.GlobalArguments; import pamguard.GlobalArguments;
import warnings.PamWarning; import warnings.PamWarning;
//import org.kc7bfi.jflac.FLACDecoder;
//import org.kc7bfi.jflac.PCMProcessor;
//import org.kc7bfi.jflac.frame.Frame;
//import org.kc7bfi.jflac.metadata.SeekPoint;
//import org.kc7bfi.jflac.metadata.StreamInfo;
//import org.kc7bfi.jflac.sound.spi.FlacEncoding;
//import org.kc7bfi.jflac.util.ByteData;
import wavFiles.ByteConverter;
/** /**
* Implementation of DaqSystem for reading data from audio files. * Implementation of DaqSystem for reading data from audio files.
* *
@ -287,8 +286,8 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
fileNameCombo.removeAllItems(); fileNameCombo.removeAllItems();
String file; String file;
if (fileInputParameters.recentFiles.size() == 0) return; if (fileInputParameters.recentFiles.size() == 0) return;
for (int i = 0; i < fileInputParameters.recentFiles.size(); i++){ for (String element : fileInputParameters.recentFiles) {
file = fileInputParameters.recentFiles.get(i); file = element;
if (file == null || file.length() == 0) continue; if (file == null || file.length() == 0) continue;
fileNameCombo.addItem(file); fileNameCombo.addItem(file);
} }
@ -335,13 +334,13 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
@Override @Override
public String getSystemName() { public String getSystemName() {
if (fileInputParameters.recentFiles == null) return null; if ((fileInputParameters.recentFiles == null) || (fileInputParameters.recentFiles.size() < 1)) return null;
if (fileInputParameters.recentFiles.size() < 1) return null;
File f = getCurrentFile(); File f = getCurrentFile();
if (f == null) return null; if (f == null) return null;
return f.getName(); return f.getName();
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (e.getSource() == fileSelect) { if (e.getSource() == fileSelect) {
@ -374,8 +373,8 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
javax.swing.filechooser.FileFilter[] filters = fileChooser javax.swing.filechooser.FileFilter[] filters = fileChooser
.getChoosableFileFilters(); .getChoosableFileFilters();
for (int i = 0; i < filters.length; i++) { for (FileFilter filter : filters) {
fileChooser.removeChoosableFileFilter(filters[i]); fileChooser.removeChoosableFileFilter(filter);
} }
fileChooser.addChoosableFileFilter(new PamAudioFileFilter()); fileChooser.addChoosableFileFilter(new PamAudioFileFilter());
@ -407,8 +406,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
* @param newFile * @param newFile
*/ */
public void interpretNewFile(String newFile){ public void interpretNewFile(String newFile){
if (newFile == null) return; if ((newFile == null) || (newFile.length() == 0)) return;
if (newFile.length() == 0) return;
File file = new File(newFile); File file = new File(newFile);
@ -511,24 +509,29 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
return false; return false;
} }
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return fileInputParameters; return fileInputParameters;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return FileInputParameters.serialVersionUID; return FileInputParameters.serialVersionUID;
} }
@Override
public String getUnitName() { public String getUnitName() {
// return "File Input System"; // return "File Input System";
return acquisitionControl.getUnitName(); return acquisitionControl.getUnitName();
} }
@Override
public String getUnitType() { public String getUnitType() {
// return "Acquisition System"; // return "Acquisition System";
return "File Input System"; return "File Input System";
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
// if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) { // if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) {
fileInputParameters = ((FileInputParameters) pamControlledUnitSettings.getSettings()).clone(); fileInputParameters = ((FileInputParameters) pamControlledUnitSettings.getSettings()).clone();
@ -561,7 +564,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
// if (fileInputParameters.recentFiles == null) return false; // if (fileInputParameters.recentFiles == null) return false;
// if (fileInputParameters.recentFiles.size() < 1) return false; // if (fileInputParameters.recentFiles.size() < 1) return false;
// String fileName = fileInputParameters.recentFiles.get(0); // String fileName = fileInputParameters.recentFiles.get(0);
if (runFileAnalysis() == false) { if (!runFileAnalysis()) {
return false; return false;
} }
return true; return true;
@ -569,8 +572,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
public File getCurrentFile() { public File getCurrentFile() {
// System.out.println("fileInputParameters: " + fileInputParameters); // System.out.println("fileInputParameters: " + fileInputParameters);
if (fileInputParameters.recentFiles == null) return null; if ((fileInputParameters.recentFiles == null) || (fileInputParameters.recentFiles.size() < 1)) return null;
if (fileInputParameters.recentFiles.size() < 1) return null;
String fileName = fileInputParameters.recentFiles.get(0); String fileName = fileInputParameters.recentFiles.get(0);
return new File(fileName); return new File(fileName);
} }
@ -875,7 +877,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
@Override @Override
public void processPCM(ByteData byteData) { public void processPCM(ByteData byteData) {
if (dontStop == false) { if (!dontStop) {
try { try {
fileStream.close(); // will make the flac reader bomb out ! fileStream.close(); // will make the flac reader bomb out !
} }
@ -923,7 +925,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
} }
while (newDataUnits.getQueueSize() > 3*nChannels) { while (newDataUnits.getQueueSize() > 3*nChannels) {
if (dontStop == false) break; if (!dontStop) break;
try { try {
Thread.sleep(2); Thread.sleep(2);
} catch (Exception ex) { } catch (Exception ex) {
@ -943,6 +945,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
public class CollectorThread implements Runnable { public class CollectorThread implements Runnable {
@Override
public void run() { public void run() {
if (audioFormat.getEncoding() == FlacEncoding.FLAC) { if (audioFormat.getEncoding() == FlacEncoding.FLAC) {
collectFlacData(); collectFlacData();
@ -1051,7 +1054,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
* unit, then set it's reference to zero. * unit, then set it's reference to zero.
*/ */
while (newDataUnits.getQueueSize() > 3*nChannels) { while (newDataUnits.getQueueSize() > 3*nChannels) {
if (dontStop == false) break; if (!dontStop) break;
try { try {
Thread.sleep(1); Thread.sleep(1);
} catch (Exception ex) { } catch (Exception ex) {
@ -1079,7 +1082,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
} }
} }
// note the reason why the file has ended. // note the reason why the file has ended.
if (dontStop == false) { // stop button pressed if (!dontStop) { // stop button pressed
setStreamStatus(STREAM_PAUSED); setStreamStatus(STREAM_PAUSED);
} }
else { // file ended, since dont stop is true. else { // file ended, since dont stop is true.
@ -1100,7 +1103,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
* @return * @return
*/ */
protected boolean openNextFile(long totalSamples) { protected boolean openNextFile(long totalSamples) {
if (fileInputParameters.repeatLoop == false) { if (!fileInputParameters.repeatLoop) {
return false; return false;
} }
// otherwise, open the same file again. // otherwise, open the same file again.

View File

@ -7,7 +7,6 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import simulatedAcquisition.SimProcess;
/** /**
* Control parameters for FolderInputSystem * Control parameters for FolderInputSystem

View File

@ -24,16 +24,14 @@ import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.Timer; import javax.swing.Timer;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import Acquisition.filedate.FileDateDialogStrip; import Acquisition.filedate.FileDateDialogStrip;
import Acquisition.layoutFX.AcquisitionPaneFX; import Acquisition.layoutFX.AcquisitionPaneFX;
import Acquisition.layoutFX.DAQSettingsPane; import Acquisition.layoutFX.DAQSettingsPane;
import Acquisition.layoutFX.FolderInputPane; import Acquisition.layoutFX.FolderInputPane;
import javafx.application.Platform;
import pamguard.GlobalArguments;
import Acquisition.pamAudio.PamAudioFileManager;
import Acquisition.pamAudio.PamAudioFileFilter; import Acquisition.pamAudio.PamAudioFileFilter;
import Acquisition.pamAudio.PamAudioFileLoader; import Acquisition.pamAudio.PamAudioFileLoader;
import Acquisition.pamAudio.PamAudioSystem; import Acquisition.pamAudio.PamAudioFileManager;
import PamController.DataInputStore; import PamController.DataInputStore;
import PamController.InputStoreInfo; import PamController.InputStoreInfo;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
@ -52,6 +50,8 @@ import PamView.dialog.PamLabel;
import PamView.panel.PamPanel; import PamView.panel.PamPanel;
import PamView.panel.PamProgressBar; import PamView.panel.PamProgressBar;
import PamguardMVC.debug.Debug; import PamguardMVC.debug.Debug;
import javafx.application.Platform;
import pamguard.GlobalArguments;
/** /**
* Read multiple files in sequence. Options exist to either pause and * Read multiple files in sequence. Options exist to either pause and
@ -70,7 +70,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
private boolean running = false; private boolean running = false;
protected ArrayList<WavFileType> allFiles = new ArrayList<WavFileType>(); protected ArrayList<WavFileType> allFiles = new ArrayList<>();
protected int currentFile; protected int currentFile;
@ -109,7 +109,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
@Override @Override
public boolean prepareInputFile() { public boolean prepareInputFile() {
boolean ans = super.prepareInputFile(); boolean ans = super.prepareInputFile();
if (ans == false && ++currentFile < allFiles.size()) { if (!ans && ++currentFile < allFiles.size()) {
System.out.println("Failed to open sound file. Try again with file " + allFiles.get(currentFile).getName()); System.out.println("Failed to open sound file. Try again with file " + allFiles.get(currentFile).getName());
/* /*
* jumping striaght to the next file messes it up if it thinks the files * jumping striaght to the next file messes it up if it thinks the files
@ -148,7 +148,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
} }
// see if it at least exists, though will we want to do this for Network folders ? // see if it at least exists, though will we want to do this for Network folders ?
File aFile = new File(globalFolder); File aFile = new File(globalFolder);
if (aFile.exists() == false) { if (!aFile.exists()) {
System.err.printf("Command line wav folder \"%s\" does not exist", globalFolder); System.err.printf("Command line wav folder \"%s\" does not exist", globalFolder);
// return null; // return null;
} }
@ -168,6 +168,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
*/ */
class RestartTimer implements ActionListener { class RestartTimer implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// System.out.println("Restart later time action"); // System.out.println("Restart later time action");
@ -306,6 +307,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
class FindAudioFolder implements ActionListener { class FindAudioFolder implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
selectFolder(); selectFolder();
@ -670,7 +672,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
@Override @Override
protected boolean openNextFile(long totalSamples) { protected boolean openNextFile(long totalSamples) {
boolean ans = false; boolean ans = false;
if (folderInputParameters.mergeFiles == false) return false; if (!folderInputParameters.mergeFiles) return false;
long currFileStart = 0; long currFileStart = 0;
@ -720,7 +722,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
* itself if we use the super.prep .... * itself if we use the super.prep ....
*/ */
ans = super.prepareInputFile(); ans = super.prepareInputFile();
if (ans == false) { if (!ans) {
return false; return false;
} }
currentFileStart = System.currentTimeMillis(); currentFileStart = System.currentTimeMillis();
@ -746,7 +748,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
} }
if (currentFile < allFiles.size()) { if (currentFile < allFiles.size()) {
// only restart if the file ended - not if it stopped // only restart if the file ended - not if it stopped
if (getStreamStatus() == STREAM_ENDED && PamController.getInstance().isManualStop() == false) { if (getStreamStatus() == STREAM_ENDED && !PamController.getInstance().isManualStop()) {
// System.out.println(String.format("Start new file timer (file %d/%d)",currentFile+1,allFiles.size())); // System.out.println(String.format("Start new file timer (file %d/%d)",currentFile+1,allFiles.size()));
newFileTimer.start(); newFileTimer.start();
} }
@ -918,6 +920,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
/****JavaFX bits***/ /****JavaFX bits***/
@Override
public DAQSettingsPane getDAQSpecificPane(AcquisitionPaneFX acquisitionPaneFX) { public DAQSettingsPane getDAQSpecificPane(AcquisitionPaneFX acquisitionPaneFX) {
if (folderInputPane==null) this.folderInputPane = new FolderInputPane(this, acquisitionPaneFX); if (folderInputPane==null) this.folderInputPane = new FolderInputPane(this, acquisitionPaneFX);
return folderInputPane; return folderInputPane;
@ -1015,6 +1018,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
/** /**
* Get a status update for batch processing. * Get a status update for batch processing.
*/ */
@Override
public String getBatchStatus() { public String getBatchStatus() {
int nFiles = 0; int nFiles = 0;
if (allFiles != null) { if (allFiles != null) {

View File

@ -8,16 +8,13 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import PamDetection.RawDataUnit; import PamDetection.RawDataUnit;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamRawDataBlock; import PamguardMVC.PamRawDataBlock;
import binaryFileStorage.BinaryDataSource; import binaryFileStorage.BinaryDataSource;
import binaryFileStorage.BinaryHeader; import binaryFileStorage.BinaryHeader;
import binaryFileStorage.BinaryObjectData; import binaryFileStorage.BinaryObjectData;
import binaryFileStorage.BinaryOutputStream;
import binaryFileStorage.ModuleFooter; import binaryFileStorage.ModuleFooter;
import binaryFileStorage.ModuleHeader; import binaryFileStorage.ModuleHeader;
import binaryFileStorage.PackedBinaryObject;
/** /**
* Data source for Raw acoustic data. This is set up to NEVER * Data source for Raw acoustic data. This is set up to NEVER

View File

@ -10,11 +10,9 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioFormat.Encoding;
import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.UnsupportedAudioFileException;
import javax.sound.sampled.AudioFormat.Encoding;
import javax.swing.filechooser.FileFilter;
//import org.kc7bfi.jflac.FLACDecoder; //import org.kc7bfi.jflac.FLACDecoder;
//import org.kc7bfi.jflac.PCMProcessor; //import org.kc7bfi.jflac.PCMProcessor;
@ -25,15 +23,14 @@ import org.jflac.PCMProcessor;
import org.jflac.metadata.StreamInfo; import org.jflac.metadata.StreamInfo;
import org.jflac.util.ByteData; import org.jflac.util.ByteData;
import wavFiles.ByteConverter;
import Acquisition.pamAudio.PamAudioFileManager;
import Acquisition.pamAudio.PamAudioFileFilter; import Acquisition.pamAudio.PamAudioFileFilter;
import Acquisition.pamAudio.PamAudioSystem; import Acquisition.pamAudio.PamAudioFileManager;
import PamDetection.RawDataUnit; import PamDetection.RawDataUnit;
import PamUtils.FileParts; import PamUtils.FileParts;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.PamFileFilter; import PamUtils.PamFileFilter;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import wavFiles.ByteConverter;
/** /**
* Bespoke system for handling data from the Rona hydrophone array which * Bespoke system for handling data from the Rona hydrophone array which
@ -98,7 +95,7 @@ public class RonaInputSystem extends FolderInputSystem {
@Override @Override
public boolean accept(File f) { public boolean accept(File f) {
if (super.accept(f) == false) { if (!super.accept(f)) {
return false; return false;
} }
if (f.isDirectory()) { if (f.isDirectory()) {
@ -245,7 +242,7 @@ public class RonaInputSystem extends FolderInputSystem {
@Override @Override
public boolean prepareSystem(AcquisitionControl daqControl) { public boolean prepareSystem(AcquisitionControl daqControl) {
this.acquisitionControl = daqControl; this.acquisitionControl = daqControl;
if (prepareInputFile() == false) { if (!prepareInputFile()) {
return false; return false;
} }
this.newDataUnits = acquisitionControl.getDaqProcess().getNewDataQueue(); this.newDataUnits = acquisitionControl.getDaqProcess().getNewDataQueue();
@ -368,7 +365,7 @@ public class RonaInputSystem extends FolderInputSystem {
newDataUnits.addNewData(readyDataUnits[i]); newDataUnits.addNewData(readyDataUnits[i]);
} }
while (newDataUnits.getQueueSize() > NCHANNELS) { while (newDataUnits.getQueueSize() > NCHANNELS) {
if (dontStop == false) break; if (!dontStop) break;
try { try {
Thread.sleep(2); Thread.sleep(2);
} catch (Exception ex) { } catch (Exception ex) {
@ -403,7 +400,7 @@ public class RonaInputSystem extends FolderInputSystem {
@Override @Override
public void processPCM(ByteData byteData) { public void processPCM(ByteData byteData) {
if (dontStop == false) { if (!dontStop) {
try { try {
fileStream.close(); // will make the flac reader bomb out ! fileStream.close(); // will make the flac reader bomb out !
} }
@ -443,7 +440,7 @@ public class RonaInputSystem extends FolderInputSystem {
// newDataUnit.timeMilliseconds = blockMillis; // newDataUnit.timeMilliseconds = blockMillis;
PamCalendar.setSoundFileTimeInMillis(blockMillis); PamCalendar.setSoundFileTimeInMillis(blockMillis);
if (fileSamples > 0 && totalSamples - lastProgressUpdate >= getSampleRate()*2) { if (fileSamples > 0 && totalSamples - lastProgressUpdate >= getSampleRate()*2) {
int progress = (int) (1000. * (float)theseFileSamples / (float) fileSamples); int progress = (int) (1000. * theseFileSamples / fileSamples);
fileProgress.setValue(progress); fileProgress.setValue(progress);
sayEta(); sayEta();
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
@ -464,7 +461,7 @@ public class RonaInputSystem extends FolderInputSystem {
*/ */
for (int ichan = 0; ichan < 1; ichan++) { for (int ichan = 0; ichan < 1; ichan++) {
while (waitingDataUnit(ichan+channelOffset)) { while (waitingDataUnit(ichan+channelOffset)) {
if (dontStop == false) break; if (!dontStop) break;
try { try {
Thread.sleep(2); Thread.sleep(2);
} catch (Exception ex) { } catch (Exception ex) {

View File

@ -5,7 +5,6 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import simulatedAcquisition.SimProcess;
/** /**
* Used by SoundCardSystem * Used by SoundCardSystem

View File

@ -8,6 +8,7 @@ import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer;
import javax.sound.sampled.Mixer.Info;
import javax.sound.sampled.TargetDataLine; import javax.sound.sampled.TargetDataLine;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -16,15 +17,14 @@ import javax.swing.border.TitledBorder;
import Acquisition.layoutFX.AcquisitionPaneFX; import Acquisition.layoutFX.AcquisitionPaneFX;
import Acquisition.layoutFX.DAQSettingsPane; import Acquisition.layoutFX.DAQSettingsPane;
import Acquisition.layoutFX.SoundCardDAQPane; import Acquisition.layoutFX.SoundCardDAQPane;
import soundPlayback.PlaybackControl;
import soundPlayback.PlaybackSystem;
import soundPlayback.SoundCardPlayback;
import wavFiles.ByteConverter;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamDetection.RawDataUnit; import PamDetection.RawDataUnit;
import PamguardMVC.debug.Debug; import soundPlayback.PlaybackControl;
import soundPlayback.PlaybackSystem;
import soundPlayback.SoundCardPlayback;
import wavFiles.ByteConverter;
/** /**
* Everything and everything to do with controlling and reading sound cards. * Everything and everything to do with controlling and reading sound cards.
@ -129,7 +129,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
// lineOk = false; // lineOk = false;
// } // }
// if the 24 bit recording failed, then try to open for 16 bit recording. // if the 24 bit recording failed, then try to open for 16 bit recording.
if (lineOk == false) { if (!lineOk) {
audioFormat = new AudioFormat(sampleRate, 16, daqChannels, true, true); audioFormat = new AudioFormat(sampleRate, 16, daqChannels, true, true);
try { try {
targetDataLine.open(audioFormat); targetDataLine.open(audioFormat);
@ -225,12 +225,12 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
public static ArrayList<Mixer.Info> getInputMixerList() { public static ArrayList<Mixer.Info> getInputMixerList() {
ArrayList<Mixer.Info> mixers = new ArrayList<Mixer.Info>(); ArrayList<Mixer.Info> mixers = new ArrayList<>();
AudioSystem.getMixerInfo(); AudioSystem.getMixerInfo();
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
Mixer mixer; Mixer mixer;
for (int i = 0; i < mixerInfo.length; i++) { for (Info element : mixerInfo) {
mixer = AudioSystem.getMixer(mixerInfo[i]); mixer = AudioSystem.getMixer(element);
//System.out.println("mixer:"+mixer); //System.out.println("mixer:"+mixer);
//System.out.println(mixer.getClass().getName()); //System.out.println(mixer.getClass().getName());
//System.out.println("mixer info:"+mixerInfo[i]); //System.out.println("mixer info:"+mixerInfo[i]);
@ -241,20 +241,20 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
if ( (mixer.getClass().getName().equals("com.sun.media.sound.DirectAudioDevice")) || if ( (mixer.getClass().getName().equals("com.sun.media.sound.DirectAudioDevice")) ||
(mixer.getClass().getName().equals("com.sun.media.sound.SimpleInputDevice"))) { (mixer.getClass().getName().equals("com.sun.media.sound.SimpleInputDevice"))) {
//System.out.println("Adding to input mixer list:"+mixer.getClass().getName()); //System.out.println("Adding to input mixer list:"+mixer.getClass().getName());
mixers.add(mixerInfo[i]); mixers.add(element);
} }
} }
} }
return mixers; return mixers;
} }
public static ArrayList<Mixer.Info> getOutputMixerList() { public static ArrayList<Mixer.Info> getOutputMixerList() {
ArrayList<Mixer.Info> mixers = new ArrayList<Mixer.Info>(); ArrayList<Mixer.Info> mixers = new ArrayList<>();
AudioSystem.getMixerInfo(); AudioSystem.getMixerInfo();
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
Mixer mixer; Mixer mixer;
for (int i = 0; i < mixerInfo.length; i++) { for (Info element : mixerInfo) {
try { try {
mixer = AudioSystem.getMixer(mixerInfo[i]); mixer = AudioSystem.getMixer(element);
} }
catch (Exception e) { catch (Exception e) {
continue; continue;
@ -268,7 +268,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
if ((mixer.getClass().getName().equals("com.sun.media.sound.DirectAudioDevice")) || if ((mixer.getClass().getName().equals("com.sun.media.sound.DirectAudioDevice")) ||
(mixer.getClass().getName().equals("com.sun.media.sound.HeadspaceMixer"))) { (mixer.getClass().getName().equals("com.sun.media.sound.HeadspaceMixer"))) {
//System.out.println(mixer.getClass().getName()); //System.out.println(mixer.getClass().getName());
mixers.add(mixerInfo[i]); mixers.add(element);
// Debug.out.printf("Use mixer %d, %s\n", i, mixerInfo[i].getName()); // Debug.out.printf("Use mixer %d, %s\n", i, mixerInfo[i].getName());
} }
// else { // else {
@ -283,7 +283,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
} }
public static ArrayList<String> getDevicesList() { public static ArrayList<String> getDevicesList() {
ArrayList<String> devices = new ArrayList<String>(); ArrayList<String> devices = new ArrayList<>();
ArrayList<Mixer.Info> mixers = getInputMixerList(); ArrayList<Mixer.Info> mixers = getInputMixerList();
for (int i = 0; i < mixers.size(); i++) { for (int i = 0; i < mixers.size(); i++) {
//System.out.println("Adding Device:"+mixers.get(i).getName()); //System.out.println("Adding Device:"+mixers.get(i).getName());
@ -306,9 +306,9 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
ArrayList<String> devices = getDevicesList(); ArrayList<String> devices = getDevicesList();
audioDevices.removeAllItems(); audioDevices.removeAllItems();
for (int i = 0; i < devices.size(); i++) { for (String element : devices) {
//System.out.println("Adding to audio device:"+devices.get(i)); //System.out.println("Adding to audio device:"+devices.get(i));
audioDevices.addItem(devices.get(i)); audioDevices.addItem(element);
} }
soundCardParameters.deviceNumber = Math.max(Math.min(devices.size()-1, soundCardParameters.deviceNumber), 0); soundCardParameters.deviceNumber = Math.max(Math.min(devices.size()-1, soundCardParameters.deviceNumber), 0);
@ -396,24 +396,29 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
return PARAMETER_UNKNOWN; return PARAMETER_UNKNOWN;
} }
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return soundCardParameters; return soundCardParameters;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return SoundCardParameters.serialVersionUID; return SoundCardParameters.serialVersionUID;
} }
@Override
public String getUnitName() { public String getUnitName() {
// return "Sound Card System"; // return "Sound Card System";
return acquisitionControl.getUnitName(); return acquisitionControl.getUnitName();
} }
@Override
public String getUnitType() { public String getUnitType() {
// return "Acquisition System"; // return "Acquisition System";
return "Sound Card System"; return "Sound Card System";
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
// if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) { // if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) {
try { try {
@ -447,6 +452,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
class CaptureThread implements Runnable { class CaptureThread implements Runnable {
@Override
public void run() { public void run() {
stopCapture = false; stopCapture = false;
captureRunning = true; captureRunning = true;

View File

@ -24,7 +24,7 @@ public class WavFileFuncs extends AudioFileFuncs {
e.printStackTrace(); e.printStackTrace();
} }
if (wavHead.checkSizes(aFile.length()) == false) { if (!wavHead.checkSizes(aFile.length())) {
wavHead.repairSizes(aFile.length()); wavHead.repairSizes(aFile.length());
return writeNewSizes(wavHead, aFile); return writeNewSizes(wavHead, aFile);
} }

View File

@ -28,7 +28,7 @@ public class WavHeader {
public void addChunkData(WavChunkData chunkData) { public void addChunkData(WavChunkData chunkData) {
if (otherChunks == null) { if (otherChunks == null) {
otherChunks = new ArrayList<WavChunkData>(); otherChunks = new ArrayList<>();
} }
otherChunks.add(chunkData); otherChunks.add(chunkData);
int t = chunkData.getType(); int t = chunkData.getType();

View File

@ -16,7 +16,6 @@ import java.io.Serializable;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.util.List;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@ -29,15 +28,12 @@ import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import soundPlayback.PlaybackControl;
import soundPlayback.PlaybackSystem;
import soundPlayback.SoundCardPlayback;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamDetection.RawDataUnit; import PamDetection.RawDataUnit;
import hfDaqCard.SmruDaqParameters; import soundPlayback.PlaybackControl;
import soundPlayback.PlaybackSystem;
/** /**
@ -385,7 +381,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
int combValue; int combValue;
/* Get the proper CRC index */ /* Get the proper CRC index */
combValue = (int) ((( accum & 0xFF) ^ (data & 0xFF)) & 0xFF); combValue = (( accum & 0xFF) ^ (data & 0xFF)) & 0xFF;
/* Use the CRC table and the index found to update the accumulator accordingly */ /* Use the CRC table and the index found to update the accumulator accordingly */
accum = (char) ((accum >> 8) ^ crc16_table [(combValue & 0xFF)]); accum = (char) ((accum >> 8) ^ crc16_table [(combValue & 0xFF)]);
@ -422,6 +418,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
* processing to match the required PAMGUARD RawDataUnit (-1,+1) * processing to match the required PAMGUARD RawDataUnit (-1,+1)
* and passes it to PAMGUARD using the newDataUnits list * and passes it to PAMGUARD using the newDataUnits list
*/ */
@Override
public void run() public void run()
{ {
/* buffer to receive data from message queue */ /* buffer to receive data from message queue */
@ -482,7 +479,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
printStreamMessageBuffer(buffer); printStreamMessageBuffer(buffer);
} }
payloadLen = (int) (((msg.payloadLength[0] & 0xFF) << 8) | (msg.payloadLength[1] & 0xFF)); payloadLen = ((msg.payloadLength[0] & 0xFF) << 8) | (msg.payloadLength[1] & 0xFF);
/* Check for the message type */ /* Check for the message type */
if(msg.type == TYPE_HEADER) if(msg.type == TYPE_HEADER)
@ -492,8 +489,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
for(payloadIndex = 0; payloadIndex < payloadLen; payloadIndex += chunkLen + CHUNK_PAYLOAD_OFFSET) for(payloadIndex = 0; payloadIndex < payloadLen; payloadIndex += chunkLen + CHUNK_PAYLOAD_OFFSET)
{ {
/* get the chunk length */ /* get the chunk length */
chunkLen = (int)(((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8) chunkLen = ((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8)
| (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF)); | (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF);
if(DEBUG) if(DEBUG)
@ -555,10 +552,10 @@ public class icListenSystem extends DaqSystem implements PamSettings
break; break;
case SCALING_CHUNK: case SCALING_CHUNK:
/* get the max amplitude */ /* get the max amplitude */
maxAmplitude = (double)((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET] << 24) maxAmplitude = (msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET] << 24)
| ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 1] & 0xFF) << 16) | ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 1] & 0xFF) << 16)
| ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 2] & 0xFF) << 8 ) | ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 2] & 0xFF) << 8 )
| ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 3] & 0xFF)) ); | ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 3] & 0xFF));
if(DEBUG) if(DEBUG)
{ {
System.out.println("Max Amplitude: " + maxAmplitude); System.out.println("Max Amplitude: " + maxAmplitude);
@ -575,8 +572,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
for(payloadIndex = 0; payloadIndex < payloadLen; payloadIndex += chunkLen + CHUNK_PAYLOAD_OFFSET) for(payloadIndex = 0; payloadIndex < payloadLen; payloadIndex += chunkLen + CHUNK_PAYLOAD_OFFSET)
{ {
/* get the length of the chunk */ /* get the length of the chunk */
chunkLen = (int)(((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8) chunkLen = ((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8)
| (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF)); | (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF);
if(DEBUG) if(DEBUG)
{ {
@ -615,8 +612,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
if(eventKeyMatch) if(eventKeyMatch)
{ {
/* get the number of samples */ /* get the number of samples */
doubleBufLen = (int)(((msg.payload[payloadIndex + DATA_SAMPLES_OFFSET] & 0xFF) << 8) doubleBufLen = ((msg.payload[payloadIndex + DATA_SAMPLES_OFFSET] & 0xFF) << 8)
| (msg.payload[payloadIndex + DATA_SAMPLES_OFFSET + 1] & 0xFF)); | (msg.payload[payloadIndex + DATA_SAMPLES_OFFSET + 1] & 0xFF);
/* Check if any samples where missed since the header /* Check if any samples where missed since the header
* by comparing the sample number to the tally minus the sequence number */ * by comparing the sample number to the tally minus the sequence number */
@ -627,7 +624,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
); );
/* check if any samples were missed */ /* check if any samples were missed */
if( (long)sampleNumber != (sampleTally - sequenceNumber)) if( sampleNumber != (sampleTally - sequenceNumber))
{ {
System.out.println("Missed samples!\nSample number: " + sampleNumber System.out.println("Missed samples!\nSample number: " + sampleNumber
+ " Samples since header: " + (sampleTally - sequenceNumber)); + " Samples since header: " + (sampleTally - sequenceNumber));
@ -635,7 +632,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
} }
/* update the sample tally */ /* update the sample tally */
sampleTally = sampleTally + (long)doubleBufLen; sampleTally = sampleTally + doubleBufLen;
if(DEBUG) if(DEBUG)
{ {
@ -649,10 +646,9 @@ public class icListenSystem extends DaqSystem implements PamSettings
doubleIndex++, chunkIndex += 3) doubleIndex++, chunkIndex += 3)
{ {
/* get the samples */ /* get the samples */
sample = (int)(((msg.payload[chunkIndex + 2])& 0xFF) sample = ((msg.payload[chunkIndex + 2])& 0xFF)
| ((msg.payload[chunkIndex + 1] & 0xFF) << 8) | ((msg.payload[chunkIndex + 1] & 0xFF) << 8)
| ((msg.payload[chunkIndex] & 0xFF) << 16) | ((msg.payload[chunkIndex] & 0xFF) << 16);
);
if(DEBUG) if(DEBUG)
{ {
@ -696,12 +692,12 @@ public class icListenSystem extends DaqSystem implements PamSettings
/* add it as a new data unit */ /* add it as a new data unit */
//TODO add a shift to the channelBitmap that uses the current channel index //TODO add a shift to the channelBitmap that uses the current channel index
newDataUnit = new RawDataUnit(milliSec, 0x01, totalSamples, (long)doubleBufLen); newDataUnit = new RawDataUnit(milliSec, 0x01, totalSamples, doubleBufLen);
newDataUnit.setRawData(doubleBuf); newDataUnit.setRawData(doubleBuf);
newDataUnits.addNewData(newDataUnit); newDataUnits.addNewData(newDataUnit);
/* tally the total samples */ /* tally the total samples */
totalSamples += (long)doubleBufLen; totalSamples += doubleBufLen;
} }
break; break;
@ -758,6 +754,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
* Function where a message will be received and put into * Function where a message will be received and put into
* the message queue for future processing * the message queue for future processing
*/ */
@Override
public void run() public void run()
{ {
/* Data capture is running */ /* Data capture is running */
@ -1068,8 +1065,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
this.payloadLength = new char[PAYLOADLEN_ARRAY_LENGTH]; this.payloadLength = new char[PAYLOADLEN_ARRAY_LENGTH];
this.payloadLength[0] = (char) buf[2]; this.payloadLength[0] = (char) buf[2];
this.payloadLength[1] = (char) buf[3]; this.payloadLength[1] = (char) buf[3];
payloadLength = (int)((this.payloadLength[1] & 0xFF) payloadLength = (this.payloadLength[1] & 0xFF)
| ((this.payloadLength[0] & 0xFF) << 8)); | ((this.payloadLength[0] & 0xFF) << 8);
/* get payload */ /* get payload */
this.payload = new char[payloadLength]; this.payload = new char[payloadLength];
@ -1256,6 +1253,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
waveformBandwidth = new JComboBox(); waveformBandwidth = new JComboBox();
waveformBandwidth.addActionListener( waveformBandwidth.addActionListener(
new ActionListener () { new ActionListener () {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
/* update the sampleRate text field*/ /* update the sampleRate text field*/
currentSampleRateString = waveformBandwidth.getSelectedIndex(); currentSampleRateString = waveformBandwidth.getSelectedIndex();
@ -1640,8 +1638,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
} }
/* Message has been received and verified, obtain necessary information */ /* Message has been received and verified, obtain necessary information */
serialNum = (int)(buffer[SERIAL_NUM_OFFSET] | (buffer[SERIAL_NUM_OFFSET + 1] << 8)); serialNum = buffer[SERIAL_NUM_OFFSET] | (buffer[SERIAL_NUM_OFFSET + 1] << 8);
deviceType = (int)buffer[DEVICE_TYPE_OFFSET]; deviceType = buffer[DEVICE_TYPE_OFFSET];
if(DEBUG) if(DEBUG)
{ {
@ -1986,7 +1984,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
/* make sure the proper values are set in the acquisition control */ /* make sure the proper values are set in the acquisition control */
acquisitionControl.getDaqProcess().setSampleRate(currentSampleRate, true); acquisitionControl.getDaqProcess().setSampleRate(currentSampleRate, true);
dataUnitSamples = (int) (currentSampleRate / 10); dataUnitSamples = currentSampleRate / 10;
/* keep a reference to where data will be put. */ /* keep a reference to where data will be put. */
// DOUG changed type of this in latest version for some better queue management // DOUG changed type of this in latest version for some better queue management

View File

@ -37,14 +37,17 @@ public class AirgunControl extends PamControlledUnit implements PamSettings, Pos
airgunProcess.findSourceData(); airgunProcess.findSourceData();
} }
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return airgunParameters; return airgunParameters;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return AirgunParameters.serialVersionUID; return AirgunParameters.serialVersionUID;
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
if (pamControlledUnitSettings.getVersionNo() != AirgunParameters.serialVersionUID) { if (pamControlledUnitSettings.getVersionNo() != AirgunParameters.serialVersionUID) {
return false; return false;
@ -69,6 +72,7 @@ public class AirgunControl extends PamControlledUnit implements PamSettings, Pos
this.frame = frame; this.frame = frame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
AirgunParameters newParams = AirgunParametersDialog.showDialog(frame, airgunParameters); AirgunParameters newParams = AirgunParametersDialog.showDialog(frame, airgunParameters);

View File

@ -14,12 +14,12 @@ import PamUtils.Coordinate3d;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamView.BasicKeyItem; import PamView.BasicKeyItem;
import PamView.GeneralProjector; import PamView.GeneralProjector;
import PamView.GeneralProjector.ParameterType;
import PamView.GeneralProjector.ParameterUnits;
import PamView.PamKeyItem; import PamView.PamKeyItem;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.PamSymbolType; import PamView.PamSymbolType;
import PamView.PanelOverlayDraw; import PamView.PanelOverlayDraw;
import PamView.GeneralProjector.ParameterType;
import PamView.GeneralProjector.ParameterUnits;
import PamView.symbol.SymbolData; import PamView.symbol.SymbolData;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
@ -43,12 +43,14 @@ public class AirgunGraphics extends PanelOverlayDraw {
parameterTypes[1] == GeneralProjector.ParameterType.LONGITUDE); parameterTypes[1] == GeneralProjector.ParameterType.LONGITUDE);
} }
@Override
public PamKeyItem createKeyItem(GeneralProjector generalProjector,int keyType) { public PamKeyItem createKeyItem(GeneralProjector generalProjector,int keyType) {
return new BasicKeyItem(getPamSymbol(null, generalProjector), airgunControl.getUnitName()); return new BasicKeyItem(getPamSymbol(null, generalProjector), airgunControl.getUnitName());
} }
@Override
public Rectangle drawDataUnit(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) { public Rectangle drawDataUnit(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) {
AirgunDataUnit airgunDataUnit = (AirgunDataUnit) pamDataUnit; AirgunDataUnit airgunDataUnit = (AirgunDataUnit) pamDataUnit;
@ -224,6 +226,7 @@ public class AirgunGraphics extends PanelOverlayDraw {
return null; return null;
} }
@Override
public String getHoverText(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) { public String getHoverText(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) {
String str = "<html>" + airgunControl.getUnitName(); String str = "<html>" + airgunControl.getUnitName();
if (airgunControl.airgunParameters.showExclusionZone) { if (airgunControl.airgunParameters.showExclusionZone) {

View File

@ -78,11 +78,11 @@ public class AirgunParameters implements Serializable, Cloneable, ManagedParamet
public AirgunParameters clone() { public AirgunParameters clone() {
try { try {
AirgunParameters np = (AirgunParameters) super.clone(); AirgunParameters np = (AirgunParameters) super.clone();
if (np.hasGunsReferencePosition == false) { if (!np.hasGunsReferencePosition) {
// sort out what happens if old boolean ref was used // sort out what happens if old boolean ref was used
// instead of new int type. // instead of new int type.
np.hasGunsReferencePosition = true; np.hasGunsReferencePosition = true;
if (np.gunsThisVessel == false) { if (!np.gunsThisVessel) {
np.gunsReferencePosition = GUNS_AIS_VESSEL; np.gunsReferencePosition = GUNS_AIS_VESSEL;
} }
} }

View File

@ -17,6 +17,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JRadioButton; import javax.swing.JRadioButton;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.BevelBorder; import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
@ -94,8 +95,7 @@ public class AirgunParametersDialog extends PamDialog {
airgunParameters.dimE = dim[0]; airgunParameters.dimE = dim[0];
airgunParameters.dimF = dim[1]; airgunParameters.dimF = dim[1];
airgunParameters.gunDepth = dim[2]; airgunParameters.gunDepth = dim[2];
if (shipIDPanel.getParams() == false) return false; if (!shipIDPanel.getParams() || !exclusionPanel.getParams()) return false;
if (exclusionPanel.getParams() == false) return false;
return true; return true;
} }
@ -131,7 +131,7 @@ public class AirgunParametersDialog extends PamDialog {
c.gridy++; c.gridy++;
c.gridx = 0; c.gridx = 0;
c.gridwidth = 1; c.gridwidth = 1;
addComponent(this, new JLabel("Source vessel mmsi number ", JLabel.RIGHT), c); addComponent(this, new JLabel("Source vessel mmsi number ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(this, mmsiNumber = new JTextField(7), c); addComponent(this, mmsiNumber = new JTextField(7), c);
c.gridx = 0; c.gridx = 0;
@ -147,6 +147,7 @@ public class AirgunParametersDialog extends PamDialog {
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
enableControls(); enableControls();
} }
@ -248,11 +249,11 @@ public class AirgunParametersDialog extends PamDialog {
c.gridx = 0; c.gridx = 0;
c.gridy ++; c.gridy ++;
c.gridwidth = 1; c.gridwidth = 1;
addComponent(this, new JLabel("Predict ahead for ", JLabel.RIGHT), c); addComponent(this, new JLabel("Predict ahead for ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(this, predictionTime = new JTextField(6), c); addComponent(this, predictionTime = new JTextField(6), c);
c.gridx++; c.gridx++;
addComponent(this, new JLabel(" seconds ", JLabel.LEFT), c); addComponent(this, new JLabel(" seconds ", SwingConstants.LEFT), c);
} }
@ -282,6 +283,7 @@ public class AirgunParametersDialog extends PamDialog {
} }
return true; return true;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (e.getSource() == exButton) { if (e.getSource() == exButton) {
Color newColor = JColorChooser.showDialog(this, "Mitigation zone colour", Color newColor = JColorChooser.showDialog(this, "Mitigation zone colour",

View File

@ -7,11 +7,9 @@ import AIS.AISDataUnit;
import AIS.AISPositionReport; import AIS.AISPositionReport;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit; import GPS.GpsDataUnit;
import Map.MapCommentOverlayGraphics;
import PamController.PamController; import PamController.PamController;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.symbol.PamSymbolManager;
import PamView.symbol.StandardSymbolManager; import PamView.symbol.StandardSymbolManager;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;

View File

@ -8,6 +8,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
@ -16,6 +17,7 @@ import javax.swing.JPanel;
import javax.swing.JSplitPane; import javax.swing.JSplitPane;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileFilter;
import Acquisition.AcquisitionControl; import Acquisition.AcquisitionControl;
import Acquisition.AcquisitionParameters; import Acquisition.AcquisitionParameters;
import PamController.PamController; import PamController.PamController;
@ -170,7 +172,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
public boolean getParams() { public boolean getParams() {
// all OK, so // all OK, so
// move the selected array to the top of the list in the ArrayManager // move the selected array to the top of the list in the ArrayManager
if (okOK(true) == false) return false; if (!okOK(true)) return false;
PamArray array = hydrophoneDialogPanel.getDialogSelectedArray(); PamArray array = hydrophoneDialogPanel.getDialogSelectedArray();
ArrayManager.getArrayManager().setCurrentArray(array); ArrayManager.getArrayManager().setCurrentArray(array);
@ -179,7 +181,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
hydrophoneDialogPanel.getParams(); hydrophoneDialogPanel.getParams();
instrumentIdentityPanel.getParams(array); instrumentIdentityPanel.getParams(array);
if (checkDaqChannels(array) == false) { if (!checkDaqChannels(array)) {
return false; return false;
} }
@ -198,7 +200,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
ArrayList<AcquisitionControl> daqControllers = AcquisitionControl.getControllers(); ArrayList<AcquisitionControl> daqControllers = AcquisitionControl.getControllers();
boolean allOk = true; boolean allOk = true;
for (int i = 0; i < daqControllers.size(); i++) { for (int i = 0; i < daqControllers.size(); i++) {
if (checkDaqChannels(daqControllers.get(i), array) == false) { if (!checkDaqChannels(daqControllers.get(i), array)) {
allOk = false; allOk = false;
} }
} }
@ -238,7 +240,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
} }
return false; return false;
} }
else if (environmentPanel.getParams() == false) { else if (!environmentPanel.getParams()) {
return false; return false;
} }
@ -274,6 +276,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
deleteArrayButton.setEnabled(ArrayManager.getArrayManager().getArrayCount() > 1); deleteArrayButton.setEnabled(ArrayManager.getArrayManager().getArrayCount() > 1);
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (e.getSource() == cancelButton) { if (e.getSource() == cancelButton) {
this.setVisible(false); this.setVisible(false);

View File

@ -8,11 +8,9 @@ import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import javax.swing.JFrame; import javax.swing.JFrame;
import pamMaths.PamQuaternion;
import pamMaths.PamVector;
import userDisplay.UserDisplayControl;
import Array.importHydrophoneData.HydrophoneImport; import Array.importHydrophoneData.HydrophoneImport;
import Array.importHydrophoneData.StreamerImport; import Array.importHydrophoneData.StreamerImport;
import Array.layoutFX.ArrayGUIFX; import Array.layoutFX.ArrayGUIFX;
@ -26,6 +24,7 @@ import PamController.PamControlledUnit;
import PamController.PamControlledUnitGUI; import PamController.PamControlledUnitGUI;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamController;
import PamController.PamControllerInterface;
import PamController.PamGUIManager; import PamController.PamGUIManager;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
@ -40,6 +39,9 @@ import PamguardMVC.PamDataUnit;
import PamguardMVC.PamObservable; import PamguardMVC.PamObservable;
import PamguardMVC.PamObserver; import PamguardMVC.PamObserver;
import dataPlotsFX.data.TDDataProviderRegisterFX; import dataPlotsFX.data.TDDataProviderRegisterFX;
import pamMaths.PamQuaternion;
import pamMaths.PamVector;
import userDisplay.UserDisplayControl;
/** /**
* Manager for different array configurations. Each array configuration is * Manager for different array configurations. Each array configuration is
@ -169,32 +171,33 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
} }
private boolean initComplete = false; private boolean initComplete = false;
@Override
public void notifyModelChanged(int changeType) { public void notifyModelChanged(int changeType) {
if (changeType == PamController.INITIALIZATION_COMPLETE) { if (changeType == PamControllerInterface.INITIALIZATION_COMPLETE) {
initComplete = true; initComplete = true;
} }
getCurrentArray().notifyModelChanged(changeType, initComplete); getCurrentArray().notifyModelChanged(changeType, initComplete);
if (changeType == PamController.INITIALIZATION_COMPLETE) { if (changeType == PamControllerInterface.INITIALIZATION_COMPLETE) {
// create data units and save - is this needed in the viewer ? // create data units and save - is this needed in the viewer ?
// if (PamController.getInstance().getRunMode() == PamController.RUN_NORMAL) { // if (PamController.getInstance().getRunMode() == PamController.RUN_NORMAL) {
hydrophonesProcess.createArrayData(); hydrophonesProcess.createArrayData();
// } // }
} }
if (changeType == PamController.OFFLINE_DATA_LOADED){ if (changeType == PamControllerInterface.OFFLINE_DATA_LOADED){
if (isViewer) { if (isViewer) {
getHydrophoneDataBlock().clearChannelIterators(); getHydrophoneDataBlock().clearChannelIterators();
} }
} }
if (changeType == PamController.HYDROPHONE_ARRAY_CHANGED){ if (changeType == PamControllerInterface.HYDROPHONE_ARRAY_CHANGED){
if (isViewer) { if (isViewer) {
getHydrophoneDataBlock().clearChannelIterators(); getHydrophoneDataBlock().clearChannelIterators();
} }
} }
if (changeType == PamController.GLOBAL_MEDIUM_UPDATE){ if (changeType == PamControllerInterface.GLOBAL_MEDIUM_UPDATE){
this.getCurrentArray().setSpeedOfSound(this.getPamController().getGlobalMediumManager().getDefaultSoundSpeed()); this.getCurrentArray().setSpeedOfSound(this.getPamController().getGlobalMediumManager().getDefaultSoundSpeed());
this.getCurrentArray().setDefaultSensitivity(this.getPamController().getGlobalMediumManager().getDefaultRecieverSens()); this.getCurrentArray().setDefaultSensitivity(this.getPamController().getGlobalMediumManager().getDefaultRecieverSens());
} }
@ -229,7 +232,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
if (selectedArray != null) { if (selectedArray != null) {
hydrophonesProcess.createArrayData(); hydrophonesProcess.createArrayData();
// need to tell all modules that the array may have changed. // need to tell all modules that the array may have changed.
PamController.getInstance().notifyModelChanged(PamController.HYDROPHONE_ARRAY_CHANGED); PamController.getInstance().notifyModelChanged(PamControllerInterface.HYDROPHONE_ARRAY_CHANGED);
} }
} }
@ -257,6 +260,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
/* (non-Javadoc) /* (non-Javadoc)
* @see PamController.PamSettings#GetSettingsReference() * @see PamController.PamSettings#GetSettingsReference()
*/ */
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
/* /*
* Save the entire array classes in the serialised file * Save the entire array classes in the serialised file
@ -275,6 +279,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
/* (non-Javadoc) /* (non-Javadoc)
* @see PamController.PamSettings#GetSettingsVersion() * @see PamController.PamSettings#GetSettingsVersion()
*/ */
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return ArrayParameters.serialVersionUID; return ArrayParameters.serialVersionUID;
} }
@ -282,6 +287,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
/* (non-Javadoc) /* (non-Javadoc)
* @see PamController.PamSettings#GetUnitName() * @see PamController.PamSettings#GetUnitName()
*/ */
@Override
public String getUnitName() { public String getUnitName() {
return "Array Manager"; return "Array Manager";
} }
@ -289,6 +295,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
/* (non-Javadoc) /* (non-Javadoc)
* @see PamController.PamSettings#getUnitType() * @see PamController.PamSettings#getUnitType()
*/ */
@Override
public String getUnitType() { public String getUnitType() {
return "Array Manager"; return "Array Manager";
} }
@ -296,6 +303,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
/* (non-Javadoc) /* (non-Javadoc)
* @see PamController.PamSettings#RestoreSettings(PamController.PamControlledUnitSettings) * @see PamController.PamSettings#RestoreSettings(PamController.PamControlledUnitSettings)
*/ */
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
try { try {
if (pamControlledUnitSettings.getSettings() != null) { if (pamControlledUnitSettings.getSettings() != null) {
@ -385,23 +393,28 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
// } // }
// } // }
@Override
public String getObserverName() { public String getObserverName() {
return "Array Manager"; return "Array Manager";
} }
@Override
public long getRequiredDataHistory(PamObservable o, Object arg) { public long getRequiredDataHistory(PamObservable o, Object arg) {
// would be better to work out how long the Gps data are being kept for and do the same // would be better to work out how long the Gps data are being kept for and do the same
return 3600*1000; return 3600*1000;
} }
@Override
public void noteNewSettings() { public void noteNewSettings() {
} }
@Override
public void removeObservable(PamObservable o) { public void removeObservable(PamObservable o) {
} }
@Override
public void setSampleRate(float sampleRate, boolean notify) { public void setSampleRate(float sampleRate, boolean notify) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@ -659,10 +672,10 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
} }
// need to find the direction vector for the plane. // need to find the direction vector for the plane.
// can do this by finding any non zero vector product. // can do this by finding any non zero vector product.
PamVector planePerpendicular = null;; PamVector planePerpendicular = null;
for (int i = 0; i < nPairs; i++) { for (int i = 0; i < nPairs; i++) {
for (int j = (i+1); j < nPairs; j++) { for (int j = (i+1); j < nPairs; j++) {
if (vectorPairs[i].isParallel(vectorPairs[j]) == false) { if (!vectorPairs[i].isParallel(vectorPairs[j])) {
planePerpendicular = vectorPairs[i].vecProd(vectorPairs[j]); planePerpendicular = vectorPairs[i].vecProd(vectorPairs[j]);
break; break;
} }
@ -771,7 +784,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
int nPairs = pvs.length; int nPairs = pvs.length;
for (int i = 0; i < nPairs; i++) { for (int i = 0; i < nPairs; i++) {
for (int j = i+1; j < nPairs; j++) { for (int j = i+1; j < nPairs; j++) {
if (pvs[i].isInLine(pvs[j]) == false) { if (!pvs[i].isInLine(pvs[j])) {
return false; return false;
} }
} }

View File

@ -1,7 +1,6 @@
package Array; package Array;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Modifier;
import java.util.ArrayList; import java.util.ArrayList;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;

View File

@ -9,7 +9,7 @@ import Array.sensors.swing.ArrayDisplayParamsDialog;
import Array.swing.sidepanel.ArraySidePanel; import Array.swing.sidepanel.ArraySidePanel;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamControllerInterface;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
@ -45,13 +45,13 @@ public class ArraySidePanelControl extends PamControlledUnit implements ArrayDis
public void notifyModelChanged(int changeType) { public void notifyModelChanged(int changeType) {
super.notifyModelChanged(changeType); super.notifyModelChanged(changeType);
switch (changeType) { switch (changeType) {
case PamController.INITIALIZATION_COMPLETE: case PamControllerInterface.INITIALIZATION_COMPLETE:
case PamController.HYDROPHONE_ARRAY_CHANGED: case PamControllerInterface.HYDROPHONE_ARRAY_CHANGED:
if (arraySidePanel != null) { if (arraySidePanel != null) {
arraySidePanel.update(); arraySidePanel.update();
} }
break; break;
case PamController.NEW_SCROLL_TIME: case PamControllerInterface.NEW_SCROLL_TIME:
if (isViewer()) { if (isViewer()) {
arraySidePanel.updateViewerTime(PamCalendar.getTimeInMillis()); arraySidePanel.updateViewerTime(PamCalendar.getTimeInMillis());
} }

View File

@ -59,6 +59,7 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
channelTableData.fireTableDataChanged(); channelTableData.fireTableDataChanged();
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (e.getSource() == daqControllerList) { if (e.getSource() == daqControllerList) {
selectDaqController(); selectDaqController();
@ -167,10 +168,12 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
class ChannelTableData extends AbstractTableModel { class ChannelTableData extends AbstractTableModel {
@Override
public int getColumnCount() { public int getColumnCount() {
return channelColumns.length; return channelColumns.length;
} }
@Override
public int getRowCount() { public int getRowCount() {
if (acquisitionControl == null) return 0; if (acquisitionControl == null) return 0;
return (acquisitionControl.acquisitionParameters.nChannels); return (acquisitionControl.acquisitionParameters.nChannels);
@ -181,6 +184,7 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
return channelColumns[column]; return channelColumns[column];
} }
@Override
public Object getValueAt(int rowIndex, int columnIndex) { public Object getValueAt(int rowIndex, int columnIndex) {
if (acquisitionControl == null) return null; if (acquisitionControl == null) return null;
// see if the controller has a hydrophone list // see if the controller has a hydrophone list
@ -247,6 +251,7 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
/* (non-Javadoc) /* (non-Javadoc)
* @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent) * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
*/ */
@Override
public void valueChanged(ListSelectionEvent e) { public void valueChanged(ListSelectionEvent e) {
enableButtons(); enableButtons();
} }

View File

@ -1,7 +1,5 @@
package Array; package Array;
import GPS.GpsData;
public class EmptyLocatorSettings extends LocatorSettings { public class EmptyLocatorSettings extends LocatorSettings {
public EmptyLocatorSettings(Class locatorClass) { public EmptyLocatorSettings(Class locatorClass) {

View File

@ -30,9 +30,9 @@ import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import pamMaths.PamVector;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.PamSymbolType; import PamView.PamSymbolType;
import pamMaths.PamVector;
/** /**
* *

View File

@ -3,12 +3,11 @@ package Array;
import java.util.ListIterator; import java.util.ListIterator;
import GPS.NavDataSynchronisation; import GPS.NavDataSynchronisation;
import pamScrollSystem.ViewLoadObserver;
import PamController.PamController; import PamController.PamController;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.dataOffline.OfflineDataLoadInfo; import PamguardMVC.dataOffline.OfflineDataLoadInfo;
import pamScrollSystem.ViewLoadObserver;
public class HydrophoneDataBlock extends PamDataBlock<HydrophoneDataUnit> { public class HydrophoneDataBlock extends PamDataBlock<HydrophoneDataUnit> {
@ -104,7 +103,7 @@ public class HydrophoneDataBlock extends PamDataBlock<HydrophoneDataUnit> {
long difference; long difference;
ListIterator<HydrophoneDataUnit> listIterator = getListIterator(ITERATOR_END); ListIterator<HydrophoneDataUnit> listIterator = getListIterator(ITERATOR_END);
if (listIterator.hasPrevious() == false) { if (!listIterator.hasPrevious()) {
return null; return null;
} }
unit = listIterator.previous(); unit = listIterator.previous();

View File

@ -9,17 +9,19 @@ import java.awt.Point;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.util.Arrays; import java.util.Arrays;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import Acquisition.AcquisitionControl; import Acquisition.AcquisitionControl;
import GPS.GpsData; import GPS.GpsData;
import Layout.PamAxis; import Layout.PamAxis;
import Layout.PamAxisPanel; import Layout.PamAxisPanel;
import PamController.PamController; import PamController.PamController;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamView.PamColors.PamColor;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.PamSymbolType; import PamView.PamSymbolType;
import PamView.PamColors.PamColor;
import PamView.panel.PamBorder; import PamView.panel.PamBorder;
import pamMaths.PamVector; import pamMaths.PamVector;

View File

@ -25,8 +25,6 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
import Array.streamerOrigin.HydrophoneOriginMethod; import Array.streamerOrigin.HydrophoneOriginMethod;
import PamController.PamController; import PamController.PamController;
@ -219,6 +217,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
hydrophoneTableData.fireTableDataChanged(); hydrophoneTableData.fireTableDataChanged();
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (e.getSource() == recentArrays) { if (e.getSource() == recentArrays) {
arrayDialog.newArraySelection(); arrayDialog.newArraySelection();
@ -573,7 +572,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
/** /**
* and the hydrophones ... * and the hydrophones ...
*/ */
if (phonesToo == false) { if (!phonesToo) {
return; return;
} }
int nPhones = currentArray.getHydrophoneCount(); int nPhones = currentArray.getHydrophoneCount();
@ -694,11 +693,13 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
class HydrophoneTableData extends AbstractTableModel { class HydrophoneTableData extends AbstractTableModel {
@Override
public int getColumnCount() { public int getColumnCount() {
return hydrophoneColumns.length; return hydrophoneColumns.length;
} }
@Override
public int getRowCount() { public int getRowCount() {
PamArray currentArray = getDialogSelectedArray(); PamArray currentArray = getDialogSelectedArray();
if (currentArray == null) return 0; if (currentArray == null) return 0;
@ -710,6 +711,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
return hydrophoneColumns[column]; return hydrophoneColumns[column];
} }
@Override
public Object getValueAt(int rowIndex, int columnIndex) { public Object getValueAt(int rowIndex, int columnIndex) {
PamArray array = getDialogSelectedArray(); PamArray array = getDialogSelectedArray();
Hydrophone hydrophone = array.getHydrophone(rowIndex); Hydrophone hydrophone = array.getHydrophone(rowIndex);
@ -750,6 +752,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
/* (non-Javadoc) /* (non-Javadoc)
* @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent) * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
*/ */
@Override
public void valueChanged(ListSelectionEvent e) { public void valueChanged(ListSelectionEvent e) {
enableButtons(); enableButtons();
} }

View File

@ -110,8 +110,8 @@ public class HydrophoneElementDialog extends PamDialog {
@Override @Override
public boolean getParams() { public boolean getParams() {
if (generalPanel.getParams() == false) return false; if (!generalPanel.getParams()) return false;
if (coordinatePanel.getParams() == false) return false; if (!coordinatePanel.getParams()) return false;
// if (sensitivityPanel.getParams() == false) return false; // if (sensitivityPanel.getParams() == false) return false;
int hi = interpolationDialogPanel.getSelection(); int hi = interpolationDialogPanel.getSelection();
if (hi >= 0) { if (hi >= 0) {
@ -158,7 +158,7 @@ public class HydrophoneElementDialog extends PamDialog {
constraints.gridwidth = 1; constraints.gridwidth = 1;
constraints.gridx = 0; constraints.gridx = 0;
constraints.gridy++; constraints.gridy++;
addComponent(this, recieverTypeLabel = new JLabel("", JLabel.RIGHT), constraints); addComponent(this, recieverTypeLabel = new JLabel("", SwingConstants.RIGHT), constraints);
constraints.gridx++; constraints.gridx++;
constraints.gridwidth = 2; constraints.gridwidth = 2;
addComponent(this, type = new JTextField(12), constraints); addComponent(this, type = new JTextField(12), constraints);
@ -169,7 +169,7 @@ public class HydrophoneElementDialog extends PamDialog {
constraints.gridx = 0; constraints.gridx = 0;
constraints.gridy++; constraints.gridy++;
constraints.anchor = GridBagConstraints.EAST; constraints.anchor = GridBagConstraints.EAST;
addComponent(this, recieverSensLabel = new JLabel("", JLabel.RIGHT), constraints); addComponent(this, recieverSensLabel = new JLabel("", SwingConstants.RIGHT), constraints);
constraints.gridx++; constraints.gridx++;
constraints.anchor = GridBagConstraints.WEST; constraints.anchor = GridBagConstraints.WEST;
addComponent(this, hSens = new JTextField(5), constraints); addComponent(this, hSens = new JTextField(5), constraints);
@ -181,7 +181,7 @@ public class HydrophoneElementDialog extends PamDialog {
constraints.gridx = 0; constraints.gridx = 0;
constraints.gridy++; constraints.gridy++;
constraints.anchor = GridBagConstraints.EAST; constraints.anchor = GridBagConstraints.EAST;
addComponent(this, new JLabel("Preamplifier gain ", JLabel.RIGHT), constraints); addComponent(this, new JLabel("Preamplifier gain ", SwingConstants.RIGHT), constraints);
constraints.gridx++; constraints.gridx++;
constraints.anchor = GridBagConstraints.WEST; constraints.anchor = GridBagConstraints.WEST;
addComponent(this, preampGain = new JTextField(5), constraints); addComponent(this, preampGain = new JTextField(5), constraints);
@ -380,7 +380,7 @@ public class HydrophoneElementDialog extends PamDialog {
double zCoeff = PamController.getInstance().getGlobalMediumManager().getZCoeff(); double zCoeff = PamController.getInstance().getGlobalMediumManager().getZCoeff();
setRecieverLabelText(); setRecieverLabelText();
if (newHydrophone == false) { if (!newHydrophone) {
x.setText(formatDouble(hydrophone.getX())); x.setText(formatDouble(hydrophone.getX()));
y.setText(formatDouble(hydrophone.getY())); y.setText(formatDouble(hydrophone.getY()));
depth.setText(formatDouble(zCoeff*hydrophone.getZ())); depth.setText(formatDouble(zCoeff*hydrophone.getZ()));

View File

@ -3,14 +3,12 @@ package Array;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import Array.streamerOrigin.StreamerDataIterator;
import GPS.GpsData; import GPS.GpsData;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamguardMVC.PamDataBlock;
import pamMaths.PamQuaternion; import pamMaths.PamQuaternion;
import pamMaths.PamVector; import pamMaths.PamVector;

View File

@ -3,7 +3,6 @@ package Array;
import java.util.ArrayList; import java.util.ArrayList;
import PamController.PamController; import PamController.PamController;
import PamController.PamguardVersionInfo;
public class HydrophoneLocators { public class HydrophoneLocators {

View File

@ -1,11 +1,10 @@
package Array; package Array;
import pamScrollSystem.AbstractScrollManager;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.symbol.StandardSymbolManager; import PamView.symbol.StandardSymbolManager;
import PamguardMVC.PamConstants;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import pamScrollSystem.AbstractScrollManager;
public class HydrophoneProcess extends PamProcess{ public class HydrophoneProcess extends PamProcess{

View File

@ -1,9 +1,9 @@
package Array; package Array;
import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes;
public class HydrophoneSQLLogging extends SQLLogging { public class HydrophoneSQLLogging extends SQLLogging {

View File

@ -7,6 +7,7 @@ import javax.swing.JComponent;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import PamView.dialog.PamGridBagContraints; import PamView.dialog.PamGridBagContraints;
@ -30,12 +31,12 @@ public class InstrumentIdentityPanel {
mainPanel.setBorder(new TitledBorder("Instrument information")); mainPanel.setBorder(new TitledBorder("Instrument information"));
mainPanel.setLayout(new GridBagLayout()); mainPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new PamGridBagContraints(); GridBagConstraints c = new PamGridBagContraints();
mainPanel.add(new JLabel("Instrument Type ", JLabel.RIGHT), c); mainPanel.add(new JLabel("Instrument Type ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
mainPanel.add(instrumentType = new JTextField(20), c); mainPanel.add(instrumentType = new JTextField(20), c);
c.gridx = 0; c.gridx = 0;
c.gridy++; c.gridy++;
mainPanel.add(new JLabel("Instrument Id ", JLabel.RIGHT), c); mainPanel.add(new JLabel("Instrument Id ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
mainPanel.add(instrumentId = new JTextField(20), c); mainPanel.add(instrumentId = new JTextField(20), c);

View File

@ -2,23 +2,12 @@ package Array;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import Array.streamerOrigin.OriginSettings;
import GPS.GPSControl;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit; import PamController.PamControllerInterface;
import PamController.PamController;
import PamController.PamSettingsSource;
import PamController.SettingsObject;
import PamController.masterReference.MasterReferencePoint;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock;
/** /**
* Master PAMGuard array localiser. There is now one of these and * Master PAMGuard array localiser. There is now one of these and
@ -192,8 +181,8 @@ public class MasterLocator extends HydrophoneLocator implements Serializable, Cl
// streamerLocators[i].notifyModelChanged(changeType); // streamerLocators[i].notifyModelChanged(changeType);
// } // }
if (initComplete) switch (changeType) { if (initComplete) switch (changeType) {
case PamController.HYDROPHONE_ARRAY_CHANGED: case PamControllerInterface.HYDROPHONE_ARRAY_CHANGED:
case PamController.INITIALIZATION_COMPLETE: case PamControllerInterface.INITIALIZATION_COMPLETE:
setupLocators(ArrayManager.getArrayManager().getCurrentArray()); setupLocators(ArrayManager.getArrayManager().getCurrentArray());
} }
} }
@ -238,7 +227,7 @@ public class MasterLocator extends HydrophoneLocator implements Serializable, Cl
boolean isStat = true; boolean isStat = true;
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
Streamer streamer = pamArray.getStreamer(i); Streamer streamer = pamArray.getStreamer(i);
if (streamer.getHydrophoneLocator().isStatic() == false) { if (!streamer.getHydrophoneLocator().isStatic()) {
isStat = false; isStat = false;
} }
} }

View File

@ -1,10 +1,5 @@
package Array; package Array;
import GPS.GpsData;
import GPS.GpsDataUnit;
import PamUtils.LatLong;
import PamguardMVC.PamDataBlock;
abstract public class MovingHydrophoneLocator extends SimpleHydrophoneLocator { abstract public class MovingHydrophoneLocator extends SimpleHydrophoneLocator {
/** /**

View File

@ -23,27 +23,21 @@ package Array;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import Acquisition.AcquisitionControl; import Acquisition.AcquisitionControl;
import pamMaths.PamVector;
import Array.streamerOrigin.HydrophoneOriginMethod;
import Array.streamerOrigin.OriginSettings; import Array.streamerOrigin.OriginSettings;
import Array.streamerOrigin.StreamerDataIterator;
import GPS.GpsData;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong;
import PamUtils.PamArrayUtils; import PamUtils.PamArrayUtils;
import PamUtils.PamCalendar;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamguardMVC.ChannelIterator; import PamguardMVC.ChannelIterator;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import pamMaths.PamVector;
/** /**
* *
@ -1281,7 +1275,7 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
return preceeding.getStreamerData(); return preceeding.getStreamerData();
} }
// otherwise, we also want the next one ... // otherwise, we also want the next one ...
if (streamerIterator.hasNext() == false) { if (!streamerIterator.hasNext()) {
return preceeding.getStreamerData(); return preceeding.getStreamerData();
} }
nextUnit = streamerIterator.next(); nextUnit = streamerIterator.next();
@ -1293,7 +1287,7 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
double w1 = nextUnit.getTimeMilliseconds()-timeMilliseconds; double w1 = nextUnit.getTimeMilliseconds()-timeMilliseconds;
double w2 = timeMilliseconds-preceeding.getTimeMilliseconds(); double w2 = timeMilliseconds-preceeding.getTimeMilliseconds();
double wTot = w1+w2; double wTot = w1+w2;
if (wTot == 0 || Double.isFinite(wTot) == false) { if (wTot == 0 || !Double.isFinite(wTot)) {
w1 = w2 = 0.5; w1 = w2 = 0.5;
} }
else { else {

View File

@ -73,7 +73,7 @@ public class Preamplifier implements Serializable, Cloneable, ManagedParameters
return (Preamplifier) super.clone(); return (Preamplifier) super.clone();
} }
catch (CloneNotSupportedException Ex) { catch (CloneNotSupportedException Ex) {
Ex.printStackTrace();; Ex.printStackTrace();
return null; return null;
} }
} }

View File

@ -2,11 +2,6 @@ package Array;
import java.util.ArrayList; import java.util.ArrayList;
import javax.vecmath.Point3d;
import javax.vecmath.Point3f;
import GPS.GpsData;
import pamMaths.PamVector; import pamMaths.PamVector;
/** /**

View File

@ -1,21 +1,13 @@
package Array; package Array;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ListIterator;
import depthReadout.DepthControl;
import depthReadout.DepthDataBlock;
import depthReadout.DepthDataUnit;
import Array.streamerOrigin.HydrophoneOriginMethod;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit; import GPS.GpsDataUnit;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong;
import PamUtils.PamUtils;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamObservable;
/** /**
* Straight Hydrophone Locator, uses GPS heading information from * Straight Hydrophone Locator, uses GPS heading information from

View File

@ -13,7 +13,7 @@ import Array.streamerOrigin.GPSOriginSettings;
import Array.streamerOrigin.HydrophoneOriginMethod; import Array.streamerOrigin.HydrophoneOriginMethod;
import Array.streamerOrigin.HydrophoneOriginMethods; import Array.streamerOrigin.HydrophoneOriginMethods;
import Array.streamerOrigin.OriginSettings; import Array.streamerOrigin.OriginSettings;
import PamController.PamController; import PamController.PamControllerInterface;
import PamController.masterReference.MasterReferencePoint; import PamController.masterReference.MasterReferencePoint;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
@ -560,7 +560,7 @@ public class Streamer implements Serializable, Cloneable, ManagedParameters {
hydrophoneOrigin.prepare(); hydrophoneOrigin.prepare();
} }
switch (changeType) { switch (changeType) {
case PamController.INITIALIZATION_COMPLETE: case PamControllerInterface.INITIALIZATION_COMPLETE:
// if (PamController.getInstance().getRunMode() == PamController.RUN_NORMAL) { // if (PamController.getInstance().getRunMode() == PamController.RUN_NORMAL) {
// makeStreamerDataUnit(); // makeStreamerDataUnit();
// } // }
@ -886,7 +886,7 @@ public class Streamer implements Serializable, Cloneable, ManagedParameters {
break; break;
case HEIGHT: case HEIGHT:
if (value != null) { if (value != null) {
setZ(value);; setZ(value);
} }
break; break;
case PITCH: case PITCH:

View File

@ -94,6 +94,7 @@ public class StreamerDataBlock extends PamDataBlock<StreamerDataUnit>{
} }
} }
@Override
public boolean loadViewerData(OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) { public boolean loadViewerData(OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) {
return super.loadViewerData(offlineDataLoadInfo, loadObserver); return super.loadViewerData(offlineDataLoadInfo, loadObserver);
} }

View File

@ -2,9 +2,7 @@ package Array;
import Array.sensors.ArrayParameterType; import Array.sensors.ArrayParameterType;
import Array.sensors.ArraySensorFieldType; import Array.sensors.ArraySensorFieldType;
import Array.streamerOrigin.HydrophoneOriginMethod;
import Array.streamerOrigin.OriginSettings; import Array.streamerOrigin.OriginSettings;
import Array.streamerOrigin.StaticOriginMethod;
import Array.streamerOrigin.StaticOriginSettings; import Array.streamerOrigin.StaticOriginSettings;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit; import GPS.GpsDataUnit;

View File

@ -7,16 +7,15 @@ import java.awt.Insets;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ListIterator;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
@ -123,7 +122,7 @@ public class StreamerDialog extends PamDialog {
addComponent(p, new JLabel("Error"), c); addComponent(p, new JLabel("Error"), c);
c.gridx = 0; c.gridx = 0;
c.gridy ++; c.gridy ++;
addComponent(p, new JLabel("x ", JLabel.RIGHT), c); addComponent(p, new JLabel("x ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(p, x = new JTextField(textLength), c); addComponent(p, x = new JTextField(textLength), c);
c.gridx++; c.gridx++;
@ -133,7 +132,7 @@ public class StreamerDialog extends PamDialog {
c.gridx = 0; c.gridx = 0;
c.gridy ++; c.gridy ++;
addComponent(p, new JLabel("y ", JLabel.RIGHT), c); addComponent(p, new JLabel("y ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(p, y = new JTextField(textLength), c); addComponent(p, y = new JTextField(textLength), c);
c.gridx++; c.gridx++;
@ -143,7 +142,7 @@ public class StreamerDialog extends PamDialog {
c.gridx = 0; c.gridx = 0;
c.gridy ++; c.gridy ++;
addComponent(p, streamerHeightLabel = new JLabel(" ", JLabel.RIGHT), c); // set in setStreamerLabels addComponent(p, streamerHeightLabel = new JLabel(" ", SwingConstants.RIGHT), c); // set in setStreamerLabels
c.gridx++; c.gridx++;
addComponent(p, z = new JTextField(textLength), c); addComponent(p, z = new JTextField(textLength), c);
c.gridx++; c.gridx++;
@ -196,29 +195,29 @@ public class StreamerDialog extends PamDialog {
String degsLab = LatLong.deg + " "; String degsLab = LatLong.deg + " ";
c.gridx = 0; c.gridx = 0;
c.gridy++; c.gridy++;
addComponent(headPanel, new JLabel("Heading ", JLabel.RIGHT), c); addComponent(headPanel, new JLabel("Heading ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(headPanel, heading = new JTextField(orWidth), c); addComponent(headPanel, heading = new JTextField(orWidth), c);
c.gridx++; c.gridx++;
addComponent(headPanel, new JLabel(degsLab, JLabel.LEFT), c); addComponent(headPanel, new JLabel(degsLab, SwingConstants.LEFT), c);
c.gridx++; c.gridx++;
addComponent(headPanel, sensorComponents[ArraySensorFieldType.HEADING.ordinal()].getComponent(), c); addComponent(headPanel, sensorComponents[ArraySensorFieldType.HEADING.ordinal()].getComponent(), c);
c.gridx = 0; c.gridx = 0;
c.gridy++; c.gridy++;
addComponent(headPanel, new JLabel("Pitch ", JLabel.RIGHT), c); addComponent(headPanel, new JLabel("Pitch ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(headPanel, pitch = new JTextField(orWidth), c); addComponent(headPanel, pitch = new JTextField(orWidth), c);
c.gridx++; c.gridx++;
addComponent(headPanel, new JLabel(degsLab, JLabel.LEFT), c); addComponent(headPanel, new JLabel(degsLab, SwingConstants.LEFT), c);
c.gridx++; c.gridx++;
addComponent(headPanel, sensorComponents[ArraySensorFieldType.PITCH.ordinal()].getComponent(), c); addComponent(headPanel, sensorComponents[ArraySensorFieldType.PITCH.ordinal()].getComponent(), c);
c.gridx = 0; c.gridx = 0;
c.gridy++; c.gridy++;
addComponent(headPanel, new JLabel("Roll ", JLabel.RIGHT), c); addComponent(headPanel, new JLabel("Roll ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
addComponent(headPanel, roll = new JTextField(orWidth), c); addComponent(headPanel, roll = new JTextField(orWidth), c);
c.gridx++; c.gridx++;
addComponent(headPanel, new JLabel(degsLab, JLabel.LEFT), c); addComponent(headPanel, new JLabel(degsLab, SwingConstants.LEFT), c);
c.gridx++; c.gridx++;
addComponent(headPanel, sensorComponents[ArraySensorFieldType.ROLL.ordinal()].getComponent(), c); addComponent(headPanel, sensorComponents[ArraySensorFieldType.ROLL.ordinal()].getComponent(), c);
@ -240,7 +239,7 @@ public class StreamerDialog extends PamDialog {
locPanel.setLayout(new BorderLayout()); locPanel.setLayout(new BorderLayout());
locPanel.setBorder(locateRecieverBorder = new TitledBorder("")); //set by steStreamerLabels locPanel.setBorder(locateRecieverBorder = new TitledBorder("")); //set by steStreamerLabels
locPanel.add(BorderLayout.WEST, relPanel); locPanel.add(BorderLayout.WEST, relPanel);
locPanel.add(BorderLayout.CENTER, new JSeparator(JSeparator.VERTICAL)); locPanel.add(BorderLayout.CENTER, new JSeparator(SwingConstants.VERTICAL));
locPanel.add(BorderLayout.EAST, headPanel); locPanel.add(BorderLayout.EAST, headPanel);
getMainPanel().add(locPanel); getMainPanel().add(locPanel);
getMainPanel().add(interpolationPanel.getComponent(getOwner())); getMainPanel().add(interpolationPanel.getComponent(getOwner()));
@ -403,7 +402,7 @@ public class StreamerDialog extends PamDialog {
} }
OriginDialogComponent mthDialogComponent = currentOriginMethod.getDialogComponent(); OriginDialogComponent mthDialogComponent = currentOriginMethod.getDialogComponent();
if (mthDialogComponent != null) { if (mthDialogComponent != null) {
if (mthDialogComponent.getParams() == false) { if (!mthDialogComponent.getParams()) {
return false; return false;
} }
} }
@ -517,7 +516,7 @@ public class StreamerDialog extends PamDialog {
} }
public void newOriginMethod() { public void newOriginMethod() {
if (constructed == false) { if (!constructed) {
return; return;
} }
int methInd = originMethod.getSelectedIndex(); int methInd = originMethod.getSelectedIndex();

View File

@ -1,6 +1,5 @@
package Array; package Array;
import java.sql.Connection;
import java.sql.Types; import java.sql.Types;
import Array.sensors.ArrayParameterType; import Array.sensors.ArrayParameterType;
@ -8,11 +7,6 @@ import Array.sensors.ArraySensorFieldType;
import Array.streamerOrigin.HydrophoneOriginMethod; import Array.streamerOrigin.HydrophoneOriginMethod;
import Array.streamerOrigin.HydrophoneOriginMethods; import Array.streamerOrigin.HydrophoneOriginMethods;
import Array.streamerOrigin.HydrophoneOriginSystem; import Array.streamerOrigin.HydrophoneOriginSystem;
import Array.streamerOrigin.OriginSettings;
import Array.streamerOrigin.StaticOriginSettings;
import GPS.GPSDataBlock;
import GPS.GpsData;
import GPS.GpsDataUnit;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;

View File

@ -5,18 +5,16 @@ import java.awt.Graphics;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Window; import java.awt.Window;
import Array.streamerOrigin.HydrophoneOriginMethod;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit;
import PamUtils.Coordinate3d; import PamUtils.Coordinate3d;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.GeneralProjector; import PamView.GeneralProjector;
import PamView.GeneralProjector.ParameterType;
import PamView.GeneralProjector.ParameterUnits;
import PamView.PamKeyItem; import PamView.PamKeyItem;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.PamSymbolType; import PamView.PamSymbolType;
import PamView.PanelOverlayDraw; import PamView.PanelOverlayDraw;
import PamView.GeneralProjector.ParameterType;
import PamView.GeneralProjector.ParameterUnits;
import PamView.symbol.SymbolData; import PamView.symbol.SymbolData;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;

View File

@ -1,15 +1,10 @@
package Array; package Array;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ListIterator;
import pamMaths.PamVector;
import Array.sensors.StreamerSensorManager;
import Array.streamerOrigin.HydrophoneOriginMethod; import Array.streamerOrigin.HydrophoneOriginMethod;
import Array.streamerOrigin.OriginIterator; import Array.streamerOrigin.OriginIterator;
import GPS.GPSControl;
import GPS.GPSDataBlock;
import GPS.GpsData; import GPS.GpsData;
import GPS.GpsDataUnit;
import GPS.NavDataSynchronisation; import GPS.NavDataSynchronisation;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
@ -92,7 +87,7 @@ public class ThreadingHydrophoneLocator extends StraightHydrophoneLocator implem
*/ */
gpsUnit = gpsIt.previous(); gpsUnit = gpsIt.previous();
} }
if (gpsIt.hasPrevious() == false) { if (!gpsIt.hasPrevious()) {
/** /**
* We're off the start of the available track, so can do nothing except use the stright model to * We're off the start of the available track, so can do nothing except use the stright model to
* interpolate backwards. * interpolate backwards.

View File

@ -7,13 +7,13 @@ import java.io.Serializable;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import mcc.MccJniInterface;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamView.PamSidePanel; import PamView.PamSidePanel;
import PamView.dialog.warn.WarnOnce; import PamView.dialog.warn.WarnOnce;
import mcc.MccJniInterface;
public class ArrayAccelControl extends PamControlledUnit implements PamSettings { public class ArrayAccelControl extends PamControlledUnit implements PamSettings {

View File

@ -1,10 +1,10 @@
package ArrayAccelerometer; package ArrayAccelerometer;
import pamMaths.PamVector;
import Array.sensors.ArraySensorDataUnit; import Array.sensors.ArraySensorDataUnit;
import Array.sensors.ArraySensorFieldType; import Array.sensors.ArraySensorFieldType;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import pamMaths.PamVector;
public class ArrayAccelDataUnit extends PamDataUnit implements ArraySensorDataUnit { public class ArrayAccelDataUnit extends PamDataUnit implements ArraySensorDataUnit {

View File

@ -9,18 +9,18 @@ import java.awt.event.ActionListener;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import PamView.dialog.PamDialog;
import PamView.dialog.PamGridBagContraints;
import mcc.MccJniInterface; import mcc.MccJniInterface;
import mcc.MccPanel; import mcc.MccPanel;
import mcc.mccjna.MCCException; import mcc.mccjna.MCCException;
import mcc.mccjna.MCCUtils; import mcc.mccjna.MCCUtils;
import PamView.dialog.PamDialog;
import PamView.dialog.PamGridBagContraints;
public class ArrayAccelDialog extends PamDialog { public class ArrayAccelDialog extends PamDialog {
@ -52,17 +52,17 @@ public class ArrayAccelDialog extends PamDialog {
JPanel rPanel = new JPanel(new GridBagLayout()); JPanel rPanel = new JPanel(new GridBagLayout());
rPanel.setBorder(new TitledBorder("Readout")); rPanel.setBorder(new TitledBorder("Readout"));
GridBagConstraints c = new PamGridBagContraints(); GridBagConstraints c = new PamGridBagContraints();
rPanel.add(new JLabel("Read interval ", JLabel.RIGHT), c); rPanel.add(new JLabel("Read interval ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
rPanel.add(readInterval = new JTextField(5), c); rPanel.add(readInterval = new JTextField(5), c);
readInterval.setToolTipText("Readout interval in seconds"); readInterval.setToolTipText("Readout interval in seconds");
c.gridx++; c.gridx++;
rPanel.add(new JLabel(" s", JLabel.LEFT), c); rPanel.add(new JLabel(" s", SwingConstants.LEFT), c);
for (int i = 0; i < ArrayAccelParams.NDIMENSIONS; i++) { for (int i = 0; i < ArrayAccelParams.NDIMENSIONS; i++) {
c.gridx = 0; c.gridx = 0;
c.gridy++; c.gridy++;
c.fill = GridBagConstraints.HORIZONTAL; c.fill = GridBagConstraints.HORIZONTAL;
rPanel.add(new JLabel("Channel " + ArrayAccelParams.DIMENSIONNAME[i] + " ", JLabel.RIGHT), c); rPanel.add(new JLabel("Channel " + ArrayAccelParams.DIMENSIONNAME[i] + " ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
c.fill = GridBagConstraints.NONE; c.fill = GridBagConstraints.NONE;
rPanel.add(dimChannel[i] = new JTextField(3), c); rPanel.add(dimChannel[i] = new JTextField(3), c);
@ -75,23 +75,23 @@ public class ArrayAccelDialog extends PamDialog {
calPanel.setBorder(new TitledBorder("Calibration")); calPanel.setBorder(new TitledBorder("Calibration"));
c = new PamGridBagContraints(); c = new PamGridBagContraints();
c.gridx = 1; c.gridx = 1;
calPanel.add(new JLabel("Zero", JLabel.CENTER), c); calPanel.add(new JLabel("Zero", SwingConstants.CENTER), c);
c.gridx += 2; c.gridx += 2;
calPanel.add(new JLabel("Scale", JLabel.CENTER), c); calPanel.add(new JLabel("Scale", SwingConstants.CENTER), c);
for (int i = 0; i < ArrayAccelParams.NDIMENSIONS; i++) { for (int i = 0; i < ArrayAccelParams.NDIMENSIONS; i++) {
c.gridy ++; c.gridy ++;
c.gridx = 0; c.gridx = 0;
calPanel.add(new JLabel(ArrayAccelParams.DIMENSIONNAME[i] + " ", JLabel.RIGHT), c); calPanel.add(new JLabel(ArrayAccelParams.DIMENSIONNAME[i] + " ", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
calPanel.add(zeroVolts[i] = new JTextField(5), c); calPanel.add(zeroVolts[i] = new JTextField(5), c);
zeroVolts[i].setToolTipText(String.format("Offset voltage for %s coordinate", ArrayAccelParams.DIMENSIONNAME[i])); zeroVolts[i].setToolTipText(String.format("Offset voltage for %s coordinate", ArrayAccelParams.DIMENSIONNAME[i]));
c.gridx++; c.gridx++;
calPanel.add(new JLabel(" V, ", JLabel.LEFT), c); calPanel.add(new JLabel(" V, ", SwingConstants.LEFT), c);
c.gridx++; c.gridx++;
calPanel.add(voltsPerG[i] = new JTextField(5), c); calPanel.add(voltsPerG[i] = new JTextField(5), c);
voltsPerG[i].setToolTipText(String.format("Voltage scale for %s coordinate", ArrayAccelParams.DIMENSIONNAME[i])); voltsPerG[i].setToolTipText(String.format("Voltage scale for %s coordinate", ArrayAccelParams.DIMENSIONNAME[i]));
c.gridx++; c.gridx++;
calPanel.add(new JLabel(" V/g ", JLabel.LEFT), c); calPanel.add(new JLabel(" V/g ", SwingConstants.LEFT), c);
} }
c.gridx = 0; c.gridx = 0;
c.gridwidth = 3; c.gridwidth = 3;
@ -103,23 +103,23 @@ public class ArrayAccelDialog extends PamDialog {
c.gridy++; c.gridy++;
c.gridx = 0; c.gridx = 0;
c.gridwidth = 3; c.gridwidth = 3;
calPanel.add(new JLabel("Roll offset ", JLabel.RIGHT), c); calPanel.add(new JLabel("Roll offset ", SwingConstants.RIGHT), c);
c.gridx += c.gridwidth; c.gridx += c.gridwidth;
c.gridwidth = 1; c.gridwidth = 1;
calPanel.add(rollOffset = new JTextField(5), c); calPanel.add(rollOffset = new JTextField(5), c);
rollOffset.setToolTipText("This value gets ADDED to the measured roll"); rollOffset.setToolTipText("This value gets ADDED to the measured roll");
c.gridx++; c.gridx++;
calPanel.add(new JLabel(" deg.", JLabel.LEFT), c); calPanel.add(new JLabel(" deg.", SwingConstants.LEFT), c);
c.gridy++; c.gridy++;
c.gridx = 0; c.gridx = 0;
c.gridwidth = 3; c.gridwidth = 3;
calPanel.add(new JLabel("Pitch offset ", JLabel.RIGHT), c); calPanel.add(new JLabel("Pitch offset ", SwingConstants.RIGHT), c);
c.gridx += c.gridwidth; c.gridx += c.gridwidth;
c.gridwidth = 1; c.gridwidth = 1;
calPanel.add(pitchOffset = new JTextField(5), c); calPanel.add(pitchOffset = new JTextField(5), c);
pitchOffset.setToolTipText("This value gets ADDED to the measured pitch"); pitchOffset.setToolTipText("This value gets ADDED to the measured pitch");
c.gridx++; c.gridx++;
calPanel.add(new JLabel(" deg.", JLabel.LEFT), c); calPanel.add(new JLabel(" deg.", SwingConstants.LEFT), c);
@ -226,7 +226,7 @@ public class ArrayAccelDialog extends PamDialog {
* Set the zero voltage for each channel. * Set the zero voltage for each channel.
*/ */
public void findZero() { public void findZero() {
if (getParams() == false) { if (!getParams()) {
return; return;
} }
// read the voltages from the three channels and set as // read the voltages from the three channels and set as

View File

@ -15,12 +15,10 @@ import PamUtils.LatLong;
import PamView.PamColors; import PamView.PamColors;
import PamView.PamColors.PamColor; import PamView.PamColors.PamColor;
import PamView.panel.PamBorder; import PamView.panel.PamBorder;
import PamView.panel.PamBorderPanel;
import PamView.panel.PamPanel; import PamView.panel.PamPanel;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamObservable; import PamguardMVC.PamObservable;
import PamguardMVC.PamObserver;
import PamguardMVC.PamObserverAdapter; import PamguardMVC.PamObserverAdapter;
/* /*
@ -36,7 +34,7 @@ public class ArrayAccelPanel {
private long zeroGraphTime; private long zeroGraphTime;
private ArrayAccelDataBlock accelDataBlock; private ArrayAccelDataBlock accelDataBlock;
private int panelDurationSecs = 300; private int panelDurationSecs = 300;
private double timeScale = 1;; private double timeScale = 1;
public ArrayAccelPanel(ArrayAccelControl accelControl) { public ArrayAccelPanel(ArrayAccelControl accelControl) {

View File

@ -1,12 +1,10 @@
package ArrayAccelerometer; package ArrayAccelerometer;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import mcc.MccJniInterface;
import mcc.mccjna.MCCConstants; import mcc.mccjna.MCCConstants;
public class ArrayAccelParams implements Serializable, Cloneable, ManagedParameters { public class ArrayAccelParams implements Serializable, Cloneable, ManagedParameters {

View File

@ -5,17 +5,12 @@ import java.awt.event.ActionListener;
import javax.swing.Timer; import javax.swing.Timer;
import PamController.PamController;
import PamUtils.PamCalendar;
import PamguardMVC.PamProcess;
import mcc.MccJniInterface; import mcc.MccJniInterface;
import mcc.mccjna.MCCException; import mcc.mccjna.MCCException;
import mcc.mccjna.MCCUtils; import mcc.mccjna.MCCUtils;
import Array.ArrayManager;
import Array.PamArray;
import Array.Streamer;
import PamController.PamControlledUnit;
import PamController.PamController;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamProcess;
public class ArrayAccelProcess extends PamProcess { public class ArrayAccelProcess extends PamProcess {

View File

@ -1,11 +1,8 @@
package ArrayAccelerometer; package ArrayAccelerometer;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import PamView.PamColors.PamColor;
import PamView.panel.PamPanel;
import PamView.PamSidePanel; import PamView.PamSidePanel;
public class ArrayAccelSidePanel implements PamSidePanel { public class ArrayAccelSidePanel implements PamSidePanel {

View File

@ -2,8 +2,6 @@ package Azigram;
import java.util.Arrays; import java.util.Arrays;
import Acquisition.AcquisitionProcess;
import PamUtils.PamUtils;
import PamUtils.complex.ComplexArray; import PamUtils.complex.ComplexArray;
import fftManager.FFTDataUnit; import fftManager.FFTDataUnit;

View File

@ -8,8 +8,6 @@ import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamView.GroupedSourceParameters; import PamView.GroupedSourceParameters;
import PamguardMVC.PamConstants;
import whistlesAndMoans.WhistleToneParameters;
public class AzigramParameters implements Serializable, ManagedParameters, Cloneable { public class AzigramParameters implements Serializable, ManagedParameters, Cloneable {

View File

@ -8,19 +8,14 @@ import java.io.Serializable;
import javax.swing.JMenu; import javax.swing.JMenu;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import Filters.layoutFX.FilterGUIFX; import Filters.layoutFX.FilterGUIFX;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitGUI; import PamController.PamControlledUnitGUI;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController;
import PamController.PamControllerInterface; import PamController.PamControllerInterface;
import PamController.PamGUIManager; import PamController.PamGUIManager;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import fftManager.layoutFX.FFTGuiFX;
/** /**
* Filters raw data using a specified filter. * Filters raw data using a specified filter.
@ -71,6 +66,7 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
FilterParameters_2 newParams = FilterDataSourceDialog.showDialog(filterParams, parentFrame, filterProcess.outputData); FilterParameters_2 newParams = FilterDataSourceDialog.showDialog(filterParams, parentFrame, filterProcess.outputData);
@ -90,6 +86,7 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
super(); super();
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
FilterParams newParams = FilterDialog.showDialog(parentFrame, FilterParams newParams = FilterDialog.showDialog(parentFrame,
@ -109,7 +106,7 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
public void notifyModelChanged(int changeType) { public void notifyModelChanged(int changeType) {
//System.out.println("FFTControl: notifyModelChanged : " +changeType); //System.out.println("FFTControl: notifyModelChanged : " +changeType);
super.notifyModelChanged(changeType); super.notifyModelChanged(changeType);
if (changeType == PamController.INITIALIZATION_COMPLETE) { if (changeType == PamControllerInterface.INITIALIZATION_COMPLETE) {
filterProcess.setupProcess(); filterProcess.setupProcess();
} }
if (filterGUIFX!=null) { if (filterGUIFX!=null) {
@ -117,14 +114,17 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
} }
} }
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return filterParams; return filterParams;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return FilterParams.serialVersionUID; return FilterParams.serialVersionUID;
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
filterParams = ((FilterParameters_2) pamControlledUnitSettings.getSettings()).clone(); filterParams = ((FilterParameters_2) pamControlledUnitSettings.getSettings()).clone();
return true; return true;

View File

@ -1,6 +1,7 @@
package Filters; package Filters;
import java.awt.Frame; import java.awt.Frame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;

View File

@ -21,6 +21,7 @@
package Filters; package Filters;
import java.awt.Window; import java.awt.Window;
import PamView.dialog.PamDialog; import PamView.dialog.PamDialog;
public class FilterDialog extends PamDialog { public class FilterDialog extends PamDialog {

View File

@ -37,10 +37,14 @@ import javax.swing.JRadioButton;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
import com.opencsv.CSVReader;
import com.opencsv.exceptions.CsvException;
import Layout.PamAxis; import Layout.PamAxis;
import PamUtils.PamFileChooser; import PamUtils.PamFileChooser;
import PamUtils.PamFileFilter; import PamUtils.PamFileFilter;
@ -49,9 +53,6 @@ import PamView.PamColors.PamColor;
import PamView.dialog.PamDialog; import PamView.dialog.PamDialog;
import PamView.dialog.PamGridBagContraints; import PamView.dialog.PamGridBagContraints;
import PamView.panel.PamPanel; import PamView.panel.PamPanel;
import com.opencsv.CSVReader;
import com.opencsv.exceptions.CsvException;
import fftManager.Complex; import fftManager.Complex;
/** /**
@ -188,8 +189,9 @@ public class FilterDialogPanel implements ActionListener {
repaintAll(); repaintAll();
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (isSetup == false) { if (!isSetup) {
return; return;
} }
if (e.getSource() == filterTypes) { if (e.getSource() == filterTypes) {
@ -235,7 +237,7 @@ public class FilterDialogPanel implements ActionListener {
break; break;
} }
boolean isArb = filterType == 4; boolean isArb = filterType == 4;
normalPanel.setVisible(isArb == false); normalPanel.setVisible(!isArb);
arbPanel.setVisible(isArb); arbPanel.setVisible(isArb);
} }
@ -321,14 +323,14 @@ public class FilterDialogPanel implements ActionListener {
c.gridwidth = 1; c.gridwidth = 1;
c.gridy++; c.gridy++;
c.gridx = xc; c.gridx = xc;
normalPanel.add(new JLabel(" High Pass", JLabel.RIGHT), c); normalPanel.add(new JLabel(" High Pass", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
normalPanel.add(highCut, c); normalPanel.add(highCut, c);
c.gridx++; c.gridx++;
normalPanel.add(new JLabel(" Hz"), c); normalPanel.add(new JLabel(" Hz"), c);
c.gridy++; c.gridy++;
c.gridx = xc; c.gridx = xc;
normalPanel.add(new JLabel(" Low Pass", JLabel.RIGHT), c); normalPanel.add(new JLabel(" Low Pass", SwingConstants.RIGHT), c);
c.gridx++; c.gridx++;
normalPanel.add(lowCut, c); normalPanel.add(lowCut, c);
c.gridx++; c.gridx++;
@ -702,10 +704,10 @@ public class FilterDialogPanel implements ActionListener {
if (filterMethod == null) { if (filterMethod == null) {
return; return;
} }
if (IIRFilterMethod.class.isAssignableFrom(filterMethod.getClass()) == true) { if (IIRFilterMethod.class.isAssignableFrom(filterMethod.getClass())) {
paintPoleZeros(g); paintPoleZeros(g);
} }
else if (FIRFilterMethod.class.isAssignableFrom(filterMethod.getClass()) == true) { else if (FIRFilterMethod.class.isAssignableFrom(filterMethod.getClass())) {
paintImpulseResponse(g); paintImpulseResponse(g);
} }
} }

View File

@ -20,8 +20,6 @@
*/ */
package Filters; package Filters;
import fftManager.Complex;
/** /**
* @author Doug Gillespie * @author Doug Gillespie
* <p> * <p>

View File

@ -2,9 +2,6 @@ package Filters;
import java.io.Serializable; import java.io.Serializable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;

View File

@ -22,12 +22,7 @@ package Filters;
import java.io.File; import java.io.File;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import PamController.PamControlledUnit;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;

View File

@ -28,7 +28,7 @@ public class FilterSpeed {
data[i] = r.nextGaussian(); data[i] = r.nextGaussian();
} }
testData = data.clone(); testData = data.clone();
long sn, en, mn = 0;; long sn, en, mn = 0;
double a; double a;
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
for (int i = 0; i < nTrials; i++) { for (int i = 0; i < nTrials; i++) {

View File

@ -229,6 +229,7 @@ public abstract class IIRFilterMethod extends FilterMethod {
* Get coefficients from poles and zeros for fast filter computations. * Get coefficients from poles and zeros for fast filter computations.
* @return * @return
*/ */
@Override
public double[] getFastFilterCoefficients() { public double[] getFastFilterCoefficients() {
Complex[] poles = getPoles(filterParams); Complex[] poles = getPoles(filterParams);
Complex[] zeros = getZeros(filterParams); Complex[] zeros = getZeros(filterParams);

View File

@ -195,6 +195,7 @@ public class IirfFilter implements Filter {
/* (non-Javadoc) /* (non-Javadoc)
* @see Filters.Filter#runFilter(double[]) * @see Filters.Filter#runFilter(double[])
*/ */
@Override
synchronized public void runFilter(double[] inputData) { synchronized public void runFilter(double[] inputData) {
int f; int f;
for (int i = 0; i < inputData.length; i++) { for (int i = 0; i < inputData.length; i++) {
@ -208,6 +209,7 @@ public class IirfFilter implements Filter {
/* (non-Javadoc) /* (non-Javadoc)
* @see Filters.Filter#runFilter(double[], double[]) * @see Filters.Filter#runFilter(double[], double[])
*/ */
@Override
synchronized public void runFilter(double[] inputData, double[] outputData) { synchronized public void runFilter(double[] inputData, double[] outputData) {
int f; int f;
if (outputData == null || outputData.length != inputData.length) { if (outputData == null || outputData.length != inputData.length) {
@ -225,6 +227,7 @@ public class IirfFilter implements Filter {
/* (non-Javadoc) /* (non-Javadoc)
* @see Filters.Filter#runFilter(double) * @see Filters.Filter#runFilter(double)
*/ */
@Override
synchronized public double runFilter(double aData) { synchronized public double runFilter(double aData) {
double newData = aData; double newData = aData;
for (int f = 0; f < nFilterUnits; f++) { for (int f = 0; f < nFilterUnits; f++) {

View File

@ -52,14 +52,14 @@ public class FormatGpsData {
Date dateO; Date dateO;
FormatGpsData() { FormatGpsData() {
}; }
FormatGpsData(StringBuffer nmeaString) { FormatGpsData(StringBuffer nmeaString) {
/* /*
* Unpack the string buffer to populate the above datas * Unpack the string buffer to populate the above datas
*/ */
}; }
public static String formatTime(int intTime) { public static String formatTime(int intTime) {
SimpleDateFormat gpsTimeFormat = new SimpleDateFormat("HHmmss"); SimpleDateFormat gpsTimeFormat = new SimpleDateFormat("HHmmss");

View File

@ -9,11 +9,6 @@ import java.util.ListIterator;
import javax.swing.JMenu; import javax.swing.JMenu;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import warnings.PamWarning;
import warnings.WarningSystem;
import NMEA.NMEADataBlock; import NMEA.NMEADataBlock;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
@ -21,9 +16,10 @@ import PamController.PamController;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamController.positionreference.PositionReference; import PamController.positionreference.PositionReference;
import PamUtils.PamCalendar;
import PamView.dialog.warn.WarnOnce; import PamView.dialog.warn.WarnOnce;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import warnings.PamWarning;
import warnings.WarningSystem;
public class GPSControl extends PamControlledUnit implements PamSettings, PositionReference { public class GPSControl extends PamControlledUnit implements PamSettings, PositionReference {
@ -144,7 +140,9 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
@Override @Override
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
String currentPath; String currentPath;
ImportGPSParams newParams=ImportGPSDialog.showDialog(PamController.getInstance().getMainFrame(), PamController.getInstance().getMainFrame().getMousePosition(),gpsImportParams, importGPSData); PamController.getInstance();
PamController.getInstance();
ImportGPSParams newParams=ImportGPSDialog.showDialog(PamController.getMainFrame(), PamController.getMainFrame().getMousePosition(),gpsImportParams, importGPSData);
if (newParams!=null) gpsImportParams=newParams.clone(); if (newParams!=null) gpsImportParams=newParams.clone();
@ -168,6 +166,7 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
GPSParameters newP = GPSParametersDialog.showDialog(parentFrame, gpsParameters); GPSParameters newP = GPSParametersDialog.showDialog(parentFrame, gpsParameters);
if (newP != null) { if (newP != null) {
@ -184,6 +183,7 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
this.parentFrame = parentFrame; this.parentFrame = parentFrame;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String message = "<html>Clock management is now controlled from the \"File/Global time settings\" menu<p>" + String message = "<html>Clock management is now controlled from the \"File/Global time settings\" menu<p>" +
"The Global time settings do not require administrator privilidges<p><p>" + "The Global time settings do not require administrator privilidges<p><p>" +
@ -195,13 +195,16 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
} }
} }
} }
@Override
public Serializable getSettingsReference() { public Serializable getSettingsReference() {
return gpsParameters; return gpsParameters;
} }
@Override
public long getSettingsVersion() { public long getSettingsVersion() {
return GPSParameters.serialVersionUID; return GPSParameters.serialVersionUID;
} }
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
if (pamControlledUnitSettings.getUnitType().equals(this.getUnitType()) if (pamControlledUnitSettings.getUnitType().equals(this.getUnitType())
@ -260,7 +263,7 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
* @return interpolated gps position. * @return interpolated gps position.
*/ */
public GpsDataUnit getShipPosition(long timeMilliseconds, boolean interpolate) { public GpsDataUnit getShipPosition(long timeMilliseconds, boolean interpolate) {
if (interpolate == false) { if (!interpolate) {
return getGpsDataBlock().getClosestUnitMillis(timeMilliseconds); return getGpsDataBlock().getClosestUnitMillis(timeMilliseconds);
} }
// otherwise try to fine a point either side and weighted mean them or extrapolate. // otherwise try to fine a point either side and weighted mean them or extrapolate.

View File

@ -3,12 +3,12 @@ package GPS;
import java.util.ListIterator; import java.util.ListIterator;
import GPS.effort.GpsEffortProvider; import GPS.effort.GpsEffortProvider;
import nmeaEmulator.EmulatedData;
import nmeaEmulator.NMEAEmulator;
import pamScrollSystem.ViewLoadObserver;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import PamguardMVC.dataOffline.OfflineDataLoadInfo; import PamguardMVC.dataOffline.OfflineDataLoadInfo;
import nmeaEmulator.EmulatedData;
import nmeaEmulator.NMEAEmulator;
import pamScrollSystem.ViewLoadObserver;
/** /**
* Add a bit of extra functionality to GPSDataBlock so * Add a bit of extra functionality to GPSDataBlock so
@ -44,7 +44,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
@Override @Override
public void addPamData(GpsDataUnit gpsDataUnit) { public void addPamData(GpsDataUnit gpsDataUnit) {
boolean r = isReasonable(gpsDataUnit); boolean r = isReasonable(gpsDataUnit);
if (r == false) { if (!r) {
gpsDataUnit.getGpsData().setDataOk(false); gpsDataUnit.getGpsData().setDataOk(false);
} }
else { else {
@ -68,7 +68,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
GpsData thisData, thatData; GpsData thisData, thatData;
thisData = gpsDataUnit.getGpsData(); thisData = gpsDataUnit.getGpsData();
if (thisData.isDataOk() == false) { if (!thisData.isDataOk()) {
return false; return false;
} }
@ -83,7 +83,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
return true; return true;
} }
// ignore gps points flagged as bad. // ignore gps points flagged as bad.
if (thatData.isDataOk() == false) { if (!thatData.isDataOk()) {
continue; continue;
} }
// OK if it's gone too far back in time // OK if it's gone too far back in time
@ -118,7 +118,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
readyGGAData = null; readyGGAData = null;
return dd; return dd;
} }
if (emulatorIterator.hasNext() == false) { if (!emulatorIterator.hasNext()) {
return null; return null;
} }
GpsDataUnit gpsUnit = emulatorIterator.next(); GpsDataUnit gpsUnit = emulatorIterator.next();

View File

@ -2,7 +2,6 @@ package GPS;
import java.util.ListIterator; import java.util.ListIterator;
import PamUtils.PamCalendar;
import PamguardMVC.dataOffline.OfflineDataLoadInfo; import PamguardMVC.dataOffline.OfflineDataLoadInfo;
/** /**

View File

@ -7,22 +7,19 @@ import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Window; import java.awt.Window;
import Map.MapProjector;
import Map.MapRectProjector; import Map.MapRectProjector;
import Map.Vessel; import Map.Vessel;
import PamUtils.Coordinate3d; import PamUtils.Coordinate3d;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.GeneralProjector; import PamView.GeneralProjector;
import PamView.ManagedSymbol; import PamView.GeneralProjector.ParameterType;
import PamView.GeneralProjector.ParameterUnits;
import PamView.ManagedSymbolInfo; import PamView.ManagedSymbolInfo;
import PamView.PamKeyItem; import PamView.PamKeyItem;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.PamOldSymbolManager;
import PamView.PamSymbolType; import PamView.PamSymbolType;
import PamView.PanelOverlayDraw; import PamView.PanelOverlayDraw;
import PamView.SymbolKeyItem; import PamView.SymbolKeyItem;
import PamView.GeneralProjector.ParameterType;
import PamView.GeneralProjector.ParameterUnits;
import PamView.symbol.SymbolData; import PamView.symbol.SymbolData;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
@ -69,7 +66,7 @@ public class GPSOverlayGraphics extends PanelOverlayDraw {
Coordinate3d coord = generalProjector.getCoord3d( gpsData.getLatitude(), gpsData.getLongitude(),gpsData.getHeight()); Coordinate3d coord = generalProjector.getCoord3d( gpsData.getLatitude(), gpsData.getLongitude(),gpsData.getHeight());
Point p = coord.getXYPoint(); Point p = coord.getXYPoint();
if (lastDrawnDataUnit != null && Math.abs(lastDrawnDataUnit.getAbsBlockIndex()-gpsDataUnit.getAbsBlockIndex()) == 1) { if (lastDrawnDataUnit != null && Math.abs(lastDrawnDataUnit.getAbsBlockIndex()-gpsDataUnit.getAbsBlockIndex()) == 1) {
if (p.equals(lastCoord) == false) { if (!p.equals(lastCoord)) {
g.setColor(s.getLineColor()); g.setColor(s.getLineColor());
g.drawLine(p.x, p.y, lastCoord.x, lastCoord.y); g.drawLine(p.x, p.y, lastCoord.x, lastCoord.y);
} }

View File

@ -4,7 +4,6 @@ import java.awt.BorderLayout;
import java.awt.Frame; import java.awt.Frame;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -18,11 +17,9 @@ import javax.swing.JRadioButton;
import javax.swing.JTabbedPane; import javax.swing.JTabbedPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import NMEA.NMEADataUnit; import NMEA.NMEADataUnit;
import PamController.PamControlledUnit;
import PamController.PamController; import PamController.PamController;
import PamView.dialog.PamDialog; import PamView.dialog.PamDialog;
import PamView.dialog.PamGridBagContraints; import PamView.dialog.PamGridBagContraints;
@ -104,7 +101,7 @@ public class GPSParametersDialog extends PamDialog {
// setModal(true); // setModal(true);
} }
private void dimensionsChanged() { private void dimensionsChanged() {
if (gpsParametersDialog.getParams() == true) { if (gpsParametersDialog.getParams()) {
// shipDrawing.setDimensions(gpsParameters.dimA, gpsParameters.dimB, // shipDrawing.setDimensions(gpsParameters.dimA, gpsParameters.dimB,
// gpsParameters.dimC, gpsParameters.dimD); // gpsParameters.dimC, gpsParameters.dimD);
} }
@ -198,9 +195,9 @@ public class GPSParametersDialog extends PamDialog {
gpsParameters.dimB = dims[1]; gpsParameters.dimB = dims[1];
gpsParameters.dimC = dims[2]; gpsParameters.dimC = dims[2];
gpsParameters.dimD = dims[3]; gpsParameters.dimD = dims[3];
if (predictPanel.getParams() == false) return false; if (!predictPanel.getParams()) return false;
if (readOptions.getParams() == false) return false; if (!readOptions.getParams()) return false;
if (smoothingOptions.getParams() == false) return false; if (!smoothingOptions.getParams()) return false;
return headingPanel.getParams(gpsParameters); return headingPanel.getParams(gpsParameters);
} }
@ -408,6 +405,7 @@ public class GPSParametersDialog extends PamDialog {
return true; return true;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
enableControls(); enableControls();
} }

View File

@ -20,8 +20,6 @@
*/ */
package GPS; package GPS;
import geoMag.MagneticVariation;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
@ -29,8 +27,6 @@ import java.util.TimeZone;
import Array.sensors.ArraySensorDataUnit; import Array.sensors.ArraySensorDataUnit;
import Array.sensors.ArraySensorFieldType; import Array.sensors.ArraySensorFieldType;
import pamMaths.PamQuaternion;
import pamMaths.PamVector;
import NMEA.AcquireNmeaData; import NMEA.AcquireNmeaData;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
@ -38,6 +34,9 @@ import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import geoMag.MagneticVariation;
import pamMaths.PamQuaternion;
import pamMaths.PamVector;
/** /**
* Note on times for GPS data ... * Note on times for GPS data ...
@ -176,7 +175,7 @@ public class GpsData extends LatLong implements Cloneable, ManagedParameters, Ar
// sortDistanceFromLast(); // sortDistanceFromLast();
}; }
/** /**
* Constructor to create a GPSData object from a lat long. * Constructor to create a GPSData object from a lat long.
@ -276,9 +275,9 @@ public class GpsData extends LatLong implements Cloneable, ManagedParameters, Ar
break; break;
} }
if (dataOk == false) return; if (!dataOk) return;
}; }
protected void sortDistanceFromLast() { protected void sortDistanceFromLast() {
@ -471,7 +470,7 @@ public class GpsData extends LatLong implements Cloneable, ManagedParameters, Ar
foundPoint = true; foundPoint = true;
continue; continue;
} }
if (foundPoint == false) { if (!foundPoint) {
newDigit = (nmeaSentence[i] - 48); newDigit = (nmeaSentence[i] - 48);
number = (number * 10 + newDigit); number = (number * 10 + newDigit);
} }

View File

@ -30,15 +30,6 @@
package GPS; package GPS;
import generalDatabase.DBControlUnit;
import generalDatabase.DBProcess;
import generalDatabase.PamConnection;
import generalDatabase.PamTableDefinition;
import generalDatabase.PamTableItem;
import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes;
import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
@ -46,16 +37,16 @@ import java.sql.Types;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import PamController.PamViewParameters; import PamController.PamViewParameters;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import generalDatabase.DBControlUnit;
import generalDatabase.DBProcess;
import generalDatabase.PamConnection;
import generalDatabase.PamTableDefinition;
import generalDatabase.PamTableItem;
import generalDatabase.SQLLogging;
import generalDatabase.SQLTypes;
public class GpsLogger extends SQLLogging { public class GpsLogger extends SQLLogging {
@ -117,7 +108,7 @@ public class GpsLogger extends SQLLogging {
@Override @Override
public synchronized boolean doExtraChecks(DBProcess dbProcess, PamConnection connection) { public synchronized boolean doExtraChecks(DBProcess dbProcess, PamConnection connection) {
if (dbProcess.tableExists(tableDefinition) == false) { if (!dbProcess.tableExists(tableDefinition)) {
return true; // PAMGUARD will create the table normally. return true; // PAMGUARD will create the table normally.
} }
// make sure the table has the right columns. // make sure the table has the right columns.
@ -136,7 +127,7 @@ public class GpsLogger extends SQLLogging {
// boolean hasId = dbProcess.columnExists(tableDefinition, tableDefinition.getIndexItem()); // boolean hasId = dbProcess.columnExists(tableDefinition, tableDefinition.getIndexItem());
boolean hasUTC = dbProcess.columnNull(tableDefinition.getTableName(), tableDefinition.getTimeStampItem()) != 2; boolean hasUTC = dbProcess.columnNull(tableDefinition.getTableName(), tableDefinition.getTimeStampItem()) != 2;
// boolean hasLoctime = dbProcess.columnExists(tableDefinition, tableDefinition.getLocalTimeItem()); // boolean hasLoctime = dbProcess.columnExists(tableDefinition, tableDefinition.getLocalTimeItem());
if (hasIndex && hasPCTime && hasUTC == false) { if (hasIndex && hasPCTime && !hasUTC) {
// seems to be a logger table // seems to be a logger table
String warningText = String.format("The data in table %s appear to be from the IFAW\n" + String warningText = String.format("The data in table %s appear to be from the IFAW\n" +
"Logger 2000 software and are incompatible with PAMGUARD\n\n" + "Logger 2000 software and are incompatible with PAMGUARD\n\n" +
@ -297,7 +288,7 @@ public class GpsLogger extends SQLLogging {
int gpsIntTimeVal = gpsTime.getIntegerValue(); int gpsIntTimeVal = gpsTime.getIntegerValue();
PamTableDefinition pamTableDef = (PamTableDefinition) getTableDefinition(); PamTableDefinition pamTableDef = (PamTableDefinition) getTableDefinition();
Object ts = pamTableDef.getTimeStampItem().getValue(); Object ts = pamTableDef.getTimeStampItem().getValue();
long gpsDate = sqlTypes.millisFromTimeStamp(ts); long gpsDate = SQLTypes.millisFromTimeStamp(ts);
if (gpsDate%1000 == 0) { if (gpsDate%1000 == 0) {
// some databases may have stored the milliseconds, in which // some databases may have stored the milliseconds, in which
// case this next bit is redundant. // case this next bit is redundant.
@ -318,9 +309,9 @@ public class GpsLogger extends SQLLogging {
if (nmeaProcess != null) { if (nmeaProcess != null) {
// this should apply the rules of how much GPD data to keep as it's loading // this should apply the rules of how much GPD data to keep as it's loading
// can reduce amount of data loaded in viewer mode to something sensible. // can reduce amount of data loaded in viewer mode to something sensible.
if (nmeaProcess.wantDataUnit(gpsDataUnit) == false) { if (!nmeaProcess.wantDataUnit(gpsDataUnit)) {
return null; return null;
}; }
} }
String fixTypeStr = fixType.getDeblankedStringValue(); String fixTypeStr = fixType.getDeblankedStringValue();

View File

@ -76,7 +76,8 @@ public class ImportGPSData {
*/ */
public void loadFile(String fileString){ public void loadFile(String fileString){
importLoadBar=ImportLoadBar.showDialog(PamController.getInstance().getMainFrame(), "Load GPS Data"); PamController.getInstance();
importLoadBar=ImportLoadBar.showDialog(PamController.getMainFrame(), "Load GPS Data");
importLoadBar.setProgress(0); importLoadBar.setProgress(0);
importLoadBar.setIntermediate(true); importLoadBar.setIntermediate(true);
PamController.getInstance().enableGUIControl(false); PamController.getInstance().enableGUIControl(false);
@ -137,7 +138,9 @@ public class ImportGPSData {
Collection<String> nmeaStrings=importFileStrings( file.getAbsolutePath()); Collection<String> nmeaStrings=importFileStrings( file.getAbsolutePath());
if (checkGGA(nmeaStrings)) { if (checkGGA(nmeaStrings)) {
ImportGPSParams newParams=ImportGGADialog.showDialog(PamController.getInstance().getMainFrame(), PamController.getInstance().getMainFrame().getMousePosition(), gpsControl.gpsImportParams, this) ; PamController.getInstance();
PamController.getInstance();
ImportGPSParams newParams=ImportGGADialog.showDialog(PamController.getMainFrame(), PamController.getMainFrame().getMousePosition(), gpsControl.gpsImportParams, this) ;
if (newParams!=null) gpsControl.gpsImportParams=newParams.clone(); if (newParams!=null) gpsControl.gpsImportParams=newParams.clone();
} }
} }
@ -375,7 +378,7 @@ public class ImportGPSData {
if (gpsData.isDataOk()) saveGPSData(gpsData); if (gpsData.isDataOk()) saveGPSData(gpsData);
} }
gpsData=new GpsData(nmeaString, gpsControl.gpsParameters.READ_GGA); gpsData=new GpsData(nmeaString, GPSParameters.READ_GGA);
///GGA strings contain no date so we need to set it. ///GGA strings contain no date so we need to set it.
gpsData.getGpsCalendar().set(Calendar.YEAR, gpsControl.gpsImportParams.year); gpsData.getGpsCalendar().set(Calendar.YEAR, gpsControl.gpsImportParams.year);
gpsData.getGpsCalendar().set(Calendar.MONTH, gpsControl.gpsImportParams.month); gpsData.getGpsCalendar().set(Calendar.MONTH, gpsControl.gpsImportParams.month);
@ -397,7 +400,7 @@ public class ImportGPSData {
} }
// System.out.println("nmea string: "+nmeaString); // System.out.println("nmea string: "+nmeaString);
gpsData=new GpsData(nmeaString, gpsControl.gpsParameters.READ_RMC); gpsData=new GpsData(nmeaString, GPSParameters.READ_RMC);
break; break;
} }
@ -452,7 +455,7 @@ public class ImportGPSData {
gpsDataBlock.saveViewerData(); gpsDataBlock.saveViewerData();
}; }
public void saveGPSData(GpsData gpsData){ public void saveGPSData(GpsData gpsData){
//System.out.println("GPSData to save: " +gpsData + "gpsDataBlock: "+gpsDataBlock); //System.out.println("GPSData to save: " +gpsData + "gpsDataBlock: "+gpsDataBlock);
@ -508,7 +511,7 @@ public class ImportGPSData {
private void loadKMLFile(File file , ImportGPSThread importGPSThread){ private void loadKMLFile(File file , ImportGPSThread importGPSThread){
// TODO Auto-generated method stub // TODO Auto-generated method stub
}; }
private void loadGPXFile(File file2, ImportGPSThread importGPSThread) { private void loadGPXFile(File file2, ImportGPSThread importGPSThread) {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -63,7 +63,7 @@ public class ImportGPSDialog extends PamDialog{
importGPS.add(BorderLayout.CENTER, p); importGPS.add(BorderLayout.CENTER, p);
setDialogComponent(importGPS); setDialogComponent(importGPS);
setLocation(location);; setLocation(location);
@ -115,6 +115,7 @@ public class ImportGPSDialog extends PamDialog{
class BrowseButtonAction implements ActionListener { class BrowseButtonAction implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
File lastFile; File lastFile;

View File

@ -3,6 +3,7 @@ package GPS;
import NMEA.NMEADataBlock; import NMEA.NMEADataBlock;
import NMEA.NMEADataUnit; import NMEA.NMEADataUnit;
import PamController.PamController; import PamController.PamController;
import PamController.PamControllerInterface;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamObservable; import PamguardMVC.PamObservable;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
@ -50,7 +51,7 @@ where:
@Override @Override
public void newData(PamObservable o, PamDataUnit arg) { public void newData(PamObservable o, PamDataUnit arg) {
if (gpsControl.gpsParameters.readHeading == false) { if (!gpsControl.gpsParameters.readHeading) {
return; return;
} }
NMEADataUnit nmeaData = (NMEADataUnit) arg; NMEADataUnit nmeaData = (NMEADataUnit) arg;
@ -121,7 +122,7 @@ where:
} }
private void findDataSource() { private void findDataSource() {
if (gpsControl.isGpsMaster() == false) { if (!gpsControl.isGpsMaster()) {
return; return;
} }
NMEADataBlock newSource = (NMEADataBlock) PamController.getInstance(). NMEADataBlock newSource = (NMEADataBlock) PamController.getInstance().
@ -134,9 +135,9 @@ where:
@Override @Override
public void notifyModelChanged(int changeType) { public void notifyModelChanged(int changeType) {
switch (changeType) { switch (changeType) {
case PamController.ADD_CONTROLLEDUNIT: case PamControllerInterface.ADD_CONTROLLEDUNIT:
case PamController.REMOVE_CONTROLLEDUNIT: case PamControllerInterface.REMOVE_CONTROLLEDUNIT:
case PamController.INITIALIZATION_COMPLETE: case PamControllerInterface.INITIALIZATION_COMPLETE:
noteNewSettings(); noteNewSettings();
} }
} }

View File

@ -20,15 +20,11 @@
*/ */
package GPS; package GPS;
import warnings.PamWarning;
import warnings.WarningSystem;
import geoMag.MagneticVariation;
import NMEA.NMEADataBlock; import NMEA.NMEADataBlock;
import NMEA.NMEADataUnit; import NMEA.NMEADataUnit;
import PamController.PamController; import PamController.PamController;
import PamController.masterReference.MasterReferencePoint; import PamController.PamControllerInterface;
import PamController.status.BaseProcessCheck; import PamController.status.BaseProcessCheck;
import PamController.status.ProcessCheck;
import PamModel.PamModel; import PamModel.PamModel;
import PamModel.SMRUEnable; import PamModel.SMRUEnable;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
@ -38,7 +34,9 @@ import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamObservable; import PamguardMVC.PamObservable;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import autecPhones.AutecGraphics; import geoMag.MagneticVariation;
import warnings.PamWarning;
import warnings.WarningSystem;
/** /**
* @author Doug Gillespie * @author Doug Gillespie
@ -90,7 +88,7 @@ public class ProcessNmeaData extends PamProcess {
findNMEADataBlock(); findNMEADataBlock();
addOutputDataBlock((gpsDataBlock = new GPSDataBlock(this))); addOutputDataBlock((gpsDataBlock = new GPSDataBlock(this)));
if (gpsControl.isGpsMaster() == false) { if (!gpsControl.isGpsMaster()) {
gpsDataBlock.setOverlayDraw(new GPSOverlayGraphics(gpsControl)); gpsDataBlock.setOverlayDraw(new GPSOverlayGraphics(gpsControl));
gpsDataBlock.setPamSymbolManager(new StandardSymbolManager(gpsDataBlock, GPSOverlayGraphics.defSymbol, false)); gpsDataBlock.setPamSymbolManager(new StandardSymbolManager(gpsDataBlock, GPSOverlayGraphics.defSymbol, false));
} }
@ -123,7 +121,7 @@ public class ProcessNmeaData extends PamProcess {
boolean findNMEADataBlock() { boolean findNMEADataBlock() {
PamDataBlock newDataBlock = null; PamDataBlock newDataBlock = null;
if (gpsController.isGpsMaster() == false) { if (!gpsController.isGpsMaster()) {
return false; return false;
} }
@ -151,9 +149,9 @@ public class ProcessNmeaData extends PamProcess {
@Override @Override
public void notifyModelChanged(int changeType) { public void notifyModelChanged(int changeType) {
switch (changeType) { switch (changeType) {
case PamController.ADD_CONTROLLEDUNIT: case PamControllerInterface.ADD_CONTROLLEDUNIT:
case PamController.REMOVE_CONTROLLEDUNIT: case PamControllerInterface.REMOVE_CONTROLLEDUNIT:
case PamController.INITIALIZATION_COMPLETE: case PamControllerInterface.INITIALIZATION_COMPLETE:
noteNewSettings(); noteNewSettings();
} }
} }
@ -193,7 +191,7 @@ public class ProcessNmeaData extends PamProcess {
} }
// newUnit.data = gpsData; // newUnit.data = gpsData;
if (wantDataUnit(newUnit) == false) { if (!wantDataUnit(newUnit)) {
return; return;
} }

View File

@ -8,6 +8,7 @@ import java.awt.event.ActionListener;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import PamView.dialog.PamDialog; import PamView.dialog.PamDialog;
@ -32,7 +33,7 @@ public class ShipDimensionsFields extends JPanel implements ActionListener{
for (int i = 0; i < dimNames.length; i++) { for (int i = 0; i < dimNames.length; i++) {
gbs.gridy = i; gbs.gridy = i;
gbs.gridx = 0; gbs.gridx = 0;
PamDialog.addComponent(this, new JLabel(" " + dimNames[i] + " ", JLabel.RIGHT), gbs); PamDialog.addComponent(this, new JLabel(" " + dimNames[i] + " ", SwingConstants.RIGHT), gbs);
gbs.gridx = 1; gbs.gridx = 1;
PamDialog.addComponent(this, shipDims[i] = new JTextField(4), gbs); PamDialog.addComponent(this, shipDims[i] = new JTextField(4), gbs);
gbs.gridx = 2; gbs.gridx = 2;
@ -62,6 +63,7 @@ public class ShipDimensionsFields extends JPanel implements ActionListener{
return dimensions; return dimensions;
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// dimensionsChanged(); // dimensionsChanged();

Some files were not shown because too many files have changed in this diff Show More