source: fact/BIASctrl/User.h@ 10190

Last change on this file since 10190 was 10153, checked in by ogrimm, 14 years ago
New command 'crate', changed signalling of program exit
File size: 1.4 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
21#define MIN_RATE 0.01
22#define MAX_RATE 50.0
23
24class User: public EvidenceServer {
25
26 enum RunMode {mode_static, mode_dynamic};
27
28 PixelMap *PixMap;
29 DimCommand *DIMCommand;
30 DimService *ConsoleOut;
31 char *ConsoleText;
32 pthread_t MainThread, Thread;
33 std::vector<std::string> Parameter;
34 RunMode Mode;
35
36 std::vector<class Crate *> Crates;
37
38 void commandHandler();
39
40 struct Range {
41 int Min;
42 int Max;
43 };
44
45 bool Match(std::string, const char *);
46 bool ConvertToDouble(std::string, double *);
47 bool ConvertToInt(std::string, int *);
48 bool ConvertToRange(std::string, struct Range &);
49
50 public:
51 double fTimeOut;
52 float fStatusRefreshRate;
53 double fMaxDiff;
54 int ActiveCrate;
55
56 User();
57 ~User();
58
59 void PrintMessage(const char *, ...);
60 unsigned int RampVoltages(int, std::map<unsigned int, double>);
61 void Monitor();
62 static void LaunchMonitor(User *);
63
64 void cmd_hv(); void cmd_synch();
65 void cmd_status(); void cmd_gs();
66 void cmd_load(); void cmd_save();
67 void cmd_exit(); void cmd_rate();
68 void cmd_timeout(); void cmd_reset();
69 void cmd_help(); void cmd_mode();
70 void cmd_crate();
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.