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

Add some logic for loading and saving PRB files

parent 1d914232
Branches
Tags
No related merge requests found
......@@ -539,11 +539,47 @@ void ChannelMappingEditor::buttonEvent(Button* button)
} else if (button == saveButton)
{
std::cout << "Save button clicked." << std::endl;
//std::cout << "Save button clicked." << std::endl;
if (!acquisitionIsActive)
{
FileChooser fc("Choose the file name...",
File::getCurrentWorkingDirectory(),
"*",
true);
if (fc.browseForFileToSave(true))
{
File fileToSave = fc.getResult();
std::cout << fileToSave.getFileName() << std::endl;
sendActionMessage(writePrbFile(fileToSave));
}
} else {
sendActionMessage("Stop acquisition before saving the channel map.");
}
} else if (button == loadButton)
{
std::cout << "Load button clicked." << std::endl;
//std::cout << "Load button clicked." << std::endl;
if (!acquisitionIsActive)
{
FileChooser fc("Choose a file to load...",
File::getCurrentWorkingDirectory(),
"*",
true);
if (fc.browseForFileToOpen())
{
File fileToOpen = fc.getResult();
std::cout << fileToOpen.getFileName() << std::endl;
sendActionMessage(loadPrbFile(fileToOpen));
}
} else {
sendActionMessage("Stop acquisition before saving the channel map.");
}
}
}
......@@ -898,4 +934,17 @@ void ChannelMappingEditor::startAcquisition()
if (reorderActive)
modifyButton->setToggleState(false,sendNotificationSync);
GenericEditor::startAcquisition();
}
String ChannelMappingEditor::writePrbFile(File filename)
{
return "Saved " + filename.getFileName();
}
String ChannelMappingEditor::loadPrbFile(File filename)
{
return "Loaded " + filename.getFileName();
}
\ No newline at end of file
......@@ -71,6 +71,9 @@ public:
void startAcquisition();
String writePrbFile(File filename);
String loadPrbFile(File filename);
private:
void setChannelReference(ElectrodeButton* button);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment