@@ -957,7 +957,7 @@ class W_Networking extends Widget {
957957 // Fix #644 - Remove confusing #Chan textfield from Networking Widget and
958958 // account for this here
959959 private int getDataTypeNumChanLSL (String dataType ) {
960- if (dataType. equals(" TimeSeries " )) {
960+ if (dataType. equals(" TimeSeriesFilt " ) || dataType . equals( " TimeSeriesRaw " )) {
961961 return currentBoard. getNumEXGChannels();
962962 } else if (dataType. equals(" Focus" )) {
963963 return 1 ;
@@ -1383,15 +1383,17 @@ class Stream extends Thread {
13831383 }
13841384
13851385 } else if (this . protocol. equals(" LSL" )) {
1386-
1387- for (int i = 0 ; i < newDataFromBuffer. length; i++ ) {
1388- for (int j = 0 ; j < newDataFromBuffer[i]. length; j++ ) {
1389- dataToSend[j + numExgChannels * i] = newDataFromBuffer[i][j];
1386+ int numChannels = newDataFromBuffer. length;
1387+ int numSamples = newDataFromBuffer[0 ]. length;
1388+ float [] _dataToSend = new float [numChannels * numSamples];
1389+ for (int sample = 0 ; sample < numSamples; sample++ ) {
1390+ for (int channel = 0 ; channel < numChannels; channel++ ) {
1391+ _dataToSend[channel + sample * numChannels] = newDataFromBuffer[channel][sample];
13901392 }
13911393 }
13921394 // From LSLLink Library: The time stamps of other samples are automatically
13931395 // derived based on the sampling rate of the stream.
1394- outlet_data. push_chunk(dataToSend );
1396+ outlet_data. push_chunk(_dataToSend );
13951397
13961398 } else if (this . protocol. equals(" Serial" )) {
13971399
0 commit comments