bool Camera_SSAGClass::Capture(int duration, usImage& img, int options, const wxRect& subframe) { // Only does full frames unsigned short *dptr; int xsize = FullSize.GetWidth(); int ysize = FullSize.GetHeight(); bool firstimg = true; //qglogfile->AddLine(wxString::Format("Capturing dur %d",duration)); //qglogfile->Write(); _SSAG_ProgramCamera(0, 0, 1280, 1024, (GuideCameraGain * 63 / 100)); if (img.Init(FullSize)) { DisconnectWithAlert(CAPT_FAIL_MEMORY); return true; } CameraWatchdog watchdog(duration, GetTimeoutMs()); _SSAG_ThreadedExposure(duration, NULL); //qglogfile->AddLine("Exposure programmed"); //qglogfile->Write(); if (duration > 100) { if (WorkerThread::MilliSleep(duration - 100, WorkerThread::INT_ANY) && (WorkerThread::TerminateRequested() || StopExposure())) { return true; } } while (_SSAG_isExposing()) { wxMilliSleep(50); if (WorkerThread::InterruptRequested() && (WorkerThread::TerminateRequested() || StopExposure())) { return true; } if (watchdog.Expired()) { DisconnectWithAlert(CAPT_FAIL_TIMEOUT); return true; } } //qglogfile->AddLine("Exposure done"); //qglogfile->Write(); dptr = img.ImageData; _SSAG_GETBUFFER(dptr, img.NPixels * 2); if (options & CAPTURE_SUBTRACT_DARK) SubtractDark(img); //qglogfile->AddLine("Image loaded"); //qglogfile->Write(); return false; }
//////////////////////////// // CLOSE CONNECTION void Alta::CloseConnection() { #ifdef DEBUGGING_CAMERA apgHelper::DebugMsg( "Alta::DefaultCloseConnection"); #endif // need to clear out the usb interface if an image ready // on altau's if( m_ImageInProgress ) { StopExposure( false ); } DefaultCloseConnection(); }
// Abort exposure, if one is in progress ARTEMISERROR ArtDrvSim::AbortExposure() { m_abortExposure = true; return StopExposure(); }