Skip to content

Commit

Permalink
DOC: Add comments for constructing stream and channel names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ningfei committed Sep 24, 2024
1 parent 3ca345b commit 616cc32
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/DeviceThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,22 @@ void DeviceThread::updateChannelsFromAOInfo()
continue;
}

// Account for "LFP 01 / Central"
if (AOChannelName.endsWith("Central") || AOChannelName.endsWith("Anterior") || AOChannelName.endsWith("Medial") || AOChannelName.endsWith("Posterior") || AOChannelName.endsWith("Lateral"))
AOChannelName = AOChannelName.replace(" / ", "-");


if (AOChannelName.contains(" / "))
// Account for pattern like "ECOG LF 2 / 01"
streamName = AOChannelName.upToFirstOccurrenceOf(" / ", false, false);
else
// Account for pattern like "Macro LFP 01"
streamName = AOChannelName.upToLastOccurrenceOf(" ", false, false);

// Account for pattern like "Port- 1"
streamName = streamName.replace("- ", "");

// Channel name always starts from the last occurrence of space
channelName = AOChannelName.fromLastOccurrenceOf(" ", false, false);

if (streamID < 0 || (!streamName.equalsIgnoreCase(streamsXmlList->getChildElement(streamID)->getStringAttribute("Stream_Name"))))
Expand Down

0 comments on commit 616cc32

Please sign in to comment.