mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +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) {
|
||||
simpleChi2Classifier.getDataSelector().getDialogPaneFX().getParams(true);
|
||||
}
|
||||
if (this.currParams != null) {
|
||||
currParams.uniqueID = this.currParams.uniqueID;
|
||||
}
|
||||
|
||||
currParams.uniqueID = this.currParams.uniqueID;
|
||||
|
||||
return currParams=this.currParams;
|
||||
return this.currParams=currParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,6 +32,7 @@ public class SmruDaqDialogPanel {
|
||||
JComboBox[] gains = new JComboBox[PamConstants.MAX_CHANNELS];
|
||||
JComboBox[] filters = new JComboBox[PamConstants.MAX_CHANNELS];
|
||||
|
||||
JLabel libVersion;
|
||||
|
||||
private SmruDaqParameters smruDaqParameters;
|
||||
|
||||
@ -54,6 +55,12 @@ public class SmruDaqDialogPanel {
|
||||
dialogPanel.setBorder(new TitledBorder("Daq card configuration"));
|
||||
GridBagConstraints c = new PamGridBagContraints();
|
||||
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);
|
||||
c.gridx += c.gridwidth;
|
||||
c.gridwidth = 3;
|
||||
@ -169,6 +176,9 @@ public class SmruDaqDialogPanel {
|
||||
}
|
||||
|
||||
public void setParams(SmruDaqParameters smruDaqParameters) {
|
||||
|
||||
libVersion.setText(smruDaqSystem.getJNILibInfo());
|
||||
|
||||
this.smruDaqParameters = smruDaqParameters.clone();
|
||||
sampleRate.setSelectedIndex(smruDaqParameters.getSampleRateIndex());
|
||||
for (int i = 0; i < SmruDaqParameters.NCHANNELS * nShownBoards; i++) {
|
||||
|
@ -20,7 +20,14 @@ public class SmruDaqJNI {
|
||||
|
||||
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 = "SailDaqV7";
|
||||
|
||||
/**
|
||||
* this is the verbose level for the C code part.
|
||||
@ -407,8 +414,8 @@ public class SmruDaqJNI {
|
||||
}
|
||||
catch (UnsatisfiedLinkError e)
|
||||
{
|
||||
smruDaqSystem.terminalPrint("SAIL DAQ Card lib '" + SILIB + "' cannot be loaded for the following reason:", 1);
|
||||
smruDaqSystem.terminalPrint("Unsatisfied Link Error : " + e.getMessage(), 1);
|
||||
System.out.println("SAIL DAQ Card lib '" + SILIB + "' cannot be loaded for the following reason:");
|
||||
System.out.println("Unsatisfied Link Error : " + e.getMessage());
|
||||
haveLibrary = false;
|
||||
}
|
||||
}
|
||||
@ -839,6 +846,22 @@ public class SmruDaqJNI {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
public boolean canPlayBack(float sampleRate) {
|
||||
@ -417,6 +430,15 @@ public class SmruDaqSystem extends DaqSystem implements PamSettings {
|
||||
|
||||
@Override
|
||||
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;
|
||||
try {
|
||||
while(daqThreadRunning) {
|
||||
|
Loading…
Reference in New Issue
Block a user