Ejemplo n.º 1
0
        private void LensArtifactMeasurementMode(string s, Args arg)
        {
            Globals.isHighResolution = false;
            IrMode_rb.Checked        = true;

            Globals.digitalGain = 50;
            tricam.setDigitalGain();
            tricam.startLiveMode();
            resume_btn.Enabled            = false;
            isLACod_cbx.Checked           = false;
            grading_btn.Visible           = false;
            whiteLightCapture_btn.Visible = true;
            ModeSelection_gbx.Enabled     = true;
            //IrMode_rb_CheckedChanged(null, null);
            if (Globals.browseBtnClicked)
            {
                tricam.stopLiveMode();
                whiteLightMode_rb.Checked = true;
                f.Publish(f.GradingStill, null);
                whiteLightMode_rb.Checked     = false;
                grading_btn.Visible           = true;
                whiteLightCapture_btn.Visible = false;
                resume_btn.Enabled            = true;
                ModeSelection_gbx.Enabled     = false;
            }
            //else if (IrMode_rb.Checked)
            //{
            //    Globals.isHighResolution = false;
            //    IrMode_rb.Checked = true;
            //    //IRGradingCapture();
            //}
            else if (whiteLightMode_rb.Checked)
            {
                whiteGradingCapture();
            }

            //Recommanded range for Avg peak is only for white light, so disabling when IR selected
            if (tricam.isLiveMode())
            {
                if (IrMode_rb.Checked)
                {
                    if (LA_avgPeakRange_lbl.Visible)
                    {
                        LA_avgPeakRange_lbl.Visible = false;
                        LA_avgPeakRange_lbl.Refresh();
                    }
                }
                else
                {
                    if (LA_avgPeakRange_lbl.Visible)
                    {
                        LA_avgPeakRange_lbl.Visible = true;
                        LA_avgPeakRange_lbl.Refresh();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void whiteLightCapture_btn_Click(object sender, EventArgs e)
 {
     if (tricam.isLiveMode())
     {
         WhiteLightCapture();
         IrImageCapture_btn.Enabled  = false;
         resume_btn.Enabled          = true;
         ModeSelection_panel.Enabled = false;
         Globals.isIlluminationGrid  = false;
         manageIlluminationGrid();
     }
 }
Ejemplo n.º 3
0
        private void CalculateImageMetrics(string s, Args arg)
        {
            if (Globals.whiteBmp == null && Globals.IrBmp == null)
            {
                return;
            }

            if (!Globals.isHighResolution)
            {
                if (tricam.isLiveMode())
                {
                    rowProfile(Globals.IrBmp);  // IR 1Mp
                }
                else
                {
                    rowProfile(Globals.Bmp);  // IR 3MP
                }
            }
            else
            {
                rowProfile(Globals.whiteBmp);
            }

            CalculateAvgBrightness(!Globals.isHighResolution);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Computing from refacto DLL to get Ring parameters when clicked on measure button
        /// </summary>
        private void DoRingCalculations()
        {
            double zeroDiopterR1 = 0.0;
            double sixDiopterR1  = 0.0;

            if (mycamera.isLiveMode() == false)
            {
                RingCapture_Click(null, null);
            }
            MessageBox.Show("please attach the JIG without any lens and press OK");
            //Capture
            RingCapture_Click(null, null);
            mycamera.getFrame();
            GetRingParameters();
            zeroDiopterR1 = rc.rc.R1;
            //GetSensitivity();
            showRingDetails();
            //Display msg box 6D
            if (mycamera.isLiveMode() == false)
            {
                RingCapture_Click(null, null);
            }
            MessageBox.Show("please keep +6D lens inside the JIG and press OK");
            //Capture
            RingCapture_Click(null, null);
            mycamera.getFrame();
            GetRingParameters();
            sixDiopterR1 = rc.rc.R1;
            //getRingParameters
            sensitivity             = sixDiopterR1 - zeroDiopterR1;
            MR.Sensitivity_tbx.Text = sensitivity.ToString("0.00");
            if (sensitivity < 23)
            {
                MR.Sensitivity_tbx.BackColor = Color.Red;
            }
            else
            {
                MR.Sensitivity_tbx.BackColor = Color.Green;
            }
        }
Ejemplo n.º 5
0
 private void overLay_pbx_MouseMove(object sender, MouseEventArgs e)
 {
     if (mouseDrag && isLensArtifactMeasurement)
     {
         if (!Globals.isSetLACord)
         {
             if (Globals.isHighResolution)
             {
                 prevroiRect.X = Globals.WLRoiRect.X;
                 prevroiRect.Y = Globals.WLRoiRect.Y;
                 float x = width / pbWidth;
                 x = e.X * x;
                 Globals.WLRoiRect.X = (int)x + 100;
                 float y = height / pbHeight;
                 y = e.Y * y;
                 Globals.WLRoiRect.Y = (int)y - 100;
             }
             else
             {
                 prevroiRect.X = Globals.IRroiRect.X;
                 prevroiRect.Y = Globals.IRroiRect.Y;
                 float x = width / pbWidth;
                 x = e.X * x;
                 Globals.IRroiRect.X = (int)x + 100;
                 float y = height / pbHeight;
                 y = e.Y * y;
                 Globals.IRroiRect.Y = (int)y - 100;
             }
             drawGridLines();
             if (!tricam.isLiveMode())
             {
                 facade.Publish(facade.SetAoiLensArtifactMeasurement, new Args());
             }
         }
         else
         {
             float x = width / pbWidth;
             x     = e.X * x;
             xCord = (int)x;
             float y = height / pbHeight;
             y     = e.Y * y;
             yCord = (int)y;
             facade.Publish(facade.LAchangeCoordinates, null);
             facade.Publish(facade.SET_LACoordinates, null);
         }
     }
 }
Ejemplo n.º 6
0
        public void CalculateAvgBrightness(bool isIR)
        {
            Tricam tricam = Tricam.createTricam();

            if (isIR)
            {
                Globals.currentSettings.imageMetrics.Average_IR_Light_Intensity = imageMetrics.AverageIntensity;
                if (Globals.currentSettings.imageMetrics.Average_IR_Light_Intensity >= 70 && Globals.currentSettings.imageMetrics.Average_IR_Light_Intensity <= 73)
                {
                    Globals.currentSettings.imageMetrics.averageIntensityLabelColor_IR = Color.Green;
                }
                else
                {
                    Globals.currentSettings.imageMetrics.averageIntensityLabelColor_IR = Color.FromArgb(254, 0, 0);
                }
            }
            else
            {
                Globals.currentSettings.imageMetrics.Average_White_Light_Intensity = imageMetrics.AverageIntensity;
                if (tricam.isLiveMode())
                {
                    if (Globals.currentSettings.imageMetrics.Average_White_Light_Intensity >= 190 && Globals.currentSettings.imageMetrics.Average_White_Light_Intensity <= 200)
                    {
                        Globals.currentSettings.imageMetrics.averageIntensityLabelColor_WL = Color.Green;
                    }
                    else
                    {
                        Globals.currentSettings.imageMetrics.averageIntensityLabelColor_WL = Color.FromArgb(254, 0, 0);
                    }
                }
                else
                {
                    if (Globals.currentSettings.imageMetrics.Average_White_Light_Intensity >= 220 && Globals.currentSettings.imageMetrics.Average_White_Light_Intensity <= 230)
                    {
                        Globals.currentSettings.imageMetrics.averageIntensityLabelColor_WL = Color.Green;
                    }
                    else
                    {
                        Globals.currentSettings.imageMetrics.averageIntensityLabelColor_WL = Color.FromArgb(254, 0, 0);
                    }
                }
            }
        }