示例#1
0
        private void UpdatePage4()
        {
            if (currentSection == null) // || !(currentSection is Rectangular || currentSection is Circle))
            {
                wizardControl.SelectTab(0);
            }
            else
            {
                ConcreteSectionProps concProps = currentSection.ConcreteProperties;
                if (concProps != null)
                {
                    if (concProps is ConcreteBeamSectionProps)
                    {
                        sqareColumnGroupBox.Visible = false;
                        beamGroupBox.Visible        = true;

                        ConcreteBeamSectionProps props = (ConcreteBeamSectionProps)concProps;
                        coverTopTextBox.Text      = string.Format("{0}", props.ConcreteCoverTop);
                        coverBottomTextBox.Text   = string.Format("{0}", props.ConcreteCoverBottom);
                        coTopLeftTextBox.Text     = string.Format("{0}", props.RoTopLeft);
                        coTopRightTextBox.Text    = string.Format("{0}", props.RoTopRight);
                        coBottomLeftTextBox.Text  = string.Format("{0}", props.RoBottomLeft);
                        coBottomRightTextBox.Text = string.Format("{0}", props.RoBottomRight);
                    }
                    else if (concProps is ConcreteColumnSectionProps)
                    {
                        columnRadioButton.Checked   = true;
                        sqareColumnGroupBox.Visible = true;
                        beamGroupBox.Visible        = false;
                        ConcreteColumnSectionProps props = (ConcreteColumnSectionProps)concProps;

                        sqColCoverToRebarTextBox.Text       = string.Format("{0}", props.CoverToRebarCenter);
                        sqColRebars22TextBox.Text           = string.Format("{0}", props.NumberOfBars2Dir);
                        sqColRebars33TextBox.Text           = string.Format("{0}", props.NumberOfBars3Dir);
                        sqColReinforcementsTextBox.Text     = string.Format("{0}", props.SpacingC);
                        sqColRebarSizeComboBox.SelectedItem = props.BarSize;
                        //sqColReinforcementsTextBox.Text = string.Format("{0:F}", props.);
                    }
                    else // Not concrete column nor beam
                    {
                        wizardControl.SelectTab(0);
                    }
                }
                else // Not concrete
                {
                    wizardControl.SelectTab(0);
                }
            }
        }
示例#2
0
        private void SectionsGUI_Load(object sender, EventArgs e)
        {
            wizardControl.HideTabs = true;

            ConcreteColumnSectionProps cProps = new ConcreteColumnSectionProps();

            concreteSectionProps.Add(cProps);
            concreteSectionProps.Add(new ConcreteBeamSectionProps());

            sqColRebarSizeComboBox.DataSource = new List <string>(BarSizes.Instance.Keys);

            if (oneSection)
            {
                wizardControl.SelectTab(4);
            }
            else
            {
                wizardControl.SelectTab(0);
            }
            UpdatePage1();

            UpdateMaterialsComboBox();
        }
示例#3
0
        private void store(OleDbConnection cn, ConcreteColumnSectionProps obj, FrameSection section)
        {
            string mat = MaterialManager.Instance.DefaultSteel.Name;
            string sql, bars3, bars2, barsCirc;

            if (section is Rectangular)
            {
                bars2    = obj.NumberOfBars2Dir.ToString();
                bars3    = obj.NumberOfBars3Dir.ToString();
                barsCirc = "0";
            }
            else // Circular
            {
                bars2    = "0";
                bars3    = "0";
                barsCirc = obj.NumberOfBars.ToString();
            }

            string barsize = obj.BarSize.ToString();

            sql = "INSERT INTO [Frame Section Properties 02 - Concrete Column] (SectionName, RebarMatL, RebarMatC, ReinfConfig, LatReinf, Cover, NumBars3Dir, NumBars2Dir, NumBarsCirc, BarSize, SpacingC, NumCBars2, NumCBars3, ReinfType) " +
                  "VALUES (\"" + section + "\", \"" + mat + "\", \"" + mat + "\", \"" + obj.RConfiguration + "\", \"" + obj.LateralR + "\", " + obj.CoverToRebarCenter + ", " + bars3 + ", " + bars2 + ", " + barsCirc + ", \"" + barsize + "\", " + obj.SpacingC + ", " + bars2 + ", " + bars3 + ", \"Design\");";
            new OleDbCommand(sql, cn).ExecuteNonQuery();
        }
示例#4
0
        private void readConcreteColumnSectionProps(XmlNode node, Catalog<Section.Section> cat)
        {
            string sName = readAttribute(node, "SectionName", "");
            FrameSection sec = cat[sName] as FrameSection;
            if (sec != null)
            {
                ConcreteColumnSectionProps column = sec.ConcreteProperties as ConcreteColumnSectionProps;
                if (column == null)
                {
                    column = new ConcreteColumnSectionProps();
                    sec.ConcreteProperties = column as ConcreteColumnSectionProps;
                }

                string config = readAttribute(node, "ReinfConfig", column.RConfiguration.ToString());
                string lat = readAttribute(node, "LatReinf", column.LateralR.ToString());
                string cover = readAttribute(node, "Cover", column.CoverToRebarCenter.ToString());
                int n3 = int.Parse(readAttribute(node, "NumBars3Dir", "0"));
                int n2 = int.Parse(readAttribute(node, "NumBars2Dir", "0"));
                int circ = int.Parse(readAttribute(node, "NumBarsCirc", "0"));
                string size = readAttribute(node, "BarSize", column.BarSize.ToString());
                string space = readAttribute(node, "SpacingC", column.SpacingC.ToString());

                column.RConfiguration = (ConcreteColumnSectionProps.ReinforcementConfiguration)Enum.Parse(
                    typeof(ConcreteColumnSectionProps.ReinforcementConfiguration), config);
                column.LateralR = (ConcreteColumnSectionProps.LateralReinforcement)Enum.Parse(
                    typeof(ConcreteColumnSectionProps.LateralReinforcement), lat);
                column.CoverToRebarCenter = float.Parse(cover);
                column.NumberOfBars2Dir = n2;
                column.NumberOfBars3Dir = n3;
                if (column.RConfiguration == ConcreteColumnSectionProps.ReinforcementConfiguration.Circular)
                    column.NumberOfBars = circ;
                else
                {
                    column.NumberOfBars2Dir = n2;
                    column.NumberOfBars3Dir = n3;
                }
                column.BarSize = size;
                column.SpacingC = float.Parse(space);
            }
        }
示例#5
0
        private void SectionsGUI_Load(object sender, EventArgs e)
        {
            wizardControl.HideTabs = true;

            ConcreteColumnSectionProps cProps = new ConcreteColumnSectionProps();
            concreteSectionProps.Add(cProps);
            concreteSectionProps.Add(new ConcreteBeamSectionProps());

            sqColRebarSizeComboBox.DataSource = new List<string>(BarSizes.Instance.Keys);

            if (oneSection)
                wizardControl.SelectTab(4);
            else
                wizardControl.SelectTab(0);
            UpdatePage1();

            UpdateMaterialsComboBox();
        }
示例#6
0
        private void store(OleDbConnection cn, ConcreteColumnSectionProps obj, FrameSection section)
        {
            string mat = MaterialManager.Instance.DefaultSteel.Name;
            string sql, bars3, bars2, barsCirc;
            if (section is Rectangular)
            {
                bars2 = obj.NumberOfBars2Dir.ToString();
                bars3 = obj.NumberOfBars3Dir.ToString();
                barsCirc = "0";
            }
            else // Circular
            {
                bars2 = "0";
                bars3 = "0";
                barsCirc = obj.NumberOfBars.ToString();
            }

            string barsize = obj.BarSize.ToString();

            sql = "INSERT INTO [Frame Section Properties 02 - Concrete Column] (SectionName, RebarMatL, RebarMatC, ReinfConfig, LatReinf, Cover, NumBars3Dir, NumBars2Dir, NumBarsCirc, BarSize, SpacingC, NumCBars2, NumCBars3, ReinfType) " +
                "VALUES (\"" + section + "\", \"" + mat + "\", \"" + mat + "\", \"" + obj.RConfiguration + "\", \"" + obj.LateralR + "\", " + obj.CoverToRebarCenter + ", " + bars3 + ", " + bars2 + ", " + barsCirc + ", \"" + barsize + "\", " + obj.SpacingC + ", " + bars2 + ", " + bars3 + ", \"Design\");";
            new OleDbCommand(sql, cn).ExecuteNonQuery();
        }
示例#7
0
        private void UpdateModel(int page)
        {
            float value;

            switch (page)
            {
            case 1:
                currentSection.Name = nameTextBox.Text;
                if (currentMaterial != null)
                {
                    currentSection.Material = currentMaterial;
                }

                if (!(currentSection.Material.DesignProperties is ConcreteDesignProps))
                {
                    currentSection.ConcreteProperties = null;
                }
                break;

            case 2:
                if (currentSection is Rectangular)
                {
                    if (float.TryParse(t3TextBox.Text, out value))
                    {
                        ((Rectangular)currentSection).T3 = value;
                    }
                    if (float.TryParse(t2TextBox.Text, out value))
                    {
                        ((Rectangular)currentSection).T2 = value;
                    }
                }
                else if (currentSection is Circle)
                {
                    if (float.TryParse(t3TextBox.Text, out value))
                    {
                        ((Circle)currentSection).D = value;
                    }
                }
                else if (currentSection is Pipe)
                {
                    if (float.TryParse(t3TextBox.Text, out value))
                    {
                        currentSection.T3 = value;
                    }
                    if (float.TryParse(t2TextBox.Text, out value))
                    {
                        currentSection.Tw = value;
                    }
                }
                else
                {
                    if (float.TryParse(t3TextBox.Text, out value))
                    {
                        currentSection.T3 = value;
                    }
                    if (float.TryParse(t2TextBox.Text, out value))
                    {
                        currentSection.T2 = value;
                    }
                    if (float.TryParse(tfTextBox.Text, out value))
                    {
                        currentSection.Tf = value;
                    }
                    if (float.TryParse(twTextBox.Text, out value))
                    {
                        currentSection.Tw = value;
                    }
                    if (float.TryParse(disTextBox.Text, out value))
                    {
                        currentSection.Dis = value;
                    }
                }
                break;

            case 3:
                ConcreteSectionProps concProps = currentSection.ConcreteProperties;

                if (concProps != null)
                {
                    if (concProps is ConcreteBeamSectionProps)
                    {
                        ConcreteBeamSectionProps props = (ConcreteBeamSectionProps)concProps;
                        // TODO: Add an image to explain
                        if (float.TryParse(coverTopTextBox.Text, out value))
                        {
                            props.ConcreteCoverTop    = value;
                            props.ConcreteCoverBottom = value;
                        }
                        //if (float.TryParse(coverBottomTextBox.Text, out value))
                        //    props.ConcreteCoverBottom = value;
                        if (float.TryParse(coTopLeftTextBox.Text, out value))
                        {
                            props.RoTopLeft = value;
                        }
                        if (float.TryParse(coTopRightTextBox.Text, out value))
                        {
                            props.RoTopRight = value;
                        }
                        if (float.TryParse(coBottomLeftTextBox.Text, out value))
                        {
                            props.RoBottomLeft = value;
                        }
                        if (float.TryParse(coBottomRightTextBox.Text, out value))
                        {
                            props.RoBottomRight = value;
                        }
                        currentSection.ConcreteProperties = props;
                    }
                    else if (concProps is ConcreteColumnSectionProps)
                    {
                        ConcreteColumnSectionProps props = (ConcreteColumnSectionProps)concProps;
                        int ival;
                        if (int.TryParse(sqColRebars22TextBox.Text, out ival))
                        {
                            props.NumberOfBars2Dir = ival;
                        }
                        if (int.TryParse(sqColRebars33TextBox.Text, out ival))
                        {
                            props.NumberOfBars3Dir = ival;
                        }
                        if (float.TryParse(sqColCoverToRebarTextBox.Text, out value))
                        {
                            props.CoverToRebarCenter = value;
                        }
                        if (float.TryParse(sqColReinforcementsTextBox.Text, out value))
                        {
                            props.SpacingC = value;
                        }
                        props.BarSize = sqColRebarSizeComboBox.SelectedItem.ToString();
                        currentSection.ConcreteProperties = props;
                    }
                }
                break;

            case 4:
                if (currentSection is General)
                {
                    UpdateGeneralSection();
                }
                break;
            }
        }