private void readAnalysisCase(XmlNode node) { string name = readAttribute(node, "Case", "").Trim(); name = (name.Length > 0) ? name : Culture.Get("Case"); string type = readAttribute(node, "Type", "LinStatic"); string modal = readAttribute(node, "ModalCase", " "); bool active = readAttribute(node, "RunCase", "Yes").Equals("Yes"); AnalysisCaseProps props; switch (type) { case "LinRespSpec": props = new ResponseSpectrumCaseProps(); AnalysisCase modalCase; foreach (AbstractCase ac in model.AbstractCases) if (ac.Name.Equals(modal)) { ((ResponseSpectrumCaseProps)props).ModalAnalysisCase = (AnalysisCase)ac; break; } break; case "LinModal": props = new ModalCaseProps(); break; case "NonStatic": props = new PDeltaCaseProps(); ((PDeltaCaseProps)props).Loads = new List<StaticCaseFactor>(); break; default: props = new StaticCaseProps(); break; } AnalysisCase aCase = new AnalysisCase(name, props); aCase.IsActive = active; model.AbstractCases.Add(aCase); }
private void store(OleDbConnection cn, string analysisCase, StaticCaseProps props) { foreach (StaticCaseFactor factor in props.Loads) { string lType, lName, sFact; AnalysisCaseAppliedLoad appLoad = factor.AppliedLoad; if (appLoad is AccelLoad) { lType = "Accel load"; lName = ((AccelLoad)appLoad).Value.ToString(); sFact = "1.0"; } else { lType = "Load case"; lName = ((LoadCase)appLoad).Name; sFact = factor.Factor.ToString(); } string sql = "INSERT INTO [Case - Static 1 - Load Assignments] " + "([Case],LoadType,LoadName, LoadSF) VALUES " + "(\"" + analysisCase + "\",\"" + lType + "\",\"" + lName + "\"," + sFact + ");"; new OleDbCommand(sql, cn).ExecuteNonQuery(); } }