diff --git a/Source/NeuropixCanvas.cpp b/Source/NeuropixCanvas.cpp index fd72901..d2db588 100644 --- a/Source/NeuropixCanvas.cpp +++ b/Source/NeuropixCanvas.cpp @@ -241,7 +241,7 @@ void NeuropixCanvas::startAcquisition() { for (auto settingsInterface : settingsInterfaces) { - if (settingsInterface->dataSource != nullptr && settingsInterface->dataSource->isEnabled) + if (settingsInterface->dataSource != nullptr) { settingsInterface->startAcquisition(); } @@ -252,7 +252,7 @@ void NeuropixCanvas::stopAcquisition() { for (auto settingsInterface : settingsInterfaces) { - if (settingsInterface->dataSource != nullptr && settingsInterface->dataSource->isEnabled) + if (settingsInterface->dataSource != nullptr) { settingsInterface->stopAcquisition(); } diff --git a/Source/UI/NeuropixInterface.cpp b/Source/UI/NeuropixInterface.cpp index eb979ad..c19f2c7 100644 --- a/Source/UI/NeuropixInterface.cpp +++ b/Source/UI/NeuropixInterface.cpp @@ -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(); @@ -1130,12 +1131,16 @@ void NeuropixInterface::selectElectrodes (Array 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); @@ -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);