CARMA C++
Encoder.h
1 #ifndef ENCODER_H
2 #define ENCODER_H
3 
11 #include "carma/szautil/Axis.h"
13 
14 namespace sza {
15  namespace antenna {
16  namespace control {
17 
18  class PmacAxis;
19 
24  class Encoder {
25 
26  public:
27 
32 
36  void reset();
37 
41  void setZero(double zero);
42 
46  void setSlewRate(long rate);
47 
51  void setCountsPerTurn(int per_turn);
52 
56  void setCountsPerRadian(double countsPerRadian);
57 
61  void setLimits(long min, long max);
62 
67 
71  void convertMountToEncoder(double angle, double rate,
72  PmacAxis* axis, int current, bool ignoreWrapLogic=true);
76  void updateMountLimits();
77 
81  double getMountMin();
82 
86  double getMountMax();
87 
91  signed getSlewRate();
92 
96  double convertCountsToSky(int count);
97 
102  void packZero(signed* s_elements);
103 
108  void packCountsPerTurn(signed* s_elements);
109 
114  void packLimits(signed* s_elements);
115 
120  void setWrapMode(WrapMode::Mode mode);
124  WrapMode::Mode getWrapMode();
128  std::string getWrapModeString();
129 
130  private:
131 
135  sza::util::Axis::Type axis_;
136 
140  double zero_;
141 
145  double countsPerRadian_;
146 
150  int countsPerTurn_;
151 
155  int min_;
156 
160  int max_;
161 
165  double mountMin_;
166 
170  double mountMax_;
171 
175  signed slewRate_;
176 
177  WrapMode::Mode wrapMode_;
178 
179  }; // End class Encoder
180 
181  }; // End namespace control
182  }; // End namespace antenna
183 }; // End namespace sza
184 
185 #endif // End #ifndef
void packLimits(signed *s_elements)
Method for packing data to be archived in the register database.
void setZero(double zero)
Set the zero point of this encoder.
void setSlewRate(long rate)
Set the slew rate.
void convertMountToEncoder(double angle, double rate, PmacAxis *axis, int current, bool ignoreWrapLogic=true)
Convert from radians to encoder values on a given axis.
void packCountsPerTurn(signed *s_elements)
Pack this encoder multiplier for archival in the register database.
void reset()
Reset the parameters of this object.
void setWrapMode(WrapMode::Mode mode)
Method to set a requested wrap mode (ignored if this is not the AZ axis)
void setCountsPerRadian(double countsPerRadian)
Set the counts per radian for this encoder.
sza::util::Axis::Type getAxis()
Return the axis type of this encoder.
signed getSlewRate()
Get the slew rate.
double convertCountsToSky(int count)
Convert from encoder counts to radians on the sky.
Objects of the following type are used to aggregate the encoder calibration parameters of each axis...
Definition: Encoder.h:24
Tagged: Fri Apr 6 10:52:00 PDT 2012.
Type
An enumerator to identify a valid axis.
Definition: Axis.h:24
std::string getWrapModeString()
Method to get the requested wrap mode as a string.
double getMountMax()
Get the mount maximum.
WrapMode::Mode getWrapMode()
Method to get the requested wrap mode.
void updateMountLimits()
Update the mount limits.
void setLimits(long min, long max)
Set the limits.
Encoder(sza::util::Axis::Type axis)
Constructor.
void setCountsPerTurn(int per_turn)
Set the counts per turn for this encoder.
void packZero(signed *s_elements)
Pack encoder zero points for archival in the register database.
double getMountMin()
Get the mount minimum.
Encapsulate the encoder counts and rates for a telescope axis.
Definition: PmacAxis.h:26