Example #1
0
        private void store(OleDbConnection cn, string material, SteelDesignProps props)
        {
            string sql = "INSERT INTO [Material Properties 03 - Design Steel] " +
                         "(Material, Fy, Fu) VALUES (\"" + material + "\", " + props.Fy + ", " + props.Fu + ");";

            new OleDbCommand(sql, cn).ExecuteNonQuery();
        }
Example #2
0
 private void readSteelDesignProps(XmlNode node)
 {
     Material.Material mat = MaterialManager.Instance.Materials[readAttribute(node, "Material", "")];
     if (mat != null)
     {
         float fy = float.Parse(readAttribute(node, "Fy", "0"));
         float fu = float.Parse(readAttribute(node, "Fu", "0"));
         SteelDesignProps props = mat.DesignProperties as SteelDesignProps;
         if (props == null)
         {
             props = new SteelDesignProps(fy, fu);
             mat.DesignProperties = props;
         }
         props.Fy = fy;
         props.Fu = fu;
         mat.DesignProperties = props;
     }
 }
        private void readMaterial(System.Xml.XmlNode node)
        {
            if (!"Material".Equals(node.Name))
                return;

            string att;
            string name = Canguro.Model.Serializer.Deserializer.readAttribute(node, "Material", "MAT");
            MaterialTypeProps tProps;

            float e = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "E", "0"));
            float u = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "U", "0"));
            float a = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "A", "0"));
            att = Canguro.Model.Serializer.Deserializer.readAttribute(node, "Type", "Isotropic");
            switch (att)
            {
                case "Uniaxial":
                    tProps = new UniaxialTypeProps(e, a);
                    break;
                case "Isotropic":
                default:
                    tProps = new IsotropicTypeProps(e, u, a);
                    break;
            }

            string design = Canguro.Model.Serializer.Deserializer.readAttribute(node, "DesignType", "None");
            MaterialDesignProps dProps;
            switch (design)
            {
                case "Rebar":
                    dProps = new RebarDesignProps();
                    break;
                case "ColdFormed":
                    dProps = new ColdFormedDesignProps();
                    break;
                case "Steel":
                    dProps = new SteelDesignProps(); // Changes when readSteelDesignProps() is called.
                    break;
                case "Concrete":
                    dProps = new NoDesignProps(); // Changes when readConcreteDesignProps() is called.
                    break;
                case "Aluminum":
                    dProps = new AluminumDesignProps();
                    break;
                default:
                    dProps = new NoDesignProps();
                    break;
            }

            float d = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "UnitMass", "d"));

            Material mat = new Material(name, false, dProps, tProps, d);
            Materials[name] = mat;
        }
Example #4
0
 private void store(OleDbConnection cn, string material, SteelDesignProps props)
 {
     string sql = "INSERT INTO [Material Properties 03 - Design Steel] " +
         "(Material, Fy, Fu) VALUES (\"" + material + "\", " + props.Fy + ", " + props.Fu + ");";
     new OleDbCommand(sql, cn).ExecuteNonQuery();
 }