Commit 15e868c1 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Cosmetics: homogenize EigerCamera.h indentation

parent f2e3e6b2
...@@ -48,174 +48,178 @@ namespace eigerapi ...@@ -48,174 +48,178 @@ namespace eigerapi
namespace lima namespace lima
{ {
namespace Eiger namespace Eiger
{ {
class SavingCtrlObj;
class Stream; class SavingCtrlObj;
/******************************************************************* class Stream;
* \class Camera
* \brief object controlling the Eiger camera via EigerAPI
*******************************************************************/
class LIBEIGER Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGen
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "Eiger");
friend class Interface;
friend class SavingCtrlObj;
friend class Stream;
public: /*******************************************************************
* \class Camera
* \brief object controlling the Eiger camera via EigerAPI
*******************************************************************/
class LIBEIGER Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGen
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "Eiger");
enum ApiGeneration { Eiger1, Eiger2 }; public:
enum Status { Ready, Initialising, Exposure, Readout, Fault }; enum ApiGeneration { Eiger1, Eiger2 };
enum CompressionType {NoCompression,LZ4,BSLZ4}; enum Status { Ready, Initialising, Exposure, Readout, Fault };
enum CompressionType {NoCompression,LZ4,BSLZ4};
Camera(const std::string& detector_ip, ApiGeneration api = Eiger1); Camera(const std::string& detector_ip, ApiGeneration api = Eiger1);
~Camera(); ~Camera();
void initialize(); void initialize();
void startAcq(); void startAcq();
void stopAcq(); void stopAcq();
void prepareAcq(); void prepareAcq();
// -- detector info object // -- detector info object
void getImageType(ImageType& type); void getImageType(ImageType& type);
void setImageType(ImageType type); void setImageType(ImageType type);
void getDetectorType(std::string& type); void getDetectorType(std::string& type);
void getDetectorModel(std::string& model); void getDetectorModel(std::string& model);
void getDetectorImageSize(Size& size); void getDetectorImageSize(Size& size);
void getDetectorMaxImageSize(Size& size); void getDetectorMaxImageSize(Size& size);
//-- Synch control object //-- Synch control object
bool checkTrigMode(TrigMode trig_mode); bool checkTrigMode(TrigMode trig_mode);
void setTrigMode(TrigMode mode); void setTrigMode(TrigMode mode);
void getTrigMode(TrigMode& mode); void getTrigMode(TrigMode& mode);
void setExpTime(double exp_time, bool force = false); void setExpTime(double exp_time, bool force = false);
void getExpTime(double& exp_time); void getExpTime(double& exp_time);
void setLatTime(double lat_time); void setLatTime(double lat_time);
void getLatTime(double& lat_time); void getLatTime(double& lat_time);
void getExposureTimeRange(double& min_expo, double& max_expo) const; void getExposureTimeRange(double& min_expo, double& max_expo) const;
void getLatTimeRange(double& min_lat, double& max_lat) const; void getLatTimeRange(double& min_lat, double& max_lat) const;
void setNbFrames(int nb_frames); void setNbFrames(int nb_frames);
void getNbFrames(int& nb_frames); void getNbFrames(int& nb_frames);
void getNbHwAcquiredFrames(int &nb_acq_frames); void getNbHwAcquiredFrames(int &nb_acq_frames);
bool isBinningAvailable(); bool isBinningAvailable();
void getPixelSize(double& sizex, double& sizey); void getPixelSize(double& sizex, double& sizey);
Camera::Status getStatus(); Camera::Status getStatus();
std::string getCamStatus(); std::string getCamStatus();
// void reset(); //void reset();
// -- Eiger specific // -- Eiger specific
void getApiGeneration(ApiGeneration&); void getApiGeneration(ApiGeneration&);
void getTemperature(double&); void getTemperature(double&);
void getHumidity(double&); void getHumidity(double&);
void setCountrateCorrection(bool);
void getCountrateCorrection(bool&);
void setFlatfieldCorrection(bool);
void getFlatfieldCorrection(bool&);
void setAutoSummation(bool);
void getAutoSummation(bool&);
void setEfficiencyCorrection(bool);
void getEfficiencyCorrection(bool& value);
void setPixelMask(bool);
void getPixelMask(bool&);
void setThresholdEnergy(double);
void getThresholdEnergy(double&);
void setVirtualPixelCorrection(bool);
void getVirtualPixelCorrection(bool&);
void setPhotonEnergy(double);
void getPhotonEnergy(double&);
void setWavelength(double);
void getWavelength(double&);
void setBeamCenterX(double);
void getBeamCenterX(double&);
void setBeamCenterY(double);
void getBeamCenterY(double&);
void setDetectorDistance(double);
void getDetectorDistance(double&);
void getDataCollectionDate(std::string&);
void getSoftwareVersion(std::string&);
void getCompression(bool&);
void setCompression(bool);
void getCompressionType(CompressionType&) const;
void setCompressionType(CompressionType);
void getSerieId(int&);
void deleteMemoryFiles();
void disarm();
const std::string& getDetectorIp() const;
private:
enum InternalStatus {IDLE,RUNNING,ERROR};
class AcqCallback;
friend class AcqCallback;
class InitCallback;
friend class InitCallback;
void initialiseController(); /// Used during plug-in initialization
void _acquisition_finished(bool);
template <typename T>
struct Cache
{
T val;
Cache() = default;
Cache(T v) : val(v) {}
operator T&() { return val; }
Cache& operator =(T new_val)
{ val = new_val; return *this; }
bool changed(T new_val)
{ std::swap(val, new_val); return (val != new_val); }
};
//-----------------------------------------------------------------------------
//- lima stuff
int m_nb_frames;
Cache<unsigned int> m_nb_images;
Cache<unsigned int> m_nb_triggers;
int m_image_number;
double m_latency_time;
Cache<TrigMode> m_trig_mode;
//- camera stuff
ApiGeneration m_api;
std::string m_detector_model;
std::string m_detector_type;
unsigned int m_maxImageWidth, m_maxImageHeight;
ImageType m_detectorImageType;
InternalStatus m_initilize_state;
InternalStatus m_trigger_state;
int m_serie_id;
//- EigerAPI stuff
eigerapi::Requests* m_requests;
double m_temperature; void setCountrateCorrection(bool);
double m_humidity; void getCountrateCorrection(bool&);
Cache<double> m_exp_time; void setFlatfieldCorrection(bool);
Cache<double> m_frame_time; void getFlatfieldCorrection(bool&);
double m_readout_time; void setAutoSummation(bool);
double m_x_pixelsize, m_y_pixelsize; void getAutoSummation(bool&);
Cond m_cond; void setEfficiencyCorrection(bool);
std::string m_detector_ip; void getEfficiencyCorrection(bool& value);
double m_min_frame_time; void setPixelMask(bool);
}; void getPixelMask(bool&);
} // namespace Eiger void setThresholdEnergy(double);
void getThresholdEnergy(double&);
void setVirtualPixelCorrection(bool);
void getVirtualPixelCorrection(bool&);
void setPhotonEnergy(double);
void getPhotonEnergy(double&);
void setWavelength(double);
void getWavelength(double&);
void setBeamCenterX(double);
void getBeamCenterX(double&);
void setBeamCenterY(double);
void getBeamCenterY(double&);
void setDetectorDistance(double);
void getDetectorDistance(double&);
void getDataCollectionDate(std::string&);
void getSoftwareVersion(std::string&);
void getCompression(bool&);
void setCompression(bool);
void getCompressionType(CompressionType&) const;
void setCompressionType(CompressionType);
void getSerieId(int&);
void deleteMemoryFiles();
void disarm();
const std::string& getDetectorIp() const;
private:
friend class Interface;
friend class SavingCtrlObj;
friend class Stream;
enum InternalStatus {IDLE,RUNNING,ERROR};
class AcqCallback;
friend class AcqCallback;
class InitCallback;
friend class InitCallback;
void initialiseController(); /// Used during plug-in initialization
void _acquisition_finished(bool);
template <typename T>
struct Cache
{
T val;
Cache() = default;
Cache(T v) : val(v) {}
operator T&() { return val; }
Cache& operator =(T new_val)
{ val = new_val; return *this; }
bool changed(T new_val)
{ std::swap(val, new_val); return (val != new_val); }
};
//-----------------------------------------------------------------------------
//- lima stuff
int m_nb_frames;
Cache<unsigned int> m_nb_images;
Cache<unsigned int> m_nb_triggers;
int m_image_number;
double m_latency_time;
Cache<TrigMode> m_trig_mode;
//- camera stuff
ApiGeneration m_api;
std::string m_detector_model;
std::string m_detector_type;
unsigned int m_maxImageWidth, m_maxImageHeight;
ImageType m_detectorImageType;
InternalStatus m_initilize_state;
InternalStatus m_trigger_state;
int m_serie_id;
//- EigerAPI stuff
eigerapi::Requests* m_requests;
double m_temperature;
double m_humidity;
Cache<double> m_exp_time;
Cache<double> m_frame_time;
double m_readout_time;
double m_x_pixelsize, m_y_pixelsize;
Cond m_cond;
std::string m_detector_ip;
double m_min_frame_time;
};
} // namespace Eiger
} // namespace lima } // namespace lima
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment