Skip to content

Commit e1ad59e

Browse files
committed
Usability improvements for EEG / AUX channels.
1 parent b011ede commit e1ad59e

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="design"/>
5+
</Category>
6+
</Info>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info location="EEGProtocol.m" type="File"/>

toolbox/src/EEGProtocol.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
classdef EEGProtocol < Simulink.IntEnumType
2+
3+
enumeration
4+
Unknown(0)
5+
NeurOne(1)
6+
actiCHamp(2)
7+
end
8+
9+
end

toolbox/src/bossdevice.m

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
num_eeg_channels
3737
num_aux_channels
3838
marker_pulse_width_sec
39+
protocol_type
40+
connection_status
3941
end
4042

4143
properties (SetAccess = private, Dependent)
@@ -343,27 +345,46 @@ function stop(obj)
343345
end
344346

345347
function n = get.num_eeg_channels(obj)
346-
n = getparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numEEGch');
348+
if obj.protocol_type == 2 % actiCHamp
349+
n = obj.getsignal({'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/TurboLink Decode',...
350+
'TurboLink_UDP_Decode/MATLAB Function'},1) * 32;
351+
else
352+
n = getparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numEEGch');
353+
end
347354
end
348355

349356
function set.num_eeg_channels(obj, n)
350357
arguments
351358
obj
352359
n uint8 {mustBeInteger,mustBeNonnegative}
353360
end
354-
setparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numEEGch', n);
361+
362+
if obj.protocol_type == 2 % actiCHamp
363+
warning('Number of EEG channels is determined automically for actiCHamp. This input will be ignored.');
364+
else
365+
setparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numEEGch', n);
366+
end
355367
end
356368

357369
function n = get.num_aux_channels(obj)
358-
n = getparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numAUXch');
370+
if obj.protocol_type == 2 % actiCHamp
371+
n = 8;
372+
else
373+
n = getparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numAUXch');
374+
end
359375
end
360376

361377
function set.num_aux_channels(obj, n)
362378
arguments
363379
obj
364380
n uint8 {mustBeInteger,mustBeNonnegative}
365381
end
366-
setparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numAUXch', n);
382+
383+
if obj.protocol_type == 2 % actiCHamp
384+
warning('Number of AUX channels is determined automically for actiCHamp. This input will be ignored.');
385+
else
386+
setparam(obj, {'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/NeurOne Decode'},'numAUXch', n);
387+
end
367388
end
368389

369390
function val = get.marker_pulse_width_sec(obj)
@@ -374,6 +395,14 @@ function stop(obj)
374395
setparam(obj, 'GEN', 'marker_pulse_width_sec', val);
375396
end
376397

398+
function val = get.protocol_type(obj)
399+
val = obj.getsignal({'UDP Decode','UDP_Decode_Biosignal/Decode UDP Messages/Protocol Selector'},1);
400+
end
401+
402+
function val = get.connection_status(obj)
403+
val = obj.getsignal({'UDP Receive','UDP_Receive_Queue/UDP Connection Status'},1);
404+
end
405+
377406
function obj = configure_generator_sequence(obj, sequence)
378407
arguments
379408
obj bossdevice

0 commit comments

Comments
 (0)