Inheritance: Utility.GlobalizedObject, Section
Example #1
0
        public SectionsGUI(FrameSection section)
        {
            oneSection = (section != null);
            InitializeComponent();

            steelSections = new Dictionary<string, FrameSection>();
            concreteSections = new Dictionary<string, FrameSection>();
            allSections = new Dictionary<string, FrameSection>();
            concreteSectionProps = new List<ConcreteSectionProps>();
            shapeNames = new Dictionary<string, string>();

            shapeNames.Add("R", Culture.Get("RectangularSection"));
            shapeNames.Add("RN", Culture.Get("CircleSection"));
            //            shapeNames.Add("2L", Culture.Get("DoubleAngle"));
            shapeNames.Add("C", Culture.Get("Channel"));
            shapeNames.Add("I", Culture.Get("I_WideFlange"));
            shapeNames.Add("B", Culture.Get("Box_Tube"));
            shapeNames.Add("P", Culture.Get("Pipe"));
            shapeNames.Add("L", Culture.Get("Angle"));
            shapeNames.Add("T", Culture.Get("Tee"));
            shapeNames.Add("G", Culture.Get("General"));
            model = Canguro.Model.Model.Instance;

            coverTopLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            coverBottomLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            roTopLeftLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            roTopRightLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            roBottomLeftLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            roBottomRightLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            sqCoverLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            sqReinforcementsLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            areaLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.Area) + ")";
            JLabel.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.AreaInertia) + ")";
            sa33Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.Area) + ")";
            sa22Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.Area) + ")";
            i33Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.AreaInertia) + ")";
            i22Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.AreaInertia) + ")";
            s33Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.ShearModulus) + ")";
            s22Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.ShearModulus) + ")";
            z33Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.ShearModulus) + ")";
            z22Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.ShearModulus) + ")";
            r33Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
            r22Label.Text += " (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
        }
Example #2
0
 public static void writeConcreteBeamAssigments(XmlWriter xml, FrameSection sec)
 {
     ConcreteSectionProps concrete = sec.ConcreteProperties;
     if (concrete != null && sec.ConcreteProperties is ConcreteBeamSectionProps)
     {
         string mat = MaterialManager.Instance.DefaultSteel.Name;
         ConcreteBeamSectionProps concreteBeam = (ConcreteBeamSectionProps)concrete;
         xml.WriteStartElement("SectionName");
         xml.WriteAttributeString("SectionName", sec.Name);
         xml.WriteAttributeString("RebarMatL", mat);
         xml.WriteAttributeString("RebarMatC", mat);
         xml.WriteAttributeString("TopCover", concreteBeam.ConcreteCoverTop.ToString());
         xml.WriteAttributeString("BotCover", concreteBeam.ConcreteCoverBottom.ToString());
         xml.WriteAttributeString("TopLeftArea", concreteBeam.RoTopLeft.ToString());
         xml.WriteAttributeString("TopRghtArea", concreteBeam.RoTopRight.ToString());
         xml.WriteAttributeString("BotLeftArea", concreteBeam.RoBottomLeft.ToString());
         xml.WriteAttributeString("BotRghtArea", concreteBeam.RoBottomRight.ToString());
         xml.WriteEndElement();
     }
 }
Example #3
0
        public static void writeConcreteColumnSectionProps(XmlWriter xml, FrameSection sec)
        {
            ConcreteSectionProps concrete = sec.ConcreteProperties;
            if (concrete != null && sec.ConcreteProperties is ConcreteColumnSectionProps)
            {
                ConcreteColumnSectionProps concreteColum = (ConcreteColumnSectionProps)concrete;
                string mat = MaterialManager.Instance.DefaultSteel.Name;
                string bars3, bars2, barsCirc;

                if (sec is Rectangular)
                {
                    bars2 = concreteColum.NumberOfBars2Dir.ToString();
                    bars3 = concreteColum.NumberOfBars3Dir.ToString();
                    barsCirc = "0";
                }
                else
                { //rounded
                    bars2 = "0";
                    bars3 = "0";
                    barsCirc = concreteColum.NumberOfBars.ToString();
                }
                string barsize = concreteColum.BarSize.ToString();

                xml.WriteStartElement("SectionName");
                xml.WriteAttributeString("SectionName", sec.Name);
                xml.WriteAttributeString("RebarMatL", mat);
                xml.WriteAttributeString("RebarMatC", mat);
                xml.WriteAttributeString("ReinfConfig", concreteColum.RConfiguration.ToString());
                xml.WriteAttributeString("LatReinf", concreteColum.LateralR.ToString());
                xml.WriteAttributeString("Cover", concreteColum.CoverToRebarCenter.ToString());
                xml.WriteAttributeString("NumBars3Dir", bars3);
                xml.WriteAttributeString("NumBars2Dir", bars2);
                xml.WriteAttributeString("NumBarsCirc", barsCirc);
                xml.WriteAttributeString("BarSize", barsize);
                xml.WriteAttributeString("SpacingC", concreteColum.SpacingC.ToString());
                xml.WriteAttributeString("NumCBars2", bars2);
                xml.WriteAttributeString("NumCBars3", bars3);
                xml.WriteAttributeString("ReinfType", "Design");
                xml.WriteEndElement();
            }
        }
        /// <summary>
        /// Executes the command. 
        /// Gets the parameters and calls createCylinder to add a Cylinder to the model
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            if (section == null)
                section = Canguro.Model.Section.SectionManager.Instance.DefaultFrameSection as Canguro.Model.Section.FrameSection;
            services.GetProperties(Culture.Get("cylinderCmdTitle"), this);

            Controller.Snap.Magnet m = services.GetPoint(Culture.Get("selectCylinderCenter"));
            if (m == null) return;
            Microsoft.DirectX.Vector3 o = m.SnapPosition;

            StraightFrameProps props = new StraightFrameProps();
            props.Section = section;
            createCylinder(services.Model, o, r, c, h, s + 1, props);
        }
Example #5
0
        private void writeFrameSection(XmlTextWriter xml, FrameSection obj)
        {
            ConcreteSectionProps cprops = obj.ConcreteProperties;
            string concC = (cprops != null && cprops is ConcreteColumnSectionProps) ? "Yes" : "No";
            string concB = (cprops != null && cprops is ConcreteBeamSectionProps) ? "Yes" : "No";

            xml.WriteStartElement("SectionName");
            xml.WriteAttributeString("SectionName", obj.Name);
            xml.WriteAttributeString("Material", obj.Material.Name);
            xml.WriteAttributeString("Shape", secShape(obj.Shape));
            xml.WriteAttributeString("t3", obj.T3.ToString());
            xml.WriteAttributeString("t2", obj.T2.ToString());
            xml.WriteAttributeString("tf", obj.Tf.ToString());
            xml.WriteAttributeString("tw", obj.Tw.ToString());
            xml.WriteAttributeString("t2b", obj.T2b.ToString());
            xml.WriteAttributeString("tfb", obj.Tfb.ToString());
            xml.WriteAttributeString("Area", obj.Area.ToString());
            xml.WriteAttributeString("TorsConst", obj.TorsConst.ToString());
            xml.WriteAttributeString("I33", obj.I33.ToString());
            xml.WriteAttributeString("I22", obj.I22.ToString());
            xml.WriteAttributeString("AS2", obj.As2.ToString());
            xml.WriteAttributeString("AS3", obj.As3.ToString());
            xml.WriteAttributeString("S33", obj.S33.ToString());
            xml.WriteAttributeString("S22", obj.S22.ToString());
            xml.WriteAttributeString("Z33", obj.Z33.ToString());
            xml.WriteAttributeString("Z22", obj.Z22.ToString());
            xml.WriteAttributeString("R33", obj.R33.ToString());
            xml.WriteAttributeString("R22", obj.R22.ToString());
            xml.WriteAttributeString("ConcCol", concC);
            xml.WriteAttributeString("ConcBeam", concB);
            xml.WriteAttributeString("Color", "Yellow");
            xml.WriteAttributeString("TotalWt", "0");
            xml.WriteAttributeString("TotalMass", "0");
            xml.WriteAttributeString("FromFile", "No");
            xml.WriteAttributeString("AMod", "1");
            xml.WriteAttributeString("A2Mod", "1");
            xml.WriteAttributeString("A3Mod", "1");
            xml.WriteAttributeString("JMod", "1");
            xml.WriteAttributeString("I2Mod", "1");
            xml.WriteAttributeString("I3Mod", "1");
            xml.WriteAttributeString("MMod", "1");
            xml.WriteAttributeString("WMod", "1");
            xml.WriteAttributeString("SectInFile", " ");
            xml.WriteAttributeString("FileName", " ");
            xml.WriteEndElement();
        }
Example #6
0
 private void addButton_Click(object sender, EventArgs e)
 {
     currentMaterial = null;
     currentSection = null;
     wizardControl.SelectTab(1);
 }
Example #7
0
 private void UpdatePage1()
 {
     if (sectionsTreeView.TopNode != Canguro.Model.Model.Instance.Sections.Tree)
     {
         sectionsTreeView.Nodes.Clear();
         sectionsTreeView.Nodes.Add(Canguro.Model.Model.Instance.Sections.Tree);
     }
     sectionsTreeView.ExpandAll();
     currentSection = (sectionsTreeView.SelectedNode != null) ? (FrameSection)sectionsTreeView.SelectedNode.Tag : null;
     if (currentSection != null)
     {
         editButton.Enabled = true;
         deleteButton.Enabled = true;
         propertiesButton.Enabled = true;
     }
     else
     {
         editButton.Enabled = false;
         deleteButton.Enabled = false;
         propertiesButton.Enabled = false;
     }
     addButton.Enabled = true;
     sectionsTreeView.Update();
 }
Example #8
0
        private void startButton5_Click(object sender, EventArgs e)
        {
            currentSection = null;

            if (oneSection)
                DialogResult = DialogResult.Cancel;
            else
            {
                wizardControl.SelectTab(0);
                DialogResult = DialogResult.None;
            }
        }
Example #9
0
 private void sectionsTreeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if ((currentSection = sectionsTreeView.SelectedNode.Tag as FrameSection) == null)
     {
         editButton.Enabled = false;
         deleteButton.Enabled = false;
         propertiesButton.Enabled = false;
     }
     else
     {
         editButton.Enabled = true;
         deleteButton.Enabled = true;
         propertiesButton.Enabled = true;
     }
     addButton.Enabled = true;
 }
Example #10
0
        private void nextButton2_Click(object sender, EventArgs e)
        {
            if (currentSection == null)
            {
                currentMaterial = MaterialManager.Instance.Materials[materialComboBox.SelectedItem.ToString()];

                string secName = nameTextBox.Text;
                ConcreteSectionProps cProps = (currentMaterial.DesignProperties is ConcreteDesignProps) ? concreteSectionProps[0] : null;

                if (shapeNames["R"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Rectangular(secName, currentMaterial, cProps, 0.2f, 0.4f);
                else if (shapeNames["RN"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Circle(secName, currentMaterial, cProps, 0.4f);
                //else if (shapeNames["2L"].Equals(shapeComboBox.SelectedItem.ToString()))
                //    currentSection = new DoubleAngle(secName, "2L", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["C"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Channel(secName, "C", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["I"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new IWideFlange(secName, "C", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["B"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new BoxTube(secName, "B", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["P"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Pipe(secName, "P", currentMaterial, cProps, 0.2f, 0.02f);
                else if (shapeNames["L"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Angle(secName, "L", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["T"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Tee(secName, "T", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else
                    currentSection = new General(secName, "G", currentMaterial, cProps, 0.2f, 0.2f, 0, 0, 0, 0, 0, 0.0043f, 9.65e-8f, 0.0000657f, 0.0000033f, 0.002f, 0.002f, 0.00043f, 0.000052f, 0.00049f, 0.000081f, 0.1241f, 0.0278f);
            }

            UpdateModel(1);

            if (currentSection.GetType().Name.Equals("General"))
                wizardControl.SelectTab(4);
            else
                wizardControl.SelectTab(2);

            //if (currentSection is Rectangular || currentSection is Circle)
            //  wizardControl.SelectTab(2);
            //else
            //    wizardControl.SelectTab(0);
            DialogResult = DialogResult.None;
        }
Example #11
0
 private void store(OleDbConnection cn, FrameSection obj)
 {
     ConcreteSectionProps cprops = obj.ConcreteProperties;
     string concC = (cprops != null && cprops is ConcreteColumnSectionProps) ? "Yes" : "No";
     string concB = (cprops != null && cprops is ConcreteBeamSectionProps) ? "Yes" : "No";
     string sql = "INSERT INTO [Frame Section Properties 01 - General] " +
         "(SectionName, Material, Shape, t3, t2, tf, tw, t2b, tfb, Area, TorsConst, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22, ConcCol, ConcBeam, Color, TotalWt, TotalMass, FromFile, AMod, A2Mod, A3Mod, JMod, I2Mod, I3Mod, MMod, WMod) " +
             "VALUES (\"" + obj.Name + "\", \"" + obj.Material.Name + "\", \"" + secShape(obj.Shape) + "\", " +
             obj.T3 + ", " + obj.T2 + ", " + obj.Tf + ", " + obj.Tw + ", " + obj.T2b + ", " + obj.Tfb + ", " + obj.Area + ", " +
             obj.TorsConst + ", " + obj.I33 + ", " + obj.I22 + ", " + obj.As2 + ", " + obj.As3 + ", " + obj.S33 + ", " + obj.S22 + ", " + obj.Z33 + ", " + obj.Z22 + ", " + obj.R33 + ", " + obj.R22 + ", \"" + concC + "\", \"" + concB + "\", \"Yellow\", 0, 0, \"No\", 1, 1, 1, 1, 1, 1, 1, 1);";
     new OleDbCommand(sql, cn).ExecuteNonQuery();
 }
Example #12
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();
        }
Example #13
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();
 }
Example #14
0
 private void store(OleDbConnection cn, ConcreteSectionProps obj, FrameSection section, List<Section> exported)
 {
     if (obj != null && !exported.Contains(section))
     {
         if (obj is ConcreteBeamSectionProps)
             store(cn, (ConcreteBeamSectionProps)obj, section);
         else if (obj is ConcreteColumnSectionProps)
             store(cn, (ConcreteColumnSectionProps)obj, section);
         exported.Add(section);
     }
 }