Esempio n. 1
0
 private void BT_Apply_Click(object sender, EventArgs e)
 {
     db.EditPresetList(PresetName, new double[]
     {
         CBE_IO.SelectedIndex + 1, (double)(SE_1.Value), (double)(SE_2.Value), (double)(SE_3.Value), (double)(SE_4.Value), (double)(SE_5.Value), (double)(SE_6.Value), (double)ND_Z.Value, (double)NUD_Press.Value, (double)NUD_Rel.Value, (double)NUD_Rot.Value, (double)NUD_Speed.Value
     }, TE_Remark.Text);
 }
Esempio n. 2
0
        private void BT_Apply_Click(object sender, EventArgs e)
        {
            double[] data = new double[]   {
                (double)(SE_1.Value), (double)(SE_2.Value), (double)(SE_3.Value),
                (double)(SE_4.Value), (double)(SE_5.Value), (double)(SE_6.Value)
            };
            data = Val3.TrsfTrsf(data, Val3.InverseTrsf(new double[] { 0, 0, (double)(SE_Z.Value), 0, 0, 0 }));
            if (data == null)
            {
                MessageBox.Show("错误");
                return;
            }

            double[] databuff = new double[7];

            for (int i = 0; i < 6; i++)
            {
                databuff[i + 1] = Math.Round(data[i], 3);
            }

            databuff[0] = CBE_IO.SelectedIndex + 1;


            db.EditPresetList(PresetName, databuff, TE_Remark.Text);
        }
Esempio n. 3
0
        private void timer_Refresh_Tick(object sender, EventArgs e)
        {
            Frm_Wait_Load(this, null);
            //  this.Text = TxtData.SoapData.Upload.ToString();
            if (IsUpload)
            {
                PP_process.Caption     = "请等待";
                PP_process.Description = "正在上传...";

                return;
            }
            if (TxtData.PublicData.ErrorCode != 0)
            {
                if (TxtData.PublicData.ErrorCode == 40)
                {
                    if (!NeedUpload)
                    {
                        this.timer_Refresh.Enabled = false;
                        this.Close();
                        return;
                    }
                }
                else
                {
                    PP_process.Caption     = "报错";
                    PP_process.Description = "信息:" + Error[TxtData.PublicData.ErrorCode];//.ToString();
                    timer_Refresh.Enabled  = false;
                    return;
                }
            }

            if (NeedUpload && TxtData.SoapData.InterfaceType == 9)
            {
                PP_process.Caption     = "提示:";
                PP_process.Description = "信息:下位机处在等待界面";
                return;
            }

            PP_process.Caption     = "请等待";
            PP_process.Description = "程序正在运行...";

            #region 需要上传
            if (TxtData.SoapData.Upload && NeedUpload)
            {
                PP_process.Caption     = "请等待";
                PP_process.Description = "正在保存文件...";

                //if (TxtData.PolishData.UploadType==1)
                //{



                //}
                switch (TxtData.PolishData.UploadType)
                {
                case 1:
                {
                    TxtData.PublicData.ErrorCode = (db.EditHome(TxtData.SoapData.Home)) ? 0 : 18;

                    break;
                    ;
                }

                case 2:
                {
                    TxtData.PublicData.ErrorCode = (db.EditPresetList("TOOL", TxtData.SoapData.Tool, TxtData.PolishData.UploadIndex + 1)) ? 0 : 18;

                    break;
                    ;
                }


                case 3:
                {
                    TxtData.PublicData.ErrorCode = (db.EditPresetList("FRAME", TxtData.SoapData.Frame, TxtData.PolishData.UploadIndex + 1)) ? 0 : 18;

                    break;
                    ;
                }
                }


                //if (File.Exists(Application.StartupPath + "\\Txt\\Recipe.txt"))
                //{
                //    File.Delete(Application.StartupPath + "\\Txt\\Recipe.txt");
                //}
                //if (File.Exists(Application.StartupPath + "\\Txt\\Configure.txt"))
                //{
                //    File.Delete(Application.StartupPath + "\\Txt\\Configure.txt");
                //}

                //if (File.Exists(Application.StartupPath + "\\Txt\\Preset.txt"))
                //{
                //    File.Delete(Application.StartupPath + "\\Txt\\Preset.txt");
                //}
                //if (File.Exists(Application.StartupPath + "\\Txt\\Action.txt"))
                //{
                //    File.Delete(Application.StartupPath + "\\Txt\\Action.txt");
                //}

                // ftp = new FtpClient(TxtData.XMLConfigure.IpAddress);
                // string Strdate = "_" + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();

                //switch (TxtData.SoapData.InterfaceType)
                //{
                //     //保存工艺
                //    case 3:
                //        {
                //            TxtData.PublicData.ErrorCode = ftp.DownLoadPreset() ? 0 : 13;
                //            if (TxtData.PublicData.ErrorCode==0)
                //            {

                //                TxtData.PublicData.ErrorCode = (db.ImportPreset(Application.StartupPath + "\\Txt\\Preset.txt","StaubliPreset") == 0) ? 0 : 17;
                //                File.Copy(Application.StartupPath + "\\Txt\\Preset.txt", Application.StartupPath + "\\Log\\Preset" + Strdate + ".txt",true);
                //            }


                //            break;


                //        }


                //        //动作
                //    case 4:
                //        {
                //            TxtData.PublicData.ErrorCode = ftp.DownLoadAction() ? 0 : 14;
                //            if (TxtData.PublicData.ErrorCode == 0)
                //            {
                //                TxtData.PublicData.ErrorCode = (db.ImportAction(Application.StartupPath+"\\Txt\\Action.txt")==0) ? 0 : 18;
                //                File.Copy(Application.StartupPath + "\\Txt\\Action.txt", Application.StartupPath + "\\Log\\Action" + Strdate + ".txt", true);
                //            }


                //            break;


                //        }
                //        //产品
                //    case 5:
                //        {
                //            IsUpload = true;
                //            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
                //            return;

                //        }

                //    case 10:
                //        {
                //            TxtData.Recipe.RecipeFrame = RobotKit.StaubliXML.GetXMLCarten("fFrame", SoapInstance.SoapRead.GetAppdata());
                //            TxtData.PublicData.ErrorCode =(TxtData.Recipe.RecipeFrame!=null) ? 0 : 36;
                //            if (TxtData.PublicData.ErrorCode == 0)
                //            {
                //                TxtData.PublicData.ErrorCode = db.EditRecipeFrame(RecipeName,TxtData.Recipe.RecipeFrame)? 0 : 37;
                //            }


                //            break;


                //        }

                //    case 11:
                //        {
                //            TxtData.Recipe.RecipeFrame = RobotKit.StaubliXML.GetXMLCarten("fOffset",SoapInstance.SoapRead.GetAppdata());
                //            TxtData.PublicData.ErrorCode =(TxtData.Recipe.RecipeFrame != null) ? 0 : 36;
                //            if (TxtData.PublicData.ErrorCode == 0)
                //            {
                //                TxtData.PublicData.ErrorCode = db.EditRecipeOffset(RecipeName, TxtData.Recipe.RecipeFrame) ? 0 : 37;
                //            }
                //            break;


                //        }
                //    case 7:
                //    case 12:
                //    case 14:
                //    case 15:
                //    case 16:
                //    case 17:
                //    case 18:
                //    case 19:
                //        {
                //            TxtData.PublicData.ErrorCode = ftp.DownLoadConfigure() ? 0 : 15;
                //            if (TxtData.PublicData.ErrorCode == 0)
                //            {
                //                TxtData.PublicData.ErrorCode = db.ImportConfigure() == 0 ? 0 : 19;
                //                File.Copy(Application.StartupPath + "\\Txt\\Configure.txt", Application.StartupPath + "\\Log\\Configure" + Strdate + ".txt", true);
                //            }


                //            break;


                //        }



                // }
                if (TxtData.PublicData.ErrorCode == 0)
                {
                    TxtData.PublicData.ErrorCode = RobotKit.SoapInstance.SoapRead.SetAppdata("bUpload", false)?0:12;
                }
                if (TxtData.PublicData.ErrorCode == 0)
                {
                    PP_process.Caption     = "成功";
                    PP_process.Description = "信息:上传成功";

                    while (TxtData.SoapData.Upload)
                    {
                        System.Threading.Thread.Sleep(10);
                    }
                }
            }
            #endregion
        }
Esempio n. 4
0
 private void BT_Apply_Click(object sender, EventArgs e)
 {
     db.EditPresetList(PresetName, new int[] { CBE_IO.SelectedIndex + 1, (int)(SE_1.Value), (int)(SE_2.Value), (int)(SE_3.Value), (int)(SE_4.Value), (int)(SE_5.Value) }, TE_Remark.Text);
 }