Exemple #1
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            Machine.Instance.Robot.CalibPrm.NeedlePosition       = this.needlePos;
            Machine.Instance.Robot.CalibPrm.NeedlePosZPlasticene = this.needlePosZPlasticene;
            Machine.Instance.Robot.CalibPrm.NeedleRotated        = this.angleRotated;
            Machine.Instance.Robot.CalibPrm.AngleGap             = this.angleGap;

            Machine.Instance.Robot.CalibPrm.Direct       = this.ckbReverse.Checked ? -1 : 1;
            Machine.Instance.Robot.CalibPrm.TestPosition = this.testPos;
            Machine.Instance.Robot.CalibPrm.TestPosZ     = this.testPosZ;

            Machine.Instance.Robot.SaveCalibPrm();

            Properties.Settings.Default.needleP1X = this.p1.X;
            Properties.Settings.Default.needleP1Y = this.p1.Y;
            Properties.Settings.Default.needleP2X = this.p2.X;
            Properties.Settings.Default.needleP2Y = this.p2.Y;
            Properties.Settings.Default.needleP3X = this.p3.X;
            Properties.Settings.Default.needleP3Y = this.p3.Y;
            Properties.Settings.Default.needleP4X = this.p4.X;
            Properties.Settings.Default.needleP4Y = this.p4.Y;

            NeedleCalibrationSetting.Save();
            this.Close();
        }
Exemple #2
0
 public static void Load()
 {
     Default = JsonUtil.Deserialize <NeedleCalibrationSetting>(typeof(NeedleCalibrationSetting).Name);
     if (Default == null)
     {
         Default = new NeedleCalibrationSetting();
     }
 }
Exemple #3
0
        private void DialogNeedleAngle_Load(object sender, EventArgs e)
        {
            NeedleCalibrationSetting.Load();
            this.inspection = InspectionMgr.Instance.FindBy(NeedleCalibrationSetting.Default.NeedleMeasurePrm.InspectionKey);

            this.cameraControl1.SetExposure(NeedleCalibrationSetting.Default.NeedleMeasurePrm.ExposureTime);
            this.cameraControl1.SetGain(NeedleCalibrationSetting.Default.NeedleMeasurePrm.Gain);
            this.cameraControl1.SelectLight(NeedleCalibrationSetting.Default.NeedleMeasurePrm.ExecutePrm);

            this.nudUpper.Increment     = (decimal)0.001;
            this.nudUpper.DecimalPlaces = 3;
            this.nudLower.Increment     = (decimal)0.001;
            this.nudLower.DecimalPlaces = 3;

            this.nudUpper.Value = (decimal)NeedleCalibrationSetting.Default.NeedleMeasurePrm.Upper;
            this.nudLower.Value = (decimal)NeedleCalibrationSetting.Default.NeedleMeasurePrm.Lower;

            this.UpdateByFlag();
        }