コード例 #1
0
ファイル: MainForm.cs プロジェクト: w7789475/EVOK
        private void stbtn_Click_1(object sender, EventArgs e)
        {
            startBtn(false);

            DialogResult dr3 = MessageBox.Show("是否继续启动,设备是否已复位,气泵是够已开?", "启动提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);//触发事件进行提示

            if (dr3 == DialogResult.No)
            {
                return;
            }

            DialogResult dr = MessageBox.Show("是否继续启动,数据是否已排版?", "启动提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);//触发事件进行提示

            if (dr == DialogResult.No)
            {
                return;
            }

            List <int> deviceIdLst = new List <int>();

            //下料锯
            if (button2.BackColor == Color.Red)
            {
                DialogResult dr0 = MessageBox.Show("是否继续启动,下料锯原料位置是否正确?", "启动提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);//触发事件进行提示

                if (dr0 == DialogResult.No)
                {
                    return;
                }

                if (opXiaLiao.ProdInfoLst.Count < 1)
                {
                    MessageBox.Show("下料锯无数据!");
                    return;
                }
                deviceIdLst.Add(Constant.doorSizeId);
            }
            //门皮
            if (button3.BackColor == Color.Red)
            {
                DialogResult dr2 = MessageBox.Show("是否继续启动,门皮板锯原料尺寸是否正确?", "启动提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);//触发事件进行提示

                if (dr2 == DialogResult.No)
                {
                    return;
                }

                if (opDoorShell.ProdInfoLst.Count < 1)
                {
                    MessageBox.Show("门皮无数据!");
                    return;
                }

                deviceIdLst.Add(Constant.doorShellId);
            }

            //门板
            if (button4.BackColor == Color.Red)
            {
                DialogResult dr1 = MessageBox.Show("是否继续启动,门芯板锯是否有余料?原料尺寸是否正确?", "启动提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);//触发事件进行提示

                if (dr1 == DialogResult.No)
                {
                    return;
                }
                if (opDoorBan.ProdInfoLst.Count < 1)
                {
                    MessageBox.Show("门板无数据!");
                    return;
                }
                deviceIdLst.Add(Constant.doorBanId);
            }

            if (deviceIdLst.Count == 0)
            {
                startBtn(true);
                MessageBox.Show("请先使能设备!");
                return;
            }

            //判断数据是否已生成
            if (evokWork0.IsLineReady(deviceIdLst))
            {
                evokWork0.downLoadTest(deviceIdLst, opXiaLiao, opDoorBan, opDoorShell);
            }
            else
            {
                MessageBox.Show("设备未就绪!");
            }

            startBtn(true);
        }