Ejemplo n.º 1
0
        /// <summary>
        /// Initialize Packet Size (Bandwidth) controls
        /// </summary>
        private void InitializeBandwidthControls()
        {
            // Check whether Cameracontrol is run by Ladybuggui with a Ladybug camera
            // If not, bandwidth control is hidden on LadybugSettings page, because
            // it could cause confusion with Packet Size control on Custom Format page
            if (!LadybugChecker.IsLadybugDLLPresent() || !LadybugChecker.IsLadybug(m_camInfo))
            {
                HideBandWidthControls();
                return;
            }

            // Disable packet size controls if ladybug camera was not in F7
            if (IsCurrentlyInFormat7())
            {
                Format7Info fmt7Info = new Format7Info();
                try
                {
                    fmt7Info = QueryFormat7Info();
                    UpdatePacketSize(fmt7Info.packetSize, fmt7Info);
                    InitializeBandwidthControlEvents();
                    SetBandWidthControlEnabledStatus(true);
                }
                catch (System.Exception ex)
                {
                    ShowErrorMessageDialog("Unable to get Format7 Configuration.", ex);

                    // Disable bandwidth control if there was an error querying F7 mode
                    SetBandWidthControlEnabledStatus(false);
                }
            }
            else
            {
                SetBandWidthControlEnabledStatus(false);
            }
        }
Ejemplo n.º 2
0
 protected bool IsLadybugModel()
 {
     return(LadybugChecker.IsLadybug(m_camInfo));
 }
Ejemplo n.º 3
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();
                    }
                }
            }
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 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;
            }
        }