libapogee  3.0.3234
Ascent.h
1 
14 #ifndef ASCENT_INCLUDE_H__
15 #define ASCENT_INCLUDE_H__
16 
17 #include "CamGen2Base.h"
18 #include <string>
19 #include "ApogeeFilterWheel.h"
20 
21 class ApgTimer;
22 
23 class DLL_EXPORT Ascent : public CamGen2Base
24 {
25  public:
27  enum FilterWheelType
28  {
30  FW_UNKNOWN_TYPE = 0,
32  CFW25_6R = 7,
34  CFW31_8R = 8
35  };
36 
38  {
39  Ascent::FilterWheelType type;
40  std::string name;
41  uint16_t maxPositions;
42  };
43 
44  Ascent();
45 
46  void OpenConnection( const std::string & ioType,
47  const std::string & DeviceAddr,
48  const uint16_t FirmwareRev,
49  const uint16_t Id );
50 
51  void CloseConnection();
52 
53  virtual ~Ascent();
54 
60  void FilterWheelOpen( Ascent::FilterWheelType type );
61 
66  void FilterWheelClose();
67 
73  void SetFilterWheelPos( uint16_t pos );
74 
79  uint16_t GetFilterWheelPos();
80 
85  ApogeeFilterWheel::Status GetFilterWheelStatus();
86 
90  Ascent::FilterWheelType GetFilterWheelType() { return m_filterWheelType; }
91 
96  std::string GetFilterWheelName();
97 
102  uint16_t GetFilterWheelMaxPositions();
103 
104  void StartExposure( double Duration, bool IsLight );
105 
106  int32_t GetNumAdChannels();
107 
108 
109  void Init();
110 
115  bool IsDualReadoutSupported();
116 
126  void SetDualReadout( bool TurnOn );
127 
131  bool GetDualReadout();
132 
134  void SetFanMode( Apg::FanMode mode, bool PreCondCheck = true );
135 
136  protected:
137  Ascent(const std::string & ioType,
138  const std::string & DeviceAddr);
139 
140  void FixImgFromCamera( const std::vector<uint16_t> & data,
141  std::vector<uint16_t> & out, int32_t rows, int32_t cols );
142 
143  void CreateCamIo(const std::string & ioType,
144  const std::string & DeviceAddr);
145 
146  void ExposureAndGetImgRC(uint16_t & r, uint16_t & c);
147 
148  void UpdateCamRegIfNeeded();
149 
150  void SetIsInterlineBit();
151 
152  void SetIsAscentBit();
153 
154  private:
155  void StartFwTimer( uint16_t pos );
156  ApogeeFilterWheel::Status FwStatusFromTimer();
157  ApogeeFilterWheel::Status FwStatusFromCamera();
158 
159  void CfgCamFromId( uint16_t CameraId );
160 
161  void VerifyCamId();
162 
163  void UpdateCfgWithStrDbInfo();
164 
165  bool AreColsCentered();
166 
167  const std::string m_fileName;
168  Ascent::FilterWheelType m_filterWheelType;
169  double m_FwDiffTime;
170 
171 //this code removes vc++ compiler warning C4251
172 //from http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
173 #ifdef WIN_OS
174 #if _MSC_VER < 1600
175  template class DLL_EXPORT std::tr1::shared_ptr<ApgTimer>;
176 #endif
177 #endif
178 
179  std::tr1::shared_ptr<ApgTimer> m_FwTimer;
180 
181  //disabling the copy ctor and assignment operator
182  //generated by the compiler - don't want them
183  //Effective C++ Item 6
184  Ascent(const Ascent&);
185  Ascent& operator=(Ascent&);
186 };
187 
188 #endif
virtual void OpenConnection(const std::string &ioType, const std::string &DeviceAddr, const uint16_t FirmwareRev, const uint16_t Id)=0
FanMode
Definition: CameraInfo.h:264
Ascent::FilterWheelType GetFilterWheelType()
Definition: Ascent.h:90
virtual int32_t GetNumAdChannels()=0
virtual void CloseConnection()=0
virtual void SetFanMode(Apg::FanMode mode, bool PreCondCheck=true)=0
virtual void Init()=0
Definition: Ascent.h:37
virtual void StartExposure(double Duration, bool IsLight)=0
virtual Apg::FanMode GetFanMode()=0
This is the base class for the second generation apogee cameras (Ascent, Aspen, etc). This is a derived class of the ApogeeCam, which contains the function common to both Alta and second generation cameras.
Definition: CamGen2Base.h:19
Status
Definition: ApogeeFilterWheel.h:50
Implementation of the ascent camera.
Definition: Ascent.h:23