Added a couple of comments to help SDSU folk get off the ground
This commit is contained in:
Douglas Gillespie 2023-01-27 15:13:30 +00:00
parent 1c11e3da15
commit 5b649edc19
3 changed files with 34 additions and 14 deletions

View File

@ -59,19 +59,6 @@ public class TethysControl extends PamControlledUnit {
public TethysExportParams getTethysExportParams() {
return tethysExportParams;
}
/**
* Get a nilus deployment document, as full populated as possible.
* @return
*/
public Deployment getDeployment() {
Deployment deployment = new Deployment();
Deployment.Instrument instrument = new Instrument();
// instrument.
// deployment.
return null;
}
/**
* We'll probably want to

View File

@ -5,6 +5,11 @@ import java.util.HashMap;
import PamguardMVC.PamDataBlock;
/**
* Parameters for controlling export of Tethys data.
* @author dg50
*
*/
public class TethysExportParams implements Serializable, Cloneable{
public static final long serialVersionUID = 1L;

View File

@ -16,6 +16,7 @@ import PamController.settings.output.xml.PamguardXMLWriter;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import PamguardMVC.dataSelector.DataSelector;
import generalDatabase.DBSchemaWriter;
import generalDatabase.SQLLogging;
import metadata.MetaDataContol;
@ -234,10 +235,37 @@ public class TethysExporter {
// do it with a data copy which can avoid synchronising the entire block for what may be a long time
// the copy function is itself synched, and is quite fast, so easier and safe this way
ArrayList<PamDataUnit> dataCopy = aDataBlock.getDataCopy();
DataSelector dataSelector = aDataBlock.getDataSelector(tethysControl.getDataSelectName(), false);
int nSkipped = 0;
int nExport = 0;
for (PamDataUnit aData : dataCopy) {
// then we do whatever we need to do to convert this into
/*
* see if we want this data unit. PAMGuard has a complicated system of data selectors specific to
* each data type. These are centrally managed so you don't need to worry too much about them. They
* are identified by name for each data stream and the behaviour here should follow the selections you
* made in the dialog.
* the data selection system allows different displays to show different data, so a stream can have many differently
* named selectors active at any one time, all doing different things in different parts of PAMGuard.
*/
if (dataSelector != null) {
if (dataSelector.scoreData(aData) <= 0) {
nSkipped++;
continue; // don't want this one.
}
}
/*
* then we do whatever we need to do to convert this into something for Tethys
* this might happen in the tethysSchema object for each data stream ????
*/
nExport ++;
}
System.out.printf("Exported %d data units and skipped %d in %s", nExport, nSkipped, aDataBlock.getLongDataName());
}