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

Finish migrating spike recording code to SpikeDisplayNode

parent 58abce3c
Branches
Tags
No related merge requests found
......@@ -339,48 +339,48 @@ void SpikeDisplayNode::openFile(int i)
diskWriteLock->enter();
//const MessageManagerLock mmLock;
Electrode& e = electrodes.getReference(i);
FILE* file;
if (!fileToUse.exists())
{
// open it and write header
file = fopen(filename.toUTF8(), "ab");
String header = generateHeader(i);
fwrite(header.toUTF8(), 1, header.getNumBytesAsUTF8(), file);
}
else
{
// append it
file = fopen(filename.toUTF8(), "ab");
}
diskWriteLock->exit();
//files.add(file);
e.file = file;
}
void SpikeDisplayNode::closeFile(int i)
{
//std::cout << "CLOSING FILE: " << filename << std::endl;
// const MessageManagerLock mmLock;
Electrode& e = electrodes.getReference(i);
std::cout << "CLOSING FILE for " << e.name << std::endl;
diskWriteLock->enter();
// if (files[i] != NULL)
// {
// fclose(file);
// }
if (e.file != NULL)
{
fclose(e.file);
}
diskWriteLock->exit();
}
void SpikeDisplayNode::writeSpike(const SpikeObject& s, int electrodeIndex)
void SpikeDisplayNode::writeSpike(const SpikeObject& s, int i)
{
packSpike(&s, spikeBuffer, MAX_SPIKE_BUFFER_LEN);
......@@ -404,8 +404,7 @@ void SpikeDisplayNode::writeSpike(const SpikeObject& s, int electrodeIndex)
diskWriteLock->enter();
// fwrite(spikeBuffer, 1, totalBytes, files[fileIndex]);
fwrite(spikeBuffer, 1, totalBytes, electrodes[i].file);
diskWriteLock->exit();
......
......@@ -611,7 +611,7 @@ float SpikePlot::getDisplayThresholdForChannel(int i)
void SpikePlot::setDetectorThresholdForChannel(int i, float t)
{
std::cout << "Setting threshold to " << t << std::endl;
// std::cout << "Setting threshold to " << t << std::endl;
wAxes[i]->setDetectorThreshold(t);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment