Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 2028) +++ CMakeLists.txt (working copy) @@ -24,6 +24,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/DsiDevice.cpp ${CMAKE_CURRENT_SOURCE_DIR}/DsiDeviceFactory.cpp ${CMAKE_CURRENT_SOURCE_DIR}/DsiPro.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/DsiColor.cpp ${CMAKE_CURRENT_SOURCE_DIR}/DsiProII.cpp ${CMAKE_CURRENT_SOURCE_DIR}/DsiTypes.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Util.cpp Index: DsiColor.cpp =================================================================== --- DsiColor.cpp (revision 0) +++ DsiColor.cpp (working copy) @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2009, Roland Roberts + * Copyright (c) 2015, Ben Gilsrud + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "DsiColor.h" +#include "DsiDevice.h" + +using namespace DSI; + +void +DsiColor::initImager(const char *devname) +{ + + command(DeviceCommand::SET_ROW_COUNT_EVEN, read_height_even); + command(DeviceCommand::SET_ROW_COUNT_ODD, read_height_odd); + + if (is_high_gain) + sendRegister(AdRegister::CONFIGURATION, 0x58); + else + sendRegister(AdRegister::CONFIGURATION, 0xd8); + + sendRegister(AdRegister::MUX_CONFIG, 0xc0); + + /* Sigh. "Interestingly," it would appear that you MUST take at least one + * throw-away image or else GET_EXP_TIMER_COUNT won't work on "real" + * exposures. Sounds like a firmware bug to me, but not something we can + * do anything about. Although MaximDL uses 4 exposures of 1000 ticks + * (100 ms) each, this shorter exposure works just fine. + */ + for (int i = 0; i < 1; i++) { + unsigned char *foo = getImage(1); + delete [] foo; + } +} + +DsiColor::DsiColor(const char *devname) : Device(devname) +{ + // color_type = ColorType.NONE; + is_high_gain = true; + + is_color = true; + + /* Turn off test mode so we can actually return an image */ + test_pattern = false; + + /* The DSI Color I cannot be put into 2x2 binning mode. */ + is_binnable = false; + + + /* Sony lists the pixel size a 9.6x7.5 microns. Craig Stark, in a note at + * http://www.skyinsight.com/wiki/ regarding the Orion Star Shoot, points + * out that that size does not fill the size of the chip. I'm not sure we + * care; I think all we care about is the pixel-to-pixel center distance + * as this determines how the final image has to be scaled to have a 1:1 + * aspect ratio for display. + */ + aspect_ratio = 0.78125; + + read_width = 537; + read_height_even = 253; + read_height_odd = 252; + read_height = read_height_even + read_height_odd; + + read_bpp = 2; + + image_width = 508; + image_height = 488; + image_offset_x = 23; + image_offset_y = 13; + pixel_size_x = 9.6; + pixel_size_y = 7.5; + + exposure_time = 10; + + initImager(); + +} + +DsiColor::~DsiColor() +{ +} Index: DsiColor.h =================================================================== --- DsiColor.h (revision 0) +++ DsiColor.h (working copy) @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2009, Roland Roberts + * Copyright (c) 2015, Ben Gilsrud + * + */ + +#ifndef __DsiColor_hh +#define __DsiColor_hh + +#include "DsiDevice.h" + +namespace DSI { + + class DsiColor : public Device { + + private: + + protected: + + void initImager(const char *devname = 0); + + public: + + DsiColor(const char *devname = 0); + ~DsiColor(); + }; +}; + +#endif /* __DsiColor_hh */ + Index: DsiDevice.h =================================================================== --- DsiDevice.h (revision 2028) +++ DsiDevice.h (working copy) @@ -174,6 +174,7 @@ virtual unsigned int getImageOffsetY() { return image_offset_y; }; virtual float getPixelSizeX() { return pixel_size_x; }; virtual float getPixelSizeY() { return pixel_size_y; }; + virtual bool isColor() { return is_color; }; virtual void abortExposure(); virtual unsigned int getAdRegister(DSI::AdRegister reg); Index: DsiDeviceFactory.cpp =================================================================== --- DsiDeviceFactory.cpp (revision 2028) +++ DsiDeviceFactory.cpp (working copy) @@ -15,6 +15,7 @@ #include "DsiDeviceFactory.h" #include "DsiPro.h" +#include "DsiColor.h" #include "DsiProII.h" #include "DsiException.h" @@ -45,6 +46,9 @@ if (ccdChipName == "ICX429ALL") return new DSI::DsiProII(devname); + if (ccdChipName == "ICX404AK") + return new DSI::DsiColor(devname); + return 0; } Index: dsi_ccd.cpp =================================================================== --- dsi_ccd.cpp (revision 2028) +++ dsi_ccd.cpp (working copy) @@ -117,6 +117,10 @@ DEBUG(INDI::Logger::DBG_SESSION, "Found a DSI Pro!"); } else if (ccd == "ICX429ALL") { DEBUG(INDI::Logger::DBG_SESSION, "Found a DSI Pro II!"); + } else if (ccd == "ICX404AK") { + DEBUG(INDI::Logger::DBG_SESSION, "Found a DSI Color!"); + } else { + DEBUGF(INDI::Logger::DBG_SESSION, "Found a DSI with an unknown CCD: %s", ccd.c_str()); } return true; @@ -168,7 +172,7 @@ cap.hasGuideHead= false; cap.hasShutter = false; cap.hasST4Port = false; - cap.hasBayer = false; + cap.hasBayer = dsi->isColor(); SetCCDCapability(&cap);