CameraConfigDialogCtrlSet::CameraConfigDialogCtrlSet(wxWindow *pParent, GuideCamera *pCamera, AdvancedDialog *pAdvancedDialog, BrainCtrlIdMap& CtrlMap) : ConfigDialogCtrlSet(pParent, pAdvancedDialog, CtrlMap) { assert(pCamera); m_pCamera = pCamera; if (m_pCamera->HasSubframes) { m_pUseSubframes = new wxCheckBox(GetParentWindow(AD_cbUseSubFrames), wxID_ANY, _("Use Subframes")); AddCtrl(CtrlMap, AD_cbUseSubFrames, m_pUseSubframes, _("Check to only download subframes (ROIs). Sub-frame size is equal to search region size.")); } int numRows = (int)m_pCamera->HasGainControl + (int)m_pCamera->HasDelayParam + (int)m_pCamera->HasPortNum + 1; int width = StringWidth(_T("0000")) + 30; // Pixel size always m_pPixelSize = NewSpinnerDouble(GetParentWindow(AD_szPixelSize), width, m_pCamera->GetCameraPixelSize(), 0.0, 99.9, 0.1, _("Guide camera un-binned pixel size in microns. Used with the guide telescope focal length to display guiding error in arc-seconds.")); AddLabeledCtrl(CtrlMap, AD_szPixelSize, _("Pixel size"), m_pPixelSize, ""); // Gain control if (m_pCamera->HasGainControl) { int width = StringWidth(_T("0000")) + 30; m_pCameraGain = NewSpinnerInt(GetParentWindow(AD_szGain), width, 100, 0, 100, 1); AddLabeledCtrl(CtrlMap, AD_szGain, _("Camera gain"), m_pCameraGain, _("Camera gain, default = 95 % , lower if you experience noise or wish to guide on a very bright star. Not available on all cameras.")); } // Binning m_binning = 0; if (m_pCamera->MaxBinning > 1) { wxArrayString opts; m_pCamera->GetBinningOpts(&opts); int width = StringArrayWidth(opts); m_binning = new wxChoice(GetParentWindow(AD_binning), wxID_ANY, wxPoint(-1, -1), wxSize(width + 35, -1), opts); AddLabeledCtrl(CtrlMap, AD_binning, _("Binning"), m_binning, _("Camera pixel binning")); } // Delay parameter if (m_pCamera->HasDelayParam) { int width = StringWidth(_T("0000")) + 30; m_pDelay = NewSpinnerInt(GetParentWindow(AD_szDelay), width, 5, 0, 250, 150); AddLabeledCtrl(CtrlMap, AD_szDelay, _("Delay"), m_pDelay, _("LE Read Delay (ms) , Adjust if you get dropped frames")); } // Port number if (m_pCamera->HasPortNum) { wxString port_choices[] = { _T("Port 378"), _T("Port 3BC"), _T("Port 278"), _T("COM1"), _T("COM2"), _T("COM3"), _T("COM4"), _T("COM5"), _T("COM6"), _T("COM7"), _T("COM8"), _T("COM9"), _T("COM10"), _T("COM11"), _T("COM12"), _T("COM13"), _T("COM14"), _T("COM15"), _T("COM16"), }; int width = StringArrayWidth(port_choices, WXSIZEOF(port_choices)); m_pPortNum = new wxChoice(GetParentWindow(AD_szPort), wxID_ANY, wxPoint(-1, -1), wxSize(width + 35, -1), WXSIZEOF(port_choices), port_choices); AddLabeledCtrl(CtrlMap, AD_szPort, _("LE Port"), m_pPortNum, _("Port number for long-exposure control")); } if (m_pCamera->HasCooler) { wxSizer *sz = new wxBoxSizer(wxHORIZONTAL); m_coolerOn = new wxCheckBox(GetParentWindow(AD_cooler), wxID_ANY, _("Cooler On")); m_coolerOn->SetToolTip(_("Turn camera cooler on or off")); sz->Add(m_coolerOn, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL).Border(wxRIGHT)); m_coolerSetpt = NewSpinnerInt(GetParentWindow(AD_szDelay), width, 5, -99, 99, 1); wxSizer *szt = MakeLabeledControl(AD_cooler, _("Set Temperature"), m_coolerSetpt, _("Cooler setpoint temperature")); sz->Add(szt, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL)); AddGroup(CtrlMap, AD_cooler, sz); } // Watchdog timeout { int width = StringWidth(_T("0000")) + 30; m_timeoutVal = NewSpinnerInt(GetParentWindow(AD_szCameraTimeout), width, 5, 5, 9999, 1); AddLabeledCtrl(CtrlMap, AD_szCameraTimeout, _("Disconnect nonresponsive\ncamera after (seconds)"), m_timeoutVal, wxString::Format(_("The camera will be disconnected if it fails to respond for this long. " "The default value, %d seconds, should be appropriate for most cameras."), DefaultGuideCameraTimeoutMs / 1000)); } }
CameraConfigDialogPane::CameraConfigDialogPane(wxWindow *pParent, GuideCamera *pCamera) : ConfigDialogPane(_("Camera Settings"), pParent) { assert(pCamera); m_pCamera = pCamera; if (m_pCamera->HasSubframes) { m_pUseSubframes = new wxCheckBox(pParent, wxID_ANY,_("Use Subframes"), wxPoint(-1,-1), wxSize(75,-1)); DoAdd(m_pUseSubframes, _("Check to only download subframes (ROIs) if your camera supports it")); } int numRows = (int)m_pCamera->HasGainControl + (int)m_pCamera->HasDelayParam + (int)m_pCamera->HasPortNum + 1; wxFlexGridSizer *pCamControls = new wxFlexGridSizer(numRows, 2, 5, 15); int width = StringWidth(_T("0000")) + 30; // Pixel size always m_pPixelSize = NewSpinnerDouble(pParent, width, m_pCamera->GetCameraPixelSize(), 0.0, 99.9, 0.1, _("Guide camera pixel size in microns. Used with the guide telescope focal length to display guiding error in arc-seconds.")); AddTableEntryPair(pParent, pCamControls, _("Pixel size"), m_pPixelSize); // Gain control if (m_pCamera->HasGainControl) { int width = StringWidth(_T("0000")) + 30; m_pCameraGain = NewSpinnerInt(pParent, width, 100, 0, 100, 1, _("Camera gain boost ? Default = 95 % , lower if you experience noise or wish to guide on a very bright star. Not available on all cameras.")); AddTableEntryPair(pParent, pCamControls, _("Camera gain"), m_pCameraGain); } // Delay parameter if (m_pCamera->HasDelayParam) { int width = StringWidth(_T("0000")) + 30; m_pDelay = NewSpinnerInt(pParent, width, 5, 0, 250, 150, _("LE Read Delay (ms) , Adjust if you get dropped frames")); AddTableEntryPair(pParent, pCamControls, _("Delay"), m_pDelay); } // Port number if (m_pCamera->HasPortNum) { wxString port_choices[] = { _T("Port 378"), _T("Port 3BC"), _T("Port 278"), _T("COM1"), _T("COM2"), _T("COM3"), _T("COM4"), _T("COM5"), _T("COM6"), _T("COM7"), _T("COM8"), _T("COM9"), _T("COM10"), _T("COM11"), _T("COM12"), _T("COM13"), _T("COM14"), _T("COM15"), _T("COM16"), }; int width = StringArrayWidth(port_choices, WXSIZEOF(port_choices)); m_pPortNum = new wxChoice(pParent, wxID_ANY, wxPoint(-1, -1), wxSize(width + 35, -1), WXSIZEOF(port_choices), port_choices); m_pPortNum->SetToolTip(_("Port number for long-exposure control")); AddTableEntryPair(pParent, pCamControls, _("LE Port"), m_pPortNum); } // Watchdog timeout { int width = StringWidth(_T("0000")) + 30; m_timeoutVal = NewSpinnerInt(pParent, width, 5, 5, 9999, 1, wxString::Format(_("The camera will be disconnected if it fails to respond for this long. The default value, %d seconds, should be appropriate for most cameras."), DefaultGuideCameraTimeoutMs / 1000)); AddTableEntryPair(pParent, pCamControls, _("Disconnect nonresponsive\ncamera after (seconds)"), m_timeoutVal); } Add(pCamControls); }