diff --git a/lib64/SmruDaqJNI.dll b/lib64/SmruDaqJNI.dll deleted file mode 100644 index 0fef1736..00000000 Binary files a/lib64/SmruDaqJNI.dll and /dev/null differ diff --git a/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java b/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java index 05602397..8ee87ba5 100644 --- a/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java +++ b/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java @@ -228,10 +228,11 @@ public class SimpleCTClassifierPane extends SettingsPane { 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 diff --git a/src/hfDaqCard/SmruDaqDialogPanel.java b/src/hfDaqCard/SmruDaqDialogPanel.java index e9300c0a..4f2dddcd 100644 --- a/src/hfDaqCard/SmruDaqDialogPanel.java +++ b/src/hfDaqCard/SmruDaqDialogPanel.java @@ -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++) { diff --git a/src/hfDaqCard/SmruDaqJNI.java b/src/hfDaqCard/SmruDaqJNI.java index 5378fb64..e1b8356f 100644 --- a/src/hfDaqCard/SmruDaqJNI.java +++ b/src/hfDaqCard/SmruDaqJNI.java @@ -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; + } } diff --git a/src/hfDaqCard/SmruDaqSystem.java b/src/hfDaqCard/SmruDaqSystem.java index 7e04151b..1d78e824 100644 --- a/src/hfDaqCard/SmruDaqSystem.java +++ b/src/hfDaqCard/SmruDaqSystem.java @@ -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) {