mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 16:42:27 +00:00
Merge pull request #21 from PAMGuard/main
Work on bug fixes in CTD classifier
This commit is contained in:
commit
f899d01a41
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -840,5 +847,21 @@ public class SmruDaqJNI {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the dll library name.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getLibrary() {
|
||||||
|
return SILIB;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the version of the dll library.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getLibarayVersion() {
|
||||||
|
return libVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,19 @@ public class SmruDaqSystem extends DaqSystem implements PamSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
return true;
|
return true;
|
||||||
@ -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