| 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 | #include <map>
|
|---|
| 13 |
|
|---|
| 14 | #include "dis.hxx"
|
|---|
| 15 |
|
|---|
| 16 | #define MAX_NUM_BOARDS 13 // Maximum number of boards per crate
|
|---|
| 17 | #define NUM_CHANNELS 32 // Channels per bias board
|
|---|
| 18 | #define BAUDRATE B115200
|
|---|
| 19 |
|
|---|
| 20 | class User;
|
|---|
| 21 |
|
|---|
| 22 | class Crate {
|
|---|
| 23 |
|
|---|
| 24 | class User *m;
|
|---|
| 25 | int CrateNumber;
|
|---|
| 26 | int fDescriptor;
|
|---|
| 27 | FILE *File;
|
|---|
| 28 | DimService *NameService;
|
|---|
| 29 |
|
|---|
| 30 | std::vector<char> Communicate(std::string);
|
|---|
| 31 | void ClearVoltageArrays();
|
|---|
| 32 |
|
|---|
| 33 | public:
|
|---|
| 34 | Crate(std::string, int, class User *);
|
|---|
| 35 | ~Crate();
|
|---|
| 36 |
|
|---|
| 37 | char *Name;
|
|---|
| 38 | DimService *BiasVolt;
|
|---|
| 39 |
|
|---|
| 40 | int Current[MAX_NUM_BOARDS][NUM_CHANNELS];
|
|---|
| 41 | bool OC[MAX_NUM_BOARDS][NUM_CHANNELS];
|
|---|
| 42 | bool Present[MAX_NUM_BOARDS][NUM_CHANNELS];
|
|---|
| 43 | bool ResetHit;
|
|---|
| 44 | bool WrapOK;
|
|---|
| 45 | int WrapCount;
|
|---|
| 46 | int ErrorCount;
|
|---|
| 47 |
|
|---|
| 48 | unsigned int DAC[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in DAC units
|
|---|
| 49 | double Volt[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in Volt
|
|---|
| 50 | int CurrentOffset[MAX_NUM_BOARDS][NUM_CHANNELS]; // Offset for current measurement
|
|---|
| 51 |
|
|---|
| 52 | bool InitOK;
|
|---|
| 53 |
|
|---|
| 54 | int SetChannels(std::map<unsigned int, unsigned int>);
|
|---|
| 55 | int ReadAll();
|
|---|
| 56 | int SystemReset();
|
|---|
| 57 | int GlobalSet(unsigned int);
|
|---|
| 58 | bool Synch();
|
|---|
| 59 | bool CurrentCalib(double);
|
|---|
| 60 | };
|
|---|
| 61 |
|
|---|
| 62 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.