Skip to content

Commit c65db66

Browse files
committed
Disallow record toggling when acquisition is active
1 parent bf72baf commit c65db66

4 files changed

Lines changed: 6 additions & 33 deletions

File tree

Builds/VisualStudio2013/open-ephys.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ Global
3232
GlobalSection(SolutionProperties) = preSolution
3333
HideSolutionNode = FALSE
3434
EndGlobalSection
35+
GlobalSection(Performance) = preSolution
36+
HasPerformanceSessions = true
37+
EndGlobalSection
3538
EndGlobal

Source/Processors/Editors/ChannelSelector.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ void ChannelSelector::buttonClicked(Button* button)
671671
}
672672
else if (b->getType() == RECORD)
673673
{
674+
674675
// get record node, and inform it of the change
675676
GenericEditor* editor = (GenericEditor*)getParentComponent();
676677

@@ -680,15 +681,8 @@ void ChannelSelector::buttonClicked(Button* button)
680681

681682
if (acquisitionIsActive) // use setParameter to change parameter safely
682683
{
683-
if ( AccessClass::getProcessorGraph()->
684-
getRecordNode()->
685-
setChannelStatus(ch, status) )
686-
{
687-
const_cast<DataChannel*>(ch)->setRecordState(status);
688-
}
689-
690-
// make sure that the button matches the system's actual state, in case
691-
// user's interaction was disallowed
684+
685+
// disable toggling when acquisition is active
692686
b->setToggleState(const_cast<DataChannel*>(ch)->getRecordState(), dontSendNotification);
693687
}
694688
else // change parameter directly

Source/Processors/RecordNode/RecordNode.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,6 @@ void RecordNode::setChannel(const DataChannel* ch)
7777

7878
}
7979

80-
bool RecordNode::setChannelStatus(const DataChannel* ch, bool status)
81-
{
82-
83-
//std::cout << "Setting channel status!" << std::endl;
84-
setChannel(ch);
85-
86-
if (status)
87-
setParameter(2, 1.0f);
88-
else
89-
setParameter(2, 0.0f);
90-
91-
return status == dataChannelArray[currentChannel]->getRecordState();
92-
}
93-
94-
9580
void RecordNode::resetConnections()
9681
{
9782
nextAvailableChannel = 0;

Source/Processors/RecordNode/RecordNode.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,6 @@ class RecordNode : public GenericProcessor,
103103
*/
104104
void setChannel(const DataChannel* ch);
105105

106-
/** Turns recording on and off for a particular channel.
107-
108-
Channel numbers are absolute (based on RecordNode channel mapping).
109-
110-
Returns a bool indicating whether the status update was successful (true)
111-
or blocked (false) because recording is currently in progress.
112-
*/
113-
bool setChannelStatus(const DataChannel* ch, bool status);
114-
115106
/** Used to clear all connections prior to the start of acquisition.
116107
*/
117108
void resetConnections();

0 commit comments

Comments
 (0)