Esempio n. 1
0
        private void Fill_All_Slab()
        {
            foreach (vdFigure fig in VDoc.ActiveLayOut.Entities)
            {
                if (fig is vdPolyline)
                {
                    fig.Deleted = true;
                }
            }



            string ff = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text);


            foreach (var item in Directory.GetFiles(Path.GetDirectoryName(ff)))
            {
                ff = Path.GetFileNameWithoutExtension(item);
                if (ff.StartsWith("S"))
                {
                    try
                    {
                        string beams = ff.Replace("S", "");

                        beams = beams.Replace("_", " ").Trim();
                        Fill_Slab(beams);
                    }
                    catch (Exception eex) { }
                }
            }
        }
Esempio n. 2
0
        void Load_Slab_Data()
        {
            Slab_Data = new Hashtable();
            string fname = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text);

            fname = Path.Combine(Path.GetDirectoryName(fname), "SLAB_DATA.TXT");


            if (File.Exists(fname))
            {
                List <string> list = new List <string>(File.ReadAllLines(fname));

                for (int i = 0; i < list.Count; i++)
                {
                    MyStrings mli = new MyStrings(list[i], ',');

                    object obj = Slab_Data[mli.StringList[0].Trim()];
                    if (obj != null)
                    {
                        Slab_Data.Remove(mli.StringList[0].Trim());
                    }

                    Slab_Data.Add(mli.StringList[0].Trim(), list[i]);
                }
            }
        }
Esempio n. 3
0
        private void btn_delete_slab_Click(object sender, EventArgs e)
        {
            MyStrings mfls = new MyStrings(txt_beam_nos.Text, ',');

            foreach (var item in mfls.StringList)
            {
                string fn = Slab_des.Get_Report_File(item.Trim(), cmb_flr_lvl.Text);
                if (File.Exists(fn))
                {
                    if (MessageBox.Show("Do you want to Delete this Slab Design [" + item.Trim() + "] ?", "ASTRA", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        File.Delete(fn);
                    }
                }
            }
            Fill_All_Slab();

            //string fn = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text);
            //if (File.Exists(fn))
            //{
            //    if (MessageBox.Show("Do you want to Delete this Slab Design ?", "ASTRA", MessageBoxButtons.YesNo) == DialogResult.Yes)
            //    {
            //        File.Delete(fn);
            //        Fill_All_Slab();
            //    }

            //}
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            MyStrings mlist = new MyStrings(txt_beam_nos.Text, ',');


            List <string> list = new List <string>();
            string        fn   = "";

            //list.AddRange(SlabDesign.Get_Banner());
            for (int i = 0; i < mlist.Count; i++)
            {
                list.Add(string.Format(""));
                list.Add(string.Format("----------------------------------------------------------------------------"));
                list.Add(string.Format("SLAB_DESIGN {0} : SLAB MEMBERS [{1}] , FLOOR LEVEL : {2}", (i + 1), mlist.StringList[i], cmb_flr_lvl.Text));
                list.Add(string.Format("----------------------------------------------------------------------------"));
                list.Add(string.Format(""));
                list.Add(string.Format(""));
                fn = Slab_des.Get_Report_File(mlist.StringList[i].Trim(), cmb_flr_lvl.Text);
                if (File.Exists(fn))
                {
                    list.AddRange(File.ReadAllLines(fn));
                }
                else
                {
                    MessageBox.Show(this, "Design is not done for the selected Slab(s).", "ASTRA");
                    return;
                }
            }

            list.Add(string.Format(""));
            list.Add(string.Format(""));


            //fn = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text);
            fn = Slab_des.Report_File;

            File.WriteAllLines(fn, list.ToArray());
            if (File.Exists(fn))
            {
                frmASTRAReport.OpenReport(fn, this, mlist.Count > 1);
            }
            else
            {
                MessageBox.Show(this, "Design is not done for the selected Slab(s).", "ASTRA");
            }
        }
Esempio n. 5
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            MyStrings ml = new MyStrings(txt_beam_nos.Text.Trim(), ',');

            if (ml.Count > 0)
            {
                Slab_des.Beam_Nos = ml.StringList[0].Trim();
            }
            else
            {
                MessageBox.Show("Slab Members is not defined.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //Slab_des.Beam_Nos = txt_beam_nos.Text;
            Slab_des.case_index = cmb_slab_type.SelectedIndex;

            Slab_des.D     = MyStrings.StringToDouble(txt_slab_D.Text, 0.0);
            Slab_des.fck   = MyStrings.StringToDouble(cmb_slab_fck.Text.Replace("M", ""), 0.0);
            Slab_des.gamma = MyStrings.StringToDouble(txt_slab_gamma.Text, 0.0);
            Slab_des.fy    = MyStrings.StringToDouble(cmb_slab_fy.Text.Replace("Fe", ""), 0.0);
            Slab_des.wll   = MyStrings.StringToDouble(txt_slab_wll.Text, 0.0);
            Slab_des.d1    = MyStrings.StringToDouble(txt_slab_d1.Text, 0.0);
            Slab_des.s1    = MyStrings.StringToDouble(txt_slab_s1.Text, 0.0);
            Slab_des.d2    = MyStrings.StringToDouble(txt_slab_d2.Text, 0.0);
            Slab_des.s2    = MyStrings.StringToDouble(txt_slab_s2.Text, 0.0);
            Slab_des.d3    = MyStrings.StringToDouble(txt_slab_d3.Text, 0.0);
            Slab_des.s3    = MyStrings.StringToDouble(txt_slab_s3.Text, 0.0);
            Slab_des.d4    = MyStrings.StringToDouble(txt_slab_d4.Text, 0.0);
            Slab_des.s4    = MyStrings.StringToDouble(txt_slab_s4.Text, 0.0);
            Slab_des.cover = MyStrings.StringToDouble(txt_slab_c.Text, 0.0);
            Slab_des.dlf   = MyStrings.StringToDouble(txt_slab_DLF.Text, 0.0);
            Slab_des.llf   = MyStrings.StringToDouble(txt_slab_LLF.Text, 0.0);

            Slab_des.dgv_dls = dgv_dls;
            #region Check Beam Members


            MyStrings mlist = new MyStrings(txt_beam_nos.Text.Trim(), ' ');

            MemberIncidenceCollection mic = new MemberIncidenceCollection();

            for (int i = 0; i < mlist.Count; i++)
            {
                mic.Add(AST_DOC.Members.Get_Member(mlist.GetInt(i)));
            }


            JointCoordinateCollection jntc = new JointCoordinateCollection();

            for (int i = 1; i < mic.Count; i++)
            {
                if (mic[i - 1].StartNode == mic[i].StartNode)
                {
                    if (!jntc.Contains(mic[i].StartNode))
                    {
                        jntc.Add(mic[i].StartNode);
                    }
                }
                else if (mic[i - 1].EndNode == mic[i].StartNode)
                {
                    if (!jntc.Contains(mic[i].StartNode))
                    {
                        jntc.Add(mic[i].StartNode);
                    }
                }
                else if (mic[i - 1].StartNode == mic[i].EndNode)
                {
                    if (!jntc.Contains(mic[i].EndNode))
                    {
                        jntc.Add(mic[i].EndNode);
                    }
                }
                else if (mic[i - 1].EndNode == mic[i].EndNode)
                {
                    if (!jntc.Contains(mic[i].EndNode))
                    {
                        jntc.Add(mic[i].EndNode);
                    }
                }
                else
                {
                    //string ss = Slab_Data[beam_nos] as string;
                    //if (ss != null)
                    //    Slab_Data.Remove(beam_nos);
                    //Save_Data();
                    MessageBox.Show("Beam " + mic[i].MemberNo + " and Beam " + mic[i - 1].MemberNo + " Joints are mismatch..", "ASTRA", MessageBoxButtons.OK);
                    return;
                }
            }

            #endregion  Check Beam Members
            //Chiranjit [2015 04 26]
            //Slab_des.Calculate_Program();
            Slab_des.Design_Program();


            List <string> Design_Summary = new List <string>();

            Design_Summary.Add(string.Format("-------------------------------------"));
            Design_Summary.Add(string.Format("SLAB MEMBERS = {0}", Slab_des.Beam_Nos));
            Design_Summary.Add(string.Format("SLAB FLOOR LEVEL = {0} M", cmb_flr_lvl.Text));
            Design_Summary.AddRange(Slab_des.Design_Summary.ToArray());
            Design_Summary.Add(string.Format("-------------------------------------"));


            string fnm = Slab_des.Get_Design_Summary_File(Slab_des.Beam_Nos, cmb_flr_lvl.Text);
            //fnm = Path.Combine(Path.GetDirectoryName(fnm), "SLAB_DESIGN_SUMMARY.TXT");

            //if (File.Exists(fnm))
            //    Design_Summary.AddRange(File.ReadAllLines(fnm));

            File.WriteAllLines(fnm, Design_Summary.ToArray());

            Save_Data();
            //Fill_Slab(txt_beam_nos.Text, Slab_des.IS_DESIGN_OK);
            Fill_All_Slab();

            Add_Slab_Boq(Slab_des.BOQ);



            GetGripSelection(false).RemoveAll();

            if (File.Exists(Slab_des.Report_File))
            {
                MessageBox.Show(this, "Report file created in file " + Slab_des.Report_File, "ASTRA", MessageBoxButtons.OK);
                frmASTRAReport.OpenReport(Slab_des.Report_File, this, false);
            }
            VDoc.Redraw(true);

            //this.DialogResult = DialogResult.OK;
            //this.Close();
        }
Esempio n. 6
0
        public void Save_Data()
        {
            string fname = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text);

            fname = Path.Combine(Path.GetDirectoryName(fname), "SLAB_DATA.TXT");

            string kStr      = "";
            string def_loads = "";
            int    i         = 0;

            for (i = 0; i < dgv_dls.RowCount - 1; i++)
            {
                def_loads += string.Format("{0}${1}$", dgv_dls[0, i].Value.ToString(), dgv_dls[1, i].Value.ToString());
            }



            kStr = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19}",
                                 txt_beam_nos.Text
                                 , txt_slab_D.Text
                                 , cmb_slab_fck.Text
                                 , txt_slab_gamma.Text
                                 , cmb_slab_fy.Text
                                 , txt_slab_wll.Text
                                 , txt_slab_DLF.Text
                                 , txt_slab_LLF.Text
                                 , txt_slab_c.Text
                                 , txt_slab_d1.Text
                                 , txt_slab_s1.Text
                                 , txt_slab_d2.Text
                                 , txt_slab_s2.Text
                                 , txt_slab_d3.Text
                                 , txt_slab_s3.Text
                                 , txt_slab_d4.Text
                                 , txt_slab_s4.Text
                                 , cmb_slab_type.Text
                                 , def_loads, Slab_des.IS_DESIGN_OK ? "OK" : "NOT OK"
                                 );

            List <string> list = new List <string>();

            string dta = (string)Slab_Data[txt_beam_nos.Text.Trim()];


            //list.AddRange(File.ReadAllLines(fname));
            if (dta == null)
            {
                Slab_Data.Add(txt_beam_nos.Text.Trim(), kStr.Trim());
            }
            else
            {
                Slab_Data.Remove(txt_beam_nos.Text);
                Slab_Data.Add(txt_beam_nos.Text, kStr);
            }


            list.Clear();

            foreach (DictionaryEntry de in Slab_Data)
            {
                list.Add(de.Value.ToString());
            }
            File.WriteAllLines(fname, list.ToArray());
        }