diff --git a/MMCore/LoadableModules/LoadedDeviceAdapter.cpp b/MMCore/LoadableModules/LoadedDeviceAdapter.cpp index 7e090a7b2..1dd68e363 100644 --- a/MMCore/LoadableModules/LoadedDeviceAdapter.cpp +++ b/MMCore/LoadableModules/LoadedDeviceAdapter.cpp @@ -185,8 +185,10 @@ LoadedDeviceAdapter::LoadDevice(CMMCore* core, const std::string& name, return std::make_shared(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger); case MM::HubDevice: return std::make_shared(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger); - case MM::PumpDevice: - return std::make_shared(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger); + case MM::PressurePumpDevice: + return std::make_shared(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger); + case MM::VolumetricPumpDevice: + return std::make_shared(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger); default: deleter(pDevice); throw CMMError("Device " + ToQuotedString(name) + diff --git a/MMCore/MMCore.cpp b/MMCore/MMCore.cpp index 4f491fa2a..576fbd93e 100644 --- a/MMCore/MMCore.cpp +++ b/MMCore/MMCore.cpp @@ -6262,214 +6262,6 @@ void CMMCore::setPumpDevice(const char* deviceLabel) throw (CMMError) } } -/** -* Homes the pump -*/ -void CMMCore::PumpHome(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->Home(); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - -/** -* Stops the pump -*/ -void CMMCore::PumpStop(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->Stop(); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - -/** -* Sets whether the pump direction needs to be inverted -*/ -void CMMCore::invertPumpDirection(const char* deviceLabel, bool invert) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->invertDirection(invert); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - -/** -* Gets whether the pump direction needs to be inverted -*/ -bool CMMCore::isPumpDirectionInverted(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - bool invert = false; - int ret = pPump->isDirectionInverted(invert); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } - return invert; -} - -/** -* Sets the volume of fluid in the pump in uL. Note it does not withdraw upto -* this amount. It is merely to inform MM of the volume in a prefilled pump. -*/ -void CMMCore::setPumpVolume(const char* deviceLabel, double volUl) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->setVolumeUl(volUl); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - -/** -* Get the fluid volume in the pump in uL -*/ -double CMMCore::getPumpVolume(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - double volUl = 0; - int ret = pPump->getVolumeUl(volUl); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } - return volUl; -} - -/** -* Sets the max volume of the pump in uL -*/ -void CMMCore::setPumpMaxVolume(const char* deviceLabel, double volUl) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->setMaxVolumeUl(volUl); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - -/** -* Gets the max volume of the pump in uL -*/ -double CMMCore::getPumpMaxVolume(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - double volUl = 0; - int ret = pPump->getMaxVolumeUl(volUl); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } - return volUl; -} - -/** -* Sets the flowrate of the pump in uL per second -*/ -void CMMCore::setPumpFlowrate(const char* deviceLabel, double UlperSec) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->setFlowrateUlPerSec(UlperSec); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - -/** -* Gets the flowrate of the pump in uL per second -*/ -double CMMCore::getPumpFlowrate(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - double UlperSec = 0; - int ret = pPump->getFlowrateUlPerSec(UlperSec); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } - return UlperSec; -} - -/** -* Start dispensing at the set flowrate until syringe is empty, or manually -* stopped (whichever occurs first). -*/ -void CMMCore::PumpDispense(const char* deviceLabel) throw (CMMError) -{ - std::shared_ptr pPump = - deviceManager_->GetDeviceOfType(deviceLabel); - mm::DeviceModuleLockGuard guard(pPump); - - int ret = pPump->Dispense(); - - if (ret != DEVICE_OK) - { - logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str()); - throw CMMError(getDeviceErrorText(ret, pPump)); - } -} - /////////////////////////////////////////////////////////////////////////////// // Pressure Pump methods /////////////////////////////////////////////////////////////////////////////// diff --git a/MMCore/MMCore.h b/MMCore/MMCore.h index 140fc018d..e7eec7e70 100644 --- a/MMCore/MMCore.h +++ b/MMCore/MMCore.h @@ -582,29 +582,6 @@ class CMMCore std::vector imageSequence) throw (CMMError); ///@} - /** \name Pump control. - * - * Control of pump devices - */ - ///@{ - void PumpHome(const char* pumpLabel) throw (CMMError); - void PumpStop(const char* pumpLabel) throw (CMMError); - void invertPumpDirection(const char* pumpLabel, bool invert) throw (CMMError); - bool isPumpDirectionInverted(const char* pumpLabel) throw (CMMError); - void setPumpVolume(const char* pumpLabel, double volume) throw (CMMError); - double getPumpVolume(const char* pumpLabel) throw (CMMError); - void setPumpMaxVolume(const char* pumpLabel, double volume) throw (CMMError); - double getPumpMaxVolume(const char* pumpLabel) throw (CMMError); - void setPumpFlowrate(const char* pumpLabel, double volume) throw (CMMError); - double getPumpFlowrate(const char* pumpLabel) throw (CMMError); - void PumpDispense(const char* pumpLabel) throw (CMMError); - void PumpDispenseDuration(const char* pumpLabel, double seconds) throw (CMMError); - void PumpDispenseVolume(const char* pumpLabel, double microLiter) throw (CMMError); - void PumpCalibrate(const char* pumpLabel) throw (CMMError); - void setPumpPressure(const char* pumplabel, double pressure) throw (CMMError); - double getPumpPressure(const char* pumplabel) throw (CMMError); - ///@} - /** \name Galvo control. * * Control of beam-steering devices. diff --git a/micromanager.sln b/micromanager.sln index d69eacc52..0d6175b14 100644 --- a/micromanager.sln +++ b/micromanager.sln @@ -492,7 +492,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DahengGalaxy", "DeviceAdapt EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PyDevice", "DeviceAdapters\PyDevice\PyDevice.vcxproj", "{36CF524A-8214-404C-8E6B-B5DEC1FDADF9}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HikRobot", "DeviceAdapters\HikRobot\HikRobot.vcxproj", "{38DCD378-83FE-4C42-8916-1C477A35F65F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hikrobot", "DeviceAdapters\HikRobot\HikRobot.vcxproj", "{38DCD378-83FE-4C42-8916-1C477A35F65F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fluigent", "DeviceAdapters\Fluigent\Fluigent.vcxproj", "{4F22D447-EDC6-4766-A750-A5781276040A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1476,14 +1478,18 @@ Global {DD3A2820-F54C-42F3-AA0E-DC95D57481B7}.Debug|x64.Build.0 = Debug|x64 {DD3A2820-F54C-42F3-AA0E-DC95D57481B7}.Release|x64.ActiveCfg = Release|x64 {DD3A2820-F54C-42F3-AA0E-DC95D57481B7}.Release|x64.Build.0 = Release|x64 - {38DCD378-83FE-4C42-8916-1C477A35F65F}.Debug|x64.ActiveCfg = Debug|x64 - {38DCD378-83FE-4C42-8916-1C477A35F65F}.Debug|x64.Build.0 = Debug|x64 - {38DCD378-83FE-4C42-8916-1C477A35F65F}.Release|x64.ActiveCfg = Release|x64 - {38DCD378-83FE-4C42-8916-1C477A35F65F}.Release|x64.Build.0 = Release|x64 {36CF524A-8214-404C-8E6B-B5DEC1FDADF9}.Debug|x64.ActiveCfg = Debug|x64 {36CF524A-8214-404C-8E6B-B5DEC1FDADF9}.Debug|x64.Build.0 = Debug|x64 {36CF524A-8214-404C-8E6B-B5DEC1FDADF9}.Release|x64.ActiveCfg = Release|x64 {36CF524A-8214-404C-8E6B-B5DEC1FDADF9}.Release|x64.Build.0 = Release|x64 + {38DCD378-83FE-4C42-8916-1C477A35F65F}.Debug|x64.ActiveCfg = Debug|x64 + {38DCD378-83FE-4C42-8916-1C477A35F65F}.Debug|x64.Build.0 = Debug|x64 + {38DCD378-83FE-4C42-8916-1C477A35F65F}.Release|x64.ActiveCfg = Release|x64 + {38DCD378-83FE-4C42-8916-1C477A35F65F}.Release|x64.Build.0 = Release|x64 + {4F22D447-EDC6-4766-A750-A5781276040A}.Debug|x64.ActiveCfg = Debug|x64 + {4F22D447-EDC6-4766-A750-A5781276040A}.Debug|x64.Build.0 = Debug|x64 + {4F22D447-EDC6-4766-A750-A5781276040A}.Release|x64.ActiveCfg = Release|x64 + {4F22D447-EDC6-4766-A750-A5781276040A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE