private void setApplicationFlow(string UNPW) { switch (UNPW) { case "production": { arg["ApplicationMode"] = Globals.ApplicationFlow.production; break; } case "service": { arg["ApplicationMode"] = Globals.ApplicationFlow.service; break; } case "qa": { arg["ApplicationMode"] = Globals.ApplicationFlow.qa; break; } case "distributor": { arg["ApplicationMode"] = Globals.ApplicationFlow.distributor; break; } default: break; } f.Publish(f.ApplicationMode, arg); }
public void RingCapture_Click(object sender, EventArgs e) { // Measure_ring_btn.Enabled = true;//enable measure ring button only on first capture if (Globals.Retake) { IsZeroPoint.Enabled = true; } if (!Globals.IsLiveCalib) { //to enable save calib button after capture is done for 37time(-12 to +12) when start calib is clicked. Globals.nvramHelper.SetNvramValue(Nvram.NvramHelper.RoyalSettings.AOIRectangleX, (int)AOI_X_UPDOWN.Value); Globals.nvramHelper.SetNvramValue(Nvram.NvramHelper.RoyalSettings.AOIRectangleY, (int)AOI_Y_UPDOWN.Value); if (StartCalibClicked == true) { if (Globals.CalibOver) { SaveCalib_btn.Enabled = true; RingCapture.Enabled = false; } } if (currentState == state.CaptureState) { Args arg = new Args(); RingCapture.Text = "Resume"; RingCapture.Refresh(); arg["isIR"] = false; currentState = state.ResumeState; f.Publish(f.REFRACTO_CAPTURE, arg); //call tricam.ringcapture } else { Globals.isHighResolution = false; RingCapture.Text = "RingCapture"; RingCapture.Refresh(); f.Publish(f.REFRACTO_NO_OF_SPOTS, null); //set display area with grids after resuming to live mode if (!Globals.IsR1R2Mode) { mycamera.initLL(); } mycamera.startLiveMode(); currentState = state.CaptureState; } } }
private void DoRingCalculations() { this.Cursor = Cursors.WaitCursor; //Calculate ring and show rc = RefractoCalculations.GetInstance(); inputRing = new Image <Bgr, byte>(Globals.whiteBmp); forDrawing = inputRing.Copy(); ellipse = rc.CalculateRing(inputRing.Convert <Gray, byte>()); forDrawing = rc.drawEllipse(forDrawing, ellipse, new Bgr(0, 0, 255), 1); overlay = forDrawing; rc.ComputeFullRingThickness(); rc.ComputeRadii(); Sharpness = rc.GetRingSharpness(); showRingDetails(); Args arg = new Args(); Globals.whiteBmp = forDrawing.ToBitmap(); forDrawing.Dispose(); f.Publish(f.displayImage, arg); // = forDrawing.ToBitmap(); this.Cursor = Cursors.Default; }
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(); } } } }
private void IRCapture() { tricam.IRCapture(); args = new Args(); args["isIR"] = true; f.Publish(f.ApplyMask, args); f.Publish(f.Save_Image, args); f.Publish(f.Alignment_Image_Metrics, args); f.Publish(f.Update_Image_Metrics_UI, args); }
//////////////////////////////////////////////////refracto table end private void setDisplayArea(String n, Args args) { ClearDisplayArea(); isLensArtifactMeasurement = false; thresholded_pbx.Visible = false; LA_AfterCorrection_pbx.Visible = false; displayWindow_pbx.BackColor = Color.Black; switch (Globals.currentMode) { case Globals.mode.isMemoryTest: { ODoverlay_pbx.Visible = false; overLay_pbx.Visible = false; dataGridView1.Visible = false; Clear_btn.Visible = false; break; } case Globals.mode.isCameraAlignment: { ODoverlay_pbx.Visible = false; overLay_pbx.Visible = true; maskOverlay = new Bitmap(@"Resources\AlignmentTemplate.bmp"); maskOverlay.MakeTransparent(Color.Black); overLay_pbx.Image = maskOverlay; dataGridView1.Visible = false; Clear_btn.Visible = false; break; } case Globals.mode.isFundusAlignment: { overLay_pbx.Visible = true; ODoverlay_pbx.Visible = true; dataGridView1.Visible = false; Clear_btn.Visible = false; if (!Globals.isIlluminationGrid) { refreshSectorLables(); if (maskOverlay != null) { if (!Globals.isHighResolution) { maskOverlay = new Bitmap(@"Resources\Mask_1MP.bmp"); } else { maskOverlay = new Bitmap(@"Resources\Mask_3MP.bmp"); } maskOverlay.MakeTransparent(Color.White); } Bitmap odOverlaybm = new Bitmap(Globals.IRWidth, Globals.IRheight); Graphics g = Graphics.FromImage(odOverlaybm); g.DrawRectangle(new Pen(Color.FromArgb(255, 0, 148, 255), 2.0f), 550, 160, 75, 110); g.DrawEllipse(new Pen(Color.Red, 2.0f), 580, 230, 2, 2); odOverlaybm.MakeTransparent(Color.Black); ODoverlay_pbx.Image = odOverlaybm; overLay_pbx.Image = maskOverlay; } else { refreshSectorLables(); drawIlluminationGrid(); updateIlluminationGrid(null, null); } break; } case Globals.mode.isLensArtifactMeasurement: { //if (Globals.CameraInitialized) { //facade.Publish(facade.Read_Nvram, null); } overLay_pbx.Visible = true; ODoverlay_pbx.Visible = false; thresholded_pbx.Visible = true; LA_AfterCorrection_pbx.Visible = true; dataGridView1.Visible = false; Clear_btn.Visible = false; if (overlayImage != null) { overlayImage.Dispose(); } if (Globals.isHighResolution) { overlayImage = new Bitmap(Globals.WlWidth, Globals.Wlheight); prevroiRect = Globals.WLRoiRect; } else { overlayImage = new Bitmap(Globals.IRWidth, Globals.IRheight); prevroiRect = Globals.IRroiRect; } width = overlayImage.Width; height = overlayImage.Height; drawGridLines(); overLay_pbx.BackColor = Color.Transparent; overlayImage.MakeTransparent(Color.Black); overLay_pbx.Image = overlayImage; isLensArtifactMeasurement = true; break; } case Globals.mode.isRefractoAlignment: { if (!Globals.isRoyal) { this.Visible = false; } break; } case Globals.mode.isRefractoCalibration: { displayWindow_pbx.BackColor = Color.White; ODoverlay_pbx.Visible = false; overLay_pbx.Visible = true; maskOverlay = new Bitmap(1024, 768); maskOverlay.MakeTransparent(Color.Black); overLay_pbx.Image = maskOverlay; dataGridView1.Visible = true; Clear_btn.Visible = true; dataGridView1.Rows.Clear(); if (Globals.CameraInitialized) { facade.Publish(facade.Read_Nvram, null); drawSpotIndication(); } break; } } }