diff --git a/MMCore/MMCore.cpp b/MMCore/MMCore.cpp index eb3cddb0e..92e810d3c 100644 --- a/MMCore/MMCore.cpp +++ b/MMCore/MMCore.cpp @@ -7526,18 +7526,16 @@ MM::DeviceDetectionStatus CMMCore::detectDevice(const char* label) * device. Doing otherwise results in undefined behavior. This function was * intended for use during initial configuration, not routine loading of * devices. These restrictions may be relaxed in the future if possible. + * + * Throws an exception if the hub device is not initialized. * * @param hubDeviceLabel the label for the device of type Hub */ -std::vector CMMCore::getInstalledDevices(const char* hubDeviceLabel, bool force) throw (CMMError) +std::vector CMMCore::getInstalledDevices(const char* hubDeviceLabel) throw (CMMError) { - if (isFeatureEnabled("StrictInitializationChecks") && !force) { - DeviceInitializationState initState = getDeviceInitializationState(hubDeviceLabel); - if (initState == DeviceInitializationState::Uninitialized) { - throw CMMError("Device " + ToQuotedString(hubDeviceLabel) + - " is not yet initialized, and you may only call this method once. " + - "This may not be what you want to do. " - "Use force=true to call it anyway."); + if (isFeatureEnabled("StrictInitializationChecks")) { + if (getDeviceInitializationState(hubDeviceLabel) == DeviceInitializationState::Uninitialized) { + throw CMMError("Device " + ToQuotedString(hubDeviceLabel) + " is not yet initialized."); } } diff --git a/MMCore/MMCore.h b/MMCore/MMCore.h index a2344bcbf..d06d86013 100644 --- a/MMCore/MMCore.h +++ b/MMCore/MMCore.h @@ -619,7 +619,7 @@ class CMMCore void setParentLabel(const char* deviceLabel, const char* parentHubLabel) throw (CMMError); - std::vector getInstalledDevices(const char* hubLabel, bool force = false) throw (CMMError); + std::vector getInstalledDevices(const char* hubLabel) throw (CMMError); std::string getInstalledDeviceDescription(const char* hubLabel, const char* peripheralLabel) throw (CMMError); std::vector getLoadedPeripheralDevices(const char* hubLabel) throw (CMMError);