Exemplo n.º 1
0
        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);
                ex.Dispose();
            }

            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);
            }
        }
Exemplo n.º 2
0
        private bool CheckGigEEnumeration()
        {
            // Prompt to enable GigE enumeration
            bool isDisabled = EnumerationController.IsEnumerationDisabled(InterfaceType.GigE);

            if (isDisabled)
            {
                DialogResult result = MessageBox.Show(
                    "GigE enumeration is currently disabled on the system. Do you wish to enable it?",
                    "Enable GigE enumeration?",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    try
                    {
                        EnumerationController.SetEnumerationDisabled(InterfaceType.GigE, false);
                        m_GigEEnumerationIsDisabled = true;
                        MessageBox.Show(
                            "GigE cameras will now be visible!",
                            "GigE enumeration enabled",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Information);

                        return(true);
                    }
                    catch (System.Security.SecurityException ex)
                    {
                        MessageBox.Show(
                            "Elevated permission is required to perform Force IP. Please restart application as administrator and try again.",
                            "Operation Failed!",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Warning);

                        return(false);
                    }
                    catch (System.Exception ex)
                    {
                        MessageBox.Show(
                            "A problem was encountered while performing Force IP. Please try again.",
                            "Operation Failed!",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Warning);

                        return(false);
                    }
                }
                else
                {
                    MessageBox.Show(
                        "GigE cameras will not be visible!",
                        "GigE enumeration not enabled",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                    m_GigEEnumerationIsDisabled = false;
                    return(false);
                }
            }
            else
            {
                return(true);
            }
        }