Skip to content

Commit

Permalink
Set range based on channel type when loading LFP Viewer parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiegle committed Sep 25, 2024
1 parent 9c47a1b commit 28a6141
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Plugins/LfpViewer/LfpDisplayOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,7 @@ void LfpDisplayOptions::saveParameters (XmlElement* xml)
}

xmlNode->setAttribute ("ChannelDisplayState", channelDisplayState);
xmlNode->setAttribute ("selectedChannelType", (int) selectedChannelType);

xmlNode->setAttribute ("ScrollX", canvasSplit->viewport->getViewPositionX());
xmlNode->setAttribute ("ScrollY", canvasSplit->viewport->getViewPositionY());
Expand Down Expand Up @@ -1532,13 +1533,15 @@ void LfpDisplayOptions::loadParameters (XmlElement* xml)
String rangeString = xmlNode->getStringAttribute ("Range");
ranges.addTokens (rangeString, ",", "\"");

setSelectedType( (ContinuousChannel::Type) xmlNode->getIntAttribute ("selectedChannelType", ContinuousChannel::Type::ELECTRODE));

selectedVoltageRangeValues[0] = ranges[0];
selectedVoltageRangeValues[1] = ranges[1];
selectedVoltageRangeValues[2] = ranges[2];
selectedVoltageRange[0] = voltageRanges[0].indexOf (ranges[0]) + 1;
selectedVoltageRange[1] = voltageRanges[1].indexOf (ranges[1]) + 1;
selectedVoltageRange[2] = voltageRanges[2].indexOf (ranges[2]) + 1;
rangeSelection->setText (ranges[0]);
rangeSelection->setText (ranges[selectedChannelType]);
lfpDisplay->setRange (ranges[0].getFloatValue() * rangeGain[0], ContinuousChannel::Type::ELECTRODE);
lfpDisplay->setRange (ranges[1].getFloatValue() * rangeGain[1], ContinuousChannel::Type::AUX);
lfpDisplay->setRange (ranges[2].getFloatValue() * rangeGain[2], ContinuousChannel::Type::ADC);
Expand Down

0 comments on commit 28a6141

Please sign in to comment.