Skip to content

Commit 7810359

Browse files
committed
Add processor to empty signal chain via HTTP
1 parent d20920f commit 7810359

1 file changed

Lines changed: 11 additions & 24 deletions

File tree

Source/Utils/OpenEphysHttpServer.h

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -605,20 +605,13 @@ class OpenEphysHttpServer : juce::Thread {
605605

606606
int sourceNodeId = 0;
607607
int destNodeId = 0;
608-
if (!request_json.contains("source_id") && !request_json.contains("dest_id")) {
609-
LOGD( "No 'source_id' or 'dest_id' element found." );
610-
res.set_content("Request must contain source or destination processor node id.", "text/plain");
611-
res.status = 400;
612-
return;
613-
}
614-
else {
615-
if(request_json.contains("source_id"))
616-
sourceNodeId = request_json["source_id"];
617-
else
618-
destNodeId = request_json["dest_id"];
619608

620-
LOGD( "Found a source/dest node id." );
621-
}
609+
if(request_json.contains("source_id"))
610+
sourceNodeId = request_json["source_id"];
611+
else if (request_json.contains("dest_id"))
612+
destNodeId = request_json["dest_id"];
613+
614+
LOGD( "Found a source/dest node id." );
622615

623616

624617
auto listOfProc = AccessClass::getProcessorList()->getItemList();
@@ -662,18 +655,12 @@ class OpenEphysHttpServer : juce::Thread {
662655
destProcessor = sourceProcessor->getDestNode();
663656
}
664657

665-
if (sourceProcessor == nullptr && destProcessor == nullptr)
666-
{
667-
return_msg = "Neither source node ID nor dest node ID could be found.";
668-
}
669-
else {
670-
const MessageManagerLock mml;
671-
graph_->createProcessor(description,
672-
sourceProcessor,
673-
destProcessor);
658+
const MessageManagerLock mml;
659+
graph_->createProcessor(description,
660+
sourceProcessor,
661+
destProcessor);
674662

675-
return_msg = procName + " added successfully";
676-
}
663+
return_msg = procName + " added successfully";
677664

678665
} else {
679666
return_msg = "Cannot add processors while acquisition is active.";

0 commit comments

Comments
 (0)