Skip to content

Commit

Permalink
remove force, change message
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jul 5, 2024
1 parent 89ecce5 commit 2d2b7c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> CMMCore::getInstalledDevices(const char* hubDeviceLabel, bool force) throw (CMMError)
std::vector<std::string> 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.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion MMCore/MMCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ class CMMCore
void setParentLabel(const char* deviceLabel,
const char* parentHubLabel) throw (CMMError);

std::vector<std::string> getInstalledDevices(const char* hubLabel, bool force = false) throw (CMMError);
std::vector<std::string> getInstalledDevices(const char* hubLabel) throw (CMMError);
std::string getInstalledDeviceDescription(const char* hubLabel,
const char* peripheralLabel) throw (CMMError);
std::vector<std::string> getLoadedPeripheralDevices(const char* hubLabel) throw (CMMError);
Expand Down

0 comments on commit 2d2b7c3

Please sign in to comment.