mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 08:32:32 +00:00
Work on bug fixes in CTD classifier
This commit is contained in:
parent
5983f30ded
commit
fccc0a715d
Binary file not shown.
@ -228,10 +228,11 @@ public class SimpleCTClassifierPane extends SettingsPane<Chi2ThresholdParams> {
|
|||||||
if (simpleChi2Classifier!=null && simpleChi2Classifier.getDataSelector()!=null) {
|
if (simpleChi2Classifier!=null && simpleChi2Classifier.getDataSelector()!=null) {
|
||||||
simpleChi2Classifier.getDataSelector().getDialogPaneFX().getParams(true);
|
simpleChi2Classifier.getDataSelector().getDialogPaneFX().getParams(true);
|
||||||
}
|
}
|
||||||
|
if (this.currParams != null) {
|
||||||
|
currParams.uniqueID = this.currParams.uniqueID;
|
||||||
|
}
|
||||||
|
|
||||||
currParams.uniqueID = this.currParams.uniqueID;
|
return this.currParams=currParams;
|
||||||
|
|
||||||
return currParams=this.currParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,6 +32,7 @@ public class SmruDaqDialogPanel {
|
|||||||
JComboBox[] gains = new JComboBox[PamConstants.MAX_CHANNELS];
|
JComboBox[] gains = new JComboBox[PamConstants.MAX_CHANNELS];
|
||||||
JComboBox[] filters = new JComboBox[PamConstants.MAX_CHANNELS];
|
JComboBox[] filters = new JComboBox[PamConstants.MAX_CHANNELS];
|
||||||
|
|
||||||
|
JLabel libVersion;
|
||||||
|
|
||||||
private SmruDaqParameters smruDaqParameters;
|
private SmruDaqParameters smruDaqParameters;
|
||||||
|
|
||||||
@ -54,6 +55,12 @@ public class SmruDaqDialogPanel {
|
|||||||
dialogPanel.setBorder(new TitledBorder("Daq card configuration"));
|
dialogPanel.setBorder(new TitledBorder("Daq card configuration"));
|
||||||
GridBagConstraints c = new PamGridBagContraints();
|
GridBagConstraints c = new PamGridBagContraints();
|
||||||
c.gridwidth = 3;
|
c.gridwidth = 3;
|
||||||
|
dialogPanel.add(new JLabel("Library version: ", JLabel.RIGHT), c);
|
||||||
|
c.gridx += c.gridwidth;
|
||||||
|
dialogPanel.add(libVersion = new JLabel("Unknown"));
|
||||||
|
c.gridx = 0;
|
||||||
|
c.gridy++;
|
||||||
|
c.gridwidth = 3;
|
||||||
PamDialog.addComponent(dialogPanel,new JLabel("Sample Rate ", SwingConstants.RIGHT),c);
|
PamDialog.addComponent(dialogPanel,new JLabel("Sample Rate ", SwingConstants.RIGHT),c);
|
||||||
c.gridx += c.gridwidth;
|
c.gridx += c.gridwidth;
|
||||||
c.gridwidth = 3;
|
c.gridwidth = 3;
|
||||||
@ -169,6 +176,9 @@ public class SmruDaqDialogPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(SmruDaqParameters smruDaqParameters) {
|
public void setParams(SmruDaqParameters smruDaqParameters) {
|
||||||
|
|
||||||
|
libVersion.setText(smruDaqSystem.getJNILibInfo());
|
||||||
|
|
||||||
this.smruDaqParameters = smruDaqParameters.clone();
|
this.smruDaqParameters = smruDaqParameters.clone();
|
||||||
sampleRate.setSelectedIndex(smruDaqParameters.getSampleRateIndex());
|
sampleRate.setSelectedIndex(smruDaqParameters.getSampleRateIndex());
|
||||||
for (int i = 0; i < SmruDaqParameters.NCHANNELS * nShownBoards; i++) {
|
for (int i = 0; i < SmruDaqParameters.NCHANNELS * nShownBoards; i++) {
|
||||||
|
@ -20,7 +20,14 @@ public class SmruDaqJNI {
|
|||||||
|
|
||||||
static public final int SMRU_RET_OK = 0;
|
static public final int SMRU_RET_OK = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Have rebuilt SAIL Daq interface in 2022, but in principle this was
|
||||||
|
* just a straight rebuild of the exact same JNI code. the main purpose was to check
|
||||||
|
* we could still rebuild it after all these years and it seems to work. No real
|
||||||
|
* need though to move on from the older and trusted version.
|
||||||
|
*/
|
||||||
private static final String SILIB = "SailDaqJNI";
|
private static final String SILIB = "SailDaqJNI";
|
||||||
|
// private static final String SILIB = "SailDaqV7";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this is the verbose level for the C code part.
|
* this is the verbose level for the C code part.
|
||||||
@ -407,8 +414,8 @@ public class SmruDaqJNI {
|
|||||||
}
|
}
|
||||||
catch (UnsatisfiedLinkError e)
|
catch (UnsatisfiedLinkError e)
|
||||||
{
|
{
|
||||||
smruDaqSystem.terminalPrint("SAIL DAQ Card lib '" + SILIB + "' cannot be loaded for the following reason:", 1);
|
System.out.println("SAIL DAQ Card lib '" + SILIB + "' cannot be loaded for the following reason:");
|
||||||
smruDaqSystem.terminalPrint("Unsatisfied Link Error : " + e.getMessage(), 1);
|
System.out.println("Unsatisfied Link Error : " + e.getMessage());
|
||||||
haveLibrary = false;
|
haveLibrary = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -839,6 +846,22 @@ public class SmruDaqJNI {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the dll library name.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getLibrary() {
|
||||||
|
return SILIB;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the version of the dll library.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getLibarayVersion() {
|
||||||
|
return libVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,19 @@ public class SmruDaqSystem extends DaqSystem implements PamSettings {
|
|||||||
System.out.println(str);
|
System.out.println(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getJNILibInfo() {
|
||||||
|
String lib = smruDaqJNI.getLibrary();
|
||||||
|
int libVer = smruDaqJNI.getLibarayVersion();
|
||||||
|
String verStr;
|
||||||
|
if (libVer < 0) {
|
||||||
|
verStr = String.format("%s not loaded", lib);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
verStr = String.format("%s.dll Version %d", lib, libVer);
|
||||||
|
}
|
||||||
|
return verStr;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayBack(float sampleRate) {
|
public boolean canPlayBack(float sampleRate) {
|
||||||
@ -417,6 +430,15 @@ public class SmruDaqSystem extends DaqSystem implements PamSettings {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopSystem(AcquisitionControl daqControl) {
|
public void stopSystem(AcquisitionControl daqControl) {
|
||||||
|
if (keepRunning == false) {
|
||||||
|
/*
|
||||||
|
* it was never running, so no need to do this. From the GUI this isn't ever a problem
|
||||||
|
* but PAMDog can call stop a little over zealously, and there seems to be a problem
|
||||||
|
* with calling this when it's not running bunging up the cards. So basically without
|
||||||
|
* this PAMDog won't run properly with PAMDog
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
keepRunning = false;
|
keepRunning = false;
|
||||||
try {
|
try {
|
||||||
while(daqThreadRunning) {
|
while(daqThreadRunning) {
|
||||||
|
Loading…
Reference in New Issue
Block a user