Skip to content

Commit

Permalink
Added PressurePump and VolumetricPump to MM
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-Kool committed Jun 24, 2024
1 parent 503321c commit 0d30f1f
Show file tree
Hide file tree
Showing 14 changed files with 813 additions and 20 deletions.
2 changes: 2 additions & 0 deletions MMCore/CoreUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ inline std::string ToString(const MM::DeviceType d)
case MM::SLMDevice: return "SLM";
case MM::HubDevice: return "Hub";
case MM::GalvoDevice: return "Galvo";
case MM::PressurePumpDevice: return "PressurePump";
case MM::VolumetricPumpDevice: return "VolumetricPump";
}
return "Invalid";
}
Expand Down
2 changes: 2 additions & 0 deletions MMCore/Devices/DeviceInstances.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@
#include "SLMInstance.h"
#include "GalvoInstance.h"
#include "HubInstance.h"
#include "PressurePumpInstance.h"
#include "VolumetricPumpInstance.h"
30 changes: 30 additions & 0 deletions MMCore/Devices/PressurePumpInstance.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// PROJECT: Micro-Manager
// SUBSYSTEM: MMCore
//
// DESCRIPTION: PressurePump device instance wrapper
//
// COPYRIGHT: Institut Pierre-Gilles de Gennes, Paris, 2024,
// All Rights reserved
//
// LICENSE: This file is distributed under the "Lesser GPL" (LGPL) license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
// AUTHOR: Lars Kool, Institut Pierre-Gilles de Gennes

#include "PressurePumpInstance.h"
#include "../../MMDevice/MMDeviceConstants.h"

// General pump functions
int PressurePumpInstance::Stop() { return GetImpl()->Stop(); }
int PressurePumpInstance::Calibrate() { return GetImpl()->Calibrate(); }
bool PressurePumpInstance::requiresCalibration() { return GetImpl()->RequiresCalibration(); }
int PressurePumpInstance::setPressure(double pressure) { return GetImpl()->SetPressure(pressure); }
int PressurePumpInstance::getPressure(double& pressure) { return GetImpl()->GetPressure(pressure); }
47 changes: 47 additions & 0 deletions MMCore/Devices/PressurePumpInstance.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// PROJECT: Micro-Manager
// SUBSYSTEM: MMCore
//
// DESCRIPTION: Pump device instance wrapper
//
// COPYRIGHT: Institut Pierre-Gilles de Gennes, Paris, 2024,
// All Rights reserved
//
// LICENSE: This file is distributed under the "Lesser GPL" (LGPL) license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
// AUTHOR: Lars Kool, Institut Pierre-Gilles de Gennes

#pragma once
#include "DeviceInstanceBase.h"
#include "../../MMDevice/MMDeviceConstants.h"


class PressurePumpInstance : public DeviceInstanceBase<MM::PressurePump>
{
public:
PressurePumpInstance(CMMCore* core,
std::shared_ptr<LoadedDeviceAdapter> adapter,
const std::string& name,
MM::Device* pDevice,
DeleteDeviceFunction deleteFunction,
const std::string& label,
mm::logging::Logger deviceLogger,
mm::logging::Logger coreLogger) :
DeviceInstanceBase<MM::PressurePump>(core, adapter, name, pDevice, deleteFunction, label, deviceLogger, coreLogger)
{}


int Calibrate();
int Stop();
bool requiresCalibration();
int setPressure(double pressure);
int getPressure(double& pressure);
};
39 changes: 39 additions & 0 deletions MMCore/Devices/VolumetricPumpInstance.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// PROJECT: Micro-Manager
// SUBSYSTEM: MMCore
//
// DESCRIPTION: Pump device instance wrapper
//
// COPYRIGHT: Institut Pierre-Gilles de Gennes, Paris, 2024,
// All Rights reserved
//
// LICENSE: This file is distributed under the "Lesser GPL" (LGPL) license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
// AUTHOR: Lars Kool, Institut Pierre-Gilles de Gennes

#include "VolumetricPumpInstance.h"
#include "../../MMDevice/MMDeviceConstants.h"

// Volume controlled pump functions
int VolumetricPumpInstance::Home() { return GetImpl()->Home(); }
int VolumetricPumpInstance::Stop() { return GetImpl()->Stop(); }
bool VolumetricPumpInstance::requiresHoming() { return GetImpl()->RequiresHoming(); }
int VolumetricPumpInstance::invertDirection(bool state) { return GetImpl()->InvertDirection(state); }
int VolumetricPumpInstance::isDirectionInverted(bool& state) { return GetImpl()->IsDirectionInverted(state); }
int VolumetricPumpInstance::setVolumeUl(double volume) { return GetImpl()->SetVolumeUl(volume); }
int VolumetricPumpInstance::getVolumeUl(double& volume) { return GetImpl()->GetVolumeUl(volume); }
int VolumetricPumpInstance::setMaxVolumeUl(double volume) { return GetImpl()->SetMaxVolumeUl(volume); }
int VolumetricPumpInstance::getMaxVolumeUl(double& volume) { return GetImpl()->GetMaxVolumeUl(volume); }
int VolumetricPumpInstance::setFlowrateUlPerSec(double flowrate) { return GetImpl()->SetFlowrateUlPerSecond(flowrate); }
int VolumetricPumpInstance::getFlowrateUlPerSec(double& flowrate) { return GetImpl()->GetFlowrateUlPerSecond(flowrate); }
int VolumetricPumpInstance::Start() { return GetImpl()->Start(); }
int VolumetricPumpInstance::DispenseDuration(double durSec) { return GetImpl()->DispenseDuration(durSec); }
int VolumetricPumpInstance::DispenseVolume(double volUl) { return GetImpl()->DispenseVolume(volUl); }
56 changes: 56 additions & 0 deletions MMCore/Devices/VolumetricPumpInstance.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// PROJECT: Micro-Manager
// SUBSYSTEM: MMCore
//
// DESCRIPTION: Pump device instance wrapper
//
// COPYRIGHT: Institut Pierre-Gilles de Gennes, Paris, 2024,
// All Rights reserved
//
// LICENSE: This file is distributed under the "Lesser GPL" (LGPL) license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
// AUTHOR: Lars Kool, Institut Pierre-Gilles de Gennes

#pragma once

#include "DeviceInstanceBase.h"
#include "../../MMDevice/MMDeviceConstants.h"


class VolumetricPumpInstance : public DeviceInstanceBase<MM::VolumetricPump>
{
public:
VolumetricPumpInstance(CMMCore* core,
std::shared_ptr<LoadedDeviceAdapter> adapter,
const std::string& name,
MM::Device* pDevice,
DeleteDeviceFunction deleteFunction,
const std::string& label,
mm::logging::Logger deviceLogger,
mm::logging::Logger coreLogger) :
DeviceInstanceBase<MM::VolumetricPump>(core, adapter, name, pDevice, deleteFunction, label, deviceLogger, coreLogger)
{}

int Home();
int Stop();
bool requiresHoming();
int invertDirection(bool state);
int isDirectionInverted(bool& state);
int setVolumeUl(double volUl);
int getVolumeUl(double& volUl);
int setMaxVolumeUl(double volUl);
int getMaxVolumeUl(double& volUl);
int setFlowrateUlPerSec(double flowrate);
int getFlowrateUlPerSec(double& flowrate);
int Start();
int DispenseDuration(double durSec);
int DispenseVolume(double volUl);
};
Loading

0 comments on commit 0d30f1f

Please sign in to comment.