My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Model.h
Go to the documentation of this file.
1 #ifndef MODEL_H
2 #define MODEL_H
3 
11 #include "gcp/util/common/Axis.h"
12 #include "gcp/util/common/Collimation.h"
13 #include "gcp/util/common/PointingMode.h"
14 #include "gcp/util/common/PointingTelescopes.h"
15 
16 #include "gcp/antenna/control/specific/AzTilt.h"
17 #include "gcp/antenna/control/specific/FixedCollimation.h"
18 #include "gcp/antenna/control/specific/Flexure.h"
19 #include "gcp/antenna/control/specific/ElTilt.h"
20 #include "gcp/antenna/control/specific/Encoder.h"
21 #include "gcp/antenna/control/specific/TrackerOffset.h"
22 
23 #include "gcp/control/code/unix/libunix_src/specific/rtcnetcoms.h"
24 
25 #include <vector>
26 
27 namespace gcp {
28  namespace antenna {
29  namespace control {
30 
31  // Encapsulate the pointing model parameters.
32 
33  class Model {
34 
35  public:
36 
37  // Constructor.
38 
39  Model();
40 
41  // Destructor.
42 
43  ~Model();
44 
45  // Reset internal data members
46 
47  void reset();
48 
49  // Return a pointer to the requested collimation model
50 
53  gcp::util::PointingTelescopes::Ptel ptel=gcp::util::PointingTelescopes::PTEL_NONE,
54  gcp::util::Collimation::Type type =
55  gcp::util::Collimation::FIXED);
56 
57  // Set which pointing mode (optical or radio) is the current
58  // collimation mode)
59 
60  void setCurrentCollimation(gcp::util::PointingMode::Type mode,
61  gcp::util::PointingTelescopes::Ptel ptel);
62 
63  // Set the right collimation for whatever type is set.
64 
65  void setCurrentCollimation();
66 
67  // Set the right collimation for whatever type is set.
68 
69  void setCollimationType(gcp::util::Collimation::Type type);
70 
71  // Return a pointer to the current collimation model
72 
74  currentCollimation(gcp::util::Collimation::Type type);
75 
76  // Return a pointer to the requested flexure model
77 
80  gcp::util::PointingTelescopes::Ptel ptel=
81  gcp::util::PointingTelescopes::PTEL_NONE);
82 
83  // Set which pointing mode (optical or radio) is the current
84  // flexure mode)
85 
87  gcp::util::PointingTelescopes::Ptel ptel);
88 
89  // Return a pointer to the current flexure model
90 
92 
93  // Return a pointer to the requested encoder model
94 
97 
98  // Compute and store the new mount limits as angles on the sky
99 
100  void updateMountLimits();
101 
102  // Set the flexure term.
103 
104  void setFlexure(double flexure);
105 
106  // Return true if the passed collimation container is the current one.
107 
109  gcp::util::Collimation::Type type);
110 
111  // Return true if the passed flexure container is the current one.
112 
114 
115  // Adjust the elevation to account for telescope flexure.
116  //
117  // PointingCorrections* f = The elevation pointing to be
118  // corrected.
119 
121 
122  // Correct the collimation of the telescope.
123  //
124  // PointingCorrections* f = The az/el pointing to be
125  // corrected.
126 
128 
129  // Return a pointer to the requested tilt
130 
133 
134  // Pack the zero points for encoders managed by this object
135 
136  void packEncoderZeros(signed* s_elements);
137 
138  // Pack the multipliers for encoders managed by this object.
139 
140  void packEncoderMultipliers(signed* s_elements);
141 
142  // Pack the tilts managed by this object.
143 
144  void packTilts(signed* s_elements);
145 
146  // Pack the flexure term managed by this object.
147 
148  void packFlexure(signed* s_elements);
149 
150  // Pack which collimation mode is the current one.
151 
152  void packCollimationMode(unsigned* u_elements);
153  void packCollimationType(unsigned* u_elements);
154  gcp::util::PointingTelescopes::Ptel getCollimationPtel();
155 
156  // Pack the current collimation correction.
157 
158  void packCollimation(signed* s_elements,
159  gcp::util::Collimation::Type type);
160 
161  friend std::ostream& operator<<(std::ostream& os, Model& model);
162 
163  private:
164 
165  // The calibration of the azimuth encoder
166 
168 
169  // The calibration of the elevation encoder
170 
172 
173  // The calibration of the deck encoder
174 
176 
177  // The azimuth tilt
178 
179  AzTilt azt_;
180 
181  // The elevation tilt
182 
183  ElTilt elt_;
184 
185  //------------------------------------------------------------
186  // Collimation terms
187  //------------------------------------------------------------
188 
189  gcp::util::Collimation::Type collimationType_;
190  gcp::util::PointingMode::Type collimationMode_;
191  gcp::util::PointingTelescopes::Ptel collimationPtel_;
192 
193  // The collimation models for optical pointing
194 
195  std::vector<gcp::antenna::control::FixedCollimation>
196  fixedOpticalCollimation_;
197 
198  // The collimation model for radio pointing
199 
200  gcp::antenna::control::FixedCollimation fixedRadioCollimation_;
201 
202  // A pointer to the currently selected radio or or optical
203  // collimation model
204 
205  gcp::antenna::control::Collimation* currentFixedCollimation_;
206 
207  //------------------------------------------------------------
208  // Flexure terms
209  //------------------------------------------------------------
210 
211  // The flexure models for optical pointing
212 
213  std::vector<gcp::antenna::control::Flexure> opticalFlexure_;
214 
215  // The flexure model for radio pointing
216 
217  gcp::antenna::control::Flexure radioFlexure_;
218 
219  // A pointer to the currently selected radio or or optical
220  // flexure model
221 
222  gcp::antenna::control::Flexure* currentFlexure_;
223 
224  }; // End class Model
225 
226  }; // End namespace control
227  }; // End namespace antenna
228 } // End namespace gcp
229 
230 #endif // End #ifndef
void packCollimationType(unsigned *u_elements)
Definition: Model.cc:344
void packEncoderMultipliers(signed *s_elements)
Definition: Model.cc:309
void setCollimationType(gcp::util::Collimation::Type type)
Definition: Model.cc:218
bool isCurrent(gcp::antenna::control::Collimation *collim, gcp::util::Collimation::Type type)
Definition: Model.cc:194
void reset()
Definition: Model.cc:36
void packCollimation(signed *s_elements, gcp::util::Collimation::Type type)
Definition: Model.cc:352
gcp::antenna::control::Flexure * Flexure(gcp::util::PointingMode::Type mode, gcp::util::PointingTelescopes::Ptel ptel=gcp::util::PointingTelescopes::PTEL_NONE)
Definition: Model.cc:134
void updateMountLimits()
Definition: Model.cc:185
void packEncoderZeros(signed *s_elements)
Definition: Model.cc:300
Model()
Definition: Model.cc:19
Definition: TrackerOffset.h:28
Definition: AzTilt.h:22
~Model()
Definition: Model.cc:31
gcp::antenna::control::Collimation * currentCollimation(gcp::util::Collimation::Type type)
Definition: Model.cc:118
void applyCollimation(PointingCorrections *f, TrackerOffset &offset)
Definition: Model.cc:292
Definition: Model.h:33
void packTilts(signed *s_elements)
Definition: Model.cc:318
Definition: Collimation.h:24
gcp::antenna::control::Flexure * currentFlexure()
Definition: Model.cc:155
Definition: ElTilt.h:22
gcp::antenna::control::Encoder * Encoder(gcp::util::Axis::Type axis)
Definition: Model.cc:164
gcp::antenna::control::Collimation * Collimation(gcp::util::PointingMode::Type mode, gcp::util::PointingTelescopes::Ptel ptel=gcp::util::PointingTelescopes::PTEL_NONE, gcp::util::Collimation::Type type=gcp::util::Collimation::FIXED)
Definition: Model.cc:76
Type
Definition: PointingMode.h:25
void packFlexure(signed *s_elements)
Definition: Model.cc:328
Type
Definition: Axis.h:24
Definition: Encoder.h:24
Definition: AxisTilt.h:26
Definition: Flexure.h:19
gcp::antenna::control::AxisTilt * AxisTilt(gcp::util::Axis::Type axis)
Definition: Model.cc:369
void applyFlexure(PointingCorrections *f)
Definition: Model.cc:281
void packCollimationMode(unsigned *u_elements)
Definition: Model.cc:336
Definition: FixedCollimation.h:26
Definition: PointingCorrections.h:22
void setCurrentFlexure(gcp::util::PointingMode::Type mode, gcp::util::PointingTelescopes::Ptel ptel)
Definition: Model.cc:257