public void UpdateBadCameraInformation(CameraInfo cameraInfo)
        {
            m_model.Text             = cameraInfo.modelName;
            m_vendor.Text            = cameraInfo.vendorName;
            m_sensor.Text            = "N/A";
            m_resolution.Text        = "N/A";
            m_interface.Text         = InterfaceTranslator.GetInterfaceString(cameraInfo.interfaceType);
            m_busSpeed.Text          = BusSpeedTranslator.GetBusSpeedString(cameraInfo.maximumBusSpeed);
            m_pciEBusSpeed.Text      = BusSpeedTranslator.GetPCIeBusSpeedString(cameraInfo.pcieBusSpeed);
            m_iidcVersion.Text       = "N/A";
            m_firmwareVersion.Text   = "N/A";
            m_firmwareBuildTime.Text = "N/A";
            m_driver.Text            = "N/A";


            if (cameraInfo.interfaceType == InterfaceType.Usb3 &&
                cameraInfo.pcieBusSpeed == PCIeBusSpeed.Speed_2_5)
            {
                // Insufficient speed, set the text to red
                m_pciEBusSpeed.ForeColor = Color.Red;
                toolTipPCIeBusSpeed.SetToolTip(m_pciEBusSpeed, "PCIe bus speed is too low - USB 3.0 performance may be degraded");
                toolTipPCIeBusSpeed.Active = true;
            }
            else
            {
                m_pciEBusSpeed.ForeColor   = m_pciEBusSpeedLabel.ForeColor;
                toolTipPCIeBusSpeed.Active = false;
            }

            // Reset tooltip and text color
            if (m_driverTooltip == null)
            {
                m_driverTooltip = new ToolTip();
            }

            m_driver.ForeColor     = m_driverLabel.ForeColor;
            m_driverTooltip.Active = false;

            if (IsLadybug2)
            {
                const uint Ladybug2HeadRegAddress = 0x1F80;
                uint       uiHeadNumber           = 0;
                try
                {
                    uiHeadNumber = m_camera.ReadRegister(Ladybug2HeadRegAddress);
                }
                catch (FC2Exception ex)
                {
                    BasePage.ShowErrorMessageDialog("Unable to read head number in the register. Initialize camera information page failed.", ex);
                    ClearInformation();
                    return;
                }

                m_serialNumber.Text = string.Format("{0} (Head S/N.{1}", cameraInfo.serialNumber, uiHeadNumber);
            }
            else
            {
                m_serialNumber.Text = cameraInfo.serialNumber.ToString();
            }
        }
示例#2
0
        public void UpdateCameraInformation(CameraInfo cameraInfo)
        {
            m_model.Text             = cameraInfo.modelName;
            m_vendor.Text            = cameraInfo.vendorName;
            m_sensor.Text            = cameraInfo.sensorInfo;
            m_resolution.Text        = cameraInfo.sensorResolution;
            m_interface.Text         = InterfaceTranslator.GetInterfaceString(cameraInfo.interfaceType);
            m_busSpeed.Text          = BusSpeedTranslator.GetBusSpeedString(cameraInfo.maximumBusSpeed);
            m_pciEBusSpeed.Text      = BusSpeedTranslator.GetPCIeBusSpeedString(cameraInfo.pcieBusSpeed);
            m_iidcVersion.Text       = string.Format("{0:0.##}", (float)cameraInfo.iidcVersion / 100.0f);
            m_firmwareVersion.Text   = cameraInfo.firmwareVersion;
            m_firmwareBuildTime.Text = cameraInfo.firmwareBuildTime;
            m_driver.Text            = cameraInfo.driverName;

            if (m_camera == null || m_camera.IsConnected() == false)
            {
                Debug.WriteLine("Camera not found or disconnected");
                ClearInformation();
                return;
            }

            if (cameraInfo.interfaceType == InterfaceType.Usb3 &&
                cameraInfo.pcieBusSpeed == PCIeBusSpeed.Speed_2_5)
            {
                // Insufficient speed, set the text to red
                m_pciEBusSpeed.ForeColor = Color.Red;
                toolTipPCIeBusSpeed.SetToolTip(m_pciEBusSpeed, "PCIe bus speed is too low - USB 3.0 performance may be degraded");
                toolTipPCIeBusSpeed.Active = true;
            }
            else
            {
                m_pciEBusSpeed.ForeColor   = m_pciEBusSpeedLabel.ForeColor;
                toolTipPCIeBusSpeed.Active = false;
            }

            if (cameraInfo.interfaceType == InterfaceType.GigE && !m_driverIsCompatible)
            {
                m_driver.ForeColor = Color.Red;
                if (m_driverTooltip == null)
                {
                    m_driverTooltip = new ToolTip();
                }
                m_driverTooltip.SetToolTip(m_driver, m_driverTooltipText);
                m_driverTooltip.Active = true;
            }
            else
            {
                if (m_driverTooltip == null)
                {
                    m_driverTooltip = new ToolTip();
                }
                m_driver.ForeColor     = m_driverLabel.ForeColor;
                m_driverTooltip.Active = false;
            }

            if (IsLadybug2)
            {
                const uint Ladybug2HeadRegAddress = 0x1F80;
                uint       uiHeadNumber           = 0;
                try
                {
                    uiHeadNumber = m_camera.ReadRegister(Ladybug2HeadRegAddress);
                }
                catch (FC2Exception ex)
                {
                    BasePage.ShowErrorMessageDialog("Unable to read head number in the register. Initialize camera information page failed.", ex);
                    ClearInformation();
                    ex.Dispose();
                    return;
                }

                m_serialNumber.Text = string.Format("{0} (Head S/N.{1}", cameraInfo.serialNumber, uiHeadNumber);
            }
            else
            {
                m_serialNumber.Text = cameraInfo.serialNumber.ToString();
            }
        }