Commit c7661bc5 authored by papillon's avatar papillon
Browse files

* first class templates for control layer



git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@8 45c4679d-1946-429d-baad-37912b19538b
parent a761f904
......@@ -8,6 +8,10 @@ enum ImageType {
Bpp8, Bpp10, Bpp12, Bpp14, Bpp16, Bpp32
};
enum AcqMode {
Single, Accumulation, Concatenation,
};
enum TrigMode {
Internal,
ExtTrigSingle, ExtTrigMult,
......@@ -18,14 +22,10 @@ enum ShutMode {
Manual, AutoFrame, AutoSeq,
};
enum BufferMode {
Linear, Circular,
};
} // lima
#endif // CONSTANTS_H
#ifndef CTACQUISITION_H
#define CTACQUISITION_H
#include "Constants.h"
namespace lima {
class CtAcquisition {
public:
struct Parameters {
int m_acq_nframes;
double m_acq_time;
double m_latency_time;
};
CtAcquisition();
~CtAcquisition();
void setParameters(const Parameters& pars);
void getParameters(Parameters& pars) const;
void setAcqNbFrames(int nframes);
void getAcqNbFrames(int& nframes) const;
void setAcqExposureTime(double acq_time);
void getAcqExposureTime(double& acq_time) const;
void setLatencyTime(double latency_time);
void getLatencyTime(double& latency_time) const;
void setTriggerMode(TrigMode mode);
void getTriggerMode(TrigMode& mode) const;
// ...
void getReadoutTime(double& readout_time) const;
void getFrameRate(double& frame_rate) const;
private:
Parameters m_pars;
};
} // namespace lima
#endif // CTACQUISITION_H
#ifndef CTBUFFER_H
#define CTBUFFER_H
#include "Constants.h"
namespace lima {
class CtBuffer {
public:
struct Parameters {
Mode mode;
long nbBuffers;
short maxMemory;
};
CtBuffer();
~CtBuffer();
void setMode(BufferMode mode);
void getMode(BufferMode& mode) const;
void setNumber(long nb_buffers);
void getNumber(long& nb_buffers) const;
void setMaxMemory(short max_memory);
void getMaxMemory(short& max_memory) const;
private:
Parameters m_pars;
} // namespace lima
#endif // CTBUFFER_H
#ifndef CTCONTROL_H
#define CTCONTROL_H
namespace lima {
class CtControl {
public:
struct ImageStatus {
long LastImageAcquired;
long LastBaseImageReady;
long LastImageReady;
long LastImageSaved;
long LastCounterReady;
};
CtControl();
~CtControl();
void prepareAcq();
void startAcq();
void stopAcq();
void getAcqStatus(); // from HW
void getImageStatus(ImageStatus& status) const;
void reset();
private:
ImageStatus m_img_status;
} // namespace lima
#endif // CTCONTROL_H
#ifndef CTIMAGE_H
#define CTIMAGE_H
#include "Constants.h"
namespace lima {
class CtImage {
public:
// Size, Type, Bin, XY from common
CtImage();
~CtImage();
void getMaxImageSize(Size& size) const;
void getImageSize(Size& size) const;
void getImageType(ImageType& type) const;
private:
}
} // namespace lima
#endif // CTIMAGE_H
#ifndef CTSAVING_H
#define CTSAVING_H
namespace lima {
class CtSaving {
public:
CtSaving();
~CtSaving();
enum FileFormat {
RAW,
EDF,
};
enum SavingMode {
Manual,
AutoFrame,
AutoHeader,
};
enum OverwritePolicy {
Abort,
Overwrite,
Append,
};
struct Parameters {
string directory;
string prefix;
string suffix;
long nextNumber;
FileFormat fileFormat;
SavingMode savingMode;
OverwritePolicy overwritePolicy;
unsigned long framesPerFile;
};
typedef std::pairs<string, string> HeaderValue;
typedef std::list<HeaderValue> HeaderList;
// --- file parameters
void setParameters(Parameters pars);
void getParameters(Parameters& pars) const;
void setDirectory(string directory);
void getDirectory(string& directory) const;
void setPrefix(string prefix);
void getPrefix(string& prefix) const;
void setSuffix(string suffix);
void getSuffix(string& suffix) const;
void setNextNumber(long number);
void getNextNumber(long& number) const;
void setFormat(FileFormat format);
void getFormat(FileFormat& format) const;
// --- saving modes
void setSavingMode(SavingMode mode);
void getSavingMode(SavingMode& mode) const;
void setOverwritePolicy(OverwritePolicy policy);
void getOverwritePolicy(OverwritePolicy& policy) const;
void setFramesPerFile(unsigned long frames_per_file);
void getFramePerFile(unsigned long& frames_per_file) const;
// --- headers
void getStaticHeader(HeaderList& header) const;
void resetCommonHeader();
void setCommonHeader(HeaderList header);
void getCommonHeader(HeaderList& header) const;
void addToCommonHeader(HeaderValue value);
private:
Parameters m_pars;
HeaderList m_static_header;
HeaderList m_common_header;
};
} // namespace lima
#undef // CTSAVING_H
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