コード例 #1
0
 public FormToZero(ToZeroInfo info, AxisSetInfo setInfo)
 {
     InitializeComponent();
     this.bindingSource1.DataSource = info;
     this.chkW.Enabled = !setInfo.IgnoreW;
     this.chkZ.Enabled = !setInfo.IgnoreZ;
     this.chkB.Enabled = !setInfo.IgnoreB;
     this.chkC.Enabled = !setInfo.IgnoreC;
     this.chkX.Enabled = !setInfo.IgnoreX;
     this.chkY.Enabled = !setInfo.IgnoreY;
 }
コード例 #2
0
ファイル: FormToZero.cs プロジェクト: JefferyXuHao/Contra-DC
 public FormToZero(ToZeroInfo info,AxisSetInfo setInfo)
 {
     InitializeComponent();
     this.bindingSource1.DataSource = info;
     this.chkW.Enabled = !setInfo.IgnoreW;
     this.chkZ.Enabled = !setInfo.IgnoreZ;
     this.chkB.Enabled = !setInfo.IgnoreB;
     this.chkC.Enabled = !setInfo.IgnoreC;
     this.chkX.Enabled = !setInfo.IgnoreX;
     this.chkY.Enabled = !setInfo.IgnoreY;
 }
コード例 #3
0
ファイル: FormMain.cs プロジェクト: JefferyXuHao/Contra-DC
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            LoadPnc();
            string path = Path.Combine(Application.StartupPath, "OverrideLogo.jpg");
            if (File.Exists(path))
            {
                this.picLogo.Image = this.picLogo.Image = Image.FromFile(path);
            }
            this.timer.Enabled = true;
            this.timerWheel.Enabled = true;
            this.timerCOrigin.Enabled = true;
            this.timerTime.Enabled = true;
            this.timerPlcCheck.Enabled = true;
            this.timerPlcCheck2.Enabled = true;
            this.btnLight.Checked = true;
            this.btnBuzzing.Checked = true;
            this.watch = new ButtonWatch();
            this.watch.WatchButtons = 7;
            watch.ButtonEvent += new Action<ButtonWatchEventArgs>(watch_ButtonEvent);
            DataTable throwModeTable = new DataTable();
            throwModeTable.Columns.Add("ID");
            throwModeTable.Columns.Add("Name");

            throwModeTable.Rows.Add("0", L.R("FormMain.ThrowMode.NotThrow", "不使用"));
            throwModeTable.Rows.Add("1", L.R("FormMain.ThrowMode.Mode1", "模式1"));
            throwModeTable.Rows.Add("2", L.R("FormMain.ThrowMode.Mode2", "模式2"));

            this.axisControl1.SetBinding(this.bindingSource, "G54");
            this.axisControl1.SetVisible(this.AxisSet);

            this.repositoryItemThrowMode.DataSource = throwModeTable;

            btnSpeed.CheckedChanged += new EventHandler(btnSpeed_CheckedChanged);
            btnSpeed.Checked = AxisSet.UseHighSpeed;
            btnFushi.Value = AxisSet.UseFushi;
            btnMen.Value = AxisSet.UseMen;
            btnSpeed.DataBindings.Add(new Binding("Checked", AxisSet, "UseHighSpeed", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));

            if (OtherSet.ShowStartZeroForm)
            {
                FormStartZero form = new FormStartZero();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    var toZeroInfo = new ToZeroInfo();
                    DialogResult result = System.Windows.Forms.DialogResult.OK;
                    if (form.ZeroInfo.IsZeroAll)
                    {
                        toZeroInfo.IsZeroZ = true;
                        toZeroInfo.IsZeroX = true;
                        toZeroInfo.IsZeroY = true;
                        toZeroInfo.IsZeroW = true;
                        toZeroInfo.IsZeroB = true;
                        toZeroInfo.IsZeroC = true;
                        toZeroInfo.IsZeroA = true;
                        result = System.Windows.Forms.DialogResult.Yes;
                    }
                    else
                    {
                        toZeroInfo.IsZeroZ = true;
                    }
                    ToZero(toZeroInfo, result);
                }
            }
            //watch.ButtonEvent += new Action<ButtonWatchEventArgs>(watch_ButtonEvent);
        }
コード例 #4
0
ファイル: FormMain.cs プロジェクト: JefferyXuHao/Contra-DC
        void waitFrm_WaitEvent()
        {
            waitFrm.Ar.WaitOne();
            this.WindowState = FormWindowState.Maximized;
            setting.Contra = setting.Contra ?? new ContraInfo();
            this.bindingSource.DataSource = setting.Contra;
            this.bindingSourceAxisSet.DataSource = new AxisModifyInfo();
            card.InitBoard();
            try
            {
                IOHelper.StartShifu();
            }
            catch (Exception)
            {

            }
            card.SetOutCheck();
            IOHelper.SetHitProtect(1);
            ZeroInfo = new ToZeroInfo();
            DrawKuaijie();
        }
コード例 #5
0
ファイル: FormMain.cs プロジェクト: JefferyXuHao/Contra-DC
        private void ToZero(ToZeroInfo info, DialogResult result)
        {
            isZero = true;
            isZeroAttemp = 0;
            isCOrigined = false;
            zeroInfo = info;
            if ((info.IsZeroX || result == DialogResult.Yes) && !AxisSet.IgnoreX)
            {
                if (AbsolutePosSet.UseAbsolutePos || AbsolutePosSet.UseFushiAbsolutePos)
                {
                    card.SingleMoveX(new HoleInfo() { X = this.CurrInfo.GetActPosX(axisType) - this.CurrInfo.LogPosX }, this.axisType);
                }
                else
                {
                    card.Home(AxisSet.AxisX, 0, CurrInfo.StartSpeed, AxisSet.SpeedXPerSecond, 2000, 4000, 0);
                }
            }
            if ((info.IsZeroY || result == DialogResult.Yes) && !AxisSet.IgnoreY)
            {
                if (AbsolutePosSet.UseAbsolutePos || AbsolutePosSet.UseFushiAbsolutePos)
                {
                    card.SingleMoveY(new HoleInfo() { Y = this.CurrInfo.GetActPosY(axisType) - this.CurrInfo.LogPosY }, this.axisType);
                }
                else
                {
                    card.Home(AxisSet.AxisY, 0, CurrInfo.StartSpeed, AxisSet.SpeedYPerSecond, 2000, 4000, 0);
                }
            }
            if ((info.IsZeroW || result == DialogResult.Yes) && !AxisSet.IgnoreW)
            {
                card.SingleMoveW(new HoleInfo() { W = 1000000 }, this.axisType);
            }
            if ((info.IsZeroZ || result == DialogResult.Yes) && !AxisSet.IgnoreZ)
            {
                card.SingleMoveZ(new HoleInfo() { Z = 1000000 }, this.axisType);
                plcHelper.SendMsg(PortHelper.ZUpOn);
            }
            if ((info.IsZeroB || result == DialogResult.Yes) && !AxisSet.IgnoreB)
            {
                card.SingleMoveB(new HoleInfo() { B = this.CurrInfo.GetActPosB(axisType) - this.CurrInfo.LogPosB }, this.axisType);
            }
            if ((info.IsZeroC || result == DialogResult.Yes) && !AxisSet.IgnoreC)
            {
                cOriginCount = 0;
                card.SingleMoveC(new HoleInfo() { C = 1000000 }, this.axisType, 10000);

                //card.SingleMoveC(new HoleInfo() { C = this.CurrInfo.GetActPosC(axisType) - this.CurrInfo.LogPosC }, this.axisType);
            }
        }