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 pDeltaCheckBox_CheckedChanged(object sender, EventArgs e) { if (!updatingDialog) { if (pDeltaCase == null && pDeltaCheckBox.Checked) { PDeltaCaseProps props = new PDeltaCaseProps(); pDeltaCase = new AnalysisCase(Culture.Get("defaultPDeltaCase"), props); services.Model.AbstractCases.Add(pDeltaCase); } if (pDeltaCase != null) { pDeltaCase.IsActive = pDeltaCheckBox.Checked; Canguro.Model.Model.Instance.RepairAbstractCases(pDeltaCase); } UpdateDialog(); } }