private void button1_Click(object sender, EventArgs e)  //保存
        {
            VarClass.BigZ_Location[0] = Convert.ToDouble(textHighLocation_Big.Text);
            VarClass.AutoSpeed[0]     = Convert.ToDouble(textAutoSpeed_Big.Text);
            VarClass.High_Wel[0]      = Convert.ToDouble(textHomeSpeed_Big.Text);

            VarClass.SmallZ_Location[0] = Convert.ToDouble(textHighLocation_Small.Text);
            VarClass.SmallZ_Location[1] = Convert.ToDouble(textLowLocation_Small.Text);
            VarClass.AutoSpeed[1]       = Convert.ToDouble(textAutoSpeed_Small.Text);
            VarClass.High_Wel[1]        = Convert.ToDouble(textHomeSpeed_Small.Text);

            VarClass.ScanZ_Location[0] = Convert.ToDouble(textHighLocation_Scan.Text);
            // VarClass.ScanZ_Location[1] = Convert.ToDouble(textScanLocation_Scan.Text);
            VarClass.AutoSpeed[2] = Convert.ToDouble(textAutoSpeed_Scan.Text);
            VarClass.High_Wel[2]  = Convert.ToDouble(textHomeSpeed_Scan.Text);

            VarClass.XAxis_Location[0] = Convert.ToDouble(textChangeLocation_XAxis.Text);
            //VarClass.XAxis_Location[1] = Convert.ToDouble(textScanLocation_XAxis.Text);
            //VarClass.XAxis_Location[2] = Convert.ToDouble(textImpact_Location_XAxis.Text);
            VarClass.AutoSpeed[3] = Convert.ToDouble(textAutoSpeed_XAxis.Text);
            VarClass.High_Wel[3]  = Convert.ToDouble(textHomeSpeed_XAxis.Text);

            VarClass.YAxis_Location[0] = Convert.ToDouble(textChangeLocation_YAxis.Text);
            //VarClass.YAxis_Location[1] = Convert.ToDouble(textScanLocation_YAxis.Text);
            //VarClass.YAxis_Location[2] = Convert.ToDouble(textImpact_Location_YAxis.Text);
            VarClass.AutoSpeed[4] = Convert.ToDouble(textAutoSpeed_YAxis.Text);
            VarClass.High_Wel[4]  = Convert.ToDouble(textHomeSpeed_YAxis.Text);


            if (MessageBox.Show("是否保存", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
            {
                PublicClass.WritePrivateProfileString("AxisPara", "HighLocation_Big", VarClass.BigZ_Location[0].ToString(), VarClass.iniPath);       //
                PublicClass.WritePrivateProfileString("AxisPara", "AutoSpeed_Big", VarClass.AutoSpeed[0].ToString(), VarClass.iniPath);              //
                PublicClass.WritePrivateProfileString("AxisPara", "HomeSpeed_Big", VarClass.High_Wel[0].ToString(), VarClass.iniPath);               //

                PublicClass.WritePrivateProfileString("AxisPara", "HighLocation_Small", VarClass.SmallZ_Location[0].ToString(), VarClass.iniPath);   //
                PublicClass.WritePrivateProfileString("AxisPara", "LowLocation_Small", VarClass.SmallZ_Location[1].ToString(), VarClass.iniPath);    //
                PublicClass.WritePrivateProfileString("AxisPara", "AutoSpeed_Small", VarClass.AutoSpeed[1].ToString(), VarClass.iniPath);            //
                PublicClass.WritePrivateProfileString("AxisPara", "HomeSpeed_Small", VarClass.High_Wel[1].ToString(), VarClass.iniPath);             //

                PublicClass.WritePrivateProfileString("AxisPara", "HighLocation_Scan", VarClass.ScanZ_Location[0].ToString(), VarClass.iniPath);     //
                PublicClass.WritePrivateProfileString("AxisPara", "ScanLocation_Scan", VarClass.ScanZ_Location[1].ToString(), VarClass.iniPath);     //
                PublicClass.WritePrivateProfileString("AxisPara", "AutoSpeed_Scan", VarClass.AutoSpeed[2].ToString(), VarClass.iniPath);             //
                PublicClass.WritePrivateProfileString("AxisPara", "HomeSpeed_Scan", VarClass.High_Wel[2].ToString(), VarClass.iniPath);              //

                PublicClass.WritePrivateProfileString("AxisPara", "ChangeLocation_XAxis", VarClass.XAxis_Location[0].ToString(), VarClass.iniPath);  //
                PublicClass.WritePrivateProfileString("AxisPara", "ScanLocation_XAxis", VarClass.XAxis_Location[1].ToString(), VarClass.iniPath);    //
                PublicClass.WritePrivateProfileString("AxisPara", "Impact_Location_XAxis", VarClass.XAxis_Location[2].ToString(), VarClass.iniPath); //
                PublicClass.WritePrivateProfileString("AxisPara", "AutoSpeed_XAxis", VarClass.AutoSpeed[3].ToString(), VarClass.iniPath);            //
                PublicClass.WritePrivateProfileString("AxisPara", "HomeSpeed_XAxis", VarClass.High_Wel[3].ToString(), VarClass.iniPath);             //

                PublicClass.WritePrivateProfileString("AxisPara", "ChangeLocation_YAxis", VarClass.YAxis_Location[0].ToString(), VarClass.iniPath);  //
                PublicClass.WritePrivateProfileString("AxisPara", "ScanLocation_YAxis", VarClass.YAxis_Location[1].ToString(), VarClass.iniPath);    //
                PublicClass.WritePrivateProfileString("AxisPara", "Impact_Location_YAxis", VarClass.YAxis_Location[2].ToString(), VarClass.iniPath); //
                PublicClass.WritePrivateProfileString("AxisPara", "AutoSpeed_YAxis", VarClass.AutoSpeed[4].ToString(), VarClass.iniPath);            //
                PublicClass.WritePrivateProfileString("AxisPara", "HomeSpeed_YAxis", VarClass.High_Wel[4].ToString(), VarClass.iniPath);             //
            }
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            VarClass.ManualSpeed[0] = Convert.ToDouble(text_BigZ_ManualSpeed.Text);
            VarClass.ManualSpeed[1] = Convert.ToDouble(text_SmallZ_ManualSpeed.Text);
            VarClass.ManualSpeed[2] = Convert.ToDouble(text_ScanZ_ManualSpeed.Text);
            VarClass.ManualSpeed[3] = Convert.ToDouble(text_Xaxis_ManualSpeed.Text);
            VarClass.ManualSpeed[4] = Convert.ToDouble(text_Yaxis_ManualSpeed.Text);

            if (MessageBox.Show("是否保存", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
            {
                PublicClass.WritePrivateProfileString("ManualSpeed", "BigZ", VarClass.ManualSpeed[0].ToString(), VarClass.iniPath);   //
                PublicClass.WritePrivateProfileString("ManualSpeed", "SmallZ", VarClass.ManualSpeed[1].ToString(), VarClass.iniPath); //
                PublicClass.WritePrivateProfileString("ManualSpeed", "ScanZ", VarClass.ManualSpeed[2].ToString(), VarClass.iniPath);  //
                PublicClass.WritePrivateProfileString("ManualSpeed", "Xaxis", VarClass.ManualSpeed[3].ToString(), VarClass.iniPath);  //
                PublicClass.WritePrivateProfileString("ManualSpeed", "Yaxis", VarClass.ManualSpeed[4].ToString(), VarClass.iniPath);  //
            }
        }