Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,445 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
% Brainstorm | ||
% v. 3.200816 (16-Aug-2020) | ||
% v. 3.200817 (17-Aug-2020) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
%{ | ||
Copyright (C) Cambridge Electronic Design Limited 2014 | ||
Author: James Thompson | ||
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk | ||
This file is part of CEDS64ML, a MATLAB interface to the SON64 library. | ||
CEDS64ML is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
CEDS64ML is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with CEDS64ML. If not, see <http://www.gnu.org/licenses/>. | ||
%} | ||
|
||
classdef CEDMarker < handle | ||
|
||
properties (GetAccess = public, SetAccess = private) | ||
m_Time; | ||
m_Code1; | ||
m_Code2; | ||
m_Code3; | ||
m_Code4; | ||
end | ||
|
||
methods | ||
% methods, including the constructor are defined in this bloc | ||
function obj = CEDMarker(Time, Code1, Code2, Code3, Code4) | ||
% class constructor | ||
% set everthing to zero then overwrite it if we have an | ||
% argument | ||
obj.m_Time = int64(0); | ||
obj.m_Code1 = uint8(0); | ||
obj.m_Code2 = uint8(0); | ||
obj.m_Code3 = uint8(0); | ||
obj.m_Code4 = uint8(0); | ||
|
||
if(nargin > 0) | ||
if (isinteger(Time) && Time > 0) | ||
obj.m_Time = int64(Time); | ||
end | ||
end | ||
if(nargin > 1) | ||
obj.m_Code1 = uint8(Code1(1)); | ||
end | ||
if(nargin > 2) | ||
obj.m_Code2 = uint8(Code2(1)); | ||
end | ||
if(nargin > 3) | ||
obj.m_Code3 = uint8(Code3(1)); | ||
end | ||
if(nargin > 4) | ||
obj.m_Code4 = uint8(Code4(1)); | ||
end | ||
end | ||
|
||
function Code = GetCode(obj, iN) | ||
switch (iN) | ||
case 1 | ||
Code = obj.m_Code1; | ||
case 2 | ||
Code = obj.m_Code2; | ||
case 3 | ||
Code = obj.m_Code3; | ||
case 4 | ||
Code = obj.m_Code4; | ||
otherwise | ||
Code = -22; | ||
end | ||
end | ||
|
||
function err = SetCode(obj, iN, Code) | ||
err = 0; | ||
switch (iN) | ||
case 1 | ||
obj.m_Code1 = uint8(Code(1)); | ||
case 2 | ||
obj.m_Code2 = uint8(Code(1)); | ||
case 3 | ||
obj.m_Code3 = uint8(Code(1)); | ||
case 4 | ||
obj.m_Code4 = uint8(Code(1)); | ||
otherwise | ||
err = -22; | ||
end | ||
end | ||
|
||
function Time = GetTime(obj) | ||
Time = obj.m_Time; | ||
end | ||
|
||
function err = SetTime(obj, Time) | ||
if (isnumeric(Time) && Time > 0) | ||
obj.m_Time = int64(Time); | ||
err = 0; | ||
else | ||
err = - 22; | ||
end | ||
end | ||
|
||
function [ r, c ] = Size(obj) | ||
r = 0; | ||
c = 0; | ||
end | ||
|
||
function err = GetData(obj) | ||
err = -22; | ||
end | ||
|
||
function err = SetData(obj, Data) | ||
err = -22; | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
%{ | ||
Copyright (C) Cambridge Electronic Design Limited 2014 | ||
Author: James Thompson | ||
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk | ||
This file is part of CEDS64ML, a MATLAB interface to the SON64 library. | ||
CEDS64ML is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
CEDS64ML is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with CEDS64ML. If not, see <http://www.gnu.org/licenses/>. | ||
%} | ||
|
||
function [ iOk, sCommentOut ] = CEDS64ChanComment( fhand, iChan, sCommentIn ) | ||
%CEDS64CHANCOMMENT Gets and sets the comment for a channel | ||
% [ iOk, sCommentOut ] = CEDS64ChanComment( fhand, iChan {, sCommentIn} ) | ||
% fhand - An integer handle to an open file | ||
% iChan - A channel number | ||
% sCommentIn - (Optional) A string containing the new comment | ||
% Output | ||
% iOk - 0 if the comment was set correctly otherwise a negative error code | ||
% sCommentOut - A string containing the old comment | ||
|
||
if (nargin == 2 || nargin == 3) % always get the comment | ||
%step 1 find out how big the comment is | ||
dummystring = blanks(1); | ||
[iSize] = calllib('ceds64int', 'S64GetChanComment', fhand, iChan, dummystring, -1); | ||
%step 2 create a string buffer of the correct size | ||
stringptr = blanks(iSize+1); | ||
[iOk, sCommentOut] = calllib('ceds64int', 'S64GetChanComment', fhand, iChan, stringptr, 0); | ||
else | ||
iOk = -22; | ||
end | ||
|
||
% has there been an error? | ||
if iOk < 0 | ||
return; | ||
end | ||
|
||
% if not set the comment if we're given one | ||
if (nargin == 3) | ||
iOk = calllib('ceds64int', 'S64SetChanComment', fhand, iChan, sCommentIn); | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
%{ | ||
Copyright (C) Cambridge Electronic Design Limited 2014 | ||
Author: James Thompson | ||
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk | ||
This file is part of CEDS64ML, a MATLAB interface to the SON64 library. | ||
CEDS64ML is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
CEDS64ML is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with CEDS64ML. If not, see <http://www.gnu.org/licenses/>. | ||
%} | ||
|
||
function [ i64Div ] = CEDS64ChanDiv( fhand, iChan ) | ||
%CEDS64CHANDIV The sample interval in Ticks | ||
% [ i64Div ] = CEDS64ChanDiv( fhand, iChan ) | ||
% Inputs | ||
% fhand - Integer file handle | ||
% iChan - Channel number | ||
% Outputs | ||
% i64Div - The sample interval in Ticks or a negative error code | ||
if(nargin == 2) | ||
i64Div = calllib('ceds64int', 'S64ChanDivide', fhand, iChan); | ||
else | ||
i64Div = -22; | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
%{ | ||
Copyright (C) Cambridge Electronic Design Limited 2014 | ||
Author: James Thompson | ||
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk | ||
This file is part of CEDS64ML, a MATLAB interface to the SON64 library. | ||
CEDS64ML is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
CEDS64ML is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with CEDS64ML. If not, see <http://www.gnu.org/licenses/>. | ||
%} | ||
|
||
function [ iOk, sTitleOut ] = CEDS64ChanTitle( fhand, iChan, sTitleIn ) | ||
%CEDS64CHANTITLE Gets and sets a channel title | ||
% [ iOk, sTitleOut ] = CEDS64ChanTitle( fhand, iChan {, sTitleIn} ) | ||
% Input | ||
% fhand - An integer handle to an open file | ||
% iChan - A channel number | ||
% sTitleIn - (Optional) A string containing the new title | ||
% Output | ||
% iOk - 0 if the title was set correctly otherwise a negative error code | ||
% sTitleOut - A string containing the old title | ||
|
||
if (nargin == 2 || nargin == 3) % always get the old title | ||
%step 1 find out how big the title is is | ||
dummystring = blanks(1); | ||
[iSize] = calllib('ceds64int', 'S64GetChanTitle', fhand, iChan, dummystring, -1); | ||
%step 2 create a string buffer of the correct size | ||
stringptr = blanks(iSize+1); | ||
[iOk, sTitleOut] = calllib('ceds64int', 'S64GetChanTitle', fhand, iChan, stringptr, 0); | ||
else | ||
iOk = -22; | ||
end | ||
|
||
% has there been an error? | ||
if iOk < 0 | ||
return; | ||
end | ||
|
||
% if not set the new title if we're given one | ||
if (nargin == 3) | ||
iOk = calllib('ceds64int', 'S64SetChanTitle', fhand, iChan, sTitleIn); | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
%{ | ||
Copyright (C) Cambridge Electronic Design Limited 2014 | ||
Author: James Thompson | ||
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk | ||
This file is part of CEDS64ML, a MATLAB interface to the SON64 library. | ||
CEDS64ML is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
CEDS64ML is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with CEDS64ML. If not, see <http://www.gnu.org/licenses/>. | ||
%} | ||
|
||
function [ iType ] = CEDS64ChanType( fhand, iChan ) | ||
%CEDS64CHANTYPE Returns an integer code corresponding to the channel type | ||
% [ iType ] = CEDS64ChanType( fhand, iChan ) | ||
% Inputs | ||
% fhand - Integer file handle | ||
% iChan - Channel number | ||
% Outputs | ||
% iType - 0 no channel | ||
% 1 Waveform channel | ||
% 2 Event (falling) | ||
% 3 Event (rising) | ||
% 4 Event (both) | ||
% 5 Marker | ||
% 6 Wavemark | ||
% 7 Realmark | ||
% 8 TextMark | ||
% 9 Realwave | ||
% or a negative error code | ||
if(nargin == 2) | ||
iType = calllib('ceds64int', 'S64ChanType', fhand, iChan); | ||
else | ||
iType = -22; | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
%{ | ||
Copyright (C) Cambridge Electronic Design Limited 2014 | ||
Author: James Thompson | ||
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk | ||
This file is part of CEDS64ML, a MATLAB interface to the SON64 library. | ||
CEDS64ML is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
CEDS64ML is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with CEDS64ML. If not, see <http://www.gnu.org/licenses/>. | ||
%} | ||
|
||
function [ iOk, sUnitsOut ] = CEDS64ChanUnits( fhand, iChan, sUnitsIn ) | ||
%CEDS64CHANUNITS Gets and sets channels units | ||
% [ iOk {, sUnitsOut} ] = CEDS64ChanUnits( fhand, iChan{, sUnitsIn} ) | ||
% Input | ||
% fhand - An integer handle to an open file | ||
% iChan - A channel number | ||
% sUnitsIn - (Optional) A string conatining the new units | ||
% Output | ||
% iOk - 0 if the units were set correctly otherwise a negative error code. | ||
% sUnitsOut - A string containing the old units | ||
|
||
if (nargin == 2 || nargin == 3) % always get the old units | ||
%step 1 find out how big the comment is | ||
dummystring = blanks(1); | ||
[iSize] = calllib('ceds64int', 'S64GetChanUnits', fhand, iChan, dummystring, -1); | ||
%step 2 create a string buffer of the correct size | ||
stringptr = blanks(iSize+1); | ||
[iOk, sUnitsOut] = calllib('ceds64int', 'S64GetChanUnits', fhand, iChan, stringptr, 0); | ||
else | ||
iOk = -22; | ||
end | ||
|
||
% has there been an error? | ||
if iOk < 0 | ||
return; | ||
end | ||
|
||
% if not set the new units if we're given some | ||
if (nargin == 3) | ||
iOk = calllib('ceds64int', 'S64SetChanUnits', fhand, iChan, sUnitsIn); | ||
end | ||
end | ||
|
Oops, something went wrong.