@@ -328,14 +328,8 @@ void LfpDisplayNode::acknowledgeTrigger(int id)
328328 latestTrigger.set (id, -1 );
329329}
330330
331- String LfpDisplayNode::handleConfigMessage (String msg) {
332- std::cout << " in lfp config: " << msg <<std::endl;
333- }
334-
335331void LfpDisplayNode::handleBroadcastMessage (String msg) {
336332 DynamicObject::Ptr jsonMessage = JSON::parse (msg).getDynamicObject ();
337- std::cout<< msg<< std::endl;
338- StringArray parts = StringArray::fromTokens (msg, " ;" , " " );
339333 String pluginName= jsonMessage -> getProperty (" plugin" );
340334 if (pluginName != " LFPViewer" ) {
341335 return ;
@@ -346,17 +340,22 @@ void LfpDisplayNode::handleBroadcastMessage(String msg) {
346340 if (payload.get () == nullptr )
347341 return ;
348342 int streamID = payload -> getProperty (" streamID" );
349- var indexes = payload -> getProperty (" indexes" );
350- if (streamID < 0 || indexes.size () == 0 ){
343+ int start = payload -> getProperty (" start" );
344+ int rows = payload -> getProperty (" rows" );
345+ int cols = payload -> getProperty (" cols" );
346+ int colsPerRow = payload -> getProperty (" colsPerRow" );
347+ if (streamID < 0 || start < 0 || rows < 0 || cols < 0 || colsPerRow < 0 ){
351348 return ;
352349 }
353350 StringArray channelNames;
354- for (int i = 0 ; i < indexes.size (); i++) {
355- channelNames.add (" CH" +String (indexes[i]));
351+ for (int row = 0 ; row < rows; row++) {
352+ for (int col = 0 ; col < cols; col++) {
353+ channelNames.add (" CH" +String (start + col + row*colsPerRow));
354+ }
356355 }
357356 displayBufferMap[streamID] -> setFilteredChannels (channelNames);
358357 for (auto split : splitDisplays) {
359- split -> shouldRebuildChannelList = true ;
358+ split -> shouldRebuildChannelList = split-> displayBuffer -> id == streamID ;
360359 }
361360
362361 }
0 commit comments