Skip to content

Commit

Permalink
Addition of Pump devices to MM and removed non-used include
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-Kool committed Apr 29, 2024
1 parent 5512c64 commit 72e3a18
Show file tree
Hide file tree
Showing 16 changed files with 753 additions and 7 deletions.
1 change: 0 additions & 1 deletion DeviceAdapters/IDSPeak/IDSPeak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "ModuleInterface.h"
#include <sstream>
#include <algorithm>
#include "WriteCompactTiffRGB.h"
#include <iostream>
#include <future>

Expand Down
1 change: 1 addition & 0 deletions MMCore/CoreUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ 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::PumpDevice: return "Pump";
}
return "Invalid";
}
Expand Down
1 change: 1 addition & 0 deletions MMCore/Devices/DeviceInstances.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "ImageProcessorInstance.h"
#include "SignalIOInstance.h"
#include "MagnifierInstance.h"
#include "PumpInstance.h"
#include "SLMInstance.h"
#include "GalvoInstance.h"
#include "HubInstance.h"
42 changes: 42 additions & 0 deletions MMCore/Devices/PumpInstance.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 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 "PumpInstance.h"

// Volume controlled pump functions
int PumpInstance::Home() { return GetImpl()->Home(); }
int PumpInstance::Stop() { return GetImpl()->Stop(); }
int PumpInstance::invertDirection(bool state) { return GetImpl()->InvertDirection(state); }
int PumpInstance::isDirectionInverted(bool& state) { return GetImpl()->IsDirectionInverted(state); }
int PumpInstance::setVolumeUl(double volume) { return GetImpl()->SetVolumeUl(volume); }
int PumpInstance::getVolumeUl(double& volume) { return GetImpl()->GetVolumeUl(volume); }
int PumpInstance::setMaxVolumeUl(double volume) { return GetImpl()->SetMaxVolumeUl(volume); }
int PumpInstance::getMaxVolumeUl(double& volume) { return GetImpl()->GetMaxVolumeUl(volume); }
int PumpInstance::setFlowrateUlPerSec(double flowrate) { return GetImpl()->SetFlowrateUlPerSecond(flowrate); }
int PumpInstance::getFlowrateUlPerSec(double& flowrate) { return GetImpl()->GetFlowrateUlPerSecond(flowrate); }
int PumpInstance::Dispense() { return GetImpl()->Dispense(); }
int PumpInstance::DispenseDuration(double durSec) { return GetImpl()->DispenseDuration(durSec); }
int PumpInstance::DispenseVolume(double volUl) { return GetImpl()->DispenseVolume(volUl); }

// Pressure controlled pump functions
int PumpInstance::Calibrate() { return GetImpl()->Calibrate(); }
int PumpInstance::setPressure(double pressure) { return GetImpl()->SetPressure(pressure); }
int PumpInstance::getPressure(double& pressure) { return GetImpl()->GetPressure(pressure); }
59 changes: 59 additions & 0 deletions MMCore/Devices/PumpInstance.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// 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"

class PumpInstance : public DeviceInstanceBase<MM::Pump>
{
public:
PumpInstance(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::Pump>(core, adapter, name, pDevice, deleteFunction, label, deviceLogger, coreLogger)
{}

// Volume controlled pump specific
int Home();
int Stop();
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 Dispense();
int DispenseDuration(double durSec);
int DispenseVolume(double volUl);

// Pressure controller specific
int Calibrate();
int setPressure(double pressure);
int getPressure(double& pressure);
};
2 changes: 2 additions & 0 deletions MMCore/LoadableModules/LoadedDeviceAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ 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);
default:
deleter(pDevice);
throw CMMError("Device " + ToQuotedString(name) +
Expand Down
Loading

0 comments on commit 72e3a18

Please sign in to comment.