Commit 578324b7 authored by Arafat Noureddine's avatar Arafat Noureddine
Browse files

first draft

parent 2752b4c9
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaBinCtrlObj.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANABINCTRLOBJ_H
#define DHYANABINCTRLOBJ_H
#include "lima/Debug.h"
#include "DhyanaCompatibility.h"
#include "lima/HwInterface.h"
#include "DhyanaCamera.h"
namespace lima
{
namespace Dhyana
{
class Camera;
/*******************************************************************
* \class BinCtrlObj
* \brief Control object providing Basler Bin interface
*******************************************************************/
class LIBDHYANA_API BinCtrlObj : public HwBinCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BinCtrlObj", "Dhyana");
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 Dhyana
} // namespace lima
#endif // DHYANABINCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaCamera.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANACAMERA_H_
#define DHYANACAMERA_H_
#include <ostream>
#include <map>
#include "DhyanaCompatibility.h"
#include "lima/HwMaxImageSizeCallback.h"
#include "lima/HwBufferMgr.h"
#include "lima/HwInterface.h"
#include "lima/Debug.h"
#include "TUCamApi.h"
#include "TUDefine.h"
using namespace std;
namespace lima
{
namespace Dhyana
{
const int PIXEL_SIZE_WIDTH_MICRON = 11; // pixel size is 11 micron
const int PIXEL_SIZE_HEIGHT_MICRON = 11; // pixel size is 11 micron
const int PIXEL_NB_WIDTH = 2048;
const int PIXEL_NB_HEIGHT = 2048;
class BufferCtrlObj;
/*******************************************************************
* \class Camera
* \brief object controlling the Dhyana camera
*******************************************************************/
class LIBDHYANA_API Camera : public HwMaxImageSizeCallbackGen
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "Dhyana");
public:
enum Status
{
Ready, Exposure, Readout, Latency, Fault
} ;
Camera();
~Camera();
void init();
void reset();
void prepareAcq();
void startAcq();
void stopAcq();
void getStatus(Camera::Status& status);
int getNbHwAcquiredFrames();
// -- detector info object
void getImageType(ImageType& type);
void setImageType(ImageType type);
void getDetectorType(std::string& type);
void getDetectorModel(std::string& model);
void getDetectorImageSize(Size& size);
void getPixelSize(double& sizex, double& sizey);
// -- Buffer control object
HwBufferCtrlObj* getBufferCtrlObj();
//-- Synch control object
void setTrigMode(TrigMode mode);
void getTrigMode(TrigMode& mode);
bool checkTrigMode(TrigMode mode);
void setExpTime(double exp_time);
void getExpTime(double& exp_time);
void setLatTime(double lat_time);
void getLatTime(double& lat_time);
void getExposureTimeRange(double& min_expo, double& max_expo) const;
void getLatTimeRange(double& min_lat, double& max_lat) const;
void setNbFrames(int nb_frames);
void getNbFrames(int& nb_frames);
//-- Related to Bin control object
void setBin(const Bin& bin);
void getBin(Bin& bin);
void checkBin(Bin& bin);
//-- Related to Roi control object
void checkRoi(const Roi& set_roi, Roi& hw_roi);
void setRoi(const Roi& set_roi);
void getRoi(Roi& hw_roi);
void setTemperatureTarget(double temp);
void getTemperatureTarget(double& temp);
void getTemperature(double& temp);
void setFanSpeed(unsigned speed);
void getFanSpeed(unsigned& speed);
void setGlobalGain(unsigned gain);
void getGlobalGain(unsigned& gain);
void getTucamVersion(std::string& version);
void getFirmwareVersion(std::string& version);
bool isAcqRunning() const;
///////////////////////////////
// -- dhyana specific functions
///////////////////////////////
private:
//get frame from API/Driver/etc ...
void readFrame(void *bptr, int frame_nb);
//////////////////////////////
// -- dhyana specific members
//////////////////////////////
class AcqThread;
AcqThread * m_acq_thread;
TrigMode m_trigger_mode;
double m_exp_time;
double m_lat_time;
ImageType m_image_type;
int m_nb_frames; // nos of frames to acquire
bool m_thread_running;
bool m_wait_flag;
bool m_quit;
int m_acq_frame_nb; // nos of frames acquired
mutable Cond m_cond;
TrigMode m_trig_mode;
long m_depth;
Camera::Status m_status;
Bin m_bin;
double m_temperature_target;
// Buffer control object
SoftBufferCtrlObj m_bufferCtrlObj;
//TUCAM stuff
TUCAM_INIT m_itApi;// Initializing SDK environment parameters
TUCAM_OPEN m_opCam;// Open camera parameters
} ;
} // namespace Dhyana
} // namespace lima
#endif /* DHYANACAMERA_H_ */
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaCompatibility.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANACOMPATIBILITY_H
#define DHYANACOMPATIBILITY_H
#ifdef WIN32
#ifdef LIBDHYANA_EXPORTS
#define LIBDHYANA_API __declspec(dllexport)
#else
#define LIBDHYANA_API __declspec(dllimport)
#endif
#else /* Unix */
#define LIBDHYANA_API
#endif
#endif
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaDetInfoCtrlObj.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANADETINFOCTRLOBJ_H
#define DHYANADETINFOCTRLOBJ_H
#include "lima/Debug.h"
//#include "Dhyana.h"
#include "DhyanaCompatibility.h"
#include "lima/HwDetInfoCtrlObj.h"
namespace lima {
namespace Dhyana {
class Camera;
/*******************************************************************
* \class DetInfoCtrlObj
* \brief Control object providing Dhyana detector info interface
*******************************************************************/
class LIBDHYANA_API DetInfoCtrlObj: public HwDetInfoCtrlObj {
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj", "Dhyana");
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& x_size, double &y_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 Dhyana
} // namespace lima
#endif // DHYANADETINFOCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaInterface.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANAINTERFACE_H_
#define DHYANAINTERFACE_H_
#include "lima/Debug.h"
#include "DhyanaCompatibility.h"
#include "DhyanaDetInfoCtrlObj.h"
#include "DhyanaSyncCtrlObj.h"
#include "DhyanaBinCtrlObj.h"
#include "DhyanaRoiCtrlObj.h"
#include "lima/HwInterface.h"
#include "lima/HwBufferMgr.h"
namespace lima
{
namespace Dhyana
{
class Camera;
/*******************************************************************
* \class Interface
* \brief Dhyana hardware interface
*******************************************************************/
class LIBDHYANA_API Interface : public HwInterface
{
DEB_CLASS_NAMESPC(DebModCamera, "Interface", "Dhyana");
public:
Interface(Camera& cam);
virtual ~Interface();
virtual void getCapList(CapList&) const;
virtual void reset(ResetLevel reset_level);
virtual void prepareAcq();
virtual void startAcq();
virtual void stopAcq();
virtual void getStatus(StatusType& status);
virtual int getNbHwAcquiredFrames();
//! get the camera object to access it directly from client
Camera& getCamera()
{
return m_cam;
}
private:
Camera& m_cam;
CapList m_cap_list;
DetInfoCtrlObj m_det_info;
HwBufferCtrlObj* m_bufferCtrlObj;
SyncCtrlObj m_sync;
BinCtrlObj m_bin;
RoiCtrlObj m_roi;
} ;
} // namespace Dhyana
} // namespace lima
#endif /* DHYANAINTERFACE_H_ */
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaRoiCtrlObj.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANAROICTRLOBJ_H
#define DHYANAROICTRLOBJ_H
#include "lima/Debug.h"
#include "DhyanaCompatibility.h"
#include "lima/HwInterface.h"
#include "DhyanaCamera.h"
namespace lima
{
namespace Dhyana
{
class Camera;
/*******************************************************************
* \class RoiCtrlObj
* \brief Control object providing Basler Roi interface
*******************************************************************/
class LIBDHYANA_API RoiCtrlObj : public HwRoiCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "RoiCtrlObj", "Dhyana");
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 Dhyana
} // namespace lima
#endif // DHYANAROICTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// 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/>.
//###########################################################################
//
// DhyanaSyncCtrlObj.h
// Created on: October 24, 2018
// Author: Arafat NOUREDDINE
#ifndef DHYANASYNCCTRLOBJ_H
#define DHYANASYNCCTRLOBJ_H
#include "lima/Debug.h"
#include "DhyanaCompatibility.h"
#include "lima/HwSyncCtrlObj.h"
#include "lima/HwInterface.h"
namespace lima
{
namespace Dhyana
{
class Camera;
/*******************************************************************
* \class SyncCtrlObj
* \brief Control object providing Dhyana synchronization interface
*******************************************************************/
class LIBDHYANA_API SyncCtrlObj: public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "SyncCtrlObj", "Dhyana");
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 Dhyana
} // namespace lima
#endif // DHYANASYNCCTRLOBJ_H
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.soleil</groupId>
<artifactId>super-pom-C-CPP</artifactId>
<version>RELEASE</version>
</parent>
<groupId>fr.soleil.lib.Lima.Camera</groupId>
<artifactId>LimaDhyana-${aol}-shared-${mode}</artifactId>
<version>1.0.0</version>
<packaging>nar</packaging>
<name>LimaDhyana</name>
<description>This module controls the TUcsen Dhyana Detector</description>
<scm>
<connection>scm:git:git://github.com/soleil-ica/Lima-camera-dhyana.git</connection>
<developerConnection>scm:git:git://github.com/soleil-ica/Lima-camera-dhyana.git</developerConnection>
<url>https://github.com/soleil-ica/Lima-camera-dhyana</url>
</scm>
<dependencies>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>LimaCore-${aol}-shared-${mode}</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>NexusCPP-${aol}-static-${mode}</artifactId>
<version>3.1.5-vc9</version>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-static-${mode}</artifactId>
<version>1.13.4-vc9</version>
</dependency>
<