Skip to content

Commit

Permalink
Start canvas acquisition even if probe is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiegle committed Nov 3, 2024
1 parent a7ef879 commit 2fd82be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/NeuropixCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void NeuropixCanvas::startAcquisition()
{
for (auto settingsInterface : settingsInterfaces)
{
if (settingsInterface->dataSource != nullptr && settingsInterface->dataSource->isEnabled)
if (settingsInterface->dataSource != nullptr)
{
settingsInterface->startAcquisition();
}
Expand All @@ -252,7 +252,7 @@ void NeuropixCanvas::stopAcquisition()
{
for (auto settingsInterface : settingsInterfaces)
{
if (settingsInterface->dataSource != nullptr && settingsInterface->dataSource->isEnabled)
if (settingsInterface->dataSource != nullptr)
{
settingsInterface->stopAcquisition();
}
Expand Down
10 changes: 9 additions & 1 deletion Source/UI/NeuropixInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ void NeuropixInterface::setAnnotationLabel (String s, Colour c)

void NeuropixInterface::buttonClicked (Button* button)
{
if (button == probeEnableButton.get())

if (button == probeEnableButton.get() && !acquisitionIsActive)
{
probe->isEnabled = probeEnableButton->getToggleState();

Expand Down Expand Up @@ -1130,12 +1131,16 @@ void NeuropixInterface::selectElectrodes (Array<int> electrodes)

void NeuropixInterface::startAcquisition()
{

bool enabledState = false;
acquisitionIsActive = true;

if (enableButton != nullptr)
enableButton->setEnabled (enabledState);

if (probeEnableButton != nullptr)
probeEnableButton->setEnabled (enabledState);

if (electrodeConfigurationComboBox != nullptr)
electrodeConfigurationComboBox->setEnabled (enabledState);

Expand Down Expand Up @@ -1199,6 +1204,9 @@ void NeuropixInterface::stopAcquisition()
if (enableButton != nullptr)
enableButton->setEnabled (enabledState);

if (probeEnableButton != nullptr)
probeEnableButton->setEnabled (enabledState);

if (electrodeConfigurationComboBox != nullptr)
electrodeConfigurationComboBox->setEnabled (enabledState);

Expand Down

0 comments on commit 2fd82be

Please sign in to comment.