Пример #1
0
        private void LoadButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog configFileDialog = new OpenFileDialog {
                Filter = @"配置文件 |*.xml"
            };                                                    //定义新的文件打开位置控件

            if (configFileDialog.ShowDialog() == DialogResult.OK) //如果有选择打开的文件
            {
                InformationText.Clear();
                InformationText.AppendText("Read Configuration File:\n" + configFileDialog.FileName + "\n");


                if (XmlTool.GetInstance.Load(configFileDialog.FileName))
                {
                    InformationText.Text = XmlTool.GetInstance.Error;
                    LoadButton.BackColor = Color.Red;
                    return;
                }
                //FormRequest.FarField.Clear();

                InformationText.Text = @"Load Configuration Successfully!";
                LoadButton.BackColor = Color.MistyRose;

                HxjLocation.Text = configFileDialog.FileName;
            }
        }
Пример #2
0
        private void ValidateButton_Click(object sender, EventArgs e)
        {
            RunButton.Enabled = false;
            InformationText.Clear();
            if (!File.Exists(FormFile.MeshCard.FirstChild.InnerText))

            {
                InformationText.Text = @"Mesh File is not exist!";
                FileButton.BackColor = Color.Red;
                return;
            }


            if (FormMethod.MethodCard.FirstChild.InnerText != "1")
            {
                FormSolution.SolutionMod.FirstChild.ChildNodes[4].InnerText = "0";
            }
            //BFButton.BackColor = int.Parse(FormBasicFunction.OSCard.FirstChild.InnerText) > -1 &&
            //                     File.Exists(FormBasicFunction.OSCard.LastChild.InnerText) ?
            //    Color.Green : Color.Yellow;


            if (XmlTool.GetInstance.Validate())
            {
                InformationText.Text     = XmlTool.GetInstance.Error;
                SaveButton.Enabled       = false;
                ValidateButton.BackColor = Color.Red;
            }
            else
            {
                InformationText.Text     = @"Configuration File is Corrected!";
                SaveButton.Enabled       = true;
                ValidateButton.BackColor = Color.MistyRose;
            }
        }
Пример #3
0
        private void BFButton_Click(object sender, EventArgs e)
        {
            Form bf = new FormBasicFunction();

            bf.ShowDialog();
            InformationText.Clear();
            InformationText.Text = @"Click BasicFunction";
            BFButton.BackColor   = Color.MistyRose;
        }
Пример #4
0
        private void RequestButton_Click(object sender, EventArgs e)
        {
            Form re = new FormRequest();

            re.ShowDialog();
            InformationText.Clear();
            InformationText.Text    = @"Click Request";
            RequestButton.BackColor = Color.MistyRose;
        }
Пример #5
0
        private void SolutionButton_Click(object sender, EventArgs e)
        {
            Form sol = new FormSolution();

            sol.ShowDialog();
            InformationText.Clear();
            InformationText.Text     = @"Click Solution";
            SolutionButton.BackColor = Color.MistyRose;
        }
Пример #6
0
        private void ExcitationButton_Click(object sender, EventArgs e)
        {
            Form excitation = new FormExcitation();

            excitation.ShowDialog();
            InformationText.Clear();
            InformationText.Text       = @"Click Excitation";
            ExcitationButton.BackColor = Color.MistyRose;
        }
Пример #7
0
        private void FRButton_Click(object sender, EventArgs e)
        {
            Form fre = new FormFrequency();

            fre.ShowDialog();
            InformationText.Clear();
            InformationText.Text = @"Click Parameter";
            FRButton.BackColor   = Color.MistyRose;
        }
Пример #8
0
        private void ImpedanceButton_Click(object sender, EventArgs e)
        {
            Form imp = new FormMethod();

            imp.ShowDialog();
            InformationText.Clear();
            InformationText.Text      = @"Click Impedance";
            ImpedanceButton.BackColor = Color.MistyRose;
        }
Пример #9
0
        //Item API
        private void Mesh_Click(object sender, EventArgs e)
        {
            Form mesh = new FormFile();

            mesh.ShowDialog();
            InformationText.Clear();
            InformationText.Text = @"Click Mesh";
            FileButton.BackColor = Color.MistyRose;

            FormBasicFunction.OSCard.FirstChild.InnerText = "-1";
            BFButton.BackColor = Color.MistyRose;
        }
Пример #10
0
        private void TestButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog configFileDialog = new OpenFileDialog {
                Filter = @"配置文件 |*.json"
            };                                                    //定义新的文件打开位置控件

            if (configFileDialog.ShowDialog() == DialogResult.OK) //如果有选择打开的文件
            {
                InformationText.Clear();
                InformationText.AppendText("Load json File:\n" + configFileDialog.FileName + "\n");
                ConfigurationFullName = configFileDialog.FileName;
                RunButton.Enabled     = true;
                PostButton.Enabled    = true;
                InformationText.Text  = @"Load json Successfully!";
                LoadButton.BackColor  = Color.MistyRose;
            }
            //if (File.Exists(ConfigurationFullName))
            //    Process.Start("D:/Program Files/Softwares/UltraEdit/uedit64.exe", ConfigurationFullName);
            //else InformationText.Text = @"Not exist file:\n" + ConfigurationFullName;
        }