Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Source/Plugins/FilterNode/FilterEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ void FilterEditor::setDefaults(double lowCut, double highCut)
lastHighCutString = String(roundFloatToInt(highCut));
lastLowCutString = String(roundFloatToInt(lowCut));

resetToSavedText();
}

void FilterEditor::resetToSavedText()
{
highCutValue->setText(lastHighCutString, dontSendNotification);
lowCutValue->setText(lastLowCutString, dontSendNotification);
}
Expand Down Expand Up @@ -219,8 +224,10 @@ void FilterEditor::loadCustomParameters(XmlElement* xml)
{
if (xmlNode->hasTagName("VALUES"))
{
highCutValue->setText(xmlNode->getStringAttribute("HighCut"),dontSendNotification);
lowCutValue->setText(xmlNode->getStringAttribute("LowCut"),dontSendNotification);
lastHighCutString = xmlNode->getStringAttribute("HighCut", lastHighCutString);
lastLowCutString = xmlNode->getStringAttribute("LowCut", lastLowCutString);
resetToSavedText();

applyFilterOnADC->setToggleState(xmlNode->getBoolAttribute("ApplyToADC",false), sendNotification);
}
}
Expand Down
1 change: 1 addition & 0 deletions Source/Plugins/FilterNode/FilterEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class FilterEditor : public GenericEditor,
void loadCustomParameters(XmlElement* xml);

void setDefaults(double lowCut, double highCut);
void resetToSavedText();

void channelChanged (int chan, bool newState);

Expand Down
3 changes: 3 additions & 0 deletions Source/Plugins/FilterNode/FilterNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ void FilterNode::loadCustomChannelParametersFromXml(XmlElement* channelInfo, Inf

if (channelType == InfoObjectCommon::DATA_CHANNEL)
{
// restore high and low cut text in case they were changed by channelChanged
static_cast<FilterEditor*>(getEditor())->resetToSavedText();

forEachXmlChildElement (*channelInfo, subNode)
{
if (subNode->hasTagName ("PARAMETERS"))
Expand Down
4 changes: 2 additions & 2 deletions Source/Plugins/FilterNode/FilterNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class FilterNode : public GenericProcessor

void updateSettings() override;

void saveCustomChannelParametersToXml(XmlElement* channelInfo, int channelNumber, InfoObjectCommon::InfoObjectType channelTypel) override;
void loadCustomChannelParametersFromXml(XmlElement* channelInfo, InfoObjectCommon::InfoObjectType channelType) override;
void saveCustomChannelParametersToXml(XmlElement* channelInfo, int channelNumber, InfoObjectCommon::InfoObjectType channelTypel) override;
void loadCustomChannelParametersFromXml(XmlElement* channelInfo, InfoObjectCommon::InfoObjectType channelType) override;

double getLowCutValueForChannel (int chan) const;
double getHighCutValueForChannel (int chan) const;
Expand Down