diff --git a/Source/Plugins/FilterNode/FilterEditor.cpp b/Source/Plugins/FilterNode/FilterEditor.cpp index 4983f530ce..3c2c4bbf3b 100644 --- a/Source/Plugins/FilterNode/FilterEditor.cpp +++ b/Source/Plugins/FilterNode/FilterEditor.cpp @@ -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); } @@ -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); } } diff --git a/Source/Plugins/FilterNode/FilterEditor.h b/Source/Plugins/FilterNode/FilterEditor.h index 79f5df0958..de0c982931 100644 --- a/Source/Plugins/FilterNode/FilterEditor.h +++ b/Source/Plugins/FilterNode/FilterEditor.h @@ -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); diff --git a/Source/Plugins/FilterNode/FilterNode.cpp b/Source/Plugins/FilterNode/FilterNode.cpp index 8728a8044c..7a4e56ffb2 100644 --- a/Source/Plugins/FilterNode/FilterNode.cpp +++ b/Source/Plugins/FilterNode/FilterNode.cpp @@ -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(getEditor())->resetToSavedText(); + forEachXmlChildElement (*channelInfo, subNode) { if (subNode->hasTagName ("PARAMETERS")) diff --git a/Source/Plugins/FilterNode/FilterNode.h b/Source/Plugins/FilterNode/FilterNode.h index e4d49183c2..7451e54797 100644 --- a/Source/Plugins/FilterNode/FilterNode.h +++ b/Source/Plugins/FilterNode/FilterNode.h @@ -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;