Beispiel #1
0
        void Load_Pile_Data()
        {
            string fname = Pile_Design.Get_Report_File(1);

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

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

                int c = 0;
                for (int i = 0; i < list.Count; i++)
                {
                    MyStrings mli = new MyStrings(list[i], '$');
                    try
                    {
                        c = 4;
                        do
                        {
                            dgv_columns[c, i].Value = mli.StringList[c];
                        }while (++c < dgv_columns.ColumnCount);

                        //dgv_columns[c, i].Value = mli.StringList[c]; c++;
                        //dgv_columns[c, i].Value = mli.StringList[c]; c++;
                        //dgv_columns[c, i].Value = mli.StringList[c]; c++;
                        //dgv_columns[c, i].Value = mli.StringList[c]; c++;
                        //dgv_columns[c, i].Value = mli.StringList[c]; c++;
                        //dgv_columns[c, i].Value = mli.StringList[c]; c++;
                        //dgv_columns[c, i].Value = mli.StringList[c];
                        if (mli.StringList[c - 1] != "")
                        {
                            Set_Grid_Color(i, true, !mli.StringList[c - 1].Contains("NOT"));
                        }
                    }
                    catch (Exception exc)
                    {
                    }
                }
            }
        }
Beispiel #2
0
        //Hashtable Beam_Data = new Hashtable();
        public void Save_Data()
        {
            string fname = Pile_Design.Get_Report_File(1);

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

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

            string kStr = "";
            int    i    = 0;

            for (i = 0; i < dgv_columns.RowCount; i++)
            {
                kStr = "";
                for (int c = 0; c < dgv_columns.ColumnCount; c++)
                {
                    kStr += string.Format("{0}$", dgv_columns[c, i].Value.ToString());
                }
                list.Add(kStr);
            }

            File.WriteAllLines(fname, list.ToArray());
        }
Beispiel #3
0
        private void btn_oprn_report_Click(object sender, EventArgs e)
        {
            DataGridView dgv = dgv_columns;

            int r = -1;

            if (dgv.SelectedCells.Count == 0)
            {
                return;
            }

            List <int> list_rows = new List <int>();

            int  i  = 0;
            bool fl = false;

            for (i = 0; i < dgv.RowCount; i++)
            {
                fl = (bool)dgv[1, i].Value;
                if (fl)
                {
                    list_rows.Add(i);
                }
            }

            list_rows.Sort();
            string f = "";


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

            //list.AddRange(PileFoundation.Get_Banner());

            foreach (var item in list_rows)
            {
                r = item;

                f = Pile_Design.Get_Report_File(r + 1);


                if (File.Exists(f))
                {
                    list.Add(string.Format("-------------------------------------------"));
                    list.Add(string.Format("PILE_DESIGN {0} : {1}", item + 1, ""));
                    list.Add(string.Format("-------------------------------------------"));
                    list.AddRange(File.ReadAllLines(f));
                }
                else
                {
                    if (MessageBox.Show(this, string.Format("Design is not done for the selected Pile Foundation {0}.\n\nDo you want to continue ?", dgv[2, r].Value),
                                        "ASTRA", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                    //MessageBox.Show(this, "Design not done for this Pile Foundation(s).");
                }
            }
            if (list.Count > 0)
            {
                File.WriteAllLines(Pile_Design.Report_File, list.ToArray());

                f = Pile_Design.Report_File;

                if (File.Exists(f))
                {
                    frmASTRAReport.OpenReport(f, this);
                }
                else
                {
                    MessageBox.Show(this, "Design not done for this Pile Foundation(s).");
                }
            }
        }
Beispiel #4
0
        public void RunThread()
        {
            List <string> list = new List <string>();

            #region TechSOFT Banner


            //list.Add("");
            //list.Add("");
            //list.Add("\t\t**********************************************");
            //list.Add("\t\t*          ASTRA Pro Release 18.0            *");
            //list.Add("\t\t*      TechSOFT Engineering Services         *");
            //list.Add("\t\t*                                            *");
            //list.Add("\t\t*      DESIGN OF RCC PILE FOUNDATION         *");
            //list.Add("\t\t*                                            *");
            //list.Add("\t\t**********************************************");
            //list.Add("\t\t----------------------------------------------");
            //list.Add("\t\tTHIS RESULT CREATED ON " + System.DateTime.Now.ToString("dd.MM.yyyy  AT HH:mm:ss") + " ");
            //list.Add("\t\t----------------------------------------------");
            //list.Add("");

            #endregion



            int c    = 0;
            int step = 1;


            string ColumnNos = "";

            //int c = 0;
            for (int i = 0; i < dgv_columns.RowCount; i++)
            {
                try
                {
                    c = 1;
                    ColumnData cd = new ColumnData();
                    cd.IsSelect = (bool)dgv_columns[c++, i].Value;
                    if (cd.IsSelect)
                    {
                        Set_Grid_Color(i, false, false);
                        Pile_Design.ColumnNo = dgv_columns[c++, i].Value.ToString(); c++;

                        if (MessageBox.Show("Process Design Pile Foundation " + Pile_Design.ColumnNo + " \n\nDou you want to continue ?", "ASTRA", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            break;
                        }
                        //Pile_Design.Continuous_ColumnMembers = dgv_columns[c++, i].Value.ToString();
                        Pile_Design.D = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        //Pile_Design.PL = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.LPC = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.BPC = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.DPC = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.d1  = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.d2  = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.d3  = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.P   = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        Pile_Design.AM  = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);

                        //Pile_Design.Mx = MyStrings.StringToDouble(dgv_columns[c, i].Value.ToString(), 0.0);


                        list.AddRange(Pile_Design.Design_Program_Loop(i + 1).ToArray());

                        dgv_columns[c, i].Value = Pile_Design.IS_DESIGN_OK ? " OK" : "NOT OK";
                        Set_Grid_Color(i, true, Pile_Design.IS_DESIGN_OK);
                        Add_Foundation_BOQ(Pile_Design.BOQ);
                    }
                }
                catch (Exception exx) { }
            }



            #region End of Report
            list.Add("");
            list.Add("---------------------------------------------------------------------------");
            list.Add("---------------------       END OF REPORT        --------------------------");
            list.Add("---------------------------------------------------------------------------");
            #endregion End of Report



            File.WriteAllLines(Pile_Design.Report_File, list.ToArray());
            //MessageBox.Show(this, "Report file created in file " + Pile_Design.Report_File);
            ////frmASTRAReport fap = new frmASTRAReport(Pile_Design.Report_File);
            ////fap.Owner = this;
            ////fap.Show();

            //frmASTRAReport.OpenReport(Pile_Design.Report_File, this);

            Save_Data();
        }