| Line | |
|---|
| 1 |
|
|---|
| 2 | #ifndef PROCESSIO_H_SEEN
|
|---|
| 3 | #define PROCESSIO_H_SEEN
|
|---|
| 4 |
|
|---|
| 5 | #include <stdarg.h>
|
|---|
| 6 | #include <errno.h>
|
|---|
| 7 | #include <math.h>
|
|---|
| 8 | #include <signal.h>
|
|---|
| 9 |
|
|---|
| 10 | #include "HVConfig.h"
|
|---|
| 11 | #include "HVCalib.h"
|
|---|
| 12 | #include "HV.h"
|
|---|
| 13 | #include "../pixelmap/PixelMap.h"
|
|---|
| 14 | #include "../drsdaq/SlowData.h"
|
|---|
| 15 |
|
|---|
| 16 | #define MAX_NUM_TOKEN 10
|
|---|
| 17 |
|
|---|
| 18 | #define MsgToConsole 1
|
|---|
| 19 | #define MsgToLog 2
|
|---|
| 20 | #define MsgToSocket 4
|
|---|
| 21 |
|
|---|
| 22 | typedef enum stateenum { active, stopped, na } state_enum;
|
|---|
| 23 |
|
|---|
| 24 | class ProcessIO {
|
|---|
| 25 |
|
|---|
| 26 | time_t StartTime;
|
|---|
| 27 | FILE *Logfile;
|
|---|
| 28 | PixelMap *pm;
|
|---|
| 29 |
|
|---|
| 30 | public:
|
|---|
| 31 |
|
|---|
| 32 | HVConfig *config;
|
|---|
| 33 | HVCalib *calib;
|
|---|
| 34 | HVBoard* fHVBoard[MAX_NUM_HVBOARDS];
|
|---|
| 35 | SlowData* SlowDataClass;
|
|---|
| 36 |
|
|---|
| 37 | pthread_mutex_t control_mutex;
|
|---|
| 38 |
|
|---|
| 39 | char Prompt[MAX_COM_SIZE];
|
|---|
| 40 | const char *Param[MAX_NUM_TOKEN]; // For parser
|
|---|
| 41 | int NParam;
|
|---|
| 42 | bool CmdFromSocket;
|
|---|
| 43 |
|
|---|
| 44 | // Status variables
|
|---|
| 45 | pthread_t HVMonitor; // exit function sends signal to these threads
|
|---|
| 46 | pthread_t SocketThread;
|
|---|
| 47 |
|
|---|
| 48 | bool Verbose;
|
|---|
| 49 | int Socket; // -1 if not connected
|
|---|
| 50 |
|
|---|
| 51 | int NumHVBoards;
|
|---|
| 52 | int FirstBoard;
|
|---|
| 53 | int LastBoard;
|
|---|
| 54 | int FirstChain;
|
|---|
| 55 | int LastChain;
|
|---|
| 56 |
|
|---|
| 57 | float fStatusRefreshRate;
|
|---|
| 58 | state_enum state;
|
|---|
| 59 | bool Exit;
|
|---|
| 60 |
|
|---|
| 61 | // Methods
|
|---|
| 62 | ProcessIO(const char *);
|
|---|
| 63 | ~ProcessIO();
|
|---|
| 64 |
|
|---|
| 65 | void PrintMessage(int, const char *, ...);
|
|---|
| 66 | void PrintMessage(const char *, ...);
|
|---|
| 67 | void PrintMessage(int, const char *, va_list);
|
|---|
| 68 | void CommandControl(char*);
|
|---|
| 69 | bool RampVoltage(unsigned int, int, int, int);
|
|---|
| 70 | void Monitor();
|
|---|
| 71 | void ResetBoard(int);
|
|---|
| 72 | int GetBoardIdx(int);
|
|---|
| 73 | void PrintBoardStatus(int);
|
|---|
| 74 | int ParseInput(char*, const char *Param[]);
|
|---|
| 75 | };
|
|---|
| 76 |
|
|---|
| 77 | bool Match(const char *, const char *);
|
|---|
| 78 | bool ConvertToDouble(const char *, double *);
|
|---|
| 79 | bool ConvertToInt(const char *, int *);
|
|---|
| 80 |
|
|---|
| 81 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.