Commit c8c3d341 authored by claustre's avatar claustre

Splitted Interfaces in several files.

parent eac72988
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef ANDORBINCTRLOBJ_H
#define ANDORBINCTRLOBJ_H
#include "HwInterface.h"
#include "AndorCamera.h"
namespace lima
{
namespace Andor
{
/*******************************************************************
* \class BinCtrlObj
* \brief Control object providing Andor Bin interface
*******************************************************************/
class BinCtrlObj : public HwBinCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BinCtrlObj", "Andor");
public:
BinCtrlObj(Camera& cam);
virtual ~BinCtrlObj() {}
virtual void setBin(const Bin& bin);
virtual void getBin(Bin& bin);
//allow all binning
virtual void checkBin(Bin& bin);
private:
Camera& m_cam;
};
} // namespace Andor
} // namespace lima
#endif // ANDORBINCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef ANDORDETINFOCTRLOBJ_H
#define ANDORDETINFOCTRLOBJ_H
#include "HwInterface.h"
#include "AndorCamera.h"
namespace lima
{
namespace Andor
{
/*******************************************************************
* \class DetInfoCtrlObj
* \brief Control object providing Andor detector info interface
*******************************************************************/
class DetInfoCtrlObj : public HwDetInfoCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj", "Andor");
public:
DetInfoCtrlObj(Camera& cam);
virtual ~DetInfoCtrlObj();
virtual void getMaxImageSize(Size& max_image_size);
virtual void getDetectorImageSize(Size& det_image_size);
virtual void getDefImageType(ImageType& def_image_type);
virtual void getCurrImageType(ImageType& curr_image_type);
virtual void setCurrImageType(ImageType curr_image_type);
virtual void getPixelSize(double& pixel_size);
virtual void getDetectorType(std::string& det_type);
virtual void getDetectorModel(std::string& det_model);
virtual void registerMaxImageSizeCallback(HwMaxImageSizeCallback& cb);
virtual void unregisterMaxImageSizeCallback(HwMaxImageSizeCallback& cb);
private:
Camera& m_cam;
};
} // namespace Andor
} // namespace lima
#endif // ANDORDETINFOCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef ANDORROICTRLOBJ_H
#define ANDORROICTRLOBJ_H
#include "HwInterface.h"
#include "AndorCamera.h"
namespace lima
{
namespace Andor
{
/*******************************************************************
* \class RoiCtrlObj
* \brief Control object providing Andor Roi interface
*******************************************************************/
class RoiCtrlObj : public HwRoiCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "RoiCtrlObj", "Andor");
public:
RoiCtrlObj(Camera& cam);
virtual ~RoiCtrlObj();
virtual void setRoi(const Roi& set_roi);
virtual void getRoi(Roi& hw_roi);
virtual void checkRoi(const Roi& set_roi, Roi& hw_roi);
private:
Camera& m_cam;
};
} // namespace Andor
} // namespace lima
#endif // ANDORROICTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef ANDORSHUTTERCTRLOBJ_H
#define ANDORSHUTTERCTRLOBJ_H
#include "HwInterface.h"
#include "AndorCamera.h"
namespace lima
{
namespace Andor
{
/*******************************************************************
* \class ShutterCtrlObj
* \brief Control object providing Andor shutter interface
*******************************************************************/
class ShutterCtrlObj : public HwShutterCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "ShutterCtrlObj", "Andor");
public:
ShutterCtrlObj(Camera& cam);
virtual ~ShutterCtrlObj();
virtual bool checkMode(ShutterMode shut_mode) const;
virtual void getModeList(ShutterModeList& mode_list) const;
virtual void setMode(ShutterMode shut_mode);
virtual void getMode(ShutterMode& shut_mode) const;
virtual void setState(bool shut_open);
virtual void getState(bool& shut_open) const;
virtual void setOpenTime (double shut_open_time);
virtual void getOpenTime (double& shut_open_time) const;
virtual void setCloseTime(double shut_close_time);
virtual void getCloseTime(double& shut_close_time) const;
private:
Camera& m_cam;
};
} // namespace Andor
} // namespace lima
#endif // ANDORSHUTTERCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef ANDORSYNCCTRLOBJ_H
#define ANDORSYNCCTRLOBJ_H
#include "HwInterface.h"
#include "AndorCamera.h"
namespace lima
{
namespace Andor
{
/*******************************************************************
* \class SyncCtrlObj
* \brief Control object providing Andor synchronization interface
*******************************************************************/
class SyncCtrlObj : public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "SyncCtrlObj", "Andor");
public:
SyncCtrlObj(Camera& cam);
virtual ~SyncCtrlObj();
virtual bool checkTrigMode(TrigMode trig_mode);
virtual void setTrigMode(TrigMode trig_mode);
virtual void getTrigMode(TrigMode& trig_mode);
virtual void setExpTime(double exp_time);
virtual void getExpTime(double& exp_time);
virtual void setLatTime(double lat_time);
virtual void getLatTime(double& lat_time);
virtual void setNbHwFrames(int nb_frames);
virtual void getNbHwFrames(int& nb_frames);
virtual void getValidRanges(ValidRangesType& valid_ranges);
private:
Camera& m_cam;
};
} // namespace Andor
} // namespace lima
#endif // ANDORSYNCCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#include "AndorBinCtrlObj.h"
using namespace lima;
using namespace lima::Andor;
using namespace std;
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
BinCtrlObj::BinCtrlObj(Camera &cam) : m_cam(cam)
{
DEB_CONSTRUCTOR();
}
void BinCtrlObj::setBin(const Bin& aBin)
{
DEB_MEMBER_FUNCT();
m_cam.setBin(aBin);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void BinCtrlObj::getBin(Bin &aBin)
{
DEB_MEMBER_FUNCT();
m_cam.getBin(aBin);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void BinCtrlObj::checkBin(Bin &aBin)
{
DEB_MEMBER_FUNCT();
m_cam.checkBin(aBin);
}
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#include "AndorDetInfoCtrlObj.h"
using namespace lima;
using namespace lima::Andor;
using namespace std;
//-----------------------------------------------------
// @brief Ctor
//-----------------------------------------------------
DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam) :m_cam(cam)
{
DEB_CONSTRUCTOR();
}
//-----------------------------------------------------
// @brief Dtor
//-----------------------------------------------------
DetInfoCtrlObj::~DetInfoCtrlObj()
{
DEB_DESTRUCTOR();
}
//-----------------------------------------------------
// @brief return the max image size
//-----------------------------------------------------
void DetInfoCtrlObj::getMaxImageSize(Size& size)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorImageSize(size);
}
//-----------------------------------------------------
// @brief returnt the detector image size
//-----------------------------------------------------
void DetInfoCtrlObj::getDetectorImageSize(Size& size)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorImageSize(size);
}
//-----------------------------------------------------
// @brief return the image type
//-----------------------------------------------------
void DetInfoCtrlObj::getDefImageType(ImageType& image_type)
{
DEB_MEMBER_FUNCT();
m_cam.getImageType(image_type);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::getCurrImageType(ImageType& image_type)
{
DEB_MEMBER_FUNCT();
m_cam.getImageType(image_type);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::setCurrImageType(ImageType image_type)
{
DEB_MEMBER_FUNCT();
m_cam.setImageType(image_type);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::getPixelSize(double& size)
{
DEB_MEMBER_FUNCT();
m_cam.getPixelSize(size);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::getDetectorType(std::string& type)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorType(type);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::getDetectorModel(std::string& model)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorModel(model);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::registerMaxImageSizeCallback(HwMaxImageSizeCallback& cb)
{
DEB_MEMBER_FUNCT();
//m_cam.registerMaxImageSizeCallback(cb);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void DetInfoCtrlObj::unregisterMaxImageSizeCallback(HwMaxImageSizeCallback& cb)
{
DEB_MEMBER_FUNCT();
//m_cam.unregisterMaxImageSizeCallback(cb);
}
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#include "AndorRoiCtrlObj.h"
using namespace lima;
using namespace lima::Andor;
using namespace std;
//-----------------------------------------------------
// @brief Ctor
//-----------------------------------------------------
RoiCtrlObj::RoiCtrlObj(Camera& cam)
: m_cam(cam)
{
DEB_CONSTRUCTOR();
}
//-----------------------------------------------------
// @brief Dtor
//-----------------------------------------------------
RoiCtrlObj::~RoiCtrlObj()
{
DEB_DESTRUCTOR();
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void RoiCtrlObj::checkRoi(const Roi& set_roi, Roi& hw_roi)
{
DEB_MEMBER_FUNCT();
m_cam.checkRoi(set_roi, hw_roi);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void RoiCtrlObj::setRoi(const Roi& roi)
{
DEB_MEMBER_FUNCT();
Roi real_roi;
checkRoi(roi,real_roi);
m_cam.setRoi(real_roi);
}
//-----------------------------------------------------
// @brief
//-----------------------------------------------------
void RoiCtrlObj::getRoi(Roi& roi)
{
DEB_MEMBER_FUNCT();
m_cam.getRoi(roi);
}
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#include "AndorShutterCtrlObj.h"
using namespace lima;
using namespace lima::Andor;
using namespace std;
//-----------------------------------------------------
// @brief Ctor
//-----------------------------------------------------
ShutterCtrlObj::ShutterCtrlObj(Camera& cam)
: m_cam(cam)
{
DEB_CONSTRUCTOR();
}
//-----------------------------------------------------
// @brief Dtor
//-----------------------------------------------------
ShutterCtrlObj::~ShutterCtrlObj()
{
DEB_DESTRUCTOR();
}
//-----------------------------------------------------
// @brief return true if the mode is valid
//-----------------------------------------------------
bool ShutterCtrlObj::checkMode(ShutterMode shut_mode) const
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(shut_mode);
bool valid_mode;
switch (shut_mode)
{
case ShutterAutoFrame:
case ShutterManual:
valid_mode = true;
break;
default:
// No AutoSequence mode for Andor !
valid_mode = false;
}
DEB_RETURN() << DEB_VAR1(valid_mode);
return valid_mode;
}
//-----------------------------------------------------
// @brief return the shutter valid mode list
//-----------------------------------------------------
void ShutterCtrlObj::getModeList(ShutterModeList& mode_list) const
{
DEB_MEMBER_FUNCT();
mode_list.push_back(ShutterAutoFrame);
mode_list.push_back(ShutterManual);
}
//-----------------------------------------------------
// @brief set the shutter mode
//-----------------------------------------------------
void ShutterCtrlObj::setMode(ShutterMode shut_mode)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(shut_mode);
if (!checkMode(shut_mode))
THROW_HW_ERROR(InvalidValue) << "Invalid "
<< DEB_VAR1(shut_mode);
Camera::ShutterMode cam_mode;
cam_mode = (shut_mode == ShutterAutoFrame) ? Camera::FRAME : Camera::MANUAL;
m_cam.setShutterMode(cam_mode);
}
//-----------------------------------------------------
// @brief return the shutter mode
//-----------------------------------------------------
void ShutterCtrlObj::getMode(ShutterMode& shut_mode) const
{
DEB_MEMBER_FUNCT();
Camera::ShutterMode cam_mode;
m_cam.getShutterMode(cam_mode);
shut_mode = (cam_mode == Camera::FRAME) ? ShutterAutoFrame : ShutterManual;
DEB_RETURN() << DEB_VAR1(shut_mode);
}
//-----------------------------------------------------
// @brief open or close manually the shutter
//-----------------------------------------------------
void ShutterCtrlObj::setState(bool open)
{
DEB_MEMBER_FUNCT();
m_cam.setShutter(open);
}
//-----------------------------------------------------
// @brief return the shutter state, valid if the shutter
// is in manual mode
//-----------------------------------------------------
void ShutterCtrlObj::getState(bool& open) const
{
DEB_MEMBER_FUNCT();
m_cam.getShutter(open);
}
//-----------------------------------------------------
// @brief set the shutter opening time
//-----------------------------------------------------
void ShutterCtrlObj::setOpenTime(double shut_open_time)
{
DEB_MEMBER_FUNCT();
m_cam.setShutterOpenTime(shut_open_time);
}
//-----------------------------------------------------
// @brief return the shutter opening time
//-----------------------------------------------------
void ShutterCtrlObj::getOpenTime(double& shut_open_time) const
{
DEB_MEMBER_FUNCT();
m_cam.getShutterOpenTime(shut_open_time);
DEB_RETURN() << DEB_VAR1(shut_open_time);
}
//-----------------------------------------------------
// @brief set the shutter closing time
//-----------------------------------------------------
void ShutterCtrlObj::setCloseTime(double shut_close_time)
{
DEB_MEMBER_FUNCT();
m_cam.setShutterCloseTime(shut_close_time);
}
//-----------------------------------------------------
// @brief return the shutter closing time
//-----------------------------------------------------
void ShutterCtrlObj::getCloseTime(double& shut_close_time) const