Skip to content
Snippets Groups Projects
Commit 7af73478 authored by jsiegle's avatar jsiegle
Browse files

PulsePalOutput can now save its settings

parent 54c2662e
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,40 @@ PulsePalOutputEditor::~PulsePalOutputEditor()
}
void PulsePalOutputEditor::saveEditorParameters(XmlElement* xml)
{
xml->setAttribute("Type", "PulsePalOutputEditor");
for (int i = 0; i < 4; i++)
{
XmlElement* outputXml = xml->createNewChildElement("OUTPUTCHANNEL");
outputXml->setAttribute("Number",i);
outputXml->setAttribute("Trigger",channelTriggerInterfaces[i]->getTriggerChannel());
outputXml->setAttribute("Gate",channelTriggerInterfaces[i]->getGateChannel());
}
}
void PulsePalOutputEditor::loadEditorParameters(XmlElement* xml)
{
forEachXmlChildElement(*xml, xmlNode)
{
if (xmlNode->hasTagName("OUTPUTCHANNEL"))
{
int chNum = xmlNode->getIntAttribute("Number");
channelTriggerInterfaces[chNum]->setTriggerChannel(xmlNode->getIntAttribute("Trigger"));
channelTriggerInterfaces[chNum]->setGateChannel(xmlNode->getIntAttribute("Gate"));
}
}
}
//-----------------------------------------------
ChannelTriggerInterface::ChannelTriggerInterface(PulsePal* pp, PulsePalOutput* ppo, int chan)
......@@ -134,3 +168,25 @@ void ChannelTriggerInterface::comboBoxChanged(ComboBox* comboBoxThatHasChanged)
}
int ChannelTriggerInterface::getTriggerChannel()
{
return triggerSelector->getSelectedId();
}
int ChannelTriggerInterface::getGateChannel()
{
return gateSelector->getSelectedId();
}
void ChannelTriggerInterface::setTriggerChannel(int chan)
{
return triggerSelector->setSelectedId(chan);
}
void ChannelTriggerInterface::setGateChannel(int chan)
{
return gateSelector->setSelectedId(chan);
}
......@@ -54,6 +54,9 @@ private:
PulsePal* pulsePal;
void saveEditorParameters(XmlElement* xml);
void loadEditorParameters(XmlElement* xml);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PulsePalOutputEditor);
};
......@@ -69,6 +72,12 @@ public:
void paint(Graphics& g);
void setTriggerChannel(int chan);
void setGateChannel(int chan);
int getTriggerChannel();
int getGateChannel();
void buttonClicked(Button* button);
void comboBoxChanged(ComboBox* comboBoxThatHasChanged);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment