Units Conversion

  Plugin development, Scripting

O-Calc Pro provides a complete set of routines for performing all of the units conversion that might be required by O-Calc developers.

It is important to understand that the stored units and the displayed units in O-Calc Pro are not always the same. The integrated Schema Explorer tool allows you to find the name and stored units of any attribute in the O-Calc data model.

Access to the units conversion routines are via the PPL_Lib.PPLGridModel.Attribute namespace and the methods provided are as follows.

  1. //Inches to ...
  2. public static double InchesToFeet(double pInches)
  3. public static double InchesToMillimeters(double pInches)
  4. public static double InchesToCentimeters(double pInches)
  5. public static double InchesToMeters(double pInches)
  6. public static double CentimetersToInches(double pCentimeters)
  7. public static double MillimetersToInches(double pMillimeters)
  8. public static double MetersToInches(double pMeters)
  9.  
  10. //Feet to ...
  11. public static double FeetToInches(double pFeet)
  12. public static double FeetToMeters(double pFeet)
  13. public static double MetersToFeet(double pMeters)
  14.  
  15. //Pounds to ...
  16. public static double PoundsToNewtons(double pLbs)
  17. public static double NewtonsToPounds(double pNewtons)
  18. public static double PoundsToKilograms(double pLbs)
  19. public static double KilogramsToPounds(double pKilograms)
  20.  
  21. //weight vs length...
  22. public static double PoundsPerInchToPoundsPerFoot(double pLbsPerIn)
  23. public static double PoundsPerInchToKilogramsPerCentimeter(double pLbsPerIn)
  24. public static double PoundsPerFootToPoundsPerInch(double pLbsPerFt)
  25. public static double PoundsPerInchToKilogramsPerMeter(double pLbsPerIn)
  26. public static double KilogramsPerMeterToPoundsPerInch(double pKgPerMtr)
  27.  
  28. //Pressure ...
  29. public static double PoundsPerSquareFootToPascal(double pPSF)
  30. public static double PascalToPoundsPerSquareFoot(double pPa)
  31. public static double KilopascalToPSI(double pKpa)
  32. public static double PSItoKilopascal(double pPSI)
  33.  
  34. //Density
  35. public static double PoundsPerCubicFootToKgM3(double pLbsFt3)
  36. public static double KgM3toPoundsPerCubicFoot(double pLbsFt3)
  37.  
  38. //Angle
  39. public static double RadiansToDegrees(double pRadians)
  40. public static double DegreesToRadians(double pDegrees)
  41.  
  42. //Pressure
  43. public static double PoundsPerCubicFootToPoundsPerCubicInch(double pPoundsPerCubicFoot)
  44. public static double PoundsPerCubicInchToPoundsPerCubicFoot(double pPoundsPerCubicInch)
  45.  
  46. //Torque ...
  47. public static double FootPoundsToNewtonMeters(double pFtLbs)
  48. public static double NewtonMetersToFootPounds(double pNtnMtr)
  49.  
  50. //Temperature
  51. public static double CelsiusToFahrenheit(double pCelsius)
  52. public static double FahrenheitToCelsius(double pFahrenheit)
  53.  
  54. //velocity
  55. public static double MilesPerHourToKilometersPerHour(double pMph)
  56. public static double KilometersPerHourMilesPerHour(double pKph)
  57.  
  58. //second moment of inertia
  59. public static double IN4toCM4(double pIN4)
  60. public static double CM4toIN4(double pCM4)
  61.  
  62. //area
  63. public static double IN2toCM2(double pIN2)
  64. public static double CM2toIN2(double pCM2)

Facebooktwitterlinkedinmail