My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Scan.h
Go to the documentation of this file.
1 // $Id: Scan.h,v 1.4 2011/08/29 22:26:28 sjcm Exp $
2 
3 #ifndef GCP_ANTENNA_CONTROL_SCAN_H
4 #define GCP_ANTENNA_CONTROL_SCAN_H
5 
15 #include "gcp/control/code/unix/libunix_src/common/scancache.h"
16 
17 namespace gcp {
18  namespace antenna {
19  namespace control {
20 
21  class Scan {
22  public:
23 
27  Scan();
28  Scan(Scan& scan);
29  Scan(const Scan& scan);
30 
34  virtual ~Scan();
35 
36  void setupForHalt();
37 
38  void resetName();
39  void reset();
40 
41  void initialize(std::string name, unsigned ibody,
42  unsigned iend, unsigned nreps, unsigned seq,
43  unsigned msPerStep=1000, unsigned msPerSample=1000,
44  bool add=false);
45 
46  void extend(unsigned npt, unsigned* index, unsigned* flag,
47  int* azoff, int* eloff);
48 
49  void extend(unsigned npt, unsigned* index,
50  int* azoff, int* eloff, int* dkoff);
51 
52  unsigned rep() {
53  return current_.irep;
54  }
55 
56  unsigned nextRep() {
57  return offsets_.irep;
58  }
59 
61 
63 
67  bool justFinished() {
68  return justFinished_;
69  }
70 
71  unsigned& lastReq() {
72  return lastReq_;
73  }
74 
75  ScanMode& currentState() {
76  return current_.currentState;
77  }
78 
79  ScanMode& nextState() {
80  return current_.nextState;
81  }
82 
83  bool add() {
84  return add_;
85  }
86 
87  unsigned flag() {
88  return current_.flag;
89  }
90 
91  unsigned index() {
92  return current_.index;
93  }
94 
95  unsigned char* name() {
96  return name_;
97  }
98 
99  void pack(signed* s_elements);
100 
101  void operator=(Scan& scan);
102  void operator=(const Scan& scan);
103 
104  friend std::ostream& operator<<(std::ostream& os, Scan& scan);
105 
106  public:
107 
108  // Variable to keep track of the time elapsed since the last
109  // call to get the scan offsets
110 
111  bool checkLastMjd_;
112  gcp::util::TimeVal mjdLast_;
113  gcp::util::TimeVal mjdDiff_;
114 
115  bool initialized_;
116 
117  unsigned char name_[SCAN_LEN];
118  ScanCache offsets_;
119 
120  ScanCacheOffset current_;
121 
122  unsigned lastReq_;
123 
124  unsigned lastAck_;
125 
126  bool justFinished_;
127 
128  // True if the offsets are to be added to the current scan
129  // offsets, or are absolute scan offsets
130 
131  bool add_;
132 
133  }; // End class Scan
134 
135  std::ostream& operator<<(std::ostream& os, Scan& scan);
136 
137  } // End namespace control
138  } // End namespace antenna
139 } // End namespace gcp
140 
141 
142 
143 #endif // End #ifndef GCP_ANTENNA_CONTROL_SCAN_H
virtual ~Scan()
Definition: Scan.cc:39
ScanCacheOffset & nextOffset(gcp::util::TimeVal &mjd)
Definition: Scan.cc:185
Definition: scancache.h:22
void reset()
Definition: Scan.cc:67
Definition: Scan.h:21
ScanCacheOffset & nextOffsetTimeJump(gcp::util::TimeVal &mjd)
Definition: Scan.cc:141
Definition: TimeVal.h:55
void initialize(std::string name, unsigned ibody, unsigned iend, unsigned nreps, unsigned seq, unsigned msPerStep=1000, unsigned msPerSample=1000, bool add=false)
Definition: Scan.cc:119
bool justFinished()
Definition: Scan.h:67
Definition: scancache.h:62
Scan()
Definition: Scan.cc:13
void setupForHalt()
Definition: Scan.cc:47
void extend(unsigned npt, unsigned *index, unsigned *flag, int *azoff, int *eloff)
Definition: Scan.cc:102