source: fact/FADctrl/FAD.h@ 10120

Last change on this file since 10120 was 10120, checked in by ogrimm, 14 years ago
Moved OpenOtherSockets() to FADBoard class
File size: 2.0 KB
Line 
1#ifndef FAD_H_SEEN
2#define FAD_H_SEEN
3
4#define SERVER_NAME "FADctrl" // Name to use in DIM
5#include "Evidence.h"
6
7#include <readline/readline.h>
8
9#include <stdlib.h>
10#include <stdarg.h>
11#include <ctype.h>
12#include <time.h>
13#include <math.h>
14#include <errno.h>
15#include <unistd.h>
16#include <dirent.h>
17#include <sys/time.h>
18#include <limits>
19#include <fcntl.h>
20
21#include "FADBoard.h"
22
23const int DEFAULT_NUM_CALIB_EVENTS = 100;
24const char CALIB_DIRECTORY[] = "~/";
25
26
27class FAD: public EvidenceServer {
28
29 public:
30 enum ModeType {idle, datarun, acalib};
31 ModeType Mode;
32
33 private:
34 pthread_t MainThread;
35 DimCommand *Command;
36 DimService *ConsoleOut;
37 char *ConsoleText;
38 std::vector<std::string> Parameter;
39 void PrintUsage();
40 void commandHandler();
41 bool Match(std::string, const char *);
42 void EventThread();
43 static void LaunchEventThread(class FAD *);
44 pthread_t Thread;
45 float EventUpdateDelay;
46
47 int Datafile;
48 int NumEvents; // Number of event taken
49
50 std::vector<class FADBoard *> Boards;
51
52 struct Range {
53 int Min;
54 int Max;
55 };
56
57 bool ConvertToDouble(std::string, double *);
58 bool ConvertToInt(std::string, int *);
59 bool ConvertToRange(std::string, struct Range &);
60
61 public:
62 FAD();
63 ~FAD();
64
65 void cmd_exit(); void cmd_help();
66 void cmd_board(); void cmd_status();
67 void cmd_acalib(); void cmd_serial();
68 void cmd_trigger(); void cmd_socketmode();
69 void cmd_srclk(); void cmd_sclk();
70 void cmd_dwrite(); void cmd_domino();
71 void cmd_wmode(); void cmd_rmode();
72 void cmd_dmode(); void cmd_dac();
73 void cmd_roi(); void cmd_address();
74 void cmd_phase(); void cmd_send();
75 void cmd_stop(); void cmd_update();
76 void cmd_take();
77
78 void EnableDomino();
79 void DisableDomino();
80 void SoftTrigger();
81 //void SetDOMINOMode(int);
82 //void SetDOMINOReadMode(int);
83 //void SetDOMINOWaveMode(int);
84 void SaveAmplitudeCalibration();
85 void PrintMessage(const char*, ...);
86
87 int Pipe[2];
88 int NumEventsRequested; // Number of events requested
89 std::vector<std::string> BoardList;
90};
91
92#endif
Note: See TracBrowser for help on using the repository browser.