Commit 6bb776df authored by ics's avatar ics
Browse files

Cfd2 update

parent 78bfc237
......@@ -111,6 +111,14 @@ CAENCfd2Driver::CAENCfd2Driver(const std::string& name) {
adcTemperature.init(this, NOSAVE, "adc_temperature");
trapGate.init(this, SAVE, "trap_gate");
traceType.init(this, SAVE, "trace_type");
cfdThres.init(this, SAVE, "cfd_thres");
// Init the device command list
initCommand(driver::INIT_COMMAND);
initCommand(driver::READ_INFOS_COMMAND);
......
......@@ -130,6 +130,11 @@ public:
// Channels adc temperature
DynamicProperty<int32> adcTemperature;
// PVE add 24 01 2020
Property<int32> trapGate;
Property<int32> traceType;
Property<int32> cfdThres;
// Commands
static const std::string WRITE_PARAMETERS_COMMAND;
static const std::string SET_MODE_COMMAND;
......
......@@ -332,10 +332,13 @@ void RealCAENCfd2Driver::writeParam() {
registerSetBits(0x1080 + (i<<8), 26, 26, 1); // enable rollover tracing // enable rollover tracing
*/
ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x1058 + (i<<8), 0x138);
ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x1058 + (i<<8), owner()->trapGate.get());
// ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x1058 + (i<<8), 0x138);
ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x106C + (i<<8), thr); // thr
ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x1038 + (i<<8), owner()->preTrigger.get(i) / 4); // pretrg
ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x10D0 + (i<<8), 0x60A6);
ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x10D0 + (i<<8), ((owner()->cfdThres.get() & 0xF)<<12) + ((owner()->triggerSmoothing.get(i) & 0xF) << 4)+ (owner()->traceType.get() & 0xF));
// ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x10D0 + (i<<8), 0x60A6);
// ret |= CAEN_DGTZ_WriteRegister(m_boardHandle, 0x10D0 + (i<<8), 0x6006);
registerSetBits(0x1080 + (i<<8), 16, 16, int32(owner()->pulsePolarity.get(i)));
// Write CFD parameters
......
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