mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +00:00
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:
parent
b9c613ea1b
commit
b420fd9f9d
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.pamguard</groupId>
|
||||
<artifactId>Pamguard</artifactId>
|
||||
<version>2.02.13</version>
|
||||
<version>2.02.13a</version>
|
||||
<name>Pamguard</name>
|
||||
<description>Pamguard using Maven to control dependencies</description>
|
||||
<url>www.pamguard.org</url>
|
||||
|
@ -13,7 +13,6 @@ import binaryFileStorage.BinaryHeader;
|
||||
import binaryFileStorage.BinaryObjectData;
|
||||
import binaryFileStorage.ModuleFooter;
|
||||
import binaryFileStorage.ModuleHeader;
|
||||
import binaryFileStorage.PackedBinaryObject;
|
||||
|
||||
public class AISBinaryDataSource extends BinaryDataSource {
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class AISBugSearch {
|
||||
// first comma separates date and NMEA data
|
||||
int chPos = line.indexOf(",");
|
||||
String nmeaData = line.substring(chPos+1);
|
||||
if (nmeaData.contains("AIVDM") == false) {
|
||||
if (!nmeaData.contains("AIVDM")) {
|
||||
continue;
|
||||
}
|
||||
System.out.println(nmeaData);
|
||||
|
@ -44,6 +44,7 @@ public class AISControl extends PamControlledUnit implements PamSettings {
|
||||
super();
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
AISStringsTable.show(aisControl);
|
||||
}
|
||||
@ -55,6 +56,7 @@ public class AISControl extends PamControlledUnit implements PamSettings {
|
||||
super();
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
AISParameters newParams = AISDisplayDialog.showDialog(parentFrame, aisParameters);
|
||||
@ -70,6 +72,7 @@ public class AISControl extends PamControlledUnit implements PamSettings {
|
||||
super();
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
AISParameters newParams = AISSettingsDialog.showDialog(parentFrame, aisParameters);
|
||||
if (newParams != null) {
|
||||
@ -115,14 +118,17 @@ public class AISControl extends PamControlledUnit implements PamSettings {
|
||||
aisProcess.noteNewSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return aisParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return AISParameters.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
|
||||
this.aisParameters = ((AISParameters) pamControlledUnitSettings.getSettings()).clone();
|
||||
|
@ -1,18 +1,16 @@
|
||||
package AIS;
|
||||
|
||||
import generalDatabase.DBControlUnit;
|
||||
import generalDatabase.SQLTypes;
|
||||
|
||||
import java.util.ListIterator;
|
||||
|
||||
import pamScrollSystem.ViewLoadObserver;
|
||||
import nmeaEmulator.EmulatedData;
|
||||
import nmeaEmulator.NMEAEmulator;
|
||||
import NMEA.AcquireNmeaData;
|
||||
import PamController.masterReference.MasterReferencePoint;
|
||||
import PamUtils.LatLong;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamProcess;
|
||||
import generalDatabase.DBControlUnit;
|
||||
import generalDatabase.SQLTypes;
|
||||
import nmeaEmulator.EmulatedData;
|
||||
import nmeaEmulator.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) {
|
||||
if (aisControl.aisParameters.limitRange == false) {
|
||||
if (!aisControl.aisParameters.limitRange) {
|
||||
return true;
|
||||
}
|
||||
double range = 0;
|
||||
@ -133,7 +131,7 @@ public class AISDataBlock extends PamDataBlock<AISDataUnit> implements NMEAEmula
|
||||
@Override
|
||||
public EmulatedData getNextData() {
|
||||
SQLTypes sqlTypes = DBControlUnit.findConnection().getSqlTypes();
|
||||
if (getLogging().readNextEmulation(sqlTypes) == false) {
|
||||
if (!getLogging().readNextEmulation(sqlTypes)) {
|
||||
return null;
|
||||
}
|
||||
// now all data should be in the loggers table definition.
|
||||
|
@ -5,7 +5,6 @@ import java.util.ArrayList;
|
||||
|
||||
import NMEA.NMEABitArray;
|
||||
import NMEA.NMEADataBlock;
|
||||
import PamDetection.AbstractLocalisation;
|
||||
import PamDetection.LocContents;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
@ -7,8 +7,6 @@ import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import radardisplay.RadarProjector;
|
||||
|
||||
import GPS.GpsData;
|
||||
import GPS.GpsDataUnit;
|
||||
import Map.MapRectProjector;
|
||||
@ -20,14 +18,14 @@ import PamUtils.Coordinate3d;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.GeneralProjector;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.PamDetectionOverlayGraphics;
|
||||
import PamView.PamKeyItem;
|
||||
import PamView.PamSymbol;
|
||||
import PamView.PamSymbolType;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.symbol.SymbolData;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.debug.Debug;
|
||||
import radardisplay.RadarProjector;
|
||||
|
||||
|
||||
public class AISGraphics extends PamDetectionOverlayGraphics {
|
||||
@ -73,12 +71,12 @@ public class AISGraphics extends PamDetectionOverlayGraphics {
|
||||
AISStaticData staticData = aisDataUnit.getStaticData();
|
||||
AISPositionReport positionReport = aisDataUnit.getPositionReport();
|
||||
|
||||
if (aisDataUnit.isComplete() == false) {
|
||||
if (!aisDataUnit.isComplete()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
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 range = localisation.getRange(0);
|
||||
Coordinate3d c3d = generalProjector.getCoord3d(bearing, range, 0);
|
||||
|
@ -1,22 +1,19 @@
|
||||
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.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Types;
|
||||
|
||||
import javax.naming.ldap.HasControls;
|
||||
|
||||
import PamController.PamController;
|
||||
import PamView.dialog.warn.WarnOnce;
|
||||
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 {
|
||||
|
||||
@ -167,7 +164,7 @@ public class AISLogger extends SQLLogging {
|
||||
acallSign = (String) callSign.getValue();
|
||||
ashipName = (String) shipName.getValue();
|
||||
ashipType = (String) shipType.getValue();
|
||||
aetaMillis = sqlTypes.millisFromTimeStamp(eta.getValue());
|
||||
aetaMillis = SQLTypes.millisFromTimeStamp(eta.getValue());
|
||||
// aetaMillis = (Long) eta.getValue();
|
||||
adraught = (Double) draft.getValue();
|
||||
adestination = (String) destination.getValue();
|
||||
|
@ -199,7 +199,7 @@ public class AISStaticData extends AISReport implements Serializable, ManagedPar
|
||||
}
|
||||
switch(stationType) {
|
||||
case BASESTATION:
|
||||
return stationType.BASESTATION.toString();
|
||||
return StationType.BASESTATION.toString();
|
||||
case A:
|
||||
case B:
|
||||
return getVesselTypeAndCargo(type);
|
||||
|
@ -109,12 +109,13 @@ public class AISStringsTable {
|
||||
|
||||
class TimerListener implements ActionListener {
|
||||
boolean doneLayout;
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
// table.
|
||||
// nmeaTableData.fireTableRowsUpdated(0, 10);
|
||||
aisTableData.fireTableDataChanged();
|
||||
|
||||
if (doneLayout == false && aisTableData.getRowCount() > 0) {
|
||||
if (!doneLayout && aisTableData.getRowCount() > 0) {
|
||||
doneLayout = true;
|
||||
}
|
||||
}
|
||||
@ -134,6 +135,7 @@ public class AISStringsTable {
|
||||
/* (non-Javadoc)
|
||||
* @see javax.swing.table.TableModel#getColumnCount()
|
||||
*/
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return tableColumns.length;
|
||||
}
|
||||
@ -141,6 +143,7 @@ public class AISStringsTable {
|
||||
/* (non-Javadoc)
|
||||
* @see javax.swing.table.TableModel#getRowCount()
|
||||
*/
|
||||
@Override
|
||||
public int getRowCount() {
|
||||
if (aisDataBlock == null) return 0;
|
||||
//System.out.println(aisDataBlock.getUnitsCount() + " rows in AIS data");
|
||||
@ -150,6 +153,7 @@ public class AISStringsTable {
|
||||
/* (non-Javadoc)
|
||||
* @see javax.swing.table.TableModel#getValueAt(int, int)
|
||||
*/
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
AISDataUnit aisDataUnit = aisDataBlock.getDataUnit(rowIndex, PamDataBlock.REFERENCE_CURRENT);
|
||||
|
||||
|
@ -3,7 +3,6 @@ package AIS;
|
||||
import NMEA.NMEADataBlock;
|
||||
import NMEA.NMEADataUnit;
|
||||
import PamController.PamController;
|
||||
import PamDetection.AbstractLocalisation;
|
||||
import PamDetection.LocContents;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.symbol.StandardSymbolManager;
|
||||
@ -11,7 +10,6 @@ import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamObservable;
|
||||
import PamguardMVC.PamProcess;
|
||||
import autecPhones.AutecGraphics;
|
||||
|
||||
/**
|
||||
* Process NMEA data to extract AIS information
|
||||
|
@ -21,10 +21,6 @@
|
||||
|
||||
package Acquisition;
|
||||
|
||||
import hfDaqCard.SmruDaqSystem;
|
||||
//import mcc.mccacquisition.MCCDaqSystem;
|
||||
import mcc.mccacquisition.MCCDaqSystem;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Window;
|
||||
@ -38,20 +34,6 @@ import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
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.StandardFileDate;
|
||||
import Acquisition.filetypes.SoundFileTypes;
|
||||
@ -74,8 +56,6 @@ import PamController.PamGUIManager;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
import PamController.RawInputControlledUnit;
|
||||
import PamController.fileprocessing.StoreStatus;
|
||||
import PamModel.PamModel;
|
||||
import PamModel.SMRUEnable;
|
||||
import PamUtils.FrequencyFormat;
|
||||
import PamUtils.PamCalendar;
|
||||
@ -91,6 +71,20 @@ import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamProcess;
|
||||
import PamguardMVC.PamRawDataBlock;
|
||||
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,
|
||||
@ -178,13 +172,13 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
registerDaqSystem(new ASIOSoundSystem(this));
|
||||
toc = System.currentTimeMillis();
|
||||
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();
|
||||
registerDaqSystem(new NewAsioSoundSystem(this));
|
||||
toc = System.currentTimeMillis();
|
||||
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));
|
||||
@ -275,7 +269,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
*/
|
||||
public void registerDaqSystem(DaqSystem daqSystem){
|
||||
if (systemList == null) {
|
||||
systemList = new ArrayList<DaqSystem>();
|
||||
systemList = new ArrayList<>();
|
||||
}
|
||||
systemList.add(daqSystem);
|
||||
//daqSystem.getItemsList();
|
||||
@ -283,7 +277,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
}
|
||||
|
||||
public static ArrayList<AcquisitionControl> getControllers() {
|
||||
ArrayList<AcquisitionControl> daqControllers = new ArrayList<AcquisitionControl>();
|
||||
ArrayList<AcquisitionControl> daqControllers = new ArrayList<>();
|
||||
PamControlledUnit pcu;
|
||||
for (int i = 0; i < PamController.getInstance().getNumControlledUnits(); i++) {
|
||||
pcu = PamController.getInstance().getControlledUnit(i);
|
||||
@ -323,8 +317,8 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
|
||||
if (systemType == null) systemType = acquisitionParameters.daqSystemType;
|
||||
|
||||
for (int i = 0; i < systemList.size(); i++) {
|
||||
if (systemList.get(i).getSystemType().equals(systemType)) return systemList.get(i);
|
||||
for (DaqSystem element : systemList) {
|
||||
if (element.getSystemType().equals(systemType)) return element;
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -347,6 +341,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
AcquisitionParameters newParameters = AcquisitionDialog.showDialog(parentFrame, acquisitionControl, acquisitionParameters);
|
||||
if (newParameters != null) {
|
||||
@ -526,14 +521,17 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
* (non-Javadoc)
|
||||
* @see PamController.PamSettings#GetSettingsReference()
|
||||
*/
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return acquisitionParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return AcquisitionParameters.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings 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
|
||||
public int ChannelsToHydrophones(int channels) {
|
||||
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.
|
||||
//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 channelListIndex;
|
||||
@ -679,6 +677,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
/**
|
||||
* @return the offlineFileServer
|
||||
*/
|
||||
@Override
|
||||
public OfflineFileServer getOfflineFileServer() {
|
||||
return offlineFileServer;
|
||||
}
|
||||
@ -766,7 +765,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
public void loadExternalDaqSystems() {
|
||||
|
||||
// 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 (daqList.isEmpty()) {
|
||||
@ -900,6 +899,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
* with the folderinputSystem.
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getBatchStatus() {
|
||||
DaqSystem runningSystem = getAcquisitionProcess().getRunningSystem();
|
||||
if (runningSystem instanceof FolderInputSystem) {
|
||||
|
@ -295,7 +295,7 @@ public class AcquisitionDialog extends PamDialog {
|
||||
|
||||
int nP = getNumChannels();
|
||||
if (getCurrentDaqSystem().supportsChannelLists() && currentChannelListPanel != null) {
|
||||
if (currentChannelListPanel.isDataOk() == false) {
|
||||
if (!currentChannelListPanel.isDataOk()) {
|
||||
return false;
|
||||
}
|
||||
int[] chL = currentChannelListPanel.getChannelList();
|
||||
@ -376,11 +376,13 @@ public class AcquisitionDialog extends PamDialog {
|
||||
}
|
||||
|
||||
private class NewDeviceType implements ActionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
newDeviceType();
|
||||
}
|
||||
}
|
||||
private class NumChannels implements ActionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
sortChannelLists();
|
||||
}
|
||||
|
@ -1,18 +1,14 @@
|
||||
package Acquisition;
|
||||
|
||||
import java.sql.Types;
|
||||
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import generalDatabase.PamTableDefinition;
|
||||
import generalDatabase.PamTableItem;
|
||||
import generalDatabase.SQLLogging;
|
||||
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
|
||||
* and stops of PAMGUARD in the database.
|
||||
@ -68,8 +64,8 @@ public class AcquisitionLogging extends SQLLogging {
|
||||
adcClockMillis.setValue((int)(ds.getAdcMilliseconds()%1000));
|
||||
rawADCTime.setValue(sqlTypes.getTimeStamp(ds.getRawADCMillis()));
|
||||
long s = ds.getSamples();
|
||||
gSamples.setValue((long)(s/1000000000));
|
||||
samples.setValue((long) (s%1000000000));
|
||||
gSamples.setValue(s/1000000000);
|
||||
samples.setValue(s%1000000000);
|
||||
Long gT = ds.getGpsPPSMilliseconds();
|
||||
if (gT == null) {
|
||||
GPSPPSTime.setValue(null);
|
||||
|
@ -1,7 +1,5 @@
|
||||
package Acquisition;
|
||||
|
||||
import hfDaqCard.SmruDaqSystem;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@ -13,6 +11,7 @@ import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamguardMVC.PamConstants;
|
||||
import hfDaqCard.SmruDaqSystem;
|
||||
|
||||
public class AcquisitionParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -146,15 +145,12 @@ public class AcquisitionParameters implements Serializable, Cloneable, ManagedPa
|
||||
if (channel < 0) {
|
||||
return channel;
|
||||
}
|
||||
if (channelListIndexes.length <= channel) return -1;
|
||||
|
||||
// this line no longer needed now that software channels are alwasy 0,1,2,3
|
||||
// even if hardware channels are more random.
|
||||
// channel = this.channelListIndexes[channel];
|
||||
//channel = this.channelListIndexes[channel];
|
||||
if (channel < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (hydrophoneList.length <= channel) return -1;
|
||||
if ((channelListIndexes.length <= channel) || (channel < 0) || (hydrophoneList.length <= channel)) return -1;
|
||||
return hydrophoneList[channel];
|
||||
}
|
||||
|
||||
|
@ -1,19 +1,13 @@
|
||||
package Acquisition;
|
||||
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
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 Acquisition.gpstiming.PPSDetector;
|
||||
import Acquisition.gpstiming.PPSParameters;
|
||||
import Array.ArrayManager;
|
||||
import Array.Hydrophone;
|
||||
import Array.PamArray;
|
||||
import Array.Preamplifier;
|
||||
import Filters.Filter;
|
||||
@ -23,31 +17,20 @@ import Filters.FilterType;
|
||||
import Filters.IirfFilter;
|
||||
import PamController.DataInputStore;
|
||||
import PamController.InputStoreInfo;
|
||||
import PamController.OfflineDataStore;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamController;
|
||||
import PamController.fileprocessing.ReprocessManager;
|
||||
import PamController.fileprocessing.StoreStatus;
|
||||
import PamController.status.BaseProcessCheck;
|
||||
import PamController.status.ProcessCheck;
|
||||
import PamDetection.RawDataUnit;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamUtils.PamUtils;
|
||||
import PamUtils.time.ntp.PamNTPTime;
|
||||
import PamUtils.time.ntp.PamNTPTimeException;
|
||||
import PamguardMVC.PamConstants;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamObservable;
|
||||
import PamguardMVC.PamObserver;
|
||||
import PamguardMVC.PamProcess;
|
||||
import PamguardMVC.PamRawDataBlock;
|
||||
import PamguardMVC.RequestCancellationObject;
|
||||
import PamguardMVC.dataOffline.OfflineDataLoadInfo;
|
||||
import dataGram.DatagramManager;
|
||||
import dataMap.OfflineDataMapPoint;
|
||||
import pamScrollSystem.AbstractScrollManager;
|
||||
import pamScrollSystem.ViewLoadObserver;
|
||||
|
||||
/**
|
||||
* 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
|
||||
// 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.
|
||||
|
||||
@ -225,7 +208,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
|
||||
boolean netRX = PamController.getInstance().getRunMode() == PamController.RUN_NETWORKRECEIVER;
|
||||
if (!netRX) {
|
||||
if (runningSystem.startSystem(acquisitionControl) == false) return;
|
||||
if (!runningSystem.startSystem(acquisitionControl)) return;
|
||||
}
|
||||
// Log a data unit asap to get the start time
|
||||
long daqStartedTime = PamCalendar.getTimeInMillis();
|
||||
@ -272,7 +255,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
}
|
||||
|
||||
private boolean addServerTime(DaqStatusDataUnit daqStatusDataUnit) {
|
||||
if (runningSystem.isRealTime() == false) {
|
||||
if (!runningSystem.isRealTime()) {
|
||||
return false;
|
||||
}
|
||||
// PamNTPTime pamNTPTime = PamNTPTime.getInstance();
|
||||
@ -429,7 +412,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
|
||||
// call acquireData one last time to make sure that
|
||||
// all data have been flushed from the buffer.
|
||||
if (bufferOverflow == false) {
|
||||
if (!bufferOverflow) {
|
||||
acquireData();
|
||||
}
|
||||
else {
|
||||
@ -585,6 +568,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
|
||||
class BufferTimerTest implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
acquisitionControl.fillStatusBarText();
|
||||
@ -609,7 +593,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (acquireData() == false) {
|
||||
if (!acquireData()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -647,6 +631,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
*/
|
||||
class RestartTimerFunction implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
|
||||
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());
|
||||
// long unitMillis = absSamplesToMilliseconds(threadDataUnit.getStartSample()) - millisecondSampleOffset;
|
||||
long unitMillis = (long) simpleSamplesToMilliseconds(threadDataUnit.getStartSample()) + millisecondSampleOffset;
|
||||
long unitMillis = simpleSamplesToMilliseconds(threadDataUnit.getStartSample()) + millisecondSampleOffset;
|
||||
newDataUnit = new RawDataUnit(unitMillis,
|
||||
threadDataUnit.getChannelBitmap(), threadDataUnit.getStartSample(),
|
||||
threadDataUnit.getSampleDuration());
|
||||
@ -697,8 +682,8 @@ public class AcquisitionProcess extends PamProcess {
|
||||
addData(null, newDataUnit);
|
||||
rawData = newDataUnit.getRawData();
|
||||
dataBlockLength = rawData.length;
|
||||
for (int i = 0; i < rawData.length; i++) {
|
||||
maxLevel = Math.max(maxLevel, Math.abs(rawData[i]));
|
||||
for (double element : rawData) {
|
||||
maxLevel = Math.max(maxLevel, Math.abs(element));
|
||||
}
|
||||
levelSamples += rawData.length;
|
||||
if (bufferOverflow) {
|
||||
@ -1216,7 +1201,7 @@ public class AcquisitionProcess extends PamProcess {
|
||||
if (runTime < stallCheckSecs * 2000 && samples == 0) {
|
||||
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;
|
||||
}
|
||||
double aveSR = (double) (samples - lastStallCheckSamples) / (double) (now-lastStallCheckTime) * 1000.;
|
||||
|
@ -42,7 +42,7 @@ public class CheckWavFileHeaders extends PamDialog {
|
||||
|
||||
private CheckFiles checkFilesWorker;
|
||||
|
||||
private ArrayList<File> allFiles = new ArrayList<File>();
|
||||
private ArrayList<File> allFiles = new ArrayList<>();
|
||||
|
||||
private CheckWavFileHeaders(Window parentFrame) {
|
||||
super(parentFrame, "Check File Headers", false);
|
||||
@ -89,8 +89,8 @@ public class CheckWavFileHeaders extends PamDialog {
|
||||
}
|
||||
|
||||
private void enableControls() {
|
||||
getOkButton().setEnabled(nFiles > 0 & running == false && ran == false);
|
||||
getCancelButton().setEnabled(running == false);
|
||||
getOkButton().setEnabled(nFiles > 0 & !running && !ran);
|
||||
getCancelButton().setEnabled(!running);
|
||||
}
|
||||
|
||||
private int countFiles(File folder) {
|
||||
@ -98,8 +98,8 @@ public class CheckWavFileHeaders extends PamDialog {
|
||||
File[] files = folder.listFiles(new PamAudioFileFilter());
|
||||
if (files == null) return 0;
|
||||
File file;
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
file = files[i];
|
||||
for (File file2 : files) {
|
||||
file = file2;
|
||||
if (file.isDirectory() && subFolders) {
|
||||
System.out.println(file.getAbsoluteFile());
|
||||
nF += countFiles(file.getAbsoluteFile());
|
||||
@ -164,7 +164,7 @@ public class CheckWavFileHeaders extends PamDialog {
|
||||
* @return true if there is an error
|
||||
*/
|
||||
private int checkFile(File aFile) {
|
||||
if (aFile.exists() == false || aFile.isDirectory() == true) {
|
||||
if (!aFile.exists() || aFile.isDirectory()) {
|
||||
return AudioFileFuncs.FILE_DOESNTEXIST;
|
||||
}
|
||||
String fileName = aFile.getName();
|
||||
@ -203,8 +203,8 @@ public class CheckWavFileHeaders extends PamDialog {
|
||||
*/
|
||||
int error;
|
||||
File aFile;
|
||||
for (int i = 0; i < allFiles.size(); i++) {
|
||||
error = checkFile(aFile = allFiles.get(i));
|
||||
for (File file : allFiles) {
|
||||
error = checkFile(aFile = file);
|
||||
publish(new ProgressData(aFile, error));
|
||||
}
|
||||
return null;
|
||||
@ -220,8 +220,8 @@ public class CheckWavFileHeaders extends PamDialog {
|
||||
|
||||
@Override
|
||||
protected void process(List<ProgressData> progressData) {
|
||||
for (int i = 0; i < progressData.size(); i++) {
|
||||
setProgressInfo(progressData.get(i));
|
||||
for (ProgressData element : progressData) {
|
||||
setProgressInfo(element);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ import binaryFileStorage.BinaryHeader;
|
||||
import binaryFileStorage.BinaryObjectData;
|
||||
import binaryFileStorage.ModuleFooter;
|
||||
import binaryFileStorage.ModuleHeader;
|
||||
import binaryFileStorage.PackedBinaryObject;
|
||||
|
||||
public class DaqStatusBinaryStore extends BinaryDataSource {
|
||||
|
||||
|
@ -2,7 +2,6 @@ package Acquisition;
|
||||
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamProcess;
|
||||
import dataMap.OfflineDataMap;
|
||||
import effort.EffortProvider;
|
||||
import effort.binary.DataMapEffortProvider;
|
||||
import generalDatabase.DBControlUnit;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package Acquisition;
|
||||
|
||||
import PamUtils.PamCalendar;
|
||||
import PamUtils.PamUtils;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
/**
|
||||
@ -100,8 +99,8 @@ public class DaqStatusDataUnit extends PamDataUnit {
|
||||
trueSampleRate = null;
|
||||
return null;
|
||||
}
|
||||
double samples = (double) (this.samples - previousUnit.getSamples());
|
||||
double tDiff = (double) (this.gpsPPSMilliseconds - previousUnit.getGpsPPSMilliseconds()) / 1000.;
|
||||
double samples = this.samples - previousUnit.getSamples();
|
||||
double tDiff = (this.gpsPPSMilliseconds - previousUnit.getGpsPPSMilliseconds()) / 1000.;
|
||||
if (tDiff > 0 && tDiff < 900 && samples > 0) {
|
||||
trueSampleRate = samples/tDiff;
|
||||
}
|
||||
|
@ -6,9 +6,7 @@ import javax.swing.JComponent;
|
||||
|
||||
import Acquisition.layoutFX.AcquisitionPaneFX;
|
||||
import Acquisition.layoutFX.DAQSettingsPane;
|
||||
import PamController.SettingsPane;
|
||||
import PamUtils.PamUtils;
|
||||
import javafx.scene.Node;
|
||||
import soundPlayback.FilePlayback;
|
||||
import soundPlayback.PlaybackControl;
|
||||
import soundPlayback.PlaybackSystem;
|
||||
|
@ -1,8 +1,6 @@
|
||||
package Acquisition;
|
||||
|
||||
import PamModel.CommonPluginInterface;
|
||||
import PamModel.PamModel;
|
||||
import PamModel.PamModuleInfo;
|
||||
|
||||
/**
|
||||
* Interface for External DAQ Systems
|
||||
|
@ -30,8 +30,8 @@ public class DaqSystemXMLManager {
|
||||
if (daqs == null) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < daqs.size(); i++) {
|
||||
AcquisitionControl daq = (AcquisitionControl) daqs.get(i);
|
||||
for (PamControlledUnit daq2 : daqs) {
|
||||
AcquisitionControl daq = (AcquisitionControl) daq2;
|
||||
AcquisitionParameters daqParams = daq.getAcquisitionParameters();
|
||||
if (daqParams.daqSystemType.equals(daqSystemType)) {
|
||||
return true;
|
||||
|
@ -22,7 +22,7 @@ public class FileInputParameters implements Serializable, Cloneable, ManagedPara
|
||||
/**
|
||||
* 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;
|
||||
|
||||
|
@ -7,8 +7,6 @@ import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -20,9 +18,9 @@ import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioFormat.Encoding;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import javax.sound.sampled.AudioFormat.Encoding;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
@ -32,33 +30,24 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
||||
import org.jflac.FLACDecoder;
|
||||
import org.jflac.PCMProcessor;
|
||||
import org.jflac.frame.Frame;
|
||||
import org.jflac.metadata.StreamInfo;
|
||||
import org.jflac.sound.spi.FlacEncoding;
|
||||
import org.jflac.util.ByteData;
|
||||
import org.pamguard.x3.sud.Chunk;
|
||||
import org.pamguard.x3.sud.SudAudioInputStream;
|
||||
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.FileDateDialogStrip;
|
||||
import Acquisition.filedate.FileDateObserver;
|
||||
import Acquisition.filetypes.SoundFileType;
|
||||
import Acquisition.pamAudio.PamAudioFileManager;
|
||||
import Acquisition.pamAudio.PamAudioFileFilter;
|
||||
import Acquisition.pamAudio.PamAudioFileManager;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
import PamController.PamSettingManager;
|
||||
@ -73,6 +62,16 @@ import PamView.panel.PamProgressBar;
|
||||
import pamguard.GlobalArguments;
|
||||
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.
|
||||
*
|
||||
@ -287,8 +286,8 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
fileNameCombo.removeAllItems();
|
||||
String file;
|
||||
if (fileInputParameters.recentFiles.size() == 0) return;
|
||||
for (int i = 0; i < fileInputParameters.recentFiles.size(); i++){
|
||||
file = fileInputParameters.recentFiles.get(i);
|
||||
for (String element : fileInputParameters.recentFiles) {
|
||||
file = element;
|
||||
if (file == null || file.length() == 0) continue;
|
||||
fileNameCombo.addItem(file);
|
||||
}
|
||||
@ -335,13 +334,13 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
|
||||
@Override
|
||||
public String getSystemName() {
|
||||
if (fileInputParameters.recentFiles == null) return null;
|
||||
if (fileInputParameters.recentFiles.size() < 1) return null;
|
||||
if ((fileInputParameters.recentFiles == null) || (fileInputParameters.recentFiles.size() < 1)) return null;
|
||||
File f = getCurrentFile();
|
||||
if (f == null) return null;
|
||||
return f.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
if (e.getSource() == fileSelect) {
|
||||
@ -374,8 +373,8 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
|
||||
javax.swing.filechooser.FileFilter[] filters = fileChooser
|
||||
.getChoosableFileFilters();
|
||||
for (int i = 0; i < filters.length; i++) {
|
||||
fileChooser.removeChoosableFileFilter(filters[i]);
|
||||
for (FileFilter filter : filters) {
|
||||
fileChooser.removeChoosableFileFilter(filter);
|
||||
}
|
||||
fileChooser.addChoosableFileFilter(new PamAudioFileFilter());
|
||||
|
||||
@ -407,8 +406,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
* @param newFile
|
||||
*/
|
||||
public void interpretNewFile(String newFile){
|
||||
if (newFile == null) return;
|
||||
if (newFile.length() == 0) return;
|
||||
if ((newFile == null) || (newFile.length() == 0)) return;
|
||||
|
||||
File file = new File(newFile);
|
||||
|
||||
@ -511,24 +509,29 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return fileInputParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return FileInputParameters.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnitName() {
|
||||
// return "File Input System";
|
||||
return acquisitionControl.getUnitName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnitType() {
|
||||
// return "Acquisition System";
|
||||
return "File Input System";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
// if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) {
|
||||
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.size() < 1) return false;
|
||||
// String fileName = fileInputParameters.recentFiles.get(0);
|
||||
if (runFileAnalysis() == false) {
|
||||
if (!runFileAnalysis()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -569,8 +572,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
|
||||
public File getCurrentFile() {
|
||||
// System.out.println("fileInputParameters: " + fileInputParameters);
|
||||
if (fileInputParameters.recentFiles == null) return null;
|
||||
if (fileInputParameters.recentFiles.size() < 1) return null;
|
||||
if ((fileInputParameters.recentFiles == null) || (fileInputParameters.recentFiles.size() < 1)) return null;
|
||||
String fileName = fileInputParameters.recentFiles.get(0);
|
||||
return new File(fileName);
|
||||
}
|
||||
@ -875,7 +877,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
|
||||
@Override
|
||||
public void processPCM(ByteData byteData) {
|
||||
if (dontStop == false) {
|
||||
if (!dontStop) {
|
||||
try {
|
||||
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) {
|
||||
if (dontStop == false) break;
|
||||
if (!dontStop) break;
|
||||
try {
|
||||
Thread.sleep(2);
|
||||
} catch (Exception ex) {
|
||||
@ -943,6 +945,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
|
||||
public class CollectorThread implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (audioFormat.getEncoding() == FlacEncoding.FLAC) {
|
||||
collectFlacData();
|
||||
@ -1051,7 +1054,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
* unit, then set it's reference to zero.
|
||||
*/
|
||||
while (newDataUnits.getQueueSize() > 3*nChannels) {
|
||||
if (dontStop == false) break;
|
||||
if (!dontStop) break;
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
} catch (Exception ex) {
|
||||
@ -1079,7 +1082,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
}
|
||||
}
|
||||
// note the reason why the file has ended.
|
||||
if (dontStop == false) { // stop button pressed
|
||||
if (!dontStop) { // stop button pressed
|
||||
setStreamStatus(STREAM_PAUSED);
|
||||
}
|
||||
else { // file ended, since dont stop is true.
|
||||
@ -1100,7 +1103,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
|
||||
* @return
|
||||
*/
|
||||
protected boolean openNextFile(long totalSamples) {
|
||||
if (fileInputParameters.repeatLoop == false) {
|
||||
if (!fileInputParameters.repeatLoop) {
|
||||
return false;
|
||||
}
|
||||
// otherwise, open the same file again.
|
||||
|
@ -7,7 +7,6 @@ import java.lang.reflect.Field;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import simulatedAcquisition.SimProcess;
|
||||
|
||||
/**
|
||||
* Control parameters for FolderInputSystem
|
||||
|
@ -24,16 +24,14 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.Timer;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import Acquisition.filedate.FileDateDialogStrip;
|
||||
import Acquisition.layoutFX.AcquisitionPaneFX;
|
||||
import Acquisition.layoutFX.DAQSettingsPane;
|
||||
import Acquisition.layoutFX.FolderInputPane;
|
||||
import javafx.application.Platform;
|
||||
import pamguard.GlobalArguments;
|
||||
import Acquisition.pamAudio.PamAudioFileManager;
|
||||
import Acquisition.pamAudio.PamAudioFileFilter;
|
||||
import Acquisition.pamAudio.PamAudioFileLoader;
|
||||
import Acquisition.pamAudio.PamAudioSystem;
|
||||
import Acquisition.pamAudio.PamAudioFileManager;
|
||||
import PamController.DataInputStore;
|
||||
import PamController.InputStoreInfo;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
@ -52,6 +50,8 @@ import PamView.dialog.PamLabel;
|
||||
import PamView.panel.PamPanel;
|
||||
import PamView.panel.PamProgressBar;
|
||||
import PamguardMVC.debug.Debug;
|
||||
import javafx.application.Platform;
|
||||
import pamguard.GlobalArguments;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
protected ArrayList<WavFileType> allFiles = new ArrayList<WavFileType>();
|
||||
protected ArrayList<WavFileType> allFiles = new ArrayList<>();
|
||||
|
||||
protected int currentFile;
|
||||
|
||||
@ -109,7 +109,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
@Override
|
||||
public boolean 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());
|
||||
/*
|
||||
* 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 ?
|
||||
File aFile = new File(globalFolder);
|
||||
if (aFile.exists() == false) {
|
||||
if (!aFile.exists()) {
|
||||
System.err.printf("Command line wav folder \"%s\" does not exist", globalFolder);
|
||||
// return null;
|
||||
}
|
||||
@ -168,6 +168,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
*/
|
||||
class RestartTimer implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
// System.out.println("Restart later time action");
|
||||
@ -306,6 +307,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
|
||||
class FindAudioFolder implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
selectFolder();
|
||||
@ -670,7 +672,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
@Override
|
||||
protected boolean openNextFile(long totalSamples) {
|
||||
boolean ans = false;
|
||||
if (folderInputParameters.mergeFiles == false) return false;
|
||||
if (!folderInputParameters.mergeFiles) return false;
|
||||
|
||||
|
||||
long currFileStart = 0;
|
||||
@ -720,7 +722,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
* itself if we use the super.prep ....
|
||||
*/
|
||||
ans = super.prepareInputFile();
|
||||
if (ans == false) {
|
||||
if (!ans) {
|
||||
return false;
|
||||
}
|
||||
currentFileStart = System.currentTimeMillis();
|
||||
@ -746,7 +748,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
}
|
||||
if (currentFile < allFiles.size()) {
|
||||
// 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()));
|
||||
newFileTimer.start();
|
||||
}
|
||||
@ -918,6 +920,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
|
||||
/****JavaFX bits***/
|
||||
|
||||
@Override
|
||||
public DAQSettingsPane getDAQSpecificPane(AcquisitionPaneFX acquisitionPaneFX) {
|
||||
if (folderInputPane==null) this.folderInputPane = new FolderInputPane(this, acquisitionPaneFX);
|
||||
return folderInputPane;
|
||||
@ -1015,6 +1018,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
/**
|
||||
* Get a status update for batch processing.
|
||||
*/
|
||||
@Override
|
||||
public String getBatchStatus() {
|
||||
int nFiles = 0;
|
||||
if (allFiles != null) {
|
||||
|
@ -8,16 +8,13 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import PamDetection.RawDataUnit;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamRawDataBlock;
|
||||
import binaryFileStorage.BinaryDataSource;
|
||||
import binaryFileStorage.BinaryHeader;
|
||||
import binaryFileStorage.BinaryObjectData;
|
||||
import binaryFileStorage.BinaryOutputStream;
|
||||
import binaryFileStorage.ModuleFooter;
|
||||
import binaryFileStorage.ModuleHeader;
|
||||
import binaryFileStorage.PackedBinaryObject;
|
||||
|
||||
/**
|
||||
* Data source for Raw acoustic data. This is set up to NEVER
|
||||
|
@ -10,11 +10,9 @@ import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioFormat.Encoding;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
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.PCMProcessor;
|
||||
@ -25,15 +23,14 @@ import org.jflac.PCMProcessor;
|
||||
import org.jflac.metadata.StreamInfo;
|
||||
import org.jflac.util.ByteData;
|
||||
|
||||
import wavFiles.ByteConverter;
|
||||
import Acquisition.pamAudio.PamAudioFileManager;
|
||||
import Acquisition.pamAudio.PamAudioFileFilter;
|
||||
import Acquisition.pamAudio.PamAudioSystem;
|
||||
import Acquisition.pamAudio.PamAudioFileManager;
|
||||
import PamDetection.RawDataUnit;
|
||||
import PamUtils.FileParts;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamUtils.PamFileFilter;
|
||||
import PamUtils.PamUtils;
|
||||
import wavFiles.ByteConverter;
|
||||
|
||||
/**
|
||||
* Bespoke system for handling data from the Rona hydrophone array which
|
||||
@ -98,7 +95,7 @@ public class RonaInputSystem extends FolderInputSystem {
|
||||
|
||||
@Override
|
||||
public boolean accept(File f) {
|
||||
if (super.accept(f) == false) {
|
||||
if (!super.accept(f)) {
|
||||
return false;
|
||||
}
|
||||
if (f.isDirectory()) {
|
||||
@ -245,7 +242,7 @@ public class RonaInputSystem extends FolderInputSystem {
|
||||
@Override
|
||||
public boolean prepareSystem(AcquisitionControl daqControl) {
|
||||
this.acquisitionControl = daqControl;
|
||||
if (prepareInputFile() == false) {
|
||||
if (!prepareInputFile()) {
|
||||
return false;
|
||||
}
|
||||
this.newDataUnits = acquisitionControl.getDaqProcess().getNewDataQueue();
|
||||
@ -368,7 +365,7 @@ public class RonaInputSystem extends FolderInputSystem {
|
||||
newDataUnits.addNewData(readyDataUnits[i]);
|
||||
}
|
||||
while (newDataUnits.getQueueSize() > NCHANNELS) {
|
||||
if (dontStop == false) break;
|
||||
if (!dontStop) break;
|
||||
try {
|
||||
Thread.sleep(2);
|
||||
} catch (Exception ex) {
|
||||
@ -403,7 +400,7 @@ public class RonaInputSystem extends FolderInputSystem {
|
||||
|
||||
@Override
|
||||
public void processPCM(ByteData byteData) {
|
||||
if (dontStop == false) {
|
||||
if (!dontStop) {
|
||||
try {
|
||||
fileStream.close(); // will make the flac reader bomb out !
|
||||
}
|
||||
@ -443,7 +440,7 @@ public class RonaInputSystem extends FolderInputSystem {
|
||||
// newDataUnit.timeMilliseconds = blockMillis;
|
||||
PamCalendar.setSoundFileTimeInMillis(blockMillis);
|
||||
if (fileSamples > 0 && totalSamples - lastProgressUpdate >= getSampleRate()*2) {
|
||||
int progress = (int) (1000. * (float)theseFileSamples / (float) fileSamples);
|
||||
int progress = (int) (1000. * theseFileSamples / fileSamples);
|
||||
fileProgress.setValue(progress);
|
||||
sayEta();
|
||||
long now = System.currentTimeMillis();
|
||||
@ -464,7 +461,7 @@ public class RonaInputSystem extends FolderInputSystem {
|
||||
*/
|
||||
for (int ichan = 0; ichan < 1; ichan++) {
|
||||
while (waitingDataUnit(ichan+channelOffset)) {
|
||||
if (dontStop == false) break;
|
||||
if (!dontStop) break;
|
||||
try {
|
||||
Thread.sleep(2);
|
||||
} catch (Exception ex) {
|
||||
|
@ -5,7 +5,6 @@ import java.io.Serializable;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import simulatedAcquisition.SimProcess;
|
||||
|
||||
/**
|
||||
* Used by SoundCardSystem
|
||||
|
@ -8,6 +8,7 @@ import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.Mixer;
|
||||
import javax.sound.sampled.Mixer.Info;
|
||||
import javax.sound.sampled.TargetDataLine;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JPanel;
|
||||
@ -16,15 +17,14 @@ import javax.swing.border.TitledBorder;
|
||||
import Acquisition.layoutFX.AcquisitionPaneFX;
|
||||
import Acquisition.layoutFX.DAQSettingsPane;
|
||||
import Acquisition.layoutFX.SoundCardDAQPane;
|
||||
import soundPlayback.PlaybackControl;
|
||||
import soundPlayback.PlaybackSystem;
|
||||
import soundPlayback.SoundCardPlayback;
|
||||
import wavFiles.ByteConverter;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
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.
|
||||
@ -129,7 +129,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
// lineOk = false;
|
||||
// }
|
||||
// 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);
|
||||
try {
|
||||
targetDataLine.open(audioFormat);
|
||||
@ -225,12 +225,12 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
|
||||
|
||||
public static ArrayList<Mixer.Info> getInputMixerList() {
|
||||
ArrayList<Mixer.Info> mixers = new ArrayList<Mixer.Info>();
|
||||
ArrayList<Mixer.Info> mixers = new ArrayList<>();
|
||||
AudioSystem.getMixerInfo();
|
||||
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
|
||||
Mixer mixer;
|
||||
for (int i = 0; i < mixerInfo.length; i++) {
|
||||
mixer = AudioSystem.getMixer(mixerInfo[i]);
|
||||
for (Info element : mixerInfo) {
|
||||
mixer = AudioSystem.getMixer(element);
|
||||
//System.out.println("mixer:"+mixer);
|
||||
//System.out.println(mixer.getClass().getName());
|
||||
//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")) ||
|
||||
(mixer.getClass().getName().equals("com.sun.media.sound.SimpleInputDevice"))) {
|
||||
//System.out.println("Adding to input mixer list:"+mixer.getClass().getName());
|
||||
mixers.add(mixerInfo[i]);
|
||||
mixers.add(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mixers;
|
||||
}
|
||||
public static ArrayList<Mixer.Info> getOutputMixerList() {
|
||||
ArrayList<Mixer.Info> mixers = new ArrayList<Mixer.Info>();
|
||||
ArrayList<Mixer.Info> mixers = new ArrayList<>();
|
||||
AudioSystem.getMixerInfo();
|
||||
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
|
||||
Mixer mixer;
|
||||
for (int i = 0; i < mixerInfo.length; i++) {
|
||||
for (Info element : mixerInfo) {
|
||||
try {
|
||||
mixer = AudioSystem.getMixer(mixerInfo[i]);
|
||||
mixer = AudioSystem.getMixer(element);
|
||||
}
|
||||
catch (Exception e) {
|
||||
continue;
|
||||
@ -268,7 +268,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
if ((mixer.getClass().getName().equals("com.sun.media.sound.DirectAudioDevice")) ||
|
||||
(mixer.getClass().getName().equals("com.sun.media.sound.HeadspaceMixer"))) {
|
||||
//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());
|
||||
}
|
||||
// else {
|
||||
@ -283,7 +283,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
}
|
||||
|
||||
public static ArrayList<String> getDevicesList() {
|
||||
ArrayList<String> devices = new ArrayList<String>();
|
||||
ArrayList<String> devices = new ArrayList<>();
|
||||
ArrayList<Mixer.Info> mixers = getInputMixerList();
|
||||
for (int i = 0; i < mixers.size(); i++) {
|
||||
//System.out.println("Adding Device:"+mixers.get(i).getName());
|
||||
@ -306,9 +306,9 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
ArrayList<String> devices = getDevicesList();
|
||||
|
||||
audioDevices.removeAllItems();
|
||||
for (int i = 0; i < devices.size(); i++) {
|
||||
for (String element : devices) {
|
||||
//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);
|
||||
@ -396,24 +396,29 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
return PARAMETER_UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return soundCardParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return SoundCardParameters.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnitName() {
|
||||
// return "Sound Card System";
|
||||
return acquisitionControl.getUnitName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnitType() {
|
||||
// return "Acquisition System";
|
||||
return "Sound Card System";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
// if (PamSettingManager.getInstance().isSettingsUnit(this, pamControlledUnitSettings)) {
|
||||
try {
|
||||
@ -447,6 +452,7 @@ public class SoundCardSystem extends DaqSystem implements PamSettings {
|
||||
|
||||
class CaptureThread implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
stopCapture = false;
|
||||
captureRunning = true;
|
||||
|
@ -24,7 +24,7 @@ public class WavFileFuncs extends AudioFileFuncs {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (wavHead.checkSizes(aFile.length()) == false) {
|
||||
if (!wavHead.checkSizes(aFile.length())) {
|
||||
wavHead.repairSizes(aFile.length());
|
||||
return writeNewSizes(wavHead, aFile);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class WavHeader {
|
||||
|
||||
public void addChunkData(WavChunkData chunkData) {
|
||||
if (otherChunks == null) {
|
||||
otherChunks = new ArrayList<WavChunkData>();
|
||||
otherChunks = new ArrayList<>();
|
||||
}
|
||||
otherChunks.add(chunkData);
|
||||
int t = chunkData.getType();
|
||||
|
@ -16,7 +16,6 @@ import java.io.Serializable;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
@ -29,15 +28,12 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import soundPlayback.PlaybackControl;
|
||||
import soundPlayback.PlaybackSystem;
|
||||
import soundPlayback.SoundCardPlayback;
|
||||
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
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;
|
||||
|
||||
/* 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 */
|
||||
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)
|
||||
* and passes it to PAMGUARD using the newDataUnits list
|
||||
*/
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
/* buffer to receive data from message queue */
|
||||
@ -482,7 +479,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
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 */
|
||||
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)
|
||||
{
|
||||
/* get the chunk length */
|
||||
chunkLen = (int)(((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8)
|
||||
| (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF));
|
||||
chunkLen = ((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8)
|
||||
| (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF);
|
||||
|
||||
|
||||
if(DEBUG)
|
||||
@ -555,10 +552,10 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
break;
|
||||
case SCALING_CHUNK:
|
||||
/* 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 + 2] & 0xFF) << 8 )
|
||||
| ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 3] & 0xFF)) );
|
||||
| ((msg.payload[payloadIndex + SCALING_MAX_AMPLITUDE_OFFSET + 3] & 0xFF));
|
||||
if(DEBUG)
|
||||
{
|
||||
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)
|
||||
{
|
||||
/* get the length of the chunk */
|
||||
chunkLen = (int)(((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8)
|
||||
| (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF));
|
||||
chunkLen = ((msg.payload[payloadIndex + CHUNK_SIZE_OFFSET] & 0xFF) << 8)
|
||||
| (msg.payload[payloadIndex + CHUNK_SIZE_OFFSET + 1] & 0xFF);
|
||||
|
||||
if(DEBUG)
|
||||
{
|
||||
@ -615,8 +612,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
if(eventKeyMatch)
|
||||
{
|
||||
/* get the number of samples */
|
||||
doubleBufLen = (int)(((msg.payload[payloadIndex + DATA_SAMPLES_OFFSET] & 0xFF) << 8)
|
||||
| (msg.payload[payloadIndex + DATA_SAMPLES_OFFSET + 1] & 0xFF));
|
||||
doubleBufLen = ((msg.payload[payloadIndex + DATA_SAMPLES_OFFSET] & 0xFF) << 8)
|
||||
| (msg.payload[payloadIndex + DATA_SAMPLES_OFFSET + 1] & 0xFF);
|
||||
|
||||
/* Check if any samples where missed since the header
|
||||
* 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 */
|
||||
if( (long)sampleNumber != (sampleTally - sequenceNumber))
|
||||
if( sampleNumber != (sampleTally - sequenceNumber))
|
||||
{
|
||||
System.out.println("Missed samples!\nSample number: " + sampleNumber
|
||||
+ " Samples since header: " + (sampleTally - sequenceNumber));
|
||||
@ -635,7 +632,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
}
|
||||
|
||||
/* update the sample tally */
|
||||
sampleTally = sampleTally + (long)doubleBufLen;
|
||||
sampleTally = sampleTally + doubleBufLen;
|
||||
|
||||
if(DEBUG)
|
||||
{
|
||||
@ -649,10 +646,9 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
doubleIndex++, chunkIndex += 3)
|
||||
{
|
||||
/* 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] & 0xFF) << 16)
|
||||
);
|
||||
| ((msg.payload[chunkIndex] & 0xFF) << 16);
|
||||
|
||||
if(DEBUG)
|
||||
{
|
||||
@ -696,12 +692,12 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
|
||||
/* add it as a new data unit */
|
||||
//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);
|
||||
newDataUnits.addNewData(newDataUnit);
|
||||
|
||||
/* tally the total samples */
|
||||
totalSamples += (long)doubleBufLen;
|
||||
totalSamples += doubleBufLen;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -758,6 +754,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
* Function where a message will be received and put into
|
||||
* the message queue for future processing
|
||||
*/
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
/* Data capture is running */
|
||||
@ -1068,8 +1065,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
this.payloadLength = new char[PAYLOADLEN_ARRAY_LENGTH];
|
||||
this.payloadLength[0] = (char) buf[2];
|
||||
this.payloadLength[1] = (char) buf[3];
|
||||
payloadLength = (int)((this.payloadLength[1] & 0xFF)
|
||||
| ((this.payloadLength[0] & 0xFF) << 8));
|
||||
payloadLength = (this.payloadLength[1] & 0xFF)
|
||||
| ((this.payloadLength[0] & 0xFF) << 8);
|
||||
|
||||
/* get payload */
|
||||
this.payload = new char[payloadLength];
|
||||
@ -1256,6 +1253,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
waveformBandwidth = new JComboBox();
|
||||
waveformBandwidth.addActionListener(
|
||||
new ActionListener () {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
/* update the sampleRate text field*/
|
||||
currentSampleRateString = waveformBandwidth.getSelectedIndex();
|
||||
@ -1640,8 +1638,8 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
}
|
||||
|
||||
/* Message has been received and verified, obtain necessary information */
|
||||
serialNum = (int)(buffer[SERIAL_NUM_OFFSET] | (buffer[SERIAL_NUM_OFFSET + 1] << 8));
|
||||
deviceType = (int)buffer[DEVICE_TYPE_OFFSET];
|
||||
serialNum = buffer[SERIAL_NUM_OFFSET] | (buffer[SERIAL_NUM_OFFSET + 1] << 8);
|
||||
deviceType = buffer[DEVICE_TYPE_OFFSET];
|
||||
|
||||
if(DEBUG)
|
||||
{
|
||||
@ -1986,7 +1984,7 @@ public class icListenSystem extends DaqSystem implements PamSettings
|
||||
/* make sure the proper values are set in the acquisition control */
|
||||
acquisitionControl.getDaqProcess().setSampleRate(currentSampleRate, true);
|
||||
|
||||
dataUnitSamples = (int) (currentSampleRate / 10);
|
||||
dataUnitSamples = currentSampleRate / 10;
|
||||
|
||||
/* keep a reference to where data will be put. */
|
||||
// DOUG changed type of this in latest version for some better queue management
|
||||
|
@ -37,14 +37,17 @@ public class AirgunControl extends PamControlledUnit implements PamSettings, Pos
|
||||
airgunProcess.findSourceData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return airgunParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return AirgunParameters.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
if (pamControlledUnitSettings.getVersionNo() != AirgunParameters.serialVersionUID) {
|
||||
return false;
|
||||
@ -69,6 +72,7 @@ public class AirgunControl extends PamControlledUnit implements PamSettings, Pos
|
||||
this.frame = frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
AirgunParameters newParams = AirgunParametersDialog.showDialog(frame, airgunParameters);
|
||||
|
@ -14,12 +14,12 @@ import PamUtils.Coordinate3d;
|
||||
import PamUtils.LatLong;
|
||||
import PamView.BasicKeyItem;
|
||||
import PamView.GeneralProjector;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.GeneralProjector.ParameterUnits;
|
||||
import PamView.PamKeyItem;
|
||||
import PamView.PamSymbol;
|
||||
import PamView.PamSymbolType;
|
||||
import PamView.PanelOverlayDraw;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.GeneralProjector.ParameterUnits;
|
||||
import PamView.symbol.SymbolData;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
@ -43,12 +43,14 @@ public class AirgunGraphics extends PanelOverlayDraw {
|
||||
parameterTypes[1] == GeneralProjector.ParameterType.LONGITUDE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PamKeyItem createKeyItem(GeneralProjector generalProjector,int keyType) {
|
||||
|
||||
return new BasicKeyItem(getPamSymbol(null, generalProjector), airgunControl.getUnitName());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle drawDataUnit(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) {
|
||||
|
||||
AirgunDataUnit airgunDataUnit = (AirgunDataUnit) pamDataUnit;
|
||||
@ -224,6 +226,7 @@ public class AirgunGraphics extends PanelOverlayDraw {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHoverText(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) {
|
||||
String str = "<html>" + airgunControl.getUnitName();
|
||||
if (airgunControl.airgunParameters.showExclusionZone) {
|
||||
|
@ -78,11 +78,11 @@ public class AirgunParameters implements Serializable, Cloneable, ManagedParamet
|
||||
public AirgunParameters clone() {
|
||||
try {
|
||||
AirgunParameters np = (AirgunParameters) super.clone();
|
||||
if (np.hasGunsReferencePosition == false) {
|
||||
if (!np.hasGunsReferencePosition) {
|
||||
// sort out what happens if old boolean ref was used
|
||||
// instead of new int type.
|
||||
np.hasGunsReferencePosition = true;
|
||||
if (np.gunsThisVessel == false) {
|
||||
if (!np.gunsThisVessel) {
|
||||
np.gunsReferencePosition = GUNS_AIS_VESSEL;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.BevelBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
@ -94,8 +95,7 @@ public class AirgunParametersDialog extends PamDialog {
|
||||
airgunParameters.dimE = dim[0];
|
||||
airgunParameters.dimF = dim[1];
|
||||
airgunParameters.gunDepth = dim[2];
|
||||
if (shipIDPanel.getParams() == false) return false;
|
||||
if (exclusionPanel.getParams() == false) return false;
|
||||
if (!shipIDPanel.getParams() || !exclusionPanel.getParams()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ public class AirgunParametersDialog extends PamDialog {
|
||||
c.gridy++;
|
||||
c.gridx = 0;
|
||||
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++;
|
||||
addComponent(this, mmsiNumber = new JTextField(7), c);
|
||||
c.gridx = 0;
|
||||
@ -147,6 +147,7 @@ public class AirgunParametersDialog extends PamDialog {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
enableControls();
|
||||
}
|
||||
@ -248,11 +249,11 @@ public class AirgunParametersDialog extends PamDialog {
|
||||
c.gridx = 0;
|
||||
c.gridy ++;
|
||||
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++;
|
||||
addComponent(this, predictionTime = new JTextField(6), c);
|
||||
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;
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (e.getSource() == exButton) {
|
||||
Color newColor = JColorChooser.showDialog(this, "Mitigation zone colour",
|
||||
|
@ -7,11 +7,9 @@ import AIS.AISDataUnit;
|
||||
import AIS.AISPositionReport;
|
||||
import GPS.GpsData;
|
||||
import GPS.GpsDataUnit;
|
||||
import Map.MapCommentOverlayGraphics;
|
||||
import PamController.PamController;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.symbol.PamSymbolManager;
|
||||
import PamView.symbol.StandardSymbolManager;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
@ -8,6 +8,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFileChooser;
|
||||
@ -16,6 +17,7 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JSplitPane;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
||||
import Acquisition.AcquisitionControl;
|
||||
import Acquisition.AcquisitionParameters;
|
||||
import PamController.PamController;
|
||||
@ -170,7 +172,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
public boolean getParams() {
|
||||
// all OK, so
|
||||
// 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();
|
||||
ArrayManager.getArrayManager().setCurrentArray(array);
|
||||
@ -179,7 +181,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
hydrophoneDialogPanel.getParams();
|
||||
instrumentIdentityPanel.getParams(array);
|
||||
|
||||
if (checkDaqChannels(array) == false) {
|
||||
if (!checkDaqChannels(array)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -198,7 +200,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
ArrayList<AcquisitionControl> daqControllers = AcquisitionControl.getControllers();
|
||||
boolean allOk = true;
|
||||
for (int i = 0; i < daqControllers.size(); i++) {
|
||||
if (checkDaqChannels(daqControllers.get(i), array) == false) {
|
||||
if (!checkDaqChannels(daqControllers.get(i), array)) {
|
||||
allOk = false;
|
||||
}
|
||||
}
|
||||
@ -238,7 +240,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (environmentPanel.getParams() == false) {
|
||||
else if (!environmentPanel.getParams()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -274,6 +276,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
deleteArrayButton.setEnabled(ArrayManager.getArrayManager().getArrayCount() > 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (e.getSource() == cancelButton) {
|
||||
this.setVisible(false);
|
||||
|
@ -8,11 +8,9 @@ import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import pamMaths.PamQuaternion;
|
||||
import pamMaths.PamVector;
|
||||
import userDisplay.UserDisplayControl;
|
||||
import Array.importHydrophoneData.HydrophoneImport;
|
||||
import Array.importHydrophoneData.StreamerImport;
|
||||
import Array.layoutFX.ArrayGUIFX;
|
||||
@ -26,6 +24,7 @@ import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitGUI;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamController.PamGUIManager;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
@ -40,6 +39,9 @@ import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamObservable;
|
||||
import PamguardMVC.PamObserver;
|
||||
import dataPlotsFX.data.TDDataProviderRegisterFX;
|
||||
import pamMaths.PamQuaternion;
|
||||
import pamMaths.PamVector;
|
||||
import userDisplay.UserDisplayControl;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@Override
|
||||
public void notifyModelChanged(int changeType) {
|
||||
if (changeType == PamController.INITIALIZATION_COMPLETE) {
|
||||
if (changeType == PamControllerInterface.INITIALIZATION_COMPLETE) {
|
||||
initComplete = true;
|
||||
}
|
||||
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 ?
|
||||
// if (PamController.getInstance().getRunMode() == PamController.RUN_NORMAL) {
|
||||
hydrophonesProcess.createArrayData();
|
||||
// }
|
||||
}
|
||||
|
||||
if (changeType == PamController.OFFLINE_DATA_LOADED){
|
||||
if (changeType == PamControllerInterface.OFFLINE_DATA_LOADED){
|
||||
if (isViewer) {
|
||||
getHydrophoneDataBlock().clearChannelIterators();
|
||||
}
|
||||
}
|
||||
|
||||
if (changeType == PamController.HYDROPHONE_ARRAY_CHANGED){
|
||||
if (changeType == PamControllerInterface.HYDROPHONE_ARRAY_CHANGED){
|
||||
if (isViewer) {
|
||||
getHydrophoneDataBlock().clearChannelIterators();
|
||||
}
|
||||
}
|
||||
|
||||
if (changeType == PamController.GLOBAL_MEDIUM_UPDATE){
|
||||
if (changeType == PamControllerInterface.GLOBAL_MEDIUM_UPDATE){
|
||||
this.getCurrentArray().setSpeedOfSound(this.getPamController().getGlobalMediumManager().getDefaultSoundSpeed());
|
||||
this.getCurrentArray().setDefaultSensitivity(this.getPamController().getGlobalMediumManager().getDefaultRecieverSens());
|
||||
}
|
||||
@ -229,7 +232,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
if (selectedArray != null) {
|
||||
hydrophonesProcess.createArrayData();
|
||||
// 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)
|
||||
* @see PamController.PamSettings#GetSettingsReference()
|
||||
*/
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
/*
|
||||
* Save the entire array classes in the serialised file
|
||||
@ -275,6 +279,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
/* (non-Javadoc)
|
||||
* @see PamController.PamSettings#GetSettingsVersion()
|
||||
*/
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return ArrayParameters.serialVersionUID;
|
||||
}
|
||||
@ -282,6 +287,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
/* (non-Javadoc)
|
||||
* @see PamController.PamSettings#GetUnitName()
|
||||
*/
|
||||
@Override
|
||||
public String getUnitName() {
|
||||
return "Array Manager";
|
||||
}
|
||||
@ -289,6 +295,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
/* (non-Javadoc)
|
||||
* @see PamController.PamSettings#getUnitType()
|
||||
*/
|
||||
@Override
|
||||
public String getUnitType() {
|
||||
return "Array Manager";
|
||||
}
|
||||
@ -296,6 +303,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
/* (non-Javadoc)
|
||||
* @see PamController.PamSettings#RestoreSettings(PamController.PamControlledUnitSettings)
|
||||
*/
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
try {
|
||||
if (pamControlledUnitSettings.getSettings() != null) {
|
||||
@ -385,23 +393,28 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getObserverName() {
|
||||
return "Array Manager";
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
return 3600*1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void noteNewSettings() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeObservable(PamObservable o) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSampleRate(float sampleRate, boolean notify) {
|
||||
// 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.
|
||||
// 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 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]);
|
||||
break;
|
||||
}
|
||||
@ -771,7 +784,7 @@ public class ArrayManager extends PamControlledUnit implements PamSettings, PamO
|
||||
int nPairs = pvs.length;
|
||||
for (int i = 0; i < nPairs; i++) {
|
||||
for (int j = i+1; j < nPairs; j++) {
|
||||
if (pvs[i].isInLine(pvs[j]) == false) {
|
||||
if (!pvs[i].isInLine(pvs[j])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package Array;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
|
@ -9,7 +9,7 @@ import Array.sensors.swing.ArrayDisplayParamsDialog;
|
||||
import Array.swing.sidepanel.ArraySidePanel;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
import PamUtils.PamCalendar;
|
||||
@ -45,13 +45,13 @@ public class ArraySidePanelControl extends PamControlledUnit implements ArrayDis
|
||||
public void notifyModelChanged(int changeType) {
|
||||
super.notifyModelChanged(changeType);
|
||||
switch (changeType) {
|
||||
case PamController.INITIALIZATION_COMPLETE:
|
||||
case PamController.HYDROPHONE_ARRAY_CHANGED:
|
||||
case PamControllerInterface.INITIALIZATION_COMPLETE:
|
||||
case PamControllerInterface.HYDROPHONE_ARRAY_CHANGED:
|
||||
if (arraySidePanel != null) {
|
||||
arraySidePanel.update();
|
||||
}
|
||||
break;
|
||||
case PamController.NEW_SCROLL_TIME:
|
||||
case PamControllerInterface.NEW_SCROLL_TIME:
|
||||
if (isViewer()) {
|
||||
arraySidePanel.updateViewerTime(PamCalendar.getTimeInMillis());
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
|
||||
channelTableData.fireTableDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (e.getSource() == daqControllerList) {
|
||||
selectDaqController();
|
||||
@ -167,10 +168,12 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
|
||||
|
||||
class ChannelTableData extends AbstractTableModel {
|
||||
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return channelColumns.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRowCount() {
|
||||
if (acquisitionControl == null) return 0;
|
||||
return (acquisitionControl.acquisitionParameters.nChannels);
|
||||
@ -181,6 +184,7 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
|
||||
return channelColumns[column];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
if (acquisitionControl == null) return null;
|
||||
// see if the controller has a hydrophone list
|
||||
@ -247,6 +251,7 @@ public class ChannelPanel implements ActionListener, ListSelectionListener {
|
||||
/* (non-Javadoc)
|
||||
* @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
enableButtons();
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package Array;
|
||||
|
||||
import GPS.GpsData;
|
||||
|
||||
public class EmptyLocatorSettings extends LocatorSettings {
|
||||
|
||||
public EmptyLocatorSettings(Class locatorClass) {
|
||||
|
@ -30,9 +30,9 @@ import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import pamMaths.PamVector;
|
||||
import PamView.PamSymbol;
|
||||
import PamView.PamSymbolType;
|
||||
import pamMaths.PamVector;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -3,12 +3,11 @@ package Array;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import GPS.NavDataSynchronisation;
|
||||
import pamScrollSystem.ViewLoadObserver;
|
||||
import PamController.PamController;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.dataOffline.OfflineDataLoadInfo;
|
||||
import pamScrollSystem.ViewLoadObserver;
|
||||
|
||||
public class HydrophoneDataBlock extends PamDataBlock<HydrophoneDataUnit> {
|
||||
|
||||
@ -104,7 +103,7 @@ public class HydrophoneDataBlock extends PamDataBlock<HydrophoneDataUnit> {
|
||||
long difference;
|
||||
|
||||
ListIterator<HydrophoneDataUnit> listIterator = getListIterator(ITERATOR_END);
|
||||
if (listIterator.hasPrevious() == false) {
|
||||
if (!listIterator.hasPrevious()) {
|
||||
return null;
|
||||
}
|
||||
unit = listIterator.previous();
|
||||
|
@ -9,17 +9,19 @@ import java.awt.Point;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import Acquisition.AcquisitionControl;
|
||||
import GPS.GpsData;
|
||||
import Layout.PamAxis;
|
||||
import Layout.PamAxisPanel;
|
||||
import PamController.PamController;
|
||||
import PamUtils.LatLong;
|
||||
import PamView.PamColors.PamColor;
|
||||
import PamView.PamSymbol;
|
||||
import PamView.PamSymbolType;
|
||||
import PamView.PamColors.PamColor;
|
||||
import PamView.panel.PamBorder;
|
||||
import pamMaths.PamVector;
|
||||
|
||||
|
@ -25,8 +25,6 @@ import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
|
||||
|
||||
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import PamController.PamController;
|
||||
|
||||
@ -219,6 +217,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
|
||||
hydrophoneTableData.fireTableDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (e.getSource() == recentArrays) {
|
||||
arrayDialog.newArraySelection();
|
||||
@ -573,7 +572,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
|
||||
/**
|
||||
* and the hydrophones ...
|
||||
*/
|
||||
if (phonesToo == false) {
|
||||
if (!phonesToo) {
|
||||
return;
|
||||
}
|
||||
int nPhones = currentArray.getHydrophoneCount();
|
||||
@ -694,11 +693,13 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
|
||||
|
||||
class HydrophoneTableData extends AbstractTableModel {
|
||||
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return hydrophoneColumns.length;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRowCount() {
|
||||
PamArray currentArray = getDialogSelectedArray();
|
||||
if (currentArray == null) return 0;
|
||||
@ -710,6 +711,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
|
||||
return hydrophoneColumns[column];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
PamArray array = getDialogSelectedArray();
|
||||
Hydrophone hydrophone = array.getHydrophone(rowIndex);
|
||||
@ -750,6 +752,7 @@ public class HydrophoneDialogPanel implements ActionListener, ListSelectionListe
|
||||
/* (non-Javadoc)
|
||||
* @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
enableButtons();
|
||||
}
|
||||
|
@ -110,8 +110,8 @@ public class HydrophoneElementDialog extends PamDialog {
|
||||
|
||||
@Override
|
||||
public boolean getParams() {
|
||||
if (generalPanel.getParams() == false) return false;
|
||||
if (coordinatePanel.getParams() == false) return false;
|
||||
if (!generalPanel.getParams()) return false;
|
||||
if (!coordinatePanel.getParams()) return false;
|
||||
// if (sensitivityPanel.getParams() == false) return false;
|
||||
int hi = interpolationDialogPanel.getSelection();
|
||||
if (hi >= 0) {
|
||||
@ -158,7 +158,7 @@ public class HydrophoneElementDialog extends PamDialog {
|
||||
constraints.gridwidth = 1;
|
||||
constraints.gridx = 0;
|
||||
constraints.gridy++;
|
||||
addComponent(this, recieverTypeLabel = new JLabel("", JLabel.RIGHT), constraints);
|
||||
addComponent(this, recieverTypeLabel = new JLabel("", SwingConstants.RIGHT), constraints);
|
||||
constraints.gridx++;
|
||||
constraints.gridwidth = 2;
|
||||
addComponent(this, type = new JTextField(12), constraints);
|
||||
@ -169,7 +169,7 @@ public class HydrophoneElementDialog extends PamDialog {
|
||||
constraints.gridx = 0;
|
||||
constraints.gridy++;
|
||||
constraints.anchor = GridBagConstraints.EAST;
|
||||
addComponent(this, recieverSensLabel = new JLabel("", JLabel.RIGHT), constraints);
|
||||
addComponent(this, recieverSensLabel = new JLabel("", SwingConstants.RIGHT), constraints);
|
||||
constraints.gridx++;
|
||||
constraints.anchor = GridBagConstraints.WEST;
|
||||
addComponent(this, hSens = new JTextField(5), constraints);
|
||||
@ -181,7 +181,7 @@ public class HydrophoneElementDialog extends PamDialog {
|
||||
constraints.gridx = 0;
|
||||
constraints.gridy++;
|
||||
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.anchor = GridBagConstraints.WEST;
|
||||
addComponent(this, preampGain = new JTextField(5), constraints);
|
||||
@ -380,7 +380,7 @@ public class HydrophoneElementDialog extends PamDialog {
|
||||
double zCoeff = PamController.getInstance().getGlobalMediumManager().getZCoeff();
|
||||
setRecieverLabelText();
|
||||
|
||||
if (newHydrophone == false) {
|
||||
if (!newHydrophone) {
|
||||
x.setText(formatDouble(hydrophone.getX()));
|
||||
y.setText(formatDouble(hydrophone.getY()));
|
||||
depth.setText(formatDouble(zCoeff*hydrophone.getZ()));
|
||||
|
@ -3,14 +3,12 @@ package Array;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import Array.streamerOrigin.StreamerDataIterator;
|
||||
import GPS.GpsData;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import pamMaths.PamQuaternion;
|
||||
import pamMaths.PamVector;
|
||||
|
||||
|
@ -3,7 +3,6 @@ package Array;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import PamController.PamController;
|
||||
import PamController.PamguardVersionInfo;
|
||||
|
||||
public class HydrophoneLocators {
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
package Array;
|
||||
|
||||
import pamScrollSystem.AbstractScrollManager;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.symbol.StandardSymbolManager;
|
||||
import PamguardMVC.PamConstants;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamProcess;
|
||||
import pamScrollSystem.AbstractScrollManager;
|
||||
|
||||
public class HydrophoneProcess extends PamProcess{
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package Array;
|
||||
|
||||
import generalDatabase.SQLLogging;
|
||||
import generalDatabase.SQLTypes;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import generalDatabase.SQLLogging;
|
||||
import generalDatabase.SQLTypes;
|
||||
|
||||
public class HydrophoneSQLLogging extends SQLLogging {
|
||||
|
||||
|
@ -7,6 +7,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
@ -30,12 +31,12 @@ public class InstrumentIdentityPanel {
|
||||
mainPanel.setBorder(new TitledBorder("Instrument information"));
|
||||
mainPanel.setLayout(new GridBagLayout());
|
||||
GridBagConstraints c = new PamGridBagContraints();
|
||||
mainPanel.add(new JLabel("Instrument Type ", JLabel.RIGHT), c);
|
||||
mainPanel.add(new JLabel("Instrument Type ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
mainPanel.add(instrumentType = new JTextField(20), c);
|
||||
c.gridx = 0;
|
||||
c.gridy++;
|
||||
mainPanel.add(new JLabel("Instrument Id ", JLabel.RIGHT), c);
|
||||
mainPanel.add(new JLabel("Instrument Id ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
mainPanel.add(instrumentId = new JTextField(20), c);
|
||||
|
||||
|
@ -2,23 +2,12 @@ package Array;
|
||||
|
||||
import java.io.Serializable;
|
||||
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.GpsDataUnit;
|
||||
import PamController.PamController;
|
||||
import PamController.PamSettingsSource;
|
||||
import PamController.SettingsObject;
|
||||
import PamController.masterReference.MasterReferencePoint;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
// }
|
||||
if (initComplete) switch (changeType) {
|
||||
case PamController.HYDROPHONE_ARRAY_CHANGED:
|
||||
case PamController.INITIALIZATION_COMPLETE:
|
||||
case PamControllerInterface.HYDROPHONE_ARRAY_CHANGED:
|
||||
case PamControllerInterface.INITIALIZATION_COMPLETE:
|
||||
setupLocators(ArrayManager.getArrayManager().getCurrentArray());
|
||||
}
|
||||
}
|
||||
@ -238,7 +227,7 @@ public class MasterLocator extends HydrophoneLocator implements Serializable, Cl
|
||||
boolean isStat = true;
|
||||
for (int i = 0; i < n; i++) {
|
||||
Streamer streamer = pamArray.getStreamer(i);
|
||||
if (streamer.getHydrophoneLocator().isStatic() == false) {
|
||||
if (!streamer.getHydrophoneLocator().isStatic()) {
|
||||
isStat = false;
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
package Array;
|
||||
|
||||
import GPS.GpsData;
|
||||
import GPS.GpsDataUnit;
|
||||
import PamUtils.LatLong;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
|
||||
abstract public class MovingHydrophoneLocator extends SimpleHydrophoneLocator {
|
||||
|
||||
/**
|
||||
|
@ -23,27 +23,21 @@ package Array;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import Acquisition.AcquisitionControl;
|
||||
import pamMaths.PamVector;
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import Array.streamerOrigin.OriginSettings;
|
||||
import Array.streamerOrigin.StreamerDataIterator;
|
||||
import GPS.GpsData;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamArrayUtils;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.PamSymbol;
|
||||
import PamguardMVC.ChannelIterator;
|
||||
import PamguardMVC.PamConstants;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import pamMaths.PamVector;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -1281,7 +1275,7 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
|
||||
return preceeding.getStreamerData();
|
||||
}
|
||||
// otherwise, we also want the next one ...
|
||||
if (streamerIterator.hasNext() == false) {
|
||||
if (!streamerIterator.hasNext()) {
|
||||
return preceeding.getStreamerData();
|
||||
}
|
||||
nextUnit = streamerIterator.next();
|
||||
@ -1293,7 +1287,7 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
|
||||
double w1 = nextUnit.getTimeMilliseconds()-timeMilliseconds;
|
||||
double w2 = timeMilliseconds-preceeding.getTimeMilliseconds();
|
||||
double wTot = w1+w2;
|
||||
if (wTot == 0 || Double.isFinite(wTot) == false) {
|
||||
if (wTot == 0 || !Double.isFinite(wTot)) {
|
||||
w1 = w2 = 0.5;
|
||||
}
|
||||
else {
|
||||
|
@ -73,7 +73,7 @@ public class Preamplifier implements Serializable, Cloneable, ManagedParameters
|
||||
return (Preamplifier) super.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException Ex) {
|
||||
Ex.printStackTrace();;
|
||||
Ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,6 @@ package Array;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.vecmath.Point3d;
|
||||
import javax.vecmath.Point3f;
|
||||
|
||||
import GPS.GpsData;
|
||||
|
||||
import pamMaths.PamVector;
|
||||
|
||||
/**
|
||||
|
@ -1,21 +1,13 @@
|
||||
package Array;
|
||||
|
||||
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.GpsDataUnit;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamUtils;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamObservable;
|
||||
|
||||
/**
|
||||
* Straight Hydrophone Locator, uses GPS heading information from
|
||||
|
@ -13,7 +13,7 @@ import Array.streamerOrigin.GPSOriginSettings;
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import Array.streamerOrigin.HydrophoneOriginMethods;
|
||||
import Array.streamerOrigin.OriginSettings;
|
||||
import PamController.PamController;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamController.masterReference.MasterReferencePoint;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
@ -560,7 +560,7 @@ public class Streamer implements Serializable, Cloneable, ManagedParameters {
|
||||
hydrophoneOrigin.prepare();
|
||||
}
|
||||
switch (changeType) {
|
||||
case PamController.INITIALIZATION_COMPLETE:
|
||||
case PamControllerInterface.INITIALIZATION_COMPLETE:
|
||||
// if (PamController.getInstance().getRunMode() == PamController.RUN_NORMAL) {
|
||||
// makeStreamerDataUnit();
|
||||
// }
|
||||
@ -886,7 +886,7 @@ public class Streamer implements Serializable, Cloneable, ManagedParameters {
|
||||
break;
|
||||
case HEIGHT:
|
||||
if (value != null) {
|
||||
setZ(value);;
|
||||
setZ(value);
|
||||
}
|
||||
break;
|
||||
case PITCH:
|
||||
|
@ -94,6 +94,7 @@ public class StreamerDataBlock extends PamDataBlock<StreamerDataUnit>{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean loadViewerData(OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) {
|
||||
return super.loadViewerData(offlineDataLoadInfo, loadObserver);
|
||||
}
|
||||
|
@ -2,9 +2,7 @@ package Array;
|
||||
|
||||
import Array.sensors.ArrayParameterType;
|
||||
import Array.sensors.ArraySensorFieldType;
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import Array.streamerOrigin.OriginSettings;
|
||||
import Array.streamerOrigin.StaticOriginMethod;
|
||||
import Array.streamerOrigin.StaticOriginSettings;
|
||||
import GPS.GpsData;
|
||||
import GPS.GpsDataUnit;
|
||||
|
@ -7,16 +7,15 @@ import java.awt.Insets;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSeparator;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
@ -123,7 +122,7 @@ public class StreamerDialog extends PamDialog {
|
||||
addComponent(p, new JLabel("Error"), c);
|
||||
c.gridx = 0;
|
||||
c.gridy ++;
|
||||
addComponent(p, new JLabel("x ", JLabel.RIGHT), c);
|
||||
addComponent(p, new JLabel("x ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
addComponent(p, x = new JTextField(textLength), c);
|
||||
c.gridx++;
|
||||
@ -133,7 +132,7 @@ public class StreamerDialog extends PamDialog {
|
||||
|
||||
c.gridx = 0;
|
||||
c.gridy ++;
|
||||
addComponent(p, new JLabel("y ", JLabel.RIGHT), c);
|
||||
addComponent(p, new JLabel("y ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
addComponent(p, y = new JTextField(textLength), c);
|
||||
c.gridx++;
|
||||
@ -143,7 +142,7 @@ public class StreamerDialog extends PamDialog {
|
||||
|
||||
c.gridx = 0;
|
||||
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++;
|
||||
addComponent(p, z = new JTextField(textLength), c);
|
||||
c.gridx++;
|
||||
@ -196,29 +195,29 @@ public class StreamerDialog extends PamDialog {
|
||||
String degsLab = LatLong.deg + " ";
|
||||
c.gridx = 0;
|
||||
c.gridy++;
|
||||
addComponent(headPanel, new JLabel("Heading ", JLabel.RIGHT), c);
|
||||
addComponent(headPanel, new JLabel("Heading ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, heading = new JTextField(orWidth), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, new JLabel(degsLab, JLabel.LEFT), c);
|
||||
addComponent(headPanel, new JLabel(degsLab, SwingConstants.LEFT), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, sensorComponents[ArraySensorFieldType.HEADING.ordinal()].getComponent(), c);
|
||||
c.gridx = 0;
|
||||
c.gridy++;
|
||||
addComponent(headPanel, new JLabel("Pitch ", JLabel.RIGHT), c);
|
||||
addComponent(headPanel, new JLabel("Pitch ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, pitch = new JTextField(orWidth), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, new JLabel(degsLab, JLabel.LEFT), c);
|
||||
addComponent(headPanel, new JLabel(degsLab, SwingConstants.LEFT), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, sensorComponents[ArraySensorFieldType.PITCH.ordinal()].getComponent(), c);
|
||||
c.gridx = 0;
|
||||
c.gridy++;
|
||||
addComponent(headPanel, new JLabel("Roll ", JLabel.RIGHT), c);
|
||||
addComponent(headPanel, new JLabel("Roll ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, roll = new JTextField(orWidth), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, new JLabel(degsLab, JLabel.LEFT), c);
|
||||
addComponent(headPanel, new JLabel(degsLab, SwingConstants.LEFT), c);
|
||||
c.gridx++;
|
||||
addComponent(headPanel, sensorComponents[ArraySensorFieldType.ROLL.ordinal()].getComponent(), c);
|
||||
|
||||
@ -240,7 +239,7 @@ public class StreamerDialog extends PamDialog {
|
||||
locPanel.setLayout(new BorderLayout());
|
||||
locPanel.setBorder(locateRecieverBorder = new TitledBorder("")); //set by steStreamerLabels
|
||||
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);
|
||||
getMainPanel().add(locPanel);
|
||||
getMainPanel().add(interpolationPanel.getComponent(getOwner()));
|
||||
@ -403,7 +402,7 @@ public class StreamerDialog extends PamDialog {
|
||||
}
|
||||
OriginDialogComponent mthDialogComponent = currentOriginMethod.getDialogComponent();
|
||||
if (mthDialogComponent != null) {
|
||||
if (mthDialogComponent.getParams() == false) {
|
||||
if (!mthDialogComponent.getParams()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -517,7 +516,7 @@ public class StreamerDialog extends PamDialog {
|
||||
}
|
||||
|
||||
public void newOriginMethod() {
|
||||
if (constructed == false) {
|
||||
if (!constructed) {
|
||||
return;
|
||||
}
|
||||
int methInd = originMethod.getSelectedIndex();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package Array;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.Types;
|
||||
|
||||
import Array.sensors.ArrayParameterType;
|
||||
@ -8,11 +7,6 @@ import Array.sensors.ArraySensorFieldType;
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import Array.streamerOrigin.HydrophoneOriginMethods;
|
||||
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 PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
@ -5,18 +5,16 @@ import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import GPS.GpsData;
|
||||
import GPS.GpsDataUnit;
|
||||
import PamUtils.Coordinate3d;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.GeneralProjector;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.GeneralProjector.ParameterUnits;
|
||||
import PamView.PamKeyItem;
|
||||
import PamView.PamSymbol;
|
||||
import PamView.PamSymbolType;
|
||||
import PamView.PanelOverlayDraw;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.GeneralProjector.ParameterUnits;
|
||||
import PamView.symbol.SymbolData;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
|
@ -1,15 +1,10 @@
|
||||
package Array;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ListIterator;
|
||||
import pamMaths.PamVector;
|
||||
import Array.sensors.StreamerSensorManager;
|
||||
|
||||
import Array.streamerOrigin.HydrophoneOriginMethod;
|
||||
import Array.streamerOrigin.OriginIterator;
|
||||
import GPS.GPSControl;
|
||||
import GPS.GPSDataBlock;
|
||||
import GPS.GpsData;
|
||||
import GPS.GpsDataUnit;
|
||||
import GPS.NavDataSynchronisation;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
@ -92,7 +87,7 @@ public class ThreadingHydrophoneLocator extends StraightHydrophoneLocator implem
|
||||
*/
|
||||
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
|
||||
* interpolate backwards.
|
||||
|
@ -7,13 +7,13 @@ import java.io.Serializable;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import mcc.MccJniInterface;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
import PamView.PamSidePanel;
|
||||
import PamView.dialog.warn.WarnOnce;
|
||||
import mcc.MccJniInterface;
|
||||
|
||||
public class ArrayAccelControl extends PamControlledUnit implements PamSettings {
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package ArrayAccelerometer;
|
||||
|
||||
import pamMaths.PamVector;
|
||||
import Array.sensors.ArraySensorDataUnit;
|
||||
import Array.sensors.ArraySensorFieldType;
|
||||
import PamUtils.PamUtils;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import pamMaths.PamVector;
|
||||
|
||||
public class ArrayAccelDataUnit extends PamDataUnit implements ArraySensorDataUnit {
|
||||
|
||||
|
@ -9,18 +9,18 @@ import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import PamView.dialog.PamDialog;
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
import mcc.MccJniInterface;
|
||||
import mcc.MccPanel;
|
||||
import mcc.mccjna.MCCException;
|
||||
import mcc.mccjna.MCCUtils;
|
||||
import PamView.dialog.PamDialog;
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
|
||||
public class ArrayAccelDialog extends PamDialog {
|
||||
|
||||
@ -52,17 +52,17 @@ public class ArrayAccelDialog extends PamDialog {
|
||||
JPanel rPanel = new JPanel(new GridBagLayout());
|
||||
rPanel.setBorder(new TitledBorder("Readout"));
|
||||
GridBagConstraints c = new PamGridBagContraints();
|
||||
rPanel.add(new JLabel("Read interval ", JLabel.RIGHT), c);
|
||||
rPanel.add(new JLabel("Read interval ", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
rPanel.add(readInterval = new JTextField(5), c);
|
||||
readInterval.setToolTipText("Readout interval in seconds");
|
||||
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++) {
|
||||
c.gridx = 0;
|
||||
c.gridy++;
|
||||
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.fill = GridBagConstraints.NONE;
|
||||
rPanel.add(dimChannel[i] = new JTextField(3), c);
|
||||
@ -75,23 +75,23 @@ public class ArrayAccelDialog extends PamDialog {
|
||||
calPanel.setBorder(new TitledBorder("Calibration"));
|
||||
c = new PamGridBagContraints();
|
||||
c.gridx = 1;
|
||||
calPanel.add(new JLabel("Zero", JLabel.CENTER), c);
|
||||
calPanel.add(new JLabel("Zero", SwingConstants.CENTER), c);
|
||||
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++) {
|
||||
c.gridy ++;
|
||||
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++;
|
||||
calPanel.add(zeroVolts[i] = new JTextField(5), c);
|
||||
zeroVolts[i].setToolTipText(String.format("Offset voltage for %s coordinate", ArrayAccelParams.DIMENSIONNAME[i]));
|
||||
c.gridx++;
|
||||
calPanel.add(new JLabel(" V, ", JLabel.LEFT), c);
|
||||
calPanel.add(new JLabel(" V, ", SwingConstants.LEFT), c);
|
||||
c.gridx++;
|
||||
calPanel.add(voltsPerG[i] = new JTextField(5), c);
|
||||
voltsPerG[i].setToolTipText(String.format("Voltage scale for %s coordinate", ArrayAccelParams.DIMENSIONNAME[i]));
|
||||
c.gridx++;
|
||||
calPanel.add(new JLabel(" V/g ", JLabel.LEFT), c);
|
||||
calPanel.add(new JLabel(" V/g ", SwingConstants.LEFT), c);
|
||||
}
|
||||
c.gridx = 0;
|
||||
c.gridwidth = 3;
|
||||
@ -103,23 +103,23 @@ public class ArrayAccelDialog extends PamDialog {
|
||||
c.gridy++;
|
||||
c.gridx = 0;
|
||||
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.gridwidth = 1;
|
||||
calPanel.add(rollOffset = new JTextField(5), c);
|
||||
rollOffset.setToolTipText("This value gets ADDED to the measured roll");
|
||||
c.gridx++;
|
||||
calPanel.add(new JLabel(" deg.", JLabel.LEFT), c);
|
||||
calPanel.add(new JLabel(" deg.", SwingConstants.LEFT), c);
|
||||
c.gridy++;
|
||||
c.gridx = 0;
|
||||
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.gridwidth = 1;
|
||||
calPanel.add(pitchOffset = new JTextField(5), c);
|
||||
pitchOffset.setToolTipText("This value gets ADDED to the measured pitch");
|
||||
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.
|
||||
*/
|
||||
public void findZero() {
|
||||
if (getParams() == false) {
|
||||
if (!getParams()) {
|
||||
return;
|
||||
}
|
||||
// read the voltages from the three channels and set as
|
||||
|
@ -15,12 +15,10 @@ import PamUtils.LatLong;
|
||||
import PamView.PamColors;
|
||||
import PamView.PamColors.PamColor;
|
||||
import PamView.panel.PamBorder;
|
||||
import PamView.panel.PamBorderPanel;
|
||||
import PamView.panel.PamPanel;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamObservable;
|
||||
import PamguardMVC.PamObserver;
|
||||
import PamguardMVC.PamObserverAdapter;
|
||||
|
||||
/*
|
||||
@ -36,7 +34,7 @@ public class ArrayAccelPanel {
|
||||
private long zeroGraphTime;
|
||||
private ArrayAccelDataBlock accelDataBlock;
|
||||
private int panelDurationSecs = 300;
|
||||
private double timeScale = 1;;
|
||||
private double timeScale = 1;
|
||||
|
||||
|
||||
public ArrayAccelPanel(ArrayAccelControl accelControl) {
|
||||
|
@ -1,12 +1,10 @@
|
||||
package ArrayAccelerometer;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import mcc.MccJniInterface;
|
||||
import mcc.mccjna.MCCConstants;
|
||||
|
||||
public class ArrayAccelParams implements Serializable, Cloneable, ManagedParameters {
|
||||
|
@ -5,17 +5,12 @@ import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.Timer;
|
||||
|
||||
import PamController.PamController;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.PamProcess;
|
||||
import mcc.MccJniInterface;
|
||||
import mcc.mccjna.MCCException;
|
||||
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 {
|
||||
|
@ -1,11 +1,8 @@
|
||||
package ArrayAccelerometer;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import PamView.PamColors.PamColor;
|
||||
import PamView.panel.PamPanel;
|
||||
import PamView.PamSidePanel;
|
||||
|
||||
public class ArrayAccelSidePanel implements PamSidePanel {
|
||||
|
@ -2,8 +2,6 @@ package Azigram;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import Acquisition.AcquisitionProcess;
|
||||
import PamUtils.PamUtils;
|
||||
import PamUtils.complex.ComplexArray;
|
||||
import fftManager.FFTDataUnit;
|
||||
|
||||
|
@ -8,8 +8,6 @@ import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamView.GroupedSourceParameters;
|
||||
import PamguardMVC.PamConstants;
|
||||
import whistlesAndMoans.WhistleToneParameters;
|
||||
|
||||
public class AzigramParameters implements Serializable, ManagedParameters, Cloneable {
|
||||
|
||||
|
@ -8,19 +8,14 @@ import java.io.Serializable;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import Filters.layoutFX.FilterGUIFX;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitGUI;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamController.PamGUIManager;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
import fftManager.layoutFX.FFTGuiFX;
|
||||
|
||||
/**
|
||||
* Filters raw data using a specified filter.
|
||||
@ -71,6 +66,7 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
FilterParameters_2 newParams = FilterDataSourceDialog.showDialog(filterParams, parentFrame, filterProcess.outputData);
|
||||
@ -90,6 +86,7 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
|
||||
super();
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
FilterParams newParams = FilterDialog.showDialog(parentFrame,
|
||||
@ -109,7 +106,7 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
|
||||
public void notifyModelChanged(int changeType) {
|
||||
//System.out.println("FFTControl: notifyModelChanged : " +changeType);
|
||||
super.notifyModelChanged(changeType);
|
||||
if (changeType == PamController.INITIALIZATION_COMPLETE) {
|
||||
if (changeType == PamControllerInterface.INITIALIZATION_COMPLETE) {
|
||||
filterProcess.setupProcess();
|
||||
}
|
||||
if (filterGUIFX!=null) {
|
||||
@ -117,14 +114,17 @@ public class FilterControl extends PamControlledUnit implements PamSettings {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return filterParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return FilterParams.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
filterParams = ((FilterParameters_2) pamControlledUnitSettings.getSettings()).clone();
|
||||
return true;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package Filters;
|
||||
|
||||
import java.awt.Frame;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
package Filters;
|
||||
|
||||
import java.awt.Window;
|
||||
|
||||
import PamView.dialog.PamDialog;
|
||||
|
||||
public class FilterDialog extends PamDialog {
|
||||
|
@ -37,10 +37,14 @@ import javax.swing.JRadioButton;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
|
||||
import com.opencsv.CSVReader;
|
||||
import com.opencsv.exceptions.CsvException;
|
||||
|
||||
import Layout.PamAxis;
|
||||
import PamUtils.PamFileChooser;
|
||||
import PamUtils.PamFileFilter;
|
||||
@ -49,9 +53,6 @@ import PamView.PamColors.PamColor;
|
||||
import PamView.dialog.PamDialog;
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
import PamView.panel.PamPanel;
|
||||
import com.opencsv.CSVReader;
|
||||
import com.opencsv.exceptions.CsvException;
|
||||
|
||||
import fftManager.Complex;
|
||||
|
||||
/**
|
||||
@ -188,8 +189,9 @@ public class FilterDialogPanel implements ActionListener {
|
||||
repaintAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (isSetup == false) {
|
||||
if (!isSetup) {
|
||||
return;
|
||||
}
|
||||
if (e.getSource() == filterTypes) {
|
||||
@ -235,7 +237,7 @@ public class FilterDialogPanel implements ActionListener {
|
||||
break;
|
||||
}
|
||||
boolean isArb = filterType == 4;
|
||||
normalPanel.setVisible(isArb == false);
|
||||
normalPanel.setVisible(!isArb);
|
||||
arbPanel.setVisible(isArb);
|
||||
}
|
||||
|
||||
@ -321,14 +323,14 @@ public class FilterDialogPanel implements ActionListener {
|
||||
c.gridwidth = 1;
|
||||
c.gridy++;
|
||||
c.gridx = xc;
|
||||
normalPanel.add(new JLabel(" High Pass", JLabel.RIGHT), c);
|
||||
normalPanel.add(new JLabel(" High Pass", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
normalPanel.add(highCut, c);
|
||||
c.gridx++;
|
||||
normalPanel.add(new JLabel(" Hz"), c);
|
||||
c.gridy++;
|
||||
c.gridx = xc;
|
||||
normalPanel.add(new JLabel(" Low Pass", JLabel.RIGHT), c);
|
||||
normalPanel.add(new JLabel(" Low Pass", SwingConstants.RIGHT), c);
|
||||
c.gridx++;
|
||||
normalPanel.add(lowCut, c);
|
||||
c.gridx++;
|
||||
@ -702,10 +704,10 @@ public class FilterDialogPanel implements ActionListener {
|
||||
if (filterMethod == null) {
|
||||
return;
|
||||
}
|
||||
if (IIRFilterMethod.class.isAssignableFrom(filterMethod.getClass()) == true) {
|
||||
if (IIRFilterMethod.class.isAssignableFrom(filterMethod.getClass())) {
|
||||
paintPoleZeros(g);
|
||||
}
|
||||
else if (FIRFilterMethod.class.isAssignableFrom(filterMethod.getClass()) == true) {
|
||||
else if (FIRFilterMethod.class.isAssignableFrom(filterMethod.getClass())) {
|
||||
paintImpulseResponse(g);
|
||||
}
|
||||
}
|
||||
|
@ -20,8 +20,6 @@
|
||||
*/
|
||||
package Filters;
|
||||
|
||||
import fftManager.Complex;
|
||||
|
||||
/**
|
||||
* @author Doug Gillespie
|
||||
* <p>
|
||||
|
@ -2,9 +2,6 @@ package Filters;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
@ -22,12 +22,7 @@ package Filters;
|
||||
|
||||
import java.io.File;
|
||||
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.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
@ -28,7 +28,7 @@ public class FilterSpeed {
|
||||
data[i] = r.nextGaussian();
|
||||
}
|
||||
testData = data.clone();
|
||||
long sn, en, mn = 0;;
|
||||
long sn, en, mn = 0;
|
||||
double a;
|
||||
long startTime = System.currentTimeMillis();
|
||||
for (int i = 0; i < nTrials; i++) {
|
||||
|
@ -229,6 +229,7 @@ public abstract class IIRFilterMethod extends FilterMethod {
|
||||
* Get coefficients from poles and zeros for fast filter computations.
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public double[] getFastFilterCoefficients() {
|
||||
Complex[] poles = getPoles(filterParams);
|
||||
Complex[] zeros = getZeros(filterParams);
|
||||
|
@ -195,6 +195,7 @@ public class IirfFilter implements Filter {
|
||||
/* (non-Javadoc)
|
||||
* @see Filters.Filter#runFilter(double[])
|
||||
*/
|
||||
@Override
|
||||
synchronized public void runFilter(double[] inputData) {
|
||||
int f;
|
||||
for (int i = 0; i < inputData.length; i++) {
|
||||
@ -208,6 +209,7 @@ public class IirfFilter implements Filter {
|
||||
/* (non-Javadoc)
|
||||
* @see Filters.Filter#runFilter(double[], double[])
|
||||
*/
|
||||
@Override
|
||||
synchronized public void runFilter(double[] inputData, double[] outputData) {
|
||||
int f;
|
||||
if (outputData == null || outputData.length != inputData.length) {
|
||||
@ -225,6 +227,7 @@ public class IirfFilter implements Filter {
|
||||
/* (non-Javadoc)
|
||||
* @see Filters.Filter#runFilter(double)
|
||||
*/
|
||||
@Override
|
||||
synchronized public double runFilter(double aData) {
|
||||
double newData = aData;
|
||||
for (int f = 0; f < nFilterUnits; f++) {
|
||||
|
@ -52,14 +52,14 @@ public class FormatGpsData {
|
||||
Date dateO;
|
||||
|
||||
FormatGpsData() {
|
||||
};
|
||||
}
|
||||
|
||||
FormatGpsData(StringBuffer nmeaString) {
|
||||
/*
|
||||
* Unpack the string buffer to populate the above datas
|
||||
*/
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public static String formatTime(int intTime) {
|
||||
SimpleDateFormat gpsTimeFormat = new SimpleDateFormat("HHmmss");
|
||||
|
@ -9,11 +9,6 @@ import java.util.ListIterator;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import warnings.PamWarning;
|
||||
import warnings.WarningSystem;
|
||||
import NMEA.NMEADataBlock;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
@ -21,9 +16,10 @@ import PamController.PamController;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
import PamController.positionreference.PositionReference;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.dialog.warn.WarnOnce;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import warnings.PamWarning;
|
||||
import warnings.WarningSystem;
|
||||
|
||||
public class GPSControl extends PamControlledUnit implements PamSettings, PositionReference {
|
||||
|
||||
@ -144,7 +140,9 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
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();
|
||||
|
||||
@ -168,6 +166,7 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
GPSParameters newP = GPSParametersDialog.showDialog(parentFrame, gpsParameters);
|
||||
if (newP != null) {
|
||||
@ -184,6 +183,7 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
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>" +
|
||||
@ -195,13 +195,16 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Serializable getSettingsReference() {
|
||||
return gpsParameters;
|
||||
}
|
||||
@Override
|
||||
public long getSettingsVersion() {
|
||||
return GPSParameters.serialVersionUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
|
||||
if (pamControlledUnitSettings.getUnitType().equals(this.getUnitType())
|
||||
@ -260,7 +263,7 @@ public class GPSControl extends PamControlledUnit implements PamSettings, Positi
|
||||
* @return interpolated gps position.
|
||||
*/
|
||||
public GpsDataUnit getShipPosition(long timeMilliseconds, boolean interpolate) {
|
||||
if (interpolate == false) {
|
||||
if (!interpolate) {
|
||||
return getGpsDataBlock().getClosestUnitMillis(timeMilliseconds);
|
||||
}
|
||||
// otherwise try to fine a point either side and weighted mean them or extrapolate.
|
||||
|
@ -3,12 +3,12 @@ package GPS;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import GPS.effort.GpsEffortProvider;
|
||||
import nmeaEmulator.EmulatedData;
|
||||
import nmeaEmulator.NMEAEmulator;
|
||||
import pamScrollSystem.ViewLoadObserver;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamProcess;
|
||||
import PamguardMVC.dataOffline.OfflineDataLoadInfo;
|
||||
import nmeaEmulator.EmulatedData;
|
||||
import nmeaEmulator.NMEAEmulator;
|
||||
import pamScrollSystem.ViewLoadObserver;
|
||||
|
||||
/**
|
||||
* Add a bit of extra functionality to GPSDataBlock so
|
||||
@ -44,7 +44,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
|
||||
@Override
|
||||
public void addPamData(GpsDataUnit gpsDataUnit) {
|
||||
boolean r = isReasonable(gpsDataUnit);
|
||||
if (r == false) {
|
||||
if (!r) {
|
||||
gpsDataUnit.getGpsData().setDataOk(false);
|
||||
}
|
||||
else {
|
||||
@ -68,7 +68,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
|
||||
GpsData thisData, thatData;
|
||||
thisData = gpsDataUnit.getGpsData();
|
||||
|
||||
if (thisData.isDataOk() == false) {
|
||||
if (!thisData.isDataOk()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
|
||||
return true;
|
||||
}
|
||||
// ignore gps points flagged as bad.
|
||||
if (thatData.isDataOk() == false) {
|
||||
if (!thatData.isDataOk()) {
|
||||
continue;
|
||||
}
|
||||
// OK if it's gone too far back in time
|
||||
@ -118,7 +118,7 @@ public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmula
|
||||
readyGGAData = null;
|
||||
return dd;
|
||||
}
|
||||
if (emulatorIterator.hasNext() == false) {
|
||||
if (!emulatorIterator.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
GpsDataUnit gpsUnit = emulatorIterator.next();
|
||||
|
@ -2,7 +2,6 @@ package GPS;
|
||||
|
||||
import java.util.ListIterator;
|
||||
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.dataOffline.OfflineDataLoadInfo;
|
||||
|
||||
/**
|
||||
|
@ -7,22 +7,19 @@ import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
|
||||
import Map.MapProjector;
|
||||
import Map.MapRectProjector;
|
||||
import Map.Vessel;
|
||||
import PamUtils.Coordinate3d;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamView.GeneralProjector;
|
||||
import PamView.ManagedSymbol;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.GeneralProjector.ParameterUnits;
|
||||
import PamView.ManagedSymbolInfo;
|
||||
import PamView.PamKeyItem;
|
||||
import PamView.PamSymbol;
|
||||
import PamView.PamOldSymbolManager;
|
||||
import PamView.PamSymbolType;
|
||||
import PamView.PanelOverlayDraw;
|
||||
import PamView.SymbolKeyItem;
|
||||
import PamView.GeneralProjector.ParameterType;
|
||||
import PamView.GeneralProjector.ParameterUnits;
|
||||
import PamView.symbol.SymbolData;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
@ -69,7 +66,7 @@ public class GPSOverlayGraphics extends PanelOverlayDraw {
|
||||
Coordinate3d coord = generalProjector.getCoord3d( gpsData.getLatitude(), gpsData.getLongitude(),gpsData.getHeight());
|
||||
Point p = coord.getXYPoint();
|
||||
if (lastDrawnDataUnit != null && Math.abs(lastDrawnDataUnit.getAbsBlockIndex()-gpsDataUnit.getAbsBlockIndex()) == 1) {
|
||||
if (p.equals(lastCoord) == false) {
|
||||
if (!p.equals(lastCoord)) {
|
||||
g.setColor(s.getLineColor());
|
||||
g.drawLine(p.x, p.y, lastCoord.x, lastCoord.y);
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import java.awt.BorderLayout;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
@ -18,11 +17,9 @@ import javax.swing.JRadioButton;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.border.EtchedBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import NMEA.NMEADataUnit;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamController;
|
||||
import PamView.dialog.PamDialog;
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
@ -104,7 +101,7 @@ public class GPSParametersDialog extends PamDialog {
|
||||
// setModal(true);
|
||||
}
|
||||
private void dimensionsChanged() {
|
||||
if (gpsParametersDialog.getParams() == true) {
|
||||
if (gpsParametersDialog.getParams()) {
|
||||
// shipDrawing.setDimensions(gpsParameters.dimA, gpsParameters.dimB,
|
||||
// gpsParameters.dimC, gpsParameters.dimD);
|
||||
}
|
||||
@ -198,9 +195,9 @@ public class GPSParametersDialog extends PamDialog {
|
||||
gpsParameters.dimB = dims[1];
|
||||
gpsParameters.dimC = dims[2];
|
||||
gpsParameters.dimD = dims[3];
|
||||
if (predictPanel.getParams() == false) return false;
|
||||
if (readOptions.getParams() == false) return false;
|
||||
if (smoothingOptions.getParams() == false) return false;
|
||||
if (!predictPanel.getParams()) return false;
|
||||
if (!readOptions.getParams()) return false;
|
||||
if (!smoothingOptions.getParams()) return false;
|
||||
|
||||
return headingPanel.getParams(gpsParameters);
|
||||
}
|
||||
@ -408,6 +405,7 @@ public class GPSParametersDialog extends PamDialog {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
enableControls();
|
||||
}
|
||||
|
@ -20,8 +20,6 @@
|
||||
*/
|
||||
package GPS;
|
||||
|
||||
import geoMag.MagneticVariation;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
@ -29,8 +27,6 @@ import java.util.TimeZone;
|
||||
|
||||
import Array.sensors.ArraySensorDataUnit;
|
||||
import Array.sensors.ArraySensorFieldType;
|
||||
import pamMaths.PamQuaternion;
|
||||
import pamMaths.PamVector;
|
||||
import NMEA.AcquireNmeaData;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
@ -38,6 +34,9 @@ import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamUtils.PamUtils;
|
||||
import geoMag.MagneticVariation;
|
||||
import pamMaths.PamQuaternion;
|
||||
import pamMaths.PamVector;
|
||||
|
||||
/**
|
||||
* Note on times for GPS data ...
|
||||
@ -176,7 +175,7 @@ public class GpsData extends LatLong implements Cloneable, ManagedParameters, Ar
|
||||
|
||||
// sortDistanceFromLast();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor to create a GPSData object from a lat long.
|
||||
@ -276,9 +275,9 @@ public class GpsData extends LatLong implements Cloneable, ManagedParameters, Ar
|
||||
break;
|
||||
}
|
||||
|
||||
if (dataOk == false) return;
|
||||
if (!dataOk) return;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
protected void sortDistanceFromLast() {
|
||||
|
||||
@ -471,7 +470,7 @@ public class GpsData extends LatLong implements Cloneable, ManagedParameters, Ar
|
||||
foundPoint = true;
|
||||
continue;
|
||||
}
|
||||
if (foundPoint == false) {
|
||||
if (!foundPoint) {
|
||||
newDigit = (nmeaSentence[i] - 48);
|
||||
number = (number * 10 + newDigit);
|
||||
}
|
||||
|
@ -30,15 +30,6 @@
|
||||
|
||||
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.SQLException;
|
||||
import java.sql.Statement;
|
||||
@ -46,16 +37,16 @@ import java.sql.Types;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import PamController.PamViewParameters;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
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 {
|
||||
|
||||
@ -117,7 +108,7 @@ public class GpsLogger extends SQLLogging {
|
||||
|
||||
@Override
|
||||
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.
|
||||
}
|
||||
// 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 hasUTC = dbProcess.columnNull(tableDefinition.getTableName(), tableDefinition.getTimeStampItem()) != 2;
|
||||
// boolean hasLoctime = dbProcess.columnExists(tableDefinition, tableDefinition.getLocalTimeItem());
|
||||
if (hasIndex && hasPCTime && hasUTC == false) {
|
||||
if (hasIndex && hasPCTime && !hasUTC) {
|
||||
// seems to be a logger table
|
||||
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" +
|
||||
@ -297,7 +288,7 @@ public class GpsLogger extends SQLLogging {
|
||||
int gpsIntTimeVal = gpsTime.getIntegerValue();
|
||||
PamTableDefinition pamTableDef = (PamTableDefinition) getTableDefinition();
|
||||
Object ts = pamTableDef.getTimeStampItem().getValue();
|
||||
long gpsDate = sqlTypes.millisFromTimeStamp(ts);
|
||||
long gpsDate = SQLTypes.millisFromTimeStamp(ts);
|
||||
if (gpsDate%1000 == 0) {
|
||||
// some databases may have stored the milliseconds, in which
|
||||
// case this next bit is redundant.
|
||||
@ -318,9 +309,9 @@ public class GpsLogger extends SQLLogging {
|
||||
if (nmeaProcess != null) {
|
||||
// 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.
|
||||
if (nmeaProcess.wantDataUnit(gpsDataUnit) == false) {
|
||||
if (!nmeaProcess.wantDataUnit(gpsDataUnit)) {
|
||||
return null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
String fixTypeStr = fixType.getDeblankedStringValue();
|
||||
|
@ -76,7 +76,8 @@ public class ImportGPSData {
|
||||
*/
|
||||
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.setIntermediate(true);
|
||||
PamController.getInstance().enableGUIControl(false);
|
||||
@ -137,7 +138,9 @@ public class ImportGPSData {
|
||||
Collection<String> nmeaStrings=importFileStrings( file.getAbsolutePath());
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
@ -375,7 +378,7 @@ public class ImportGPSData {
|
||||
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.
|
||||
gpsData.getGpsCalendar().set(Calendar.YEAR, gpsControl.gpsImportParams.year);
|
||||
gpsData.getGpsCalendar().set(Calendar.MONTH, gpsControl.gpsImportParams.month);
|
||||
@ -397,7 +400,7 @@ public class ImportGPSData {
|
||||
}
|
||||
|
||||
// System.out.println("nmea string: "+nmeaString);
|
||||
gpsData=new GpsData(nmeaString, gpsControl.gpsParameters.READ_RMC);
|
||||
gpsData=new GpsData(nmeaString, GPSParameters.READ_RMC);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -452,7 +455,7 @@ public class ImportGPSData {
|
||||
|
||||
gpsDataBlock.saveViewerData();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public void saveGPSData(GpsData gpsData){
|
||||
//System.out.println("GPSData to save: " +gpsData + "gpsDataBlock: "+gpsDataBlock);
|
||||
@ -508,7 +511,7 @@ public class ImportGPSData {
|
||||
|
||||
private void loadKMLFile(File file , ImportGPSThread importGPSThread){
|
||||
// TODO Auto-generated method stub
|
||||
};
|
||||
}
|
||||
|
||||
private void loadGPXFile(File file2, ImportGPSThread importGPSThread) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -63,7 +63,7 @@ public class ImportGPSDialog extends PamDialog{
|
||||
importGPS.add(BorderLayout.CENTER, p);
|
||||
setDialogComponent(importGPS);
|
||||
|
||||
setLocation(location);;
|
||||
setLocation(location);
|
||||
|
||||
|
||||
|
||||
@ -115,6 +115,7 @@ public class ImportGPSDialog extends PamDialog{
|
||||
class BrowseButtonAction implements ActionListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
File lastFile;
|
||||
|
@ -3,6 +3,7 @@ package GPS;
|
||||
import NMEA.NMEADataBlock;
|
||||
import NMEA.NMEADataUnit;
|
||||
import PamController.PamController;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamObservable;
|
||||
import PamguardMVC.PamProcess;
|
||||
@ -50,7 +51,7 @@ where:
|
||||
|
||||
@Override
|
||||
public void newData(PamObservable o, PamDataUnit arg) {
|
||||
if (gpsControl.gpsParameters.readHeading == false) {
|
||||
if (!gpsControl.gpsParameters.readHeading) {
|
||||
return;
|
||||
}
|
||||
NMEADataUnit nmeaData = (NMEADataUnit) arg;
|
||||
@ -121,7 +122,7 @@ where:
|
||||
}
|
||||
|
||||
private void findDataSource() {
|
||||
if (gpsControl.isGpsMaster() == false) {
|
||||
if (!gpsControl.isGpsMaster()) {
|
||||
return;
|
||||
}
|
||||
NMEADataBlock newSource = (NMEADataBlock) PamController.getInstance().
|
||||
@ -134,9 +135,9 @@ where:
|
||||
@Override
|
||||
public void notifyModelChanged(int changeType) {
|
||||
switch (changeType) {
|
||||
case PamController.ADD_CONTROLLEDUNIT:
|
||||
case PamController.REMOVE_CONTROLLEDUNIT:
|
||||
case PamController.INITIALIZATION_COMPLETE:
|
||||
case PamControllerInterface.ADD_CONTROLLEDUNIT:
|
||||
case PamControllerInterface.REMOVE_CONTROLLEDUNIT:
|
||||
case PamControllerInterface.INITIALIZATION_COMPLETE:
|
||||
noteNewSettings();
|
||||
}
|
||||
}
|
||||
|
@ -20,15 +20,11 @@
|
||||
*/
|
||||
package GPS;
|
||||
|
||||
import warnings.PamWarning;
|
||||
import warnings.WarningSystem;
|
||||
import geoMag.MagneticVariation;
|
||||
import NMEA.NMEADataBlock;
|
||||
import NMEA.NMEADataUnit;
|
||||
import PamController.PamController;
|
||||
import PamController.masterReference.MasterReferencePoint;
|
||||
import PamController.PamControllerInterface;
|
||||
import PamController.status.BaseProcessCheck;
|
||||
import PamController.status.ProcessCheck;
|
||||
import PamModel.PamModel;
|
||||
import PamModel.SMRUEnable;
|
||||
import PamUtils.PamCalendar;
|
||||
@ -38,7 +34,9 @@ import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamObservable;
|
||||
import PamguardMVC.PamProcess;
|
||||
import autecPhones.AutecGraphics;
|
||||
import geoMag.MagneticVariation;
|
||||
import warnings.PamWarning;
|
||||
import warnings.WarningSystem;
|
||||
|
||||
/**
|
||||
* @author Doug Gillespie
|
||||
@ -90,7 +88,7 @@ public class ProcessNmeaData extends PamProcess {
|
||||
findNMEADataBlock();
|
||||
|
||||
addOutputDataBlock((gpsDataBlock = new GPSDataBlock(this)));
|
||||
if (gpsControl.isGpsMaster() == false) {
|
||||
if (!gpsControl.isGpsMaster()) {
|
||||
gpsDataBlock.setOverlayDraw(new GPSOverlayGraphics(gpsControl));
|
||||
gpsDataBlock.setPamSymbolManager(new StandardSymbolManager(gpsDataBlock, GPSOverlayGraphics.defSymbol, false));
|
||||
}
|
||||
@ -123,7 +121,7 @@ public class ProcessNmeaData extends PamProcess {
|
||||
boolean findNMEADataBlock() {
|
||||
|
||||
PamDataBlock newDataBlock = null;
|
||||
if (gpsController.isGpsMaster() == false) {
|
||||
if (!gpsController.isGpsMaster()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -151,9 +149,9 @@ public class ProcessNmeaData extends PamProcess {
|
||||
@Override
|
||||
public void notifyModelChanged(int changeType) {
|
||||
switch (changeType) {
|
||||
case PamController.ADD_CONTROLLEDUNIT:
|
||||
case PamController.REMOVE_CONTROLLEDUNIT:
|
||||
case PamController.INITIALIZATION_COMPLETE:
|
||||
case PamControllerInterface.ADD_CONTROLLEDUNIT:
|
||||
case PamControllerInterface.REMOVE_CONTROLLEDUNIT:
|
||||
case PamControllerInterface.INITIALIZATION_COMPLETE:
|
||||
noteNewSettings();
|
||||
}
|
||||
}
|
||||
@ -193,7 +191,7 @@ public class ProcessNmeaData extends PamProcess {
|
||||
}
|
||||
|
||||
// newUnit.data = gpsData;
|
||||
if (wantDataUnit(newUnit) == false) {
|
||||
if (!wantDataUnit(newUnit)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import java.awt.event.ActionListener;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
import PamView.dialog.PamDialog;
|
||||
@ -32,7 +33,7 @@ public class ShipDimensionsFields extends JPanel implements ActionListener{
|
||||
for (int i = 0; i < dimNames.length; i++) {
|
||||
gbs.gridy = i;
|
||||
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;
|
||||
PamDialog.addComponent(this, shipDims[i] = new JTextField(4), gbs);
|
||||
gbs.gridx = 2;
|
||||
@ -62,6 +63,7 @@ public class ShipDimensionsFields extends JPanel implements ActionListener{
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
// dimensionsChanged();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user