/// <summary> /// Executes the command. /// Gets the Load Case properties from the User, adds it to the Model and sets it as Active. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { string name = Culture.Get("defaultLoadCase"); LoadCase lCase = new LoadCase(name, LoadCase.LoadCaseType.Dead); lCase.Name = name; // services.GetProperties(lCase.Name, lCase, false); EditLoadCaseDialog dlg = new EditLoadCaseDialog(lCase); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!services.Model.LoadCases.ContainsKey(lCase.Name)) services.Model.LoadCases.Add(lCase.Name, lCase); services.Model.ActiveLoadCase = lCase; AnalysisCase aCase = new AnalysisCase(lCase.Name); StaticCaseProps props = aCase.Properties as StaticCaseProps; if (props != null) { List<StaticCaseFactor> list = props.Loads; list.Add(new StaticCaseFactor(lCase)); props.Loads = list; services.Model.AbstractCases.Add(aCase); } } else services.Model.Undo.Rollback(); }
private void writeModalGeneralCase(XmlTextWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is ModalCaseProps) { ModalCaseProps mcp = (ModalCaseProps)props; xml.WriteStartElement("Case"); xml.WriteAttributeString("Name", aCase.Name); xml.WriteAttributeString("ModeType", mcp.ModesType.ToString()); xml.WriteAttributeString("MaxNumModes", mcp.MaxModes.ToString()); xml.WriteAttributeString("MinNumModes", mcp.MinModes.ToString()); xml.WriteAttributeString("EigenShift", "0"); xml.WriteAttributeString("EigenCutoff", "0"); xml.WriteAttributeString("EigenTol", "0.000000001"); xml.WriteAttributeString("AutoShift", "No"); xml.WriteEndElement(); } }
private void writeModalCase(XmlTextWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is ModalCaseProps) { ModalCaseProps mcp = (ModalCaseProps)props; if (mcp.ModesType == ModalCaseProps.ModesMethod.RitzVectors) { IList<ModalCaseFactor> list = mcp.Loads; foreach (ModalCaseFactor f in list) { if (f == null) continue; AnalysisCaseAppliedLoad load = f.AppliedLoad; if (load is LoadCase) { xml.WriteStartElement("Case"); xml.WriteAttributeString("Name", aCase.Name); xml.WriteAttributeString("LoadType", "Load Case"); xml.WriteAttributeString("LoadName", ((LoadCase)load).Name); xml.WriteAttributeString("MaxCycles", f.Cycles.ToString()); xml.WriteAttributeString("TargetPar", f.Ratio.ToString()); xml.WriteEndElement(); } if (load is AccelLoad) { xml.WriteStartElement("Case"); xml.WriteAttributeString("Name", aCase.Name); xml.WriteAttributeString("LoadType", "Accel"); xml.WriteAttributeString("LoadName", "Accel " + ((AccelLoad)load).Value); xml.WriteAttributeString("MaxCycles", f.Cycles.ToString()); xml.WriteAttributeString("TargetPar", f.Ratio.ToString()); xml.WriteEndElement(); } } } } }
private void writeAnalysisCase(XmlTextWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is ResponseSpectrumCaseProps) { ResponseSpectrumCaseProps rProps = props as ResponseSpectrumCaseProps; xml.WriteStartElement("Case"); xml.WriteAttributeString("Case", aCase.Name); xml.WriteAttributeString("Type", "LinRespSpec"); xml.WriteAttributeString("InitialCond", " "); xml.WriteAttributeString("ModalCase", rProps.ModalAnalysisCase.ToString()); xml.WriteAttributeString("RunCase", "Yes"); xml.WriteEndElement(); } else { string type = (props is ModalCaseProps) ? "LinModal" : "LinStatic"; xml.WriteStartElement("Case"); xml.WriteAttributeString("Case", aCase.Name); xml.WriteAttributeString("Type", type); xml.WriteAttributeString("InitialCond", "Zero"); xml.WriteAttributeString("ModalCase", " "); xml.WriteAttributeString("RunCase", "Yes"); xml.WriteEndElement(); } }
private void writeStaticCase(XmlTextWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is StaticCaseProps) { StaticCaseProps scprops = (StaticCaseProps)props; foreach (StaticCaseFactor factor in scprops.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(); } xml.WriteStartElement("Case"); xml.WriteAttributeString("Case", aCase.Name); xml.WriteAttributeString("LoadType", lType); xml.WriteAttributeString("LoadName", lName); xml.WriteAttributeString("LoadSF", sFact); xml.WriteEndElement(); } } }
private void writeResponseSpectrumLoadCase(XmlTextWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is ResponseSpectrumCaseProps) { ResponseSpectrumCaseProps rsp = (ResponseSpectrumCaseProps)props; IList<ResponseSpectrumCaseFactor> list = rsp.Loads; foreach (ResponseSpectrumCaseFactor f in list) { if (f == null) continue; AccelLoad load = f.Accel as AccelLoad; if (load != null) { xml.WriteStartElement("Case"); xml.WriteAttributeString("Name", aCase.Name); xml.WriteAttributeString("LoadType", "Acceleration"); xml.WriteAttributeString("LoadName", encode(load.Value)); xml.WriteAttributeString("CoordSys", "GLOBAL"); xml.WriteAttributeString("Function", rsp.ResponseSpectrumFunction.ToString()); xml.WriteAttributeString("Angle", "0"); xml.WriteAttributeString("TransAccSF", "1"); xml.WriteEndElement(); } } } }
private void writeResponseSpectrumGeneralCase(XmlTextWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is ResponseSpectrumCaseProps) { ResponseSpectrumCaseProps rsp = (ResponseSpectrumCaseProps)props; xml.WriteStartElement("Case"); xml.WriteAttributeString("Name", aCase.Name); xml.WriteAttributeString("ModalCombo", rsp.ModalCombination.ToString()); xml.WriteAttributeString("DirCombo", rsp.DirectionalCombination.ToString()); xml.WriteAttributeString("DampingType", "Constant"); xml.WriteAttributeString("ConstDamp", rsp.ModalDamping.ToString()); xml.WriteAttributeString("EccenRatio", "0"); xml.WriteAttributeString("NumOverride", "0"); xml.WriteEndElement(); } }
private void modalAnalysisCheckBox_CheckedChanged(object sender, EventArgs e) { if (!updatingDialog) { if (modalCase == null && modalAnalysisCheckBox.Checked) { modalCase = new AnalysisCase(Culture.Get("defaultModalCase"), new ModalCaseProps()); services.Model.AbstractCases.Add(modalCase); } if (modalCase != null) { modalCase.IsActive = modalAnalysisCheckBox.Checked; Canguro.Model.Model.Instance.RepairAbstractCases(modalCase); } UpdateDialog(); } }
private void writeAnalysisCase(XmlWriter xml, AnalysisCase aCase) { AnalysisCaseProps props = aCase.Properties; if (props is ResponseSpectrumCaseProps) { ResponseSpectrumCaseProps rProps = props as ResponseSpectrumCaseProps; xml.WriteStartElement("Case"); xml.WriteAttributeString("Case", aCase.Name); xml.WriteAttributeString("Type", "LinRespSpec"); xml.WriteAttributeString("InitialCond", " "); xml.WriteAttributeString("ModalCase", rProps.ModalAnalysisCase.ToString()); xml.WriteAttributeString("RunCase", CodeYN(aCase.IsActive)); xml.WriteEndElement(); } else { string initial = "Zero"; if (!(props is PDeltaCaseProps)) foreach (AbstractCase ac in model.AbstractCases) if (ac is AnalysisCase && ((AnalysisCase)ac).Properties is PDeltaCaseProps) initial = ac.Name; string type = (props is ModalCaseProps) ? "LinModal" : (props is PDeltaCaseProps) ? "NonStatic" : "LinStatic"; xml.WriteStartElement("Case"); xml.WriteAttributeString("Case", aCase.Name); xml.WriteAttributeString("Type", type); xml.WriteAttributeString("InitialCond", initial); xml.WriteAttributeString("ModalCase", " "); xml.WriteAttributeString("RunCase", CodeYN(aCase.IsActive)); xml.WriteEndElement(); } }
private void writeNamedSets2(XmlWriter xml, AnalysisCase aCase) { xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "AnalysisCase"); xml.WriteAttributeString("Selection", aCase.Name); xml.WriteEndElement(); }
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); }
/// <summary> /// Destruye todo el modelo y lo deja limpio /// </summary> /// <TODO>Modified, Save, Load</TODO> public void Reset() { try { this.undoManager = new UndoManager(this); undoManager.Enabled = false; this.abstractCases = new ManagedList<Canguro.Model.Load.AbstractCase>(); abstractCases.ElementRemoved += new ManagedList<AbstractCase>.ListChangedEventHandler(abstractCases_ElementRemoved); this.activeLoadCase = null; this.areaList = new ItemList<AreaElement>(); this.constraintList = new ManagedList<Constraint>(); this.isLocked = false; this.jointList = new ItemList<Joint>(); this.layers = new ItemList<Layer>(); layers.ElementRemoved += new ManagedList<Layer>.ListChangedEventHandler(layers_ElementRemoved); this.lineList = new ItemList<LineElement>(); this.loadCases = new ManagedDictionary<string, LoadCase>(); loadCases.ElementRemoved += new ManagedDictionary<string, LoadCase>.ListChangedEventHandler(loadCases_ElementRemoved); this.summary = new ModelSummary(this); this.designOptions = new List<DesignOptions>(); designOptions.Add(NoDesign.Instance); designOptions.Add(new LRFD99()); designOptions.Add(new ACI318_02()); designOptions.Add(new ASD01()); designOptions.Add(new RCDF2001()); designOptions.Add(new UBC97_ASD()); designOptions.Add(new UBC97_LRFD()); designOptions.Add(new UBC97_Conc()); steelDesignOptions = NoDesign.Instance; concreteDesignOptions = NoDesign.Instance; coldFormedDesignOptions = NoDesign.Instance; aluminumDesignOptions = NoDesign.Instance; this.results = new Canguro.Model.Results.Results(0); // Layer es un Item y todos los Items asignan su propiedad layer // de acuerdo a ActiveLayer, por lo que hay que asignarla en null // antes de crear el primer Layer, root de todos los demás activeLayer = null; Layer rootLayer = new Layer(Culture.Get("defaultLayerName")); ActiveLayer = rootLayer; activeLoadCase = new LoadCase(Culture.Get("defaultLoadCase"), LoadCase.LoadCaseType.Dead); activeLoadCase.SelfWeight = 1.0f; loadCases.Add(activeLoadCase.Name, activeLoadCase); AnalysisCase anc = new Canguro.Model.Load.AnalysisCase(Culture.Get("defaultLoadCase")); AbstractCases.Add(anc); if (anc != null) { StaticCaseProps props = anc.Properties as StaticCaseProps; if (props != null) { List<StaticCaseFactor> list = props.Loads; list.Add(new StaticCaseFactor(ActiveLoadCase)); props.Loads = list; } } MaterialManager.Instance.Initialize(); SectionManager.Instance.Initialize(ref sections); sections.ElementRemoved += new Catalog<Canguro.Model.Section.Section>.ListChangedEventHandler(sections_ElementRemoved); this.currentPath = ""; foreach (Canguro.Model.UnitSystem.UnitSystem us in UnitSystemsManager.Instance.UnitSystems) if (Properties.Settings.Default.UnitSystem.Equals(us.GetType().Name)) UnitSystemsManager.Instance.CurrentSystem = us; viewManager = Canguro.View.GraphicViewManager.Instance; modified = false; } catch (Exception e) { Console.WriteLine(e.StackTrace); throw e; } finally { if (ModelReset != null) ModelReset(this, EventArgs.Empty); undoManager.Enabled = true; } }
private void responseSpectrumCheckBox_CheckedChanged(object sender, EventArgs e) { if (!updatingDialog) { if (responseCases.Count == 0 && responseSpectrumCheckBox.Checked && services.Model.ResponseSpectra.Count > 0) { if (modalCase == null) { modalCase = new AnalysisCase(Culture.Get("defaultModalCase"), new ModalCaseProps()); services.Model.AbstractCases.Add(modalCase); } ResponseSpectrumCaseProps props = new ResponseSpectrumCaseProps(AccelLoad.AccelLoadValues.UX); props.ModalAnalysisCase = modalCase; responseCases.Add(new AnalysisCase(Culture.Get("defaultResponseCase") + " X", props)); responseCases[0].IsActive = false; services.Model.AbstractCases.Add(responseCases[0]); props = new ResponseSpectrumCaseProps(AccelLoad.AccelLoadValues.UY); props.ModalAnalysisCase = modalCase; responseCases.Add(new AnalysisCase(Culture.Get("defaultResponseCase") + " Y", props)); services.Model.AbstractCases.Add(responseCases[1]); props = new ResponseSpectrumCaseProps(AccelLoad.AccelLoadValues.UZ); props.ModalAnalysisCase = modalCase; responseCases.Add(new AnalysisCase(Culture.Get("defaultResponseCase") + " Z", props)); services.Model.AbstractCases.Add(responseCases[2]); } foreach (AbstractCase responseCase in responseCases) { responseCase.IsActive = responseSpectrumCheckBox.Checked; Canguro.Model.Model.Instance.RepairAbstractCases(responseCase); } UpdateDialog(); } }
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(); } }
public void Init() { try { updatingDialog = true; Canguro.Model.Model model = services.Model; int responseSpectrumCases = 0; foreach (AbstractCase aCase in model.AbstractCases) { if (aCase is AnalysisCase && ((AnalysisCase)aCase).Properties is ModalCaseProps) { modalCase = (AnalysisCase)aCase; modalAnalysisCheckBox.Checked = aCase.IsActive; } else if (aCase is AnalysisCase && ((AnalysisCase)aCase).Properties is PDeltaCaseProps) { pDeltaCase = (AnalysisCase)aCase; pDeltaCheckBox.Checked = aCase.IsActive; } else if (aCase is AnalysisCase && ((AnalysisCase)aCase).Properties is ResponseSpectrumCaseProps) { responseCases.Add((AnalysisCase)aCase); if (aCase.IsActive) responseSpectrumCases++; switch (responseSpectrumCases) { case 1: case 2: responseSpectrumCheckBox.CheckState = CheckState.Indeterminate; break; case 3: responseSpectrumCheckBox.CheckState = CheckState.Checked; break; default: responseSpectrumCheckBox.CheckState = CheckState.Unchecked; break; } } } responseSpectrumFunctionsComboBox.Items.Clear(); foreach (ResponseSpectrum rs in model.ResponseSpectra) responseSpectrumFunctionsComboBox.Items.Add(rs); steelDesignComboBox.Items.Add(NoDesign.Instance); concreteDesignComboBox.Items.Add(NoDesign.Instance); foreach (DesignOptions option in model.DesignOptions) { if (option is SteelDesignOptions) steelDesignComboBox.Items.Add(option); else if (option is ConcreteDesignOptions) concreteDesignComboBox.Items.Add(option); } steelDesignComboBox.SelectedItem = model.SteelDesignOptions; concreteDesignComboBox.SelectedItem = model.ConcreteDesignOptions; bool steelActive = false; bool concreteActive = false; foreach (Canguro.Model.LineElement e in model.LineList) { if (e != null && e.Properties is Canguro.Model.StraightFrameProps && ((Canguro.Model.StraightFrameProps)e.Properties).Section.Material.DesignProperties is Canguro.Model.Material.SteelDesignProps) steelActive = true; else if (e != null && e.Properties is Canguro.Model.StraightFrameProps && ((Canguro.Model.StraightFrameProps)e.Properties).Section.Material.DesignProperties is Canguro.Model.Material.ConcreteDesignProps) concreteActive = true; } steelDesignComboBox.Enabled = steelActive; concreteDesignComboBox.Enabled = concreteActive; } finally { updatingDialog = false; } this.Width = NormalWidth; }
private void writeNamedSets2(XmlTextWriter xml, AnalysisCase aCase) { xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Joint Displacements"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Joint Reactions"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection","Joint Velocities - Relative" ); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Joint Accelerations - Relative"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Assembled Joint Masses"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Element Joint Forces - Frames"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Element Joint Forces - Frames"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Base Reactions"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Modal Periods And Frequencies"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Modal Load Participation Ratios"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Modal Participating Mass Ratios"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Modal Participation Factors"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Response Spectrum Modal Information"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 1 - Summary Data - AISC-LRFD99"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 2 - PMM Details - AISC-LRFD99"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 3 - Shear Details - AISC-LRFD99"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 1 - Summary Data - AISC-ASD01"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 2 - PMM Details - AISC-ASD01"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 3 - Shear Details - AISC-ASD01"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 1 - Summary Data - UBC97-ASD"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 2 - PMM Details - UBC97-ASD"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 3 - Shear Details - UBC97-ASD"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Concrete Design 1 - Column Summary Data - Mexican RCDF 2001"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Concrete Design 2 - Beam Summary Data - Mexican RCDF 2001"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Concrete Design 1 - Column Summary Data - UBC97"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Concrete Design 2 - Beam Summary Data - UBC97"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 1 - Summary Data - UBC97-LRFD"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 2 - PMM Details - UBC97-LRFD"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Concrete Design 1 - Column Summary Data - ACI 318-02"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Concrete Design 2 - Beam Summary Data - ACI 318-02"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "Table"); xml.WriteAttributeString("Selection", "Steel Design 3 - Shear Details - UBC97-LRFD"); xml.WriteEndElement(); xml.WriteStartElement("DBNamedSet"); xml.WriteAttributeString("DBNamedSet", "RESULTS"); xml.WriteAttributeString("SelectType", "AnalysisCase"); xml.WriteAttributeString("Selection", aCase.Name); xml.WriteEndElement(); }
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); }
/// <summary> /// Destruye todo el modelo y lo deja limpio /// </summary> /// <TODO>Modified, Save, Load</TODO> public void Reset() { try { this.undoManager = new UndoManager(this); undoManager.Enabled = false; this.abstractCases = new ManagedList <Canguro.Model.Load.AbstractCase>(); abstractCases.ElementRemoved += new ManagedList <AbstractCase> .ListChangedEventHandler(abstractCases_ElementRemoved); this.activeLoadCase = null; this.areaList = new ItemList <AreaElement>(); this.constraintList = new ManagedList <Constraint>(); this.isLocked = false; this.jointList = new ItemList <Joint>(); this.layers = new ItemList <Layer>(); layers.ElementRemoved += new ManagedList <Layer> .ListChangedEventHandler(layers_ElementRemoved); this.lineList = new ItemList <LineElement>(); this.loadCases = new ManagedDictionary <string, LoadCase>(); loadCases.ElementRemoved += new ManagedDictionary <string, LoadCase> .ListChangedEventHandler(loadCases_ElementRemoved); this.summary = new ModelSummary(this); this.designOptions = new List <DesignOptions>(); designOptions.Add(NoDesign.Instance); designOptions.Add(new LRFD99()); designOptions.Add(new ACI318_02()); designOptions.Add(new ASD01()); designOptions.Add(new RCDF2001()); designOptions.Add(new UBC97_ASD()); designOptions.Add(new UBC97_LRFD()); designOptions.Add(new UBC97_Conc()); steelDesignOptions = NoDesign.Instance; concreteDesignOptions = NoDesign.Instance; coldFormedDesignOptions = NoDesign.Instance; aluminumDesignOptions = NoDesign.Instance; this.results = new Canguro.Model.Results.Results(0); // Layer es un Item y todos los Items asignan su propiedad layer // de acuerdo a ActiveLayer, por lo que hay que asignarla en null // antes de crear el primer Layer, root de todos los demás activeLayer = null; Layer rootLayer = new Layer(Culture.Get("defaultLayerName")); ActiveLayer = rootLayer; activeLoadCase = new LoadCase(Culture.Get("defaultLoadCase"), LoadCase.LoadCaseType.Dead); activeLoadCase.SelfWeight = 1.0f; loadCases.Add(activeLoadCase.Name, activeLoadCase); AnalysisCase anc = new Canguro.Model.Load.AnalysisCase(Culture.Get("defaultLoadCase")); AbstractCases.Add(anc); if (anc != null) { StaticCaseProps props = anc.Properties as StaticCaseProps; if (props != null) { List <StaticCaseFactor> list = props.Loads; list.Add(new StaticCaseFactor(ActiveLoadCase)); props.Loads = list; } } MaterialManager.Instance.Initialize(); SectionManager.Instance.Initialize(ref sections); sections.ElementRemoved += new Catalog <Canguro.Model.Section.Section> .ListChangedEventHandler(sections_ElementRemoved); this.currentPath = ""; foreach (Canguro.Model.UnitSystem.UnitSystem us in UnitSystemsManager.Instance.UnitSystems) { if (Properties.Settings.Default.UnitSystem.Equals(us.GetType().Name)) { UnitSystemsManager.Instance.CurrentSystem = us; } } viewManager = Canguro.View.GraphicViewManager.Instance; modified = false; } catch (Exception e) { Console.WriteLine(e.StackTrace); throw e; } finally { if (ModelReset != null) { ModelReset(this, EventArgs.Empty); } undoManager.Enabled = true; } }