diff options
Diffstat (limited to 'kstars/kstars/indi/apogee')
97 files changed, 27935 insertions, 0 deletions
diff --git a/kstars/kstars/indi/apogee/Apn.h b/kstars/kstars/indi/apogee/Apn.h new file mode 100644 index 00000000..c5071e50 --- /dev/null +++ b/kstars/kstars/indi/apogee/Apn.h @@ -0,0 +1,56 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#define APN_DRIVER_VERSION "2.0.13.0" + +#define APN_HBINNING_MAX 10 +#define APN_VBINNING_MAX 2048 + +#define APN_TIMER_RESOLUTION 0.00000256 +#define APN_PERIOD_TIMER_RESOLUTION 0.000000040 + +#define APN_TIMER_OFFSET_COUNT 3 + +#define APN_SEQUENCE_DELAY_RESOLUTION 0.000327 +#define APN_SEQUENCE_DELAY_LIMIT 21.429945 + +#define APN_EXPOSURE_TIME_MIN 0.00001 // 10us is the defined min. +#define APN_EXPOSURE_TIME_MAX 10990.0 // seconds + +#define APN_TDI_RATE_RESOLUTION 0.00000512 +#define APN_TDI_RATE_MIN 0.00000512 +#define APN_TDI_RATE_MAX 0.336 + +#define APN_VOLTAGE_RESOLUTION 0.00439453 + +#define APN_SHUTTER_CLOSE_DIFF 0.00001024 + +#define APN_STROBE_POSITION_MIN 0.00000331 +#define APN_STROBE_POSITION_MAX 0.1677 +#define APN_STROBE_PERIOD_MIN 0.000000045 +#define APN_STROBE_PERIOD_MAX 0.0026 + +#define APN_TEMP_COUNTS 4096 +#define APN_TEMP_KELVIN_SCALE_OFFSET 273.16 + +#define APN_TEMP_SETPOINT_MIN 213 +#define APN_TEMP_SETPOINT_MAX 313 + +#define APN_TEMP_HEATSINK_MIN 240 +#define APN_TEMP_HEATSINK_MAX 340 + +#define APN_TEMP_SETPOINT_ZERO_POINT 2458 +#define APN_TEMP_HEATSINK_ZERO_POINT 1351 + +#define APN_TEMP_DEGREES_PER_BIT 0.024414 + +#define APN_FAN_SPEED_OFF 0 +#define APN_FAN_SPEED_LOW 3100 +#define APN_FAN_SPEED_MEDIUM 3660 +#define APN_FAN_SPEED_HIGH 4095 diff --git a/kstars/kstars/indi/apogee/ApnCamData.cpp b/kstars/kstars/indi/apogee/ApnCamData.cpp new file mode 100644 index 00000000..da339741 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData.cpp @@ -0,0 +1,130 @@ +// ApnCamData.cpp: implementation of the CApnCamData class. +// +// Copyright (c) 2003, 2004 Apogee Instruments, Inc. +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ApnCamData.h" + +#include <stdlib.h> +#include <malloc.h> + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CApnCamData::CApnCamData() +{ + init_vpattern(); + + init_hpattern( &m_ClampPatternSixteen ); + init_hpattern( &m_SkipPatternSixteen ); + init_hpattern( &m_RoiPatternSixteen ); + + init_hpattern( &m_ClampPatternTwelve ); + init_hpattern( &m_SkipPatternTwelve ); + init_hpattern( &m_RoiPatternTwelve ); +} + +CApnCamData::~CApnCamData() +{ + clear_vpattern(); + + clear_hpattern( &m_ClampPatternSixteen ); + clear_hpattern( &m_SkipPatternSixteen ); + clear_hpattern( &m_RoiPatternSixteen ); + + clear_hpattern( &m_ClampPatternTwelve ); + clear_hpattern( &m_SkipPatternTwelve ); + clear_hpattern( &m_RoiPatternTwelve ); +} + + +void CApnCamData::init_vpattern( ) +{ + // OutputDebugString( "init_vpattern()" ); + + m_VerticalPattern.Mask = 0x0; + m_VerticalPattern.NumElements = 0; + m_VerticalPattern.PatternData = NULL; +} + + +void CApnCamData::clear_vpattern( ) +{ + // OutputDebugString( "clear_vpattern()" ); + + m_VerticalPattern.Mask = 0x0; + m_VerticalPattern.NumElements = 0; + + if ( m_VerticalPattern.PatternData != NULL ) + { + free( m_VerticalPattern.PatternData ); + m_VerticalPattern.PatternData = NULL; + } +} + + +void CApnCamData::init_hpattern( APN_HPATTERN_FILE *Pattern ) +{ + int Counter; + + // OutputDebugString( "init_hpattern()" ); + + Pattern->Mask = 0x0; + Pattern->RefNumElements = 0; + Pattern->SigNumElements = 0; + Pattern->BinningLimit = 0; + + Pattern->RefPatternData = NULL; + Pattern->SigPatternData = NULL; + + for ( Counter=0; Counter<APN_MAX_HBINNING; Counter++ ) + { + Pattern->BinNumElements[Counter] = 0; + Pattern->BinPatternData[Counter] = NULL; + } +} + + +void CApnCamData::clear_hpattern( APN_HPATTERN_FILE *Pattern ) +{ + int Counter; + // char szMsg[80]; + + // OutputDebugString( "clear_hpattern()" ); + + Pattern->Mask = 0x0; + Pattern->RefNumElements = 0; + Pattern->SigNumElements = 0; + Pattern->BinningLimit = 0; + + if ( Pattern->RefPatternData != NULL ) + { + // OutputDebugString( "Freeing Allocated Reference Pattern Memory" ); + free( Pattern->RefPatternData ); + + Pattern->RefPatternData = NULL; + } + if ( Pattern->SigPatternData != NULL ) + { + // OutputDebugString( "Freeing Allocated Signal Pattern Memory" ); + free( Pattern->SigPatternData ); + + Pattern->SigPatternData = NULL; + } + + for ( Counter=0; Counter<APN_MAX_HBINNING; Counter++ ) + { + Pattern->BinNumElements[Counter] = 0; + if ( Pattern->BinPatternData[Counter] != NULL ) + { + // sprintf( szMsg, "Freeing Allocated Binning Pattern Memory (Binning = %d)", Counter+1 ); + // OutputDebugString( szMsg ); + free( Pattern->BinPatternData[Counter] ); + + Pattern->BinPatternData[Counter] = NULL; + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData.h b/kstars/kstars/indi/apogee/ApnCamData.h new file mode 100644 index 00000000..7ec3539d --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData.h @@ -0,0 +1,124 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// ApnCamData.h: interface for the CApnCamData class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNCAMDATA_H__32231556_A1FD_421B_94F8_295D4148E195__INCLUDED_) +#define AFX_APNCAMDATA_H__32231556_A1FD_421B_94F8_295D4148E195__INCLUDED_ + +#define APN_MAX_HBINNING 10 +#define APN_MAX_PATTERN_ENTRIES 256 + + +typedef struct _APN_VPATTERN_FILE { + unsigned short Mask; + unsigned short NumElements; + unsigned short *PatternData; +} APN_VPATTERN_FILE; + +typedef struct _APN_HPATTERN_FILE { + unsigned short Mask; + unsigned short BinningLimit; + unsigned short RefNumElements; + unsigned short BinNumElements[APN_MAX_HBINNING]; + unsigned short SigNumElements; + unsigned short *RefPatternData; + unsigned short *BinPatternData[APN_MAX_HBINNING]; + unsigned short *SigPatternData; +} APN_HPATTERN_FILE; + + +class CApnCamData +{ +public: + CApnCamData(); + virtual ~CApnCamData(); + + virtual void Initialize() = 0; + + + char m_Sensor[20]; + char m_CameraModel[20]; + + unsigned short m_CameraId; + + bool m_InterlineCCD; + bool m_SupportsSerialA; + bool m_SupportsSerialB; + bool m_SensorTypeCCD; + + unsigned short m_TotalColumns; + unsigned short m_ImagingColumns; + + unsigned short m_ClampColumns; + unsigned short m_PreRoiSkipColumns; + unsigned short m_PostRoiSkipColumns; + unsigned short m_OverscanColumns; + + unsigned short m_TotalRows; + unsigned short m_ImagingRows; + + unsigned short m_UnderscanRows; + unsigned short m_OverscanRows; + + unsigned short m_VFlushBinning; + + bool m_EnableSingleRowOffset; + unsigned short m_RowOffsetBinning; + + bool m_HFlushDisable; + + unsigned short m_ShutterCloseDelay; + + double m_PixelSizeX; + double m_PixelSizeY; + + bool m_Color; + + double m_ReportedGainSixteenBit; + + double m_MinSuggestedExpTime; + + bool m_CoolingSupported; + bool m_RegulatedCoolingSupported; + + double m_TempSetPoint; + unsigned short m_TempRampRateOne; + unsigned short m_TempRampRateTwo; + double m_TempBackoffPoint; + + unsigned short m_DefaultGainTwelveBit; + unsigned short m_DefaultOffsetTwelveBit; + unsigned short m_DefaultRVoltage; + + + // Pattern Files + APN_VPATTERN_FILE m_VerticalPattern; + + APN_HPATTERN_FILE m_ClampPatternSixteen; + APN_HPATTERN_FILE m_SkipPatternSixteen; + APN_HPATTERN_FILE m_RoiPatternSixteen; + + APN_HPATTERN_FILE m_ClampPatternTwelve; + APN_HPATTERN_FILE m_SkipPatternTwelve; + APN_HPATTERN_FILE m_RoiPatternTwelve; + + +private: + + void init_vpattern( ); + void clear_vpattern( ); + + void init_hpattern( APN_HPATTERN_FILE *Pattern ); + void clear_hpattern( APN_HPATTERN_FILE *Pattern ); + +}; + +#endif // !defined(AFX_APNCAMDATA_H__32231556_A1FD_421B_94F8_295D4148E195__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD3011HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD3011HS.cpp new file mode 100644 index 00000000..8ea6b7de --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD3011HS.cpp @@ -0,0 +1,582 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD3011HS.cpp: Implementation file for the CApnCamData_CCD3011HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD3011HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD3011HS::CApnCamData_CCD3011HS() +{ +} + + +CApnCamData_CCD3011HS::~CApnCamData_CCD3011HS() +{ +} + + +void CApnCamData_CCD3011HS::Initialize() +{ + strcpy( m_Sensor, "CCD3011HS" ); + strcpy( m_CameraModel, "30" ); + m_CameraId = 21; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1040; + m_ImagingColumns = 1024; + m_ClampColumns = 8; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 8; + m_TotalRows = 256; + m_ImagingRows = 256; + m_UnderscanRows = 0; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 26; + m_PixelSizeY = 26; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD3011HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD3011HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD3011HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD3011HS.h new file mode 100644 index 00000000..6ffa3a6c --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD3011HS.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD3011HS.h: Interface file for the CApnCamData_CCD3011HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD3011HS : public CApnCamData +{ +public: + CApnCamData_CCD3011HS(); + virtual ~CApnCamData_CCD3011HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD3011LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD3011LS.cpp new file mode 100644 index 00000000..565c3f88 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD3011LS.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD3011LS.cpp: Implementation file for the CApnCamData_CCD3011LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD3011LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD3011LS::CApnCamData_CCD3011LS() +{ +} + + +CApnCamData_CCD3011LS::~CApnCamData_CCD3011LS() +{ +} + + +void CApnCamData_CCD3011LS::Initialize() +{ + strcpy( m_Sensor, "CCD3011LS" ); + strcpy( m_CameraModel, "30" ); + m_CameraId = 20; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1040; + m_ImagingColumns = 1024; + m_ClampColumns = 8; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 8; + m_TotalRows = 256; + m_ImagingRows = 256; + m_UnderscanRows = 0; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 26; + m_PixelSizeY = 26; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD3011LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD3011LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD3011LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD3011LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD3011LS.h new file mode 100644 index 00000000..018d2e23 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD3011LS.h @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD3011LS.h: Interface file for the CApnCamData_CCD3011LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD3011LS : public CApnCamData +{ +public: + CApnCamData_CCD3011LS(); + virtual ~CApnCamData_CCD3011LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4020HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4020HS.h new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4020HS.h @@ -0,0 +1 @@ + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4240HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4240HS.cpp new file mode 100644 index 00000000..cfb84f14 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4240HS.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4240HS.cpp: Implementation file for the CApnCamData_CCD4240HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4240HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4240HS::CApnCamData_CCD4240HS() +{ +} + + +CApnCamData_CCD4240HS::~CApnCamData_CCD4240HS() +{ +} + + +void CApnCamData_CCD4240HS::Initialize() +{ + strcpy( m_Sensor, "CCD4240HS" ); + strcpy( m_CameraModel, "42" ); + m_CameraId = 16; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 2148; + m_ImagingColumns = 2048; + m_ClampColumns = 50; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 50; + m_TotalRows = 2052; + m_ImagingRows = 2048; + m_UnderscanRows = 2; + m_OverscanRows = 2; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 600; + m_PixelSizeX = 13.5; + m_PixelSizeY = 13.5; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4240HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4240HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4240HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4240HS.h new file mode 100644 index 00000000..612ebdd0 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4240HS.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4240HS.h: Interface file for the CApnCamData_CCD4240HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4240HS : public CApnCamData +{ +public: + CApnCamData_CCD4240HS(); + virtual ~CApnCamData_CCD4240HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4240LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4240LS.cpp new file mode 100644 index 00000000..d768dad0 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4240LS.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4240LS.cpp: Implementation file for the CApnCamData_CCD4240LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4240LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4240LS::CApnCamData_CCD4240LS() +{ +} + + +CApnCamData_CCD4240LS::~CApnCamData_CCD4240LS() +{ +} + + +void CApnCamData_CCD4240LS::Initialize() +{ + strcpy( m_Sensor, "CCD4240LS" ); + strcpy( m_CameraModel, "42" ); + m_CameraId = 17; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 2148; + m_ImagingColumns = 2048; + m_ClampColumns = 50; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 50; + m_TotalRows = 2052; + m_ImagingRows = 2048; + m_UnderscanRows = 2; + m_OverscanRows = 2; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 600; + m_PixelSizeX = 13.5; + m_PixelSizeY = 13.5; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4240LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4240LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4240LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4240LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4240LS.h new file mode 100644 index 00000000..4767d428 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4240LS.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4240LS.h: Interface file for the CApnCamData_CCD4240LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4240LS : public CApnCamData +{ +public: + CApnCamData_CCD4240LS(); + virtual ~CApnCamData_CCD4240LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4710HS.cpp new file mode 100644 index 00000000..2b0dde8e --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710HS.cpp @@ -0,0 +1,566 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710HS.cpp: Implementation file for the CApnCamData_CCD4710HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4710HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4710HS::CApnCamData_CCD4710HS() +{ +} + + +CApnCamData_CCD4710HS::~CApnCamData_CCD4710HS() +{ +} + + +void CApnCamData_CCD4710HS::Initialize() +{ + strcpy( m_Sensor, "CCD4710HS" ); + strcpy( m_CameraModel, "47" ); + m_CameraId = 11; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 1027; + m_ImagingRows = 1024; + m_UnderscanRows = 3; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4710HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4710HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, + 0x00D0, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0054, 0x0044 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4710HS.h new file mode 100644 index 00000000..b07baedb --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710HS.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710HS.h: Interface file for the CApnCamData_CCD4710HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4710HS : public CApnCamData +{ +public: + CApnCamData_CCD4710HS(); + virtual ~CApnCamData_CCD4710HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS.cpp new file mode 100644 index 00000000..7ab60fb8 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS.cpp: Implementation file for the CApnCamData_CCD4710LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4710LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4710LS::CApnCamData_CCD4710LS() +{ +} + + +CApnCamData_CCD4710LS::~CApnCamData_CCD4710LS() +{ +} + + +void CApnCamData_CCD4710LS::Initialize() +{ + strcpy( m_Sensor, "CCD4710LS" ); + strcpy( m_CameraModel, "47" ); + m_CameraId = 10; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 1027; + m_ImagingRows = 1024; + m_UnderscanRows = 3; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4710LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4710LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS.h new file mode 100644 index 00000000..417bfc66 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS.h: Interface file for the CApnCamData_CCD4710LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4710LS : public CApnCamData +{ +public: + CApnCamData_CCD4710LS(); + virtual ~CApnCamData_CCD4710LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS2.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS2.cpp new file mode 100644 index 00000000..a23176f3 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS2.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS2.cpp: Implementation file for the CApnCamData_CCD4710LS2 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4710LS2.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4710LS2::CApnCamData_CCD4710LS2() +{ +} + + +CApnCamData_CCD4710LS2::~CApnCamData_CCD4710LS2() +{ +} + + +void CApnCamData_CCD4710LS2::Initialize() +{ + strcpy( m_Sensor, "CCD4710LS2" ); + strcpy( m_CameraModel, "47" ); + m_CameraId = 12; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 1027; + m_ImagingRows = 1024; + m_UnderscanRows = 3; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4710LS2::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4710LS2::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS2::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS2::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS2::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS2::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS2::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS2::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS2.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS2.h new file mode 100644 index 00000000..07482590 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS2.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS2.h: Interface file for the CApnCamData_CCD4710LS2 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4710LS2 : public CApnCamData +{ +public: + CApnCamData_CCD4710LS2(); + virtual ~CApnCamData_CCD4710LS2(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS3.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS3.cpp new file mode 100644 index 00000000..8650c0b2 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS3.cpp @@ -0,0 +1,571 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS3.cpp: Implementation file for the CApnCamData_CCD4710LS3 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4710LS3.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4710LS3::CApnCamData_CCD4710LS3() +{ +} + + +CApnCamData_CCD4710LS3::~CApnCamData_CCD4710LS3() +{ +} + + +void CApnCamData_CCD4710LS3::Initialize() +{ + strcpy( m_Sensor, "CCD4710LS3" ); + strcpy( m_CameraModel, "47" ); + m_CameraId = 13; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 1027; + m_ImagingRows = 1024; + m_UnderscanRows = 3; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4710LS3::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4710LS3::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS3::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS3::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 42; + const unsigned short SigNumElements = 56; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006E, 0x006E, 0x006A, 0x006A, 0x106A, 0x106A, 0x106A, 0x007A, 0x007A, 0x007A, + 0x007A, 0x007A, 0x0072, 0x0072, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, + 0x0076, 0x0076, 0x0076, 0x0076, 0x00F6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, + 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, + 0x00D6, 0x00D6 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x00D6, + 0x00D6, 0x00D6, 0x00D6, 0x00D6, 0x0056, 0x0046, 0x0046, 0x0046, 0x0046, 0x0046, + 0x0046, 0x0146, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, + 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, + 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, + 0x0106, 0x0106, 0x0106, 0x8106, 0x8107, 0x0406 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D6, 0x00D6 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS3::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS3::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS3::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS3::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS3.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS3.h new file mode 100644 index 00000000..ca8fcce3 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS3.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS3.h: Interface file for the CApnCamData_CCD4710LS3 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4710LS3 : public CApnCamData +{ +public: + CApnCamData_CCD4710LS3(); + virtual ~CApnCamData_CCD4710LS3(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS4.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS4.cpp new file mode 100644 index 00000000..23cec00b --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS4.cpp @@ -0,0 +1,571 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS4.cpp: Implementation file for the CApnCamData_CCD4710LS4 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4710LS4.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4710LS4::CApnCamData_CCD4710LS4() +{ +} + + +CApnCamData_CCD4710LS4::~CApnCamData_CCD4710LS4() +{ +} + + +void CApnCamData_CCD4710LS4::Initialize() +{ + strcpy( m_Sensor, "CCD4710LS4" ); + strcpy( m_CameraModel, "47" ); + m_CameraId = 15; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 1027; + m_ImagingRows = 1024; + m_UnderscanRows = 3; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4710LS4::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4710LS4::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS4::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS4::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 42; + const unsigned short SigNumElements = 56; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8105, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS4::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS4::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS4::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS4::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS4.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS4.h new file mode 100644 index 00000000..18623bc3 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS4.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS4.h: Interface file for the CApnCamData_CCD4710LS4 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4710LS4 : public CApnCamData +{ +public: + CApnCamData_CCD4710LS4(); + virtual ~CApnCamData_CCD4710LS4(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS5.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS5.cpp new file mode 100644 index 00000000..625bcc5b --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS5.cpp @@ -0,0 +1,571 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS5.cpp: Implementation file for the CApnCamData_CCD4710LS5 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4710LS5.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4710LS5::CApnCamData_CCD4710LS5() +{ +} + + +CApnCamData_CCD4710LS5::~CApnCamData_CCD4710LS5() +{ +} + + +void CApnCamData_CCD4710LS5::Initialize() +{ + strcpy( m_Sensor, "CCD4710LS5" ); + strcpy( m_CameraModel, "47" ); + m_CameraId = 28; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 1027; + m_ImagingRows = 1024; + m_UnderscanRows = 3; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4710LS5::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4710LS5::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS5::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS5::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 42; + const unsigned short SigNumElements = 56; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8105, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS5::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS5::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS5::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4710LS5::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS5.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS5.h new file mode 100644 index 00000000..23907e5e --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4710LS5.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4710LS5.h: Interface file for the CApnCamData_CCD4710LS5 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4710LS5 : public CApnCamData +{ +public: + CApnCamData_CCD4710LS5(); + virtual ~CApnCamData_CCD4710LS5(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; + + diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4720HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4720HS.cpp new file mode 100644 index 00000000..e95d6dc2 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4720HS.cpp @@ -0,0 +1,550 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4720HS.cpp: Implementation file for the CApnCamData_CCD4720HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4720HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4720HS::CApnCamData_CCD4720HS() +{ +} + + +CApnCamData_CCD4720HS::~CApnCamData_CCD4720HS() +{ +} + + +void CApnCamData_CCD4720HS::Initialize() +{ + strcpy( m_Sensor, "CCD4720HS" ); + strcpy( m_CameraModel, "4720" ); + m_CameraId = 25; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 2057; + m_ImagingRows = 1024; + m_UnderscanRows = 1033; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = true; + m_RowOffsetBinning = 1033; + m_HFlushDisable = false; + m_ShutterCloseDelay = 0; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 1.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4720HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 23; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0006, 0x0006, 0x0006, + 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4720HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4720HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4720HS.h new file mode 100644 index 00000000..4616b0fb --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4720HS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4720HS.h: Interface file for the CApnCamData_CCD4720HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4720HS : public CApnCamData +{ +public: + CApnCamData_CCD4720HS(); + virtual ~CApnCamData_CCD4720HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4720LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD4720LS.cpp new file mode 100644 index 00000000..c46098cd --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4720LS.cpp @@ -0,0 +1,550 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4720LS.cpp: Implementation file for the CApnCamData_CCD4720LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD4720LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD4720LS::CApnCamData_CCD4720LS() +{ +} + + +CApnCamData_CCD4720LS::~CApnCamData_CCD4720LS() +{ +} + + +void CApnCamData_CCD4720LS::Initialize() +{ + strcpy( m_Sensor, "CCD4720LS" ); + strcpy( m_CameraModel, "4720" ); + m_CameraId = 24; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1072; + m_ImagingColumns = 1024; + m_ClampColumns = 24; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 24; + m_TotalRows = 2057; + m_ImagingRows = 1024; + m_UnderscanRows = 1033; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = true; + m_RowOffsetBinning = 1033; + m_HFlushDisable = false; + m_ShutterCloseDelay = 0; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 1.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD4720LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 23; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0006, 0x0006, 0x0006, + 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD4720LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD4720LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD4720LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD4720LS.h new file mode 100644 index 00000000..5ace563c --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD4720LS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD4720LS.h: Interface file for the CApnCamData_CCD4720LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD4720LS : public CApnCamData +{ +public: + CApnCamData_CCD4720LS(); + virtual ~CApnCamData_CCD4720LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5520HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD5520HS.cpp new file mode 100644 index 00000000..657200e3 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5520HS.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5520HS.cpp: Implementation file for the CApnCamData_CCD5520HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD5520HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD5520HS::CApnCamData_CCD5520HS() +{ +} + + +CApnCamData_CCD5520HS::~CApnCamData_CCD5520HS() +{ +} + + +void CApnCamData_CCD5520HS::Initialize() +{ + strcpy( m_Sensor, "CCD5520HS" ); + strcpy( m_CameraModel, "55" ); + m_CameraId = 23; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 804; + m_ImagingColumns = 770; + m_ClampColumns = 17; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 17; + m_TotalRows = 1152; + m_ImagingRows = 1152; + m_UnderscanRows = 0; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 22.5; + m_PixelSizeY = 22.5; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD5520HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD5520HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5520HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD5520HS.h new file mode 100644 index 00000000..0e4c2a34 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5520HS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5520HS.h: Interface file for the CApnCamData_CCD5520HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD5520HS : public CApnCamData +{ +public: + CApnCamData_CCD5520HS(); + virtual ~CApnCamData_CCD5520HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5520LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD5520LS.cpp new file mode 100644 index 00000000..1dc66328 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5520LS.cpp @@ -0,0 +1,572 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5520LS.cpp: Implementation file for the CApnCamData_CCD5520LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD5520LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD5520LS::CApnCamData_CCD5520LS() +{ +} + + +CApnCamData_CCD5520LS::~CApnCamData_CCD5520LS() +{ +} + + +void CApnCamData_CCD5520LS::Initialize() +{ + strcpy( m_Sensor, "CCD5520LS" ); + strcpy( m_CameraModel, "55" ); + m_CameraId = 22; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 804; + m_ImagingColumns = 770; + m_ClampColumns = 17; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 17; + m_TotalRows = 1152; + m_ImagingRows = 1152; + m_UnderscanRows = 0; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 22.5; + m_PixelSizeY = 22.5; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD5520LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 247; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, 0x000A, + 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD5520LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5520LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5520LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD5520LS.h new file mode 100644 index 00000000..3f2b18fe --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5520LS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5520LS.h: Interface file for the CApnCamData_CCD5520LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD5520LS : public CApnCamData +{ +public: + CApnCamData_CCD5520LS(); + virtual ~CApnCamData_CCD5520LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5710HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD5710HS.cpp new file mode 100644 index 00000000..fd737cbe --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5710HS.cpp @@ -0,0 +1,550 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5710HS.cpp: Implementation file for the CApnCamData_CCD5710HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD5710HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD5710HS::CApnCamData_CCD5710HS() +{ +} + + +CApnCamData_CCD5710HS::~CApnCamData_CCD5710HS() +{ +} + + +void CApnCamData_CCD5710HS::Initialize() +{ + strcpy( m_Sensor, "CCD5710HS" ); + strcpy( m_CameraModel, "57" ); + m_CameraId = 19; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 536; + m_ImagingColumns = 512; + m_ClampColumns = 12; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 12; + m_TotalRows = 1056; + m_ImagingRows = 512; + m_UnderscanRows = 536; + m_OverscanRows = 8; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = true; + m_RowOffsetBinning = 536; + m_HFlushDisable = false; + m_ShutterCloseDelay = 0; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 1.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD5710HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 23; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0006, 0x0006, 0x0006, + 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD5710HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5710HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD5710HS.h new file mode 100644 index 00000000..f455126e --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5710HS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5710HS.h: Interface file for the CApnCamData_CCD5710HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD5710HS : public CApnCamData +{ +public: + CApnCamData_CCD5710HS(); + virtual ~CApnCamData_CCD5710HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5710LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD5710LS.cpp new file mode 100644 index 00000000..438cf29d --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5710LS.cpp @@ -0,0 +1,550 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5710LS.cpp: Implementation file for the CApnCamData_CCD5710LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD5710LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD5710LS::CApnCamData_CCD5710LS() +{ +} + + +CApnCamData_CCD5710LS::~CApnCamData_CCD5710LS() +{ +} + + +void CApnCamData_CCD5710LS::Initialize() +{ + strcpy( m_Sensor, "CCD5710LS" ); + strcpy( m_CameraModel, "57" ); + m_CameraId = 18; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 536; + m_ImagingColumns = 512; + m_ClampColumns = 12; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 12; + m_TotalRows = 1056; + m_ImagingRows = 512; + m_UnderscanRows = 536; + m_OverscanRows = 8; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = true; + m_RowOffsetBinning = 536; + m_HFlushDisable = false; + m_ShutterCloseDelay = 0; + m_PixelSizeX = 13; + m_PixelSizeY = 13; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 1.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD5710LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 23; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0006, 0x0006, 0x0006, + 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD5710LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD5710LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD5710LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD5710LS.h new file mode 100644 index 00000000..546b5387 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD5710LS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD5710LS.h: Interface file for the CApnCamData_CCD5710LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD5710LS : public CApnCamData +{ +public: + CApnCamData_CCD5710LS(); + virtual ~CApnCamData_CCD5710LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD7700HS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD7700HS.cpp new file mode 100644 index 00000000..7fdf2860 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD7700HS.cpp @@ -0,0 +1,554 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD7700HS.cpp: Implementation file for the CApnCamData_CCD7700HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD7700HS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD7700HS::CApnCamData_CCD7700HS() +{ +} + + +CApnCamData_CCD7700HS::~CApnCamData_CCD7700HS() +{ +} + + +void CApnCamData_CCD7700HS::Initialize() +{ + strcpy( m_Sensor, "CCD7700HS" ); + strcpy( m_CameraModel, "77" ); + m_CameraId = 27; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 527; + m_ImagingColumns = 512; + m_ClampColumns = 15; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 0; + m_TotalRows = 512; + m_ImagingRows = 512; + m_UnderscanRows = 0; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 24; + m_PixelSizeY = 24; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD7700HS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 61; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0008, + 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD7700HS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700HS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700HS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700HS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700HS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700HS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700HS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD7700HS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD7700HS.h new file mode 100644 index 00000000..8ffb861e --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD7700HS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD7700HS.h: Interface file for the CApnCamData_CCD7700HS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD7700HS : public CApnCamData +{ +public: + CApnCamData_CCD7700HS(); + virtual ~CApnCamData_CCD7700HS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD7700LS.cpp b/kstars/kstars/indi/apogee/ApnCamData_CCD7700LS.cpp new file mode 100644 index 00000000..5e146a5d --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD7700LS.cpp @@ -0,0 +1,554 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD7700LS.cpp: Implementation file for the CApnCamData_CCD7700LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_CCD7700LS.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_CCD7700LS::CApnCamData_CCD7700LS() +{ +} + + +CApnCamData_CCD7700LS::~CApnCamData_CCD7700LS() +{ +} + + +void CApnCamData_CCD7700LS::Initialize() +{ + strcpy( m_Sensor, "CCD7700LS" ); + strcpy( m_CameraModel, "77" ); + m_CameraId = 26; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 527; + m_ImagingColumns = 512; + m_ClampColumns = 15; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 0; + m_TotalRows = 512; + m_ImagingRows = 512; + m_UnderscanRows = 0; + m_OverscanRows = 0; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 24; + m_PixelSizeY = 24; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 300; + m_DefaultOffsetTwelveBit = 100; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_CCD7700LS::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 61; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0000, 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0008, + 0x0008, 0x0008, 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_CCD7700LS::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700LS::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 22; + const unsigned short SigNumElements = 8; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x0068, 0x006A, 0x006A, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D0, 0x00D0, 0x00D0, 0x00D0, 0x00D4, 0x00D4, + 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0054, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700LS::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 48; + const unsigned short SigNumElements = 65; + + unsigned short RefPatternData[RefNumElements] = + { + 0x006C, 0x006C, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0070, 0x0070, 0x0074, 0x0074, 0x0076, 0x0076, 0x0076, 0x0074, + 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x1074, 0x1074, 0x0074, 0x0074, 0x0074, + 0x00F4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x00D4, + 0x00D4, 0x00D4, 0x00D4, 0x00D4, 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0144, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x8104, 0x8104, 0x0004, 0x0004, 0x0004, 0x0004, 0x0404, + 0x0404, 0x0004, 0x0004, 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x0024, 0x0058, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x00D4, 0x00D4 + }, + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x004C, 0x004C, 0x004C, 0x004C, 0x004C, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0058, 0x0058, 0x0058, 0x0058, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044 + }, + { + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700LS::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700LS::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0005, 0x0004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700LS::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0017 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x000C, 0x0008, 0x400A, 0x000A, 0x0008, 0x0008, 0x0218, 0x0018, 0x0018, 0x0018, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0014, 0x2014, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x8005, 0x8004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_CCD7700LS::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_CCD7700LS.h b/kstars/kstars/indi/apogee/ApnCamData_CCD7700LS.h new file mode 100644 index 00000000..423efe14 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_CCD7700LS.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_CCD7700LS.h: Interface file for the CApnCamData_CCD7700LS class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_CCD7700LS : public CApnCamData +{ +public: + CApnCamData_CCD7700LS(); + virtual ~CApnCamData_CCD7700LS(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF0261E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF0261E.cpp new file mode 100644 index 00000000..423f2eb4 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF0261E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF0261E.cpp: Implementation file for the CApnCamData_KAF0261E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF0261E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF0261E::CApnCamData_KAF0261E() +{ +} + + +CApnCamData_KAF0261E::~CApnCamData_KAF0261E() +{ +} + + +void CApnCamData_KAF0261E::Initialize() +{ + strcpy( m_Sensor, "KAF0261E" ); + strcpy( m_CameraModel, "260" ); + m_CameraId = 2; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 530; + m_ImagingColumns = 512; + m_ClampColumns = 8; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 10; + m_TotalRows = 520; + m_ImagingRows = 512; + m_UnderscanRows = 4; + m_OverscanRows = 4; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 20; + m_PixelSizeY = 20; + m_Color = false; + m_ReportedGainSixteenBit = 3; + m_MinSuggestedExpTime = 10.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF0261E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF0261E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0261E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0261E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0261E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0261E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0261E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0261E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF0261E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF0261E.h new file mode 100644 index 00000000..9aaefee7 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF0261E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF0261E.h: Interface file for the CApnCamData_KAF0261E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF0261E : public CApnCamData +{ +public: + CApnCamData_KAF0261E(); + virtual ~CApnCamData_KAF0261E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF0401E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF0401E.cpp new file mode 100644 index 00000000..63e4d2f8 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF0401E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF0401E.cpp: Implementation file for the CApnCamData_KAF0401E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF0401E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF0401E::CApnCamData_KAF0401E() +{ +} + + +CApnCamData_KAF0401E::~CApnCamData_KAF0401E() +{ +} + + +void CApnCamData_KAF0401E::Initialize() +{ + strcpy( m_Sensor, "KAF0401E" ); + strcpy( m_CameraModel, "1" ); + m_CameraId = 0; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 796; + m_ImagingColumns = 768; + m_ClampColumns = 14; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 14; + m_TotalRows = 520; + m_ImagingRows = 512; + m_UnderscanRows = 4; + m_OverscanRows = 4; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 9; + m_PixelSizeY = 9; + m_Color = false; + m_ReportedGainSixteenBit = 1.5; + m_MinSuggestedExpTime = 10.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF0401E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF0401E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0401E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0401E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0401E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0401E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0401E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF0401E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF0401E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF0401E.h new file mode 100644 index 00000000..5c947b9a --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF0401E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF0401E.h: Interface file for the CApnCamData_KAF0401E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF0401E : public CApnCamData +{ +public: + CApnCamData_KAF0401E(); + virtual ~CApnCamData_KAF0401E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1001E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF1001E.cpp new file mode 100644 index 00000000..6f58201d --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1001E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1001E.cpp: Implementation file for the CApnCamData_KAF1001E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF1001E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF1001E::CApnCamData_KAF1001E() +{ +} + + +CApnCamData_KAF1001E::~CApnCamData_KAF1001E() +{ +} + + +void CApnCamData_KAF1001E::Initialize() +{ + strcpy( m_Sensor, "KAF1001E" ); + strcpy( m_CameraModel, "6" ); + m_CameraId = 5; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1044; + m_ImagingColumns = 1024; + m_ClampColumns = 8; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 12; + m_TotalRows = 1032; + m_ImagingRows = 1024; + m_UnderscanRows = 4; + m_OverscanRows = 4; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 24; + m_PixelSizeY = 24; + m_Color = false; + m_ReportedGainSixteenBit = 3; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF1001E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF1001E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1001E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1001E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1001E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1001E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1001E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1001E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1001E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF1001E.h new file mode 100644 index 00000000..2e23c278 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1001E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1001E.h: Interface file for the CApnCamData_KAF1001E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF1001E : public CApnCamData +{ +public: + CApnCamData_KAF1001E(); + virtual ~CApnCamData_KAF1001E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1301E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF1301E.cpp new file mode 100644 index 00000000..46d62d17 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1301E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1301E.cpp: Implementation file for the CApnCamData_KAF1301E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF1301E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF1301E::CApnCamData_KAF1301E() +{ +} + + +CApnCamData_KAF1301E::~CApnCamData_KAF1301E() +{ +} + + +void CApnCamData_KAF1301E::Initialize() +{ + strcpy( m_Sensor, "KAF1301E" ); + strcpy( m_CameraModel, "13" ); + m_CameraId = 3; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1305; + m_ImagingColumns = 1280; + m_ClampColumns = 4; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 21; + m_TotalRows = 1028; + m_ImagingRows = 1024; + m_UnderscanRows = 2; + m_OverscanRows = 2; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 16; + m_PixelSizeY = 16; + m_Color = false; + m_ReportedGainSixteenBit = 3; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF1301E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF1301E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1301E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1301E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1301E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1301E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1301E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1301E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1301E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF1301E.h new file mode 100644 index 00000000..5ca47f78 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1301E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1301E.h: Interface file for the CApnCamData_KAF1301E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF1301E : public CApnCamData +{ +public: + CApnCamData_KAF1301E(); + virtual ~CApnCamData_KAF1301E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1401E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF1401E.cpp new file mode 100644 index 00000000..4c21d3bf --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1401E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1401E.cpp: Implementation file for the CApnCamData_KAF1401E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF1401E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF1401E::CApnCamData_KAF1401E() +{ +} + + +CApnCamData_KAF1401E::~CApnCamData_KAF1401E() +{ +} + + +void CApnCamData_KAF1401E::Initialize() +{ + strcpy( m_Sensor, "KAF1401E" ); + strcpy( m_CameraModel, "14" ); + m_CameraId = 4; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1348; + m_ImagingColumns = 1320; + m_ClampColumns = 26; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 2; + m_TotalRows = 1037; + m_ImagingRows = 1035; + m_UnderscanRows = 1; + m_OverscanRows = 1; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 6.8; + m_PixelSizeY = 6.8; + m_Color = false; + m_ReportedGainSixteenBit = 1; + m_MinSuggestedExpTime = 10.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF1401E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF1401E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1401E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1401E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1401E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1401E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1401E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1401E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1401E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF1401E.h new file mode 100644 index 00000000..9ffedcec --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1401E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1401E.h: Interface file for the CApnCamData_KAF1401E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF1401E : public CApnCamData +{ +public: + CApnCamData_KAF1401E(); + virtual ~CApnCamData_KAF1401E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1602E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF1602E.cpp new file mode 100644 index 00000000..e46da326 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1602E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1602E.cpp: Implementation file for the CApnCamData_KAF1602E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF1602E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF1602E::CApnCamData_KAF1602E() +{ +} + + +CApnCamData_KAF1602E::~CApnCamData_KAF1602E() +{ +} + + +void CApnCamData_KAF1602E::Initialize() +{ + strcpy( m_Sensor, "KAF1602E" ); + strcpy( m_CameraModel, "2" ); + m_CameraId = 1; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 1564; + m_ImagingColumns = 1536; + m_ClampColumns = 14; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 14; + m_TotalRows = 1032; + m_ImagingRows = 1024; + m_UnderscanRows = 4; + m_OverscanRows = 4; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 9; + m_PixelSizeY = 9; + m_Color = false; + m_ReportedGainSixteenBit = 1.5; + m_MinSuggestedExpTime = 10.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF1602E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF1602E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1602E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1602E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1602E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1602E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1602E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF1602E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF1602E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF1602E.h new file mode 100644 index 00000000..c768852d --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF1602E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF1602E.h: Interface file for the CApnCamData_KAF1602E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF1602E : public CApnCamData +{ +public: + CApnCamData_KAF1602E(); + virtual ~CApnCamData_KAF1602E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF16801E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF16801E.cpp new file mode 100644 index 00000000..19054ce3 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF16801E.cpp @@ -0,0 +1,619 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF16801E.cpp: Implementation file for the CApnCamData_KAF16801E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF16801E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF16801E::CApnCamData_KAF16801E() +{ +} + + +CApnCamData_KAF16801E::~CApnCamData_KAF16801E() +{ +} + + +void CApnCamData_KAF16801E::Initialize() +{ + strcpy( m_Sensor, "KAF16801E" ); + strcpy( m_CameraModel, "16" ); + m_CameraId = 9; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 4145; + m_ImagingColumns = 4098; + m_ClampColumns = 35; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 12; + m_TotalRows = 4128; + m_ImagingRows = 4098; + m_UnderscanRows = 10; + m_OverscanRows = 20; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 9; + m_PixelSizeY = 9; + m_Color = false; + m_ReportedGainSixteenBit = 1.5; + m_MinSuggestedExpTime = 30.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF16801E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 116; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, + 0x0204, 0x0004, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF16801E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x2; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF16801E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x2; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF16801E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x2; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF16801E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF16801E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF16801E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF16801E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF16801E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF16801E.h new file mode 100644 index 00000000..f46680a4 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF16801E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF16801E.h: Interface file for the CApnCamData_KAF16801E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF16801E : public CApnCamData +{ +public: + CApnCamData_KAF16801E(); + virtual ~CApnCamData_KAF16801E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF3200E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF3200E.cpp new file mode 100644 index 00000000..e63e6899 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF3200E.cpp @@ -0,0 +1,611 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF3200E.cpp: Implementation file for the CApnCamData_KAF3200E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF3200E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF3200E::CApnCamData_KAF3200E() +{ +} + + +CApnCamData_KAF3200E::~CApnCamData_KAF3200E() +{ +} + + +void CApnCamData_KAF3200E::Initialize() +{ + strcpy( m_Sensor, "KAF3200E" ); + strcpy( m_CameraModel, "32" ); + m_CameraId = 6; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 2267; + m_ImagingColumns = 2184; + m_ClampColumns = 46; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 37; + m_TotalRows = 1510; + m_ImagingRows = 1472; + m_UnderscanRows = 34; + m_OverscanRows = 4; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 6.8; + m_PixelSizeY = 6.8; + m_Color = false; + m_ReportedGainSixteenBit = 1; + m_MinSuggestedExpTime = 10.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF3200E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 39; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, 0x0204, + 0x0204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF3200E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x2; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF3200E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x2; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF3200E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x2; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF3200E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF3200E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF3200E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF3200E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF3200E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF3200E.h new file mode 100644 index 00000000..ee166530 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF3200E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF3200E.h: Interface file for the CApnCamData_KAF3200E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF3200E : public CApnCamData +{ +public: + CApnCamData_KAF3200E(); + virtual ~CApnCamData_KAF3200E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF4202.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF4202.cpp new file mode 100644 index 00000000..c9931294 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF4202.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF4202.cpp: Implementation file for the CApnCamData_KAF4202 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF4202.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF4202::CApnCamData_KAF4202() +{ +} + + +CApnCamData_KAF4202::~CApnCamData_KAF4202() +{ +} + + +void CApnCamData_KAF4202::Initialize() +{ + strcpy( m_Sensor, "KAF4202" ); + strcpy( m_CameraModel, "4" ); + m_CameraId = 7; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 2060; + m_ImagingColumns = 2032; + m_ClampColumns = 25; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 3; + m_TotalRows = 2048; + m_ImagingRows = 2044; + m_UnderscanRows = 2; + m_OverscanRows = 2; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 9; + m_PixelSizeY = 9; + m_Color = false; + m_ReportedGainSixteenBit = 1.5; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF4202::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF4202::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF4202::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF4202::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF4202::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF4202::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF4202::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF4202::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF4202.h b/kstars/kstars/indi/apogee/ApnCamData_KAF4202.h new file mode 100644 index 00000000..e34c51b0 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF4202.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF4202.h: Interface file for the CApnCamData_KAF4202 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF4202 : public CApnCamData +{ +public: + CApnCamData_KAF4202(); + virtual ~CApnCamData_KAF4202(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF6303E.cpp b/kstars/kstars/indi/apogee/ApnCamData_KAF6303E.cpp new file mode 100644 index 00000000..cded741c --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF6303E.cpp @@ -0,0 +1,615 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF6303E.cpp: Implementation file for the CApnCamData_KAF6303E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_KAF6303E.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_KAF6303E::CApnCamData_KAF6303E() +{ +} + + +CApnCamData_KAF6303E::~CApnCamData_KAF6303E() +{ +} + + +void CApnCamData_KAF6303E::Initialize() +{ + strcpy( m_Sensor, "KAF6303E" ); + strcpy( m_CameraModel, "9" ); + m_CameraId = 8; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 3100; + m_ImagingColumns = 3073; + m_ClampColumns = 15; + m_PreRoiSkipColumns = 0; + m_PostRoiSkipColumns = 0; + m_OverscanColumns = 12; + m_TotalRows = 2056; + m_ImagingRows = 2048; + m_UnderscanRows = 4; + m_OverscanRows = 4; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 9; + m_PixelSizeY = 9; + m_Color = false; + m_ReportedGainSixteenBit = 1.5; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_KAF6303E::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 71; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_KAF6303E::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0004 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF6303E::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x0068, 0x1068, 0x1068, 0x1068, 0x1068, 0x1048, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8, + 0x10C8, 0x10C8, 0x10C8, 0x10C8, 0x10C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0064 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0048, 0x0044 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF6303E::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0xE; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0064, 0x006A, 0x006A, 0x0068, 0x1068, 0x1068, 0x1068, 0x0068, 0x00E8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8, + 0x00C8, 0x00C8, 0x00C8, 0x00C8, 0x00C8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0404 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF6303E::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2008, 0x0004, 0x0004, 0x0004, 0x0005, + 0x4004 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF6303E::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4004 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF6303E::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_KAF6303E::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_KAF6303E.h b/kstars/kstars/indi/apogee/ApnCamData_KAF6303E.h new file mode 100644 index 00000000..9b84a102 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_KAF6303E.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_KAF6303E.h: Interface file for the CApnCamData_KAF6303E class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_KAF6303E : public CApnCamData +{ +public: + CApnCamData_KAF6303E(); + virtual ~CApnCamData_KAF6303E(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamData_TH7899.cpp b/kstars/kstars/indi/apogee/ApnCamData_TH7899.cpp new file mode 100644 index 00000000..69767c19 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_TH7899.cpp @@ -0,0 +1,609 @@ +///////////////////////////////////////////////////////////// +// +// ApnCamData_TH7899.cpp: Implementation file for the CApnCamData_TH7899 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData_TH7899.h" + +#include <stdlib.h> +#include <malloc.h> +#include <string.h> + + +///////////////////////////////////////////////////////////// +// Construction/Destruction +///////////////////////////////////////////////////////////// + + +CApnCamData_TH7899::CApnCamData_TH7899() +{ +} + + +CApnCamData_TH7899::~CApnCamData_TH7899() +{ +} + + +void CApnCamData_TH7899::Initialize() +{ + strcpy( m_Sensor, "TH7899" ); + strcpy( m_CameraModel, "10" ); + m_CameraId = 14; + m_InterlineCCD = false; + m_SupportsSerialA = true; + m_SupportsSerialB = true; + m_SensorTypeCCD = true; + m_TotalColumns = 2110; + m_ImagingColumns = 2048; + m_ClampColumns = 25; + m_PreRoiSkipColumns = 5; + m_PostRoiSkipColumns = 5; + m_OverscanColumns = 27; + m_TotalRows = 2054; + m_ImagingRows = 2048; + m_UnderscanRows = 3; + m_OverscanRows = 3; + m_VFlushBinning = 4; + m_EnableSingleRowOffset = false; + m_RowOffsetBinning = 1; + m_HFlushDisable = false; + m_ShutterCloseDelay = 20; + m_PixelSizeX = 14; + m_PixelSizeY = 14; + m_Color = false; + m_ReportedGainSixteenBit = 2; + m_MinSuggestedExpTime = 20.0; + m_CoolingSupported = true; + m_RegulatedCoolingSupported = true; + m_TempSetPoint = -20.0; + m_TempRampRateOne = 1000; + m_TempRampRateTwo = 2000; + m_TempBackoffPoint = 2.0; + m_DefaultGainTwelveBit = 100; + m_DefaultOffsetTwelveBit = 255; + m_DefaultRVoltage = 1000; + + set_vpattern(); + + set_hpattern_clamp_sixteen(); + set_hpattern_skip_sixteen(); + set_hpattern_roi_sixteen(); + + set_hpattern_clamp_twelve(); + set_hpattern_skip_twelve(); + set_hpattern_roi_twelve(); +} + + +void CApnCamData_TH7899::set_vpattern() +{ + const unsigned short Mask = 0x0; + const unsigned short NumElements = 18; + unsigned short Pattern[NumElements] = + { + 0x0000, 0x0018, 0x0018, 0x001A, 0x001A, 0x0012, 0x0012, 0x0016, 0x0016, 0x0006, + 0x0006, 0x000E, 0x000E, 0x000C, 0x000C, 0x0000, 0x0001, 0x0000 + }; + + m_VerticalPattern.Mask = Mask; + m_VerticalPattern.NumElements = NumElements; + m_VerticalPattern.PatternData = + (unsigned short *)malloc(NumElements * sizeof(unsigned short)); + + for ( int i=0; i<NumElements; i++ ) + { + m_VerticalPattern.PatternData[i] = Pattern[i]; + } +} + + +void CApnCamData_TH7899::set_hpattern_skip_sixteen() +{ + const unsigned short Mask = 0x1E; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 11; + const unsigned short SigNumElements = 12; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0074, 0x007A, 0x007A, 0x0078, 0x1078, 0x1078, 0x1078, 0x0078, 0x00F8, 0x00D8, + 0x00D8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0004, + 0x0005, 0x0014 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0058, 0x0054 + } }; + + set_hpattern( &m_SkipPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_TH7899::set_hpattern_clamp_sixteen() +{ + const unsigned short Mask = 0x1E; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 24; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0074, 0x007A, 0x007A, 0x0078, 0x0078, 0x1078, 0x1078, 0x1078, 0x1078, 0x1058, + 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8, + 0x10D8, 0x10D8, 0x10D8, 0x10D8, 0x10D8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0004, 0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, + 0x0404, 0x0004, 0x0005, 0x0074 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002 + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0058, 0x0054 + } }; + + set_hpattern( &m_ClampPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_TH7899::set_hpattern_roi_sixteen() +{ + const unsigned short Mask = 0x1E; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 25; + const unsigned short SigNumElements = 27; + + unsigned short RefPatternData[RefNumElements] = + { + 0x0074, 0x007A, 0x007A, 0x0078, 0x1078, 0x1078, 0x1078, 0x0078, 0x00F8, 0x00D8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8, + 0x00D8, 0x00D8, 0x00D8, 0x00D8, 0x00D8 + }; + + unsigned short SigPatternData[SigNumElements] = + { + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0144, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, + 0x0104, 0x0104, 0x0104, 0x0104, 0x8004, 0x8005, 0x0414 + }; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x0002, 0x002A, 0x0052, 0x007A, 0x00A2, 0x00CA, 0x00B6, 0x00C6, 0x00A2, 0x00B6 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0058, 0x0054 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + }, + { + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0048, + 0x0048, 0x0044 + } }; + + set_hpattern( &m_RoiPatternSixteen, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_TH7899::set_hpattern_skip_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000B + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0014, 0x021A, 0x0018, 0x0018, 0x0018, 0x2018, 0x0014, 0x0004, 0x0004, 0x0005, + 0x4014 + } }; + + set_hpattern( &m_SkipPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_TH7899::set_hpattern_clamp_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 1; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000C + }; + + unsigned short BinPatternData[1][256] = { + { + 0x0014, 0x021A, 0x0018, 0x0018, 0x0018, 0x0018, 0x0014, 0x2004, 0x0004, 0x0004, + 0x0005, 0x4014 + } }; + + set_hpattern( &m_ClampPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_TH7899::set_hpattern_roi_twelve() +{ + const unsigned short Mask = 0x0; + const unsigned short BinningLimit = 10; + const unsigned short RefNumElements = 0; + const unsigned short SigNumElements = 0; + + unsigned short *RefPatternData = NULL; + + unsigned short *SigPatternData = NULL; + + unsigned short BinNumElements[APN_MAX_HBINNING] = + { + 0x000A, 0x0011, 0x0019, 0x0021, 0x0029, 0x0031, 0x0039, 0x0041, 0x0049, 0x0051 + }; + + unsigned short BinPatternData[10][256] = { + { + 0x0014, 0x021A, 0x0018, 0x0018, 0x0018, 0x0014, 0x2004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0014, 0x021A, 0x0018, 0x0018, 0x0018, 0x2014, 0x0014, 0x0014, 0x0014, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0014, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x8005, 0xC004 + }, + { + 0x0004, 0x020A, 0x0008, 0x0008, 0x0008, 0x2004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0004, 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0008, 0x0008, 0x0008, 0x0008, 0x0004, 0x0004, 0x8005, + 0xC004 + } }; + + set_hpattern( &m_RoiPatternTwelve, + Mask, + BinningLimit, + RefNumElements, + SigNumElements, + BinNumElements, + RefPatternData, + SigPatternData, + BinPatternData ); +} + + +void CApnCamData_TH7899::set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ) +{ + int i, j; + + Pattern->Mask = Mask; + Pattern->BinningLimit = BinningLimit; + Pattern->RefNumElements = RefNumElements; + Pattern->SigNumElements = SigNumElements; + + if ( RefNumElements > 0 ) + { + Pattern->RefPatternData = + (unsigned short *)malloc(RefNumElements * sizeof(unsigned short)); + + for ( i=0; i<RefNumElements; i++ ) + { + Pattern->RefPatternData[i] = RefPatternData[i]; + } + } + + if ( SigNumElements > 0 ) + { + Pattern->SigPatternData = + (unsigned short *)malloc(SigNumElements * sizeof(unsigned short)); + + for ( i=0; i<SigNumElements; i++ ) + { + Pattern->SigPatternData[i] = SigPatternData[i]; + } + } + + if ( BinningLimit > 0 ) + { + for ( i=0; i<BinningLimit; i++ ) + { + Pattern->BinNumElements[i] = BinNumElements[i]; + + Pattern->BinPatternData[i] = + (unsigned short *)malloc(BinNumElements[i] * sizeof(unsigned short)); + + for ( j=0; j<BinNumElements[i]; j++ ) + { + Pattern->BinPatternData[i][j] = BinPatternData[i][j]; + } + } + } +} diff --git a/kstars/kstars/indi/apogee/ApnCamData_TH7899.h b/kstars/kstars/indi/apogee/ApnCamData_TH7899.h new file mode 100644 index 00000000..296cc627 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamData_TH7899.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +///////////////////////////////////////////////////////////// +// +// ApnCamData_TH7899.h: Interface file for the CApnCamData_TH7899 class. +// +///////////////////////////////////////////////////////////// + +#include "ApnCamData.h" + +class CApnCamData_TH7899 : public CApnCamData +{ +public: + CApnCamData_TH7899(); + virtual ~CApnCamData_TH7899(); + + void Initialize(); + +private: + + void set_vpattern(); + + void set_hpattern_clamp_sixteen(); + void set_hpattern_skip_sixteen(); + void set_hpattern_roi_sixteen(); + + void set_hpattern_clamp_twelve(); + void set_hpattern_skip_twelve(); + void set_hpattern_roi_twelve(); + + void set_hpattern( APN_HPATTERN_FILE *Pattern, + unsigned short Mask, + unsigned short BinningLimit, + unsigned short RefNumElements, + unsigned short SigNumElements, + unsigned short BinNumElements[], + unsigned short RefPatternData[], + unsigned short SigPatternData[], + unsigned short BinPatternData[][APN_MAX_PATTERN_ENTRIES] ); + +}; diff --git a/kstars/kstars/indi/apogee/ApnCamTable.cpp b/kstars/kstars/indi/apogee/ApnCamTable.cpp new file mode 100644 index 00000000..5379ec9a --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamTable.cpp @@ -0,0 +1,149 @@ +// ApnCamTable.cpp +// +// Copyright (c) 2003, 2004 Apogee Instruments, Inc. +////////////////////////////////////////////////////////////////////// + +#include <string.h> + +#include "ApnCamTable.h" + + +#define ALTA_MODEL_PREFIX "Alta-" + + +void ApnCamModelLookup( unsigned short CamId, unsigned short Interface, char *szCamModel ) +{ + char szModelNumber[20]; + bool Error; + + Error = false; + + switch( CamId ) + { + case APN_ALTA_KAF0401E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF0401E_CAM_SZ ); + break; + case APN_ALTA_KAF1602E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF1602E_CAM_SZ ); + break; + case APN_ALTA_KAF0261E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF0261E_CAM_SZ ); + break; + case APN_ALTA_KAF1301E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF1301E_CAM_SZ ); + break; + case APN_ALTA_KAF1401E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF1401E_CAM_SZ ); + break; + case APN_ALTA_KAF1001E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF1001E_CAM_SZ ); + break; + case APN_ALTA_KAF3200E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF3200E_CAM_SZ ); + break; + case APN_ALTA_KAF4202_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF4202_CAM_SZ ); + break; + case APN_ALTA_KAF6303E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF6303E_CAM_SZ ); + break; + case APN_ALTA_KAF16801E_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAF16801E_CAM_SZ ); + break; + case APN_ALTA_CCD4710LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4710LS_CAM_SZ ); + break; + case APN_ALTA_CCD4710HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4710HS_CAM_SZ ); + break; + case APN_ALTA_TH7899_CAM_ID: + strcpy( szModelNumber, APN_ALTA_TH7899_CAM_SZ ); + break; + case APN_ALTA_CCD4240LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4240LS_CAM_SZ ); + break; + case APN_ALTA_CCD4240HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4240HS_CAM_SZ ); + break; + case APN_ALTA_CCD5710LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD5710LS_CAM_SZ ); + break; + case APN_ALTA_CCD5710HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD5710HS_CAM_SZ ); + break; + case APN_ALTA_CCD3011LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD3011LS_CAM_SZ ); + break; + case APN_ALTA_CCD3011HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD3011HS_CAM_SZ ); + break; + case APN_ALTA_CCD5520LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD5520LS_CAM_SZ ); + break; + case APN_ALTA_CCD5520HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD5520HS_CAM_SZ ); + break; + case APN_ALTA_CCD4720LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4720LS_CAM_SZ ); + break; + case APN_ALTA_CCD4720HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4720HS_CAM_SZ ); + break; + case APN_ALTA_CCD7700LS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD7700LS_CAM_SZ ); + break; + case APN_ALTA_CCD7700HS_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD7700HS_CAM_SZ ); + break; + case APN_ALTA_KAI2001M_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAI2001M_CAM_SZ ); + break; + case APN_ALTA_KAI2001MC_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAI2001MC_CAM_SZ ); + break; + case APN_ALTA_KAI4020_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAI4020_CAM_SZ ); + break; + case APN_ALTA_KAI11000_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAI11000_CAM_SZ ); + break; + case APN_ALTA_KAI11000C_CAM_ID: + strcpy( szModelNumber, APN_ALTA_KAI11000C_CAM_SZ ); + break; + + case APN_ALTA_CCD4710LS2_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4710LS2_CAM_SZ ); + break; + case APN_ALTA_CCD4710LS3_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4710LS3_CAM_SZ ); + break; + case APN_ALTA_CCD4710LS4_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4710LS4_CAM_SZ ); + break; + case APN_ALTA_CCD4710LS5_CAM_ID: + strcpy( szModelNumber, APN_ALTA_CCD4710LS5_CAM_SZ ); + break; + default: + Error = true; + break; + } + + if ( Error ) + { + strcpy( szCamModel, "Unknown" ); + } + else + { + strcpy( szCamModel, ALTA_MODEL_PREFIX ); + + if ( Interface == 0 ) // Network Interface + strcat( szCamModel, "E" ); + + if ( Interface == 1 ) // USB 2.0 Interface + strcat( szCamModel, "U" ); + + strcat( szCamModel, szModelNumber ); + } + +} + diff --git a/kstars/kstars/indi/apogee/ApnCamTable.h b/kstars/kstars/indi/apogee/ApnCamTable.h new file mode 100644 index 00000000..8eb527c3 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamTable.h @@ -0,0 +1,125 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef __APN_CAM_TABLE_H__ +#define __APN_CAM_TABLE_H__ + + +#define APN_MODEL_COUNT 25 // total number of models + + +#define APN_ALTA_KAF0401E_CAM_ID 0 +#define APN_ALTA_KAF0401E_CAM_SZ "1" + +#define APN_ALTA_KAF1602E_CAM_ID 1 +#define APN_ALTA_KAF1602E_CAM_SZ "2" + +#define APN_ALTA_KAF0261E_CAM_ID 2 +#define APN_ALTA_KAF0261E_CAM_SZ "260" + +#define APN_ALTA_KAF1301E_CAM_ID 3 +#define APN_ALTA_KAF1301E_CAM_SZ "13" + +#define APN_ALTA_KAF1401E_CAM_ID 4 +#define APN_ALTA_KAF1401E_CAM_SZ "14" + +#define APN_ALTA_KAF1001E_CAM_ID 5 +#define APN_ALTA_KAF1001E_CAM_SZ "6" + +#define APN_ALTA_KAF3200E_CAM_ID 6 +#define APN_ALTA_KAF3200E_CAM_SZ "32" + +#define APN_ALTA_KAF4202_CAM_ID 7 +#define APN_ALTA_KAF4202_CAM_SZ "4" + +#define APN_ALTA_KAF6303E_CAM_ID 8 +#define APN_ALTA_KAF6303E_CAM_SZ "9" + +#define APN_ALTA_KAF16801E_CAM_ID 9 +#define APN_ALTA_KAF16801E_CAM_SZ "16" + +#define APN_ALTA_CCD4710LS_CAM_ID 10 +#define APN_ALTA_CCD4710LS_CAM_SZ "47" + +#define APN_ALTA_CCD4710HS_CAM_ID 11 +#define APN_ALTA_CCD4710HS_CAM_SZ "47" + +#define APN_ALTA_TH7899_CAM_ID 14 +#define APN_ALTA_TH7899_CAM_SZ "10" + +#define APN_ALTA_CCD4240LS_CAM_ID 16 +#define APN_ALTA_CCD4240LS_CAM_SZ "42" + +#define APN_ALTA_CCD4240HS_CAM_ID 17 +#define APN_ALTA_CCD4240HS_CAM_SZ "42" + +#define APN_ALTA_CCD5710LS_CAM_ID 18 +#define APN_ALTA_CCD5710LS_CAM_SZ "57" + +#define APN_ALTA_CCD5710HS_CAM_ID 19 +#define APN_ALTA_CCD5710HS_CAM_SZ "57" + +#define APN_ALTA_CCD3011LS_CAM_ID 20 +#define APN_ALTA_CCD3011LS_CAM_SZ "30" + +#define APN_ALTA_CCD3011HS_CAM_ID 21 +#define APN_ALTA_CCD3011HS_CAM_SZ "30" + +#define APN_ALTA_CCD5520LS_CAM_ID 22 +#define APN_ALTA_CCD5520LS_CAM_SZ "55" + +#define APN_ALTA_CCD5520HS_CAM_ID 23 +#define APN_ALTA_CCD5520HS_CAM_SZ "55" + +#define APN_ALTA_CCD4720LS_CAM_ID 24 +#define APN_ALTA_CCD4720LS_CAM_SZ "4720" + +#define APN_ALTA_CCD4720HS_CAM_ID 25 +#define APN_ALTA_CCD4720HS_CAM_SZ "4720" + +#define APN_ALTA_CCD7700LS_CAM_ID 26 +#define APN_ALTA_CCD7700LS_CAM_SZ "77" + +#define APN_ALTA_CCD7700HS_CAM_ID 27 +#define APN_ALTA_CCD7700HS_CAM_SZ "77" + +#define APN_ALTA_KAI2001M_CAM_ID 64 +#define APN_ALTA_KAI2001M_CAM_SZ "2000" + +#define APN_ALTA_KAI2001MC_CAM_ID 65 +#define APN_ALTA_KAI2001MC_CAM_SZ "2000C" + +#define APN_ALTA_KAI4020_CAM_ID 66 +#define APN_ALTA_KAI4020_CAM_SZ "4000" + +#define APN_ALTA_KAI11000_CAM_ID 67 +#define APN_ALTA_KAI11000_CAM_SZ "11000" + +#define APN_ALTA_KAI11000C_CAM_ID 68 +#define APN_ALTA_KAI11000C_CAM_SZ "11000C" + +#define APN_ALTA_CCD4710LS2_CAM_ID 12 +#define APN_ALTA_CCD4710LS2_CAM_SZ "4710" + +#define APN_ALTA_CCD4710LS3_CAM_ID 13 +#define APN_ALTA_CCD4710LS3_CAM_SZ "4710" + +#define APN_ALTA_CCD4710LS4_CAM_ID 15 +#define APN_ALTA_CCD4710LS4_CAM_SZ "4710" + +#define APN_ALTA_CCD4710LS5_CAM_ID 28 +#define APN_ALTA_CCD4710LS5_CAM_SZ "4710" + + +// Helper function prototype + +void ApnCamModelLookup( unsigned short CamId, unsigned short Interface, char *szCamModel ); + + +#endif diff --git a/kstars/kstars/indi/apogee/ApnCamera.cpp b/kstars/kstars/indi/apogee/ApnCamera.cpp new file mode 100644 index 00000000..4e8c1b00 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera.cpp @@ -0,0 +1,1890 @@ +// ApnCamera.cpp: implementation of the CApnCamera class. +// +// Copyright (c) 2003, 2004 Apogee Instruments, Inc. +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" + +#include "ApnCamera.h" +#include "ApnCamTable.h" + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CApnCamera::CApnCamera() +{ + m_ApnSensorInfo = NULL; +} + +CApnCamera::~CApnCamera() +{ + if ( m_ApnSensorInfo != NULL ) + { + delete m_ApnSensorInfo; + m_ApnSensorInfo = NULL; + } + CloseDriver(); +} + +bool CApnCamera::Expose( double Duration, bool Light ) +{ + ULONG ExpTime; + unsigned short BitsPerPixel(0); + unsigned short UnbinnedRoiX; + unsigned short UnbinnedRoiY; + unsigned short PreRoiSkip, PostRoiSkip; + unsigned short PreRoiRows, PostRoiRows; + unsigned short PreRoiVBinning, PostRoiVBinning; + + unsigned short RoiRegBuffer[12]; + unsigned short RoiRegData[12]; + + unsigned short TotalHPixels; + unsigned short TotalVPixels; + + + while ( read_ImagingStatus() != Apn_Status_Flushing ) + { + Sleep( 20 ); + } + + // Validate the "Duration" parameter + if ( Duration < APN_EXPOSURE_TIME_MIN ) + Duration = APN_EXPOSURE_TIME_MIN; + + // Validate the ROI params + UnbinnedRoiX = m_RoiPixelsH * m_RoiBinningH; + + PreRoiSkip = m_RoiStartX; + + PostRoiSkip = m_ApnSensorInfo->m_TotalColumns - + m_ApnSensorInfo->m_ClampColumns - + PreRoiSkip - + UnbinnedRoiX; + + TotalHPixels = UnbinnedRoiX + PreRoiSkip + PostRoiSkip + m_ApnSensorInfo->m_ClampColumns; + + if ( TotalHPixels != m_ApnSensorInfo->m_TotalColumns ) + return false; + + UnbinnedRoiY = m_RoiPixelsV * m_RoiBinningV; + + PreRoiRows = m_ApnSensorInfo->m_UnderscanRows + + m_RoiStartY; + + PostRoiRows = m_ApnSensorInfo->m_TotalRows - + PreRoiRows - + UnbinnedRoiY; + + TotalVPixels = UnbinnedRoiY + PreRoiRows + PostRoiRows; + + if ( TotalVPixels != m_ApnSensorInfo->m_TotalRows ) + return false; + + // Calculate the exposure time to program to the camera + ExpTime = ((unsigned long)(Duration / APN_TIMER_RESOLUTION)) + APN_TIMER_OFFSET_COUNT; + + Write( FPGA_REG_TIMER_LOWER, (unsigned short)(ExpTime & 0xFFFF)); + ExpTime = ExpTime >> 16; + Write( FPGA_REG_TIMER_UPPER, (unsigned short)(ExpTime & 0xFFFF)); + + m_pvtExposurePixelsV = m_RoiPixelsV; + m_pvtExposurePixelsH = m_RoiPixelsH; + + if ( m_DataBits == Apn_Resolution_SixteenBit ) + { + BitsPerPixel = 16; + } + else if ( m_DataBits == Apn_Resolution_TwelveBit ) + { + BitsPerPixel = 12; + } + + if ( PreStartExpose( BitsPerPixel ) != 0 ) + { + return false; + } + + // Calculate the vertical parameters + PreRoiVBinning = m_ApnSensorInfo->m_RowOffsetBinning; + + PostRoiVBinning = 1; + + // For interline CCDs, set "Fast Dump" mode if the particular array is NOT digitized + if ( m_ApnSensorInfo->m_InterlineCCD ) + { + // use the fast dump feature to get rid of the data quickly. + // one row, binning to the original row count + // note that we only are not digitized in arrays 1 and 3 + PreRoiVBinning = PreRoiRows; + PostRoiVBinning = PostRoiRows; + + PreRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; + PostRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; + + PreRoiRows = 1; + PostRoiRows = 1; + } + + // Set up the geometry for a full frame device + if ( m_ApnSensorInfo->m_EnableSingleRowOffset ) + { + PreRoiVBinning += PreRoiRows; + PostRoiVBinning = PostRoiRows; + + PreRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; + PostRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; + + PreRoiRows = 1; + PostRoiRows = 1; + } + + + // Issue the reset + RoiRegBuffer[0] = FPGA_REG_COMMAND_B; + RoiRegData[0] = FPGA_BIT_CMD_RESET; + + // Program the horizontal settings + RoiRegBuffer[1] = FPGA_REG_PREROI_SKIP_COUNT; + RoiRegData[1] = PreRoiSkip; + + RoiRegBuffer[2] = FPGA_REG_ROI_COUNT; + // Number of ROI pixels. Adjust the 12bit operation here to account for an extra + // 10 pixel shift as a result of the A/D conversion. + if ( m_DataBits == Apn_Resolution_SixteenBit ) + { + RoiRegData[2] = m_pvtExposurePixelsH + 1; + } + else if ( m_DataBits == Apn_Resolution_TwelveBit ) + { + RoiRegData[2] = m_pvtExposurePixelsH + 10; + } + + RoiRegBuffer[3] = FPGA_REG_POSTROI_SKIP_COUNT; + RoiRegData[3] = PostRoiSkip; + + // Program the vertical settings + RoiRegBuffer[4] = FPGA_REG_A1_ROW_COUNT; + RoiRegData[4] = PreRoiRows; + RoiRegBuffer[5] = FPGA_REG_A1_VBINNING; + RoiRegData[5] = PreRoiVBinning; + + RoiRegBuffer[6] = FPGA_REG_A2_ROW_COUNT; + RoiRegData[6] = m_RoiPixelsV; + RoiRegBuffer[7] = FPGA_REG_A2_VBINNING; + RoiRegData[7] = (m_RoiBinningV | FPGA_BIT_ARRAY_DIGITIZE); + + RoiRegBuffer[8] = FPGA_REG_A3_ROW_COUNT; + RoiRegData[8] = PostRoiRows; + RoiRegBuffer[9] = FPGA_REG_A3_VBINNING; + RoiRegData[9] = PostRoiVBinning; + + // Issue the reset + RoiRegBuffer[10] = FPGA_REG_COMMAND_B; + RoiRegData[10] = FPGA_BIT_CMD_RESET; + + switch ( m_pvtCameraMode ) + { + case Apn_CameraMode_Normal: + if ( Light ) + { + RoiRegBuffer[11] = FPGA_REG_COMMAND_A; + RoiRegData[11] = FPGA_BIT_CMD_EXPOSE; + } + else + { + RoiRegBuffer[11] = FPGA_REG_COMMAND_A; + RoiRegData[11] = FPGA_BIT_CMD_DARK; + } + break; + case Apn_CameraMode_TDI: + RoiRegBuffer[11] = FPGA_REG_COMMAND_A; + RoiRegData[11] = FPGA_BIT_CMD_TDI; + break; + case Apn_CameraMode_Test: + if ( Light ) + { + RoiRegBuffer[11] = FPGA_REG_COMMAND_A; + RoiRegData[11] = FPGA_BIT_CMD_EXPOSE; + } + else + { + RoiRegBuffer[11] = FPGA_REG_COMMAND_A; + RoiRegData[11] = FPGA_BIT_CMD_DARK; + } + break; + case Apn_CameraMode_ExternalTrigger: + RoiRegBuffer[11] = FPGA_REG_COMMAND_A; + RoiRegData[11] = FPGA_BIT_CMD_TRIGGER_EXPOSE; + break; + case Apn_CameraMode_ExternalShutter: + break; + } + + // Send the instruction sequence to the camera + WriteMultiMRMD( RoiRegBuffer, RoiRegData, 12 ); + + m_pvtImageInProgress = true; + m_pvtImageReady = false; + + return true; +} + +bool CApnCamera::ResetSystem() +{ + // Reset the camera engine + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + + // Start flushing + Write( FPGA_REG_COMMAND_A, FPGA_BIT_CMD_FLUSH ); + + return true; +} + +bool CApnCamera::PauseTimer( bool PauseState ) +{ + unsigned short RegVal; + bool CurrentState; + + Read( FPGA_REG_OP_A, RegVal ); + + CurrentState = ( RegVal & FPGA_BIT_PAUSE_TIMER ) == FPGA_BIT_PAUSE_TIMER; + + if ( CurrentState != PauseState ) + { + if ( PauseState ) + { + RegVal |= FPGA_BIT_PAUSE_TIMER; + } + else + { + RegVal &= ~FPGA_BIT_PAUSE_TIMER; + } + Write ( FPGA_REG_OP_A, RegVal ); + } + + return true; +} + +bool CApnCamera::StopExposure( bool DigitizeData ) +{ + if ( m_pvtImageInProgress ) + { + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_END_EXPOSURE ); + + if ( PostStopExposure( DigitizeData ) != 0 ) + { + return false; + } + } + + return true; +} + + +unsigned short CApnCamera::GetExposurePixelsH() +{ + return m_pvtExposurePixelsH; +} + +unsigned short CApnCamera::GetExposurePixelsV() +{ + return m_pvtExposurePixelsV; +} + +double CApnCamera::read_InputVoltage() +{ + UpdateGeneralStatus(); + + return m_pvtInputVoltage; +} + +long CApnCamera::read_AvailableMemory() +{ + long AvailableMemory(0); + + switch( m_CameraInterface ) + { + case Apn_Interface_NET: + AvailableMemory = 28 * 1024; + break; + case Apn_Interface_USB: + AvailableMemory = 32 * 1024; + break; + default: + break; + } + + return AvailableMemory; +} + +unsigned short CApnCamera::read_FirmwareVersion() +{ + unsigned short FirmwareVersion; + Read( FPGA_REG_FIRMWARE_REV, FirmwareVersion ); + return FirmwareVersion; +} + +bool CApnCamera::read_ShutterState() +{ + UpdateGeneralStatus(); + + return m_pvtShutterState; +} + +bool CApnCamera::read_DisableShutter() +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + return ( (RegVal & FPGA_BIT_DISABLE_SHUTTER) != 0 ); +} + +void CApnCamera::write_DisableShutter( bool DisableShutter ) +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + + if ( DisableShutter ) + RegVal |= FPGA_BIT_DISABLE_SHUTTER; + else + RegVal &= ~FPGA_BIT_DISABLE_SHUTTER; + + Write( FPGA_REG_OP_A, RegVal ); +} + +bool CApnCamera::read_ForceShutterOpen() +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + return ( (RegVal & FPGA_BIT_FORCE_SHUTTER) != 0 ); +} + +void CApnCamera::write_ForceShutterOpen( bool ForceShutterOpen ) +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + + if ( ForceShutterOpen ) + RegVal |= FPGA_BIT_FORCE_SHUTTER; + else + RegVal &= ~FPGA_BIT_FORCE_SHUTTER; + + Write( FPGA_REG_OP_A, RegVal ); +} + +bool CApnCamera::read_ShutterAmpControl() +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + return ( (RegVal & FPGA_BIT_SHUTTER_AMP_CONTROL ) != 0 ); +} + +void CApnCamera::write_ShutterAmpControl( bool ShutterAmpControl ) +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + + if ( ShutterAmpControl ) + RegVal |= FPGA_BIT_SHUTTER_AMP_CONTROL; + else + RegVal &= ~FPGA_BIT_SHUTTER_AMP_CONTROL; + + Write( FPGA_REG_OP_A, RegVal ); +} + +bool CApnCamera::read_ExternalIoReadout() +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + return ( (RegVal & FPGA_BIT_SHUTTER_MODE) != 0 ); +} + +void CApnCamera::write_ExternalIoReadout( bool ExternalIoReadout ) +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + + if ( ExternalIoReadout ) + RegVal |= FPGA_BIT_SHUTTER_MODE; + else + RegVal &= ~FPGA_BIT_SHUTTER_MODE; + + Write( FPGA_REG_OP_A, RegVal ); +} + +bool CApnCamera::read_FastSequence() +{ + if ( m_ApnSensorInfo->m_InterlineCCD == false ) + return false; + + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + return ( (RegVal & FPGA_BIT_RATIO) != 0 ); +} + +void CApnCamera::write_FastSequence( bool FastSequence ) +{ + if ( m_ApnSensorInfo->m_InterlineCCD == false ) + return; + + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + + if ( FastSequence ) + { + RegVal |= FPGA_BIT_RATIO; + Write( FPGA_REG_SHUTTER_CLOSE_DELAY, 0x0 ); + } + else + { + RegVal &= ~FPGA_BIT_RATIO; + } + + Write( FPGA_REG_OP_A, RegVal ); +} + +Apn_NetworkMode CApnCamera::read_NetworkTransferMode() +{ + return m_pvtNetworkTransferMode; +} + +void CApnCamera::write_NetworkTransferMode( Apn_NetworkMode TransferMode ) +{ + SetNetworkTransferMode( TransferMode ); + + m_pvtNetworkTransferMode = TransferMode; +} + +Apn_CameraMode CApnCamera::read_CameraMode() +{ + return m_pvtCameraMode; +} + +void CApnCamera::write_CameraMode( Apn_CameraMode CameraMode ) +{ + unsigned short RegVal; + + + // If our state isn't going to change, do nothing + if ( m_pvtCameraMode == CameraMode ) + return; + + // If we didn't return already, then if we know our state is going to + // change. If we're in test mode, clear the appropriate FPGA bit(s). + switch( m_pvtCameraMode ) + { + case Apn_CameraMode_Normal: + break; + case Apn_CameraMode_TDI: + break; + case Apn_CameraMode_Test: + Read( FPGA_REG_OP_B, RegVal ); + RegVal &= ~FPGA_BIT_AD_SIMULATION; + Write( FPGA_REG_OP_B, RegVal ); + break; + case Apn_CameraMode_ExternalTrigger: + break; + case Apn_CameraMode_ExternalShutter: + Read( FPGA_REG_OP_A, RegVal ); + RegVal &= ~FPGA_BIT_SHUTTER_SOURCE; + Write( FPGA_REG_OP_A, RegVal ); + break; + } + + switch ( CameraMode ) + { + case Apn_CameraMode_Normal: + break; + case Apn_CameraMode_TDI: + break; + case Apn_CameraMode_Test: + Read( FPGA_REG_OP_B, RegVal ); + RegVal |= FPGA_BIT_AD_SIMULATION; + Write( FPGA_REG_OP_B, RegVal ); + break; + case Apn_CameraMode_ExternalTrigger: + Read( FPGA_REG_IO_PORT_ASSIGNMENT, RegVal ); + RegVal |= 0x01; + Write( FPGA_REG_IO_PORT_ASSIGNMENT, RegVal ); + break; + case Apn_CameraMode_ExternalShutter: + Read( FPGA_REG_OP_A, RegVal ); + RegVal |= FPGA_BIT_SHUTTER_SOURCE; + Write( FPGA_REG_OP_A, RegVal ); + break; + } + + m_pvtCameraMode = CameraMode; +} + +void CApnCamera::write_DataBits( Apn_Resolution BitResolution ) +{ + unsigned short RegVal; + + if ( m_CameraInterface == Apn_Interface_NET ) + { + // The network interface is 16bpp only. Changing the resolution + // for network cameras has no effect. + return; + } + + if ( m_DataBits != BitResolution ) + { + // Reset the camera + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + + // Change bit setting after the reset + Read( FPGA_REG_OP_A, RegVal ); + + if ( BitResolution == Apn_Resolution_TwelveBit ) + RegVal |= FPGA_BIT_DIGITIZATION_RES; + + if ( BitResolution == Apn_Resolution_SixteenBit ) + RegVal &= ~FPGA_BIT_DIGITIZATION_RES; + + Write( FPGA_REG_OP_A, RegVal ); + + m_DataBits = BitResolution; + + LoadClampPattern(); + LoadSkipPattern(); + LoadRoiPattern( m_RoiBinningH ); + + // Reset the camera + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + // Start flushing + Write( FPGA_REG_COMMAND_A, FPGA_BIT_CMD_FLUSH ); + } +} + +Apn_Status CApnCamera::read_ImagingStatus() +{ + bool Exposing, Active, Done, Flushing, WaitOnTrigger; + bool DataHalted, RamError; + + + UpdateGeneralStatus(); + + // Update the ImagingStatus + Exposing = false; + Active = false; + Done = false; + Flushing = false; + WaitOnTrigger = false; + DataHalted = false; + RamError = false; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGING_ACTIVE) != 0 ) + Active = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGE_EXPOSING) != 0 ) + Exposing = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGE_DONE) != 0 ) + Done = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_FLUSHING) != 0 ) + Flushing = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_WAITING_TRIGGER) != 0 ) + WaitOnTrigger = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_DATA_HALTED) != 0 ) + DataHalted = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_PATTERN_ERROR) != 0 ) + RamError = true; + + if ( RamError ) + { + m_pvtImagingStatus = Apn_Status_PatternError; + } + else + { + if ( DataHalted ) + { + m_pvtImagingStatus = Apn_Status_DataError; + } + else + { + if ( WaitOnTrigger ) + { + m_pvtImagingStatus = Apn_Status_WaitingOnTrigger; + } + else + { + if ( Done && m_pvtImageInProgress ) + { + m_pvtImageReady = true; + m_pvtImagingStatus = Apn_Status_ImageReady; + } + else + { + if ( Active ) + { + if ( Exposing ) + m_pvtImagingStatus = Apn_Status_Exposing; + else + m_pvtImagingStatus = Apn_Status_ImagingActive; + } + else + { + if ( Flushing ) + m_pvtImagingStatus = Apn_Status_Flushing; + else + m_pvtImagingStatus = Apn_Status_Idle; + } + } + } + } + } + + /* + switch( m_pvtImagingStatus ) + { + case Apn_Status_DataError: + OutputDebugString( "ImagingStatus: Apn_Status_DataError" ); + break; + case Apn_Status_PatternError: + OutputDebugString( "ImagingStatus: Apn_Status_PatternError" ); + break; + case Apn_Status_Idle: + OutputDebugString( "ImagingStatus: Apn_Status_Idle" ); + break; + case Apn_Status_Exposing: + OutputDebugString( "ImagingStatus: Apn_Status_Exposing" ); + break; + case Apn_Status_ImagingActive: + OutputDebugString( "ImagingStatus: Apn_Status_ImagingActive" ); + break; + case Apn_Status_ImageReady: + OutputDebugString( "ImagingStatus: Apn_Status_ImageReady" ); + break; + case Apn_Status_Flushing: + OutputDebugString( "ImagingStatus: Apn_Status_Flushing" ); + break; + case Apn_Status_WaitingOnTrigger: + OutputDebugString( "ImagingStatus: Apn_Status_WaitingOnTrigger" ); + break; + default: + OutputDebugString( "ImagingStatus: UNDEFINED!!" ); + break; + } + */ + + return m_pvtImagingStatus; +} + +Apn_LedMode CApnCamera::read_LedMode() +{ + return m_pvtLedMode; +} + +void CApnCamera::write_LedMode( Apn_LedMode LedMode ) +{ + unsigned short RegVal; + + Read( FPGA_REG_OP_A, RegVal ); + + switch ( LedMode ) + { + case Apn_LedMode_DisableAll: + RegVal |= FPGA_BIT_LED_DISABLE; + break; + case Apn_LedMode_DisableWhileExpose: + RegVal &= ~FPGA_BIT_LED_DISABLE; + RegVal |= FPGA_BIT_LED_EXPOSE_DISABLE; + break; + case Apn_LedMode_EnableAll: + RegVal &= ~FPGA_BIT_LED_DISABLE; + RegVal &= ~FPGA_BIT_LED_EXPOSE_DISABLE; + break; + } + + m_pvtLedMode = LedMode; + + Write( FPGA_REG_OP_A, RegVal ); +} + +Apn_LedState CApnCamera::read_LedState( unsigned short LedId ) +{ + Apn_LedState RetVal(0); + + if ( LedId == 0 ) // LED A + RetVal = m_pvtLedStateA; + + if ( LedId == 1 ) // LED B + RetVal = m_pvtLedStateB; + + return RetVal; +} + +void CApnCamera::write_LedState( unsigned short LedId, Apn_LedState LedState ) +{ + unsigned short RegVal; + + + RegVal = 0x0; + + if ( LedId == 0 ) // LED A + { + RegVal = (m_pvtLedStateB << 4); // keep the current settings for LED B + RegVal |= LedState; // program new settings + m_pvtLedStateA = LedState; + } + else if ( LedId == 1 ) // LED B + { + RegVal = m_pvtLedStateA; // keep the current settings for LED A + RegVal |= (LedState << 4); // program new settings + m_pvtLedStateB = LedState; + } + + Write( FPGA_REG_LED_SELECT, RegVal ); +} + +bool CApnCamera::read_CoolerEnable() +{ + return m_pvtCoolerEnable; +} + +void CApnCamera::write_CoolerEnable( bool CoolerEnable ) +{ + if ( CoolerEnable ) + { + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RAMP_TO_SETPOINT ); + } + else + { + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RAMP_TO_AMBIENT ); + } + + m_pvtCoolerEnable = CoolerEnable; +} + +Apn_CoolerStatus CApnCamera::read_CoolerStatus() +{ + bool CoolerAtTemp; + bool CoolerActive; + bool CoolerTempRevised; + + + UpdateGeneralStatus(); + + // Update CoolerStatus + CoolerActive = false; + CoolerAtTemp = false; + CoolerTempRevised = false; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_AT_TEMP) != 0 ) + CoolerAtTemp = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_ACTIVE) != 0 ) + CoolerActive = true; + + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_REVISION) != 0 ) + CoolerTempRevised = true; + + // Now derive our cooler state + if ( !CoolerActive ) + { + m_pvtCoolerStatus = Apn_CoolerStatus_Off; + } + else + { + if ( CoolerTempRevised ) + { + m_pvtCoolerStatus = Apn_CoolerStatus_Revision; + } + else + { + if ( CoolerAtTemp ) + m_pvtCoolerStatus = Apn_CoolerStatus_AtSetPoint; + else + m_pvtCoolerStatus = Apn_CoolerStatus_RampingToSetPoint; + + } + } + + return m_pvtCoolerStatus; +} + +double CApnCamera::read_CoolerSetPoint() +{ + unsigned short RegVal; + double TempVal; + + Read( FPGA_REG_TEMP_DESIRED, RegVal ); + + RegVal &= 0x0FFF; + + TempVal = ( RegVal - APN_TEMP_SETPOINT_ZERO_POINT ) * APN_TEMP_DEGREES_PER_BIT; + + return TempVal; +} + +void CApnCamera::write_CoolerSetPoint( double SetPoint ) +{ + unsigned short RegVal; + double TempVal; + + + TempVal = SetPoint; + + if ( SetPoint < (APN_TEMP_SETPOINT_MIN - APN_TEMP_KELVIN_SCALE_OFFSET) ) + TempVal = APN_TEMP_SETPOINT_MIN; + + if ( SetPoint > (APN_TEMP_SETPOINT_MAX - APN_TEMP_KELVIN_SCALE_OFFSET) ) + TempVal = APN_TEMP_SETPOINT_MAX; + + RegVal = (unsigned short)( (TempVal / APN_TEMP_DEGREES_PER_BIT) + APN_TEMP_SETPOINT_ZERO_POINT ); + + Write( FPGA_REG_TEMP_DESIRED, RegVal ); +} + +double CApnCamera::read_CoolerBackoffPoint() +{ + return ( m_pvtCoolerBackoffPoint ); +} + +void CApnCamera::write_CoolerBackoffPoint( double BackoffPoint ) +{ + unsigned short RegVal; + double TempVal; + + TempVal = BackoffPoint; + + // BackoffPoint must be a positive number! + if ( BackoffPoint < 0.0 ) + TempVal = 0.0; + + if ( BackoffPoint < (APN_TEMP_SETPOINT_MIN - APN_TEMP_KELVIN_SCALE_OFFSET) ) + TempVal = APN_TEMP_SETPOINT_MIN; + + if ( BackoffPoint > (APN_TEMP_SETPOINT_MAX - APN_TEMP_KELVIN_SCALE_OFFSET) ) + TempVal = APN_TEMP_SETPOINT_MAX; + + m_pvtCoolerBackoffPoint = TempVal; + + RegVal = (unsigned short)( TempVal / APN_TEMP_DEGREES_PER_BIT ); + + Write( FPGA_REG_TEMP_BACKOFF, RegVal ); +} + +double CApnCamera::read_CoolerDrive() +{ + UpdateGeneralStatus(); + + return m_pvtCoolerDrive; +} + +double CApnCamera::read_TempCCD() +{ + // UpdateGeneralStatus(); + + unsigned short TempReg; + unsigned short TempAvg; + unsigned long TempTotal; + int don; + + TempTotal = 0; + don = 8; + if ( m_CameraInterface == Apn_Interface_NET ) { + don = 1; + } + + for ( int i=0; i<don; i++ ) + { + Read( FPGA_REG_TEMP_CCD, TempReg ); + TempTotal += TempReg; + } + + TempAvg = (unsigned short)(TempTotal / don); + + m_pvtCurrentCcdTemp = ( (TempAvg - APN_TEMP_SETPOINT_ZERO_POINT) + * APN_TEMP_DEGREES_PER_BIT ); + + return m_pvtCurrentCcdTemp; +} + +double CApnCamera::read_TempHeatsink() +{ + // UpdateGeneralStatus(); + + unsigned short TempReg; + unsigned short TempAvg; + unsigned long TempTotal; + int don; + + TempTotal = 0; + don = 8; + if ( m_CameraInterface == Apn_Interface_NET ) { + don = 1; + } + + for ( int i=0; i<don; i++ ) + { + Read( FPGA_REG_TEMP_HEATSINK, TempReg ); + TempTotal += TempReg; + } + + TempAvg = (unsigned short)(TempTotal / don); + + m_pvtCurrentHeatsinkTemp = ( (TempAvg - APN_TEMP_HEATSINK_ZERO_POINT) + * APN_TEMP_DEGREES_PER_BIT ); + + return m_pvtCurrentHeatsinkTemp; +} + +Apn_FanMode CApnCamera::read_FanMode() +{ + return m_pvtFanMode; +} + +void CApnCamera::write_FanMode( Apn_FanMode FanMode ) +{ + unsigned short RegVal; + unsigned short OpRegA; + + + if ( m_pvtFanMode == FanMode ) + return; + + if ( m_pvtCoolerEnable ) + { + Read( FPGA_REG_OP_A, OpRegA ); + OpRegA |= FPGA_BIT_TEMP_SUSPEND; + Write( FPGA_REG_OP_A, OpRegA ); + + do + { + Read( FPGA_REG_GENERAL_STATUS, RegVal ); + } while ( (RegVal & FPGA_BIT_STATUS_TEMP_SUSPEND_ACK) == 0 ); + + } + + switch ( FanMode ) + { + case Apn_FanMode_Off: + RegVal = APN_FAN_SPEED_OFF; + break; + case Apn_FanMode_Low: + RegVal = APN_FAN_SPEED_LOW; + break; + case Apn_FanMode_Medium: + RegVal = APN_FAN_SPEED_MEDIUM; + break; + case Apn_FanMode_High: + RegVal = APN_FAN_SPEED_HIGH; + break; + } + + Write( FPGA_REG_FAN_SPEED_CONTROL, RegVal ); + + Read( FPGA_REG_OP_B, RegVal ); + RegVal |= FPGA_BIT_DAC_SELECT_ZERO; + RegVal &= ~FPGA_BIT_DAC_SELECT_ONE; + Write( FPGA_REG_OP_B, RegVal ); + + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_DAC_LOAD ); + + m_pvtFanMode = FanMode; + + if ( m_pvtCoolerEnable ) + { + OpRegA &= ~FPGA_BIT_TEMP_SUSPEND; + Write( FPGA_REG_OP_A, OpRegA ); + } +} + +double CApnCamera::read_ShutterStrobePosition() +{ + return m_pvtShutterStrobePosition; +} + +void CApnCamera::write_ShutterStrobePosition( double Position ) +{ + unsigned short RegVal; + + if ( Position < APN_STROBE_POSITION_MIN ) + Position = APN_STROBE_POSITION_MIN; + + RegVal = (unsigned short)((Position - APN_STROBE_POSITION_MIN) / APN_TIMER_RESOLUTION); + + Write( FPGA_REG_SHUTTER_STROBE_POSITION, RegVal ); + + m_pvtShutterStrobePosition = Position; +} + +double CApnCamera::read_ShutterStrobePeriod() +{ + return m_pvtShutterStrobePeriod; +} + +void CApnCamera::write_ShutterStrobePeriod( double Period ) +{ + unsigned short RegVal; + + if ( Period < APN_STROBE_PERIOD_MIN ) + Period = APN_STROBE_PERIOD_MIN; + + RegVal = (unsigned short)((Period - APN_STROBE_PERIOD_MIN) / APN_PERIOD_TIMER_RESOLUTION); + + Write( FPGA_REG_SHUTTER_STROBE_PERIOD, RegVal ); + + m_pvtShutterStrobePeriod = Period; +} + +double CApnCamera::read_SequenceDelay() +{ + return m_pvtSequenceDelay; +} + +void CApnCamera::write_SequenceDelay( double Delay ) +{ + unsigned short RegVal; + + if ( Delay > APN_SEQUENCE_DELAY_LIMIT ) + Delay = APN_SEQUENCE_DELAY_LIMIT; + + m_pvtSequenceDelay = Delay; + + RegVal = (unsigned short)(Delay / APN_SEQUENCE_DELAY_RESOLUTION); + + Write( FPGA_REG_SEQUENCE_DELAY, RegVal ); +} + +bool CApnCamera::read_VariableSequenceDelay() +{ + unsigned short RegVal; + Read( FPGA_REG_OP_A, RegVal ); + // variable delay occurs when the bit is 0 + return ( (RegVal & FPGA_BIT_DELAY_MODE) == 0 ); +} + +void CApnCamera::write_VariableSequenceDelay( bool VariableSequenceDelay ) +{ + unsigned short RegVal; + + Read( FPGA_REG_OP_A, RegVal ); + + if ( VariableSequenceDelay ) + RegVal &= ~FPGA_BIT_DELAY_MODE; // variable when zero + else + RegVal |= FPGA_BIT_DELAY_MODE; // constant when one + + Write( FPGA_REG_OP_A, RegVal ); +} + +unsigned short CApnCamera::read_ImageCount() +{ + return m_pvtImageCount; +} + +void CApnCamera::write_ImageCount( unsigned short Count ) +{ + if ( Count == 0 ) + Count = 1; + + Write( FPGA_REG_IMAGE_COUNT, Count ); + + m_pvtImageCount = Count; +} + +void CApnCamera::write_RoiBinningH( unsigned short BinningH ) +{ + // Check to see if we actually need to update the binning + if ( BinningH != m_RoiBinningH ) + { + // Reset the camera + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + + LoadRoiPattern( BinningH ); + m_RoiBinningH = BinningH; + + // Reset the camera + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + + // Start flushing + Write( FPGA_REG_COMMAND_A, FPGA_BIT_CMD_FLUSH ); + } +} + +void CApnCamera::write_RoiBinningV( unsigned short BinningV ) +{ + // Check to see if we actually need to update the binning + if ( BinningV != m_RoiBinningV ) + { + m_RoiBinningV = BinningV; + } +} + +void CApnCamera::write_RoiPixelsV( unsigned short PixelsV ) +{ + m_RoiPixelsV = PixelsV; +} + +void CApnCamera::write_RoiStartY( unsigned short StartY ) +{ + m_RoiStartY = StartY; +} + +unsigned short CApnCamera::read_OverscanColumns() +{ + return m_ApnSensorInfo->m_OverscanColumns; +} + +unsigned short CApnCamera::read_MaxBinningV() +{ + if ( m_ApnSensorInfo->m_ImagingRows < APN_VBINNING_MAX ) + return m_ApnSensorInfo->m_ImagingRows; + else + return APN_VBINNING_MAX; +} + +unsigned short CApnCamera::read_SequenceCounter() +{ + unsigned short RegVal; + Read( FPGA_REG_SEQUENCE_COUNTER, RegVal ); + return RegVal; +} + +unsigned short CApnCamera::read_TDICounter() +{ + unsigned short RegVal; + Read( FPGA_REG_TDI_COUNTER, RegVal ); + return RegVal; +} + +unsigned short CApnCamera::read_TDIRows() +{ + return m_pvtTDIRows; +} + +void CApnCamera::write_TDIRows( unsigned short TdiRows ) +{ + if ( TdiRows == 0 ) // Make sure the TDI row count is at least 1 + TdiRows = 1; + + Write( FPGA_REG_TDI_COUNT, TdiRows ); + m_pvtTDIRows = TdiRows; +} + +double CApnCamera::read_TDIRate() +{ + return m_pvtTDIRate; +} + +void CApnCamera::write_TDIRate( double TdiRate ) +{ + unsigned short RegVal; + + if ( TdiRate < APN_TDI_RATE_MIN ) + TdiRate = APN_TDI_RATE_MIN; + + if ( TdiRate > APN_TDI_RATE_MAX ) + TdiRate = APN_TDI_RATE_MAX; + + RegVal = (unsigned short)( TdiRate / APN_TDI_RATE_RESOLUTION ); + + Write( FPGA_REG_TDI_RATE, RegVal ); + + m_pvtTDIRate = TdiRate; +} + +unsigned short CApnCamera::read_IoPortAssignment() +{ + unsigned short RegVal; + Read( FPGA_REG_IO_PORT_ASSIGNMENT, RegVal ); + RegVal &= FPGA_MASK_IO_PORT_ASSIGNMENT; + return RegVal; +} + +void CApnCamera::write_IoPortAssignment( unsigned short IoPortAssignment ) +{ + IoPortAssignment &= FPGA_MASK_IO_PORT_ASSIGNMENT; + Write( FPGA_REG_IO_PORT_ASSIGNMENT, IoPortAssignment ); +} + +unsigned short CApnCamera::read_IoPortDirection() +{ + unsigned short RegVal; + Read( FPGA_REG_IO_PORT_DIRECTION, RegVal ); + RegVal &= FPGA_MASK_IO_PORT_DIRECTION; + return RegVal; +} + +void CApnCamera::write_IoPortDirection( unsigned short IoPortDirection ) +{ + IoPortDirection &= FPGA_MASK_IO_PORT_DIRECTION; + Write( FPGA_REG_IO_PORT_DIRECTION, IoPortDirection ); +} + +unsigned short CApnCamera::read_IoPortData() +{ + unsigned short RegVal; + Read( FPGA_REG_IO_PORT_READ, RegVal ); + RegVal &= FPGA_MASK_IO_PORT_DATA; + return RegVal; +} + +void CApnCamera::write_IoPortData( unsigned short IoPortData ) +{ + IoPortData &= FPGA_MASK_IO_PORT_DATA; + Write( FPGA_REG_IO_PORT_WRITE, IoPortData ); +} + +unsigned short CApnCamera::read_TwelveBitGain() +{ + return m_pvtTwelveBitGain; +} + +void CApnCamera::write_TwelveBitGain( unsigned short TwelveBitGain ) +{ + unsigned short NewVal; + unsigned short StartVal; + unsigned short FirstBit; + + NewVal = 0x0; + StartVal = TwelveBitGain & 0x3FF; + + for ( int i=0; i<10; i++ ) + { + FirstBit = ( StartVal & 0x0001 ); + NewVal |= ( FirstBit << (10-i) ); + StartVal = StartVal >> 1; + } + + NewVal |= 0x4000; + + Write( FPGA_REG_AD_CONFIG_DATA, NewVal ); + Write( FPGA_REG_COMMAND_B, 0x8000 ); + + m_pvtTwelveBitGain = TwelveBitGain & 0x3FF; +} + +double CApnCamera::read_MaxExposureTime() +{ + return APN_EXPOSURE_TIME_MAX; +} + +double CApnCamera::read_TestLedBrightness() +{ + return m_pvtTestLedBrightness; +} + +void CApnCamera::write_TestLedBrightness( double TestLedBrightness ) +{ + unsigned short RegVal; + unsigned short OpRegA; + + + if ( TestLedBrightness == m_pvtTestLedBrightness ) + return; + + if ( m_pvtCoolerEnable ) + { + Read( FPGA_REG_OP_A, OpRegA ); + OpRegA |= FPGA_BIT_TEMP_SUSPEND; + Write( FPGA_REG_OP_A, OpRegA ); + + do + { + Read( FPGA_REG_GENERAL_STATUS, RegVal ); + } while ( (RegVal & FPGA_BIT_STATUS_TEMP_SUSPEND_ACK) == 0 ); + + } + + RegVal = (unsigned short)( (double)FPGA_MASK_LED_ILLUMINATION * (TestLedBrightness/100.0) ); + + Write( FPGA_REG_LED_DRIVE, RegVal ); + + Read( FPGA_REG_OP_B, RegVal ); + RegVal &= ~FPGA_BIT_DAC_SELECT_ZERO; + RegVal |= FPGA_BIT_DAC_SELECT_ONE; + Write( FPGA_REG_OP_B, RegVal ); + + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_DAC_LOAD ); + + m_pvtTestLedBrightness = TestLedBrightness; + + if ( m_pvtCoolerEnable ) + { + OpRegA &= ~FPGA_BIT_TEMP_SUSPEND; + Write( FPGA_REG_OP_A, OpRegA ); + } +} + + + + + + + + +long CApnCamera::LoadVerticalPattern() +{ + unsigned short RegData; + + // Prime the RAM (Enable) + Read( FPGA_REG_OP_B, RegData ); + RegData |= FPGA_BIT_VRAM_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + WriteMultiSRMD( FPGA_REG_VRAM_INPUT, + m_ApnSensorInfo->m_VerticalPattern.PatternData, + m_ApnSensorInfo->m_VerticalPattern.NumElements ); + + // RAM is now loaded (Disable) + Read( FPGA_REG_OP_B, RegData ); + RegData &= ~FPGA_BIT_VRAM_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + return 0; +} + + +long CApnCamera::LoadClampPattern() +{ + unsigned short RegData; + + // Prime the RAM (Enable) + Read( FPGA_REG_OP_B, RegData ); + RegData |= FPGA_BIT_HCLAMP_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + if ( m_DataBits == Apn_Resolution_SixteenBit ) + { + WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternSixteen, + FPGA_REG_HCLAMP_INPUT, + 1 ); + } + else if ( m_DataBits == Apn_Resolution_TwelveBit ) + { + WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternTwelve, + FPGA_REG_HCLAMP_INPUT, + 1 ); + } + + // RAM is now loaded (Disable) + Read( FPGA_REG_OP_B, RegData ); + RegData &= ~FPGA_BIT_HCLAMP_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + return 0; +} + + +long CApnCamera::LoadSkipPattern() +{ + unsigned short RegData; + + // Prime the RAM (Enable) + Read( FPGA_REG_OP_B, RegData ); + RegData |= FPGA_BIT_HSKIP_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + if ( m_DataBits == Apn_Resolution_SixteenBit ) + { + WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternSixteen, + FPGA_REG_HSKIP_INPUT, + 1 ); + } + else if ( m_DataBits == Apn_Resolution_TwelveBit ) + { + WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternTwelve, + FPGA_REG_HSKIP_INPUT, + 1 ); + } + + // RAM is now loaded (Disable) + Read( FPGA_REG_OP_B, RegData ); + RegData &= ~FPGA_BIT_HSKIP_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + return 0; +} + + +long CApnCamera::LoadRoiPattern( unsigned short binning ) +{ + unsigned short RegData; + + // Prime the RAM (Enable) + Read( FPGA_REG_OP_B, RegData ); + RegData |= FPGA_BIT_HRAM_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + if ( m_DataBits == Apn_Resolution_SixteenBit ) + { + WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternSixteen, + FPGA_REG_HRAM_INPUT, + binning ); + } + else if ( m_DataBits == Apn_Resolution_TwelveBit ) + { + WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternTwelve, + FPGA_REG_HRAM_INPUT, + binning ); + } + + // RAM is now loaded (Disable) + Read( FPGA_REG_OP_B, RegData ); + RegData &= ~FPGA_BIT_HRAM_ENABLE; + Write( FPGA_REG_OP_B, RegData ); + + return 0; +} + + +long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern, + unsigned short RamReg, + unsigned short Binning ) +{ + unsigned short i; + unsigned short DataCount; + unsigned short *DataArray; + unsigned short Index; + unsigned short BinNumber; + + + Index = 0; + BinNumber = Binning - 1; // arrays are zero-based + + DataCount = Pattern->RefNumElements + + Pattern->BinNumElements[BinNumber] + + Pattern->SigNumElements; + + DataArray = (unsigned short *)malloc(DataCount * sizeof(unsigned short)); + + for ( i=0; i<Pattern->RefNumElements; i++ ) + { + DataArray[Index] = Pattern->RefPatternData[i]; + Index++; + } + + for ( i=0; i<Pattern->BinNumElements[BinNumber]; i++ ) + { + DataArray[Index] = Pattern->BinPatternData[BinNumber][i]; + Index++; + } + + for ( i=0; i<Pattern->SigNumElements; i++ ) + { + DataArray[Index] = Pattern->SigPatternData[i]; + Index++; + } + + WriteMultiSRMD( RamReg, DataArray, DataCount ); + + // cleanup + free( DataArray ); + + return 0; +} + + +long CApnCamera::InitDefaults() +{ + unsigned short RegVal; + unsigned short CameraID; + unsigned short ShutterDelay; + + unsigned short PreRoiRows, PostRoiRows; + unsigned short PreRoiVBinning, PostRoiVBinning; + unsigned short UnbinnedRoiY; // Vertical ROI pixels + + + // Read the Camera ID register + Read( FPGA_REG_CAMERA_ID, CameraID ); + CameraID &= FPGA_MASK_CAMERA_ID; + + // Look up the ID and dynamically create the m_ApnSensorInfo object + switch ( CameraID ) + { + case APN_ALTA_KAF0401E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF0401E; + break; + case APN_ALTA_KAF1602E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF1602E; + break; + case APN_ALTA_KAF0261E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF0261E; + break; + case APN_ALTA_KAF1301E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF1301E; + break; + case APN_ALTA_KAF1401E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF1401E; + break; + case APN_ALTA_KAF1001E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF1001E; + break; + case APN_ALTA_KAF3200E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF3200E; + break; + case APN_ALTA_KAF4202_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF4202; + break; + case APN_ALTA_KAF6303E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF6303E; + break; + case APN_ALTA_KAF16801E_CAM_ID: + m_ApnSensorInfo = new CApnCamData_KAF16801E; + break; + case APN_ALTA_TH7899_CAM_ID: + m_ApnSensorInfo = new CApnCamData_TH7899; + break; + case APN_ALTA_CCD4710LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4710LS; + break; + case APN_ALTA_CCD4710HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4710HS; + break; + case APN_ALTA_CCD4240LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4240LS; + break; + case APN_ALTA_CCD4240HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4240HS; + break; + case APN_ALTA_CCD5710LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD5710LS; + break; + case APN_ALTA_CCD5710HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD5710HS; + break; + case APN_ALTA_CCD3011LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD3011LS; + break; + case APN_ALTA_CCD3011HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD3011HS; + break; + case APN_ALTA_CCD5520LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD5520LS; + break; + case APN_ALTA_CCD5520HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD5520HS; + break; + case APN_ALTA_CCD4720LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4720LS; + break; + case APN_ALTA_CCD4720HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4720HS; + break; + case APN_ALTA_CCD7700LS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD7700LS; + break; + case APN_ALTA_CCD7700HS_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD7700HS; + break; + case APN_ALTA_CCD4710LS2_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4710LS2; + break; + case APN_ALTA_CCD4710LS3_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4710LS3; + break; + case APN_ALTA_CCD4710LS4_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4710LS4; + break; + case APN_ALTA_CCD4710LS5_CAM_ID: + m_ApnSensorInfo = new CApnCamData_CCD4710LS5; + break; + default: + return 1; + break; + } + + // we created the object, now set everything + m_ApnSensorInfo->Initialize(); + + // Initialize public variables + m_DigitizeOverscan = false; + m_DataBits = Apn_Resolution_SixteenBit; + + // Initialize private variables + m_pvtCameraMode = Apn_CameraMode_Normal; + m_pvtNetworkTransferMode = Apn_NetworkMode_Tcp; + + // Initialize variables used for imaging + m_RoiStartX = 0; + m_RoiStartY = 0; + m_RoiPixelsH = m_ApnSensorInfo->m_ImagingColumns; + m_RoiPixelsV = m_ApnSensorInfo->m_ImagingRows; + + m_RoiBinningH = 1; + m_RoiBinningV = 1; + printf ("Camera ID is %u\n",CameraID); + printf("sensor = %s\n", m_ApnSensorInfo->m_Sensor); + printf("model = %s\n",m_ApnSensorInfo->m_CameraModel); + printf("interline = %u\n",m_ApnSensorInfo->m_InterlineCCD); + printf("serialA = %u\n",m_ApnSensorInfo->m_SupportsSerialA); + printf("serialB = %u\n",m_ApnSensorInfo->m_SupportsSerialB); + printf("ccdtype = %u\n",m_ApnSensorInfo->m_SensorTypeCCD); + printf("Tcolumns = %u\n",m_ApnSensorInfo->m_TotalColumns); + printf("ImgColumns = %u\n",m_ApnSensorInfo->m_ImagingColumns); + printf("ClampColumns = %u\n",m_ApnSensorInfo->m_ClampColumns); + printf("PreRoiSColumns = %u\n",m_ApnSensorInfo->m_PreRoiSkipColumns); + printf("PostRoiSColumns = %u\n",m_ApnSensorInfo->m_PostRoiSkipColumns); + printf("OverscanColumns = %u\n",m_ApnSensorInfo->m_OverscanColumns); + printf("TRows = %u\n",m_ApnSensorInfo->m_TotalRows); + printf("ImgRows = %u\n",m_ApnSensorInfo->m_ImagingRows); + printf("UnderscanRows = %u\n",m_ApnSensorInfo->m_UnderscanRows); + printf("OverscanRows = %u\n",m_ApnSensorInfo->m_OverscanRows); + printf("VFlushBinning = %u\n",m_ApnSensorInfo->m_VFlushBinning); + printf("HFlushDisable = %u\n",m_ApnSensorInfo->m_HFlushDisable); + printf("ShutterCloseDelay = %u\n",m_ApnSensorInfo->m_ShutterCloseDelay); + printf("PixelSizeX = %lf\n",m_ApnSensorInfo->m_PixelSizeX); + printf("PixelSizeY = %lf\n",m_ApnSensorInfo->m_PixelSizeY); + printf("Color = %u\n",m_ApnSensorInfo->m_Color); +// printf("ReportedGainTwelveBit = %lf\n",m_ApnSensorInfo->m_ReportedGainTwelveBit); + printf("ReportedGainSixteenBit = %lf\n",m_ApnSensorInfo->m_ReportedGainSixteenBit); + printf("MinSuggestedExpTime = %lf\n",m_ApnSensorInfo->m_MinSuggestedExpTime); + printf("CoolingSupported = %u\n",m_ApnSensorInfo->m_CoolingSupported); + printf("RegulatedCoolingSupported = %u\n",m_ApnSensorInfo->m_RegulatedCoolingSupported); + printf("TempSetPoint = %lf\n",m_ApnSensorInfo->m_TempSetPoint); +// printf("TempRegRate = %u\n",m_ApnSensorInfo->m_TempRegRate); + printf("TempRampRateOne = %u\n",m_ApnSensorInfo->m_TempRampRateOne); + printf("TempRampRateTwo = %u\n",m_ApnSensorInfo->m_TempRampRateTwo); + printf("TempBackoffPoint = %lf\n",m_ApnSensorInfo->m_TempBackoffPoint); + printf("DefaultGainTwelveBit = %u\n",m_ApnSensorInfo->m_DefaultGainTwelveBit); + printf("DefaultOffsetTwelveBit = %u\n",m_ApnSensorInfo->m_DefaultOffsetTwelveBit); + printf("DefaultRVoltage = %u\n",m_ApnSensorInfo->m_DefaultRVoltage); + + + + printf ("RoiPixelsH is %u\n",m_RoiPixelsH); + printf ("RoiPixelsV is %u\n",m_RoiPixelsV); + + + // Issue a clear command, so the registers are zeroed out + // This will put the camera in a known state for us. + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_CLEAR_ALL ); + + // Reset the camera + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + + // Load Inversion Masks + Write( FPGA_REG_VRAM_INV_MASK, m_ApnSensorInfo->m_VerticalPattern.Mask ); + Write( FPGA_REG_HRAM_INV_MASK, m_ApnSensorInfo->m_RoiPatternSixteen.Mask ); + + // Load Pattern Files + LoadVerticalPattern(); + LoadClampPattern(); + LoadSkipPattern(); + LoadRoiPattern( m_RoiBinningH ); + + // Program default camera settings + Write( FPGA_REG_CLAMP_COUNT, m_ApnSensorInfo->m_ClampColumns ); + Write( FPGA_REG_PREROI_SKIP_COUNT, m_ApnSensorInfo->m_PreRoiSkipColumns ); + Write( FPGA_REG_ROI_COUNT, m_ApnSensorInfo->m_ImagingColumns ); + Write( FPGA_REG_POSTROI_SKIP_COUNT, m_ApnSensorInfo->m_PostRoiSkipColumns + + m_ApnSensorInfo->m_OverscanColumns ); + + // Since the default state of m_DigitizeOverscan is false, set the count to zero. + Write( FPGA_REG_OVERSCAN_COUNT, 0x0 ); + + // Now calculate the vertical settings + UnbinnedRoiY = m_RoiPixelsV * m_RoiBinningV; + + PreRoiRows = m_ApnSensorInfo->m_UnderscanRows + + m_RoiStartY; + + PostRoiRows = m_ApnSensorInfo->m_TotalRows - + PreRoiRows - + UnbinnedRoiY; + + PreRoiVBinning = 1; + PostRoiVBinning = 1; + + // For interline CCDs, set "Fast Dump" mode if the particular array is NOT digitized + if ( m_ApnSensorInfo->m_InterlineCCD ) + { + // use the fast dump feature to get rid of the data quickly. + // one row, binning to the original row count + // note that we only are not digitized in arrays 1 and 3 + PreRoiVBinning = PreRoiRows; + PostRoiVBinning = PostRoiRows; + + PreRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; + PostRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; + + PreRoiRows = 1; + PostRoiRows = 1; + } + + // Program the vertical settings + Write( FPGA_REG_A1_ROW_COUNT, PreRoiRows ); + Write( FPGA_REG_A1_VBINNING, PreRoiVBinning ); + + Write( FPGA_REG_A2_ROW_COUNT, m_RoiPixelsV ); + Write( FPGA_REG_A2_VBINNING, (m_RoiBinningV | FPGA_BIT_ARRAY_DIGITIZE) ); + + Write( FPGA_REG_A3_ROW_COUNT, PostRoiRows ); + Write( FPGA_REG_A3_VBINNING, PostRoiVBinning ); + + Write( FPGA_REG_VFLUSH_BINNING, m_ApnSensorInfo->m_VFlushBinning ); + + double CloseDelay = (double)m_ApnSensorInfo->m_ShutterCloseDelay / 1000; + ShutterDelay = (unsigned short) + ( (CloseDelay - APN_SHUTTER_CLOSE_DIFF) / APN_TIMER_RESOLUTION ); + + Write( FPGA_REG_SHUTTER_CLOSE_DELAY, ShutterDelay ); + + Write( FPGA_REG_IMAGE_COUNT, 1 ); + Write( FPGA_REG_SEQUENCE_DELAY, 0 ); + + if ( m_ApnSensorInfo->m_HFlushDisable ) + { + Read( FPGA_REG_OP_A, RegVal ); + + RegVal |= FPGA_BIT_DISABLE_H_CLK; + + Write( FPGA_REG_OP_A, RegVal ); + } + + // Reset the camera again + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_RESET ); + + // Start flushing + Write( FPGA_REG_COMMAND_A, FPGA_BIT_CMD_FLUSH ); + + // If we are a USB2 camera, set all the 12bit variables for the 12bit + // A/D processor + if ( m_CameraInterface == Apn_Interface_USB ) + { + InitTwelveBitAD(); + write_TwelveBitGain( m_ApnSensorInfo->m_DefaultGainTwelveBit ); + WriteTwelveBitOffset(); + } + + // Set the Fan State. Setting the private var first to make sure the write_FanMode + // call thinks we're doing a state transition. + // On write_FanMode return, our state will be Apn_FanMode_Medium + m_pvtFanMode = Apn_FanMode_Off; // we're going to set this + write_FanMode( Apn_FanMode_Medium ); + + // Initialize the LED states and the LED mode. There is nothing to output + // to the device since we issued our CLEAR early in the init() process, and + // we are now in a known state. + m_pvtLedStateA = Apn_LedState_Expose; + m_pvtLedStateB = Apn_LedState_Expose; + m_pvtLedMode = Apn_LedMode_EnableAll; + + // Default value for test LED is 0% + m_pvtTestLedBrightness = 0.0; + + // Program our initial cooler values. The only cooler value that we reset + // at init time is the backoff point. Everything else is left untouched, and + // state information is determined from the camera controller. + m_pvtCoolerBackoffPoint = m_ApnSensorInfo->m_TempBackoffPoint; + write_CoolerBackoffPoint( m_pvtCoolerBackoffPoint ); + Write( FPGA_REG_TEMP_RAMP_DOWN_A, m_ApnSensorInfo->m_TempRampRateOne ); + Write( FPGA_REG_TEMP_RAMP_DOWN_B, m_ApnSensorInfo->m_TempRampRateTwo ); + // the collor code not only determines the m_pvtCoolerEnable state, but + // also implicitly calls UpdateGeneralStatus() as part of read_CoolerStatus() + if ( read_CoolerStatus() == Apn_CoolerStatus_Off ) + m_pvtCoolerEnable = false; + else + m_pvtCoolerEnable = true; + + m_pvtImageInProgress = false; + m_pvtImageReady = false; + + return 0; +} + +long CApnCamera::InitTwelveBitAD() +{ + Write( FPGA_REG_AD_CONFIG_DATA, 0x0028 ); + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_AD_CONFIG ); + + return 0; +} + +long CApnCamera::WriteTwelveBitOffset() +{ + unsigned short NewVal; + unsigned short StartVal; + unsigned short FirstBit; + + + NewVal = 0x0; + StartVal = m_ApnSensorInfo->m_DefaultOffsetTwelveBit & 0xFF; + + for ( int i=0; i<8; i++ ) + { + FirstBit = ( StartVal & 0x0001 ); + NewVal |= ( FirstBit << (10-i) ); + StartVal = StartVal >> 1; + } + + NewVal |= 0x2000; + + Write( FPGA_REG_AD_CONFIG_DATA, NewVal ); + Write( FPGA_REG_COMMAND_B, FPGA_BIT_CMD_AD_CONFIG ); + + return 0; +} + +void CApnCamera::UpdateGeneralStatus() +{ + unsigned short StatusReg; + unsigned short HeatsinkTempReg; + unsigned short CcdTempReg; + unsigned short CoolerDriveReg; + unsigned short VoltageReg; + unsigned short TdiCounterReg; + unsigned short SequenceCounterReg; + + + + // Read the general status register of the device + QueryStatusRegs( StatusReg, + HeatsinkTempReg, + CcdTempReg, + CoolerDriveReg, + VoltageReg, + TdiCounterReg, + SequenceCounterReg ); + + m_pvtStatusReg = StatusReg; + + HeatsinkTempReg &= FPGA_MASK_TEMP_PARAMS; + CcdTempReg &= FPGA_MASK_TEMP_PARAMS; + CoolerDriveReg &= FPGA_MASK_TEMP_PARAMS; + VoltageReg &= FPGA_MASK_INPUT_VOLTAGE; + + if ( CoolerDriveReg > 3200 ) + m_pvtCoolerDrive = 100.0; + else + m_pvtCoolerDrive = ( (double)(CoolerDriveReg - 600) / 2600.0 ) * 100.0; + + m_pvtCurrentCcdTemp = ( (CcdTempReg - APN_TEMP_SETPOINT_ZERO_POINT) + * APN_TEMP_DEGREES_PER_BIT ); + + m_pvtCurrentHeatsinkTemp = ( (HeatsinkTempReg - APN_TEMP_HEATSINK_ZERO_POINT) + * APN_TEMP_DEGREES_PER_BIT ); + + m_pvtInputVoltage = VoltageReg * APN_VOLTAGE_RESOLUTION; + + // Update ShutterState + m_pvtShutterState = ( (m_pvtStatusReg & FPGA_BIT_STATUS_SHUTTER_OPEN) != 0 ); +} + + +bool CApnCamera::ImageReady() +{ + return m_pvtImageReady; +} + + +void CApnCamera::SignalImagingDone() +{ + m_pvtImageInProgress = false; +} + + + + + diff --git a/kstars/kstars/indi/apogee/ApnCamera.h b/kstars/kstars/indi/apogee/ApnCamera.h new file mode 100644 index 00000000..b0e6af03 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera.h @@ -0,0 +1,332 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// ApnCamera.h: interface for the CApnCamera class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNCAMERA_H__CF513996_359F_4103_BBA6_2C730AE2C301__INCLUDED_) +#define AFX_APNCAMERA_H__CF513996_359F_4103_BBA6_2C730AE2C301__INCLUDED_ + +#include "Apogee.h" +#include "Apn.h" +#include "FpgaRegs.h" + +#include "ApnCamData.h" +#include "ApnCamData_CCD3011HS.h" +#include "ApnCamData_CCD3011LS.h" +#include "ApnCamData_CCD4240HS.h" +#include "ApnCamData_CCD4240LS.h" +#include "ApnCamData_CCD4710HS.h" +#include "ApnCamData_CCD4710LS.h" +#include "ApnCamData_CCD4720HS.h" +#include "ApnCamData_CCD4720LS.h" +#include "ApnCamData_CCD5520HS.h" +#include "ApnCamData_CCD5520LS.h" +#include "ApnCamData_CCD5710HS.h" +#include "ApnCamData_CCD5710LS.h" +#include "ApnCamData_CCD7700HS.h" +#include "ApnCamData_CCD7700LS.h" +#include "ApnCamData_KAF0261E.h" +#include "ApnCamData_KAF0401E.h" +#include "ApnCamData_KAF1001E.h" +#include "ApnCamData_KAF1301E.h" +#include "ApnCamData_KAF1401E.h" +#include "ApnCamData_KAF1602E.h" +#include "ApnCamData_KAF16801E.h" +#include "ApnCamData_KAF3200E.h" +#include "ApnCamData_KAF4202.h" +#include "ApnCamData_KAF6303E.h" +#include "ApnCamData_TH7899.h" + +#include "ApnCamData_CCD4710LS2.h" +#include "ApnCamData_CCD4710LS3.h" +#include "ApnCamData_CCD4710LS4.h" +#include "ApnCamData_CCD4710LS5.h" + + +class CApnCamera +{ +public: + CApnCamera(); + ~CApnCamera(); + + bool InitDriver( unsigned long CamIdA, + unsigned short CamIdB, + unsigned long Option ); + + bool CloseDriver(); + long PreStartExpose( unsigned short BitsPerPixel ); + long PostStopExposure( bool DigitizeData ); + + bool GetImageData( unsigned short *pImageData, + unsigned short &Width, + unsigned short &Height, + unsigned long &Count ); + + bool GetLineData( unsigned short *pLineBuffer, + unsigned short &Size ); + + long Read( unsigned short reg, unsigned short& val ); + long Write( unsigned short reg, unsigned short val ); + + long WriteMultiSRMD( unsigned short reg, + unsigned short val[], + unsigned short count ); + + long WriteMultiMRMD( unsigned short reg[], + unsigned short val[], + unsigned short count ); + + long QueryStatusRegs( unsigned short& StatusReg, + unsigned short& HeatsinkTempReg, + unsigned short& CcdTempReg, + unsigned short& CoolerDriveReg, + unsigned short& VoltageReg, + unsigned short& TdiCounter, + unsigned short& SequenceCounter ); + + void SetNetworkTransferMode( Apn_NetworkMode TransferMode ); + + long InitDefaults(); + + bool Expose( double Duration, bool Light ); + bool BufferImage(char *bufferName ); + bool BufferDriftScan(char *bufferName, int delay, int rowCount, int nblock , int npipe); + + bool StopExposure( bool DigitizeData ); + + bool ResetSystem(); + bool PauseTimer( bool PauseState ); + + + unsigned short GetExposurePixelsH(); + unsigned short GetExposurePixelsV(); + + bool read_Present(); + unsigned short read_FirmwareVersion(); + + bool read_ShutterState(); + bool read_DisableShutter(); + void write_DisableShutter( bool DisableShutter ); + bool read_ForceShutterOpen(); + void write_ForceShutterOpen( bool ForceShutterOpen ); + bool read_ShutterAmpControl(); + void write_ShutterAmpControl( bool ShutterAmpControl ); + + bool read_ExternalIoReadout(); + void write_ExternalIoReadout( bool ExternalIoReadout ); + bool read_FastSequence(); + void write_FastSequence( bool FastSequence ); + + Apn_CameraMode read_CameraMode(); + void write_CameraMode( Apn_CameraMode CameraMode ); + + void write_DataBits( Apn_Resolution BitResolution ); + + Apn_Status read_ImagingStatus(); + + Apn_LedMode read_LedMode(); + void write_LedMode( Apn_LedMode LedMode ); + Apn_LedState read_LedState( unsigned short LedId ); + void write_LedState( unsigned short LedId, Apn_LedState LedState ); + + bool read_CoolerEnable(); + void write_CoolerEnable( bool CoolerEnable ); + Apn_CoolerStatus read_CoolerStatus(); + double read_CoolerSetPoint(); + void write_CoolerSetPoint( double SetPoint ); + double read_CoolerBackoffPoint(); + void write_CoolerBackoffPoint( double BackoffPoint ); + double read_CoolerDrive(); + double read_TempCCD(); + double read_TempHeatsink(); + Apn_FanMode read_FanMode(); + void write_FanMode( Apn_FanMode FanMode ); + + void write_RoiBinningH( unsigned short BinningH ); + void write_RoiBinningV( unsigned short BinningV ); + + void write_RoiPixelsV( unsigned short PixelsV ); + + void write_RoiStartY( unsigned short StartY ); + + unsigned short read_MaxBinningV(); + unsigned short read_OverscanColumns(); + + double read_ShutterStrobePosition(); + void write_ShutterStrobePosition( double Position ); + double read_ShutterStrobePeriod(); + void write_ShutterStrobePeriod( double Period ); + + double read_SequenceDelay(); + void write_SequenceDelay( double Delay ); + bool read_VariableSequenceDelay(); + void write_VariableSequenceDelay( bool VariableSequenceDelay ); + unsigned short read_ImageCount(); + void write_ImageCount( unsigned short Count ); + + unsigned short read_SequenceCounter(); + unsigned short read_TDICounter(); + unsigned short read_TDIRows(); + void write_TDIRows( unsigned short TdiRows ); + double read_TDIRate(); + void write_TDIRate( double TdiRate ); + unsigned short read_IoPortAssignment(); + void write_IoPortAssignment( unsigned short IoPortAssignment ); + unsigned short read_IoPortDirection(); + void write_IoPortDirection( unsigned short IoPortDirection ); + unsigned short read_IoPortData(); + void write_IoPortData( unsigned short IoPortData ); + + unsigned short read_TwelveBitGain(); + void write_TwelveBitGain( unsigned short TwelveBitGain ); + + double read_InputVoltage(); + long read_AvailableMemory(); + + double read_MaxExposureTime(); + + Apn_NetworkMode read_NetworkTransferMode(); + void write_NetworkTransferMode( Apn_NetworkMode TransferMode ); + + double read_TestLedBrightness(); + void write_TestLedBrightness( double TestLedBrightness ); + + + // Public helper function + bool ImageReady(); + void SignalImagingDone(); + + + // Variables + Apn_Interface m_CameraInterface; + + CApnCamData *m_ApnSensorInfo; + + unsigned short m_RoiStartX, m_RoiStartY; + unsigned short m_RoiPixelsH, m_RoiPixelsV; + unsigned short m_RoiBinningH, m_RoiBinningV; + + bool m_DigitizeOverscan; + Apn_Resolution m_DataBits; + +/* was private: */ + + // General helper functions + long LoadVerticalPattern(); + long LoadClampPattern(); + long LoadSkipPattern(); + long LoadRoiPattern( unsigned short Binning ); + + long WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern, + unsigned short reg, + unsigned short binning ); + + long InitTwelveBitAD(); + long WriteTwelveBitOffset(); + + void UpdateGeneralStatus(); + + // Internal private variables + bool m_ResetVerticalArrays; + + // Camera state variables + Apn_CameraMode m_pvtCameraMode; + + Apn_NetworkMode m_pvtNetworkTransferMode; + + unsigned short m_pvtImageCount; + unsigned short m_pvtTDIRows; + double m_pvtTDIRate; + + double m_pvtSequenceDelay; + double m_pvtShutterStrobePosition; + double m_pvtShutterStrobePeriod; + + unsigned short m_pvtExposurePixelsH, m_pvtExposurePixelsV; + + unsigned short m_pvtTwelveBitGain; + + Apn_LedMode m_pvtLedMode; + Apn_LedState m_pvtLedStateA; + Apn_LedState m_pvtLedStateB; + + double m_pvtTestLedBrightness; + + bool m_pvtCoolerEnable; + Apn_FanMode m_pvtFanMode; + + double m_pvtCoolerBackoffPoint; + + Apn_CoolerStatus m_pvtCoolerStatus; + Apn_Status m_pvtImagingStatus; + bool m_pvtShutterState; + bool m_pvtImageInProgress; + bool m_pvtImageReady; + + unsigned short m_pvtStatusReg; + + double m_pvtCoolerDrive; + double m_pvtCurrentHeatsinkTemp; + double m_pvtCurrentCcdTemp; + + double m_pvtInputVoltage; + unsigned short m_pvtIoPortAssignment; + unsigned short m_pvtIoPortDirection; + +/* added USB/NET specifics */ + unsigned short m_pvtBitsPerPixel; + unsigned short m_pvtWidth; + unsigned short m_pvtHeight; + + +/* added sensor data mirrors */ + bool sensorInfo(); + char m_Sensor[20]; + char m_CameraModel[20]; + unsigned short m_CameraId; + bool m_InterlineCCD; + bool m_SupportsSerialA; + bool m_SupportsSerialB; + bool m_SensorTypeCCD; + unsigned short m_TotalColumns; + unsigned short m_ImagingColumns; + unsigned short m_ClampColumns; + unsigned short m_PreRoiSkipColumns; + unsigned short m_PostRoiSkipColumns; + unsigned short m_OverscanColumns; + unsigned short m_TotalRows; + unsigned short m_ImagingRows; + unsigned short m_UnderscanRows; + unsigned short m_OverscanRows; + unsigned short m_VFlushBinning; + bool m_HFlushDisable; + unsigned short m_ShutterCloseDelay; + double m_PixelSizeX; + double m_PixelSizeY; + bool m_Color; +// double m_ReportedGainTwelveBit; + double m_ReportedGainSixteenBit; + double m_MinSuggestedExpTime; +// unsigned short m_TempRegRate; + unsigned short m_TempRampRateOne; + unsigned short m_TempRampRateTwo; + unsigned short m_DefaultGainTwelveBit; + unsigned short m_DefaultOffsetTwelveBit; + unsigned short m_DefaultRVoltage; + +}; + +#endif // !defined(AFX_APNCAMERA_H__CF513996_359F_4103_BBA6_2C730AE2C301__INCLUDED_) + + + + + + diff --git a/kstars/kstars/indi/apogee/ApnCamera_Linux.cpp b/kstars/kstars/indi/apogee/ApnCamera_Linux.cpp new file mode 100644 index 00000000..cce9ba37 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera_Linux.cpp @@ -0,0 +1,129 @@ +// ApnCamera.cpp: extras from the CCameraIO class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" + +#include "ApnCamera.h" +#include "ApnCamTable.h" +//#include "tcl.h" +//#include "ccd.h" + + +// Determine if camera is present +// True if camera is present, false otherwise. +bool CApnCamera::read_Present() +{ + // OutputDebugString( "read_Present()" ); + + USHORT ApStatus; + USHORT DatumA; + USHORT DatumB; + char szMsg[80]; + + DatumA = 0x0; + DatumB = 0x0; + ApStatus = 0; + + Write( FPGA_REG_SCRATCH, 0x8086 ); + Read( FPGA_REG_SCRATCH, DatumA ); + + Write( FPGA_REG_SCRATCH, 0x1F2F ); + Read( FPGA_REG_SCRATCH, DatumB ); + + if ( (DatumA != 0x8086) || (DatumB != 0x1F2F) ) + { + // OutputDebugString( "read_Present FAILED." ); + sprintf( szMsg, "read_Present FAILED. DatumA: 0x%X DatumB: 0x%X", DatumA, DatumB ); + // OutputDebugString( szMsg ); + return false; + } + + // OutputDebugString( "read_Present SUCCESS" ); + + return true; +} + +bool CApnCamera::sensorInfo() +{ + strcpy(m_Sensor,m_ApnSensorInfo->m_Sensor); + strcpy(m_CameraModel,m_ApnSensorInfo->m_CameraModel); + m_CameraId = m_ApnSensorInfo->m_CameraId; + m_InterlineCCD = m_ApnSensorInfo->m_InterlineCCD; + m_SupportsSerialA = m_ApnSensorInfo->m_SupportsSerialA; + m_SupportsSerialB = m_ApnSensorInfo->m_SupportsSerialB; + m_SensorTypeCCD =m_ApnSensorInfo->m_SensorTypeCCD; + m_TotalColumns =m_ApnSensorInfo->m_TotalColumns; + m_ImagingColumns= m_ApnSensorInfo->m_ImagingColumns; + m_ClampColumns= m_ApnSensorInfo->m_ClampColumns; + m_PreRoiSkipColumns =m_ApnSensorInfo->m_PreRoiSkipColumns; + m_PostRoiSkipColumns= m_ApnSensorInfo->m_PostRoiSkipColumns; + m_OverscanColumns =m_ApnSensorInfo->m_OverscanColumns; + m_TotalRows =m_ApnSensorInfo->m_TotalRows; + m_ImagingRows =m_ApnSensorInfo->m_ImagingRows; + m_UnderscanRows= m_ApnSensorInfo->m_UnderscanRows; + m_OverscanRows =m_ApnSensorInfo->m_OverscanRows; + m_VFlushBinning =m_ApnSensorInfo->m_VFlushBinning; + m_HFlushDisable =m_ApnSensorInfo->m_HFlushDisable; + m_ShutterCloseDelay= m_ApnSensorInfo->m_ShutterCloseDelay; + m_PixelSizeX = m_ApnSensorInfo->m_PixelSizeX; + m_PixelSizeY = m_ApnSensorInfo->m_PixelSizeY; + m_Color = m_ApnSensorInfo->m_Color; +// m_ReportedGainTwelveBit = m_ApnSensorInfo->m_ReportedGainTwelveBit; + m_ReportedGainSixteenBit= m_ApnSensorInfo->m_ReportedGainSixteenBit; + m_MinSuggestedExpTime = m_ApnSensorInfo->m_MinSuggestedExpTime; +// m_TempRegRate =m_ApnSensorInfo->m_TempRegRate; + m_TempRampRateOne =m_ApnSensorInfo->m_TempRampRateOne; + m_TempRampRateTwo =m_ApnSensorInfo->m_TempRampRateTwo; + m_DefaultGainTwelveBit =m_ApnSensorInfo->m_DefaultGainTwelveBit; + m_DefaultOffsetTwelveBit= m_ApnSensorInfo->m_DefaultOffsetTwelveBit; + m_DefaultRVoltage =m_ApnSensorInfo->m_DefaultRVoltage; + return true; + +} + +#if 0 +bool CApnCamera::BufferImage(char *bufferName ) +{ + unsigned short *pImageData; + bool status; + short cols,rows,hbin,vbin; + unsigned short xSize, ySize; + unsigned long count; + + cols = m_pvtExposurePixelsH; + rows = m_pvtExposurePixelsV; + + /* ALTA code has already applied binning calculations*/ + hbin = 1; + vbin = 1; + + pImageData = (unsigned short *)CCD_locate_buffer(bufferName, 2 , cols, rows, hbin, vbin ); + if (pImageData == NULL) { + return 0; + } + + status = GetImageData(pImageData, xSize, ySize, count); + return status; +} + + + +bool CApnCamera::BufferDriftScan(char *bufferName, int delay, int rowCount, int nblock , int npipe) +{ + unsigned short *pImageData, *ptr; + bool status; + int irow; + short cols,rows,hbin,vbin; + + cols = m_pvtExposurePixelsH; + rows = rowCount; + hbin = m_RoiBinningH; + vbin = 1; + return 1; +} + +#endif + + + diff --git a/kstars/kstars/indi/apogee/ApnCamera_NET.cpp b/kstars/kstars/indi/apogee/ApnCamera_NET.cpp new file mode 100644 index 00000000..0f739121 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera_NET.cpp @@ -0,0 +1,275 @@ +// ApnCamera_NET.cpp: implementation of the CApnCamera_NET class. +// +// Copyright (c) 2003, 2004 Apogee Instruments, Inc. +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ApnCamera_NET.h" + +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include "ApogeeNet.h" +#include "ApogeeNetErr.h" + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + + + +bool CApnCamera::InitDriver( unsigned long CamIdA, + unsigned short CamIdB, + unsigned long Option ) +{ + char Hostname[25]; + BYTE ipAddr[4]; + int init; + + ipAddr[0] = (BYTE)(CamIdA & 0xFF); + ipAddr[1] = (BYTE)((CamIdA >> 8) & 0xFF); + ipAddr[2] = (BYTE)((CamIdA >> 16) & 0xFF); + ipAddr[3] = (BYTE)((CamIdA >> 24) & 0xFF); + + sprintf( Hostname, "%u.%u.%u.%u:%u", ipAddr[3], ipAddr[2], ipAddr[1], ipAddr[0], CamIdB ); + + if ( ApnNetConnect( Hostname ) != APNET_SUCCESS ) + { + return false; + } + + m_CameraInterface = Apn_Interface_NET; + + // Before trying to initialize, perform a simple loopback test + unsigned short RegData; + unsigned short NewRegData; + + RegData = 0x5AA5; + if ( Write( FPGA_REG_SCRATCH, RegData ) != APNET_SUCCESS ) return false; + if ( Read( FPGA_REG_SCRATCH, NewRegData ) != APNET_SUCCESS ) return false; + if ( RegData != NewRegData ) return false; + + RegData = 0xA55A; + if ( Write( FPGA_REG_SCRATCH, RegData ) != APNET_SUCCESS ) return false; + if ( Read( FPGA_REG_SCRATCH, NewRegData ) != APNET_SUCCESS ) return false; + if ( RegData != NewRegData ) return false; + printf("Loopback test successful - ALTA-E detected at %u.%u.%u.%u:%u\n", ipAddr[3], ipAddr[2], ipAddr[1], ipAddr[0]); + + // The loopback test was successful. Proceed with initialization. + init = InitDefaults(); + if ( init != 0 ) { + printf("Loopback test successful - InitDefaults FAILED\n"); + return false; + } + + printf("Loopback test successful - InitDefaults completed\n"); + return true; +} + + +bool CApnCamera::CloseDriver() +{ + ApnNetClose(); + + return true; +} + + +bool CApnCamera::GetImageData( unsigned short *pImageBuffer, + unsigned short &Width, + unsigned short &Height, + unsigned long &Count ) +{ + unsigned short Offset; + unsigned short *pTempBuffer; + long i, j; + + + // Make sure it is okay to get the image data + // The app *should* have done this on its own, but we have to make sure + while ( !ImageReady() ) + { + Sleep( 50 ); + read_ImagingStatus(); + } + + Width = m_pvtWidth; + Height = m_pvtHeight; + + if ( m_pvtBitsPerPixel == 16 ) + Offset = 1; + + if ( m_pvtBitsPerPixel == 12 ) + Offset = 10; + + Width -= Offset; // Calculate the true image width + + pTempBuffer = new unsigned short[(Width+Offset) * Height]; + + ApnNetGetImageTcp( pTempBuffer ); + + for ( i=0; i<Height; i++ ) + { + for ( j=0; j<Width; j++ ) + { + pImageBuffer[(i*Width)+j] = pTempBuffer[(i*(Width+Offset))+j+Offset]; + } + } + + delete [] pTempBuffer; + + Count = read_ImageCount(); + + SignalImagingDone(); + + return true; +} + + +bool CApnCamera::GetLineData( unsigned short *pLineBuffer, + unsigned short &Size ) +{ + Size = 0; + + return false; +} + + +long CApnCamera::PreStartExpose( unsigned short BitsPerPixel ) +{ + m_pvtWidth = GetExposurePixelsH(); + m_pvtHeight = GetExposurePixelsV(); + + if ( (BitsPerPixel != 16) && (BitsPerPixel != 12) ) + { + // Invalid bit depth request + return 1; + } + + m_pvtBitsPerPixel = BitsPerPixel; + + if ( BitsPerPixel == 16 ) + m_pvtWidth += 1; + + if ( BitsPerPixel == 12 ) + m_pvtWidth += 10; + + if ( ApnNetStartExp( m_pvtWidth, m_pvtHeight ) != APNET_SUCCESS ) + { + return 1; + } + + return 0; +} + + +long CApnCamera::PostStopExposure( bool DigitizeData ) +{ + if ( ApnNetStopExp( DigitizeData ) != APNET_SUCCESS ) + { + return 1; + } + + if ( !DigitizeData ) + { + SignalImagingDone(); + } + + return 0; +} + + +void CApnCamera::SetNetworkTransferMode( Apn_NetworkMode TransferMode ) +{ + switch ( TransferMode ) + { + case Apn_NetworkMode_Tcp: + ApnNetSetSpeed( false ); + break; + case Apn_NetworkMode_Udp: + ApnNetSetSpeed( true ); + break; + } +} + + +long CApnCamera::Read( unsigned short reg, unsigned short& val ) +{ + if ( ApnNetReadReg( reg, &val ) != APNET_SUCCESS ) + { + return 1; // Failure + } + return 0; +} + + +long CApnCamera::Write( unsigned short reg, unsigned short val ) +{ + if ( ApnNetWriteReg( reg, val ) != APNET_SUCCESS ) + { + return 1; // Failure + } + + return 0; +} + + +long CApnCamera::WriteMultiSRMD( unsigned short reg, unsigned short val[], unsigned short count ) +{ + if ( ApnNetWriteRegMulti( reg, val, count ) != APNET_SUCCESS ) + { + return 1; + } + + return 0; +} + + +long CApnCamera::WriteMultiMRMD( unsigned short reg[], unsigned short val[], unsigned short count ) +{ + if ( ApnNetWriteRegMultiMRMD( reg, val, count ) != APNET_SUCCESS ) + { + return 1; + } + + return 0; +} + + +long CApnCamera::QueryStatusRegs( unsigned short& StatusReg, + unsigned short& HeatsinkTempReg, + unsigned short& CcdTempReg, + unsigned short& CoolerDriveReg, + unsigned short& VoltageReg, + unsigned short& TdiCounter, + unsigned short& SequenceCounter ) +{ + unsigned short RegNumber[7]; + unsigned short RegData[7]; + + RegNumber[0] = 91; + RegNumber[1] = 93; + RegNumber[2] = 94; + RegNumber[3] = 95; + RegNumber[4] = 96; + RegNumber[5] = 104; + RegNumber[6] = 105; + + if ( ApnNetReadRegMulti( RegNumber, RegData, 7 ) != APNET_SUCCESS ) + { + return 1; + } + + StatusReg = RegData[0]; + HeatsinkTempReg = RegData[1]; + CcdTempReg = RegData[2]; + CoolerDriveReg = RegData[3]; + VoltageReg = RegData[4]; + TdiCounter = RegData[5]; + SequenceCounter = RegData[6]; + + return 0; +} + diff --git a/kstars/kstars/indi/apogee/ApnCamera_NET.h b/kstars/kstars/indi/apogee/ApnCamera_NET.h new file mode 100644 index 00000000..e46d3846 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera_NET.h @@ -0,0 +1,74 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// ApnCamera_NET.h: interface for the CApnCamera_NET class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNCAMERA_NET_H__D6F0E3AB_536C_4937_9E2B_DCF682D0DD31__INCLUDED_) +#define AFX_APNCAMERA_NET_H__D6F0E3AB_536C_4937_9E2B_DCF682D0DD31__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ApnCamera.h" + +class CApnCamera_NET : public CApnCamera +{ +private: + unsigned short m_pvtBitsPerPixel; + + unsigned short m_pvtWidth; + unsigned short m_pvtHeight; + +public: + CApnCamera_NET(); + virtual ~CApnCamera_NET(); + + bool InitDriver( unsigned long CamIdA, + unsigned short CamIdB, + unsigned long Option ); + + bool CloseDriver(); + + long PreStartExpose( unsigned short BitsPerPixel ); + + long PostStopExposure( bool DigitizeData ); + + + bool GetImageData( unsigned short *pImageData, + unsigned short &Width, + unsigned short &Height, + unsigned long &Count ); + + bool GetLineData( unsigned short *pLineBuffer, + unsigned short &Size ); + + long Read( unsigned short reg, unsigned short& val ); + long Write( unsigned short reg, unsigned short val ); + + long WriteMultiSRMD( unsigned short reg, + unsigned short val[], + unsigned short count ); + + long WriteMultiMRMD( unsigned short reg[], + unsigned short val[], + unsigned short count ); + + long QueryStatusRegs( unsigned short& StatusReg, + unsigned short& HeatsinkTempReg, + unsigned short& CcdTempReg, + unsigned short& CoolerDriveReg, + unsigned short& VoltageReg, + unsigned short& TdiCounter, + unsigned short& SequenceCounter ); + +}; + +#endif // !defined(AFX_APNCAMERA_NET_H__D6F0E3AB_536C_4937_9E2B_DCF682D0DD31__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApnCamera_USB.cpp b/kstars/kstars/indi/apogee/ApnCamera_USB.cpp new file mode 100644 index 00000000..a6bbad42 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera_USB.cpp @@ -0,0 +1,256 @@ +// ApnCamera_USB.cpp: implementation of the CApnCamera_USB class. +// +// Copyright (c) 2003, 2004 Apogee Instruments, Inc. +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ApnCamera_USB.h" + +#include "ApogeeUsb.h" +#include "ApogeeUsbErr.h" + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + + + +bool CApnCamera::InitDriver( unsigned long CamIdA, + unsigned short /*CamIdB*/, + unsigned long /*Option*/ ) +{ + if ( ApnUsbOpen( (unsigned short)CamIdA ) != APN_USB_SUCCESS ) + { + return false; + } + + m_CameraInterface = Apn_Interface_USB; + + // Before trying to initialize, perform a simple loopback test + unsigned short RegData; + unsigned short NewRegData; + + RegData = 0x5AA5; + if ( Write( FPGA_REG_SCRATCH, RegData ) != APN_USB_SUCCESS ) return false; + if ( Read( FPGA_REG_SCRATCH, NewRegData ) != APN_USB_SUCCESS ) return false; + if ( RegData != NewRegData ) return false; + + RegData = 0xA55A; + if ( Write( FPGA_REG_SCRATCH, RegData ) != APN_USB_SUCCESS ) return false; + if ( Read( FPGA_REG_SCRATCH, NewRegData ) != APN_USB_SUCCESS ) return false; + if ( RegData != NewRegData ) return false; + + // The loopback test was successful. Proceed with initialization. + if ( InitDefaults() != 0 ) + return false; + + return true; +} + + +bool CApnCamera::CloseDriver() +{ + ApnUsbClose(); + + return true; +} + +void CApnCamera::SetNetworkTransferMode( Apn_NetworkMode /*TransferMode*/ ) +{ + return; +} + +bool CApnCamera::GetImageData( unsigned short *pImageBuffer, + unsigned short &Width, + unsigned short &Height, + unsigned long &Count ) +{ + unsigned short Offset(0); + unsigned short *pTempBuffer; + long i, j; + + + // Make sure it is okay to get the image data + // The app *should* have done this on its own, but we have to make sure + while ( !ImageReady() ) + { + Sleep( 50 ); + read_ImagingStatus(); + } + + Width = m_pvtWidth; + Height = m_pvtHeight; + + if ( m_pvtBitsPerPixel == 16 ) + Offset = 1; + + if ( m_pvtBitsPerPixel == 12 ) + Offset = 10; + + Width -= Offset; // Calculate the true image width + + pTempBuffer = new unsigned short[(Width+Offset) * Height]; + + ApnUsbGetImage( pTempBuffer ); + + for ( i=0; i<Height; i++ ) + { + for ( j=0; j<Width; j++ ) + { + pImageBuffer[(i*Width)+j] = pTempBuffer[(i*(Width+Offset))+j+Offset]; + } + } + + delete [] pTempBuffer; + + + Count = read_ImageCount(); + + SignalImagingDone(); + + return true; +} + + +bool CApnCamera::GetLineData( unsigned short */*pLineBuffer*/, + unsigned short &Size ) +{ + Size = 0; + + return false; +} + + +long CApnCamera::PreStartExpose( unsigned short BitsPerPixel ) +{ + m_pvtWidth = GetExposurePixelsH(); + m_pvtHeight = GetExposurePixelsV(); + + if ( (BitsPerPixel != 16) && (BitsPerPixel != 12) ) + { + // Invalid bit depth request + return 1; + } + + m_pvtBitsPerPixel = BitsPerPixel; + + + if ( BitsPerPixel == 16 ) + m_pvtWidth += 1; + + if ( BitsPerPixel == 12 ) + m_pvtWidth += 10; + + if ( ApnUsbStartExp( m_pvtWidth, m_pvtHeight ) != APN_USB_SUCCESS ) + { + return 1; + } + + return 0; +} + + +long CApnCamera::PostStopExposure( bool DigitizeData ) +{ + PUSHORT pRequestData; + + + if ( !DigitizeData ) + { + while ( !ImageReady() ) + { + Sleep( 50 ); + read_ImagingStatus(); + } + + pRequestData = new USHORT[m_pvtWidth*m_pvtHeight]; + + ApnUsbGetImage( pRequestData ); + + delete [] pRequestData; + + SignalImagingDone(); + } + + // The following code will eventually be the implementation of the STOP + // command for USB. Currently, this does not work correctly. + // if ( ApnUsbStopExp( DigitizeData ) != APN_USB_SUCCESS ) + // { + // return 1; + // } + + return 0; +} + + +long CApnCamera::Read( unsigned short reg, unsigned short& val ) +{ + if ( ApnUsbReadReg( reg, &val ) != APN_USB_SUCCESS ) + { + return 1; // Failure + } + + return 0; +} + + +long CApnCamera::Write( unsigned short reg, unsigned short val ) +{ + if ( ApnUsbWriteReg( reg, val ) != APN_USB_SUCCESS ) + { + return 1; // Failure + } + + return 0; +} + + +long CApnCamera::WriteMultiSRMD( unsigned short reg, unsigned short val[], unsigned short count ) +{ + if ( ApnUsbWriteRegMulti( reg, val, count ) != APN_USB_SUCCESS ) + { + return 1; + } + + return 0; +} + + +long CApnCamera::WriteMultiMRMD( unsigned short reg[], unsigned short val[], unsigned short count ) +{ + if ( ApnUsbWriteRegMultiMRMD( reg, val, count ) != APN_USB_SUCCESS ) + { + return 1; + } + + return 0; +} + + +long CApnCamera::QueryStatusRegs( unsigned short& StatusReg, + unsigned short& HeatsinkTempReg, + unsigned short& CcdTempReg, + unsigned short& CoolerDriveReg, + unsigned short& VoltageReg, + unsigned short& TdiCounter, + unsigned short& SequenceCounter ) +{ + /*unsigned short stat,heat,ccdt,cool,volt,tdic,sequ;*/ + + if ( ApnUsbReadStatusRegs( &StatusReg, + &HeatsinkTempReg, + &CcdTempReg, + &CoolerDriveReg, + &VoltageReg, + &TdiCounter, + &SequenceCounter ) != APN_USB_SUCCESS ) + { + return 1; + } + return 0; +} + + + + diff --git a/kstars/kstars/indi/apogee/ApnCamera_USB.h b/kstars/kstars/indi/apogee/ApnCamera_USB.h new file mode 100644 index 00000000..0d4a3d07 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnCamera_USB.h @@ -0,0 +1,69 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// ApnCamera_USB.h: interface for the CApnCamera_USB class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNCAMERA_USB_H__E83248CA_F0AA_4221_8E10_22FA70CEFAA6__INCLUDED_) +#define AFX_APNCAMERA_USB_H__E83248CA_F0AA_4221_8E10_22FA70CEFAA6__INCLUDED_ + +#include "ApnCamera.h" + +class CApnCamera_USB : public CApnCamera +{ +private: + unsigned short m_pvtBitsPerPixel; + + unsigned short m_pvtWidth; + unsigned short m_pvtHeight; + +public: + CApnCamera_USB(); + virtual ~CApnCamera_USB(); + + bool InitDriver( unsigned long CamIdA, + unsigned short CamIdB, + unsigned long Option ); + + bool CloseDriver(); + + long PreStartExpose( unsigned short BitsPerPixel ); + + long PostStopExposure( bool DigitizeData ); + + bool GetImageData( unsigned short *pImageData, + unsigned short &Width, + unsigned short &Height, + unsigned long &Count ); + + bool GetLineData( unsigned short *pLineBuffer, + unsigned short &Size ); + + long Read( unsigned short reg, unsigned short& val ); + long Write( unsigned short reg, unsigned short val ); + + long WriteMultiSRMD( unsigned short reg, + unsigned short val[], + unsigned short count ); + + long WriteMultiMRMD( unsigned short reg[], + unsigned short val[], + unsigned short count ); + + long QueryStatusRegs( unsigned short& StatusReg, + unsigned short& HeatsinkTempReg, + unsigned short& CcdTempReg, + unsigned short& CoolerDriveReg, + unsigned short& VoltageReg, + unsigned short& TdiCounter, + unsigned short& SequenceCounter ); + +}; + +#endif // !defined(AFX_APNCAMERA_USB_H__E83248CA_F0AA_4221_8E10_22FA70CEFAA6__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApnSerial.cpp b/kstars/kstars/indi/apogee/ApnSerial.cpp new file mode 100644 index 00000000..43687aad --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnSerial.cpp @@ -0,0 +1,27 @@ +// ApnSerial.cpp: implementation of the CApnSerial class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "apogee.h" +#include "ApnSerial.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CApnSerial::CApnSerial() +{ + m_SerialId = -1; +} + +CApnSerial::~CApnSerial() +{ + +} diff --git a/kstars/kstars/indi/apogee/ApnSerial.h b/kstars/kstars/indi/apogee/ApnSerial.h new file mode 100644 index 00000000..81179901 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnSerial.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// ApnSerial.h: interface for the CApnSerial class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNSERIAL_H__A27F1749_FA8F_40E8_A03F_4A28C8378DD1__INCLUDED_) +#define AFX_APNSERIAL_H__A27F1749_FA8F_40E8_A03F_4A28C8378DD1__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Apogee.h" + + +class CApnSerial +{ +public: + + CApnSerial(); + virtual ~CApnSerial(); + + virtual bool InitPort( unsigned long CamIdA, + unsigned short CamIdB, + unsigned short SerialId ) = 0; + + virtual bool ClosePort() = 0; + + virtual bool GetBaudRate( unsigned long *BaudRate ) = 0; + + virtual bool SetBaudRate( unsigned long BaudRate ) = 0; + + virtual bool GetFlowControl( Apn_SerialFlowControl *FlowControl ) = 0; + + virtual bool SetFlowControl( Apn_SerialFlowControl FlowControl ) = 0; + + virtual bool GetParity( Apn_SerialParity *Parity ) = 0; + + virtual bool SetParity( Apn_SerialParity Parity ) = 0; + + virtual bool Read( char *ReadBuffer, + unsigned short *ReadCount ) = 0; + + virtual bool Write( char *WriteBuffer, + unsigned short WriteCount ) = 0; + + // Variables + Apn_Interface m_CameraInterface; + short m_SerialId; + +}; + +#endif // !defined(AFX_APNSERIAL_H__A27F1749_FA8F_40E8_A03F_4A28C8378DD1__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApnSerial_NET.cpp b/kstars/kstars/indi/apogee/ApnSerial_NET.cpp new file mode 100644 index 00000000..ded34f47 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnSerial_NET.cpp @@ -0,0 +1,214 @@ +// ApnSerial_NET.cpp: implementation of the CApnSerial_NET class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "apogee.h" +#include "ApnSerial_NET.h" + +#include "ApogeeNet.h" +#include "ApogeeNetErr.h" + + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CApnSerial_NET::CApnSerial_NET() +{ + m_SerialId = -1; +} + +CApnSerial_NET::~CApnSerial_NET() +{ + +} + +bool CApnSerial_NET::InitPort( unsigned long CamIdA, + unsigned short CamIdB, + unsigned short SerialId ) +{ + char Hostname[25]; + BYTE ipAddr[4]; + + + ipAddr[0] = (BYTE)(CamIdA & 0xFF); + ipAddr[1] = (BYTE)((CamIdA >> 8) & 0xFF); + ipAddr[2] = (BYTE)((CamIdA >> 16) & 0xFF); + ipAddr[3] = (BYTE)((CamIdA >> 24) & 0xFF); + + sprintf( Hostname, "%u.%u.%u.%u", ipAddr[3], ipAddr[2], ipAddr[1], ipAddr[0] ); + + if ( m_SerialId != -1 ) + { + return false; + } + + if ( (SerialId != 0) && (SerialId != 1) ) + { + return false; + } + + if ( ApnNetStartSockets() != APNET_SUCCESS ) + return false; + + if ( ApnNetSerialPortOpen( Hostname, CamIdB, SerialId ) != APNET_SUCCESS ) + return false; + + m_SerialId = SerialId; + + return true; +} + +bool CApnSerial_NET::ClosePort() +{ + if ( m_SerialId == -1 ) + return false; + + // just close the port and not care whether it was successful. if it was, + // great. if not, we'll still set m_SerialId to -1 so that another call + // can at least be tried to connect to the port. + ApnNetSerialPortClose( m_SerialId ); + + ApnNetStopSockets(); + + m_SerialId = -1; + + return true; +} + +bool CApnSerial_NET::GetBaudRate( unsigned long *BaudRate ) +{ + *BaudRate = -1; + + if ( m_SerialId == -1 ) + return false; + + /* + unsigned long BaudRateRead; + + + if ( m_SerialId == -1 ) + return false; + + if ( ApnNetSerialReadBaudRate(m_SerialId, &BaudRateRead) != APNET_SUCCESS ) + return false; + + *BaudRate = BaudRateRead; + */ + + return true; +} + +bool CApnSerial_NET::SetBaudRate( unsigned long BaudRate ) +{ + if ( m_SerialId == -1 ) + return false; + + /* + if ( ApnNetSerialWriteBaudRate(m_SerialId, BaudRate) != APNET_SUCCESS ) + return false; + */ + + return true; +} + +bool CApnSerial_NET::GetFlowControl( Apn_SerialFlowControl *FlowControl ) +{ + *FlowControl = Apn_SerialFlowControl_Unknown; + + if ( m_SerialId == -1 ) + return false; + + /* + bool FlowControlRead; + + if ( m_SerialId == -1 ) + return false; + + if ( ApnNetSerialReadFlowControl(m_SerialId, &FlowControlRead) != APNET_SUCCESS ) + return false; + */ + + return true; +} + +bool CApnSerial_NET::SetFlowControl( Apn_SerialFlowControl FlowControl ) +{ + if ( m_SerialId == -1 ) + return false; + + /* + if ( ApnNetSerialWriteFlowControl(m_SerialId, FlowControl) != APNET_SUCCESS ) + return false; + */ + + return true; +} + +bool CApnSerial_NET::GetParity( Apn_SerialParity *Parity ) +{ + *Parity = Apn_SerialParity_Unknown; + + if ( m_SerialId == -1 ) + return false; + + /* + ApnNetParity ParityRead; + + if ( m_SerialId == -1 ) + return false; + + if ( ApnNetSerialReadParity(m_SerialId, &ParityRead) != APNET_SUCCESS ) + return false; + + *Parity = (Apn_SerialParity)ParityRead; + */ + + return true; +} + +bool CApnSerial_NET::SetParity( Apn_SerialParity Parity ) +{ + if ( m_SerialId == -1 ) + return false; + + /* + if ( ApnNetSerialWriteParity(m_SerialId, (ApnNetParity)Parity) != APNET_SUCCESS ) + return false; + */ + + return true; +} + +bool CApnSerial_NET::Read( char *ReadBuffer, unsigned short *ReadCount ) +{ + if ( m_SerialId == -1 ) + return false; + + if ( ApnNetSerialRead(m_SerialId, ReadBuffer, ReadCount) != APNET_SUCCESS ) + { + *ReadCount = 0; + return false; + } + + return true; +} + +bool CApnSerial_NET::Write( char *WriteBuffer, unsigned short WriteCount ) +{ + if ( m_SerialId == -1 ) + return false; + + if ( ApnNetSerialWrite(m_SerialId, WriteBuffer, WriteCount) != APNET_SUCCESS ) + return false; + + return true; +} + diff --git a/kstars/kstars/indi/apogee/ApnSerial_NET.h b/kstars/kstars/indi/apogee/ApnSerial_NET.h new file mode 100644 index 00000000..d7bc9745 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnSerial_NET.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// ApnSerial_NET.h: interface for the CApnSerial_NET class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNSERIAL_NET_H__F31A372D_2B82_4998_B74C_FFAD8E3EEE86__INCLUDED_) +#define AFX_APNSERIAL_NET_H__F31A372D_2B82_4998_B74C_FFAD8E3EEE86__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ApnSerial.h" + + +class CApnSerial_NET : public CApnSerial +{ +public: + CApnSerial_NET(); + virtual ~CApnSerial_NET(); + + bool InitPort( unsigned long CamIdA, + unsigned short CamIdB, + unsigned short SerialId ); + + bool ClosePort(); + + bool GetBaudRate( unsigned long *BaudRate ); + bool SetBaudRate( unsigned long BaudRate ); + + bool GetFlowControl( Apn_SerialFlowControl *FlowControl ); + bool SetFlowControl( Apn_SerialFlowControl FlowControl ); + + bool GetParity( Apn_SerialParity *Parity ); + bool SetParity( Apn_SerialParity Parity ); + + bool Read( char *ReadBuffer, + unsigned short *ReadCount ); + + bool Write( char *WriteBuffer, + unsigned short WriteCount ); + +}; + +#endif // !defined(AFX_APNSERIAL_NET_H__F31A372D_2B82_4998_B74C_FFAD8E3EEE86__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApnSerial_USB.cpp b/kstars/kstars/indi/apogee/ApnSerial_USB.cpp new file mode 100644 index 00000000..6effe609 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnSerial_USB.cpp @@ -0,0 +1,79 @@ +// ApnSerial_USB.cpp: implementation of the CApnSerial_USB class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "apogee.h" +#include "ApnSerial_USB.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CApnSerial_USB::CApnSerial_USB() +{ + +} + +CApnSerial_USB::~CApnSerial_USB() +{ + +} + +bool CApnSerial_USB::InitPort( unsigned long CamIdA, + unsigned short CamIdB, + unsigned short SerialId ) +{ + return true; +} + +bool CApnSerial_USB::ClosePort() +{ + return true; +} + +bool CApnSerial_USB::GetBaudRate( unsigned long *BaudRate ) +{ + return true; +} + +bool CApnSerial_USB::SetBaudRate( unsigned long BaudRate ) +{ + return true; +} + +bool CApnSerial_USB::GetFlowControl( Apn_SerialFlowControl *FlowControl ) +{ + return true; +} + +bool CApnSerial_USB::SetFlowControl( Apn_SerialFlowControl FlowControl ) +{ + return true; +} + +bool CApnSerial_USB::GetParity( Apn_SerialParity *Parity ) +{ + return true; +} + +bool CApnSerial_USB::SetParity( Apn_SerialParity Parity ) +{ + return true; +} + +bool CApnSerial_USB::Read( char *ReadBuffer, unsigned short *ReadCount ) +{ + return true; +} + +bool CApnSerial_USB::Write( char *WriteBuffer, unsigned short WriteCount ) +{ + return true; +} diff --git a/kstars/kstars/indi/apogee/ApnSerial_USB.h b/kstars/kstars/indi/apogee/ApnSerial_USB.h new file mode 100644 index 00000000..cd10d9b5 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnSerial_USB.h @@ -0,0 +1,43 @@ +// ApnSerial_USB.h: interface for the CApnSerial_USB class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_APNSERIAL_USB_H__D7A1A328_6505_438F_BCCE_FA3F3B5EECC2__INCLUDED_) +#define AFX_APNSERIAL_USB_H__D7A1A328_6505_438F_BCCE_FA3F3B5EECC2__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ApnSerial.h" + +class CApnSerial_USB : public CApnSerial +{ +public: + CApnSerial_USB(); + virtual ~CApnSerial_USB(); + + bool InitPort( unsigned long CamIdA, + unsigned short CamIdB, + unsigned short SerialId ); + + bool ClosePort(); + + bool GetBaudRate( unsigned long *BaudRate ); + bool SetBaudRate( unsigned long BaudRate ); + + bool GetFlowControl( Apn_SerialFlowControl *FlowControl ); + bool SetFlowControl( Apn_SerialFlowControl FlowControl ); + + bool GetParity( Apn_SerialParity *Parity ); + bool SetParity( Apn_SerialParity Parity ); + + bool Read( char *ReadBuffer, + unsigned short *ReadCount ); + + bool Write( char *WriteBuffer, + unsigned short WriteCount ); + +}; + +#endif // !defined(AFX_APNSERIAL_USB_H__D7A1A328_6505_438F_BCCE_FA3F3B5EECC2__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApnUsbSys.h b/kstars/kstars/indi/apogee/ApnUsbSys.h new file mode 100644 index 00000000..6016c9f6 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApnUsbSys.h @@ -0,0 +1,46 @@ +// ApnUsbSys.h +// +// Copyright (c) 2003, 2004 Apogee Instruments, Inc. +// +// Defines common data structure(s) for sharing between application +// layer and the ApUSB.sys device driver. +// + +#if !defined(_APNUSBSYS_H__INCLUDED_) +#define _APNUSBSYS_H__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + + +#define VND_ANCHOR_LOAD_INTERNAL 0xA0 + +#define VND_APOGEE_CMD_BASE 0xC0 +#define VND_APOGEE_STATUS ( VND_APOGEE_CMD_BASE + 0x0 ) +#define VND_APOGEE_CAMCON_REG ( VND_APOGEE_CMD_BASE + 0x2 ) +#define VND_APOGEE_BUFCON_REG ( VND_APOGEE_CMD_BASE + 0x3 ) +#define VND_APOGEE_SET_SERIAL ( VND_APOGEE_CMD_BASE + 0x4 ) +#define VND_APOGEE_SERIAL ( VND_APOGEE_CMD_BASE + 0x5 ) +#define VND_APOGEE_EEPROM ( VND_APOGEE_CMD_BASE + 0x6 ) +#define VND_APOGEE_SOFT_RESET ( VND_APOGEE_CMD_BASE + 0x8 ) +#define VND_APOGEE_GET_IMAGE ( VND_APOGEE_CMD_BASE + 0x9 ) +#define VND_APOGEE_STOP_IMAGE ( VND_APOGEE_CMD_BASE + 0xA ) + + +#define REQUEST_IN 0x1 +#define REQUEST_OUT 0x0 + + +typedef struct _APN_USB_REQUEST +{ + unsigned char Request; + unsigned char Direction; + unsigned short Value; + unsigned short Index; +} APN_USB_REQUEST, *PAPN_USB_REQUEST; + + + +#endif // !defined(_APNUSBSYS_H__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/Apogee.h b/kstars/kstars/indi/apogee/Apogee.h new file mode 100644 index 00000000..d97740b2 --- /dev/null +++ b/kstars/kstars/indi/apogee/Apogee.h @@ -0,0 +1,97 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#if !defined(AFX_APOGEE__INCLUDED_) +#define AFX_APOGEE__INCLUDED_ + + +#define Apn_Interface int +#define Apn_Interface_NET 0 +#define Apn_Interface_USB 1 + +#define Apn_NetworkMode int +#define Apn_NetworkMode_Tcp 0 +#define Apn_NetworkMode_Udp 1 + +#define Apn_Resolution int +#define Apn_Resolution_SixteenBit 0 +#define Apn_Resolution_TwelveBit 1 + +#define Apn_CameraMode int +#define Apn_CameraMode_Normal 0 +#define Apn_CameraMode_TDI 1 +#define Apn_CameraMode_Test 2 +#define Apn_CameraMode_ExternalTrigger 3 +#define Apn_CameraMode_ExternalShutter 4 + +#define Apn_Status int +#define Apn_Status_DataError -2 +#define Apn_Status_PatternError -1 +#define Apn_Status_Idle 0 +#define Apn_Status_Exposing 1 +#define Apn_Status_ImagingActive 2 +#define Apn_Status_ImageReady 3 +#define Apn_Status_Flushing 4 +#define Apn_Status_WaitingOnTrigger 5 + +#define Apn_LedMode int +#define Apn_LedMode_DisableAll 0 +#define Apn_LedMode_DisableWhileExpose 1 +#define Apn_LedMode_EnableAll 2 + +#define Apn_LedState int +#define Apn_LedState_Expose 0 +#define Apn_LedState_ImageActive 1 +#define Apn_LedState_Flushing 2 +#define Apn_LedState_ExtTriggerWaiting 3 +#define Apn_LedState_ExtTriggerReceived 4 +#define Apn_LedState_ExtShutterInput 5 +#define Apn_LedState_ExtStartReadout 6 +#define Apn_LedState_AtTemp 7 + +#define Apn_CoolerStatus int +#define Apn_CoolerStatus_Off 0 +#define Apn_CoolerStatus_RampingToSetPoint 1 +#define Apn_CoolerStatus_AtSetPoint 2 +#define Apn_CoolerStatus_Revision 3 + +#define Apn_FanMode int +#define Apn_FanMode_Off 0 +#define Apn_FanMode_Low 1 +#define Apn_FanMode_Medium 2 +#define Apn_FanMode_High 3 + + +#define Camera_Status int +#define Camera_Status_Idle 0 +#define Camera_Status_Waiting 1 +#define Camera_Status_Exposing 2 +#define Camera_Status_Downloading 3 +#define Camera_Status_LineReady 4 +#define Camera_Status_ImageReady 5 +#define Camera_Status_Flushing 6 + +#define Camera_CoolerStatus int +#define Camera_CoolerStatus_Off 0 +#define Camera_CoolerStatus_RampingToSetPoint 1 +#define Camera_CoolerStatus_Correcting 2 +#define Camera_CoolerStatus_RampingToAmbient 3 +#define Camera_CoolerStatus_AtAmbient 4 +#define Camera_CoolerStatus_AtMax 5 +#define Camera_CoolerStatus_AtMin 6 +#define Camera_CoolerStatus_AtSetPoint 7 + +#define Camera_CoolerMode int +#define Camera_CoolerMode_Off 0 +#define Camera_CoolerMode_On 1 +#define Camera_CoolerMode_Shutdown 2 + +#endif + + + diff --git a/kstars/kstars/indi/apogee/ApogeeIoctl.h b/kstars/kstars/indi/apogee/ApogeeIoctl.h new file mode 100644 index 00000000..ec0fc580 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApogeeIoctl.h @@ -0,0 +1,40 @@ +// ApogeeIoctl.h Include file for I/O +// +// Copyright (c) 2000 Apogee Instruments Inc. +// +//Portions Copyright (c) 2000 The Random Factory. +// +// Define the IOCTL codes we will use. The IOCTL code contains a command +// identifier, plus other information about the device, the type of access +// with which the file must have been opened, and the type of buffering. +// + +extern unsigned short apogee_bit; +extern unsigned short apogee_word; +extern unsigned long apogee_long; +extern short apogee_signed; + + +// General Ioctl definitions for Apogee CCD device driver + +#define APOGEE_IOC_MAGIC 'j' +#define APOGEE_IOC_MAXNR 100 +#define APOGEE_IOCHARDRESET _IO(APOGEE_IOC_MAGIC,0) + + +// Read single word +#define IOCTL_GPD_READ_ISA_USHORT _IOR(APOGEE_IOC_MAGIC,1,apogee_word) + +// Write single word +#define IOCTL_GPD_WRITE_ISA_USHORT _IOW(APOGEE_IOC_MAGIC,2,apogee_word) + +// Read line from camera +#define IOCTL_GPD_READ_ISA_LINE _IOR(APOGEE_IOC_MAGIC,3,apogee_word) + +#define IOCTL_GPD_READ_PPI_USHORT _IOR(APOGEE_IOC_MAGIC,1,apogee_word) + +// Write single word +#define IOCTL_GPD_WRITE_PPI_USHORT _IOW(APOGEE_IOC_MAGIC,2,apogee_word) + +// Read line from camera +#define IOCTL_GPD_READ_PPI_LINE _IOR(APOGEE_IOC_MAGIC,3,apogee_word) diff --git a/kstars/kstars/indi/apogee/ApogeeLinux.h b/kstars/kstars/indi/apogee/ApogeeLinux.h new file mode 100644 index 00000000..d17e7bde --- /dev/null +++ b/kstars/kstars/indi/apogee/ApogeeLinux.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef APOGEELINUX_H +#define APOGEELINUX_H + +#define APISA_READ_USHORT _IOR('a', 0x01, unsigned int) +#define APISA_READ_LINE _IOR('a', 0x02, unsigned int) +#define APISA_WRITE_USHORT _IOW('a', 0x03, unsigned int) + +#define APPPI_READ_USHORT _IOR('a', 0x01, unsigned int) +#define APPPI_READ_LINE _IOR('a', 0x02, unsigned int) +#define APPPI_WRITE_USHORT _IOW('a', 0x03, unsigned int) + +#define APPCI_READ_USHORT _IOR('a', 0x01, unsigned int) +#define APPCI_READ_LINE _IOR('a', 0x02, unsigned int) +#define APPCI_WRITE_USHORT _IOW('a', 0x03, unsigned int) + +#define APUSB_READ_USHORT _IOR('a', 0x01, unsigned int) +#define APUSB_WRITE_USHORT _IOW('a', 0x02, unsigned int) +#define APUSB_USB_STATUS _IOR('a', 0x03, unsigned int) +#define APUSB_PRIME_USB_DOWNLOAD _IOR('a', 0x04, unsigned int) +#define APUSB_STOP_USB_IMAGE _IOR('a', 0x05, unsigned int) +#define APUSB_READ_USB_IMAGE _IOR('a', 0x06, unsigned int) +#define APUSB_USB_RESET _IOR('a', 0x07, unsigned int) +#define APUSB_READ_USB_SERIAL _IOR('a', 0x08, unsigned int) +#define APUSB_WRITE_USB_SERIAL _IOR('a', 0x09, unsigned int) +#define APUSB_USB_SET_SERIAL _IOR('a', 0x0A, unsigned int) +#define APUSB_USB_REQUEST _IOR('a', 0x0B, unsigned int) +#define APUSB_READ_STATUS _IOR('a', 0x0C, unsigned int) + +#define appci_major_number 60 +#define apppi_major_number 61 +#define apisa_major_number 62 + +struct apIOparam // IOCTL data + { + unsigned int reg; + unsigned long param1, param2; + }; + +#define APOGEE_PCI_DEVICE "/dev/appci" +#define APOGEE_PPI_DEVICE "/dev/apppi" +#define APOGEE_ISA_DEVICE "/dev/apisa" +#define APOGEE_USB_DEVICE "/dev/usb/alta" + +#endif diff --git a/kstars/kstars/indi/apogee/ApogeeUsb.h b/kstars/kstars/indi/apogee/ApogeeUsb.h new file mode 100644 index 00000000..f242ea6a --- /dev/null +++ b/kstars/kstars/indi/apogee/ApogeeUsb.h @@ -0,0 +1,86 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#if !defined(_APOGEEUSB_H__INCLUDED_) +#define _APOGEEUSB_H__INCLUDED_ + +#ifndef APN_USB_TYPE +#define APN_USB_TYPE unsigned short +#endif + +#define APN_USB_MAXCAMERAS 255 + + +typedef struct _APN_USB_CAMINFO { + unsigned short CamNumber; + unsigned short CamModel; +} APN_USB_CAMINFO; + + + +#ifndef IN +#define IN +#endif + +#ifndef OUT +#define OUT +#endif + + +APN_USB_TYPE ApnUsbOpen( unsigned short DeviceNumber ); + + +APN_USB_TYPE ApnUsbClose( void ); + + +APN_USB_TYPE ApnUsbDiscovery( unsigned short *UsbCamCount, + APN_USB_CAMINFO UsbCamInfo[] ); + + +APN_USB_TYPE ApnUsbReadReg( unsigned short FpgaReg, + unsigned short *FpgaData ); + + +APN_USB_TYPE ApnUsbWriteReg( unsigned short FpgaReg, + unsigned short FpgaData ); + + +APN_USB_TYPE ApnUsbWriteRegMulti( unsigned short FpgaReg, + unsigned short FpgaData[], + unsigned short RegCount ); + + +APN_USB_TYPE ApnUsbWriteRegMultiMRMD( unsigned short FpgaReg[], + unsigned short FpgaData[], + unsigned short RegCount ); + + +APN_USB_TYPE ApnUsbReadStatusRegs( unsigned short *StatusReg, + unsigned short *HeatsinkTempReg, + unsigned short *CcdTempReg, + unsigned short *CoolerDriveReg, + unsigned short *VoltageReg, + unsigned short *TdiCounter, + unsigned short *SequenceCounter ); + + +APN_USB_TYPE ApnUsbStartExp( unsigned short ImageWidth, + unsigned short ImageHeight ); + + +APN_USB_TYPE ApnUsbStopExp( bool DigitizeData ); + + +APN_USB_TYPE ApnUsbGetImage( unsigned short *pMem ); + + +APN_USB_TYPE ApnUsbReset(); + + +#endif // !defined(_APOGEEUSB_H__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/ApogeeUsbErr.h b/kstars/kstars/indi/apogee/ApogeeUsbErr.h new file mode 100644 index 00000000..69ee4d3a --- /dev/null +++ b/kstars/kstars/indi/apogee/ApogeeUsbErr.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// Error codes for the ApogeeUsb* files + + +#define APN_USB_SUCCESS 0 + +#define APN_USB_ERR_OPEN 1 +#define APN_USB_ERR_READ 2 +#define APN_USB_ERR_WRITE 3 + +#define APN_USB_ERR_IMAGE_DOWNLOAD 4 + +#define APN_USB_ERR_START_EXP 5 +#define APN_USB_ERR_STOP_EXP 6 + +#define APN_USB_ERR_STATUS 7 + +#define APN_USB_ERR_RESET 8 + + + + diff --git a/kstars/kstars/indi/apogee/ApogeeUsbLinux.cpp b/kstars/kstars/indi/apogee/ApogeeUsbLinux.cpp new file mode 100644 index 00000000..fcedd1d9 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApogeeUsbLinux.cpp @@ -0,0 +1,394 @@ +// ApogeeUsb.cpp : Library of basic USB functions for Apogee APn/Alta. +// + +#include <assert.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <string.h> +#include <sched.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdio.h> + + +#include <usb.h> +#include "ApogeeUsb.h" +#include "ApogeeUsbErr.h" +#include "ApogeeLinux.h" + + +#define HANDLE struct usb_dev_handle; +#define ULONG unsigned int +#define BOOLEAN unsigned int +#define USHORT unsigned short + +#define APOGEE_USB_DEVICE "/dev/usb/alta" +#define INVALID_HANDLE_VALUE -1 + +#define VND_ANCHOR_LOAD_INTERNAL 0xA0 +#define VND_APOGEE_CMD_BASE 0xC0 +#define VND_APOGEE_STATUS ( VND_APOGEE_CMD_BASE + 0x0 ) +#define VND_APOGEE_CAMCON_REG ( VND_APOGEE_CMD_BASE + 0x2 ) +#define VND_APOGEE_BUFCON_REG ( VND_APOGEE_CMD_BASE + 0x3 ) +#define VND_APOGEE_SET_SERIAL ( VND_APOGEE_CMD_BASE + 0x4 ) +#define VND_APOGEE_SERIAL ( VND_APOGEE_CMD_BASE + 0x5 ) +#define VND_APOGEE_EEPROM ( VND_APOGEE_CMD_BASE + 0x6 ) +#define VND_APOGEE_SOFT_RESET ( VND_APOGEE_CMD_BASE + 0x8 ) +#define VND_APOGEE_GET_IMAGE ( VND_APOGEE_CMD_BASE + 0x9 ) +#define VND_APOGEE_STOP_IMAGE ( VND_APOGEE_CMD_BASE + 0xA ) + +#define USB_ALTA_VENDOR_ID 0x125c +#define USB_ALTA_PRODUCT_ID 0x0010 +#define USB_DIR_IN USB_ENDPOINT_IN +#define USB_DIR_OUT USB_ENDPOINT_OUT + + +// Global variables used in this DLL +struct usb_dev_handle *g_hSysDriver; +ULONG g_UsbImgSizeBytes; +char controlBuffer[1024]; + +#define IMAGE_BUFFER_SIZE 126976 // Number of requested bytes in a transfer +//#define IMAGE_BUFFER_SIZE 253952 // Number of requested bytes in a transfer + + +// This is an example of an exported function. +APN_USB_TYPE ApnUsbOpen( unsigned short /*DevNumber*/ ) +{ + + /*char deviceName[128];*/ + struct usb_bus *bus; + struct usb_device *dev; + struct usb_dev_handle *hDevice(NULL); + + usb_init(); + + usb_find_busses(); + usb_find_devices(); + + /*char string[256];*/ + + int found = 0; + + /* find ALTA device */ + for(bus = usb_busses; bus && !found; bus = bus->next) { + for(dev = bus->devices; dev && !found; dev = dev->next) { + if (dev->descriptor.idVendor == USB_ALTA_VENDOR_ID && + dev->descriptor.idProduct == USB_ALTA_PRODUCT_ID) { + hDevice = usb_open(dev); +// cerr << "Found ALTA USB. Attempting to open... "; + found = 1; + if (hDevice) { +// if (!usb_get_string_simple(hDevice, +// dev->descriptor.iSerialNumber, +// string, sizeof(string))) +// throw DevOpenError(); +// cerr << "Success.\n"; +// cerr << "Serial number: " << string << endl; + } + else return APN_USB_ERR_OPEN; + } + } + } + + if (!found) return APN_USB_ERR_OPEN; +// if (!usb_set_configuration(hDevice, 0x0)) return APN_USB_ERR_OPEN; + if (!usb_claim_interface(hDevice, 0x0)) return APN_USB_ERR_OPEN; + + g_hSysDriver = hDevice; + g_UsbImgSizeBytes = 0; +// printf("DRIVER: opened device\n"); + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbClose( void ) +{ + + if ( g_hSysDriver != 0 ) + { + usb_release_interface(g_hSysDriver, 0x0); + usb_close(g_hSysDriver); + g_hSysDriver = 0; + } + + return APN_USB_SUCCESS; // Success +} + + + +APN_USB_TYPE ApnUsbReadReg( unsigned short FpgaReg, unsigned short *FpgaData ) +{ + int Success; + unsigned short RegData; + + Success = usb_control_msg((struct usb_dev_handle *)g_hSysDriver, + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, VND_APOGEE_CAMCON_REG, + FpgaReg, FpgaReg,(char *)&RegData, 2, 50); + *FpgaData = RegData; + +/* printf("DRIVER: usb read reg=%x data=%x s=%x\n",FpgaReg,*FpgaData,Success); */ + if ( !Success ) + return APN_USB_ERR_WRITE; + return APN_USB_SUCCESS; // Success +} + +APN_USB_TYPE ApnUsbWriteReg( unsigned short FpgaReg, unsigned short FpgaData ) +{ + char *cbuf; + int Success; + + cbuf = (char *)&FpgaData; + Success = usb_control_msg((struct usb_dev_handle *)g_hSysDriver, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, VND_APOGEE_CAMCON_REG, + 0, FpgaReg, cbuf, 2, 50); +/* printf("DRIVER: usb write reg=%x data=%x s=%x\n",FpgaReg,FpgaData,Success); */ + if ( !Success ) + return APN_USB_ERR_WRITE; + return APN_USB_SUCCESS; // Success + + +} + + + + +APN_USB_TYPE ApnUsbWriteRegMulti( unsigned short FpgaReg, unsigned short FpgaData[], unsigned short RegCount ) +{ + unsigned short Counter; + + for ( Counter=0; Counter<RegCount; Counter++ ) + { + if ( ApnUsbWriteReg( FpgaReg, FpgaData[Counter] ) != APN_USB_SUCCESS ) + { + return APN_USB_ERR_WRITE; + } + } + + return APN_USB_SUCCESS; // Success +} + +APN_USB_TYPE ApnUsbWriteRegMultiMRMD( unsigned short FpgaReg[], + unsigned short FpgaData[], + unsigned short RegCount ) +{ + unsigned short Counter; + + for ( Counter=0; Counter<RegCount; Counter++ ) + { + if ( ApnUsbWriteReg( FpgaReg[Counter], + FpgaData[Counter] ) != APN_USB_SUCCESS ) + { + return APN_USB_ERR_WRITE; + } + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbReadStatusRegs( unsigned short *StatusReg, + unsigned short *HeatsinkTempReg, + unsigned short *CcdTempReg, + unsigned short *CoolerDriveReg, + unsigned short *VoltageReg, + unsigned short *TdiCounter, + unsigned short *SequenceCounter ) +{ + BOOLEAN Success; + /*unsigned int BytesReceived;*/ + unsigned short *Data; + unsigned char StatusData[21]; + + Success = usb_control_msg(g_hSysDriver, + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, VND_APOGEE_STATUS, + 0, 0, (char *)&StatusData, 21, 3000); + +// if ( !Success ) +// return APN_USB_ERR_STATUS; + Data = (unsigned short *)StatusData; + + *HeatsinkTempReg = Data[0]; + *CcdTempReg = Data[1]; + *CoolerDriveReg = Data[2]; + *VoltageReg = Data[3]; + *TdiCounter = Data[4]; + *SequenceCounter = Data[5]; + *StatusReg = Data[6]; + + if ( (StatusData[20] & 0x01) != 0 ) + { + *StatusReg |= 0x8; + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbStartExp( unsigned short ImageWidth, + unsigned short ImageHeight ) +{ + BOOLEAN Success; + ULONG ImageSize; + unsigned short BytesReceived; + + +// if ( (g_hSysDriver) == 0) +// { +// return APN_USB_ERR_OPEN; +// } + + g_UsbImgSizeBytes = ImageWidth * ImageHeight * 2; + ImageSize = ImageWidth * ImageHeight; + + if ( g_UsbImgSizeBytes == 0 ) + { + return APN_USB_ERR_START_EXP; + } + + Success = usb_control_msg(g_hSysDriver, + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, VND_APOGEE_GET_IMAGE, + (ImageSize >> 16) & 0xFFFF, + (ImageSize & 0xFFFF), (char *)&BytesReceived, 4, 3000); + +// printf("DRIVER: startexp s=%x\n",Success); + +// if ( !Success ) +// { +// return APN_USB_ERR_START_EXP; +// } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbStopExp( bool DigitizeData ) +{ + BOOLEAN Success; + unsigned short BytesReceived; + + +// if ( (g_hSysDriver) == 0) +// { +// return APN_USB_ERR_OPEN; +// } + + if ( DigitizeData == false ) + { + Success = usb_control_msg(g_hSysDriver, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, VND_APOGEE_STOP_IMAGE, + 0, 0,(char *)&BytesReceived, 2, 3000); + +// if ( !Success ) +// { +// return APN_USB_ERR_STOP_EXP; +// } + } + + return APN_USB_SUCCESS; +} + +APN_USB_TYPE ApnUsbGetImage( unsigned short *pMem ) +{ + BOOLEAN Success; + ULONG ImageBytesRemaining; + ULONG ReceivedSize; + + Success = 1; +// if ( (g_hSysDriver) == 0 ) +// { +// return APN_USB_ERR_OPEN; +// } + + ImageBytesRemaining = g_UsbImgSizeBytes; + + + //////////////////////// + ULONG LoopCount = g_UsbImgSizeBytes / IMAGE_BUFFER_SIZE; + ULONG Remainder = g_UsbImgSizeBytes - ( LoopCount * IMAGE_BUFFER_SIZE ); + ULONG MemIterator = IMAGE_BUFFER_SIZE / 2; + ULONG Counter; + + + for ( Counter=0; Counter<LoopCount; Counter++ ) + { + ReceivedSize = usb_bulk_read(g_hSysDriver, 0x86, + (char *)pMem, IMAGE_BUFFER_SIZE, 1000); +// printf("DRIVER: bulkread size=%x\n",ReceivedSize); + + if ( ReceivedSize != IMAGE_BUFFER_SIZE ) + { + Success = 0; + break; + } + else + { + pMem += MemIterator; + printf("."); + } + } + + if ( Remainder != 0 ) + { + ReceivedSize = usb_bulk_read(g_hSysDriver, 0x86, + (char *)pMem, Remainder, 1000); +// printf("DRIVER: bulkread2 size=%x\n",ReceivedSize); + + if ( ReceivedSize != Remainder ) + Success = 0; + } + printf("\n"); + + if ( !Success ) + return APN_USB_ERR_IMAGE_DOWNLOAD; + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbReset() +{ + BOOLEAN Success; + unsigned short BytesReceived; + +// if ( (g_hSysDriver) == 0) +// { +// return APN_USB_ERR_OPEN; +// } + + Success = usb_control_msg(g_hSysDriver, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, VND_APOGEE_SOFT_RESET, + 0, 0, (char *)&BytesReceived, 2, 3000); +// printf("DRIVER: reset s=%x\n",Success); + + if ( !Success ) + { + return APN_USB_ERR_RESET; + } + + return APN_USB_SUCCESS; +} + + + + + + + + + + + + + + + + + + + diff --git a/kstars/kstars/indi/apogee/ApogeeUsbLinuxForKernel.cpp b/kstars/kstars/indi/apogee/ApogeeUsbLinuxForKernel.cpp new file mode 100644 index 00000000..4cbb77b2 --- /dev/null +++ b/kstars/kstars/indi/apogee/ApogeeUsbLinuxForKernel.cpp @@ -0,0 +1,486 @@ +// ApogeeUsb.cpp : Library of basic USB functions for Apogee APn/Alta. +// + +#include <assert.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <string.h> +#include <sched.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdio.h> + + +#include "ApogeeUsb.h" +#include "ApogeeUsbErr.h" +#include "ApogeeLinux.h" + + +#define HANDLE unsigned int +#define ULONG unsigned int +#define BOOLEAN unsigned int +#define USHORT unsigned short + +#define APOGEE_USB_DEVICE "/dev/usb/alta" +#define INVALID_HANDLE_VALUE -1 + + +// Global variables used in this DLL +HANDLE g_hSysDriver; +ULONG g_UsbImgSizeBytes; + + +// 1044480 +// 520192 +// 126976 +// 61440 +// 49152 +// 4096 +#define IMAGE_BUFFER_SIZE 126976 // Number of requested bytes in a transfer +//#define IMAGE_BUFFER_SIZE 253952 // Number of requested bytes in a transfer + + +// This is an example of an exported function. +APN_USB_TYPE ApnUsbOpen( unsigned short DevNumber ) +{ + + char deviceName[128]; + + g_hSysDriver = 0; + g_UsbImgSizeBytes = 0; + + // Open the driver + sprintf(deviceName,"%s%d",APOGEE_USB_DEVICE,DevNumber); + g_hSysDriver = ::open(deviceName,O_RDONLY); + + if ( g_hSysDriver == INVALID_HANDLE_VALUE ) + { + return APN_USB_ERR_OPEN; // Failure to open device + } + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbClose( void ) +{ + if ( (g_hSysDriver != INVALID_HANDLE_VALUE ) && (g_hSysDriver != 0) ) + { + ::close( g_hSysDriver ); + g_hSysDriver = 0; + } + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbDiscovery( unsigned short *UsbCamCount, + APN_USB_CAMINFO UsbCamInfo[] ) +{ + HANDLE hDriver; + char deviceName[64]; + unsigned short RegNumber; + unsigned short retval; + struct apIOparam request; + USHORT RegData; + *UsbCamCount = 0; + + + for ( int i=0; i<APN_USB_MAXCAMERAS; i++ ) + { + NULL, + NULL, + + // Open the driver + sprintf(deviceName,"%s%d",APOGEE_USB_DEVICE,i); + hDriver = ::open(deviceName,O_RDONLY); + + if ( hDriver != INVALID_HANDLE_VALUE ) + { + // first set the camera number + UsbCamInfo[*UsbCamCount].CamNumber = i; + + // now determine the camera model with a read operation + BOOLEAN Success; + USHORT FpgaReg; + USHORT RegData; + ULONG BytesReceived; + + FpgaReg = 100; + request.reg = FpgaReg; + request.param1=(unsigned long)&retval; + Success=ioctl(hDriver,APUSB_READ_USHORT,(unsigned long)&request); + RegData = (unsigned short)retval; + + if ( Success ) + { + UsbCamInfo[*UsbCamCount].CamModel = RegData & 0x00FF; + (*UsbCamCount)++; + } + } + + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbReadReg( unsigned short FpgaReg, unsigned short *FpgaData ) +{ + BOOLEAN Success; + USHORT RegData; + unsigned short RegNumber; + unsigned short retval; + struct apIOparam request; + + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + + request.reg = FpgaReg; + request.param1=(unsigned long)&retval; + Success=ioctl(g_hSysDriver,APUSB_READ_USHORT,(unsigned long)&request); + RegData = (unsigned short)retval; + + if ( (!Success) ) + { + return APN_USB_ERR_READ; + } + + *FpgaData = RegData; + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbWriteReg( unsigned short FpgaReg, unsigned short FpgaData ) +{ + BOOLEAN Success; + unsigned short RegNumber; + struct apIOparam request; + + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + request.reg = FpgaReg; + request.param1=(int)FpgaData; + Success=ioctl(g_hSysDriver,APUSB_WRITE_USHORT,(unsigned long)&request); + if ( !Success ) + return APN_USB_ERR_WRITE; + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbWriteRegMulti( unsigned short FpgaReg, unsigned short FpgaData[], unsigned short RegCount ) +{ + unsigned short Counter; + + for ( Counter=0; Counter<RegCount; Counter++ ) + { + if ( ApnUsbWriteReg( FpgaReg, FpgaData[Counter] ) != APN_USB_SUCCESS ) + { + return APN_USB_ERR_WRITE; + } + } + + return APN_USB_SUCCESS; // Success +} + +APN_USB_TYPE ApnUsbWriteRegMultiMRMD( unsigned short FpgaReg[], + unsigned short FpgaData[], + unsigned short RegCount ) +{ + unsigned short Counter; + + for ( Counter=0; Counter<RegCount; Counter++ ) + { + if ( ApnUsbWriteReg( FpgaReg[Counter], FpgaData[Counter] ) != APN_USB_SUCCESS ) + { + return APN_USB_ERR_WRITE; + } + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbReadStatusRegs( unsigned short *StatusReg, + unsigned short *HeatsinkTempReg, + unsigned short *CcdTempReg, + unsigned short *CoolerDriveReg, + unsigned short *VoltageReg, + unsigned short *TdiCounter, + unsigned short *SequenceCounter ) +{ + BOOLEAN Success; + unsigned int BytesReceived; + unsigned short RegNumber; + struct apIOparam request; + unsigned short *Data; + unsigned char StatusData[21]; + + request.reg = 0; //check this ******************* + request.param1=(unsigned long)&StatusData; + Success=ioctl(g_hSysDriver,APUSB_READ_STATUS,(unsigned long)&request); + +// if ( !Success ) +// return APN_USB_ERR_STATUS; + Data = (unsigned short *)StatusData; + + *HeatsinkTempReg = Data[0]; + *CcdTempReg = Data[1]; + *CoolerDriveReg = Data[2]; + *VoltageReg = Data[3]; + *TdiCounter = Data[4]; + *SequenceCounter = Data[5]; + *StatusReg = Data[6]; + + if ( (StatusData[20] & 0x01) != 0 ) + { + *StatusReg |= 0x8; + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbStartExp( unsigned short ImageWidth, + unsigned short ImageHeight ) +{ + BOOLEAN Success; + ULONG ImageSize; + ULONG BytesReceived; + unsigned short RegNumber; + struct apIOparam request; + + + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + g_UsbImgSizeBytes = ImageWidth * ImageHeight * 2; + ImageSize = ImageWidth * ImageHeight; + + if ( g_UsbImgSizeBytes == 0 ) + { + return APN_USB_ERR_START_EXP; + } + + request.reg = (int)ImageSize; + request.param1= 0; + Success=ioctl(g_hSysDriver,APUSB_PRIME_USB_DOWNLOAD,(unsigned long)&request); + + if ( !Success ) + { + return APN_USB_ERR_START_EXP; + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE ApnUsbStopExp( bool DigitizeData ) +{ + BOOLEAN Success; + ULONG BytesReceived; + unsigned short RegNumber; + struct apIOparam request; + + + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + if ( DigitizeData == false ) + { + request.reg = 0; + request.param1 = 0; + Success=ioctl(g_hSysDriver,APUSB_STOP_USB_IMAGE,(unsigned long)&request); + + if ( !Success ) + { + return APN_USB_ERR_STOP_EXP; + } + } + + return APN_USB_SUCCESS; +} + + +APN_USB_TYPE OrigApnUsbGetImage( unsigned short *pMem ) +{ + BOOLEAN Success; + ULONG ImageBytesRemaining; + ULONG ReceivedSize; + ULONG retval; + unsigned char *pRequestData; + unsigned short RegNumber; + struct apIOparam request; + + + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + ImageBytesRemaining = g_UsbImgSizeBytes; + +// pRequestData = new UCHAR[IMAGE_BUFFER_SIZE]; + + //////////////////////// + ULONG LoopCount = g_UsbImgSizeBytes / IMAGE_BUFFER_SIZE; + ULONG Remainder = g_UsbImgSizeBytes - ( LoopCount * IMAGE_BUFFER_SIZE ); + ULONG MemIterator = IMAGE_BUFFER_SIZE / 2; + ULONG Counter; + + + for ( Counter=0; Counter<LoopCount; Counter++ ) + { + request.reg = 0; //check this *************** + request.param1= *pMem; + request.param2=IMAGE_BUFFER_SIZE; + Success=ioctl(g_hSysDriver,APUSB_READ_USB_IMAGE,(unsigned long)&request); + ReceivedSize = (unsigned short)retval; + + if ( (!Success) || (ReceivedSize != IMAGE_BUFFER_SIZE) ) + { + Success = 0; + break; + } + else + { + pMem += MemIterator; + } + } + + if ( (Success) && (Remainder != 0) ) + { + request.reg = 0; //check this *************************8 + request.param1= *pMem; + request.param2=Remainder; + Success=ioctl(g_hSysDriver,APUSB_READ_USB_IMAGE,(unsigned long)&request); + ReceivedSize = (unsigned short)retval; + + if ( ReceivedSize != Remainder ) + Success = 0; + } + +// delete [] pRequestData; + + if ( !Success ) + return APN_USB_ERR_IMAGE_DOWNLOAD; + + return APN_USB_SUCCESS; // Success +} + +APN_USB_TYPE ApnUsbGetImage( unsigned short *pMem ) +{ + BOOLEAN Success; + ULONG ImageBytesRemaining; + ULONG ReceivedSize; + ULONG retval; + unsigned char *pRequestData; + unsigned short RegNumber; + struct apIOparam request; + + Success = 1; + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + ImageBytesRemaining = g_UsbImgSizeBytes; + + + //////////////////////// + ULONG LoopCount = g_UsbImgSizeBytes / IMAGE_BUFFER_SIZE; + ULONG Remainder = g_UsbImgSizeBytes - ( LoopCount * IMAGE_BUFFER_SIZE ); + ULONG MemIterator = IMAGE_BUFFER_SIZE / 2; + ULONG Counter; + + + for ( Counter=0; Counter<LoopCount; Counter++ ) + { + ReceivedSize = read(g_hSysDriver,pMem,IMAGE_BUFFER_SIZE); + + if ( ReceivedSize != IMAGE_BUFFER_SIZE ) + { + Success = 0; + break; + } + else + { + pMem += MemIterator; + printf("."); + } + } + + if ( Remainder != 0 ) + { + ReceivedSize = read(g_hSysDriver,pMem,Remainder); + + if ( ReceivedSize != Remainder ) + Success = 0; + } + printf("\n"); + + if ( !Success ) + return APN_USB_ERR_IMAGE_DOWNLOAD; + + return APN_USB_SUCCESS; // Success +} + + +APN_USB_TYPE ApnUsbReset() +{ + BOOLEAN Success; + ULONG BytesReceived; + unsigned short RegNumber; + struct apIOparam request; + + + if ( (g_hSysDriver == INVALID_HANDLE_VALUE) || (g_hSysDriver == 0) ) + { + return APN_USB_ERR_OPEN; + } + + request.reg = 0; + request.param1 = 0; + Success=ioctl(g_hSysDriver,APUSB_USB_RESET,(unsigned long)&request); + + if ( !Success ) + { + return APN_USB_ERR_RESET; + } + + return APN_USB_SUCCESS; +} + + + + + + + + + + + + + + + + + + diff --git a/kstars/kstars/indi/apogee/CameraIO_Linux.cpp b/kstars/kstars/indi/apogee/CameraIO_Linux.cpp new file mode 100644 index 00000000..67d217ec --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_Linux.cpp @@ -0,0 +1,1362 @@ +// CameraIO.cpp: implementation of the CCameraIO class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#include <assert.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <string.h> +#include <sched.h> +#include <unistd.h> +#include <fcntl.h> +#define HANDLE int +#define FALSE 0 +#define DWORD long +#define _ASSERT assert +#define REALTIME_PRIORITY_CLASS 1 +#define GetCurrentProcess getpid +#define LOBYTE(x) ((x) & 0xff) +#define HIBYTE(x) ((x >> 8) & 0xff) + +#define MIRQ1 0x21 +#define MIRQ2 0xA1 + +#include "time.h" +//#include "tcl.h" +//#include "ccd.h" +#include "CameraIO_Linux.h" +#include "ApogeeLinux.h" + +const int NUM_POSITIONS = 6; +const int NUM_STEPS_PER_FILTER = 48; +const int STEP_DELAY = 10; + +const unsigned char Steps[] = { 0x10, 0x30, 0x20, 0x60, 0x40, 0xc0, 0x80, 0x90 }; +const int NUM_STEPS = sizeof ( Steps ); + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CCameraIO::CCameraIO() +{ + InitDefaults(); + + m_TDI = false; + + m_Shutter = false; + m_FilterPosition = 0; + m_FilterStepPos = 0; + + m_WaitingforImage = false; + m_WaitingforLine = false; + + m_WaitingforTrigger = false; + m_Status = Camera_Status_Idle; + m_CoolerStatus = Camera_CoolerStatus_Off; + + m_ExposureBinX = 0; + m_ExposureBinY = 0; + m_ExposureStartX = 0; + m_ExposureStartY = 0; + m_ExposureNumX = 0; + m_ExposureNumY = 0; + m_ExposureColumns = 0; + m_ExposureRows = 0; + m_ExposureSkipC = 0; + m_ExposureSkipR = 0; + m_ExposureHFlush = 0; + m_ExposureVFlush = 0; + m_ExposureBIC = 0; + m_ExposureBIR = 0; + m_ExposureAIC = 0; + m_ExposureRemainingLines = 0; + m_ExposureAIR = 0; + + m_RegShadow[ Reg_Command ] = 0; + m_RegShadow[ Reg_Timer ] = 0; + m_RegShadow[ Reg_VBinning ] = 0; + m_RegShadow[ Reg_AICCounter ] = 0; + m_RegShadow[ Reg_TempSetPoint ] = 0; + m_RegShadow[ Reg_PixelCounter ] = 0; + m_RegShadow[ Reg_LineCounter ] = 0; + m_RegShadow[ Reg_BICCounter ] = 0; + + m_FastShutterBits_Mode = 0; + m_FastShutterBits_Test = 0; + m_IRQMask = 0; + saveIRQS = 0; + +} + +CCameraIO::~CCameraIO() +{ + + //::close(fileHandle); + close(fileHandle); +} + +//////////////////////////////////////////////////////////// +// System methods + +int GetPriorityClass ( HANDLE /*hProcess*/ ) +{ + int i; + i = sched_getscheduler(0); + return(i); +} + +int SetPriorityClass ( HANDLE /*hProcess*/, int hPriority) +{ + int i; + sched_param p; + + if (hPriority) { + i = sched_setscheduler(0,SCHED_RR,&p); + } else { + i = sched_setscheduler(0,SCHED_OTHER,&p); + } + return(i); +} + +void Sleep (int hTime) +{ + timespec t; + t.tv_sec= 0; + t.tv_nsec = hTime*1000000; +// nanosleep(&t); +} + + + +void ATLTRACE (char * /*msg*/) +{ +} + + +void CCameraIO::Reset() +{ + unsigned short val = 0; + Read( Reg_CommandReadback, val ); // Take snapshot of currrent status + m_RegShadow[ Reg_Command ] = val; // remember it in our write shadow + + // In case these were left on, turn them off + m_RegShadow[ Reg_Command ] &= ~RegBit_FIFOCache; // set bit to 0 + m_RegShadow[ Reg_Command ] &= ~RegBit_TDIMode; // set bit to 0 + + m_RegShadow[ Reg_Command ] |= RegBit_ResetSystem; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_ResetSystem; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_WaitingforImage = false; + m_WaitingforLine = false; + m_WaitingforTrigger = false; +} + +void CCameraIO::AuxOutput( unsigned char val ) +{ + // clear bits to 0 + m_RegShadow[ Reg_TempSetPoint ] &= ~( RegBitMask_PortControl << RegBitShift_PortControl ); + + // set our new bits + m_RegShadow[ Reg_TempSetPoint ] |= val << RegBitShift_PortControl; + + Write( Reg_TempSetPoint, m_RegShadow[ Reg_TempSetPoint ] ); +} + +// Input reg is from 0 to 7, val is any 16 bit number +void CCameraIO::RegWrite( short reg, unsigned short val ) +{ + Write( reg, val ); + + // Update our shadow register + switch ( reg ) + { + case Reg_Command: + m_RegShadow[ Reg_Command ] = val; + break; + case Reg_Timer: + m_RegShadow[ Reg_Timer ] = val; + break; + case Reg_VBinning: + m_RegShadow[ Reg_VBinning ] = val; + break; + case Reg_AICCounter: + m_RegShadow[ Reg_AICCounter ] = val; + break; + case Reg_TempSetPoint: + m_RegShadow[ Reg_TempSetPoint ] = val; + break; + case Reg_PixelCounter: + m_RegShadow[ Reg_PixelCounter ] = val; + break; + case Reg_LineCounter: + m_RegShadow[ Reg_LineCounter ] = val; + break; + case Reg_BICCounter: + m_RegShadow[ Reg_BICCounter ] = val; + break; + default: + _ASSERT( FALSE ); // application program bug + } +} + +// Input reg is from 8 to 12, returned val is any 16 bit number +void CCameraIO::RegRead( short reg, unsigned short& val ) +{ + Read( reg, val ); +} + +bool CCameraIO::FilterHome() +{ + HANDLE hProcess(0); + DWORD Class(0); + + if ( m_HighPriority ) + { // Store current process class and priority + hProcess = GetCurrentProcess(); + Class = GetPriorityClass ( hProcess ); + SetPriorityClass ( hProcess, REALTIME_PRIORITY_CLASS ); + } + + // Find the home position + m_FilterPosition = 0; + int Safety = 0; + for (int I = 0; I < NUM_POSITIONS * NUM_STEPS_PER_FILTER * 2; I++) + { + // Advance the filter one step + m_FilterStepPos += 1; + if (m_FilterStepPos >= NUM_STEPS) m_FilterStepPos = 0; + unsigned char Step = Steps[ m_FilterStepPos ]; + + AuxOutput( Step ); + Sleep ( STEP_DELAY ); + + // Check for strobe + unsigned short val = 0; + Read( Reg_Status, val ); + if ( val & RegBit_GotTrigger ) + { + // Cycle all the way around if it's on the first time + if (I < NUM_STEPS_PER_FILTER) + { + if (++Safety > NUM_STEPS_PER_FILTER * 2) + { + // Restore normal priority + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + return false; + } + I = 0; + continue; + } + + // Continue cycling until we get clear of the opto mirror + for (int J = 0; J < NUM_STEPS_PER_FILTER; J++) + { + // Advance the filter one step + m_FilterStepPos += 1; + if (m_FilterStepPos >= NUM_STEPS) m_FilterStepPos = 0; + unsigned char Step = Steps[ m_FilterStepPos ]; + + AuxOutput( Step ); + Sleep ( STEP_DELAY ); + + val = 0; + Read( Reg_Status, val ); + if ( val & RegBit_GotTrigger ) + { + Sleep ( 10 ); + + val = 0; + Read( Reg_Status, val ); + if ( val & RegBit_GotTrigger ) + { + // Restore normal priority + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + return true; + } + } + } + + // Restore normal priority + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + return true; + } + } + + // Restore normal priority + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + return false; +} + +void CCameraIO::FilterSet( short Slot ) +{ + // Determine how far we have to move + int Pos = Slot - m_FilterPosition; + if (Pos < 0) Pos += NUM_POSITIONS; + + HANDLE hProcess(0); + DWORD Class(0); + + if ( m_HighPriority ) + { // Store current process class and priority + hProcess = GetCurrentProcess(); + Class = GetPriorityClass ( hProcess ); + SetPriorityClass ( hProcess, REALTIME_PRIORITY_CLASS ); + } + + for (int I = 0; I < Pos; I++) + { + // Advance one position + for (int J = 0; J < NUM_STEPS_PER_FILTER; J++) + { + m_FilterStepPos += 1; + if (m_FilterStepPos >= NUM_STEPS) m_FilterStepPos = 0; + unsigned char Step = Steps[ m_FilterStepPos ]; + + AuxOutput( Step ); + Sleep ( STEP_DELAY ); + } + } + + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + + m_FilterPosition = Slot; +} + +//////////////////////////////////////////////////////////// +// Normal exposure methods + +bool CCameraIO::Expose( double Duration, bool Light ) +{ + if ( !m_TDI && ( Duration < m_MinExposure || Duration > m_MaxExposure ) ) return false; + + // Validate all input variables + if ( m_Columns < 1 || m_Columns > MAXCOLUMNS ) return false; + m_ExposureColumns = m_Columns; + + if ( m_Rows < 1 || m_Rows > MAXROWS ) return false; + m_ExposureRows = m_Rows; + + if ( m_SkipC < 0 ) return false; + m_ExposureSkipC = m_SkipC; + + if ( m_SkipR < 0 ) return false; + m_ExposureSkipR = m_SkipR; + + if ( m_HFlush < 1 || m_HFlush > MAXHBIN ) return false; + m_ExposureHFlush = m_HFlush; + + if ( m_VFlush < 1 || m_VFlush > MAXVBIN ) return false; + m_ExposureVFlush = m_VFlush; + + if ( m_BIC < 1 || m_BIC > MAXCOLUMNS ) return false; + m_ExposureBIC = m_BIC; + + if ( m_BIR < 1 || m_BIR > MAXROWS ) return false; + m_ExposureBIR = m_BIR; + + // Validate all input variables + if ( m_BinX < 1 || m_BinX > MAXHBIN ) return false; + m_ExposureBinX = m_BinX; + + if ( m_StartX < 0 || m_StartX >= MAXCOLUMNS ) return false; + m_ExposureStartX = m_StartX; + + if ( m_NumX < 1 || m_NumX * m_BinX > m_ImgColumns ) return false; + m_ExposureNumX = m_NumX; + + // Calculate BIC, RawPixelCount, AIC + unsigned short BIC = m_ExposureBIC + m_ExposureStartX; // unbinned columns + unsigned short RawPixelCount = m_ExposureNumX * m_ExposureBinX; + m_ExposureAIC = m_ExposureColumns - BIC - RawPixelCount; // unbinned columns + + if ( m_BinY < 1 || m_BinY > MAXVBIN ) return false; + m_ExposureBinY = m_BinY; + + unsigned short VBin(0), row_offset(0); + + if ( m_TDI ) + { // row_offset is the drift time in milliseconds when in TDI mode + row_offset = (unsigned short) (Duration * 1000 + 0.5); + Duration = 0.0; + } + else + { + if ( m_StartY < 0 || m_StartX >= MAXROWS ) return false; + m_ExposureStartY = m_StartY; + + if ( m_NumY < 1 || m_NumY * m_BinY > m_ImgRows ) return false; + m_ExposureNumY = m_NumY; + + unsigned short BIR = m_ExposureBIR + m_ExposureStartY; // unbinned rows + if ( BIR >= MAXROWS ) return false; + m_ExposureAIR = m_ExposureRows - BIR - m_ExposureNumY * m_ExposureBinY; // unbinned rows + + if ( m_VFlush > BIR ) + { + VBin = BIR; + m_ExposureRemainingLines = 0; + } + else + { + VBin = m_VFlush; + m_ExposureRemainingLines = BIR % VBin; // unbinned rows + } + row_offset = BIR - m_ExposureRemainingLines; // unbinned rows + } + + StopFlushing(); + Reset(); + + LoadColumnLayout( m_ExposureAIC, BIC, (unsigned short) m_ExposureNumX + m_ExposureSkipC ); + LoadTimerAndBinning( Duration, (unsigned short) m_ExposureHFlush, VBin ); + LoadLineCounter( row_offset ); + + if ( m_TDI ) + { + // Turn on TDI + m_RegShadow[ Reg_Command ] |= RegBit_TDIMode; // set bit to 1 + + // Disable FIFO cache + m_RegShadow[ Reg_Command ] &= ~RegBit_FIFOCache; // set bit to 0 + + // Set shutter override + if ( Light ) + m_RegShadow[ Reg_Command ] |= RegBit_ShutterOverride; // set bit to 1 + else + m_RegShadow[ Reg_Command ] &= ~RegBit_ShutterOverride; // set bit to 0 + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + // Update our status + m_Shutter = Light; + m_WaitingforTrigger = false; + m_WaitingforLine = false; + } + else + { + // Set shutter + if ( Light ) + m_RegShadow[ Reg_Command ] |= RegBit_ShutterEnable; // set bit to 1 + else + m_RegShadow[ Reg_Command ] &= ~RegBit_ShutterEnable; // set bit to 0 + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + // Update our status + unsigned short val = 0; + Read( Reg_CommandReadback, val ); + if ( val & RegBit_ShutterOverride ) + m_Shutter = true; + else + m_Shutter = Light; + + if ( ( val & RegBit_TriggerEnable ) ) + m_WaitingforTrigger = true; + else + m_WaitingforTrigger = false; + + // Start the exposure + m_RegShadow[ Reg_Command ] |= RegBit_StartTimer; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartTimer; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_WaitingforImage = true; + } + + return true; +} + +/*bool CCameraIO::BufferImage(char *bufferName ) +{ + unsigned short *pImageData; + bool status; + short cols,rows,hbin,vbin; + short xSize, ySize; + + cols = m_NumX*m_BinX; + rows = m_NumY*m_BinY; + hbin = m_BinX; + vbin = m_BinY; + + pImageData = (unsigned short *)CCD_locate_buffer(bufferName, 2 , cols, rows, hbin, vbin ); + if (pImageData == NULL) { + return 0; + } + + status = GetImage(pImageData, xSize, ySize); + return status; +}*/ + +bool CCameraIO::GetImage( unsigned short* pImageData, short& xSize, short& ySize ) +{ + int i; + unsigned short BIC = m_ExposureBIC + m_ExposureStartX; + + // Update internal variables in case application did not poll read_Status + m_WaitingforTrigger = false; + m_WaitingforLine = false; + + if ( m_WaitingforImage ) + { // In case application did not poll read_Status + m_WaitingforImage = false; + + ///////////////////////////////////// + // Wait until camera is done flushing + clock_t StopTime = clock() + long( m_Timeout * CLOCKS_PER_SEC ); // wait at most m_Timeout seconds + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_FrameDone ) != 0 ) break; + + if ( clock() > StopTime ) return false; // Timed out + } + } + +// MaskIrqs(); + + ///////////////////////////////////// + // Update our internal status + unsigned short val = 0; + Read( Reg_CommandReadback, val ); + if ( !( val & RegBit_ShutterOverride ) ) m_Shutter = false; + + StopFlushing(); + LoadColumnLayout( m_ExposureAIC, BIC, (unsigned short) m_ExposureNumX + m_ExposureSkipC ); + + if ( m_ExposureRemainingLines > 0 ) + { + LoadTimerAndBinning( 0.0, m_ExposureHFlush, m_ExposureRemainingLines ); + + ///////////////////////////////////// + // Clock out the remaining lines + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Wait until camera is done clocking + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break; // Line done + + if ( clock() > StopTime ) + { + Flush(); + return false; // Timed out, no image available + } + } + } + + LoadTimerAndBinning( 0.0, m_ExposureBinX, m_ExposureBinY ); + + bool ret = false; // assume failure + + // NB Application must have allocated enough memory or else !!! + if ( pImageData != NULL ) + { + HANDLE hProcess(0); + DWORD Class(0); + + if ( m_HighPriority ) + { // Store current process class and priority + hProcess = GetCurrentProcess(); + Class = GetPriorityClass ( hProcess ); + SetPriorityClass ( hProcess, REALTIME_PRIORITY_CLASS ); + } + + m_RegShadow[ Reg_Command ] |= RegBit_FIFOCache; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + long XPixels = long( m_ExposureNumX ); + long SkipPixels = long( m_ExposureSkipC ); + for (i = 0; i < m_ExposureSkipR; i++) + { + if ( ReadLine( SkipPixels, XPixels, pImageData ) ) break; + } + + if ( i == m_ExposureSkipR ) + { // We have skipped all the lines + long YPixels = long( m_ExposureNumY ); + unsigned short* pLineBuffer = pImageData; + for (i = 0; i < YPixels; i++) + { + if ( ReadLine( SkipPixels, XPixels, pLineBuffer ) ) break; + pLineBuffer += XPixels; + } + + if ( i == YPixels ) ret = true; // We have read all the lines + } + + m_RegShadow[ Reg_Command ] &= ~RegBit_FIFOCache; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + //Restore priority + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + } + +// UnmaskIrqs(); + + if ( ret ) + { // We were successfull + Flush( m_ExposureAIR ); // flush after imaging rows + + xSize = m_ExposureNumX; + ySize = m_ExposureNumY; + + if ( m_DataBits == 16 ) + { // Take care of two's complement converters + unsigned short *Ptr = pImageData; + short *Ptr2 = (short *) pImageData; + long Size = m_ExposureNumX * m_ExposureNumY; + for (i = 0; i < Size; i++) + { + *Ptr++ = (unsigned short) *Ptr2++ + 32768 ; + } + } + + } + else + { // Something went wrong + xSize = 0; + ySize = 0; + } + + Flush(); // start normal flushing + + return ret; +} + +//////////////////////////////////////////////////////////// +// Drift scan methods + +bool CCameraIO::DigitizeLine() +{ + ///////////////////////////////////// + // All of these are done just in case + // since they are called in Expose() + StopFlushing(); + + unsigned short BIC = m_ExposureBIC + m_ExposureStartX; + LoadColumnLayout( m_ExposureAIC, BIC, (unsigned short) m_ExposureNumX + m_ExposureSkipC ); + LoadTimerAndBinning( 0.0, m_ExposureBinX, m_ExposureBinY ); + + // Disable FIFO cache + m_RegShadow[ Reg_Command ] &= ~RegBit_FIFOCache; // set bit to 0 + ///////////////////////////////////// + + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + m_WaitingforLine = true; + return true; +} + +bool CCameraIO::GetLine( unsigned short* pLineData, short& xSize ) +{ + int i; + + if ( m_WaitingforLine ) + { // In case application did not poll read_Status + m_WaitingforLine = false; + + ///////////////////////////////////// + // Wait until camera is done clocking + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break; // Line done + + if ( clock() > StopTime ) + { + Flush(); + return false; // Timed out, no line available + } + } + } + + bool ret = false; // assume failure + +// MaskIrqs(); + + // NB Application must have allocated enough memory or else !!! + if ( pLineData != NULL ) + { + HANDLE hProcess(0); + DWORD Class(0); + + if ( m_HighPriority ) + { // Store current process class and priority + hProcess = GetCurrentProcess(); + Class = GetPriorityClass ( hProcess ); + SetPriorityClass ( hProcess, REALTIME_PRIORITY_CLASS ); + } + + long XPixels = long( m_ExposureNumX ); + long SkipPixels = long( m_ExposureSkipC ); + + if ( ReadLine( SkipPixels, XPixels, pLineData ) ) + { // Something went wrong + xSize = 0; + ret = false; + } + else + { + xSize = m_ExposureNumX; + + if ( m_DataBits == 16 ) + { // Take care of two's complement converters + unsigned short *Ptr = pLineData; + short *Ptr2 = (short *) pLineData; + long Size = m_ExposureNumX; + for (i = 0; i < Size; i++) + { + *Ptr++ = (unsigned short) *Ptr2++ + 32768 ; + } + } + + ret = true; + } + + //Restore priority + if ( m_HighPriority ) SetPriorityClass ( hProcess, Class ); + } + +// UnmaskIrqs(); + return ret; +} + +//////////////////////////////////////////////////////////// +// Easy to use methods + +bool CCameraIO::Snap( double Duration, bool Light, unsigned short* pImageData, short& xSize, short& ySize ) +{ + // NB This also demonstrates how an application might use the + // Expose and GetImage routines. + + bool ret = Expose( Duration, Light ); + if ( !ret ) return false; + + if ( m_WaitingforTrigger ) + { + Camera_Status stat; + while ( true ) + { // This will wait forever if no trigger happens + stat = read_Status(); + if ( stat == Camera_Status_Exposing ) break; + Sleep( 220 ); // dont bog down the CPU while polling + } + m_WaitingforTrigger = false; + } + + // Only wait a time slightly greater than the duration of the exposure + // but enough for the BIR to flush out + clock_t StopTime = clock() + long( ( 1.2 * Duration + m_Timeout ) * CLOCKS_PER_SEC ); + while ( true ) + { + Camera_Status stat = read_Status(); + if ( stat == Camera_Status_ImageReady ) break; + + if ( clock() > StopTime ) return false; // Timed out, no image available + Sleep( 220 ); // dont bog down the CPU while polling + } + + return GetImage( pImageData, xSize, ySize ); +} + +//////////////////////////////////////////////////////////// +// Camera Settings + +Camera_Status CCameraIO::read_Status() +{ + unsigned short val = 0; + Read( Reg_Status, val ); + + if ( val & RegBit_Exposing ) //11.0 + { + ATLTRACE( "Exposing\r\n" ); + m_WaitingforTrigger = false; + m_Status = Camera_Status_Exposing; + } + + else if ( m_WaitingforTrigger ) + m_Status = Camera_Status_Waiting; + + else if ( m_WaitingforImage && ( val & RegBit_FrameDone ) ) //11.11 + { + ATLTRACE( "ImageReady\r\n" ); + m_WaitingforImage = false; + m_Status = Camera_Status_ImageReady; + } + + else if ( m_WaitingforLine && ( val & RegBit_LineDone ) ) //11.1 + { + ATLTRACE( "LineReady\r\n" ); + m_WaitingforLine = false; + m_Status = Camera_Status_LineReady; + } + else if ( m_WaitingforImage || m_WaitingforLine ) + { + ATLTRACE( "Flushing\r\n" ); + m_Status = Camera_Status_Flushing; + } + else + m_Status = Camera_Status_Idle; + + return m_Status; +} + +bool CCameraIO::read_Present() +{ +// This does not work on all cameras +/* + m_RegShadow[ Reg_BICCounter ] |= RegBit_LoopbackTest; // set bit to 1 + Write( Reg_BICCounter, m_RegShadow[ Reg_BICCounter ] ); + + bool FailedLoopback = false; + unsigned short val = 0; + Read( Reg_Status, val ); + if ( !( val & RegBit_LoopbackTest ) ) FailedLoopback = true; + + m_RegShadow[ Reg_BICCounter ] &= ~RegBit_LoopbackTest; // clear bit to 0 + Write( Reg_BICCounter, m_RegShadow[ Reg_BICCounter ] ); + + Read( Reg_Status, val ); + if ( val & RegBit_LoopbackTest ) FailedLoopback = true; +*/ + + unsigned short val = 0; + Read( Reg_CommandReadback, val ); // Take snapshot of currrent status + m_RegShadow[ Reg_Command ] = val; // remember it in our write shadow + + bool TriggerEnabled = ( val & RegBit_TriggerEnable ) != 0; + + m_RegShadow[ Reg_Command ] &= ~RegBit_TriggerEnable;// clear bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + Read( Reg_CommandReadback, val ); // get currrent status + if ( val & RegBit_TriggerEnable ) return false; + + m_RegShadow[ Reg_Command ] |= RegBit_TriggerEnable; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + Read( Reg_CommandReadback, val ); // get currrent status + if ( !(val & RegBit_TriggerEnable) ) return false; + + m_RegShadow[ Reg_Command ] &= ~RegBit_TriggerEnable;// clear bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + Read( Reg_CommandReadback, val ); // get currrent status + if ( val & RegBit_TriggerEnable ) return false; + + if ( TriggerEnabled ) + { // Set it back the way it was + m_RegShadow[ Reg_Command ] |= RegBit_TriggerEnable; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + } + return true; +} + +bool CCameraIO::read_Shutter() +{ + unsigned short regval = 0; + Read( Reg_Status, regval ); + if ( !( regval & RegBit_Exposing ) ) + { // We are not exposing, but might have finnshed an exposure + // and have not called GetImage yet, so update our internal variable + regval = 0; + Read( Reg_CommandReadback, regval ); + if ( !( regval & RegBit_ShutterOverride ) ) + // The shutter override is not on, so the shutter must be closed + m_Shutter = false; + } + + return m_Shutter; +} + +bool CCameraIO::read_ForceShutterOpen() +{ + unsigned short val = 0; + Read( Reg_CommandReadback, val ); + return ( ( val & RegBit_ShutterOverride ) != 0 ); +} + +void CCameraIO::write_ForceShutterOpen( bool val ) +{ + if ( val ) + { + m_RegShadow[ Reg_Command ] |= RegBit_ShutterOverride; // set bit to 1 + m_Shutter = true; // shutter will open immediately now matter what is going on + } + else + { + m_RegShadow[ Reg_Command ] &= ~RegBit_ShutterOverride; // clear bit to 0 + + unsigned short regval = 0; + Read( Reg_Status, regval ); + if ( ( regval & RegBit_Exposing ) ) + { + // Shutter will remain open if a Light frame is being taken + // however if a dark frame was being exposed while the + // override was on or the override is turned on during the exposure + // and now is turned off (dumb idea but some app might do it!) + // we must update our variable since the shutter will close + // when override gets turned off below + regval = 0; + Read( Reg_CommandReadback, regval ); + if ( !( regval & RegBit_ShutterEnable ) ) m_Shutter = false; + } + else + { // Not currently exposing so shutter will close + // once override is turned off, update our variable + m_Shutter = false; + } + } + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); +} + + + +bool CCameraIO::read_LongCable() +{ + unsigned short val = 0; + Read( Reg_CommandReadback, val ); + return ( ( val & RegBit_CableLength ) != 0 ); +} + +void CCameraIO::write_Shutter( bool val ) +{ + if ( val ) + m_RegShadow[ Reg_Command ] |= RegBit_ShutterEnable; // set bit to 1 + else + m_RegShadow[ Reg_Command ] &= ~RegBit_ShutterEnable; // clear bit to 0 + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); +} + +void CCameraIO::write_LongCable( bool val ) +{ + if ( val ) + m_RegShadow[ Reg_Command ] |= RegBit_CableLength; // set bit to 1 + else + m_RegShadow[ Reg_Command ] &= ~RegBit_CableLength; // clear bit to 0 + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); +} + + +short CCameraIO::read_Mode() +{ + return ( ( m_RegShadow[ Reg_LineCounter ] >> RegBitShift_Mode ) & RegBitMask_Mode ); +} + +void CCameraIO::write_Mode( short val ) +{ + // clear bits to 0 + m_RegShadow[ Reg_LineCounter ] &= ~( RegBitMask_Mode << RegBitShift_Mode ); + + // set our new bits + m_RegShadow[ Reg_LineCounter ] |= ( (unsigned short) val & RegBitMask_Mode ) << RegBitShift_Mode; + + Write( Reg_LineCounter, m_RegShadow[ Reg_LineCounter ] ); +} + +short CCameraIO::read_TestBits() +{ + return ( ( m_RegShadow[ Reg_BICCounter ] >> RegBitShift_Test ) & RegBitMask_Test ); +} + +void CCameraIO::write_TestBits( short val ) +{ + // clear bits to 0 + m_RegShadow[ Reg_BICCounter ] &= ~( RegBitMask_Test << RegBitShift_Test ); + + // set our new bits + m_RegShadow[ Reg_BICCounter ] |= ( (unsigned short) val & RegBitMask_Test ) << RegBitShift_Test; + + Write( Reg_BICCounter, m_RegShadow[ Reg_BICCounter ] ); +} + + +short CCameraIO::read_Test2Bits() +{ + return ( ( m_RegShadow[ Reg_AICCounter ] >> RegBitShift_Test2 ) & RegBitMask_Test2 ); +} + +void CCameraIO::write_Test2Bits( short val ) +{ + // clear bits to 0 + m_RegShadow[ Reg_AICCounter ] &= ~( RegBitMask_Test2 << RegBitShift_Test2 ); + + // set our new bits + m_RegShadow[ Reg_AICCounter ] |= ( (unsigned short) val & RegBitMask_Test2 ) << RegBitShift_Test2; + + Write( Reg_AICCounter, m_RegShadow[ Reg_AICCounter ] ); +} + +bool CCameraIO::read_FastReadout() +{ + unsigned short val = 0; + Read( Reg_CommandReadback , val ); + return ( ( val & RegBit_Focus ) != 0 ); +} + +void CCameraIO::write_FastReadout( bool val ) +{ + if ( val ) + m_RegShadow[ Reg_Command ] |= RegBit_Focus; // set bit to 1 + else + m_RegShadow[ Reg_Command ] &= ~RegBit_Focus; // clear bit to 0 + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); +} + +bool CCameraIO::read_UseTrigger() +{ + unsigned short val = 0; + Read( Reg_CommandReadback , val ); + return ( ( val & RegBit_TriggerEnable ) != 0 ); +} + +void CCameraIO::write_UseTrigger( bool val ) +{ + if ( val ) + m_RegShadow[ Reg_Command ] |= RegBit_TriggerEnable; // set bit to 1 + else + m_RegShadow[ Reg_Command ] &= ~RegBit_TriggerEnable; // clear bit to 0 + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); +} + +//////////////////////////////////////////////////////////// +// Cooler Settings + +double CCameraIO::read_CoolerSetPoint() +{ + // Get the setting from the shadow registers + short DACunits = short( ( m_RegShadow[ Reg_TempSetPoint ] >> RegBitShift_TempSetPoint ) & RegBitMask_TempSetPoint ); + return ( DACunits - m_TempCalibration ) / m_TempScale; +} + +void CCameraIO::write_CoolerSetPoint( double val ) +{ + // clear bits to 0 + m_RegShadow[ Reg_TempSetPoint ] &= ~( RegBitMask_TempSetPoint << RegBitShift_TempSetPoint ); + + // Calculate DAC units from degrees Celcius + unsigned short DACunits = (unsigned )( m_TempScale * val ) + m_TempCalibration ; + + // set our new bits + m_RegShadow[ Reg_TempSetPoint ] |= ( DACunits & RegBitMask_TempSetPoint ) << RegBitShift_TempSetPoint; + + Write( Reg_TempSetPoint, m_RegShadow[ Reg_TempSetPoint ] ); +} + +Camera_CoolerStatus CCameraIO::read_CoolerStatus() +{ + unsigned short val = 0; + Read( Reg_CommandReadback, val ); + + if ( val & RegBit_CoolerEnable ) //12.15 + { + unsigned short val2 = 0; + Read( Reg_Status, val2 ); + + if ( val & RegBit_CoolerShutdown ) //12.8 + { + if ( val2 & RegBit_ShutdownComplete ) //11.6 + m_CoolerStatus = Camera_CoolerStatus_AtAmbient; + else + m_CoolerStatus = Camera_CoolerStatus_RampingToAmbient; + } + else + { + if ( val2 & RegBit_TempAtMax ) //11.5 + m_CoolerStatus = Camera_CoolerStatus_AtMax; + else if ( val2 & RegBit_TempAtMin ) //11.4 + m_CoolerStatus = Camera_CoolerStatus_AtMin; + else if ( val2 & RegBit_TempAtSetPoint ) //11.7 + m_CoolerStatus = Camera_CoolerStatus_AtSetPoint; + // Check against last known cooler status + else if ( m_CoolerStatus == Camera_CoolerStatus_AtSetPoint ) + m_CoolerStatus = Camera_CoolerStatus_Correcting; + else + m_CoolerStatus = Camera_CoolerStatus_RampingToSetPoint; + } + } + else + m_CoolerStatus = Camera_CoolerStatus_Off; + + return m_CoolerStatus; +} + +Camera_CoolerMode CCameraIO::read_CoolerMode() +{ + unsigned short val = 0; + Read( Reg_CommandReadback, val ); + + if ( val & RegBit_CoolerShutdown ) + return Camera_CoolerMode_Shutdown; + else if ( val & RegBit_CoolerEnable ) + return Camera_CoolerMode_On; + else + return Camera_CoolerMode_Off; +} + +void CCameraIO::write_CoolerMode( Camera_CoolerMode val ) +{ + switch ( val ) + { + case Camera_CoolerMode_Off: + m_RegShadow[ Reg_Command ] &= ~( RegBit_CoolerEnable ); // clear bit to 0 + m_RegShadow[ Reg_Command ] &= ~( RegBit_CoolerShutdown ); // clear bit to 0 + break; + case Camera_CoolerMode_On: + m_RegShadow[ Reg_Command ] |= RegBit_CoolerEnable; // set bit to 1 + break; + case Camera_CoolerMode_Shutdown: + m_RegShadow[ Reg_Command ] |= RegBit_CoolerShutdown; // set bit to 1 + break; + default: + return; + } + + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); +} + +double CCameraIO::read_Temperature() +{ + if ( m_TempScale == 0.0 ) + return 0.0; + else + { + unsigned short val = 0; + Read( Reg_TempData, val ); + + short DACunits = short( ( val >> RegBitShift_TempData ) & RegBitMask_TempData ); + + return ( DACunits - m_TempCalibration ) / m_TempScale; + } +} + +// Load line counter +void CCameraIO::LoadLineCounter( unsigned short rows ) +{ + ///////////////////////////////////// + // Write out Line_Count - in unbinned rows + // clear bits to 0 + m_RegShadow[ Reg_LineCounter ] &= ~( RegBitMask_LineCounter << RegBitShift_LineCounter ); + // set our new bits + m_RegShadow[ Reg_LineCounter ] |= ( rows & RegBitMask_LineCounter ) << RegBitShift_LineCounter; + + Write( Reg_LineCounter, m_RegShadow[ Reg_LineCounter ] ); + ///////////////////////////////////// +} + +// Load AIC, BIC and pixel count into registers +void CCameraIO::LoadColumnLayout( unsigned short aic, unsigned short bic, unsigned short pixels ) +{ + ///////////////////////////////////// + // Write out AIC - in unbinned columns + // clear bits to 0 + m_RegShadow[ Reg_AICCounter ] &= ~( RegBitMask_AICCounter << RegBitShift_AICCounter ); + // set our new bits + m_RegShadow[ Reg_AICCounter ] |= ( aic & RegBitMask_AICCounter ) << RegBitShift_AICCounter; + + Write( Reg_AICCounter, m_RegShadow[ Reg_AICCounter ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Write out BIC - in unbinned columns + // clear bits to 0 + m_RegShadow[ Reg_BICCounter ] &= ~( RegBitMask_BICCounter << RegBitShift_BICCounter ); + // set our new bits + m_RegShadow[ Reg_BICCounter ] |= ( bic & RegBitMask_BICCounter ) << RegBitShift_BICCounter; + + Write( Reg_BICCounter, m_RegShadow[ Reg_BICCounter ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Write out pixel count - in binned columns + // clear bits to 0 + m_RegShadow[ Reg_PixelCounter ] &= ~( RegBitMask_PixelCounter << RegBitShift_PixelCounter ); + // set our new bits + m_RegShadow[ Reg_PixelCounter ] |= ( pixels & RegBitMask_PixelCounter ) << RegBitShift_PixelCounter; + + Write( Reg_PixelCounter, m_RegShadow[ Reg_PixelCounter ] ); + ///////////////////////////////////// +} + +// Load timer, vertical binning and horizontal binning in to registers +// If Duration parameter is 0 the current timer value will be retained. +// The VBin and HBin parameters are one based, the HBin value +// is converted to zero base inside this routine. +void CCameraIO::LoadTimerAndBinning( double Duration, unsigned short HBin, unsigned short VBin ) +{ + ///////////////////////////////////// + // Write out HBin for flushing + // clear bits to 0 + m_RegShadow[ Reg_PixelCounter ] &= ~( RegBitMask_HBinning << RegBitShift_HBinning ); + // set our new bits + m_RegShadow[ Reg_PixelCounter ] |= ( ( HBin - 1 ) & RegBitMask_HBinning ) << RegBitShift_HBinning; + + Write( Reg_PixelCounter, m_RegShadow[ Reg_PixelCounter ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Write out VBin for flushing and Timer + if ( Duration > 0.0 ) + { + if ( Duration > m_MaxExposure ) Duration = m_MaxExposure; + + long valTimer; + if ( m_FastShutter && Duration <= 1048.575 ) + { // Automatically switch to high precision mode + valTimer = long( ( Duration * 1000 ) + 0.5 ); + m_RegShadow[ Reg_LineCounter ] |= ( m_FastShutterBits_Mode & RegBitMask_Mode ) << RegBitShift_Mode; + m_RegShadow[ Reg_BICCounter ] |= ( m_FastShutterBits_Test & RegBitMask_Test ) << RegBitShift_Test; + } + else + { + valTimer = long( ( Duration * 100 ) + 0.5 ); + if ( m_FastShutter ) + { // Disable high precision mode + m_RegShadow[ Reg_LineCounter ] &= ~( m_FastShutterBits_Mode & RegBitMask_Mode ) << RegBitShift_Mode; + m_RegShadow[ Reg_BICCounter ] &= ~( m_FastShutterBits_Test & RegBitMask_Test ) << RegBitShift_Test; + } + } + + if ( m_FastShutter ) + { + Write( Reg_LineCounter, m_RegShadow[ Reg_LineCounter ] ); + Write( Reg_BICCounter, m_RegShadow[ Reg_BICCounter ] ); + } + + if ( valTimer <= 0 ) valTimer = 1; // Safety since firmware doesnt like zero + + unsigned short valTimerLow = (unsigned short) (valTimer & 0x0000FFFF); + unsigned short valTimerHigh = (unsigned short) (valTimer >> 16); + + // Enable loading of timer values + m_RegShadow[ Reg_Command ] |= RegBit_TimerLoad; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + // clear bits to 0 + m_RegShadow[ Reg_Timer ] = 0; + // set our new bits + m_RegShadow[ Reg_Timer ] |= ( valTimerLow & RegBitMask_Timer )<< RegBitShift_Timer; + Write( Reg_Timer, m_RegShadow[ Reg_Timer ] ); + + // clear bits to 0 + m_RegShadow[ Reg_VBinning ] = 0; + + // set our new bits + m_RegShadow[ Reg_VBinning ] |= ( VBin & RegBitMask_VBinning ) << RegBitShift_VBinning; + m_RegShadow[ Reg_VBinning ] |= ( valTimerHigh & RegBitMask_Timer2 ) << RegBitShift_Timer2; + Write( Reg_VBinning, m_RegShadow[ Reg_VBinning ] ); + + // Disable loading of timer values + m_RegShadow[ Reg_Command ] &= ~RegBit_TimerLoad; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + } + else + { + // clear bits to 0 + m_RegShadow[ Reg_VBinning ] &= ~( RegBitMask_VBinning << RegBitShift_VBinning ); + + // set our new bits + m_RegShadow[ Reg_VBinning ] |= ( VBin & RegBitMask_VBinning ) << RegBitShift_VBinning; + Write( Reg_VBinning, m_RegShadow[ Reg_VBinning ] ); + } + +} + +// Start flushing the entire CCD (rows = -1) or a specific number or rows +void CCameraIO::Flush( short Rows ) +{ + if ( Rows == 0 ) return; + + unsigned short AIC = (unsigned short) ( m_Columns - m_BIC - m_ImgColumns ); + unsigned short Pixels = (unsigned short) ( m_ImgColumns / m_HFlush ); + if ( m_ImgColumns % m_HFlush > 0 ) Pixels++; // round up if necessary + LoadColumnLayout( AIC, (unsigned short) m_BIC, Pixels ); + + LoadTimerAndBinning( 0.0, m_HFlush, m_VFlush ); + + if ( Rows > 0 ) + { + LoadLineCounter( (unsigned short) Rows ); + StartFlushing(); + + ///////////////////////////////////// + // Wait until camera is done flushing + clock_t StopTime = clock() + long( m_Timeout * CLOCKS_PER_SEC ); // wait at most m_Timeout seconds + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_FrameDone ) != 0 ) break; + + if ( clock() > StopTime ) break; // Timed out + } + } + else + { + LoadLineCounter( (unsigned short) m_ImgRows ); + StartFlushing(); + } +} + +void CCameraIO::StartFlushing() +{ + ///////////////////////////////////// + // Start flushing + m_RegShadow[ Reg_Command ] |= RegBit_StartFlushing; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartFlushing;// set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// +} + +void CCameraIO::StopFlushing() +{ + ///////////////////////////////////// + // Stop flushing + m_RegShadow[ Reg_Command ] |= RegBit_StopFlushing; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StopFlushing; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// +} + + + + + diff --git a/kstars/kstars/indi/apogee/CameraIO_Linux.h b/kstars/kstars/indi/apogee/CameraIO_Linux.h new file mode 100644 index 00000000..d6a61e1c --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_Linux.h @@ -0,0 +1,416 @@ +// CameraIO.h: interface for the CCameraIO class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_CAMERAIO_H__A2882C82_7CFB_11D4_9155_0060676644C1__INCLUDED_) +#define AFX_CAMERAIO_H__A2882C82_7CFB_11D4_9155_0060676644C1__INCLUDED_ + +#include "Apogee.h" + +enum Camera_Interface{ + Camera_Interface_ISA = 0, + Camera_Interface_PPI, + Camera_Interface_PCI +}; + +enum Camera_SensorType{ + Camera_SensorType_CCD = 0, + Camera_SensorType_CMOS +}; + +const long MAXCOLUMNS = 16383; +const long MAXROWS = 16383; +const long MAXHBIN = 8; +const long MAXVBIN = 255; + +// Number of write only registers +const long NumWriteRegisters = 8; + +const long RegISA_Command = 0x000; // Register 1 in ISA firmware +const long Reg_Command = 0; // Register 1 shadow +const unsigned short RegBit_TDIMode = 0x1; // Bit 0 +const unsigned short RegBit_StartTimer = 0x2; // Bit 1 +const unsigned short RegBit_ShutterOverride = 0x4; // Bit 2 +const unsigned short RegBit_ResetSystem = 0x8; // Bit 3 +const unsigned short RegBit_FIFOCache = 0x10; // Bit 4 +const unsigned short RegBit_TriggerEnable = 0x20; // Bit 5 +const unsigned short RegBit_StopFlushing = 0x40; // Bit 6 +const unsigned short RegBit_ShutterEnable = 0x80; // Bit 7 +const unsigned short RegBit_CoolerShutdown = 0x100; // Bit 8 +const unsigned short RegBit_DoneReading = 0x200; // Bit 9 +const unsigned short RegBit_TimerLoad = 0x400; // Bit 10 +const unsigned short RegBit_StartNextLine = 0x800; // Bit 11 +const unsigned short RegBit_StartFlushing = 0x1000; // Bit 12 +const unsigned short RegBit_Focus = 0x2000; // Bit 13 +const unsigned short RegBit_CableLength = 0x4000; // Bit 14 +const unsigned short RegBit_CoolerEnable = 0x8000; // Bit 15 + +const long RegISA_Timer = 0x002; // Register 2 in ISA firmware +const long Reg_Timer = 1; // Register 2 shadow +const unsigned short RegBitShift_Timer = 0; // Bit 0 +const unsigned short RegBitMask_Timer = 0xFFFF; // 16 bits + +const long RegISA_VBinning = 0x004; // Register 3 in ISA firmware +const long Reg_VBinning = 2; // Register 3 shadow +const unsigned short RegBitShift_Timer2 = 0; // Bit 0 +const unsigned short RegBitMask_Timer2 = 0xF; // 4 bits +const unsigned short RegBitShift_VBinning = 0x8; // Bit 8 +const unsigned short RegBitMask_VBinning = 0xFF; // 8 bits + +const long RegISA_AICCounter = 0x006; // Register 4 in ISA firmware +const long Reg_AICCounter = 3; // Register 4 shadow +const unsigned short RegBitShift_AICCounter = 0; // Bit 0 +const unsigned short RegBitMask_AICCounter = 0xFFF; // 12 bits +const unsigned short RegBitShift_Test2 = 0xC; // Bit 12 +const unsigned short RegBitMask_Test2 = 0xF; // 4 bits + +const long RegISA_TempSetPoint = 0x008; // Register 5 in ISA firmware +const long Reg_TempSetPoint = 4; // Register 5 shadow +const unsigned short RegBitShift_TempSetPoint = 0; // Bit 0 +const unsigned short RegBitMask_TempSetPoint = 0xFF;// 8 bits +const unsigned short RegBitShift_PortControl = 0x8; // Bit 8 +const unsigned short RegBitMask_PortControl = 0xFF; // 8 bits + +const long RegISA_PixelCounter = 0x00a; // Register 6 in ISA firmware +const long Reg_PixelCounter = 5; // Register 6 shadow +const unsigned short RegBitShift_PixelCounter = 0; // Bit 0 +const unsigned short RegBitMask_PixelCounter = 0xFFF; // 12 bits +const unsigned short RegBitShift_HBinning = 0xC; // Bit 12 +const unsigned short RegBitMask_HBinning = 0x7; // 3 bits +const unsigned short RegBit_LoopLock = 0x8000; // Bit 15 + +const long RegISA_LineCounter = 0x00c; // Register 7 in ISA firmware +const long Reg_LineCounter = 6; // Register 7 shadow +const unsigned short RegBitShift_LineCounter = 0; // Bit 0 +const unsigned short RegBitMask_LineCounter = 0xFFF; // 12 bits +const unsigned short RegBitShift_Mode = 0xC; // Bit 12 +const unsigned short RegBitMask_Mode = 0xF; // 4 bits + +const long RegISA_BICCounter = 0x00e; // Register 8 in ISA firmware +const long Reg_BICCounter = 7; // Register 8 shadow +const unsigned short RegBitShift_BICCounter = 0; // Bit 0 +const unsigned short RegBitMask_BICCounter = 0xFFF; // 12 bits +const unsigned short RegBitShift_Test = 0xC; // Bit 12 +const unsigned short RegBitMask_Test = 0xF; // 4 bits + +const long RegISA_ImageData = 0x000; // Register 9 in ISA firmware +const long Reg_ImageData = 8; // Register 9 +const unsigned short RegBitShift_ImageData = 0; // Bit 0 +const unsigned short RegBitMask_ImageData = 0xFFFF; // 16 bits + +const long RegISA_TempData = 0x002; // Register 10 in ISA firmware +const long Reg_TempData = 9; // Register 10 +const unsigned short RegBitShift_TempData = 0; // Bit 0 +const unsigned short RegBitMask_TempData = 0xFF; // 8 bits + +const long RegISA_Status = 0x006; // Register 11 in firmware +const long Reg_Status = 10; // Register 11 +const unsigned short RegBit_Exposing = 0x1; // Bit 0 +const unsigned short RegBit_LineDone = 0x2; // Bit 1 +const unsigned short RegBit_CacheReadOK = 0x4; // Bit 2 +const unsigned short RegBit_TempAtMin = 0x10; // Bit 4 +const unsigned short RegBit_TempAtMax = 0x20; // Bit 5 +const unsigned short RegBit_ShutdownComplete = 0x40;// Bit 6 +const unsigned short RegBit_TempAtSetPoint = 0x80; // Bit 7 +const unsigned short RegBit_GotTrigger = 0x400; // Bit 10 +const unsigned short RegBit_FrameDone = 0x800; // Bit 11 +const unsigned short RegBit_LoopbackTest = 0x8000; // Bit 15 + +const long RegISA_CommandReadback = 0x008; // Register 12 in ISA firmware +const long Reg_CommandReadback = 11; // Register 12 +// Use RegBit offsets from Reg_Command + +const long RegPCI_Command = 0x000; // Register 1 in PCI firmware +const long RegPCI_CommandRead = 0x020; +const long RegPCI_Timer = 0x004; // Register 2 in PCI firmware +const long RegPCI_TimerRead = 0x024; +const long RegPCI_VBinning = 0x008; // Register 3 in PCI firmware +const long RegPCI_VBinningRead = 0x028; +const long RegPCI_AICCounter = 0x00C; // Register 4 in PCI firmware +const long RegPCI_AICCounterRead = 0x02C; +const long RegPCI_TempSetPoint = 0x010; // Register 5 in PCI firmware +const long RegPCI_TempSetPointRead = 0x030; +const long RegPCI_PixelCounter = 0x014; // Register 6 in PCI firmware +const long RegPCI_PixelCounterRead = 0x034; +const long RegPCI_LineCounter = 0x018; // Register 7 in PCI firmware +const long RegPCI_LineCounterRead = 0x038; +const long RegPCI_BICCounter = 0x01C; // Register 8 in PCI firmware +const long RegPCI_BICCounterRead = 0x03C; +const long RegPCI_ImageData = 0x000; // Register 9 in PCI firmware +const long RegPCI_TempData = 0x004; // Register 10 in PCI firmware +const long RegPCI_Status = 0x00C; // Register 11 in firmware +const long RegPCI_CommandReadback = 0x010; // Register 12 in PCI firmware + + + +class CCameraIO +{ +public: + + CCameraIO(); + virtual ~CCameraIO(); + + //////////////////////////////////////////////////////////// + // Low level read write methods - Overridables + bool InitDriver(unsigned short camnum); + long ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer ); + long Write( unsigned short reg, unsigned short val ); + long Read( unsigned short reg, unsigned short& val ); + + //////////////////////////////////////////////////////////// + // Camera Settings + + Camera_Status read_Status(); // Current camera state + // <0: error codes + // 0: idle + // 1: flushing + // 2: waiting for trigger + // 3: exposing + // 4: reading + // 5: downloading + // 6: line ready + // 7: image ready + + bool read_Present(); // True if camera is present, false otherwise. + + bool read_Shutter(); // Current shutter state, true = open, false = closed. + void write_Shutter( bool val ); + + bool read_ForceShutterOpen(); // True: Forces shutter permanently open. False: allows + void write_ForceShutterOpen( bool val ); // normal shutter operation. + + bool read_LongCable(); // Long cable mode. + void write_LongCable( bool val ); + + short read_Mode(); // First four bits map to Mode bits used for + void write_Mode( short val ); // special functions or camera configurations. + + short read_TestBits(); // First four bits to Test bits used for + void write_TestBits( short val ); // troubleshooting. + + short read_Test2Bits(); // First four bits map to Test2 bits used for + void write_Test2Bits( short val ); // special functions or camera configurations. + + bool read_FastReadout(); // Fast readout mode (used for focusing). + void write_FastReadout( bool val ); // True means fast focus is on + + bool read_UseTrigger(); // Triggered exposure mode. + void write_UseTrigger( bool val ); // True means triggered exposure is on. + + bool m_HighPriority; // Bost thread priority level during download + + short m_PPRepeat; // Delay used on parallel port systems. + + short m_DataBits; // Digitization resolution, 8 - 18. + + bool m_FastShutter; // Capable of 0.001 sec exposure resolution + + bool m_GuiderRelays; // Capable of outputing autoguider signals + + short m_MaxBinX, m_MaxBinY; // Maximum binning factors + + double m_MaxExposure; // Maximum exposure length + double m_MinExposure; // Minimum exposure length + + double m_Timeout; // camera polling timeout value + + //////////////////////////////////////////////////////////// + // Cooler Settings + // N.B. DAC units = ( m_TempScale * CoolerSetPoint (deg. C ) ) + m_TempCalibration; + // N.B. Temperature (deg. C) = (DAC units - m_TempCalibration) / m_TempScale + + double read_CoolerSetPoint(); // Returns/sets setpoint temperature in degrees + void write_CoolerSetPoint( double val ); // Celcius. + + Camera_CoolerStatus read_CoolerStatus(); // Returns current cooler status + + Camera_CoolerMode read_CoolerMode(); // Returns/sets current cooler operation mode. + void write_CoolerMode( Camera_CoolerMode val ); + + double read_Temperature(); // Current temperature in degrees Celcius. + + bool m_TempControl; // Temperature can be externally controlled + short m_TempCalibration; // Temperature calibration factor. + double m_TempScale; // Temperature scaling factor. + + //////////////////////////////////////////////////////////// + // Exposure Settings + // The following variables are latched in Expose method, until next Reset or GetImage + + short m_BinX, m_BinY; // Horizontal and vertical binning. + short m_StartX, m_StartY; // Zero based subframe start position in unbinned pixels. + short m_NumX, m_NumY; // Subframe size in binned pixels. + + //////////////////////////////////////////////////////////// + // Geometry Settings + // The following variables are latched in Expose method, until next Reset or GetImage + + short m_Columns, m_Rows; // Total columns/rows on CCD (physical). + short m_ImgColumns, m_ImgRows; // Unbinned columns/rows in imaging area + short m_SkipC, m_SkipR; // Deleted data columns/rows not to be displayed or saved + short m_HFlush, m_VFlush; // Horizontal/Vertical flush binning. + short m_BIC, m_BIR; // Before Image Column/Row count (dark non-imaging pixels). + + //////////////////////////////////////////////////////////// + // CCD Settings + + char m_Sensor[ 256 ]; // Sensor model installed in camera (i.e. Sensor = SITe 502). + bool m_Color; // Sensor has color dyes + double m_Noise; // Read out noise in e-. + double m_Gain; // Gain in e-/ADU units. + double m_PixelXSize; // Size of pixel in X direction in micrometers. + double m_PixelYSize; // Size of pixel in Y direction in micrometers. + + //////////////////////////////////////////////////////////// + // System methods + + // Resets camera to idle state, will terminate current exposure. + void Reset(); + + // Mask user requested set of IRQS +// void MaskIrqs(); + + // Restore default IRQ mask +// void UnmaskIrqs(); + + // Starts flushing the camera (which should be the normal idle state) + // If Rows is non-negative, only the specified number of rows are flushed, + // in which case the method will return only when flushing is completed. + void Flush( short Rows = -1 ); + + // Output byte to auxillary output port (e.g. for driving guider relays). + void AuxOutput( unsigned char val ); + + // Write a 16 bit value to register 1 to 8. + void RegWrite( short reg, unsigned short val ); + + // Read a 16 bit value from register 9 to 12. + void RegRead( short reg, unsigned short& val ); + + // Move the filterwheel to the home position - failure indicates no filterwheel + //attached or broken filterwheel + bool FilterHome(); + + // Move filterwheel to the given slot + void FilterSet( short Slot ); + + //////////////////////////////////////////////////////////// + // Normal exposure methods + + // The Duration parameter is the exposure time in seconds. The Light parameter controls + // the status of the shutter during the exposure, Light = True opens the shutter, Light + // = False closes the shutter. Returns immediately after invocation, poll the CameraStatus + // property to determine the start time of a triggered exposure and the end of an exposure. + bool Expose( double Duration, bool Light ); + + // Returns the pImageData parameter which is a pointer to unsigned short data with NumX*NumY + // elements. Can be overridden if necessary + virtual bool GetImage( unsigned short* pImageData, short& xSize, short& ySize ); + + /*virtual bool BufferImage(char *bufferName );*/ + + //////////////////////////////////////////////////////////// + // Drift scan methods + + // Begins clocking and digitization of a single line of data begining with a vertical clock + // sequence and ending with a buffer full of line data. Poll the CameraStatus property to + // determine when the data is ready for download. + bool DigitizeLine(); + + // Returns the pLineData parameter which is a pointer to unsigned short data with NumX elements. + bool GetLine( unsigned short* pLineData, short& xSize ); + + /* TODO enable this back after removing some deps */ + /*bool BufferDriftScan(char *bufferName, int delay, int rowCount, int nblock , int npipe);*/ + + //////////////////////////////////////////////////////////// + // Easy to use methods + + // Combination of the Expose and GetImage methods. Blocks calling thread for duration + // of exposure and readout. + bool Snap( double Duration, bool Light, unsigned short* pImageData, short& xSize, short& ySize ); + +// Internal variables to keep track of things that can not be read from the firmware +// directly, or are a combination of firmware setting + + bool m_TDI; // Time drift integration mode + + bool m_WaitingforTrigger; // camera is waiting for external trigger + bool m_WaitingforImage; // camera is exposing and wiating for an to available + bool m_WaitingforLine; // camera is clocking and digitizing a row of data + + short m_RegisterOffset; // Offset from base address used in parallel port systems. + + short m_FilterPosition; // Current filter position + short m_FilterStepPos; // Current filter position in our internal array + + bool m_Shutter; // Last known shutter state + Camera_Status m_Status; // Last known camera status + + Camera_Interface m_Interface; // String acronyms may be used in INI file. + // 0 or ISA: Industry Standard Architecture bus + // 1 or PPI: Parallel Port Interface + // 2 or PCI: Peripheral Component Interface + + Camera_SensorType m_SensorType; // 0 or CCD: Charge Coupled Device + // 1 or CMOS: Complementary Metal-Oxide-Silicon + + Camera_CoolerStatus m_CoolerStatus; // Last known cooler status. + unsigned int m_IRQMask; // Set of IRQs masked on user request // 0: Off + // 1: Ramping to set point + // 2: Correcting + // 3: Ramping to ambient + // 4: At ambient + // 5: Max cooling limit + // 6: Min cooling limit + // 7: At set point + + // Latched public variables used during Exposure..GetImage sequence + short m_ExposureBinX, m_ExposureBinY; // Horizontal and vertical binning. + short m_ExposureStartX, m_ExposureStartY; // Subframe start position in unbinned pixels. + short m_ExposureNumX, m_ExposureNumY; // Subframe size in binned pixels. + short m_ExposureColumns, m_ExposureRows; // Total columns/rows on CCD (physical). + short m_ExposureSkipC, m_ExposureSkipR; // Deleted data columns/rows not to be displayed or saved to disk. + short m_ExposureHFlush, m_ExposureVFlush; // Horizontal/Vertical flush binning. + short m_ExposureBIC, m_ExposureBIR; // Before Image Column/Row count (dark non-imaging pixels). + unsigned short m_ExposureAIC; // Calculated After Image Column count (dark non-imaging pixels). + unsigned short m_ExposureRemainingLines; // Number of lines to be clocked out by GetImage + unsigned short m_ExposureAIR; // Number of lines to be flushed after GetImage + + //////////////////////////////////////////////////////////// + // Write register shadow variables + unsigned short m_RegShadow[ NumWriteRegisters ]; + + unsigned short m_FastShutterBits_Mode; // Mask to enable fast shutter mode + unsigned short m_FastShutterBits_Test; // Mask to enable fast shutter mode + + //////////////////////////////////////////////////////////// + // Internal helper routines + + void LoadLineCounter( unsigned short rows ); + void LoadColumnLayout( unsigned short aic, unsigned short bic, unsigned short pixels ); + void LoadTimerAndBinning( double Duration, unsigned short HBin, unsigned short VBin ); + + void StartFlushing(); + void StopFlushing(); + + void InitDefaults(); +#ifndef WITHPPI +long ReadImage(short unsigned int *); +long InternalReadLine(bool, long int, long int, unsigned short *); +#endif + +private: + unsigned short m_BaseAddressp2; + unsigned int saveIRQS; + int fileHandle; +#ifdef WITHPPI + inline void RegisterSelect( unsigned short reg ); + inline unsigned short INPW(); + inline void OUTPW( unsigned short val ); +#endif + +}; + +#endif // !defined(AFX_CAMERAIO_H__A2882C82_7CFB_11D4_9155_0060676644C1__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/CameraIO_LinuxISA.cpp b/kstars/kstars/indi/apogee/CameraIO_LinuxISA.cpp new file mode 100644 index 00000000..16a6bb72 --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_LinuxISA.cpp @@ -0,0 +1,319 @@ +// CameraIO.cpp: implementation of the CCameraIO class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#include <assert.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <string.h> +#include <sched.h> +#include <unistd.h> +#include <fcntl.h> +#include <stdio.h> +#define HANDLE int +#define FALSE 0 +#define DWORD long +#define _ASSERT assert +#define REALTIME_PRIORITY_CLASS 1 +#define GetCurrentProcess getpid +#define LOBYTE(x) ((x) & 0xff) +#define HIBYTE(x) ((x >> 8) & 0xff) + +#define MIRQ1 0x21 +#define MIRQ2 0xA1 + +#include "time.h" +//#include "tcl.h" +//#include "ccd.h" +#include "CameraIO_Linux.h" +#include "ApogeeLinux.h" + +const int NUM_POSITIONS = 6; +const int NUM_STEPS_PER_FILTER = 48; +const int STEP_DELAY = 10; + +const unsigned char Steps[] = { 0x10, 0x30, 0x20, 0x60, 0x40, 0xc0, 0x80, 0x90 }; +const int NUM_STEPS = sizeof ( Steps ); + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +void CCameraIO::InitDefaults() +{ + //////////////////////////////////////////////////////////// + // Camera Settings + + m_HighPriority = true; + m_PPRepeat = 1; + m_DataBits = 16; + m_FastShutter = false; + m_MaxBinX = 8; + m_MaxBinY = 63; + m_MaxExposure = 10485.75; + m_MinExposure = 0.01; + m_GuiderRelays = false; + m_Timeout = 2.0; + + //////////////////////////////////////////////////////////// + // Cooler Settings + + m_TempControl = true; + m_TempCalibration = 160; + m_TempScale = 2.1; + + //////////////////////////////////////////////////////////// + // Exposure Settings + + m_BinX = 1; + m_BinY = 1; + m_StartX = 0; + m_StartY = 0; + m_NumX = 1; + m_NumY = 1; + + //////////////////////////////////////////////////////////// + // Geometry Settings + + m_Columns = 0; + m_Rows = 0; + m_SkipC = 0; + m_SkipR = 0; + m_HFlush = 1; + m_VFlush = 1; + m_BIC = 4; + m_BIR = 4; + m_ImgColumns = 0; + m_ImgRows = 0; + + //////////////////////////////////////////////////////////// + // CCD Settings + + memset( m_Sensor, 0, 256 ); + m_Color = false; + m_Noise = 0.0; + m_Gain = 0.0; + m_PixelXSize = 0.0; + m_PixelYSize = 0.0; + + //////////////////////////////////////////////////////////// + // Internal variables + + fileHandle = 0; + m_RegisterOffset = 0; + m_Interface = Camera_Interface_ISA; + m_SensorType = Camera_SensorType_CCD; +} + + + +bool CCameraIO::InitDriver(unsigned short camnum) +{ + char deviceName[64]; + + sprintf(deviceName,"%s%d",APOGEE_ISA_DEVICE,camnum); + fileHandle = ::open(deviceName,O_RDONLY); + if (fileHandle == -1) return false; + return true; +} + +long CCameraIO::Write( unsigned short reg, unsigned short val ) +{ + int status; + + struct apIOparam request; + unsigned short realreg = ( reg << 1 ) & 0xE; // limit input to our address range + request.reg = realreg; + request.param1=(int)val; + status=ioctl(fileHandle,APISA_WRITE_USHORT,(unsigned long)&request); + return 0; +} + +long CCameraIO::Read( unsigned short reg, unsigned short& val ) +{ + unsigned short realreg; + int retval, status; + struct apIOparam request; + + switch ( reg ) + { + case Reg_ImageData: + realreg = RegISA_ImageData; + break; + case Reg_TempData: + realreg = RegISA_TempData; + break; + case Reg_Status: + realreg = RegISA_Status; + break; + case Reg_CommandReadback: + realreg = RegISA_CommandReadback; + break; + default: + assert( 1 ); // application program bug + val = 0; + return 0; + } + + request.reg = realreg; + request.param1=(unsigned long)&retval; + status=ioctl(fileHandle,APISA_READ_USHORT,(unsigned long)&request); + val = (unsigned short)retval; + return 0; +} + +// Returns 0 if successfull, 1 if Line_Done poll timed out. +long CCameraIO::ReadLine( long SkipPixels, long Pixels,unsigned short* pLineBuffer ) +{ + int j; + int retval, status; + struct apIOparam request; + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + } + + request.reg = RegISA_ImageData; + request.param1=(unsigned long)&retval; + + for (j = 0; j < SkipPixels; j++) + { + status=ioctl(fileHandle,APISA_READ_USHORT,(unsigned long)&request); + } + for (j = 0; j < Pixels; j++) + { + status=ioctl(fileHandle,APISA_READ_USHORT,(unsigned long)&request); + *pLineBuffer++ = (unsigned short)retval; + } + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Wait until camera is done + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + if ( clock() > StopTime ) return 1; // Timed out + } + } + + return 0; +} + + + +long CCameraIO::ReadImage( unsigned short* pImageBuffer ) +{ + m_RegShadow[ Reg_Command ] |= RegBit_FIFOCache; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + long XEnd = long( m_ExposureNumX ); + long SkipC = long( m_ExposureSkipC ); + for (long i = 0; i < m_ExposureSkipR; i++) + { + if( InternalReadLine( false, SkipC, XEnd, NULL ) ) return 1; + } + + long YEnd = long( m_ExposureNumY ); + unsigned short* pLineBuffer = pImageBuffer; + for (long i = 0; i < YEnd; i++) + { + if ( InternalReadLine( true, SkipC, XEnd, pLineBuffer ) ) return 1; + pLineBuffer += XEnd; + } + + m_RegShadow[ Reg_Command ] &= !RegBit_FIFOCache; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + return 0; +} + + + +// Returns 0 if successfull, 1 if Line_Done poll timed out. +long CCameraIO::InternalReadLine( bool KeepData, long SkipC, long XEnd, unsigned short* pLineBuffer ) +{ + struct apIOparam request; + int retval, status; + + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= !RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + request.reg = RegISA_ImageData; + request.param1=(unsigned long)&retval; + + for (long j = 0; j < SkipC; j++) + status=ioctl(fileHandle,APISA_READ_USHORT,(unsigned long)&request); + + if ( KeepData ) + { + for (long j = 0; j < XEnd; j++) { + status=ioctl(fileHandle,APISA_READ_USHORT,(unsigned long)&request); + *pLineBuffer++ = (unsigned short)retval; + } + } + else + { + for (long j = 0; j < XEnd; j++) + status=ioctl(fileHandle,APISA_READ_USHORT,(unsigned long)&request); + } + + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= !RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Wait until camera is done clocking + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + clock_t CurrentTime = clock(); + if ( CurrentTime > StopTime ) return 1; // Timed out + } + + return 0; +} + + + + + + + diff --git a/kstars/kstars/indi/apogee/CameraIO_LinuxPCI.cpp b/kstars/kstars/indi/apogee/CameraIO_LinuxPCI.cpp new file mode 100644 index 00000000..a83a594e --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_LinuxPCI.cpp @@ -0,0 +1,373 @@ +// CameraIO.cpp: implementation of the CCameraIO class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#include <assert.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <string.h> +#include <sched.h> +#include <unistd.h> +#include <fcntl.h> +#include <stdio.h> +#define HANDLE int +#define FALSE 0 +#define DWORD long +#define _ASSERT assert +#define REALTIME_PRIORITY_CLASS 1 +#define GetCurrentProcess getpid +#define LOBYTE(x) ((x) & 0xff) +#define HIBYTE(x) ((x >> 8) & 0xff) + +#define MIRQ1 0x21 +#define MIRQ2 0xA1 + +#include "time.h" +//#include "tcl.h" +//#include "ccd.h" +#include "CameraIO_Linux.h" +#include "ApogeeLinux.h" + +const int NUM_POSITIONS = 6; +const int NUM_STEPS_PER_FILTER = 48; +const int STEP_DELAY = 10; + +const unsigned char Steps[] = { 0x10, 0x30, 0x20, 0x60, 0x40, 0xc0, 0x80, 0x90 }; +const int NUM_STEPS = sizeof ( Steps ); + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +void CCameraIO::InitDefaults() +{ + //////////////////////////////////////////////////////////// + // Camera Settings + + m_HighPriority = true; + m_PPRepeat = 1; + m_DataBits = 16; + m_FastShutter = false; + m_MaxBinX = 8; + m_MaxBinY = 63; + m_MaxExposure = 10485.75; + m_MinExposure = 0.01; + m_GuiderRelays = false; + m_Timeout = 2.0; + + //////////////////////////////////////////////////////////// + // Cooler Settings + + m_TempControl = true; + m_TempCalibration = 160; + m_TempScale = 2.1; + + //////////////////////////////////////////////////////////// + // Exposure Settings + + m_BinX = 1; + m_BinY = 1; + m_StartX = 0; + m_StartY = 0; + m_NumX = 1; + m_NumY = 1; + + //////////////////////////////////////////////////////////// + // Geometry Settings + + m_Columns = 0; + m_Rows = 0; + m_SkipC = 0; + m_SkipR = 0; + m_HFlush = 1; + m_VFlush = 1; + m_BIC = 4; + m_BIR = 4; + m_ImgColumns = 0; + m_ImgRows = 0; + + //////////////////////////////////////////////////////////// + // CCD Settings + + memset( m_Sensor, 0, 256 ); + m_Color = false; + m_Noise = 0.0; + m_Gain = 0.0; + m_PixelXSize = 0.0; + m_PixelYSize = 0.0; + + //////////////////////////////////////////////////////////// + // Internal variables + + fileHandle = 0; + m_RegisterOffset = 0; + m_Interface = Camera_Interface_PCI; + m_SensorType = Camera_SensorType_CCD; +} + + + +bool CCameraIO::InitDriver(unsigned short camnum) +{ + char deviceName[64]; + + sprintf(deviceName,"%s%d",APOGEE_PCI_DEVICE,camnum); + fileHandle = ::open(deviceName,O_RDONLY); + if (fileHandle == -1) return false; + return true; +} + +long CCameraIO::Write( unsigned short reg, unsigned short val ) +{ + int status; + unsigned short RegNumber; + struct apIOparam request; + + switch ( reg ) + { + case Reg_Command: + RegNumber = RegPCI_Command; + break; + case Reg_Timer: + RegNumber = RegPCI_Timer; + break; + case Reg_VBinning: + RegNumber = RegPCI_VBinning; + break; + case Reg_AICCounter: + RegNumber = RegPCI_AICCounter; + break; + case Reg_TempSetPoint: + RegNumber = RegPCI_TempSetPoint; + break; + case Reg_PixelCounter: + RegNumber = RegPCI_PixelCounter; + break; + case Reg_LineCounter: + RegNumber = RegPCI_LineCounter; + break; + case Reg_BICCounter: + RegNumber = RegPCI_BICCounter; + break; + default: + _ASSERT ( false ); + return 0; + } + request.reg = RegNumber; + request.param1=(int)val; + status=ioctl(fileHandle,APPCI_WRITE_USHORT,(unsigned long)&request); + return 0; +} + +long CCameraIO::Read( unsigned short reg, unsigned short& val ) +{ + int retval, status; + struct apIOparam request; + unsigned short RegNumber; + + switch ( reg ) + { + case Reg_Command: + RegNumber = RegPCI_CommandRead; + break; + case Reg_Timer: + RegNumber = RegPCI_TimerRead; + break; + case Reg_VBinning: + RegNumber = RegPCI_VBinningRead; + break; + case Reg_AICCounter: + RegNumber = RegPCI_AICCounterRead; + break; + case Reg_TempSetPoint: + RegNumber = RegPCI_TempSetPointRead; + break; + case Reg_PixelCounter: + RegNumber = RegPCI_PixelCounterRead; + break; + case Reg_LineCounter: + RegNumber = RegPCI_LineCounterRead; + break; + case Reg_BICCounter: + RegNumber = RegPCI_BICCounterRead; + break; + case Reg_ImageData: + RegNumber = RegPCI_ImageData; + break; + case Reg_TempData: + RegNumber = RegPCI_TempData; + break; + case Reg_Status: + RegNumber = RegPCI_Status; + break; + case Reg_CommandReadback: + RegNumber = RegPCI_CommandReadback; + break; + default: + assert( 1 ); // application program bug + val = 0; + return 0; + } + + request.reg = RegNumber; + request.param1=(unsigned long)&retval; + status=ioctl(fileHandle,APPCI_READ_USHORT,(unsigned long)&request); + val = (unsigned short)retval; + return 0; +} + +// Returns 0 if successfull, 1 if Line_Done poll timed out. +long CCameraIO::ReadLine( long SkipPixels, long Pixels,unsigned short* pLineBuffer ) +{ + int j; + int retval, status; + struct apIOparam request; + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + } + + request.reg = RegPCI_ImageData; + request.param1=(unsigned long)&retval; + + for (j = 0; j < SkipPixels; j++) + { + status=ioctl(fileHandle,APPCI_READ_USHORT,(unsigned long)&request); + } + for (j = 0; j < Pixels; j++) + { + status=ioctl(fileHandle,APPCI_READ_USHORT,(unsigned long)&request); + *pLineBuffer++ = (unsigned short)retval; + } + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Wait until camera is done + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + if ( clock() > StopTime ) return 1; // Timed out + } + } + + return 0; +} + + + +long CCameraIO::ReadImage( unsigned short* pImageBuffer ) +{ + m_RegShadow[ Reg_Command ] |= RegBit_FIFOCache; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + long XEnd = long( m_ExposureNumX ); + long SkipC = long( m_ExposureSkipC ); + for (long i = 0; i < m_ExposureSkipR; i++) + { + if( InternalReadLine( false, SkipC, XEnd, NULL ) ) return 1; + } + + long YEnd = long( m_ExposureNumY ); + unsigned short* pLineBuffer = pImageBuffer; + for (long i = 0; i < YEnd; i++) + { + if ( InternalReadLine( true, SkipC, XEnd, pLineBuffer ) ) return 1; + pLineBuffer += XEnd; + } + + m_RegShadow[ Reg_Command ] &= !RegBit_FIFOCache; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + return 0; +} + + + +// Returns 0 if successfull, 1 if Line_Done poll timed out. +long CCameraIO::InternalReadLine( bool KeepData, long SkipC, long XEnd, unsigned short* pLineBuffer ) +{ + struct apIOparam request; + int retval, status; + + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= !RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + request.reg = RegPCI_ImageData; + request.param1=(unsigned long)&retval; + + for (long j = 0; j < SkipC; j++) + status=ioctl(fileHandle,APPCI_READ_USHORT,(unsigned long)&request); + + if ( KeepData ) + { + for (long j = 0; j < XEnd; j++) { + status=ioctl(fileHandle,APPCI_READ_USHORT,(unsigned long)&request); + *pLineBuffer++ = (unsigned short)retval; + } + } + else + { + for (long j = 0; j < XEnd; j++) + status=ioctl(fileHandle,APPCI_READ_USHORT,(unsigned long)&request); + } + + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= !RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Wait until camera is done clocking + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + clock_t CurrentTime = clock(); + if ( CurrentTime > StopTime ) return 1; // Timed out + } + + return 0; +} + + + + + + + diff --git a/kstars/kstars/indi/apogee/CameraIO_LinuxPPI.cpp b/kstars/kstars/indi/apogee/CameraIO_LinuxPPI.cpp new file mode 100644 index 00000000..7025d9ce --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_LinuxPPI.cpp @@ -0,0 +1,325 @@ +// CameraIO.cpp: implementation of the CCameraIO class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#include <assert.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <string.h> +#include <sched.h> +#include <unistd.h> +#include <fcntl.h> +#include <stdio.h> +#define HANDLE int +#define FALSE 0 +#define DWORD long +#define _ASSERT assert +#define REALTIME_PRIORITY_CLASS 1 +#define GetCurrentProcess getpid +#define LOBYTE(x) ((x) & 0xff) +#define HIBYTE(x) ((x >> 8) & 0xff) + +#define MIRQ1 0x21 +#define MIRQ2 0xA1 + +#include "time.h" +//#include "tcl.h" +//#include "ccd.h" + +#include "CameraIO_Linux.h" +#include "ApogeeLinux.h" + +const int NUM_POSITIONS = 6; +const int NUM_STEPS_PER_FILTER = 48; +const int STEP_DELAY = 10; + +const unsigned char Steps[] = { 0x10, 0x30, 0x20, 0x60, 0x40, 0xc0, 0x80, 0x90 }; +const int NUM_STEPS = sizeof ( Steps ); + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +void CCameraIO::InitDefaults() +{ + //////////////////////////////////////////////////////////// + // Camera Settings + + m_HighPriority = true; + m_PPRepeat = 1; + m_DataBits = 16; + m_FastShutter = false; + m_MaxBinX = 8; + m_MaxBinY = 63; + m_MaxExposure = 10485.75; + m_MinExposure = 0.01; + m_GuiderRelays = false; + m_Timeout = 2.0; + + //////////////////////////////////////////////////////////// + // Cooler Settings + + m_TempControl = true; + m_TempCalibration = 160; + m_TempScale = 2.1; + + //////////////////////////////////////////////////////////// + // Exposure Settings + + m_BinX = 1; + m_BinY = 1; + m_StartX = 0; + m_StartY = 0; + m_NumX = 1; + m_NumY = 1; + + //////////////////////////////////////////////////////////// + // Geometry Settings + + m_Columns = 0; + m_Rows = 0; + m_SkipC = 0; + m_SkipR = 0; + m_HFlush = 1; + m_VFlush = 1; + m_BIC = 4; + m_BIR = 4; + m_ImgColumns = 0; + m_ImgRows = 0; + + //////////////////////////////////////////////////////////// + // CCD Settings + + memset( m_Sensor, 0, 256 ); + m_Color = false; + m_Noise = 0.0; + m_Gain = 0.0; + m_PixelXSize = 0.0; + m_PixelYSize = 0.0; + + //////////////////////////////////////////////////////////// + // Internal variables + + fileHandle = 0; + m_RegisterOffset = 0; + m_Interface = Camera_Interface_PPI; + m_SensorType = Camera_SensorType_CCD; +} + + + +bool CCameraIO::InitDriver(unsigned short camnum) +{ + char deviceName[64]; + + sprintf(deviceName,"%s%d",APOGEE_PPI_DEVICE,camnum); + fileHandle = ::open(deviceName,O_RDONLY); + if (fileHandle == -1) return false; + return true; +} + +long CCameraIO::Write( unsigned short reg, unsigned short val ) +{ + int status; + + struct apIOparam request; + unsigned short realreg = ( reg << 1 ) & 0xE; // limit input to our address range + request.reg = realreg; + request.param1=(int)val; + request.param2=(int)m_PPRepeat; + status=ioctl(fileHandle,APPPI_WRITE_USHORT,(unsigned long)&request); + return 0; +} + +long CCameraIO::Read( unsigned short reg, unsigned short& val ) +{ + unsigned short realreg; + int retval, status; + struct apIOparam request; + + switch ( reg ) + { + case Reg_ImageData: + realreg = RegISA_ImageData; + break; + case Reg_TempData: + realreg = RegISA_TempData; + break; + case Reg_Status: + realreg = RegISA_Status; + break; + case Reg_CommandReadback: + realreg = RegISA_CommandReadback; + break; + default: + assert( 1 ); // application program bug + val = 0; + return 0; + } + + request.reg = realreg; + request.param1=(unsigned long)&retval; + request.param2=(int)m_PPRepeat; + status=ioctl(fileHandle,APPPI_READ_USHORT,(unsigned long)&request); + val = (unsigned short)retval; + return 0; +} + +// Returns 0 if successfull, 1 if Line_Done poll timed out. +long CCameraIO::ReadLine( long SkipPixels, long Pixels,unsigned short* pLineBuffer ) +{ + int j; + int retval, status; + struct apIOparam request; + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + } + + request.reg = RegISA_ImageData; + request.param1=(unsigned long)&retval; + request.param2=(int)m_PPRepeat; + + for (j = 0; j < SkipPixels; j++) + { + status=ioctl(fileHandle,APPPI_READ_USHORT,(unsigned long)&request); + } + for (j = 0; j < Pixels; j++) + { + status=ioctl(fileHandle,APPPI_READ_USHORT,(unsigned long)&request); + *pLineBuffer++ = (unsigned short)retval; + } + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Wait until camera is done + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + if ( clock() > StopTime ) return 1; // Timed out + } + } + + return 0; +} + + + +long CCameraIO::ReadImage( unsigned short* pImageBuffer ) +{ + m_RegShadow[ Reg_Command ] |= RegBit_FIFOCache; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + long XEnd = long( m_ExposureNumX ); + long SkipC = long( m_ExposureSkipC ); + for (long i = 0; i < m_ExposureSkipR; i++) + { + if( InternalReadLine( false, SkipC, XEnd, NULL ) ) return 1; + } + + long YEnd = long( m_ExposureNumY ); + unsigned short* pLineBuffer = pImageBuffer; + for (long i = 0; i < YEnd; i++) + { + if ( InternalReadLine( true, SkipC, XEnd, pLineBuffer ) ) return 1; + pLineBuffer += XEnd; + } + + m_RegShadow[ Reg_Command ] &= !RegBit_FIFOCache; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + return 0; +} + + + +// Returns 0 if successfull, 1 if Line_Done poll timed out. +long CCameraIO::InternalReadLine( bool KeepData, long SkipC, long XEnd, unsigned short* pLineBuffer ) +{ + struct apIOparam request; + int retval, status; + + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= !RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + request.reg = RegISA_ImageData; + request.param1=(unsigned long)&retval; + request.param2=(int)m_PPRepeat; + + + for (long j = 0; j < SkipC; j++) + status=ioctl(fileHandle,APPPI_READ_USHORT,(unsigned long)&request); + + if ( KeepData ) + { + for (long j = 0; j < XEnd; j++) { + status=ioctl(fileHandle,APPPI_READ_USHORT,(unsigned long)&request); + *pLineBuffer++ = (unsigned short)retval; + } + } + else + { + for (long j = 0; j < XEnd; j++) + status=ioctl(fileHandle,APPPI_READ_USHORT,(unsigned long)&request); + } + + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= !RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + ///////////////////////////////////// + // Wait until camera is done clocking + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + clock_t CurrentTime = clock(); + if ( CurrentTime > StopTime ) return 1; // Timed out + } + + return 0; +} + + + + + + + diff --git a/kstars/kstars/indi/apogee/CameraIO_PCI.cpp b/kstars/kstars/indi/apogee/CameraIO_PCI.cpp new file mode 100644 index 00000000..3e6cc43e --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_PCI.cpp @@ -0,0 +1,405 @@ +// CameraIO_PCI.cpp: implementation of the CCameraIO_PCI class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include <winioctl.h> + +#include "ApogeeLinux.h" // This defines the IOCTL constants. +#include "CameraIO_PCI.h" +#include "time.h" + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CCameraIO_PCI::CCameraIO_PCI() +{ + m_IsWDM = false; + m_hDriver = NULL; +} + +CCameraIO_PCI::~CCameraIO_PCI() +{ + CloseDriver(); +} + +long CCameraIO_PCI::Read(unsigned short reg, unsigned short& val) +{ + BOOLEAN IoctlResult; + ULONG ReturnedLength; + USHORT RegNumber; + USHORT ReadBuffer; + + switch ( reg ) + { + case Reg_Command: + RegNumber = RegPCI_CommandRead; + break; + case Reg_Timer: + RegNumber = RegPCI_TimerRead; + break; + case Reg_VBinning: + RegNumber = RegPCI_VBinningRead; + break; + case Reg_AICCounter: + RegNumber = RegPCI_AICCounterRead; + break; + case Reg_TempSetPoint: + RegNumber = RegPCI_TempSetPointRead; + break; + case Reg_PixelCounter: + RegNumber = RegPCI_PixelCounterRead; + break; + case Reg_LineCounter: + RegNumber = RegPCI_LineCounterRead; + break; + case Reg_BICCounter: + RegNumber = RegPCI_BICCounterRead; + break; + case Reg_ImageData: + RegNumber = RegPCI_ImageData; + break; + case Reg_TempData: + RegNumber = RegPCI_TempData; + break; + case Reg_Status: + RegNumber = RegPCI_Status; + break; + case Reg_CommandReadback: + RegNumber = RegPCI_CommandReadback; + break; + default: + _ASSERT( FALSE ); // Application program bug + val = 0; + return 0; + } + + if ( m_IsWDM ) + { + IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_WDM_READ_PCI_USHORT, // IO Control code for Read + &RegNumber, // Buffer to driver. + sizeof(RegNumber), // Length of buffer in bytes. + &ReadBuffer, // Buffer from driver. + sizeof(ReadBuffer), // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in DataBuffer. + NULL // NULL means wait till op. completes. + ); + } + else + { + IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_GPD_READ_PCI_USHORT, // IO Control code for Read + &RegNumber, // Buffer to driver. + sizeof(RegNumber), // Length of buffer in bytes. + &ReadBuffer, // Buffer from driver. + sizeof(ReadBuffer), // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in DataBuffer. + NULL // NULL means wait till op. completes. + ); + } + + if ( (ReturnedLength != 2) || (IoctlResult == FALSE) ) + { + return 1; + } + + val = ReadBuffer; + + return 0; +} + +long CCameraIO_PCI::Write(unsigned short reg, unsigned short val) +{ + BOOLEAN IoctlResult; + ULONG InBuffer[2]; + ULONG ReturnedLength; + USHORT RegNumber; + + switch ( reg ) + { + case Reg_Command: + RegNumber = RegPCI_Command; + break; + case Reg_Timer: + RegNumber = RegPCI_Timer; + break; + case Reg_VBinning: + RegNumber = RegPCI_VBinning; + break; + case Reg_AICCounter: + RegNumber = RegPCI_AICCounter; + break; + case Reg_TempSetPoint: + RegNumber = RegPCI_TempSetPoint; + break; + case Reg_PixelCounter: + RegNumber = RegPCI_PixelCounter; + break; + case Reg_LineCounter: + RegNumber = RegPCI_LineCounter; + break; + case Reg_BICCounter: + RegNumber = RegPCI_BICCounter; + break; + default: + _ASSERT ( false ); + return 0; + } + + InBuffer[0] = RegNumber; + InBuffer[1] = val; + + // Do an I/O write + if ( m_IsWDM ) + { + IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_WDM_WRITE_PCI_USHORT, // IO Control code for Write + &InBuffer, // Buffer to driver. Holds register/data. + sizeof ( InBuffer ), // Length of buffer in bytes. + NULL, // Buffer from driver. Not used. + 0, // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in outbuf. Should be 0. + NULL // NULL means wait till I/O completes. + ); + } + else + { + IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_GPD_WRITE_PCI_USHORT, // IO Control code for Write + &InBuffer, // Buffer to driver. Holds register/data. + sizeof ( InBuffer ), // Length of buffer in bytes. + NULL, // Buffer from driver. Not used. + 0, // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in outbuf. Should be 0. + NULL // NULL means wait till I/O completes. + ); + } + + if ( (IoctlResult == FALSE) || (ReturnedLength != 0) ) + { + return 1; + } + + return 0; + +} + +long CCameraIO_PCI::ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer ) +{ + BOOLEAN IoctlResult; + ULONG InBuffer[3]; + ULONG ReturnedLength; // Number of bytes returned in output buffer + ULONG NumBytes; + USHORT* DataBuffer; + + InBuffer[0] = RegPCI_ImageData; + InBuffer[1] = SkipPixels; // Data points to skip + InBuffer[2] = Pixels; // Data points to keep + + NumBytes = Pixels * sizeof( unsigned short ); + DataBuffer = pLineBuffer; + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Clock out the line + m_RegShadow[ Reg_Command ] |= RegBit_StartNextLine; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_StartNextLine; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + } + + if ( m_IsWDM ) + { + IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_WDM_READ_PCI_LINE, // IO Control code for Read line + &InBuffer, // Buffer to driver. + sizeof(InBuffer), // Length of buffer in bytes. + DataBuffer, // Buffer from driver. + NumBytes, // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in DataBuffer. + NULL // NULL means wait till op. completes. + ); + } + else + { + IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_GPD_READ_PCI_LINE, // IO Control code for Read line + &InBuffer, // Buffer to driver. + sizeof(InBuffer), // Length of buffer in bytes. + DataBuffer, // Buffer from driver. + NumBytes, // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in DataBuffer. + NULL // NULL means wait till op. completes. + ); + } + + if ( (ReturnedLength != NumBytes) || (!IoctlResult) ) + { + return 1; // Failed to get line info + } + + ///////////////////////////////////// + // Assert done reading line + m_RegShadow[ Reg_Command ] |= RegBit_DoneReading; // set bit to 1 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + + m_RegShadow[ Reg_Command ] &= ~RegBit_DoneReading; // set bit to 0 + Write( Reg_Command, m_RegShadow[ Reg_Command ] ); + ///////////////////////////////////// + + if ( !m_TDI ) + { + ///////////////////////////////////// + // Wait until camera is done + clock_t StopTime = clock() + CLOCKS_PER_SEC; // wait at most one second + while ( true ) + { + unsigned short val = 0; + Read( Reg_Status, val ); + if ( ( val & RegBit_LineDone ) != 0 ) break;// Line done + + if ( clock() > StopTime ) return 1; // Timed out + } + } + + return 0; +} + +bool CCameraIO_PCI::InitDriver() +{ + OSVERSIONINFO OSVerInfo; + BOOLEAN IsPostWin98OS; + BOOLEAN IsNT4OS; + BOOLEAN IsPostNT4OS; + + IsPostWin98OS = false; + IsNT4OS = false; + IsPostNT4OS = false; + + CloseDriver(); + + OSVerInfo.dwOSVersionInfoSize = sizeof ( OSVERSIONINFO ); + GetVersionEx( &OSVerInfo ); + + // Check for Win9x versions. Pre-Win98 is unsupported. + if ( OSVerInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + { + // Check for pre-Win98 + if (( OSVerInfo.dwMajorVersion < 4 ) || + (( OSVerInfo.dwMajorVersion == 4 ) && ( OSVerInfo.dwMinorVersion == 0 ))) + { + return false; // Pre-Win98 not supported + } + else + { + IsPostWin98OS = true; + } + + } + else if ( OSVerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) + { + // Check if NT4 + if ( OSVerInfo.dwMajorVersion < 4 ) + { + // NT3.51 is not supported. Right?? + return false; + } + else if (OSVerInfo.dwMajorVersion == 4 ) + { + IsNT4OS = true; + } + else if (OSVerInfo.dwMajorVersion > 4 ) + { + IsPostNT4OS = true; + } + } + + if ( IsNT4OS ) + { + ULONG ReturnedLength; + ULONG DataBuffer[2]; + + // Open the driver + m_hDriver = CreateFile( + "\\\\.\\ApogeeIO", + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_WRITE | FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + 0, + NULL); + + if ( m_hDriver == INVALID_HANDLE_VALUE ) + { + m_hDriver = NULL; + return false; + } + + BOOL IoctlResult = DeviceIoControl( + m_hDriver, // Handle to device + IOCTL_PCI_BUS_SCAN, // IO Control code for PCI Bus Scan + NULL, // Buffer to driver. + 0, // Length of buffer in bytes. + DataBuffer, // Buffer from driver. + sizeof( DataBuffer ), // Length of buffer in bytes. + &ReturnedLength, // Bytes placed in DataBuffer. + NULL // NULL means wait till op. completes. + ); + + if ( (!IoctlResult) || (ReturnedLength != sizeof(DataBuffer)) ) + { + return false; + } + } + else if ( IsPostWin98OS || IsPostNT4OS ) + { + // Should be okay to use the WDM driver. Note that the kernel + // driver will actually check to see if WDM services are available + + // Open the driver + m_hDriver = CreateFile( + "\\\\.\\ApPCI", + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_WRITE | FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + 0, + NULL + ); + + if ( m_hDriver == INVALID_HANDLE_VALUE ) + { + m_hDriver = NULL; + return false; + } + + // Safe to assume we're using the WDM driver at this point. + m_IsWDM = true; + } + + return true; +} + +void CCameraIO_PCI::CloseDriver() +{ + // Close the driver if it already exists + if ( m_hDriver != NULL ) + { + CloseHandle ( m_hDriver ); + } + + m_hDriver = NULL; +} diff --git a/kstars/kstars/indi/apogee/CameraIO_PCI.h b/kstars/kstars/indi/apogee/CameraIO_PCI.h new file mode 100644 index 00000000..c1b4adf4 --- /dev/null +++ b/kstars/kstars/indi/apogee/CameraIO_PCI.h @@ -0,0 +1,35 @@ +// CameraIO_PCI.h: interface for the CCameraIO_PCI class. +// +// Copyright (c) 2000 Apogee Instruments Inc. +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_CAMERAIO_PCI_H__0F583058_8596_11D4_915F_0060676644C1__INCLUDED_) +#define AFX_CAMERAIO_PCI_H__0F583058_8596_11D4_915F_0060676644C1__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "CameraIO.h" + +class CCameraIO_PCI : public CCameraIO +{ +public: + + CCameraIO_PCI(); + virtual ~CCameraIO_PCI(); + + bool InitDriver(); + long ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer ); + long Write( unsigned short reg, unsigned short val ); + long Read( unsigned short reg, unsigned short& val ); + +private: + + BOOLEAN m_IsWDM; + HANDLE m_hDriver; + + void CloseDriver(); +}; + +#endif // !defined(AFX_CAMERAIO_PCI_H__0F583058_8596_11D4_915F_0060676644C1__INCLUDED_) diff --git a/kstars/kstars/indi/apogee/Camera_Example.cpp b/kstars/kstars/indi/apogee/Camera_Example.cpp new file mode 100644 index 00000000..f1f64121 --- /dev/null +++ b/kstars/kstars/indi/apogee/Camera_Example.cpp @@ -0,0 +1,631 @@ +// Example source code for implementing the CCameraIO object + +#include "windows.h" +#include "stdio.h" + +#include "CameraIO.h" +#include "CameraIO_ISA_9x.h" +#include "CameraIO_PPI_9x.h" + +#include "CameraIO_ISA_NT.h" +#include "CameraIO_PPI_NT.h" + +#include "CameraIO_PCI.h" + + +// Error codes returned from config_load +const long CCD_OPEN_NOERR = 0; // No error detected +const long CCD_OPEN_CFGNAME = 1; // No config file specified +const long CCD_OPEN_CFGDATA = 2; // Config missing or missing required data +const long CCD_OPEN_LOOPTST = 3; // Loopback test failed, no camera found +const long CCD_OPEN_ALLOC = 4; // Memory alloc failed - system error +const long CCD_OPEN_NTIO = 5; // NT I/O driver not present + +CCameraIO* cam; // the Camera interface object + +// Function declarations for this file +int InitCam( char* cfgname ); +long config_load( char* cfgname, short BaseAddress, short RegOffset ); +bool CfgGet ( FILE* inifp, + char* inisect, + char* iniparm, + char* retbuff, + short bufflen, + short* parmlen); + +unsigned short hextoi(char* instr); +void trimstr(char* s); + +// Initializes the CameraIO object from an INI file specified by cfgname +int InitCam( char* cfgname ) +{ + long ret = config_load( cfgname, -1, -1 ); + if ( ret == 0 ) + { + // We can now access the cam objects members + cam->Flush(); // Start the camera flushing + return 0; + } + else + { + switch ( ret ) + { + case CCD_OPEN_CFGNAME: + // "No config file specified." + break; + case CCD_OPEN_CFGDATA: + // "Config file missing or missing required data." + break; + case CCD_OPEN_LOOPTST: + // "Loopback test failed, no camera found" + break; + case CCD_OPEN_ALLOC: + // "Memory allocation failed - system error" + break; + case CCD_OPEN_NTIO: + // "NT I/O driver not present" + break; + } + return ret; + } +} + +// Convert a string to a decimal or hexadecimal integer +unsigned short hextoi(char *instr) +{ + unsigned short val, tot = 0; + bool IsHEX = false; + + long n = strlen( instr ); + if ( n > 1 ) + { // Look for hex format e.g. 8Fh, A3H or 0x5D + if ( instr[ n - 1 ] == 'h' || instr[ n - 1 ] == 'H' ) + IsHEX = true; + else if ( *instr == '0' && *(instr+1) == 'x' ) + { + IsHEX = true; + instr += 2; + } + } + + if ( IsHEX ) + { + while (instr && *instr && isxdigit(*instr)) + { + val = *instr++ - '0'; + if (9 < val) + val -= 7; + tot <<= 4; + tot |= (val & 0x0f); + } + } + else + tot = atoi( instr ); + + return tot; +} + +// Trim trailing spaces from a string +void trimstr(char *s) +{ + char *p; + + p = s + (strlen(s) - 1); + while (isspace(*p)) + p--; + *(++p) = '\0'; +} + + +//------------------------------------------------------------- +// CfgGet +// +// Retrieve a parameter from an INI file. Returns a status code +// and the paramter string in retbuff. +//------------------------------------------------------------- +bool CfgGet ( FILE* inifp, + char *inisect, + char *iniparm, + char *retbuff, + short bufflen, + short *parmlen) +{ + short gotsect; + char tbuf[256]; + char *ss, *eq, *ps, *vs, *ptr; + + rewind( inifp ); + + // find the target section + + gotsect = 0; + while (fgets(tbuf,256,inifp) != NULL) { + if ((ss = strchr(tbuf,'[')) != NULL) { + if (strnicmp(ss+1,inisect,strlen(inisect)) == 0) { + gotsect = 1; + break; + } + } + } + + if (!gotsect) { // section not found + return false; + } + + while (fgets(tbuf,256,inifp) != NULL) { // find parameter in sect + + if ((ptr = strrchr(tbuf,'\n')) != NULL) // remove newline if there + *ptr = '\0'; + + ps = tbuf+strspn(tbuf," \t"); // find the first non-blank + + if (*ps == ';') // Skip line if comment + continue; + + if (*ps == '[') { // Start of next section + return false; + } + + eq = strchr(ps,'='); // Find '=' sign in string + + if (eq) + vs = eq + 1 + strspn(eq+1," \t"); // Find start of value str + else + continue; + + // found the target parameter + + if (strnicmp(ps,iniparm,strlen(iniparm)) == 0) { + + if ((ptr = strchr(vs,';')) != NULL) // cut off an EOL comment + *ptr = '\0'; + + if (short(strlen(vs)) > bufflen - 1) {// not enough buffer space + strncpy(retbuff,vs,bufflen - 1); + retbuff[bufflen - 1] = '\0'; // put EOL in string + *parmlen = bufflen; + return true; + } + else { + strcpy(retbuff,vs); // got it + trimstr(retbuff); // trim any trailing blanks + *parmlen = strlen(retbuff); + return true; + } + } + } + + return false; // parameter not found +} + +// Initializes internal variables to their default value and reads the parameters in the +// specified INI file. Then initializes the camera using current settings. If BaseAddress +// or RegOffset parameters are specified (not equal to -1) then one or both of these +// values are used for the m_BaseAddress and m_RegisterOffset properties overriding those +// settings in the INI file. +long config_load( char* cfgname, short BaseAddress, short RegOffset ) +{ + short plen; + char retbuf[256]; + + if ((strlen(cfgname) == 0) || (cfgname[0] == '\0')) return CCD_OPEN_CFGNAME; + + // attempt to open INI file + FILE* inifp = NULL; + + if ((inifp = fopen(cfgname,"r")) == NULL) return CCD_OPEN_CFGDATA; + + // Check whether we are on an NT platform + OSVERSIONINFO VersionInfo; + memset(&VersionInfo, 0, sizeof(OSVERSIONINFO)); + VersionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + GetVersionEx ( &VersionInfo ); + bool IsNT = VersionInfo.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS; + + // System + if (CfgGet (inifp, "system", "interface", retbuf, sizeof(retbuf), &plen)) + { + // Assume cam is currently null + if ( stricmp( "isa", retbuf ) == 0 ) + { + if ( IsNT ) + cam = new CCameraIO_ISA_NT; + else + cam = new CCameraIO_ISA_9x; + } + else if ( stricmp( "ppi", retbuf ) == 0 ) + { + if ( IsNT ) + cam = new CCameraIO_PPI_NT; + else + cam = new CCameraIO_PPI_9x; + } + else if ( stricmp( "pci", retbuf ) == 0 ) + { + cam = new CCameraIO_PCI; + } + + if ( cam == NULL ) + { + fclose( inifp ); + return CCD_OPEN_ALLOC; + } + } + else + { + fclose( inifp ); + return CCD_OPEN_CFGDATA; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Settings which are stored in a class member (not in firmware) are already set + // to a default value in the constructor. Settings accessed by get/put functions + // must be set to a default value in this routine, after the base address and + // communication protocal is setup. + + ///////////////////////////////////////////////////////////////////////////////// + // These settings must done first since they affect communication with the camera + + if ( BaseAddress == -1 ) + { + if (CfgGet (inifp, "system", "base", retbuf, sizeof(retbuf), &plen)) + cam->m_BaseAddress = hextoi(retbuf) & 0xFFF; + else + { + fclose( inifp ); + delete cam; + cam = NULL; + return CCD_OPEN_CFGDATA; // base address MUST be defined + } + } + else + cam->m_BaseAddress = BaseAddress & 0xFFF; + + if ( RegOffset == -1 ) + { + if (CfgGet (inifp, "system", "reg_offset", retbuf, sizeof(retbuf), &plen)) + { + unsigned short val = hextoi(retbuf); + if ( val >= 0x0 && val <= 0xF0 ) cam->m_RegisterOffset = val & 0xF0; + } + } + else + { + if ( RegOffset >= 0x0 && RegOffset <= 0xF0 ) cam->m_RegisterOffset = RegOffset & 0xF0; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Necessary geometry settings + + if (CfgGet (inifp, "geometry", "rows", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXTOTALROWS ) cam->m_Rows = val; + } + else + { + fclose( inifp ); + delete cam; + cam = NULL; + return CCD_OPEN_CFGDATA; // rows MUST be defined + } + + if (CfgGet (inifp, "geometry", "columns", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXTOTALCOLUMNS ) cam->m_Columns = val; + } + else + { + fclose( inifp ); + delete cam; + cam = NULL; + return CCD_OPEN_CFGDATA; // columns MUST be defined + } + + ///////////////////////////////////////////////////////////////////////////////// + + if (CfgGet (inifp, "system", "pp_repeat", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi( retbuf ); + if ( val > 0 && val <= 1000 ) cam->m_PPRepeat = val; + } + + ///////////////////////////////////////////////////////////////////////////////// + // First actual communication with camera if in PPI mode + if ( !cam->InitDriver() ) + { + delete cam; + cam = NULL; + fclose( inifp ); + if ( IsNT ) + return CCD_OPEN_NTIO; + else + return CCD_OPEN_LOOPTST; + } + ///////////////////////////////////////////////////////////////////////////////// + // First actual communication with camera if in ISA mode + cam->Reset(); // Read in command register to set shadow register known state + ///////////////////////////////////////////////////////////////////////////////// + + if (CfgGet (inifp, "system", "cable", retbuf, sizeof(retbuf), &plen)) + { + if (!stricmp("LONG",retbuf)) + cam->write_LongCable( true ); + else if ( !stricmp("SHORT",retbuf) ) + cam->write_LongCable( false ); + } + else + cam->write_LongCable( false ); // default + + if ( !cam->read_Present() ) + { + delete cam; + cam = NULL; + fclose( inifp ); + + return CCD_OPEN_LOOPTST; + } + ///////////////////////////////////////////////////////////////////////////////// + // Set default setting and read other settings from ini file + + cam->write_UseTrigger( false ); + cam->write_ForceShutterOpen( false ); + + if (CfgGet (inifp, "system", "high_priority", retbuf, sizeof(retbuf), &plen)) + { + if (!stricmp("ON",retbuf) || !stricmp("TRUE",retbuf) || !stricmp("1",retbuf)) + { + cam->m_HighPriority = true; + } + else if (!stricmp("OFF",retbuf) || !stricmp("FALSE",retbuf) || !stricmp("0",retbuf)) + { + cam->m_HighPriority = false; + } + } + + if (CfgGet (inifp, "system", "data_bits", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi( retbuf ); + if ( val >= 8 && val <= 18 ) cam->m_DataBits = val; + } + + if (CfgGet (inifp, "system", "sensor", retbuf, sizeof(retbuf), &plen)) + { + if ( stricmp( "ccd", retbuf ) == 0 ) + { + cam->m_SensorType = Camera_SensorType_CCD; + } + else if ( stricmp( "cmos", retbuf ) == 0 ) + { + cam->m_SensorType = Camera_SensorType_CMOS; + } + } + + if (CfgGet (inifp, "system", "mode", retbuf, sizeof(retbuf), &plen)) + { + unsigned short val = hextoi(retbuf) & 0xF; + cam->write_Mode( val ); + } + else + cam->write_Mode( 0 ); // default + + if (CfgGet (inifp, "system", "test", retbuf, sizeof(retbuf), &plen)) + { + unsigned short val = hextoi(retbuf) & 0xF; + cam->write_TestBits( val ); + } + else + cam->write_TestBits( 0 ); //default + + if (CfgGet (inifp, "system", "test2", retbuf, sizeof(retbuf), &plen)) + { + unsigned short val = hextoi(retbuf) & 0xF; + cam->write_Test2Bits( val ); + } + else + cam->write_Test2Bits( 0 ); // default + + cam->write_FastReadout( false ); //default + + if (CfgGet (inifp, "system", "shutter_speed", retbuf, sizeof(retbuf), &plen)) + { + if (!stricmp("normal",retbuf)) + { + cam->m_FastShutter = false; + cam->m_MaxExposure = 10485.75; + cam->m_MinExposure = 0.01; + } + else if (!stricmp("fast",retbuf)) + { + cam->m_FastShutter = true; + cam->m_MaxExposure = 1048.575; + cam->m_MinExposure = 0.001; + } + else if ( !stricmp("dual",retbuf)) + { + cam->m_FastShutter = true; + cam->m_MaxExposure = 10485.75; + cam->m_MinExposure = 0.001; + } + } + + if (CfgGet (inifp, "system", "shutter_bits", retbuf, sizeof(retbuf), &plen)) + { + unsigned short val = hextoi(retbuf); + cam->m_FastShutterBits_Mode = val & 0x0F; + cam->m_FastShutterBits_Test = ( val & 0xF0 ) >> 4; + } + + if (CfgGet (inifp, "system", "maxbinx", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXHBIN ) cam->m_MaxBinX = val; + } + + if (CfgGet (inifp, "system", "maxbiny", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXVBIN ) cam->m_MaxBinY = val; + } + + if (CfgGet (inifp, "system", "guider_relays", retbuf, sizeof(retbuf), &plen)) + { + if (!stricmp("ON",retbuf) || !stricmp("TRUE",retbuf) || !stricmp("1",retbuf)) + { + cam->m_GuiderRelays = true; + } + else if (!stricmp("OFF",retbuf) || !stricmp("FALSE",retbuf) || !stricmp("0",retbuf)) + { + cam->m_GuiderRelays = false; + } + } + + if (CfgGet (inifp, "system", "timeout", retbuf, sizeof(retbuf), &plen)) + { + double val = atof(retbuf); + if ( val >= 0.0 && val <= 10000.0 ) cam->m_Timeout = val; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Geometry + + if (CfgGet (inifp, "geometry", "bic", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXCOLUMNS ) cam->m_BIC = val; + } + + if (CfgGet (inifp, "geometry", "bir", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXROWS ) cam->m_BIR = val; + } + + if (CfgGet (inifp, "geometry", "skipc", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 0 && val <= MAXCOLUMNS ) cam->m_SkipC = val; + } + + if (CfgGet (inifp, "geometry", "skipr", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 0 && val <= MAXROWS ) cam->m_SkipR = val; + } + + if (CfgGet (inifp, "geometry", "imgcols", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXTOTALCOLUMNS ) cam->m_ImgColumns = val; + } + else + cam->m_ImgColumns = cam->m_Columns - cam->m_BIC - cam->m_SkipC; + + if (CfgGet (inifp, "geometry", "imgrows", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXTOTALROWS ) cam->m_ImgRows = val; + } + else + cam->m_ImgRows = cam->m_Rows - cam->m_BIR - cam->m_SkipR; + + if (CfgGet (inifp, "geometry", "hflush", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXHBIN ) cam->m_HFlush = val; + } + + if (CfgGet (inifp, "geometry", "vflush", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= MAXVBIN ) cam->m_VFlush = val; + } + + // Default to full frame + cam->m_NumX = cam->m_ImgColumns; + cam->m_NumY = cam->m_ImgRows; + + ///////////////////////////////////////////////////////////////////////////////// + // Temperature + + if (CfgGet (inifp, "temp", "control", retbuf, sizeof(retbuf), &plen)) + { + if (!stricmp("ON",retbuf) || !stricmp("TRUE",retbuf) || !stricmp("1",retbuf)) + { + cam->m_TempControl = true; + } + else if (!stricmp("OFF",retbuf) || !stricmp("FALSE",retbuf) || !stricmp("0",retbuf)) + { + cam->m_TempControl = false; + } + } + + if (CfgGet (inifp, "temp", "cal", retbuf, sizeof(retbuf), &plen)) + { + short val = hextoi(retbuf); + if ( val >= 1 && val <= 255 ) cam->m_TempCalibration = val; + } + + if (CfgGet (inifp, "temp", "scale", retbuf, sizeof(retbuf), &plen)) + { + double val = atof(retbuf); + if ( val >= 1.0 && val <= 10.0 ) cam->m_TempScale = val; + } + + if (CfgGet (inifp, "temp", "target", retbuf, sizeof(retbuf), &plen)) + { + double val = atof(retbuf); + if ( val >= -60.0 && val <= 40.0 ) + cam->write_CoolerSetPoint( val ); + else + cam->write_CoolerSetPoint( -10.0 ); + } + else + cam->write_CoolerSetPoint( -10.0 ); //default + + ///////////////////////////////////////////////////////////////////////////////// + // CCD + + if (CfgGet (inifp, "ccd", "sensor", retbuf, sizeof(retbuf), &plen)) + { + if ( plen > 256 ) plen = 256; + memcpy( cam->m_Sensor, retbuf, plen ); + } + + if (CfgGet (inifp, "ccd", "color", retbuf, sizeof(retbuf), &plen)) + { + if (!stricmp("ON",retbuf) || !stricmp("TRUE",retbuf) || !stricmp("1",retbuf)) + { + cam->m_Color = true; + } + else if (!stricmp("OFF",retbuf) || !stricmp("FALSE",retbuf) || !stricmp("0",retbuf)) + { + cam->m_Color = false; + } + } + + if (CfgGet (inifp, "ccd", "noise", retbuf, sizeof(retbuf), &plen)) + { + cam->m_Noise = atof( retbuf ); + } + + if (CfgGet (inifp, "ccd", "gain", retbuf, sizeof(retbuf), &plen)) + { + cam->m_Gain = atof( retbuf ); + } + + if (CfgGet (inifp, "ccd", "pixelxsize", retbuf, sizeof(retbuf), &plen)) + { + cam->m_PixelXSize = atof( retbuf ); + } + + if (CfgGet (inifp, "ccd", "pixelysize", retbuf, sizeof(retbuf), &plen)) + { + cam->m_PixelYSize = atof( retbuf ); + } + + fclose( inifp ); + return CCD_OPEN_NOERR; +} + diff --git a/kstars/kstars/indi/apogee/FpgaRegs.h b/kstars/kstars/indi/apogee/FpgaRegs.h new file mode 100644 index 00000000..b1fd5fe1 --- /dev/null +++ b/kstars/kstars/indi/apogee/FpgaRegs.h @@ -0,0 +1,190 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef __FPGAREGS_H__APOGEE_APN__ +#define __FPGAREGS_H__APOGEE_APN__ + + +#define FPGA_TOTAL_REGISTER_COUNT 103 + + +#define FPGA_REG_COMMAND_A 0 +#define FPGA_BIT_CMD_EXPOSE 0x0001 +#define FPGA_BIT_CMD_DARK 0x0002 +#define FPGA_BIT_CMD_TEST 0x0004 +#define FPGA_BIT_CMD_TDI 0x0008 +#define FPGA_BIT_CMD_FLUSH 0x0010 +#define FPGA_BIT_CMD_TRIGGER_EXPOSE 0x0020 + +#define FPGA_REG_COMMAND_B 1 +#define FPGA_BIT_CMD_RESET 0x0002 +#define FPGA_BIT_CMD_CLEAR_ALL 0x0010 +#define FPGA_BIT_CMD_END_EXPOSURE 0x0080 +#define FPGA_BIT_CMD_RAMP_TO_SETPOINT 0x0200 +#define FPGA_BIT_CMD_RAMP_TO_AMBIENT 0x0400 +#define FPGA_BIT_CMD_START_TEMP_READ 0x2000 +#define FPGA_BIT_CMD_DAC_LOAD 0x4000 +#define FPGA_BIT_CMD_AD_CONFIG 0x8000 + +#define FPGA_REG_OP_A 2 +#define FPGA_BIT_LED_DISABLE 0x0001 +#define FPGA_BIT_PAUSE_TIMER 0x0002 +#define FPGA_BIT_RATIO 0x0004 +#define FPGA_BIT_DELAY_MODE 0x0008 +#define FPGA_BIT_P_CLK_MODE 0x0010 +#define FPGA_BIT_LED_EXPOSE_DISABLE 0x0020 +#define FPGA_BIT_DISABLE_H_CLK 0x0040 +#define FPGA_BIT_SHUTTER_AMP_CONTROL 0x0080 +#define FPGA_BIT_HALT_DISABLE 0x0100 +#define FPGA_BIT_SHUTTER_MODE 0x0200 +#define FPGA_BIT_DIGITIZATION_RES 0x0400 +#define FPGA_BIT_FORCE_SHUTTER 0x0800 +#define FPGA_BIT_DISABLE_SHUTTER 0x1000 +#define FPGA_BIT_TEMP_SUSPEND 0x2000 +#define FPGA_BIT_SHUTTER_SOURCE 0x4000 +#define FPGA_BIT_TEST_MODE 0x8000 + +#define FPGA_REG_OP_B 3 +#define FPGA_BIT_HCLAMP_ENABLE 0x0008 +#define FPGA_BIT_HSKIP_ENABLE 0x0010 +#define FPGA_BIT_HRAM_ENABLE 0x0020 +#define FPGA_BIT_VRAM_ENABLE 0x0040 +#define FPGA_BIT_DAC_SELECT_ZERO 0x0080 +#define FPGA_BIT_DAC_SELECT_ONE 0x0100 +#define FPGA_BIT_AD_SIMULATION 0x8000 + +#define FPGA_REG_TIMER_UPPER 4 +#define FPGA_REG_TIMER_LOWER 5 + +#define FPGA_REG_HRAM_INPUT 6 +#define FPGA_REG_VRAM_INPUT 7 + +#define FPGA_REG_HRAM_INV_MASK 8 +#define FPGA_REG_VRAM_INV_MASK 9 + +#define FPGA_REG_HCLAMP_INPUT 10 +#define FPGA_REG_HSKIP_INPUT 11 + +#define FPGA_REG_PRECLAMP_SKIP_COUNT 12 +#define FPGA_REG_CLAMP_COUNT 13 +#define FPGA_REG_PREROI_SKIP_COUNT 14 +#define FPGA_REG_ROI_COUNT 15 +#define FPGA_REG_POSTROI_SKIP_COUNT 16 +#define FPGA_REG_OVERSCAN_COUNT 17 +#define FPGA_REG_IMAGE_COUNT 18 + +#define FPGA_REG_VFLUSH_BINNING 19 + +#define FPGA_REG_SHUTTER_CLOSE_DELAY 20 + +#define FPGA_REG_POSTOVERSCAN_SKIP_COUNT 21 + +#define FPGA_REG_SHUTTER_STROBE_POSITION 23 +#define FPGA_REG_SHUTTER_STROBE_PERIOD 24 + +#define FPGA_REG_FAN_SPEED_CONTROL 25 +#define FPGA_REG_LED_DRIVE 26 +#define FPGA_REG_SUBSTRATE_ADJUST 27 +#define FPGA_MASK_FAN_SPEED_CONTROL 0x0FFF +#define FPGA_MASK_LED_ILLUMINATION 0x0FFF +#define FPGA_MASK_SUBSTRATE_ADJUST 0x0FFF + +#define FPGA_REG_TEST_COUNT_UPPER 28 +#define FPGA_REG_TEST_COUNT_LOWER 29 + +#define FPGA_REG_A1_ROW_COUNT 30 +#define FPGA_REG_A1_VBINNING 31 +#define FPGA_REG_A2_ROW_COUNT 32 +#define FPGA_REG_A2_VBINNING 33 +#define FPGA_REG_A3_ROW_COUNT 34 +#define FPGA_REG_A3_VBINNING 35 + +#define FPGA_MASK_VBINNING 0x0FFF +#define FPGA_BIT_ARRAY_DIGITIZE 0x1000 +#define FPGA_BIT_ARRAY_FASTDUMP 0x4000 + +#define FPGA_REG_SEQUENCE_DELAY 47 +#define FPGA_REG_TDI_RATE 48 + +#define FPGA_REG_IO_PORT_WRITE 49 + +#define FPGA_REG_IO_PORT_DIRECTION 50 +#define FPGA_MASK_IO_PORT_DIRECTION 0x003F + +#define FPGA_REG_IO_PORT_ASSIGNMENT 51 +#define FPGA_MASK_IO_PORT_ASSIGNMENT 0x003F + +#define FPGA_REG_LED_SELECT 52 +#define FPGA_MASK_LED_SELECT_A 0x000F +#define FPGA_MASK_LED_SELECT_B 0x00F0 +#define FPGA_BIT_LED_EXPOSE 0x0001 +#define FPGA_BIT_LED_IMAGE_ACTIVE 0x0002 +#define FPGA_BIT_LED_FLUSHING 0x0004 +#define FPGA_BIT_LED_TRIGGER_WAIT 0x0008 +#define FPGA_BIT_LED_EXT_TRIGGER 0x0010 +#define FPGA_BIT_LED_EXT_SHUTTER_INPUT 0x0020 +#define FPGA_BIT_LED_EXT_START_READOUT 0x0040 +#define FPGA_BIT_LED_AT_TEMP 0x0080 + +#define FPGA_REG_SCRATCH 53 + +#define FPGA_REG_TDI_COUNT 54 + +#define FPGA_REG_TEMP_DESIRED 55 + +#define FPGA_REG_TEMP_RAMP_DOWN_A 57 +#define FPGA_REG_TEMP_RAMP_DOWN_B 58 +#define FPGA_REG_TEMP_BACKOFF 60 +#define FPGA_REG_TEMP_COOLER_OVERRIDE 61 +#define FPGA_MASK_TEMP_PARAMS 0x0FFF // 12 bits + +#define FPGA_REG_AD_CONFIG_DATA 62 +#define FPGA_MASK_AD_GAIN 0x07FF // 11 bits + +#define FPGA_REG_IO_PORT_READ 90 +#define FPGA_MASK_IO_PORT_DATA 0x003F + +#define FPGA_REG_GENERAL_STATUS 91 +#define FPGA_BIT_STATUS_IMAGE_EXPOSING 0x0001 +#define FPGA_BIT_STATUS_IMAGING_ACTIVE 0x0002 +#define FPGA_BIT_STATUS_DATA_HALTED 0x0004 +#define FPGA_BIT_STATUS_IMAGE_DONE 0x0008 +#define FPGA_BIT_STATUS_FLUSHING 0x0010 +#define FPGA_BIT_STATUS_WAITING_TRIGGER 0x0020 +#define FPGA_BIT_STATUS_SHUTTER_OPEN 0x0040 +#define FPGA_BIT_STATUS_PATTERN_ERROR 0x0080 +#define FPGA_BIT_STATUS_TEMP_SUSPEND_ACK 0x0100 +#define FPGA_BIT_STATUS_TEMP_REVISION 0x2000 +#define FPGA_BIT_STATUS_TEMP_AT_TEMP 0x4000 +#define FPGA_BIT_STATUS_TEMP_ACTIVE 0x8000 + +#define FPGA_REG_TEMP_HEATSINK 93 +#define FPGA_REG_TEMP_CCD 94 +#define FPGA_REG_TEMP_DRIVE 95 + +#define FPGA_REG_INPUT_VOLTAGE 96 +#define FPGA_MASK_INPUT_VOLTAGE 0x0FFF + +#define FPGA_REG_TEMP_REVISED 97 + +#define FPGA_REG_FIFO_DATA 98 +#define FPGA_REG_FIFO_STATUS 99 + +#define FPGA_REG_CAMERA_ID 100 +#define FPGA_MASK_CAMERA_ID 0x007F + +#define FPGA_REG_FIRMWARE_REV 101 + +#define FPGA_REG_FIFO_FULL_COUNT 102 +#define FPGA_REG_FIFO_EMPTY_COUNT 103 + +#define FPGA_REG_TDI_COUNTER 104 +#define FPGA_REG_SEQUENCE_COUNTER 105 + +#endif diff --git a/kstars/kstars/indi/apogee/Makefile.am b/kstars/kstars/indi/apogee/Makefile.am new file mode 100644 index 00000000..3d62dadc --- /dev/null +++ b/kstars/kstars/indi/apogee/Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = +METASOURCES = AUTO + +if HAVE_LIBUSB +libapogee_target = libapogee_USB.la +endif + +if LINUX +apogee_targets = libapogee_ISA.la libapogee_PCI.la libapogee_PPI.la $(libapogee_target) +endif + +noinst_LTLIBRARIES = $(apogee_targets) + +libapogee_ISA_la_SOURCES = CameraIO_Linux.cpp CameraIO_LinuxISA.cpp +libapogee_PCI_la_SOURCES = CameraIO_Linux.cpp CameraIO_LinuxPCI.cpp +libapogee_PPI_la_SOURCES = CameraIO_Linux.cpp CameraIO_LinuxPPI.cpp + +libapogee_USB_la_SOURCES = ApnCamData.cpp ApnCamData_CCD3011HS.cpp ApnCamData_CCD3011LS.cpp ApnCamData_CCD4240HS.cpp ApnCamData_CCD4240LS.cpp ApnCamData_CCD4710HS.cpp ApnCamData_CCD4710LS.cpp ApnCamData_CCD4710LS2.cpp ApnCamData_CCD4710LS3.cpp ApnCamData_CCD4710LS4.cpp ApnCamData_CCD4710LS5.cpp ApnCamData_CCD4720HS.cpp ApnCamData_CCD4720LS.cpp ApnCamData_CCD5520HS.cpp ApnCamData_CCD5520LS.cpp ApnCamData_CCD5710HS.cpp ApnCamData_CCD5710LS.cpp ApnCamData_CCD7700HS.cpp ApnCamData_CCD7700LS.cpp ApnCamData_KAF0261E.cpp ApnCamData_KAF0401E.cpp ApnCamData_KAF1001E.cpp ApnCamData_KAF1301E.cpp ApnCamData_KAF1401E.cpp ApnCamData_KAF3200E.cpp ApnCamData_KAF4202.cpp ApnCamData_KAF1602E.cpp ApnCamData_KAF16801E.cpp ApnCamData_KAF6303E.cpp ApnCamData_TH7899.cpp ApnCamTable.cpp ApnCamera.cpp ApnCamera_USB.cpp ApnCamera_Linux.cpp ApogeeUsbLinux.cpp +libapogee_USB_la_LADD = -lusb + +KDE_OPTIONS = nofinal +KDE_CXXFLAGS = -D_POSIX_C_SOURCE=199506L diff --git a/kstars/kstars/indi/apogee/reb1100.cpp b/kstars/kstars/indi/apogee/reb1100.cpp new file mode 100644 index 00000000..cacf16eb --- /dev/null +++ b/kstars/kstars/indi/apogee/reb1100.cpp @@ -0,0 +1,195 @@ +/*************************************************************************** + reb1100.cpp - REB1100 communication class + ------------------- + begin : Thu Mar 27 2003 + copyright : (C) 2003 by Igor Izyumin + email : igor@mlug.missouri.edu + ***************************************************************************/ + +/*************************************************************************** + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. + + **********************************************************************/ + +#include "reb1100.h" + +REB1100::REB1100(){ + struct usb_bus *bus; + struct usb_device *dev; + + usb_init(); + + usb_find_busses(); + usb_find_devices(); + + char string[256]; + + int found = 0; + + /* find ebook device */ + for(bus = usb_busses; bus && !found; bus = bus->next) { + for(dev = bus->devices; dev && !found; dev = dev->next) { + if (dev->descriptor.idVendor == 0x993 && dev->descriptor.idProduct == 0x1) { + hDevice = usb_open(dev); + cerr << "Found eBook. Attempting to open... "; + found = 1; + if (hDevice) { +// if (!usb_get_string_simple(hDevice, dev->descriptor.iSerialNumber, string, sizeof(string))) throw DevOpenError(); + cerr << "Success.\n"; +// cerr << "Serial number: " << string << endl; + } + else throw DevOpenError(); + } + } + } + if (!found) throw DevNotFoundError(); + + if (!usb_set_configuration(hDevice, 0x0)) throw DevOpenError(); + if (!usb_claim_interface(hDevice, 0x1)) throw DevOpenError(); + + memTarget = INTERNAL; +} + +REB1100::~REB1100(){ + usb_release_interface(hDevice, 0x0); + usb_close(hDevice); +} + +void REB1100::getFile(string filename, string &data) { + long flength = filename.length(); + char buf[4096]; + char zeros[4] = {0, 0, 0, 0}; + int ret; + string request; + // first four bytes are the length of the filename + // (low-endian) + char *byte = reinterpret_cast<char*>(&flength); + request += *byte; + byte++; + request += *byte; + byte++; + request += *byte; + byte++; + request += *byte; + // the rest is the filename + request += filename; + + // send a USB control request to tell the device what file we want + char *temp; + temp = new char[request.length()]; + request.copy(temp, string::npos); + ret = usb_control_msg(hDevice, 0x42, 0x01, 0x00, 0x00, temp, request.length(), 300); + if (ret == -1) throw DevControlError(); + delete temp; + temp = NULL; + + // read the return code + ret = usb_control_msg(hDevice, 0xc2, 0x02, 0x00, 0x00, zeros, 4, 300); + if (ret == -1) throw DevControlError(); + + // read file from pipe + do { + ret = usb_bulk_read(hDevice, 2, buf, 4096, 1000); + if (ret == -1) throw DevReadError(); + for(int i = 0; i < ret; i++) { + data += buf[i]; + } + } + while(ret == 4096); +} + +void REB1100::sendFile(string filename, string &data) { + string prefix = ""; + if (memTarget == MEMCARD) { // prefix with \SM\ when sending to memory card + prefix = "\\SM\\"; + } + filename = prefix + filename; + + long flength = data.length(); + long fnlength = filename.length(); + + // prepare initial request + string request; + + // first four bytes are the length of the file + // (low-endian) + char *byte = reinterpret_cast<char*>(&flength); + request += *byte; + byte++; + request += *byte; + byte++; + request += *byte; + byte++; + request += *byte; + + // next four bytes are the length of the filename + // (low-endian) + byte = reinterpret_cast<char*>(&fnlength); + request += *byte; + byte++; + request += *byte; + byte++; + request += *byte; + byte++; + request += *byte; + + // append filename + request += filename; + + // send message to device + int ret; + char *temp; + temp = new char[request.length()]; + request.copy(temp, string::npos); + ret = usb_control_msg(hDevice, 0x42, 0x00, 0x00, 0x00, temp, request.length(), 3000); + delete temp; + temp = NULL; + if (ret == -1) throw DevControlError(); + + // read from device and check for error + char temp2[4] = {0, 0, 0, 0}; + ret = usb_control_msg(hDevice, 0xc2, 0x03, 0x00, 0x00, temp2, 4, 3000); + if (ret == -1) throw DevControlError(); + if (temp2[0] || temp2[1] || temp2[2] || temp2[3]) throw DevControlError(); + + // now start bulk writing to the device + string buf; + int n, offset = 0; + char *temp3; + do { + buf = data.substr(offset, 4096); + n = buf.length(); + if (buf.length() > 0) { + temp3 = new char[buf.length()]; + buf.copy(temp3, string::npos); +// cout << "Sending block (" << n << " bytes)\n"; + ret = usb_bulk_write(hDevice, 2, temp3, n, 3000); + if (ret == -1) throw DevWriteError(); + delete temp3; + temp3 = NULL; + offset += 4096; + } + } + while(offset + 1 < data.length()); + // send empty packet to signify end of file + ret = usb_bulk_write(hDevice, 2, 0, 0, 3000); + if (ret == -1) throw DevWriteError(); +} + +void REB1100::setTarget(bool target) { + memTarget = target; +} + diff --git a/kstars/kstars/indi/apogee/stdafx.h b/kstars/kstars/indi/apogee/stdafx.h new file mode 100644 index 00000000..acabaa43 --- /dev/null +++ b/kstars/kstars/indi/apogee/stdafx.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#if !defined(STDAFX__INCLUDED_) +#define STDAFX__INCLUDED_ + +#ifdef __linux__ +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#define ULONG unsigned long +#define USHORT unsigned short +#define PUSHORT unsigned short * +#define BYTE unsigned char +#define DWORD long +#define BOOLEAN unsigned long +#define TRUE 1 +#define FALSE 0 +#define INTERNET_OPEN_TYPE_DIRECT 1 +#define INTERNET_FLAG_NO_CACHE_WRITE 1 +#define INTERNET_FLAG_KEEP_CONNECTION 1 +#define Sleep(x) usleep(1000*x) +#endif + + +#endif + + + + + |