Commit a761f904 authored by ahoms's avatar ahoms
Browse files

* Added basic common constant and utility headers

* Added more Hardware feature control objects


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@7 45c4679d-1946-429d-baad-37912b19538b
parent 4c7c6c55
#ifndef CONSTANTS_H
#define CONSTANTS_H
namespace lima
{
enum ImageType {
Bpp8, Bpp10, Bpp12, Bpp14, Bpp16, Bpp32
};
enum TrigMode {
Internal,
ExtTrigSingle, ExtTrigMult,
ExtGate, ExtStartStop,
};
enum ShutMode {
Manual, AutoFrame, AutoSeq,
};
enum BufferMode {
Linear, Circular,
};
} // lima
#endif // CONSTANTS_H
#ifndef FRAMEDIM_H
#define FRAMEDIM_H
class FrameDim
{
public:
FrameDim(int width, int height, Type type);
int getWidth() const;
int getHeight() const;
Type getType() const;
int getDepth() const;
static int getTypeBpp(Type type);
static int getTypeDepth(Type depth);
private:
FrameDim();
int m_width;
int m_height;
Type m_type;
int m_depth;
};
inline FrameDim::getWidth() const
{
return m_width();
}
#endif // FRAMEDIM_H
#include "FrameDim.h"
FrameDim::FrameDim(int width, int height, Type type)
{
width = height = 0;
}
#ifndef HWBUFFERCTRLOBJ_H
#define HWBUFFERCTRLOBJ_H
#include "HwFrameCallback.h"
namespace lima
{
class HwBufferCtrlObj
{
public:
HwBufferCtrlObj();
virtual ~HwBufferCtrlObj();
virtual void setNbBuffers(int nb_buffers) = 0;
virtual void getNbBuffers(int& nb_buffers) = 0;
virtual void setNbConcatFrames(int nb_concat_frames) = 0;
virtual void getNbConcatFrames(int& nb_concat_frames) = 0;
virtual void setNbAccFrames(int nb_acc_frames) = 0;
virtual void getNbAccFrames(int& nb_acc_frames) = 0;
virtual void getMaxNbBuffers(int& max_nb_buffers) = 0;
virtual void setBufferMode(BufferMode buffer_mode) = 0;
virtual void getBufferMode(BufferMode& buffer_mode) = 0;
virtual void *getBufferPtr(int buffer_nb) = 0;
virtual void *getFramePtr(int acq_frame_nb) = 0;
virtual double getFrameTimeStamp(int acq_frame_nb) = 0;
private:
};
} // namespace lima
#endif // HWBUFFERCTRLOBJ_H
......@@ -8,8 +8,9 @@ class HwCap
{
public:
enum Type {
Sync, Buffer, // Standard: these are mandatory
Roi, Bin, Flip, // Image
DetInfo, ImageInfo, // Standard: these are mandatory
Sync, Buffer,
Roi, Bin, Flip, // Image operations
Kinetics, FrameTransfer,// Acquisition modes
Timing, // Read only detector timmings
SerialLine, // Generic detector serial line
......@@ -27,4 +28,7 @@ public:
} // namespace lima
#include "HwSyncCtrlObj.h"
#include "HwBufferCtrlObj.h"
#endif // HWCAP_H
#ifndef HWFRAMECALLBACK_H
#define HWFRAMECALLBACK_H
namespace lima
{
class HwBufferCtrlObj;
class HwFrameCallback
{
public:
typedef struct Info {
int acq_frame_nb;
void *frame_ptr;
FrameDim frame_dim;
double frame_time_stamp;
} InfoType;
};
} // namespace lima
#endif // HWFRAMECALLBACK_H
......@@ -46,7 +46,8 @@ class HwInterface
virtual void startAcq() = 0;
virtual void stopAcq() = 0;
virtual void getStatus(StatusType& status) = 0;
virtual unsigned long getAcqFrameNb() = 0;
virtual int getNbAcquiredFrames() = 0;
virtual double getStartTimeStamp() = 0;
};
} // namespace lima
......
#ifndef HWSYNCCTRLOBJ_H
#define HWSYNCCTRLOBJ_H
#include "Constants.h"
namespace lima
{
class HwSyncCtrlObj
{
public:
enum TrigMode {
Internal,
ExtTrigSingle, ExtTrigMult,
ExtGate, ExtStartStop,
};
enum ShutMode {
Manual, AutoFrame, AutoSeq,
};
HwSyncCtrlObj();
virtual ~HwSyncCtrlObj();
......@@ -40,6 +32,9 @@ public:
virtual void setShutCloseTime(double shut_close_time) = 0;
virtual void getShutCloseTime(double& shut_close_time) = 0;
virtual void setNbFrames(int nb_frames) = 0;
virtual void getNbFrames(int& nb_frames) = 0;
private:
};
......
#include "HwBufferCtrlObj.h"
using namespace lima;
HwBufferCtrlObj::HwBufferCtrlObj()
{
}
HwBufferCtrlObj::~HwBufferCtrlObj()
{
}
hw-objs := HwInterface.o HwCap.o HwSyncCtrlObj.o
hw-objs := HwInterface.o HwCap.o HwSyncCtrlObj.o HwBufferCtrlObj.o
CXXFLAGS += -I../include -I../../common/include -Wall
......
Markdown is supported
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