From 6c19f8109fed01d3dc9697fbaeeefaa47462ca43 Mon Sep 17 00:00:00 2001 From: Lars Kool Date: Fri, 23 Aug 2024 10:55:02 +0200 Subject: [PATCH] Squashed commits and fixed bug with setPumpPressure --- MMCore/MMCore.cpp | 49 ++++++----------------------------- MMCore/MMCore.vcxproj.filters | 6 ----- 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/MMCore/MMCore.cpp b/MMCore/MMCore.cpp index 623f53546..09168bc26 100644 --- a/MMCore/MMCore.cpp +++ b/MMCore/MMCore.cpp @@ -6278,39 +6278,6 @@ void CMMCore::setPressurePumpDevice(const char* deviceLabel) throw (CMMError) } } -/** - * Sets the current pump device. - * @param pump the shutter device label - */ -void CMMCore::setPressurePumpDevice(const char* deviceLabel) throw (CMMError) -{ - if (!deviceLabel || strlen(deviceLabel) > 0) // Allow empty label - CheckDeviceLabel(deviceLabel); - - // Nothing to do if this is the current shutter device: - if (getPressurePumpDevice().compare(deviceLabel) == 0) - return; - - if (strlen(deviceLabel) > 0) - { - currentPressurePump_ = - deviceManager_->GetDeviceOfType(deviceLabel); - - LOG_INFO(coreLogger_) << "Default shutter set to " << deviceLabel; - } - else - { - currentPressurePump_.reset(); - LOG_INFO(coreLogger_) << "Default pump unset"; - } - properties_->Refresh(); // TODO: more efficient - std::string newPumpLabel = getPressurePumpDevice(); - { - MMThreadGuard scg(stateCacheLock_); - stateCache_.addSetting(PropertySetting(MM::g_Keyword_CoreDevice, MM::g_Keyword_CorePressurePump, newPumpLabel.c_str())); - } -} - /** * Stops the pressure pump */ @@ -6360,41 +6327,41 @@ bool CMMCore::PressurePumpRequiresCalibration(const char* deviceLabel) throw (CM } /** -* Sets the pressure of the pump in kPa +* Gets the pressure of the pump in kPa */ -void CMMCore::setPumpPressure(const char* deviceLabel, double pressurekPa) throw (CMMError) +double CMMCore::getPumpPressure(const char* deviceLabel) throw (CMMError) { std::shared_ptr pPump = deviceManager_->GetDeviceOfType(deviceLabel); mm::DeviceModuleLockGuard guard(pPump); - int ret = pPump->setPressure(pressurekPa); + double pressurekPa = 0; + int ret = pPump->getPressure(pressurekPa); if (ret != DEVICE_OK) { logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); throw CMMError(getDeviceErrorText(ret, pPump)); } + return pressurekPa; } /** -* Gets the pressure of the pump in kPa +* Sets the pressure of the pump in kPa */ -double CMMCore::getPumpPressure(const char* deviceLabel) throw (CMMError) +void CMMCore::setPumpPressure(const char* deviceLabel, double pressurekPa) throw (CMMError) { std::shared_ptr pPump = deviceManager_->GetDeviceOfType(deviceLabel); mm::DeviceModuleLockGuard guard(pPump); - double pressurekPa = 0; - int ret = pPump->getPressure(pressurekPa); + int ret = pPump->setPressure(pressurekPa); if (ret != DEVICE_OK) { logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); throw CMMError(getDeviceErrorText(ret, pPump)); } - return pressurekPa; } /////////////////////////////////////////////////////////////////////////////// diff --git a/MMCore/MMCore.vcxproj.filters b/MMCore/MMCore.vcxproj.filters index 50f2a3f7d..2e6fb9bea 100644 --- a/MMCore/MMCore.vcxproj.filters +++ b/MMCore/MMCore.vcxproj.filters @@ -147,12 +147,6 @@ Source Files\Devices - - Source Files\Devices - - - Source Files\Devices -