Skip to content

Conversation

rhayman
Copy link

@rhayman rhayman commented Jan 29, 2025

When using the FileReader plugin to read data recorded with AUX channels these channels aren't represented in the data stream i.e. they aren't added to the continuousChannels array. Instead all channels added are of type continuousChannel::Type::ELECTRODE.

Below, the channelInfo.name attribute is compared to the string "AUX" and, if true, a ContinuousChannel::Type::AUX channel is added to the continuousChannels array, otherwise a ContinuousChannel::Type::ELECTRODE channel is added (i.e. the default).

The relevant part of the updateSettings method in FileReader.cpp now reads:

for (int i = 0; i < currentNumChannels; i++) {
  String ch_name = channelInfo[i].name;
  if (ch_name.contains(String("AUX"))) {
	ContinuousChannel::Settings channelSettings{
		ContinuousChannel::Type::AUX, channelInfo[i].name, "description",
		"filereader.stream",
		channelInfo[i].bitVolts, // BITVOLTS VALUE
		dataStreams.getLast()};

	continuousChannels.add(new ContinuousChannel(channelSettings));
	continuousChannels.getLast()->addProcessor(processorInfo.get());

  } else {
	ContinuousChannel::Settings channelSettings{
		ContinuousChannel::Type::ELECTRODE,
		channelInfo[i].name,
		"description",
		"filereader.stream",
		channelInfo[i].bitVolts, // BITVOLTS VALUE
		dataStreams.getLast()};

	continuousChannels.add(new ContinuousChannel(channelSettings));
	continuousChannels.getLast()->addProcessor(processorInfo.get());
  }
}

[My editor has reformatted FileReader.cpp so lots of irrelevant diffs are popping up. Sorry!]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant