Frelon.cpp 4.12 KB
Newer Older
1
#include "Frelon.h"
ahoms's avatar
ahoms committed
2
#include "MiscUtils.h"
3

ahoms's avatar
ahoms committed
4
using namespace lima;
5
using namespace lima::Frelon;
6
7
using namespace std;

8
typedef pair<Reg, string> RegPair;
ahoms's avatar
ahoms committed
9
10
static const RegPair RegStrCList[] = {
	RegPair(NbFrames,	"N"),
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
	RegPair(ExpTime,	"I"),
	RegPair(ShutCloseTime,	"F"),
	RegPair(LatencyTime,	"T"),
	RegPair(RoiLineBegin,	"RLB"),
	RegPair(RoiLineWidth,	"RLW"),
	RegPair(RoiPixelBegin,	"RPB"),
	RegPair(RoiPixelWidth,	"RPW"),
	RegPair(ChanMode,	"M"),
	RegPair(TimeUnit,	"Z"),
	RegPair(RoiEnable,	"R"),
	RegPair(RoiFast,	"RF"),
	RegPair(AntiBloom,	"BL"),
	RegPair(BinVert,	"BV"),
	RegPair(BinHorz,	"BH"),
	RegPair(ConfigHD,	"CNF"),
	RegPair(RoiKinetic,	"SPE"),
	RegPair(ShutEnable,	"U"),
	RegPair(HardTrigDisable,"HTD"),
29

30
31
32
	RegPair(PixelFreq,	"P"),
	RegPair(LineFreq,	"L"),

33
	RegPair(FlipMode,	"FLI"),
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	RegPair(IntCalib,	"IE"),
	RegPair(DisplayImage,	"X"),
	RegPair(AdcFloatDiode,	"ADS"),
	RegPair(AdcSignal,	"ASS"),
	RegPair(DarkPixelCalib,	"DPE"),
	RegPair(DarkPixelMode,	"DPM"),
	RegPair(ChanControl,	"CCS"),
	RegPair(Mire,		"MIR"),

	RegPair(AoiLineBegin,	"ALB"),
	RegPair(AoiLineWidth,	"ALW"),
	RegPair(AoiPixelBegin,	"APB"),
	RegPair(AoiPixelWidth,	"APW"),
	RegPair(AoiImageHeight,	"IMH"),
	RegPair(AoiImageWidth,	"IMW"),
	RegPair(ChanOnImage,	"COI"),
	RegPair(ChanOnCcd,	"COC"),

	RegPair(Version,	"VER"),
ahoms's avatar
ahoms committed
53
	RegPair(CompSerNb,	"SN"),
54
	RegPair(Warn,		"W"),
55
56
57
58
59
60
61
62
63
64
65
66
67
68
	RegPair(LastWarn,	"LW"),

	RegPair(LineClockPer,	"TLC"),
	RegPair(PixelClockPer,	"TPC"),
	RegPair(FirstPHIVLen,	"TFV"),
	RegPair(PHIHSetupLen,	"THS"),
	RegPair(SingleVertXfer,	"TOV"),
	RegPair(SingleHorzXfer,	"TOH"),
	RegPair(AllVertXfer,	"TAV"),
	RegPair(AllHorzXfer,	"TAH"),
	RegPair(ReadoutTime,	"TRD"),
	RegPair(TransferTime,	"TTR"),
	RegPair(CcdModesAvail,	"CMA"),

69
};
ahoms's avatar
ahoms committed
70
RegStrMapType lima::Frelon::RegStrMap(C_LIST_ITERS(RegStrCList));
71

72
73
74
75
76
77
static Reg CacheableRegCList[] = {
	NbFrames,	ExpTime,	ShutCloseTime,	LatencyTime,
	RoiLineBegin,	RoiLineWidth,	RoiPixelBegin,	RoiPixelWidth,
	ChanMode,	TimeUnit,	RoiEnable,	RoiFast,
	RoiKinetic,	BinVert,	BinHorz,	ConfigHD,
	ShutEnable,	HardTrigDisable, FlipMode,	CompSerNb,
78
79
};
RegListType 
80
lima::Frelon::CacheableRegList(C_LIST_ITERS(CacheableRegCList));
81
82

const int lima::Frelon::MaxRegVal = (1 << 16) - 1;
83
84

typedef pair<Cmd, string> CmdPair;
ahoms's avatar
ahoms committed
85
static const CmdPair CmdStrCList[] = {
86
87
88
89
90
	CmdPair(Reset,		"RST"),
	CmdPair(Start,		"S"),
	CmdPair(Stop,		"O"),
	CmdPair(Save,		"SAV"),
};
ahoms's avatar
ahoms committed
91
CmdStrMapType lima::Frelon::CmdStrMap(C_LIST_ITERS(CmdStrCList));
92
93
94


typedef pair<MultiLineCmd, string> MLCmdPair;
ahoms's avatar
ahoms committed
95
static const MLCmdPair MLCmdStrCList[] = {
96
97
98
99
100
	MLCmdPair(Help,		"H"),
	MLCmdPair(Config,	"C"),
	MLCmdPair(Dac,		"D"),
	MLCmdPair(Volt,		"V"),
	MLCmdPair(Aoi,		"AOI"),
101
102
	MLCmdPair(PLL,		"PLL"),
	MLCmdPair(Timing,	"TIM"),
103
};
ahoms's avatar
ahoms committed
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
MultiLineCmdStrMapType 
lima::Frelon::MultiLineCmdStrMap(C_LIST_ITERS(MLCmdStrCList));


typedef pair<FrameTransferMode, ChanRange> RangePair;
static const RangePair FTMChanRangeCList[] = {
	RangePair(FFM, ChanRange(1,  10)),
	RangePair(FTM, ChanRange(10, 13)),
};
FTMChanRangeMapType 
lima::Frelon::FTMChanRangeMap(C_LIST_ITERS(FTMChanRangeCList));


static const InputChan FFMInputChanCList[] = {
	Chan1, Chan2, Chan3, Chan4, Chan13, Chan24, Chan12, Chan34, Chan1234,
};
static const InputChan FTMInputChanCList[] = {
	Chan1234, Chan34, Chan12,
};
typedef pair<FrameTransferMode, InputChanList> InputChanPair;
static const InputChanPair FTMInputChanListCList[] = {
	InputChanPair(FFM, InputChanList(C_LIST_ITERS(FFMInputChanCList))),
	InputChanPair(FTM, InputChanList(C_LIST_ITERS(FTMInputChanCList))),
};
FTMInputChanListMapType 
lima::Frelon::FTMInputChanListMap(C_LIST_ITERS(FTMInputChanListCList));


132
133
134
135
136
137
138
139
140
typedef pair<TimeUnitFactor, double> FactorPair;
static const FactorPair TimeUnitFactorCList[] = {
	FactorPair(Milliseconds, 1e-3),
	FactorPair(Microseconds, 1e-6),
};
TimeUnitFactorMapType 
lima::Frelon::TimeUnitFactorMap(C_LIST_ITERS(TimeUnitFactorCList));


ahoms's avatar
ahoms committed
141
const FrameDim lima::Frelon::MaxFrameDim(2048, 2048, Bpp16);
142
143


144
145
146
147
typedef pair<ChipType, double> ChipSizePair;
static const ChipSizePair ChipPixelSizeCList[] = {
	ChipSizePair(Atmel, 14e-6),
	ChipSizePair(Kodak, 24e-6),
148
	ChipSizePair(E2V,   15e-6),
149
150
151
};
ChipPixelSizeMapType 
lima::Frelon::ChipPixelSizeMap(C_LIST_ITERS(ChipPixelSizeCList));