00001
00014 #ifndef ASCENT_INCLUDE_H__
00015 #define ASCENT_INCLUDE_H__
00016
00017 #include "CamGen2Base.h"
00018 #include <string>
00019 #include "ApogeeFilterWheel.h"
00020
00021 class ApgTimer;
00022
00023 class DLL_EXPORT Ascent : public CamGen2Base
00024 {
00025 public:
00027 enum FilterWheelType
00028 {
00030 FW_UNKNOWN_TYPE = 0,
00032 CFW25_6R = 7,
00034 CFW31_8R = 8
00035 };
00036
00037 struct FilterWheelInfo
00038 {
00039 Ascent::FilterWheelType type;
00040 std::string name;
00041 uint16_t maxPositions;
00042 };
00043
00044 Ascent();
00045
00046 void OpenConnection( const std::string & ioType,
00047 const std::string & DeviceAddr,
00048 const uint16_t FirmwareRev,
00049 const uint16_t Id );
00050
00051 void CloseConnection();
00052
00053 virtual ~Ascent();
00054
00060 void FilterWheelOpen( Ascent::FilterWheelType type );
00061
00066 void FilterWheelClose();
00067
00073 void SetFilterWheelPos( uint16_t pos );
00074
00079 uint16_t GetFilterWheelPos();
00080
00085 ApogeeFilterWheel::Status GetFilterWheelStatus();
00086
00090 Ascent::FilterWheelType GetFilterWheelType() { return m_filterWheelType; }
00091
00096 std::string GetFilterWheelName();
00097
00102 uint16_t GetFilterWheelMaxPositions();
00103
00104 void StartExposure( double Duration, bool IsLight );
00105
00106 int32_t GetNumAdChannels();
00107
00108
00109 void Init();
00110
00115 bool IsDualReadoutSupported();
00116
00126 void SetDualReadout( bool TurnOn );
00127
00131 bool GetDualReadout();
00132
00133 Apg::FanMode GetFanMode();
00134 void SetFanMode( Apg::FanMode mode, bool PreCondCheck = true );
00135
00136 protected:
00137 Ascent(const std::string & ioType,
00138 const std::string & DeviceAddr);
00139
00140 void FixImgFromCamera( const std::vector<uint16_t> & data,
00141 std::vector<uint16_t> & out, int32_t rows, int32_t cols );
00142
00143 void CreateCamIo(const std::string & ioType,
00144 const std::string & DeviceAddr);
00145
00146 void ExposureAndGetImgRC(uint16_t & r, uint16_t & c);
00147
00148 void UpdateCamRegIfNeeded();
00149
00150 void SetIsInterlineBit();
00151
00152 void SetIsAscentBit();
00153
00154 private:
00155 void StartFwTimer( uint16_t pos );
00156 ApogeeFilterWheel::Status FwStatusFromTimer();
00157 ApogeeFilterWheel::Status FwStatusFromCamera();
00158
00159 void CfgCamFromId( uint16_t CameraId );
00160
00161 void VerifyCamId();
00162
00163 void UpdateCfgWithStrDbInfo();
00164
00165 bool AreColsCentered();
00166
00167 const std::string m_fileName;
00168 Ascent::FilterWheelType m_filterWheelType;
00169 double m_FwDiffTime;
00170
00171
00172
00173 #ifdef WIN_OS
00174 template class DLL_EXPORT std::tr1::shared_ptr<ApgTimer>;
00175 #endif
00176
00177 std::tr1::shared_ptr<ApgTimer> m_FwTimer;
00178
00179
00180
00181
00182 Ascent(const Ascent&);
00183 Ascent& operator=(Ascent&);
00184 };
00185
00186 #endif