/// <summary> /// Executes the command. /// Creates, gets parameters and add a Distributed line load to the selected line elements. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { TemperatureGradientLineLoad load = new TemperatureGradientLineLoad(); if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(load) == System.Windows.Forms.DialogResult.OK) { List<Item> selection = services.GetSelection(); foreach (Item item in selection) { if (item is LineElement) ((LineElement)item).Loads.Add((TemperatureGradientLineLoad)load.Clone()); } } }
/// <summary> /// Executes the command. /// Creates, gets parameters and add a Distributed line load to the selected line elements. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { TemperatureGradientLineLoad load = new TemperatureGradientLineLoad(); if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(load) == System.Windows.Forms.DialogResult.OK) { List <Item> selection = services.GetSelection(); foreach (Item item in selection) { if (item is LineElement) { ((LineElement)item).Loads.Add((TemperatureGradientLineLoad)load.Clone()); } } } }
private void readLineTemperatureLoad(XmlNode node) { uint id = uint.Parse(readAttribute(node, "Frame", "0")); string lcName = readAttribute(node, "LoadCase", "").Trim(); lcName = (lcName.Length > 0) ? lcName : Culture.Get("Case"); LoadCase lCase = model.LoadCases[lcName]; LineElement obj = model.LineList[id]; if (obj != null && lCase != null) { AssignedLoads loads = obj.Loads; string type = readAttribute(node, "Type", ""); TemperatureLineLoad load = null; switch (type) { case "Temperature": load = new TemperatureLineLoad(); load.Temperature = float.Parse(readAttribute(node, "Temp", "0")); break; case "Gradient2": load = new TemperatureGradientLineLoad(); load.Temperature = float.Parse(readAttribute(node, "TempGrad2", "0")); ((TemperatureGradientLineLoad)load).LoadType = TemperatureGradientLineLoad.GradientDirection.G22; break; case "Gradient3": load = new TemperatureGradientLineLoad(); load.Temperature = float.Parse(readAttribute(node, "TempGrad3", "0")); ((TemperatureGradientLineLoad)load).LoadType = TemperatureGradientLineLoad.GradientDirection.G33; break; } if (load != null) loads.Add(load, lCase); } }