From 616cc3262b027b8b0bfcf86cebebf964056952ea Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Tue, 24 Sep 2024 09:36:25 +0200 Subject: [PATCH] DOC: Add comments for constructing stream and channel names. --- Source/DeviceThread.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/DeviceThread.cpp b/Source/DeviceThread.cpp index 049f156..563af9b 100644 --- a/Source/DeviceThread.cpp +++ b/Source/DeviceThread.cpp @@ -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"))))