Exemplo n.º 1
0
        private void btn_RE_process_Click(object sender, EventArgs e)
        {
            try
            {
                if (!Check_Project_Folder())
                {
                    return;
                }

                if (iApp.Check_Demo_Version())
                {
                    Save_FormRecord.Get_Demo_Data(this);
                }

                Save_FormRecord.Write_All_Data(this, Working_Folder);


                Set_Input_Data();


                for (int i = 0; i < re_des.Layout_Sections.Count; i++)
                {
                    try
                    {
                        re_des.Layout_Sections[i].Embedment_Depth = MyList.StringToDouble(dgv_RE_height_embedment[1, i].Value.ToString(), 0.43);
                    }
                    catch (Exception ex) { }
                }

                //re_des.Calculate_Program();
                re_des.Loop_Program();


                MessageBox.Show(this, "Report file created in " + re_des.Report_File + "\n\n and\n\n" + re_des.Report_Table_File, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);

                frm_RE_wall_report f = new frm_RE_wall_report(iApp, false);

                f.Owner = this;
                f.ShowDialog();
                if (f.Is_Details)
                {
                    if (File.Exists(re_des.Report_File))
                    {
                        iApp.View_Result(re_des.Report_File);
                    }
                }
                else
                {
                    if (File.Exists(re_des.Report_Table_File))
                    {
                        iApp.View_Result(re_des.Report_Table_File);
                    }
                }
            }
            catch (Exception ex) { }
        }
Exemplo n.º 2
0
        private void btn_process_Click(object sender, System.EventArgs e)
        {
            POT_PTFE_VERSO_BEARING_DESIGN vtmp = null;

            Button btn = sender as Button;

            if (iApp.Check_Demo_Version())
            {
                Save_FormRecord.Get_Demo_Data(this);
            }


            if (btn.Name == btn_VMABT_process.Name)
            {
                Set_VMABT_Input_Data();
                vtmp = VMABT;
            }
            else if (btn.Name == btn_VMABL_process.Name)
            {
                Set_VMABL_Input_Data();
                vtmp = VMABL;
            }
            else if (btn.Name == btn_VBAB_process.Name)
            {
                Set_VBAB_Input_Data();
                vtmp = VBAB;
            }
            else if (btn.Name == btn_VFB_process.Name)
            {
                Set_VFB_Input_Data();
                vtmp = VFB;
            }


            if (vtmp != null)
            {
                vtmp.Generate_Report();
                iApp.Save_Form_Record(this, user_path);
                MessageBox.Show(this, "Report file created in " + vtmp.Report_File, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                iApp.View_Result(vtmp.Report_File);
            }
        }
Exemplo n.º 3
0
        private void tsmi_Click(object sender, EventArgs e)
        {
            ToolStripItem tsi = sender as ToolStripItem;

            Control ctrl = sender as Control;

            if (ctrl != null && tsi == null)
            {
                if (ctrl.Name == btn_open_ll_editor.Name)
                {
                    tsi = tsb_ll_editor;
                }
            }


            if (tsi.Name == tsmi_open.Name || tsi.Name == tsb_open.Name)
            {
                using (OpenFileDialog ofd = new OpenFileDialog())
                {
                    ofd.Filter           = "Text Files (*.txt)|*.txt|ASTRA Files (*.ast)|*.ast";
                    ofd.InitialDirectory = Analysis_Path;

                    if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
                    {
                        Open_File(ofd.FileName);
                    }
                }
            }
            else if (tsi.Name == tsmi_save.Name || tsi.Name == tsb_save.Name)
            {
                if (File.Exists(File_Name))
                {
                    if (rtb_input_file.Lines.Length > 0)
                    {
                        File.WriteAllLines(File_Name, rtb_input_file.Lines);
                    }
                    if (rtb_LL_TXT.Lines.Length > 0 && !splitContainer1.Panel2Collapsed)
                    {
                        File.WriteAllLines(LL_TXT, rtb_LL_TXT.Lines);
                        MessageBox.Show("\"" + Path.GetFileName(File_Name) + "\"" + " and " +
                                        "\"" + Path.GetFileName(LL_TXT) + "\"" + " Saved Successfully.",
                                        "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        //MessageBox.Show("Data file and Moving Load file Saved Successfully.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("\"" + Path.GetFileName(File_Name) + "\"" + " Saved Successfully.",
                                        "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    File_Save_As();
                }
            }
            else if (tsi.Name == tsmi_save_as.Name || tsi.Name == tsb_save_as.Name)
            {
                File_Save_As();
            }
            else if (tsi.Name == tsb_run.Name || tsi.Name == tsmi_run.Name)
            {
                if (iApp.Check_Demo_Version(true))
                {
                    return;
                }

                string flPath = File_Name;

                if (!File.Exists(flPath))
                {
                    return;
                }


                File.WriteAllText(Path.Combine(Path.GetDirectoryName(flPath), "PAT001.tmp"), Path.GetDirectoryName(flPath) + "\\");
                File.WriteAllText(Path.Combine(iApp.AppFolder, "PAT001.tmp"), Path.GetDirectoryName(flPath) + "\\");
                //System.Environment.SetEnvironmentVariable("SURVEY", flPath);

                System.Diagnostics.Process prs = new System.Diagnostics.Process();

                System.Environment.SetEnvironmentVariable("SURVEY", flPath);
                System.Environment.SetEnvironmentVariable("ASTRA", flPath);

                if (Path.GetExtension(File_Name).ToUpper() == ".AST")
                {
                    prs.StartInfo.FileName = Path.Combine(Application.StartupPath, "ast003.exe");
                }
                else
                {
                    prs.StartInfo.FileName = Path.Combine(Application.StartupPath, "ast001.exe");
                }

                //files.AddRange(Directory.GetFiles(WorkingFolder));
                iApp.Delete_Temporary_Files(flPath);

                if (prs.Start())
                {
                    prs.WaitForExit();
                }

                Open_File(File_Name);


                if (File.Exists(Analysis_Report))
                {
                    if (MessageBox.Show("Do you want to open Analysis Report file ?", "ASTRA",
                                        MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        iApp.View_Result(Analysis_Report);
                    }
                }
            }
            else if (tsi.Name == tsb_stage_analysis.Name || tsi.Name == tsmi_stage_analysis.Name)
            {
                //iApp.WorkingFile = File_Name;
                //frmStageAnalysis p_d_analysis = new frmStageAnalysis(iApp);

                //p_d_analysis.ShowDialog();

                iApp.Form_Stage_Analysis(File_Name).Show();
            }
            else if (tsi.Name == tsb_ana_results.Name)
            {
                if (File.Exists(File_Name))
                {
                    iApp.OpenWork(File_Name, false);
                }
            }
            else if (tsi.Name == tsb_view_structure.Name || tsi.Name == tsmi_view_structure.Name)
            {
                if (File.Exists(File_Name))
                {
                    iApp.Form_ASTRA_TEXT_Data(File_Name, false).ShowDialog();
                    //iApp.Form_ASTRA_Analysis_Process()
                    rtb_input_file.Lines = File.ReadAllLines(File_Name);
                }
            }
            else if (tsi.Name == tsmi_view_structure.Name || tsi.Name == tsb_ana_inputs.Name)
            {
                iApp.Form_ASTRA_Input_Data(File_Name, false).ShowDialog();
                rtb_input_file.Lines = File.ReadAllLines(File_Name);
            }
            else if (tsi.Name == tsmi_report.Name || tsi.Name == tsb_open_report.Name)
            {
                if (File.Exists(Analysis_Report))
                {
                    iApp.View_Result(Analysis_Report);
                }
                //System.Diagnostics.Process.Start(Analysis_Report);
            }
            else if (tsi.Name == tsmi_SAP.Name || tsi.Name == tsb_sap.Name || tsi.Name == tsb_ana_sap.Name)
            {
                if (File.Exists(SAP_Data_File))
                {
                    iApp.View_SAP_Data(SAP_Data_File);
                    //System.Diagnostics.Process.Start(SAP_Data_File);
                }
            }
            else if (tsi.Name == tsmi_forces.Name || tsi.Name == tsb_forces.Name)
            {
                if (File.Exists(Member_Forces_File))
                {
                    System.Diagnostics.Process.Start(Member_Forces_File);
                }
            }
            else if (tsi.Name == tsb_open_folder.Name)
            {
                if (Directory.Exists(Analysis_Path))
                {
                    System.Diagnostics.Process.Start(Analysis_Path);
                }
            }
            else if (tsi.Name == tsb_ll_editor.Name || tsi.Name == tsmi_open_LL_editor.Name)
            {
                string ll_file = MyList.Get_LL_TXT_File(File_Name);

                if (File.Exists(ll_file))
                {
                    frmMovingLoadData fmld = new frmMovingLoadData(iApp, ll_file);
                    fmld.Owner = this;
                    if (fmld.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        rtb_LL_TXT.Lines = File.ReadAllLines(ll_file);
                    }
                }
            }
            else if (tsi.Name == tsmi_close.Name)
            {
                this.Close();
            }
        }