From 33714913ce724817d758cf306d023e085eb1efd7 Mon Sep 17 00:00:00 2001 From: jsiegle <jsiegle@mit.edu> Date: Thu, 19 Apr 2012 11:28:44 -0400 Subject: [PATCH] Reorganizing FPGAThread to parallel IntanThread --- Source/Processors/DataThreads/DataThread.cpp | 2 +- Source/Processors/DataThreads/DataThread.h | 2 +- Source/Processors/DataThreads/FPGAThread.cpp | 2 -- Source/Processors/DataThreads/FPGAThread.h | 19 ++++++++++--------- .../DataThreads/FileReaderThread.cpp | 2 +- Source/Processors/DataThreads/IntanThread.cpp | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Source/Processors/DataThreads/DataThread.cpp b/Source/Processors/DataThreads/DataThread.cpp index 034d66ac9..a3033780c 100644 --- a/Source/Processors/DataThreads/DataThread.cpp +++ b/Source/Processors/DataThreads/DataThread.cpp @@ -33,7 +33,7 @@ DataThread::DataThread(SourceNode* s) : Thread ("Data Thread"), dataBuffer(0) DataThread::~DataThread() { - deleteAndZero(dataBuffer); + //deleteAndZero(dataBuffer); } void DataThread::run() { diff --git a/Source/Processors/DataThreads/DataThread.h b/Source/Processors/DataThreads/DataThread.h index 001bb8e5f..0ab79ba6b 100644 --- a/Source/Processors/DataThreads/DataThread.h +++ b/Source/Processors/DataThreads/DataThread.h @@ -54,7 +54,7 @@ public: virtual bool updateBuffer() = 0; - DataBuffer* dataBuffer; + ScopedPointer<DataBuffer> dataBuffer; virtual bool foundInputSource() = 0; virtual bool startAcquisition() = 0; diff --git a/Source/Processors/DataThreads/FPGAThread.cpp b/Source/Processors/DataThreads/FPGAThread.cpp index f7f45df00..34fb9995d 100644 --- a/Source/Processors/DataThreads/FPGAThread.cpp +++ b/Source/Processors/DataThreads/FPGAThread.cpp @@ -72,8 +72,6 @@ FPGAThread::~FPGAThread() { std::cout << "FPGA interface destroyed." << std::endl; - // probably not the best way to do this: - deleteAndZero(dataBuffer); deleteAndZero(dev); } diff --git a/Source/Processors/DataThreads/FPGAThread.h b/Source/Processors/DataThreads/FPGAThread.h index 810ee5f5a..7bc294011 100644 --- a/Source/Processors/DataThreads/FPGAThread.h +++ b/Source/Processors/DataThreads/FPGAThread.h @@ -37,8 +37,6 @@ /** - --UNDER CONSTRUCTION-- - Communicates with the custom acquisition board via an Opal Kelly FPGA. @see DataThread, SourceNode @@ -54,11 +52,9 @@ public: FPGAThread(SourceNode* sn); ~FPGAThread(); - bool foundInputSource() {return true;} - bool startAcquisition(); - bool stopAcquisition(); - int getNumChannels() {return 32;} - float getSampleRate() {return 25000.0;} + bool foundInputSource(); // {return true;} + int getNumChannels();// {return 32;} + float getSampleRate();// {return 25000.0;} private: @@ -67,6 +63,12 @@ private: char dll_date[32], dll_time[32]; UINT32 i; + bool initializeFPGA(okCFrontPanel*, char*); + bool closeFPGA(); + + bool startAcquisition(); + bool stopAcquisition(); + int m_u32SegmentSize; unsigned char pBuffer[50000]; // request a 1MB block of data @@ -79,8 +81,7 @@ private: int Ndatabytes; bool updateBuffer(); - bool initializeFPGA(okCFrontPanel*, char*); - + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FPGAThread); }; diff --git a/Source/Processors/DataThreads/FileReaderThread.cpp b/Source/Processors/DataThreads/FileReaderThread.cpp index f7f1aa4ee..242093003 100644 --- a/Source/Processors/DataThreads/FileReaderThread.cpp +++ b/Source/Processors/DataThreads/FileReaderThread.cpp @@ -45,7 +45,7 @@ FileReaderThread::~FileReaderThread() { deleteAndZero(input); - deleteAndZero(dataBuffer); + //deleteAndZero(dataBuffer); } diff --git a/Source/Processors/DataThreads/IntanThread.cpp b/Source/Processors/DataThreads/IntanThread.cpp index 6a1c88c13..d43babe9b 100644 --- a/Source/Processors/DataThreads/IntanThread.cpp +++ b/Source/Processors/DataThreads/IntanThread.cpp @@ -43,7 +43,7 @@ IntanThread::IntanThread(SourceNode* sn) : DataThread(sn), IntanThread::~IntanThread() { //closeUSB(); - deleteAndZero(dataBuffer); + //deleteAndZero(dataBuffer); } int IntanThread::getNumChannels() -- GitLab