source: fact/BIASctrl/User.h@ 13178

Last change on this file since 13178 was 11919, checked in by ogrimm, 13 years ago
Added simple bias current calibration
File size: 1.3 KB
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#include <string>
10#include <pthread.h>
11#include <limits>
12
13#define SERVER_NAME "Bias" // Name to use in DIM
14#include "Evidence.h"
15
16#include "Crate.h"
17#include "../pixelmap/PixelMap.h"
18
19#define MAX_COM_SIZE 5000
20
21class User: public EvidenceServer {
22
23 enum RunMode {mode_static, mode_dynamic};
24
25 PixelMap *PixMap;
26 DimCommand *DIMCommand;
27 DimService *ConsoleOut;
28 char *ConsoleText;
29 pthread_t MainThread, Thread;
30 std::vector<std::string> Parameter;
31 RunMode Mode;
32
33 class Crate *Dev;
34 std::vector<double> DefaultVoltage;
35 std::vector<double> R, I0;
36
37 void commandHandler();
38
39 struct Range {
40 int Min;
41 int Max;
42 };
43
44 bool Match(std::string, const char *);
45 bool ConvertToDouble(std::string, double *);
46 bool ConvertToInt(std::string, int *);
47 bool ConvertToRange(std::string, struct Range &);
48
49 public:
50 User(std::string);
51 ~User();
52
53 void PrintMessage(const char *, ...);
54 unsigned int RampVoltages(std::map<unsigned int, double>);
55 void Monitor();
56 static void LaunchMonitor(User *);
57
58 void cmd_hv(); void cmd_synch();
59 void cmd_status(); void cmd_gs();
60 void cmd_load(); void cmd_save();
61 void cmd_exit(); void cmd_reset();
62 void cmd_help(); void cmd_mode();
63 void cmd_shell(); void cmd_calib();
64};
65
66#endif
Note: See TracBrowser for help on using the repository browser.