private void btn_report_Click(object sender, System.EventArgs e)
        {
            Button btn = sender as Button;
            POT_PTFE_VERSO_BEARING_DESIGN vtmp = null;

            if (btn.Name == btn_VMABT_report.Name)
            {
                vtmp = VMABT;
            }
            else if (btn.Name == btn_VMABL_report.Name)
            {
                vtmp = VMABL;
            }
            else if (btn.Name == btn_VBAB_report.Name)
            {
                vtmp = VBAB;
            }
            else if (btn.Name == btn_VFB_report.Name)
            {
                vtmp = VFB;
            }


            try
            {
                if (File.Exists(vtmp.Report_File))
                {
                    iApp.View_Result(vtmp.Report_File);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Report file is not created.", "ASTRA");
            }
        }
        private void btn_drawings_Click(object sender, System.EventArgs e)
        {
            Button btn = sender as Button;

            POT_PTFE_VERSO_BEARING_DESIGN ptvb = null;

            if (btn.Name == btn_VMABT_drawings.Name)
            {
                if (VMABT == null)
                {
                    VMABT = new POT_PTFE_VERSO_BEARING_DESIGN(iApp, eDesignBearing.VERSO_MONO_AXIAL_BEARING_TRANSVERSE);
                }
                ptvb = VMABT;
            }
            else if (btn.Name == btn_VMABL_drawings.Name)
            {
                if (VMABL == null)
                {
                    VMABL = new POT_PTFE_VERSO_BEARING_DESIGN(iApp, eDesignBearing.VERSO_MONO_AXIAL_BEARING_LONGITUDINAL);
                }
                ptvb = VMABL;
            }
            else if (btn.Name == btn_VBAB_drawings.Name)
            {
                if (VBAB == null)
                {
                    VBAB = new POT_PTFE_VERSO_BEARING_DESIGN(iApp, eDesignBearing.VERSO_BI_AXIAL_BEARING);
                }

                ptvb = VBAB;
            }
            else if (btn.Name == btn_VFB_drawings.Name)
            {
                if (VFB == null)
                {
                    VFB = new POT_PTFE_VERSO_BEARING_DESIGN(iApp, eDesignBearing.VERSO_FIXED_BEARING);
                }
                ptvb = VFB;
            }

            string draw_cmd = ptvb.BearingDesign.ToString();

            ptvb.Working_Folder = Working_Folder;

            iApp.RunViewer(Path.Combine(ptvb.Drawing_Folder, "DRAWINGS"), draw_cmd);
        }
        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);
            }
        }
        private void btn_open_save_design_Click(object sender, System.EventArgs e)
        {
            Button btn = sender as Button;

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

            POT_PTFE_VERSO_BEARING_DESIGN vtmp = null;

            if (btn.Name == btn_save_VMABT_des.Name)
            {
                Set_VMABT_Input_Data();
                vtmp = VMABT;
            }
            else if (btn.Name == btn_save_VMABL_des.Name)
            {
                Set_VMABL_Input_Data();
                vtmp = VMABL;
            }
            else if (btn.Name == btn_save_VBAB_des.Name)
            {
                Set_VBAB_Input_Data();
                vtmp = VBAB;
            }
            else if (btn.Name == btn_save_VFB_des.Name)
            {
                Set_VFB_Input_Data();
                vtmp = VFB;
            }

            if (vtmp != null)
            {
                vtmp.Generate_Report();
                using (SaveFileDialog sfd = new SaveFileDialog())
                {
                    sfd.FileName = vtmp.BearingDesign.ToString();
                    sfd.Filter   = "All Report Files(*.txt)|*.txt";
                    if (sfd.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
                    {
                        try
                        {
                            File.Copy(vtmp.Report_File, sfd.FileName, true);
                            MessageBox.Show(this, "Report file created in " + sfd.FileName, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);

                            iApp.Save_Form_Record(this, Path.GetDirectoryName(sfd.FileName));
                            iApp.View_Result(sfd.FileName);
                        }
                        catch (Exception ex) { }
                    }
                }
            }
            else if ((btn.Name == btn_open_VMABT_des.Name) ||
                     (btn.Name == btn_open_VBAB_des.Name) ||
                     (btn.Name == btn_open_VFB_des.Name) ||
                     (btn.Name == btn_open_VMABL_des.Name))
            {
                using (OpenFileDialog ofd = new OpenFileDialog())
                {
                    ofd.Filter = "All Report Files(*.txt)|*.txt";
                    if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
                    {
                        try
                        {
                            iApp.Read_Form_Record(this, Path.GetDirectoryName(ofd.FileName));
                            MessageBox.Show(this, "Previous Design opened successfully. " + ofd.FileName, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            //To do
                        }
                        catch (Exception ex) { }
                    }
                }
            }
        }
        public void Set_VMABL_Input_Data()
        {
            if (VMABL == null)
            {
                VMABL = new POT_PTFE_VERSO_BEARING_DESIGN(iApp, eDesignBearing.VERSO_MONO_AXIAL_BEARING_LONGITUDINAL);
            }
            VMABL.Working_Folder = Working_Folder;
            VMABL.Nmax           = MyList.StringToDouble(txt_VMABL_1_Nmax.Text, 0.0);
            VMABL.Hlatn          = MyList.StringToDouble(txt_VMABL_1_Hlatn.Text, 0.0);

            VMABL.Nnorm   = MyList.StringToDouble(txt_VMABL_1_Nnorm.Text, 0.0);
            VMABL.Hlts    = MyList.StringToDouble(txt_VMABL_1_Hlts.Text, 0.0);
            VMABL.Nmin    = MyList.StringToDouble(txt_VMABL_1_Nmin.Text, 0.0);
            VMABL.Hlng_n  = MyList.StringToDouble(txt_VMABL_1_Hingn.Text, 0.0);
            VMABL.theta_p = MyList.StringToDouble(txt_VMABL_1_theta_p.Text, 0.0);
            VMABL.Hlng_s  = MyList.StringToDouble(txt_VMABL_1_Hings.Text, 0.0);
            VMABL.theta_v = MyList.StringToDouble(txt_VMABL_1_theta_v.Text, 0.0);
            VMABL.H       = MyList.StringToDouble(txt_VMABL_1_H.Text, 0.0);
            VMABL.theta   = MyList.StringToDouble(txt_VMABL_1_theta.Text, 0.0);
            VMABL.elong   = MyList.StringToDouble(txt_VMABL_1_elong.Text, 0.0);
            VMABL.etrans  = MyList.StringToDouble(txt_VMABL_1_etrans.Text, 0.0);


            VMABL.fy = MyList.StringToDouble(txt_VMABL_2_fy.Text, 0.0);
            VMABL.di = MyList.StringToDouble(txt_VMABL_2_di.Text, 0.0);
            VMABL.he = MyList.StringToDouble(txt_VMABL_2_he.Text, 0.0);

            VMABL.IRHD = MyList.StringToDouble(txt_VMABL_2_IRHD.Text, 0.0);
            VMABL.k1   = MyList.StringToDouble(txt_VMABL_2_k1.Text, 0.0);
            VMABL.k2   = MyList.StringToDouble(txt_VMABL_2_k2.Text, 0.0);


            VMABL.dp  = MyList.StringToDouble(txt_VMABL_2_dp.Text, 0.0);
            VMABL.w   = MyList.StringToDouble(txt_VMABL_2_w.Text, 0.0);
            VMABL.hm  = MyList.StringToDouble(txt_VMABL_2_hm.Text, 0.0);
            VMABL.An  = MyList.StringToDouble(txt_VMABL_2_An.Text, 0.0);
            VMABL.hts = MyList.StringToDouble(txt_VMABL_2_hts.Text, 0.0);


            VMABL.Do_       = MyList.StringToDouble(txt_VMABL_2_Do.Text, 0.0);
            VMABL.kb        = MyList.StringToDouble(txt_VMABL_2_kb.Text, 0.0);
            VMABL.do_       = MyList.StringToDouble(txt_VMABL_2_do_.Text, 0.0);
            VMABL.hc        = MyList.StringToDouble(txt_VMABL_2_hc.Text, 0.0);
            VMABL.deb_avibl = MyList.StringToDouble(txt_VMABL_2_dev_avibl.Text, 0.0);



            VMABL.a         = MyList.StringToDouble(txt_VMABL_2_a.Text, 0.0);
            VMABL.b         = MyList.StringToDouble(txt_VMABL_2_b.Text, 0.0);
            VMABL.ks        = MyList.StringToDouble(txt_VMABL_2_ks.Text, 0.0);
            VMABL.kt        = MyList.StringToDouble(txt_VMABL_2_kt.Text, 0.0);
            VMABL.as_       = MyList.StringToDouble(txt_VMABL_2_as.Text, 0.0);
            VMABL.bs        = MyList.StringToDouble(txt_VMABL_2_bs.Text, 0.0);
            VMABL.ku        = MyList.StringToDouble(txt_VMABL_2_ku.Text, 0.0);
            VMABL.Lu        = MyList.StringToDouble(txt_VMABL_2_Lu.Text, 0.0);
            VMABL.det_avibl = MyList.StringToDouble(txt_VMABL_2_det_avibl.Text, 0.0);
            VMABL.h         = MyList.StringToDouble(txt_VMABL_2_h.Text, 0.0);



            VMABL.bottom_Mj = MyList.StringToDouble(txt_VMABL_2_bottom_Mj.Text, 0.0);
            VMABL.bottom_Ab = MyList.StringToDouble(txt_VMABL_2_bottom_Ab.Text, 0.0);
            VMABL.bottom_n  = MyList.StringToDouble(txt_VMABL_2_bottom_n.Text, 0.0);
            VMABL.bottom_bc = MyList.StringToDouble(txt_VMABL_2_bottom_bc.Text, 0.0);
            VMABL.bottom_D  = MyList.StringToDouble(txt_VMABL_2_bottom_D.Text, 0.0);
            VMABL.bottom_L  = MyList.StringToDouble(txt_VMABL_2_bottom_L.Text, 0.0);


            VMABL.top_Mj = MyList.StringToDouble(txt_VMABL_2_top_Mj.Text, 0.0);
            VMABL.top_Ab = MyList.StringToDouble(txt_VMABL_2_top_Ab.Text, 0.0);
            VMABL.top_n  = MyList.StringToDouble(txt_VMABL_2_top_n.Text, 0.0);
            VMABL.top_bc = MyList.StringToDouble(txt_VMABL_2_top_bc.Text, 0.0);


            VMABL.fck                  = MyList.StringToDouble(txt_VMABL_3_fck.Text, 0.0);
            VMABL.steel_fy             = MyList.StringToDouble(txt_VMABL_3_fy.Text, 0.0);
            VMABL.bottom_mu            = MyList.StringToDouble(txt_VMABL_3_8_bot_mu.Text, 0.0);
            VMABL.bottom_sigma_bq_perm = MyList.StringToDouble(txt_VMABL_3_8_bot_sigma_bq_perm.Text, 0.0);
            VMABL.top_mu               = VMABL.bottom_mu;
            VMABL.top_sigma_bq_perm    = VMABL.bottom_sigma_bq_perm;
        }
Exemple #6
0
 private void frmBearingDesign_Load(object sender, EventArgs e)
 {
     VMABT = new POT_PTFE_VERSO_BEARING_DESIGN(iApp, eDesignBearing.VERSO_MONO_AXIAL_BEARING_TRANSVERSE);
     InVisible_Type1();
     grb_1_deg_param.Visible = true;
 }