Skip to content

Commit 4579913

Browse files
committed
Add GPL State reading
Add reader for GPL state
1 parent 5a313ac commit 4579913

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
classdef GPLState < pgmatlab.core.standard.StandardModule
2+
properties
3+
objectType = [];
4+
end
5+
methods
6+
function obj = GPLState();
7+
% obj.background = @pgmatlab.core.modules.detectors.SpectralBackground;
8+
end
9+
function [data, selState] = readImpl(~, fid, data, fileInfo, length, identifier, selState);
10+
% error = false;
11+
% nChan = pgmatlab.utils.countChannels(data.channelMap);
12+
try
13+
% dataLength = fread(fid, 1, 'int32');
14+
data.baseline = fread(fid, 1, 'float32');
15+
data.ceilNoise = fread(fid,1, 'float32');
16+
data.threshFloor = fread(fid,1, 'float32');
17+
data.peakState = fread(fid,1,'int16');
18+
catch mError
19+
disp(['Error reading ' fileInfo.fileHeader.moduleType ' data object. Data read:']);
20+
disp(data);
21+
disp(getReport(mError));
22+
% error=true;
23+
end
24+
end
25+
end
26+
end

pgmatlab/+pgmatlab/loadPamguardBinaryFile.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@
222222
switch fileInfo.fileHeader.streamName
223223
case 'GPL Detections'
224224
moduleObj = pgmatlab.core.modules.detectors.GPL();
225+
case 'GPL State'
226+
moduleObj = pgmatlab.core.modules.detectors.GPLState();
225227
end
226228

227229
% Right Whale Edge Detector Module

0 commit comments

Comments
 (0)