Пример #1
0
 public RefractoCalibration()
 {
     InitializeComponent();
     mycamera = Tricam.createTricam();
     f        = Facade.getInstance();
     f.Subscribe(f.REFRACTO_CALCULATIONS_COMPLETE, new NotificationHandler(onRefractoCalculationsComplete)); //To save calibration file
     f.Subscribe(f.REFRACTO_SPOTS_DETECTED, new NotificationHandler(onSpotsDetected));                       //For autoCapture
     f.Subscribe(f.REFRACTO_FOCUSKNOB_STATUS, new NotificationHandler(onFocusKnobChanged));                  //to display proximity status
     f.Subscribe(f.SetRefractoCalibrationMode, new NotificationHandler(GetValuesFromNvram));
     //IsZeroPoint.Enabled = false;
     SaveCalib_btn.Enabled = false;
     if (!Globals.IsR1R2Mode)
     {
         mycamera.initLL(); //initialize Liquid lens
     }
     if (Globals.CameraInitialized)
     {
         Globals.nvramHelper.SetNvramValue(Nvram.NvramHelper.RoyalSettings.RefractoGain, (int)Refracto_Gain_Updown.Value);
         Globals.nvramHelper.SetNvramValue(Nvram.NvramHelper.RoyalSettings.DisplayCentreX, (int)DisplayCenter_X_UpDown.Value);
         Globals.nvramHelper.SetNvramValue(Nvram.NvramHelper.RoyalSettings.DisplayCentreY, (int)DisplayCenter_Y_UpDown.Value);
         Globals.currentSettings.royalSettings.DisplayCenter_X = (int)DisplayCenter_X_UpDown.Value;
         Globals.currentSettings.royalSettings.DisplayCenter_Y = (int)DisplayCenter_Y_UpDown.Value;
         Globals.currentSettings.royalSettings.AOI_X           = (int)AOI_X_UPDOWN.Value;
         Globals.currentSettings.royalSettings.AOI_Y           = (int)AOI_Y_UPDOWN.Value;
         Globals.currentSettings.royalSettings.Refracto_Gain   = (int)Refracto_Gain_Updown.Value;
     }
 }
Пример #2
0
 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;
         }
     }
 }