From 937a8c7705a837482ded52c79ecfc69085f0e983 Mon Sep 17 00:00:00 2001 From: Aaron Cuevas Lopez <aacuelo@teleco.upv.es> Date: Fri, 15 Apr 2016 00:40:49 +0200 Subject: [PATCH] Save sample rates as a dataset instead of an array attribute --- .../Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.cpp | 9 ++++++++- .../Processors/DataThreads/RhythmNode/RHD2000Thread.cpp | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.cpp b/Source/Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.cpp index ce0c8638a..76e3387e8 100644 --- a/Source/Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.cpp +++ b/Source/Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.cpp @@ -668,6 +668,7 @@ void KWDFile::startNewRecording(int recordingNumber, int nChannels, HDF5Recordin uint8 mSample = info->multiSample ? 1 : 0; ScopedPointer<HDF5RecordingData> bitVoltsSet; + ScopedPointer<HDF5RecordingData> sampleRateSet; String recordPath = String("/recordings/")+String(recordingNumber); CHECK_ERROR(createGroup(recordPath)); @@ -685,7 +686,13 @@ void KWDFile::startNewRecording(int recordingNumber, int nChannels, HDF5Recordin std::cerr << "Error creating bitvolts data set" << std::endl; CHECK_ERROR(setAttribute(U8,&mSample,recordPath+"/application_data",String("is_multiSampleRate_data"))); - CHECK_ERROR(setAttributeArray(F32,info->channelSampleRates.getRawDataPointer(),info->channelSampleRates.size(),recordPath+"/application_data",String("channel_sample_rates"))); + //CHECK_ERROR(setAttributeArray(F32,info->channelSampleRates.getRawDataPointer(),info->channelSampleRates.size(),recordPath+"/application_data",String("channel_sample_rates"))); + sampleRateSet = createDataSet(F32, info->channelSampleRates.size(), 0, recordPath + "/application_data/channel_sample_rates"); + if (sampleRateSet.get()) + sampleRateSet->writeDataBlock(info->channelSampleRates.size(), F32, info->channelSampleRates.getRawDataPointer()); + else + std::cerr << "Error creating sample rates data set" << std::endl; + recdata = createDataSet(I16,0,nChannels,CHUNK_XSIZE,recordPath+"/data"); if (!recdata.get()) std::cerr << "Error creating data set" << std::endl; diff --git a/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp b/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp index b73e8a067..629dce123 100644 --- a/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp +++ b/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp @@ -44,8 +44,8 @@ #define REGISTER_59_MISO_B 58 #define RHD2132_16CH_OFFSET 8 -#define DEBUG_EMULATE_HEADSTAGES 8 -#define DEBUG_EMULATE_64CH +//#define DEBUG_EMULATE_HEADSTAGES 8 +//#define DEBUG_EMULATE_64CH #define INIT_STEP ( evalBoard->isUSB3() ? 256 : 60) -- GitLab