private double GetBarPressureRatiokg_cm2(EUnitPressure to) { double ratio = 0; switch (to) { case EUnitPressure.Bar: ratio = 1.0 / 1.019716; break; case EUnitPressure.kPa: ratio = 1.0 / 1.019716 * 100.0; break; case EUnitPressure.MPa: ratio = 1.0 / 1.019716 * 0.1; break; case EUnitPressure.kg_cm2: ratio = 1.0; break; } return(ratio); }
private double GetPressureRatio(EUnitPressure from, EUnitPressure to) { double ratio = 0; switch (from) { case EUnitPressure.Bar: ratio = GetBarPressureRatioBar(to); break; case EUnitPressure.kPa: ratio = GetBarPressureRatiokPa(to); break; case EUnitPressure.MPa: ratio = GetBarPressureRatioMPa(to); break; case EUnitPressure.kg_cm2: ratio = GetBarPressureRatiokg_cm2(to); break; } return(ratio); }