Ejemplo n.º 1
0
        private void store(OleDbConnection cn, LoadCombination obj, Canguro.Model.Model model)
        {
            List <AbstractCaseFactor> list = obj.Cases;

            string sql       = "";
            string steel     = CodeYN(model.SteelDesignOptions.DesignCombinations.Contains(obj));
            string concrete  = CodeYN(model.ConcreteDesignOptions.DesignCombinations.Contains(obj));
            string alum      = CodeYN(model.AluminumDesignOptions.DesignCombinations.Contains(obj));
            string cold      = CodeYN(model.ColdFormedDesignOptions.DesignCombinations.Contains(obj));
            string comboType = GetComboType(obj.Type);

            foreach (AbstractCaseFactor f in list)
            {
                AbstractCase aCase = f.Case as AbstractCase;
                sql = "";
                if (aCase != null) // && aCase.IsActive)
                {
                    if (aCase is LoadCombination)
                    {
                        sql = "INSERT INTO [Combination Definitions] " +
                              "(ComboName,ComboType,CaseType,CaseName,ScaleFactor,SteelDesign,ConcDesign,AlumDesign,ColdDesign) VALUES " +
                              "(\"" + obj.Name + "\",\"\",\"Combo\",\"" + aCase.Name + "\"," + f.Factor + "," + steel + "," + concrete + "," + alum + "," + cold + ");";
                    }
                    else if (aCase is AnalysisCase)
                    {
                        AnalysisCaseProps props = ((AnalysisCase)aCase).Properties;
                        if (props is StaticCaseProps)
                        {
                            // StaticCaseProps sprops = (StaticCaseProps)props;
                            sql = "INSERT INTO [Combination Definitions] " +
                                  "(ComboName,ComboType,CaseType,CaseName,ScaleFactor,SteelDesign,ConcDesign,AlumDesign,ColdDesign) VALUES " +
                                  "(\"" + obj.Name + "\",\"" + comboType + "\",\"Linear Static\",\"" + aCase.Name + "\"," + f.Factor + "," + steel + "," + concrete + "," + alum + "," + cold + ");";
                        }
                        else if (props is ResponseSpectrumCaseProps)
                        {
                            sql = "INSERT INTO [Combination Definitions] " +
                                  "(ComboName,ComboType,CaseType,CaseName,ScaleFactor,SteelDesign,ConcDesign,AlumDesign,ColdDesign) VALUES " +
                                  "(\"" + obj.Name + "\",\"" + comboType + "\",\"Response Spectrum\",\"" + aCase.Name + "\"," + f.Factor + "," + steel + "," + concrete + "," + alum + "," + cold + ");";
                        }
                        //steel = concrete = alum = cold = "\"\"";
                    }
                    if (sql.Length > 0)
                    {
                        new OleDbCommand(sql, cn).ExecuteNonQuery();
                    }
                }
            }

            // Insert record in RESULTS Named Set
            sql = " INSERT INTO [Named Sets - Database Tables 2 - Selections] " +
                  "(DBNamedSet, SelectType, [Selection]) VALUES (\"RESULTS\", \"Combo\", \"" + obj.Name + "\");";
            new OleDbCommand(sql, cn).ExecuteNonQuery();
        }
Ejemplo n.º 2
0
        private void store(OleDbConnection cn, AnalysisCase obj)
        {
            AnalysisCaseProps props = obj.Properties;
            string            sql;

            if (props is ResponseSpectrumCaseProps)
            {
                ResponseSpectrumCaseProps rProps = props as ResponseSpectrumCaseProps;
                sql = "INSERT INTO [Analysis Case Definitions] " +
                      "([Case], Type, ModalCase, RunCase) VALUES " +
                      "(\"" + obj.Name + "\", \"LinRespSpec\", \"" + rProps.ModalAnalysisCase + "\", \"Yes\");";
            }
            else
            {
                string type = (props is ModalCaseProps) ? "LinModal" : "LinStatic";
                sql = "INSERT INTO [Analysis Case Definitions] " +
                      "([Case], Type, InitialCond, RunCase) VALUES " +
                      "(\"" + obj.Name + "\",\"" + type + "\",\"Zero\",\"Yes\");";
            }

            new OleDbCommand(sql, cn).ExecuteNonQuery();

            // Insert record in RESULTS Named Set
            sql = " INSERT INTO [Named Sets - Database Tables 2 - Selections] " +
                  "(DBNamedSet, SelectType, [Selection]) VALUES (\"RESULTS\", \"AnalysisCase\", \"" + obj.Name + "\");";
            new OleDbCommand(sql, cn).ExecuteNonQuery();

            if (props is StaticCaseProps)
            {
                store(cn, obj.Name, (StaticCaseProps)props);
            }
            else if (props is ModalCaseProps)
            {
                store(cn, obj.Name, (ModalCaseProps)props);
            }
            else if (props is ResponseSpectrumCaseProps)
            {
                store(cn, obj.Name, (ResponseSpectrumCaseProps)props);
            }
            //else if (props is MultistepStaticCaseProps)
            //    store(cn, obj.Name, (MultistepStaticCaseProps)props);
            //else if (props is TimeHistoryCaseProps)
            //    store(cn, obj.Name, (TimeHistoryCaseProps)props);
            //else if (props is MovingLoadCaseProps)
            //    store(cn, obj.Name, (MovingLoadCaseProps)props);
            //else if (props is BucklingCaseProps)
            //    store(cn, obj.Name, (BucklingCaseProps)props);
            //else if (props is SteadyStateCaseProps)
            //    store(cn, obj.Name, (SteadyStateCaseProps)props);
            //else if (props is PowerSpectalDensityCaseProps)
            //    store(cn, obj.Name, (PowerSpectalDensityCaseProps)props);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructora que da valores iniciales para el nombre y las propiedades.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="props"></param>
 public AnalysisCase(string name, AnalysisCaseProps props)
     : base(name)
 {
     properties = props;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructora que da valores iniciales para el nombre y las propiedades.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="props"></param>
 public AnalysisCase(string name, AnalysisCaseProps props)
     : base(name)
 {
     properties = props;
 }