Skip to content

Commit

Permalink
***** NPMK Version 4.5.1.0 :September 13, 2017 *****
Browse files Browse the repository at this point in the history
% openNSx 6.4.3.0: September 13, 2017
%   - Removed a redundant block of code that was accidentally placed in the
%     script twice.
%   - Checks to see if there's a newer version of NPMK is available.

% openNEV 5.4.0.0: September 13, 2017
%   - Checks to see if there's a newer version of NPMK is available.
%   - Properly reads the comment colors.

% NPMKverChecker 1.0.0.0: September 13, 2017
%   - Initial Release.
  • Loading branch information
Kian Torab committed Sep 13, 2017
1 parent cd66f14 commit fce0338
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NPMK/Dependent Functions/getFile.ini
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/Users/kianabc/Documents/Sample Data/The Most Perfect Data in the WWWorld/sampleData/
/Users/kianabc/Downloads/
32 changes: 32 additions & 0 deletions NPMK/NPMKverChecker.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function NPMKverChecker()

% NPMKverChecker
%
% Checks to see if there is a newer version of NPMK is available for
% download.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Use NPMKverChecker
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Kian Torab
% [email protected]
% Blackrock Microsystems
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Version History
%
% 1.0.0.0: September 13, 2017
% - Initial release.
%

%% Check for the latest version fo NPMK
FIDv = fopen('Versions.txt');
verFile = fscanf(FIDv, '%s');
fclose(FIDv);
latestVersion = verFile(findstr('LATEST', verFile)+7:findstr('LATEST', verFile)+13);
gitHubPage = urlread('https://github.com/BlackrockMicrosystems/NPMK/releases/latest');
newVersionAvailable = findstr(latestVersion, gitHubPage);
if isempty(newVersionAvailable)
disp('A new version of NPMK may be available.');
disp('Please visit https://github.com/BlackrockMicrosystems/NPMK/releases/latest to get the latest version.');
end
15 changes: 15 additions & 0 deletions NPMK/Versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,18 @@ NPMK Version 2.8.2.0: 5 May 2014
% - Fixed a invalid character bug.
% - Bug fixes with file loading

***** NPMK Version 4.5.1.0 :September 13, 2017 *****

% openNSx 6.4.3.0: September 13, 2017
% - Removed a redundant block of code that was accidentally placed in the
% script twice.
% - Checks to see if there's a newer version of NPMK is available.

% openNEV 5.4.0.0: September 13, 2017
% - Checks to see if there's a newer version of NPMK is available.
% - Properly reads the comment colors.

% NPMKverChecker 1.0.0.0: September 13, 2017
% - Initial Release.

LATEST:4.5.1.0
17 changes: 15 additions & 2 deletions NPMK/openNEV.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,15 @@
% 5.3.1.0: September 1, 2017
% - Fixed a bug with file path and whent this was passed to the function.
%
% 5.4.0.0: September 13, 2017
% - Checks to see if there's a newer version of NPMK is available.
% - Properly reads the comment colors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Check for the latest version fo NPMK
NPMKverChecker

%% Defining structures
NEV = struct('MetaTags',[], 'ElectrodesInfo', [], 'Data', []);
NEV.MetaTags = struct('Subject', [], 'Experimenter', [], 'DateTime', [],...
Expand Down Expand Up @@ -661,10 +668,11 @@
NEV.Data.Comments.TimeStamp = Timestamp(commentIndices);
NEV.Data.Comments.TimeStampSec = double(NEV.Data.Comments.TimeStamp)/double(NEV.MetaTags.TimeRes);
NEV.Data.Comments.CharSet = tRawData(7, commentIndices);
colorFlag = tRawData(8, commentIndices);
NEV.Data.Comments.TimeStampStarted = tRawData(9:12, commentIndices);
NEV.Data.Comments.TimeStampStarted = typecast(NEV.Data.Comments.TimeStampStarted(:), 'uint32').';
NEV.Data.Comments.Text = char(tRawData(13:Trackers.countPacketBytes, commentIndices).');

% Transferring NeuroMotive Events to its own structure
neuroMotiveEvents = find(NEV.Data.Comments.CharSet == 255);
NEV.Data.TrackingEvents.TimeStamp = NEV.Data.Comments.TimeStamp(neuroMotiveEvents);
Expand All @@ -682,10 +690,15 @@
NEV.Data.Comments.TimeStamp(neuroMotiveEvents) = [];
NEV.Data.Comments.TimeStampSec(neuroMotiveEvents) = [];
NEV.Data.Comments.CharSet(neuroMotiveEvents) = [];

NEV.Data.Comments.TimeStampStarted(neuroMotiveEvents) = [];
NEV.Data.Comments.TimeStampStartedSec = double(NEV.Data.Comments.TimeStampStarted)/double(NEV.MetaTags.TimeRes);
NEV.Data.Comments.Text(neuroMotiveEvents,:) = [];
colorFlag(neuroMotiveEvents) = [];

% Figuring out the text color of the comments that had color
NEV.Data.Comments.Color = dec2hex(NEV.Data.Comments.TimeStampStarted);
NEV.Data.Comments.Color(colorFlag == 1,:) = repmat('0', size(NEV.Data.Comments.Color(colorFlag == 1,:)));
NEV.Data.Comments.TimeStampStarted(colorFlag == 0) = NEV.Data.Comments.TimeStamp(colorFlag == 0);

clear commentIndices;
end
Expand Down
3 changes: 2 additions & 1 deletion NPMK/openNSx.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@
% - Fixed a bug related to reading data from sample that is not 1 and
% timestamp that used to get reset to 0.
%
% 6.4.3.0: September 3, 2017
% 6.4.3.0: September 13, 2017
% - Removed a redundant block of code that was accidentally placed in the
% script twice.
% - Checks to see if there's a newer version of NPMK is available.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down

0 comments on commit fce0338

Please sign in to comment.