@@ -59,7 +59,7 @@ void BinaryRecording::openFiles(File rootFolder, int experimentNumber, int recor
5959 Array<unsigned int > indexedChannelCount;
6060 Array<var> jsonContinuousfiles;
6161 Array<var> jsonChannels;
62-
62+ StringArray continuousFileNames;
6363 int lastId = 0 ;
6464 for (int proc = 0 ; proc < nProcessors; proc++)
6565 {
@@ -100,11 +100,8 @@ void BinaryRecording::openFiles(File rootFolder, int experimentNumber, int recor
100100 {
101101 String datPath (contPath + channelInfo->getCurrentNodeName () + " _(" + String (channelInfo->getCurrentNodeID ()) + " )" + File::separatorString);
102102 String datFileName (channelInfo->getSourceName () + " _(" + String (sourceId) + " ." + String (sourceSubIdx) + " )" );
103- ScopedPointer<SequentialBlockFile> bFile = new SequentialBlockFile (pInfo.recordedChannels .size (), samplesPerBlock);
104- if (bFile->openFile (datPath + datFileName + " .dat" ))
105- m_DataFiles.add (bFile.release ());
106- else
107- m_DataFiles.add (nullptr );
103+ continuousFileNames.add (datPath + datFileName + " .dat" );
104+
108105 Array<NpyType> tstypes;
109106 tstypes.add (NpyType (" Timestamp" , BaseType::INT64, 1 ));
110107
@@ -129,12 +126,17 @@ void BinaryRecording::openFiles(File rootFolder, int experimentNumber, int recor
129126 }
130127 lastId = indexedDataChannels.size ();
131128 }
132- int nFiles = jsonContinuousfiles .size ();
129+ int nFiles = continuousFileNames .size ();
133130 for (int i = 0 ; i < nFiles; i++)
134131 {
135- int size = jsonChannels.getReference (i).size ();
132+ int numChannels = jsonChannels.getReference (i).size ();
133+ ScopedPointer<SequentialBlockFile> bFile = new SequentialBlockFile (numChannels, samplesPerBlock);
134+ if (bFile->openFile (continuousFileNames[i]))
135+ m_DataFiles.add (bFile.release ());
136+ else
137+ m_DataFiles.add (nullptr );
136138 DynamicObject::Ptr jsonFile = jsonContinuousfiles.getReference (i).getDynamicObject ();
137- jsonFile->setProperty (" num_channels" , size );
139+ jsonFile->setProperty (" num_channels" , numChannels );
138140 jsonFile->setProperty (" channels" , jsonChannels.getReference (i));
139141 }
140142
0 commit comments