Skip to content

Commit

Permalink
fixed bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-Kool committed Jun 24, 2024
1 parent ebd65a1 commit 360c9b2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 238 deletions.
6 changes: 4 additions & 2 deletions MMCore/LoadableModules/LoadedDeviceAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ LoadedDeviceAdapter::LoadDevice(CMMCore* core, const std::string& name,
return std::make_shared<GalvoInstance>(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger);
case MM::HubDevice:
return std::make_shared<HubInstance>(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger);
case MM::PumpDevice:
return std::make_shared<PumpInstance>(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger);
case MM::PressurePumpDevice:
return std::make_shared<PressurePumpInstance>(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger);
case MM::VolumetricPumpDevice:
return std::make_shared<VolumetricPumpInstance>(core, shared_this, name, pDevice, deleter, label, deviceLogger, coreLogger);
default:
deleter(pDevice);
throw CMMError("Device " + ToQuotedString(name) +
Expand Down
208 changes: 0 additions & 208 deletions MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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<PumpInstance> pPump =
deviceManager_->GetDeviceOfType<PumpInstance>(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
///////////////////////////////////////////////////////////////////////////////
Expand Down
23 changes: 0 additions & 23 deletions MMCore/MMCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,29 +582,6 @@ class CMMCore
std::vector<unsigned char*> 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.
Expand Down
16 changes: 11 additions & 5 deletions micromanager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 360c9b2

Please sign in to comment.