private void InitializeCameraSelectionData()
        {
            HideGigEInformation();
            m_busMgr          = new ManagedBusManager();
            m_cameraInfoPanel = new CameraInformationDisplayPanel();
            m_cameraInfoDisplayPanel.Controls.Add(m_cameraInfoPanel);
            m_GigEEnumerationIsDisabled = EnumerationController.IsEnumerationDisabled(InterfaceType.GigE);
            m_gigEInfoPanel             = new GigEInformationDisplayPanel();
            m_gigeInfoDisplayPanel.Controls.Add(m_gigEInfoPanel);

            m_activeDialogs = new Dictionary <uint, DialogHolder>();

            m_timer          = new System.Windows.Forms.Timer();
            m_timer.Interval = 2000;
            m_timer.Tick    += new EventHandler(m_timer_Tick);

            try
            {
                m_busResetHandle = m_busMgr.RegisterCallback(OnBusReset, ManagedCallbackType.BusReset, IntPtr.Zero);
            }
            catch (FC2Exception ex)
            {
                BasePage.ShowErrorMessageDialog("Error registering bus reset callback.", ex);
            }

            m_isLadybugGUI = LadybugChecker.IsLadybugDLLPresent();
            if (m_isLadybugGUI == true)
            {
                this.Text = "Ladybug Camera Selection";
            }
            else
            {
                FC2Version version = ManagedUtilities.libraryVersion;
                this.Text = string.Format(
                    "FlyCapture2 Camera Selection {0}.{1}.{2}.{3}",
                    version.major,
                    version.minor,
                    version.type,
                    version.build);
            }
        }
 protected bool IsLadybug5()
 {
     return(LadybugChecker.IsLadybug5(m_camInfo));
 }
Exemple #3
0
        public void UpdateRadioButtonStatusFromCamera()
        {
            if (m_camera == null)
            {
                // Bad!
                m_mainGroupBox.Enabled = false;
                return;
            }

            m_isUpdatingRadioStatus = true;
            InitializeCurrentVideoModeAndFrameRate();
            bool disableAll = LadybugChecker.IsLadybugDLLPresent() && LadybugChecker.IsLadybug(m_camInfo) && IsCameraStreaming();

            if (m_currentVideoMode == VideoMode.VideoModeFormat7)
            {
                m_format7RadioButton.Checked = true;
                DisableFrameRateButtons();
                m_isUpdatingRadioStatus = false;
                if (m_videoModeRadioButtons != null)
                {
                    for (int y = 0; y < m_videoModeRadioButtons.GetLength(1); y++)
                    {
                        for (int x = 0; x < m_videoModeRadioButtons.GetLength(0); x++)
                        {
                            if (disableAll == true)
                            {
                                m_videoModeRadioButtons[x, y].Enabled = false;
                            }
                            else
                            {
                                m_videoModeRadioButtons[x, y].Enabled = true;
                            }

                            m_videoModeRadioButtons[x, y].Checked = false;
                        }
                    }
                }

                return;
            }
            else
            {
                for (int y = 0; y < m_videoModeRadioButtons.GetLength(1); y++)
                {
                    for (int x = 0; x < m_videoModeRadioButtons.GetLength(0); x++)
                    {
                        if (disableAll)
                        {
                            m_videoModeRadioButtons[x, y].Enabled = false;
                        }
                        else
                        {
                            m_videoModeRadioButtons[x, y].Enabled = true;
                        }

                        if (m_videoModeRadioButtons[x, y].Visible &&
                            (m_currentVideoMode == ((VideoMode)m_videoModeRadioButtons[x, y].Tag)))
                        {
                            m_videoModeRadioButtons[x, y].Checked = true;
                        }
                        else
                        {
                            m_videoModeRadioButtons[x, y].Checked = false;
                        }
                    }
                }
            }

            UpdateCurrentAvailableFrameRate(m_currentVideoMode);
            UpdateCheckStatusForFrameRateRadioButtons();
            m_isUpdatingRadioStatus = false;
        }
Exemple #4
0
        private void CreatePages()
        {
            m_pages = new BasePage[sk_maxNumberOfPages];

            // Using an index allows us to rearrange pages easily simply
            // by moving the page initialization up and down
            int index = 0;

            InitializeCameraSettingPage(index++);
            InitializeDCAMFormatPage(index++);
            InitializeFormat7Page(index++);
            InitializeCameraInformationPage(index++);
            InitializeCameraRegistersPage(index++);
            InitializeGPIOPage(index++);
            InitializeAdvSettingsPage(index++);
            InitializeHighDynamicRangePage(index++);
            InitializeLookUpTablePage(index++);
            InitializeFrameBufferPage(index++);
            InitializeDataFlashPage(index++);
            InitializeSystemInformationPage(index++);
            InitializeBusTopologyPage(index++);
            InitializeHelpSupportPage(index++);

            // Dynamically add Ladybug page according to camera type
            if (LadybugChecker.IsLadybug(m_camInfo) == false)
            {
                if (m_mainTabControl.TabPages.Contains(m_ladyBugTabPage) == true)
                {
                    // Delete ladybug tab page if it already exists
                    m_mainTabControl.TabPages.Remove(m_ladyBugTabPage);
                    m_ladyBugTabPage.Controls.Clear();
                }
            }
            else
            {
                if (m_mainTabControl.TabPages.Contains(m_ladyBugTabPage) == false)
                {
                    // add Ladybug tab page if main tab control does not have this page
                    m_mainTabControl.TabPages.Add(m_ladyBugTabPage);
                }

                InitializeLadybugSettingsPage(index++);

                // Check whether we are being run from Ladybuggui module
                if (LadybugChecker.IsLadybugDLLPresent())
                {
                    // Remove DCAM and Format7 pages when ran from ladybuggui
                    if (m_mainTabControl.TabPages.Contains(m_standardVideoModesTabPage))
                    {
                        m_mainTabControl.TabPages.Remove(m_standardVideoModesTabPage);
                        m_standardVideoModesTabPage.Controls.Clear();
                    }

                    if (m_mainTabControl.TabPages.Contains(m_customVideoModesTabPage))
                    {
                        m_mainTabControl.TabPages.Remove(m_customVideoModesTabPage);
                        m_customVideoModesTabPage.Controls.Clear();
                    }
                }
            }
        }
Exemple #5
0
        private void InitializeModeRadioButtons()
        {
            bool isLadybugGui = LadybugChecker.IsLadybugDLLPresent() && LadybugChecker.IsLadybug(m_camInfo);

            if (IsIIDC())
            {
                m_videoModeRadioButtons = new RadioButton[k_numOfPixelFormat, k_numOfResolutionModes];
                ManagedCamera camera = (ManagedCamera)m_camera;

                // Update the video mode radio buttons
                // Loop through all the video modes
                // For each video mode, loop through all the frame rates
                // If the camera supports this video mode at any frame rate, then
                // the radio button should be shown
                ArrayList supportedVideoMode = GetIIDCSupportedVideoMode(camera);
                for (int y = 0; y < m_videoModeRadioButtons.GetLength(1); y++)
                {
                    for (int x = 0; x < m_videoModeRadioButtons.GetLength(0); x++)
                    {
                        //bool supported = false;
                        string buttonStringName = string.Format("VideoMode{1}{0}", GetNameOfRadioButtonLocationX(x), GetNameOfRadioButtonLocationY(y));
                        m_videoModeRadioButtons[x, y]          = new RadioButton();
                        m_videoModeRadioButtons[x, y].Tag      = null;
                        m_videoModeRadioButtons[x, y].Visible  = false;
                        m_videoModeRadioButtons[x, y].AutoSize = true;
                        m_videoModeRadioButtons[x, y].Anchor   = AnchorStyles.None;
                        m_radioButtonLayout.Controls.Add(m_videoModeRadioButtons[x, y], x, y);
                        foreach (VideoMode videoModeIterator in supportedVideoMode)
                        {
                            if (buttonStringName.Equals(videoModeIterator.ToString()))
                            {
                                m_videoModeRadioButtons[x, y].Visible = true;

                                //TODO: need to check this function is working properly or not, for bug 12879
                                if (isLadybugGui == true && (IsCameraStreaming() == true))
                                {
                                    m_videoModeRadioButtons[x, y].Enabled = false;
                                }
                                else
                                {
                                    m_videoModeRadioButtons[x, y].Enabled = true;
                                }

                                m_videoModeRadioButtons[x, y].Tag = videoModeIterator;
                                if (m_currentVideoMode == videoModeIterator)
                                {
                                    m_videoModeRadioButtons[x, y].Checked = true;
                                }

                                break;
                            }
                        }

                        m_videoModeRadioButtons[x, y].CheckedChanged += new EventHandler(VideoModeRadioButton_CheckedChanged);
                    }
                }

                m_format7RadioButton.Visible = true;
            }
            else if (IsGEV())
            {
                m_videoModeRadioButtons      = null;
                m_format7RadioButton.Visible = true;
            }
        }