Beispiel #1
0
        public BarcodeCmd(RunnableModule runnableModule, BarcodeCmdLine barcodeCmdLine) : base(runnableModule, barcodeCmdLine)
        {
            var structure = runnableModule.CommandsModule.program.ModuleStructure;

            this.position   = structure.ToMachine(runnableModule, barcodeCmdLine.PosInPattern);
            this.barcodePrm = barcodeCmdLine.BarcodePrm;
        }
Beispiel #2
0
        public EditBarcodeForm(Pattern pattern, BarcodeCmdLine barcodeCmdLine)
            : base(pattern.GetOriginPos())
        {
            InitializeComponent();
            for (int i = 30; i < 40; i++)
            {
                this.comboBox1.Items.Add(i);
            }
            this.pattern = pattern;
            this.origin  = pattern.GetOriginPos();
            if (barcodeCmdLine == null)
            {
                isCreating          = true;
                this.barcodeCmdLine = new BarcodeCmdLine();
                this.barcodeCmdLine.BarcodePrm.ExposureTime = Machine.Instance.Camera.Prm.Exposure;
                this.barcodeCmdLine.BarcodePrm.Gain         = Machine.Instance.Camera.Prm.Gain;
                this.barcodeCmdLine.BarcodePrm.ExecutePrm   = (ExecutePrm)Machine.Instance.Light.ExecutePrm.Clone();
            }
            else
            {
                isCreating          = false;
                this.barcodeCmdLine = barcodeCmdLine;
            }
            //系统坐标->机械坐标
            PointD p = this.pattern.MachineRel(this.barcodeCmdLine.PosInPattern);

            tbLocationX.Text = p.X.ToString("0.000");
            tbLocationY.Text = p.Y.ToString("0.000");

            this.nudSettingTime.Minimum = 0;
            this.nudSettingTime.Maximum = 5000;
            this.nudSettingTime.Value   = this.barcodeCmdLine.BarcodePrm.SettlingTime;

            this.inspection             = InspectionMgr.Instance.FindBy(this.barcodeCmdLine.BarcodePrm.InspectionKey);
            this.comboBox1.SelectedItem = this.barcodeCmdLine.BarcodePrm.InspectionKey;

            this.cameraControl1.SetExposure(this.barcodeCmdLine.BarcodePrm.ExposureTime);
            this.cameraControl1.SetGain(this.barcodeCmdLine.BarcodePrm.Gain);
            this.cameraControl1.SelectLight(this.barcodeCmdLine.BarcodePrm.ExecutePrm);
            this.SetupLight(this.barcodeCmdLine.BarcodePrm.ExecutePrm);

            this.nudMinLength.Value = this.barcodeCmdLine.BarcodePrm.MinLength;
            this.nudMaxLength.Value = this.barcodeCmdLine.BarcodePrm.MaxLength;
            this.rbnTaught.Checked  = true;

            this.cmbFindCodeMethod.Items.Add(FindBarCodeType.ASV);
            this.cmbFindCodeMethod.Items.Add(FindBarCodeType.AFM);
            this.cmbFindCodeMethod.SelectedItem = this.barcodeCmdLine.BarcodePrm.FindBarCodeType;

            this.ReadLanguageResources();
        }