Пример #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();
            }
        }
Пример #2
0
 private LengthToThe4th(FLT flt, double value, LengthToThe4thUnit unit)
     : base(flt, value, unit)
 {
 }
 private LengthCubed(FLT flt, double value, LengthCubedUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #4
0
 private Stress(FLT flt, double value, StressUnit unit)
     : base(flt, value, unit)
 {
 }
 private ForcePerLength(FLT flt, double value, ForcePerLengthUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #6
0
 private Undefined(FLT flt, double value, UndefinedUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #7
0
 public Undefined(FLT flt, double value)
     : base(flt, NormalizeValue(value, UndefinedUnit.Undefined), DefaultUnit)
 {
 }
 private FlexuralStiffness(FLT flt, double value, FlexuralStiffnessUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #9
0
 private Moment(FLT flt, double value, MomentUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #10
0
 private Unitless(FLT flt, double value, UnitlessUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #11
0
 protected Result(FLT flt, double value, Unit displayUnit)
 {
     FLT         = flt;
     Value       = value;
     DisplayUnit = displayUnit;
 }
Пример #12
0
 private Area(FLT flt, double value, AreaUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #13
0
 private Time(FLT flt, double value, TimeUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #14
0
 private Density(FLT flt, double value, DensityUnit unit)
     : base(flt, value, unit)
 {
 }
Пример #15
0
 private Force(FLT flt, double value, ForceUnit unit)
     : base(flt, value, unit)
 {
 }