static internal bool GetSectionPropertyCrvs(string section, out List <Curve> crvs) { CrossSectionType cst = CrossSectionTypeFromString(section); switch (cst) { case CrossSectionType.RectangularSolid: return(GetRectangleCurve(section, out crvs)); case CrossSectionType.RHS: return(GetRHSCurve(section, out crvs)); case CrossSectionType.CHS: return(GetCHSCurve(section, out crvs)); case CrossSectionType.CSS: return(GetCSSCurve(section, out crvs)); default: break; } // If fails crvs = null; return(false); }
static internal bool CrossSectionFormString(string section, out WR_IXSec xSec) { CrossSectionType cst = CrossSectionTypeFromString(section); switch (cst) { case CrossSectionType.RectangularSolid: return(RectangularCrossSection(section, out xSec)); case CrossSectionType.RHS: return(RHSCrossSection(section, out xSec)); case CrossSectionType.CHS: return(CHSCrossSection(section, out xSec)); case CrossSectionType.CSS: // Not implemented yet return(CSSCrossSection(section, out xSec)); case CrossSectionType.Invalid: default: { xSec = null; return(false); } } }
public ErrorMessage SpecifyCrossSectionType(CrossSectionType aValue) { if (aValue != crossSectionType) { crossSectionType = aValue; //owner.HasBeenModified(true); DoScopingCalculation(); } return(null); }
public CrossSectionGeometry(CrossSectionType crossSectionType, UnitOperation owner) : base() { this.owner = owner; this.crossSectionType = crossSectionType; diameter = new ProcessVarDouble(StringConstants.DIAMETER, PhysicalQuantity.SmallLength, VarState.Specified, owner); width = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.Length, VarState.Specified, owner); height = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.Length, VarState.Specified, owner); heightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, owner); InitializeVarListAndRegisterVars(); }
private void ManageProcessVarList(CrossSectionType sectionType) { if (sectionType == CrossSectionType.Rectangle) { RemoveVarsOnListAndUnregisterInSystem(circularGeometryVarList); AddVarsOnListAndRegisterInSystem(rectangularGeometryVarList); } else if (sectionType == CrossSectionType.Circle) { RemoveVarsOnListAndUnregisterInSystem(rectangularGeometryVarList); AddVarsOnListAndRegisterInSystem(circularGeometryVarList); } }
public void SetCrossSectionType(CrossSectionType type) { if (type == CrossSectionType.Circle) { this.radioButtonCrossSectionTypeCircle.Checked = true; this.SetCircularSectionUI(); } else if (type == CrossSectionType.Rectangle) { this.radioButtonCrossSectionTypeRectangle.Checked = true; this.SetRectangularSectionUI(); } }
public override void SetObjectData() { base.SetObjectData(); int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionCrossSectionGeometry", typeof(int)); if (persistedClassVersion == 1) { this.crossSectionType = (CrossSectionType)info.GetValue("CrossSectionType", typeof(CrossSectionType)); this.diameter = RecallStorableObject("Diameter", typeof(ProcessVarDouble)) as ProcessVarDouble; this.width = RecallStorableObject("Width", typeof(ProcessVarDouble)) as ProcessVarDouble; this.height = RecallStorableObject("Height", typeof(ProcessVarDouble)) as ProcessVarDouble; this.heightWidthRatio = RecallStorableObject("HeightWidthRatio", typeof(ProcessVarDouble)) as ProcessVarDouble; } }
public DryerScopingModel(Dryer dryer) : base() { this.owner = dryer; crossSectionType = CrossSectionType.Circle; gasVelocity = new ProcessVarDouble(StringConstants.GAS_VELOCITY, PhysicalQuantity.Velocity, 2.0, VarState.Specified, dryer); diameter = new ProcessVarDouble(StringConstants.DIAMETER, PhysicalQuantity.Length, VarState.Specified, dryer); height = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.Length, VarState.Specified, dryer); lengthDiameterRatio = new ProcessVarDouble(StringConstants.LENGTH_DIAMETER_RATIO, PhysicalQuantity.Unknown, 8.0, VarState.Specified, dryer); width = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.Length, VarState.Specified, dryer); length = new ProcessVarDouble(StringConstants.LENGTH, PhysicalQuantity.Length, VarState.Specified, dryer); lengthWidthRatio = new ProcessVarDouble(StringConstants.LENGTH_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, dryer); heightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, dryer); InitializeVarListAndRegisterVars(); }
public Fan(string name, UnitOpSystem uoSys) : base(name, uoSys) { staticPressure = new ProcessVarDouble(StringConstants.STATIC_PRESSURE, PhysicalQuantity.Pressure, VarState.Specified, this); totalDischargePressure = new ProcessVarDouble(StringConstants.TOTAL_DISCHARGE_PRESSURE, PhysicalQuantity.Pressure, VarState.AlwaysCalculated, this); efficiency = new ProcessVarDouble(StringConstants.EFFICIENCY, PhysicalQuantity.Fraction, VarState.Specified, this); powerInput = new ProcessVarDouble(StringConstants.POWER_INPUT, PhysicalQuantity.Power, VarState.AlwaysCalculated, this); outletCrossSectionType = CrossSectionType.Circle; outletDiameter = new ProcessVarDouble(StringConstants.OUTLET_DIAMETER, PhysicalQuantity.SmallLength, VarState.Specified, this); outletWidth = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.SmallLength, VarState.Specified, this); outletHeight = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.SmallLength, VarState.Specified, this); outletHeightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, this); includeOutletVelocityEffect = true; outletVelocity = new ProcessVarDouble(StringConstants.OUTLET_VELOCITY, PhysicalQuantity.Velocity, VarState.AlwaysCalculated, this); //outletGeometry = new CrossSectionGeometry(this); InitializeVarListAndRegisterVars(); }
public override void SetObjectData() { base.SetObjectData(); int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionDryerScopingModel", typeof(int)); if (persistedClassVersion == 1) { this.owner = info.GetValue("Owner", typeof(Dryer)) as Dryer; this.procVarList = info.GetValue("ProcVarList", typeof(ArrayList)) as ArrayList; this.crossSectionType = (CrossSectionType)info.GetValue("CrossSectionType", typeof(CrossSectionType)); this.diameter = (ProcessVarDouble)RecallStorableObject("Diameter", typeof(ProcessVarDouble)); this.gasVelocity = (ProcessVarDouble)RecallStorableObject("GasVelocity", typeof(ProcessVarDouble)); this.height = (ProcessVarDouble)RecallStorableObject("Height", typeof(ProcessVarDouble)); this.lengthDiameterRatio = (ProcessVarDouble)RecallStorableObject("LengthDiameterRatio", typeof(ProcessVarDouble)); this.width = (ProcessVarDouble)RecallStorableObject("Width", typeof(ProcessVarDouble)); this.length = (ProcessVarDouble)RecallStorableObject("Length", typeof(ProcessVarDouble)); this.lengthWidthRatio = (ProcessVarDouble)RecallStorableObject("LengthWidthRatio", typeof(ProcessVarDouble)); this.heightWidthRatio = (ProcessVarDouble)RecallStorableObject("HeightWidthRatio", typeof(ProcessVarDouble)); } }
//public ErrorMessage SpecifyFanType(FanType aValue) { // ErrorMessage retValue = null; // if (aValue != fanType) { // if (fanType == FanType.Fan && staticPressure.IsSpecifiedAndHasValue && staticPressure.Value > 3477) { // string msg = "Changing the fan type from Blower to Fan causes the specified value of " + staticPressure.VarTypeName + " to be out of the appropriate range."; // retValue = new ErrorMessage(ErrorType.SpecifiedValueCausingOtherVarsOutOfRange, StringConstants.INAPPROPRIATE_SPECIFIED_VALUE, msg); // retValue.AddVarAndItsRange(staticPressure, new DoubleRange(0, 3477)); // } // else if (fanType == FanType.Blower && staticPressure.HasValue && (staticPressure.Value < 3477 || staticPressure.Value > 10320)) { // string msg = "Changing the fan type from Blower to Fan causes the specified value of " + staticPressure.VarTypeName + " to be out of the appropriate range."; // retValue = new ErrorMessage(ErrorType.SpecifiedValueCausingOtherVarsOutOfRange, StringConstants.INAPPROPRIATE_SPECIFIED_VALUE, msg); // retValue.AddVarAndItsRange(staticPressure, new DoubleRange(3477, 10320)); // } // if (retValue == null) { // fanType = aValue; // } // } // return retValue; //} public ErrorMessage SpecifyOutletCrossSectionType(CrossSectionType aValue) { ErrorMessage retMsg = null; if (aValue != outletCrossSectionType) { ManageProcessVarList(aValue); CrossSectionType oldValue = outletCrossSectionType; outletCrossSectionType = aValue; try { HasBeenModified(true); } catch (Exception e) { outletCrossSectionType = oldValue; ManageProcessVarList(oldValue); retMsg = HandleException(e); } } return(retMsg); }
public override void SetObjectData() { base.SetObjectData(); int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionFan", typeof(int)); if (persistedClassVersion == 1) { //this.fanType = (FanType) info.GetValue("FanType", typeof(FanType)); this.staticPressure = RecallStorableObject("StaticPressure", typeof(ProcessVarDouble)) as ProcessVarDouble; this.totalDischargePressure = RecallStorableObject("TotalDischargePressure", typeof(ProcessVarDouble)) as ProcessVarDouble; this.efficiency = RecallStorableObject("Efficiency", typeof(ProcessVarDouble)) as ProcessVarDouble; this.powerInput = RecallStorableObject("PowerInput", typeof(ProcessVarDouble)) as ProcessVarDouble; this.includeOutletVelocityEffect = (bool)info.GetValue("IncludeOutletVelocityEffect", typeof(bool)); this.outletCrossSectionType = (CrossSectionType)info.GetValue("OutletCrossSectionType", typeof(CrossSectionType)); this.outletDiameter = RecallStorableObject("OutletDiameter", typeof(ProcessVarDouble)) as ProcessVarDouble; this.outletVelocity = RecallStorableObject("OutletVelocity", typeof(ProcessVarDouble)) as ProcessVarDouble; this.outletWidth = RecallStorableObject("OutletWidth", typeof(ProcessVarDouble)) as ProcessVarDouble; this.outletHeight = RecallStorableObject("OutletHeight", typeof(ProcessVarDouble)) as ProcessVarDouble; this.outletHeightWidthRatio = RecallStorableObject("OutletHeightWidthRatio", typeof(ProcessVarDouble)) as ProcessVarDouble; this.circularGeometryVarList = info.GetValue("CircularGeometryVarList", typeof(ArrayList)) as ArrayList; this.rectangularGeometryVarList = info.GetValue("RectangularGeometryVarList", typeof(ArrayList)) as ArrayList; } }