Example #1
0
 public static string DspString(double Value, PressureRateUnit Unit)
 {
     if (double.IsNaN(Value))
     {
         return("");
     }
     return(Value.ToString(mDspFmt[(int)Unit], CultureInfo.CurrentCulture));
 }
Example #2
0
 public static string LogString(double Value, PressureRateUnit Unit, CultureInfo Culture)
 {
     if (double.IsNaN(Value))
     {
         return("");
     }
     return(Value.ToString(mLogFmt[(int)Unit], Culture));
 }
Example #3
0
        public static double Convert(double Value, PressureRateUnit FromUnit, PressureRateUnit ToUnit)
        {
            // it would be faster to create a 5-by-5 table with each conversion constant,
            // but this is much easier.
            if (FromUnit == ToUnit || double.IsNaN(Value))
            {
                return(Value);
            }
            // first, convert the unit to meters-per-sec
            double mb = Value / mRatios[(int)FromUnit];

            // now, convert to the desired unit
            return(mb * mRatios[(int)ToUnit]);
        }
Example #4
0
 public static string ToString(PressureRateUnit Unit)
 {
     return(mUnitStrings[(int)Unit]);
 }
Example #5
0
 public static string DspString(double Value, PressureRateUnit FromUnit, PressureRateUnit ToUnit)
 {
     return(DspString(Convert(Value, FromUnit, ToUnit), ToUnit));
 }
Example #6
0
 public static string LogString(double Value, PressureRateUnit FromUnit, PressureRateUnit ToUnit, CultureInfo Culture)
 {
     return(LogString(Convert(Value, FromUnit, ToUnit), ToUnit, Culture));
 }