source: fact/BIASctrl/Crate.h@ 10052

Last change on this file since 10052 was 10052, checked in by ogrimm, 14 years ago
Added bulk command transfer
File size: 1.3 KB
Line 
1#ifndef HV_H_SEEN
2#define HV_H_SEEN
3
4#include <termios.h> // POSIX terminal control definitions
5#include <fcntl.h> // File control definitions => fcntl() in fcn OpenPort()
6#include <errno.h>
7#include <stdio.h>
8#include <unistd.h>
9#include <sys/ioctl.h>
10#include <string>
11#include <vector>
12
13#include "dis.hxx"
14
15#define MAX_NUM_BOARDS 13 // Maximum number of boards per crate
16#define NUM_CHANNELS 32 // Channels per bias board
17#define BAUDRATE B115200
18
19class User;
20
21class Crate {
22
23 class User *m;
24 int CrateNumber;
25 int fDescriptor;
26 FILE *File;
27 DimService *NameService;
28
29 std::vector<char> Communicate(unsigned char*, int);
30 void ClearVoltageArrays();
31
32 public:
33 Crate(std::string, int, class User *);
34 ~Crate();
35
36 char *Name;
37 DimService *BiasVolt;
38
39 int Current[MAX_NUM_BOARDS][NUM_CHANNELS];
40 bool OC[MAX_NUM_BOARDS][NUM_CHANNELS];
41 bool ResetHit;
42 bool WrapOK;
43 int WrapCount;
44 int ErrorCount;
45
46 int DAC[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in DAC units
47 double Volt[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in Volt
48 int CurrentOffset[MAX_NUM_BOARDS][NUM_CHANNELS]; // Offset for current measurement
49
50 bool InitOK;
51
52 int SetAll();
53 int ReadAll();
54 int SystemReset();
55 int ReadChannel(unsigned int, unsigned int);
56 int GlobalSet(unsigned int);
57 int ChannelSet(int, int, unsigned int);
58 bool Synch();
59 bool CurrentCalib(double);
60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.