bool MICCD::StartExposure(float duration) { imageFrameType = PrimaryCCD.getFrameType(); useShutter = (imageFrameType == INDI::CCDChip::LIGHT_FRAME || imageFrameType == INDI::CCDChip::FLAT_FRAME); if (!isSimulation()) { // read modes in G2/G3/G4 cameras are in inverse order, we have to calculate correct value int mode, prm; gxccd_get_integer_parameter(cameraHandle, GIP_PREVIEW_READ_MODE, &prm); if (prm == 0) // preview mode == 0 means smaller G0/G1 cameras mode = IUFindOnSwitchIndex(&ReadModeSP); else mode = prm - IUFindOnSwitchIndex(&ReadModeSP); gxccd_set_read_mode(cameraHandle, mode); // send binned coords int x = PrimaryCCD.getSubX() / PrimaryCCD.getBinX(); int y = PrimaryCCD.getSubY() / PrimaryCCD.getBinY(); int w = PrimaryCCD.getSubW() / PrimaryCCD.getBinX(); int d = PrimaryCCD.getSubH() / PrimaryCCD.getBinY(); gxccd_start_exposure(cameraHandle, duration, useShutter, x, y, w, d); } ExposureRequest = duration; PrimaryCCD.setExposureDuration(duration); gettimeofday(&ExpStart, nullptr); InExposure = true; downloading = false; LOGF_DEBUG("Taking a %.3f seconds frame...", ExposureRequest); return true; }
bool MICCD::StartExposure(float duration) { int ret = 0; useShutter = true; if (duration < minExpTime) { DEBUGF(INDI::Logger::DBG_WARNING, "Exposure shorter than minimum duration %g s requested. Setting exposure time to %g s.", duration, minExpTime); duration = minExpTime; } imageFrameType = PrimaryCCD.getFrameType(); if (imageFrameType == CCDChip::BIAS_FRAME) { duration = minExpTime; } else if (imageFrameType == CCDChip::DARK_FRAME) { useShutter = false; } if (!isSimulation()) { // read modes in G2/G3/G4 cameras are in inverse order, we have to calculate correct value int mode, prm; gxccd_get_integer_parameter(cameraHandle, GIP_PREVIEW_READ_MODE, &prm); if (prm == 0) // preview mode == 0 means smaller G0/G1 cameras mode = IUFindOnSwitchIndex(&NoiseSP); else mode = prm - IUFindOnSwitchIndex(&NoiseSP); gxccd_set_read_mode(cameraHandle, mode); gxccd_start_exposure(cameraHandle, duration, useShutter, PrimaryCCD.getSubX(), PrimaryCCD.getSubY(), PrimaryCCD.getSubW(), PrimaryCCD.getSubH()); } ExposureRequest = duration; PrimaryCCD.setExposureDuration(duration); gettimeofday(&ExpStart, NULL); InExposure = true; downloading = false; DEBUGF(INDI::Logger::DBG_DEBUG, "Taking a %g seconds frame...", ExposureRequest); return true; }