Skip to content

Commit

Permalink
Store and load ContinuousChannel type
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Oct 14, 2024
1 parent 78ff567 commit 1697f96
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/OpenEphysFileSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ bool OpenEphysFileSource::open (File file)
{
info.name = channel->getStringAttribute ("name");
info.bitVolts = channel->getStringAttribute ("bitVolts").getDoubleValue();
info.type = channel->getIntAttribute ("type");
info.startPos = channel->getIntAttribute ("position");

if (! recording.streams.count (streamName))
Expand Down Expand Up @@ -241,6 +242,7 @@ void OpenEphysFileSource::fillRecordInfo()

cInfo.name = recordings[recordingNum].streams[streamName].channels[i].name;
cInfo.bitVolts = recordings[recordingNum].streams[streamName].channels[i].bitVolts;
cInfo.type = recordings[recordingNum].streams[streamName].channels[i].type;

info.channels.add (cInfo);
}
Expand Down
1 change: 1 addition & 0 deletions Source/OpenEphysFileSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class OpenEphysFileSource : public FileSource
int id;
String name;
double bitVolts;
uint8 type;
String filename;
long int startPos;
};
Expand Down
1 change: 1 addition & 0 deletions Source/OpenEphysFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ void OpenEphysFormat::writeXml()
XmlElement* channelXml = new XmlElement ("CHANNEL");
channelXml->setAttribute ("name", channelInfo->name);
channelXml->setAttribute ("bitVolts", channelInfo->bitVolts);
channelXml->setAttribute ("type", static_cast<int>(channelInfo->type));
channelXml->setAttribute ("filename", channelInfo->filename);
channelXml->setAttribute ("position", (double) (channelInfo->startPos)); // As long as the file doesnt exceed 2^53 bytes, this will have integer precission. Better than limiting to 32bits.
streamXml->addChildElement (channelXml);
Expand Down
1 change: 1 addition & 0 deletions Source/OpenEphysFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class OpenEphysFormat : public RecordEngine
String name;
String filename;
float bitVolts;
uint8 type;
long int startPos;
};

Expand Down

0 comments on commit 1697f96

Please sign in to comment.