mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-29 02:22:22 +00:00
Bug fix for matched click classifier (#10)
* Bug fix for matched click classifier Some of the alarm stuff in the click detector was throwing an exception because the matched click classifier adds a click ID that is not in the click ID module's list...now fixed and test with porpoises. * Matched click classifier now has template names The name field of the imported templates is now the file name of the template.
This commit is contained in:
parent
3c18822949
commit
6ef5adcad2
@ -108,6 +108,9 @@ public class ClickAlarmManager extends PamProcess {
|
||||
// System.out.println("ClickAlarm hashcode, time = " + System.identityHashCode(arg) + "," + cd.getTimeMilliseconds() + "," + cd.getClickType() );
|
||||
if (cd.getClickType()!=0) {
|
||||
ClickTypeCommonParams commonParams = clickControl.getClickIdentifier().getCommonParams(cd.getClickType());
|
||||
|
||||
if (commonParams==null) return;
|
||||
|
||||
Boolean soundAlarm = commonParams.getAlarmEnabled();
|
||||
|
||||
if (soundAlarm != null && soundAlarm) {
|
||||
|
@ -401,6 +401,7 @@ public class BasicClickIdentifier implements ClickIdentifier, PamSettings {
|
||||
*/
|
||||
public ClickTypeCommonParams getCommonParams(int code) {
|
||||
int codeIdx = codeToListIndex(code);
|
||||
if (codeIdx>=idParameters.clickTypeParams.size()) return null;
|
||||
return idParameters.clickTypeParams.get(codeIdx);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class ImportTemplateCSV implements TemplateImport {
|
||||
//now create waveform
|
||||
// System.out.println("Create a waveform with " + waveform.length + " samples with a sample rate of "
|
||||
// + sR + " Hz");
|
||||
MatchTemplate matchedTemplate = new MatchTemplate("Imported Waveform", waveform, sR);
|
||||
MatchTemplate matchedTemplate = new MatchTemplate(filePath.getName(), waveform, sR);
|
||||
//TODO
|
||||
return matchedTemplate;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class ImportTemplateMAT implements TemplateImport {
|
||||
//now create waveform
|
||||
// System.out.println("Create a waveform with " + waveform.length + " samples with a sample rate of "
|
||||
// + sR + " Hz");
|
||||
MatchTemplate matchedTemplate = new MatchTemplate("Imported Waveform", waveform, sR);
|
||||
MatchTemplate matchedTemplate = new MatchTemplate(filePath.getName(), waveform, sR);
|
||||
return matchedTemplate;
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user