Skip to content

Commit

Permalink
Merge pull request #404 from micro-manager/relax-setting-preinit-prop…
Browse files Browse the repository at this point in the history
…erty-post-init

Relax check against setting a pre-init property after initialization
  • Loading branch information
marktsuchida authored Nov 10, 2023
2 parents b4b174c + 6e34450 commit d83430d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions MMCore/Devices/DeviceInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,20 @@ void
DeviceInstance::SetProperty(const std::string& name,
const std::string& value) const
{
if (initialized_ && GetPropertyInitStatus(name.c_str()))
ThrowError("Cannot set pre-init property after initialization");
if (initialized_ && GetPropertyInitStatus(name.c_str())) {
// Note: Some features (port scanning) may depend on setting serial port
// properties post-init. We may want to exclude SerialManager from this
// check (regardless of whether strictInitializationChecks is enabled).
if (mm::features::flags().strictInitializationChecks)
{
ThrowError("Cannot set pre-init property after initialization");
}
else
{
LOG_WARNING(Logger()) << "Setting of pre-init property (" << name <<
") not permitted on initialized device (this will be an error in a future version of MMCore; for now we continue with the operation anyway, even though it might not be safe)";
}
}

LOG_DEBUG(Logger()) << "Will set property \"" << name << "\" to \"" <<
value << "\"";
Expand Down
2 changes: 1 addition & 1 deletion MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ using namespace std;
* (Keep the 3 numbers on one line to make it easier to look at diffs when
* merging/rebasing.)
*/
const int MMCore_versionMajor = 11, MMCore_versionMinor = 1, MMCore_versionPatch = 0;
const int MMCore_versionMajor = 11, MMCore_versionMinor = 1, MMCore_versionPatch = 1;


///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion MMCoreJ_wrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>org.micro-manager.mmcorej</groupId>
<artifactId>MMCoreJ</artifactId>
<packaging>jar</packaging>
<version>11.1.0</version>
<version>11.1.1</version>
<name>Micro-Manager Java Interface to MMCore</name>
<description>Micro-Manager is open source software for control of automated/motorized microscopes. This specific packages provides the Java interface to the device abstractino layer (MMCore) that is written in C++ with a C-interface</description>
<url>http://micro-manager.org</url>
Expand Down

0 comments on commit d83430d

Please sign in to comment.