Esempio n. 1
0
        private static Result BuildTypedResult(FLT flt, double result)
        {
            switch (flt.GetType())
            {
            case UnitType.Area:
                return(Area.CreateWithStandardUnits(result));

            case UnitType.Density:
                return(Density.CreateWithStandardUnits(result));

            case UnitType.Force:
                return(Force.CreateWithStandardUnits(result));

            case UnitType.ForcePerLength:
                return(ForcePerLength.CreateWithStandardUnits(result));

            case UnitType.FlexuralStiffness:
                return(FlexuralStiffness.CreateWithStandardUnits(result));

            case UnitType.Length:
                return(Length.CreateWithStandardUnits(result));

            case UnitType.LengthCubed:
                return(LengthCubed.CreateWithStandardUnits(result));

            case UnitType.LengthToThe4th:
                return(LengthToThe4th.CreateWithStandardUnits(result));

            case UnitType.LengthToThe6th:
                return(LengthToThe6th.CreateWithStandardUnits(result));

            case UnitType.Moment:
                return(Moment.CreateWithStandardUnits(result));

            case UnitType.Stress:
                return(Stress.CreateWithStandardUnits(result));

            case UnitType.Time:
                return(Time.CreateWithStandardUnits(result));

            case UnitType.Undefined:
                return(new Undefined(flt, result));

            case UnitType.Unitless:
                return(new Unitless(result));

            default:
                throw new InvalidEnumArgumentException();
            }
        }
Esempio n. 2
0
 protected Result(FLT flt, double value, Unit displayUnit)
 {
     FLT         = flt;
     Value       = value;
     DisplayUnit = displayUnit;
 }
Esempio n. 3
0
 private LengthToThe4th(FLT flt, double value, LengthToThe4thUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 4
0
 private Time(FLT flt, double value, TimeUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 5
0
 private Density(FLT flt, double value, DensityUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 6
0
 private Unitless(FLT flt, double value, UnitlessUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 7
0
 public Undefined(FLT flt, double value)
     : base(flt, NormalizeValue(value, UndefinedUnit.Undefined), DefaultUnit)
 {
 }
Esempio n. 8
0
 private Stress(FLT flt, double value, StressUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 9
0
 private Moment(FLT flt, double value, MomentUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 10
0
 private Undefined(FLT flt, double value, UndefinedUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 11
0
 private ForcePerLength(FLT flt, double value, ForcePerLengthUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 12
0
 private LengthCubed(FLT flt, double value, LengthCubedUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 13
0
 private FlexuralStiffness(FLT flt, double value, FlexuralStiffnessUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 14
0
 private Area(FLT flt, double value, AreaUnit unit)
     : base(flt, value, unit)
 {
 }
Esempio n. 15
0
 private Force(FLT flt, double value, ForceUnit unit)
     : base(flt, value, unit)
 {
 }