Commit ba8e942b authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline

Frelon16: first version working with SPB2 and SPB8x1

* Disable Flip/Bin/Roi
* Set FTM as default mode for Frelon16
* Dummy readout/transfer times (100/100 ms)
* Do not include SPB2 status if SPB8
parent 38e95089
Pipeline #7233 passed with stages
in 4 minutes and 53 seconds
......@@ -22,7 +22,7 @@
#ifndef FRELONGEOMETRY_H
#define FRELONGEOMETRY_H
#include "Frelon.h"
#include "FrelonModel.h"
#include "lima/HwMaxImageSizeCallback.h"
namespace lima
......@@ -31,7 +31,6 @@ namespace lima
namespace Frelon
{
class Model;
class Geometry;
class Camera;
......@@ -62,7 +61,7 @@ class Geometry : public HwMaxImageSizeCallbackGen
void sync();
bool getDefInputChan(FrameTransferMode ftm,
InputChan& input_chan);
InputChan& input_chan);
void setInputChan(InputChan input_chan);
void getInputChan(InputChan& input_chan);
......@@ -70,7 +69,7 @@ class Geometry : public HwMaxImageSizeCallbackGen
void getFrameTransferMode(FrameTransferMode& ftm);
std::string getInputChanModeName(FrameTransferMode ftm,
InputChan input_chan);
InputChan input_chan);
void getMaxFrameDim(FrameDim& max_frame_dim);
void getFrameDim(FrameDim& frame_dim);
......@@ -112,6 +111,8 @@ class Geometry : public HwMaxImageSizeCallbackGen
protected:
virtual void setMaxImageSizeCallbackActive(bool cb_active);
bool isFrelon16(SPBType spb_type);
void writeRegister(Reg reg, int val);
void readRegister (Reg reg, int& val);
void readFloatRegister(Reg reg, double& val);
......@@ -168,6 +169,14 @@ inline bool Geometry::isChanActive(InputChan curr, InputChan chan)
return (curr & chan) == chan;
};
inline bool Geometry::isFrelon16(SPBType spb_type)
{
GeomType geom_type = m_model.getGeomType();
return (((geom_type == SPB2_F16) && (spb_type == SPBType2)) ||
(((geom_type == SPB8_F16_Half) ||
(geom_type == SPB8_F16_Half)) && (spb_type == SPBType8)));
}
} // namespace Frelon
......
......@@ -207,26 +207,28 @@ lima::Frelon::TimeUnitFactorMap(C_LIST_ITERS(TimeUnitFactorCList));
typedef pair<ChipType, FrameDim> ChipFrameDimPair;
static const ChipFrameDimPair ChipMaxFrameDimCList[] = {
ChipFrameDimPair(Atmel, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(Kodak, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(E2V_2k, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(E2V_2kNotMPP, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(E2V_4k, FrameDim(4096, 4096, Bpp16)),
ChipFrameDimPair(E2V_4kNotMPP, FrameDim(4096, 4096, Bpp16)),
ChipFrameDimPair(Hama, FrameDim(2048, 1, Bpp16)),
ChipFrameDimPair(Atmel, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(Kodak, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(E2V_2k, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(E2V_2kNotMPP, FrameDim(2048, 2048, Bpp16)),
ChipFrameDimPair(E2V_4k, FrameDim(4096, 4096, Bpp16)),
ChipFrameDimPair(E2V_4kNotMPP, FrameDim(4096, 4096, Bpp16)),
ChipFrameDimPair(Hama, FrameDim(2048, 1, Bpp16)),
ChipFrameDimPair(Andanta_CcdFT2k, FrameDim(1920, 3840, Bpp16)),
};
ChipMaxFrameDimMapType
lima::Frelon::ChipMaxFrameDimMap(C_LIST_ITERS(ChipMaxFrameDimCList));
typedef pair<ChipType, double> ChipSizePair;
static const ChipSizePair ChipPixelSizeCList[] = {
ChipSizePair(Atmel, 14e-6),
ChipSizePair(Kodak, 24e-6),
ChipSizePair(E2V_2k, 15e-6),
ChipSizePair(E2V_2kNotMPP, 15e-6),
ChipSizePair(E2V_4k, 15e-6),
ChipSizePair(E2V_4kNotMPP, 15e-6),
ChipSizePair(Hama, 14e-6),
ChipSizePair(Atmel, 14e-6),
ChipSizePair(Kodak, 24e-6),
ChipSizePair(E2V_2k, 15e-6),
ChipSizePair(E2V_2kNotMPP, 15e-6),
ChipSizePair(E2V_4k, 15e-6),
ChipSizePair(E2V_4kNotMPP, 15e-6),
ChipSizePair(Hama, 14e-6),
ChipSizePair(Andanta_CcdFT2k, 16e-6),
};
ChipPixelSizeMapType
lima::Frelon::ChipPixelSizeMap(C_LIST_ITERS(ChipPixelSizeCList));
......
......@@ -110,10 +110,10 @@ void Camera::syncRegs()
switch (geom_type) {
case SPB12_4_Quad:
case Hamamatsu:
m_geom = new Geometry(*this);
break;
case SPB2_F16:
case SPB8_F16_Half:
m_geom = new Geometry(*this);
break;
case SPB8_F16_Dual:
THROW_HW_ERROR(NotSupported) << DEB_VAR1(geom_type);
}
......@@ -728,6 +728,12 @@ void Camera::getStatus(Status& status, bool use_ser_line, bool read_spb2)
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR2(use_ser_line, read_spb2);
bool isSPB8 = (m_model.getSPBType() == SPBType8);
if (isSPB8 && read_spb2) {
DEB_TRACE() << "SPB8: Ignoring " << DEB_VAR1(read_spb2);
read_spb2 = false;
}
bool has_good_htd = m_model.has(Model::GoodHTD);
if ((use_ser_line || read_spb2) && !has_good_htd)
THROW_HW_ERROR(NotSupported) << "SPB2/ser. line status "
......
......@@ -322,6 +322,11 @@ void Geometry::getMaxFrameDim(FrameDim& max_frame_dim)
ChipType chip_type = m_model.getChipType();
max_frame_dim = ChipMaxFrameDimMap[chip_type];
if (isFrelon16(SPBType2))
max_frame_dim /= Point(2, 2);
else if (isFrelon16(SPBType8))
max_frame_dim /= Point(1, 2);
DEB_RETURN() << DEB_VAR1(max_frame_dim);
}
......@@ -356,7 +361,12 @@ void Geometry::checkFlip(Flip& flip)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(flip);
DEB_TRACE() << "All standard flip modes are supported";
if (isFrelon16(SPBType2) || isFrelon16(SPBType8)) {
DEB_TRACE() << "No flip is supported";
flip = Flip(false);
} else {
DEB_TRACE() << "All standard flip modes are supported";
}
DEB_RETURN() << DEB_VAR1(flip);
}
......@@ -384,9 +394,12 @@ void Geometry::checkBin(Bin& bin)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(bin);
int bin_x = min(bin.getX(), int(MaxBinX));
int bin_y = min(bin.getY(), int(MaxBinY));
bool frelon16 = (isFrelon16(SPBType2) || isFrelon16(SPBType8));
int max_bin_x = frelon16 ? 1 : int(MaxBinX);
int max_bin_y = frelon16 ? 1 : int(MaxBinY);
int bin_x = min(bin.getX(), max_bin_x);
int bin_y = min(bin.getY(), max_bin_y);
bin = Bin(bin_x, bin_y);
DEB_RETURN() << DEB_VAR1(bin);
......@@ -481,7 +494,8 @@ Flip Geometry::getMirror()
Flip mirror;
mirror.x = isChanActive(curr, Chan12) || isChanActive(curr, Chan34);
mirror.y = isChanActive(curr, Chan13) || isChanActive(curr, Chan24);
if (isFrelon16(SPBType2) || isFrelon16(SPBType8))
mirror = Flip(false);
DEB_RETURN() << DEB_VAR1(mirror);
return mirror;
}
......@@ -921,8 +935,12 @@ void Geometry::getReadoutTime(double& readout_time)
THROW_HW_ERROR(NotSupported) << "Camera does not have "
<< "readout time calculation";
readFloatRegister(ReadoutTime, readout_time);
readout_time *= 1e-6;
if (isFrelon16(SPBType2) || isFrelon16(SPBType8)) {
readout_time = 100e-3;
} else {
readFloatRegister(ReadoutTime, readout_time);
readout_time *= 1e-6;
}
DEB_RETURN() << DEB_VAR1(readout_time);
}
......@@ -933,8 +951,12 @@ void Geometry::getTransferTime(double& xfer_time)
THROW_HW_ERROR(NotSupported) << "Camera does not have "
<< "shift time calculation";
readFloatRegister(TransferTime, xfer_time);
xfer_time *= 1e-6;
if (isFrelon16(SPBType2) || isFrelon16(SPBType8)) {
xfer_time = 100e-3;
} else {
readFloatRegister(TransferTime, xfer_time);
xfer_time *= 1e-6;
}
DEB_RETURN() << DEB_VAR1(xfer_time);
}
......
......@@ -875,10 +875,12 @@ void Interface::resetDefaults()
stopAcq();
bool f16 = (m_cam.getModel().getChipType() == Andanta_CcdFT2k);
FrameTransferMode ftm_seq[2] = {!f16 ? FFM : FTM, !f16 ? FTM : FFM};
FrameTransferMode ftm;
InputChan input_chan;
if (!m_cam.getDefInputChan(ftm=FFM, input_chan) &&
!m_cam.getDefInputChan(ftm=FTM, input_chan))
if (!m_cam.getDefInputChan(ftm=ftm_seq[0], input_chan) &&
!m_cam.getDefInputChan(ftm=ftm_seq[1], input_chan))
THROW_HW_ERROR(Error) << "Cannot find default input channel!!";
m_cam.setFrameTransferMode(ftm);
m_cam.setInputChan(input_chan);
......
......@@ -256,9 +256,13 @@ void Model::update()
}
DEB_TRACE() << DEB_VAR3(m_spb_type, m_spb_con_type, m_chip_type);
DEB_TRACE() << DEB_VAR6(has(Taper), has(HamaChip), has(ModesAvail),
has(TimeCalc), has(HTDCmd), has(GoodHTD));
DEB_TRACE() << DEB_VAR2(has(ImagesPerEOF), has(CamChar));
bool has_Taper = has(Taper), has_HamaChip = has(HamaChip);
bool has_ModesAvail = has(ModesAvail), has_TimeCalc = has(TimeCalc);
bool has_HTDCmd = has(HTDCmd), has_GoodHTD = has(GoodHTD);
bool has_ImagesPerEOF = has(ImagesPerEOF), has_CamChar = has(CamChar);
DEB_TRACE() << DEB_VAR6(has_Taper, has_HamaChip, has_ModesAvail,
has_TimeCalc, has_HTDCmd, has_GoodHTD);
DEB_TRACE() << DEB_VAR2(has_ImagesPerEOF, has_CamChar);
}
bool Model::isValid()
......
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