Skip to content

Commit

Permalink
Fixed some code duplication due to manual merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-Kool committed Jul 1, 2024
1 parent 67dbe2b commit 9bbc64a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
51 changes: 0 additions & 51 deletions MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PressurePumpInstance>(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
*/
Expand Down Expand Up @@ -6359,24 +6326,6 @@ bool CMMCore::PressurePumpRequiresCalibration(const char* deviceLabel) throw (CM
return pPump->requiresCalibration();
}

/**
* Sets the pressure of the pump in kPa
*/
void CMMCore::setPumpPressure(const char* deviceLabel, double pressurekPa) throw (CMMError)
{
std::shared_ptr<PressurePumpInstance> pPump =
deviceManager_->GetDeviceOfType<PressurePumpInstance>(deviceLabel);
mm::DeviceModuleLockGuard guard(pPump);

int ret = pPump->setPressure(pressurekPa);

if (ret != DEVICE_OK)
{
logError(deviceLabel, getDeviceErrorText(ret, pPump).c_str());
throw CMMError(getDeviceErrorText(ret, pPump));
}
}

/**
* Gets the pressure of the pump in kPa
*/
Expand Down
6 changes: 0 additions & 6 deletions MMCore/MMCore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@
<ClCompile Include="Devices\VolumetricPumpInstance.cpp">
<Filter>Source Files\Devices</Filter>
</ClCompile>
<ClCompile Include="Devices\PressurePumpInstance.cpp">
<Filter>Source Files\Devices</Filter>
</ClCompile>
<ClCompile Include="Devices\VolumetricPumpInstance.cpp">
<Filter>Source Files\Devices</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="CircularBuffer.h">
Expand Down

0 comments on commit 9bbc64a

Please sign in to comment.