Example #1
0
        private void BT_TrajDelete_Click(object sender, EventArgs e)
        {
            if (gv.GetFocusedDataSourceRowIndex() < 0 || gv.RowCount < 1)
            {
                MessageBox.Show("没有路径");
                return;
            }
            //2013.11.19
            //添加批处理删除路径

            Batch_DeleteTraj frmChoose = new Batch_DeleteTraj(CBE_RecipeName.EditValue.ToString(), gv.GetSelectedRows()[0]);

            frmChoose.ShowDialog();
            if (TxtData.PublicData.DeleteTrajIndex == null)
            {
                return;
            }



            if (MessageBox.Show("确定需要删除路径吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 4;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frm.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Example #2
0
        private void BT_OutPort_Click(object sender, EventArgs e)
        {
            if ((FileName = PublicFunc.SfD_Show()) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollOutport));
            Frm_Wait frm = new Frm_Wait("", false);
            frm.ShowDialog();
        }
Example #3
0
 private void BT_Edit_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("确定需要全部清空吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
     {
         return;
     }
     TxtData.PublicData.ErrorCode = 0;
     System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
     Frm_Wait frm = new Frm_Wait();
     frm.ShowDialog();
     Frm_PCAlarm_Load(this,null);
 }
Example #4
0
        private void BT_Edit_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定需要全部清空吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait();

            frm.ShowDialog();
            Frm_PCAlarm_Load(this, null);
        }
Example #5
0
        private void BT_OutPort_Click(object sender, EventArgs e)
        {
            if ((FileName = PublicFunc.SfD_Show()) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollOutport));
            Frm_Wait frm = new Frm_Wait("", false);

            frm.ShowDialog();
        }
Example #6
0
        private void BT_OutPut_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if ((FileName = PublicFunc.SfD_Show(CBE_RecipeName.EditValue.ToString() + ".txt")) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 1;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frm.ShowDialog();
        }
Example #7
0
        private void BT_Delete_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (MessageBox.Show("确定需要删除产品?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 2;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frm.ShowDialog();
            Frm_Recipe_Load(this, null);
        }
Example #8
0
        private void BT_Cs8c_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (!TxtData.XMLConfigure.Reged && CBE_RecipeName.Properties.Items.Count > 4)
            {
                MessageBox.Show("软件未注册,请注册!\n未注册产品总个数不能超过4个!");
                return;
            }



            if (TxtData.DataBase.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.DataBase.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }

            //2013.12.25
            //添加对剩余时间的支持

            if (TxtData.XMLConfigure.LeftUsedDay < 7 && TxtData.XMLConfigure.LeftUsedDay >= 1)
            {
                MessageBox.Show("软件剩余使用天数是" + TxtData.XMLConfigure.LeftUsedDay.ToString() + "天");
            }
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString());

            frm.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Example #9
0
        private void BT_Import_Click(object sender, EventArgs e)
        {
            if (gv.RowCount != 0)
            {
                MessageBox.Show("产品已存在路径");
                return;
            }
            if (CBE_RecipeName.EditValue.ToString() == "" || Frame == null)
            {
                MessageBox.Show("请先建立产品");
                return;
            }
            if ((FileName = PublicFunc.OpenDir_Show()) == null)
            {
                return;
            }
            string[] frm = new string[6];

            if (!PublicFunc.IsFrame(FileName, Frame, ref frm))
            {
                if (MessageBox.Show(
                        "导入文本中的产品坐标系不一致,是否继续导入?" + "\n新建产品坐标系是:"
                        + Frame[0].ToString() + "," + Frame[1].ToString() + "," + Frame[2].ToString() + "," + Frame[3].ToString() + ","
                        + Frame[4].ToString() + "," + Frame[5].ToString() + "\n文本坐标系是:"
                        + frm[0].ToString() + "," + frm[1].ToString() + "," + frm[2].ToString() + "," + frm[3].ToString() + ","
                        + frm[4].ToString() + "," + frm[5].ToString(), "产品坐标系不一致", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }

            TxtData.PublicData.ErrorCode = 0;
            TxtData.PublicData.ErrorLine = 0;
            OperIndex = 3;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frM = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frM.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Example #10
0
        private void BT_RecipeOffset_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (TxtData.DataBase.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.DataBase.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }

            if (!SoapInstance.SoapRead.SetAppdata("sProductName", CBE_RecipeName.EditValue.ToString()))
            {
                MessageBox.Show("设置下位机数据出错!");
                return;
            }

            if (!SoapInstance.SoapRead.SetAppdata("nInterfaceType", 11))
            {
                MessageBox.Show("设置下位机数据出错!");
                return;
            }
            //while (TxtData.DataBase.InterfaceType == 9)
            //{
            //    System.Threading.Thread.Sleep(10);
            //}
            TxtData.PublicData.ErrorCode = 0;
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), true);

            frm.ShowDialog();
            RecipeInfor();
        }
Example #11
0
        private void BT_Teach_Click(object sender, EventArgs e)
        {
            if (TxtData.DataBase.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.DataBase.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }


            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(true);

            frm.ShowDialog();
            Frm_Action_Load(this, null);
        }
Example #12
0
 private void BT_Delete_Click(object sender, EventArgs e)
 {
     if (CBE_RecipeName.EditValue.ToString() == "")
     {
         MessageBox.Show("无产品");
         return;
     }
     if (MessageBox.Show("确定需要删除产品?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
     {
         return;
     }
     TxtData.PublicData.ErrorCode = 0;
     OperIndex = 2;
     System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
     Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);
     frm.ShowDialog();
     Frm_Recipe_Load(this, null);
 }
Example #13
0
        private void BT_Cs8c_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (!TxtData.XMLConfigure.Reged&&CBE_RecipeName.Properties.Items.Count>4)
             {
                 MessageBox.Show("软件未注册,请注册!\n未注册产品总个数不能超过4个!");
                 return;

             }

            if (TxtData.DataBase.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.DataBase.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }

            //2013.12.25
            //添加对剩余时间的支持

            if (TxtData.XMLConfigure.LeftUsedDay < 7 && TxtData.XMLConfigure.LeftUsedDay>=1)
            {
                MessageBox.Show("软件剩余使用天数是" + TxtData.XMLConfigure.LeftUsedDay.ToString() + "天");

            }
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString());
            frm.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Example #14
0
        private void BT_TrajDelete_Click(object sender, EventArgs e)
        {
            if (gv.GetFocusedDataSourceRowIndex() < 0 || gv.RowCount < 1)
            {
                MessageBox.Show("没有路径");
                return;
            }
            //2013.11.19
            //添加批处理删除路径

            Batch_DeleteTraj frmChoose = new Batch_DeleteTraj(CBE_RecipeName.EditValue.ToString(), gv.GetSelectedRows()[0]);
            frmChoose.ShowDialog();
            if (TxtData.PublicData.DeleteTrajIndex==null)
            {
                return;
            }

            if (MessageBox.Show("确定需要删除路径吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 4;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);
            frm.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Example #15
0
        private void BT_ReicpeFrame_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (TxtData.DataBase.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.DataBase.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }
            if (!SoapInstance.SoapRead.SetAppdata("sProductName", CBE_RecipeName.EditValue.ToString()))
            {
                MessageBox.Show("设置下位机数据出错!");
                return;
            }
            if (!SoapInstance.SoapRead.SetAppdata("nInterfaceType", 10))
            {
                MessageBox.Show("设置下位机数据出错!");
                return;
            }
            //while (TxtData.DataBase.InterfaceType == 9)
            //{
            //    System.Threading.Thread.Sleep(10);
            //}
            TxtData.PublicData.ErrorCode = 0;
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(),true);
            frm.ShowDialog();
            RecipeInfor();
        }
Example #16
0
 private void BT_OutPut_Click(object sender, EventArgs e)
 {
     if (CBE_RecipeName.EditValue.ToString() == "")
     {
         MessageBox.Show("无产品");
         return;
     }
     if ((FileName = PublicFunc.SfD_Show(CBE_RecipeName.EditValue.ToString() + ".txt")) == null)
     {
         return;
     }
     TxtData.PublicData.ErrorCode = 0;
     OperIndex = 1;
     System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
     Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);
     frm.ShowDialog();
 }
Example #17
0
        private void BT_Import_Click(object sender, EventArgs e)
        {
            if (gv.RowCount != 0)
            {
                MessageBox.Show("产品已存在路径");
                return;
            }
            if (CBE_RecipeName.EditValue.ToString()==""||Frame==null)
            {
                MessageBox.Show("请先建立产品");
                return;
            }
            if ((FileName = PublicFunc.OpenDir_Show()) == null)
            {
                return;
            }
            string[] frm = new string[6];

            if (!PublicFunc.IsFrame(FileName, Frame,ref frm))
            {
                if (MessageBox.Show(
                    "导入文本中的产品坐标系不一致,是否继续导入?"+"\n新建产品坐标系是:"
                    + Frame[0].ToString() + ","  +Frame[1].ToString() + "," + Frame[2].ToString() + "," + Frame[3].ToString() + ","
                      + Frame[4].ToString() + "," +Frame[5].ToString() +"\n文本坐标系是:"
                    + frm[0].ToString() + ","  +frm[1].ToString() + "," + frm[2].ToString() + "," + frm[3].ToString() + ","
                      + frm[4].ToString() + "," +frm[5].ToString(),"产品坐标系不一致",MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

            }

            TxtData.PublicData.ErrorCode = 0;
            TxtData.PublicData.ErrorLine = 0;
            OperIndex = 3;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frM = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);
            frM.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Example #18
0
        private void BT_Teach_Click(object sender, EventArgs e)
        {
            if (TxtData.DataBase.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.DataBase.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }

            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(true);
            frm.ShowDialog();
            Frm_Action_Load(this, null);
        }