Exemplo n.º 1
0
        private void store(OleDbConnection cn, ConcreteBeamSectionProps obj, FrameSection section)
        {
            string mat = MaterialManager.Instance.DefaultSteel.Name;
            string sec = section.Name;
            string sql = "INSERT INTO [Frame Section Properties 03 - Concrete Beam] (SectionName, RebarMatL, RebarMatC, TopCover, BotCover, TopLeftArea, TopRghtArea, BotLeftArea, BotRghtArea) " +
                         "VALUES (\"" + sec + "\", \"" + mat + "\", \"" + mat + "\", " + obj.ConcreteCoverTop + ", " + obj.ConcreteCoverBottom + ", " + obj.RoTopLeft + ", " + obj.RoTopRight + ", " + obj.RoBottomLeft + ", " + obj.RoBottomRight + ");";

            new OleDbCommand(sql, cn).ExecuteNonQuery();
        }
Exemplo n.º 2
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);
                }
            }
        }
Exemplo n.º 3
0
 private void readConcreteBeamSectionProps(XmlNode node, Catalog<Section.Section> cat)
 {
     string sName = readAttribute(node, "SectionName", "");
     FrameSection sec = cat[sName] as FrameSection;
     if (sec != null)
     {
         ConcreteBeamSectionProps concreteBeam = sec.ConcreteProperties as ConcreteBeamSectionProps;
         if (concreteBeam == null)
         {
             concreteBeam = new ConcreteBeamSectionProps();
             sec.ConcreteProperties = concreteBeam as ConcreteBeamSectionProps;
         }
         concreteBeam.ConcreteCoverTop = float.Parse(readAttribute(node, "TopCover", concreteBeam.ConcreteCoverTop.ToString()));
         concreteBeam.ConcreteCoverTop = float.Parse(readAttribute(node, "BotCover", concreteBeam.ConcreteCoverBottom.ToString()));
         concreteBeam.ConcreteCoverTop = float.Parse(readAttribute(node, "TopLeftArea", concreteBeam.RoTopLeft.ToString()));
         concreteBeam.ConcreteCoverTop = float.Parse(readAttribute(node, "TopRghtArea", concreteBeam.RoTopRight.ToString()));
         concreteBeam.ConcreteCoverTop = float.Parse(readAttribute(node, "BotLeftArea", concreteBeam.RoBottomLeft.ToString()));
         concreteBeam.ConcreteCoverTop = float.Parse(readAttribute(node, "BotRghtArea", concreteBeam.RoBottomRight.ToString()));
     }
 }
Exemplo n.º 4
0
 private void store(OleDbConnection cn, ConcreteBeamSectionProps obj, FrameSection section)
 {
     string mat = MaterialManager.Instance.DefaultSteel.Name;
     string sec = section.Name;
     string sql = "INSERT INTO [Frame Section Properties 03 - Concrete Beam] (SectionName, RebarMatL, RebarMatC, TopCover, BotCover, TopLeftArea, TopRghtArea, BotLeftArea, BotRghtArea) " +
         "VALUES (\"" + sec + "\", \"" + mat + "\", \"" + mat + "\", " + obj.ConcreteCoverTop + ", " + obj.ConcreteCoverBottom + ", " + obj.RoTopLeft + ", " + obj.RoTopRight + ", " + obj.RoBottomLeft + ", " + obj.RoBottomRight + ");";
     new OleDbCommand(sql, cn).ExecuteNonQuery();
 }
Exemplo n.º 5
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;
            }
        }