CAENPhaDriver.h 4.49 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 * Nomad Instrument Control Software
 *
 * Copyright 2011 Institut Laue-Langevin
 *
 * Licensed under the EUPL, Version 1.1 only (the "License");
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * http://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */

#ifndef CAENPHADRIVER_H
#define CAENPHADRIVER_H

#include <Driver.h>
#include "drivers/global/Vme.h"

namespace caen_pha {

/*!
 * \class CAENPhaDriver
 * \brief Main class for the CAENPhaDriver device driver
 *
 * \par
 * Class for CAENPhaDriver driver. Implements DeviceDriver methods.
 * \par
 * The CAENPhaDriver device manages the global functionality of the CAEN Pha VME Digitiser.
 */

class CAENPhaDriver : public driver::Vme {

public:

	//! Driver type value
	static const std::string TYPE;

	/*!
	 * \brief Constructor
	 * \param[in] name the name of the device driver
	 */
	CAENPhaDriver(const std::string& name);

	/*!
	 * \brief Destructor
	 */
	virtual ~CAENPhaDriver();

	/*!
	 * \brief Method called for executing a command
	 *
	 * \param[in] command the command to apply on the controller
	 */
	virtual void execute(const std::string& aCommand);

	// Global properties
	Property<int32> nbChannels;
	Property<int32> nbBits;
    Property<int32> model;
    Property<int32>	channels;
    Property<int32> serialNumber;
    Property<std::string> modelName;
    Property<std::string> rocFirmware;
    Property<std::string> amcFirmware;

    // Board properties
    Property<int32> linkType;
    Property<int32> acqMode;
    Property<int32> dppAcqMode;
    Property<std::string> dppAcqModeStr;
    Property<int32> saveMode;
    Property<std::string> saveModeStr;
    Property<int32> recordLength;					// Nb samples for oscilloscope mode
    Property<int32> ioLevel;
    Property<int32> triggerMode;
    Property<int32> channelMask;

Paolo Mutti's avatar
Paolo Mutti committed
84
85
86
87
88
89
90
	// Coincidence properties
	Property<int32> enableCoincidence;
	Property<int32> coincidenceWindow;
	Property<int32> coincidenceMask;

    Property<int32> usePn1Coincidence;

91
92
93
94
95
96
97
98
99
100
101
102
103
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
132
133
134
135
	// Channels properties in dppParams
	DynamicProperty<int32> signalDecayTime;			// M - range 0:65535
	DynamicProperty<int32> trapezoidFlatTop;		// m - range 0:1023
	DynamicProperty<int32> trapezoidRiseTime;		// k - range 0:1023
	DynamicProperty<int32> flatTopDelay;			// ftd (peaking)
	DynamicProperty<int32> triggerSmoothing;		// a - range 0:63
	DynamicProperty<int32> signalRiseTime;			// b - range 0:255
	DynamicProperty<int32> triggerThreshold;		// thr - range 0:16383
	DynamicProperty<int32> baselineMean;			// nsbl - range 0:6 (no baseline, 16, 64, 256, 1024, 4096, 16384)
	DynamicProperty<int32> peakMean;				// nspk - range 0:3 (1, 4, 16, 64 samples)
	DynamicProperty<int32> peakHoldOff;				// pkho - range 0:255
	DynamicProperty<int32> baselineHoldOff;			// blho - range 0:255
	DynamicProperty<int32> triggerHoldOff;			// trgho - range 0:63
	DynamicProperty<int32> triggerWindowSize;		// twwdt
	DynamicProperty<int32> triggerWindowEnable;		// trgwin - range 0:1
	DynamicProperty<int32> digitalGain;				// dgain - range 0:3 (1, 2, 4, 8)
	DynamicProperty<float64> trapezoidGain; 		// enf
	DynamicProperty<int32> decimation;				// decimation - range 0:3 (disabled, 2, 4 8)

	// Channels properties outside dppParam
	DynamicProperty<int32> channelActive;
	DynamicProperty<std::string> channelActiveStr;
	DynamicProperty<int32> dcOffset;
	DynamicProperty<int32> preTrigger;				// range 0:1023 (nSamples = pre_trig x 2)
	DynamicProperty<int32> pulsePolarity;			// invert input - range 0:1
	DynamicProperty<std::string> pulsePolarityStr;
	DynamicProperty<int32> useFirstDerivative;		// use first derivative - range 0:1

	// Commands
	static const std::string WRITE_PARAMETERS_COMMAND;
	static const std::string SET_MODE_COMMAND;
	static const std::string RESET_COMMAND;
	static const std::string CLEAR_COMMAND;

private:

	void refreshNbChannelsProperty(int32 aValue) throw (CannotSetValue);
	void refreshDppAcqModeProperty(int32 aValue) throw (CannotSetValue);
	void refreshSaveModeProperty(int32 aValue) throw (CannotSetValue);
	void refreshChannelActiveProperty(int32 index, int32 aValue) throw (CannotSetValue);
	void refreshPulsePolarityProperty(int32 index, int32 aValue) throw (CannotSetValue);
};

}
#endif //CAENPHADRIVER_H