개정판 ce3132c8
issue #1263 Unit 변경 시 Value값 오류 수정
Change-Id: Ifa1e8f58efb0519e465331fec57afcf8e2f1a2b3
HYTOS/HYTOS/Calculation.py | ||
---|---|---|
783 | 783 |
sys.exc_info()[-1].tb_lineno) |
784 | 784 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
785 | 785 | |
786 |
def get_ref_baro(self): |
|
787 |
try: |
|
788 |
unit = self.units['Pressure'] |
|
789 |
if unit == 'kg/cm2': |
|
790 |
ref_baro = 1.033 |
|
791 |
elif unit == 'bar': |
|
792 |
ref_baro = 1.01325 / 0.980665 |
|
793 |
elif unit == 'psi': |
|
794 |
ref_baro = 14.7 / 14.22334 |
|
795 |
elif unit == 'mmHg': |
|
796 |
ref_baro = 760 / 735.5591 |
|
797 |
elif unit == 'kPa': |
|
798 |
ref_baro = 101.325 / 98.0665 |
|
799 |
elif unit == 'MPa': |
|
800 |
ref_baro = 0.101325 / 0.0980665 |
|
801 | ||
802 |
return ref_baro |
|
803 |
except Exception as ex: |
|
804 |
from App import App |
|
805 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
806 |
sys.exc_info()[-1].tb_lineno) |
|
807 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
808 | ||
786 | 809 |
def get_barometric_pressure(self): |
787 | 810 |
try: |
788 | 811 |
unit = self.units['Pressure'] |
789 | 812 |
if unit == 'kg/cm2': |
790 | 813 |
barometric_pressure = 1.033 |
791 | 814 |
elif unit == 'bar': |
792 |
barometric_pressure = 1.01325 / 0.980665
|
|
815 |
barometric_pressure = 1.01325 |
|
793 | 816 |
elif unit == 'psi': |
794 |
barometric_pressure = 14.7 / 14.22334
|
|
817 |
barometric_pressure = 14.7 |
|
795 | 818 |
elif unit == 'mmHg': |
796 |
barometric_pressure = 760 / 735.5591
|
|
819 |
barometric_pressure = 760 |
|
797 | 820 |
elif unit == 'kPa': |
798 |
barometric_pressure = 101.325 / 98.0665
|
|
821 |
barometric_pressure = 101.325 |
|
799 | 822 |
elif unit == 'MPa': |
800 |
barometric_pressure = 0.101325 / 0.0980665
|
|
823 |
barometric_pressure = 0.101325 |
|
801 | 824 | |
802 | 825 |
return barometric_pressure |
803 | 826 |
except Exception as ex: |
... | ... | |
1926 | 1949 |
try: |
1927 | 1950 |
self.no = 0 |
1928 | 1951 | |
1929 |
Ref_baro = self.get_barometric_pressure()
|
|
1952 |
Ref_baro = self.get_ref_baro()
|
|
1930 | 1953 |
self.calc_factor = self.get_mixed_calc_factor() |
1931 | 1954 | |
1932 | 1955 |
# (1) fixed property |
내보내기 Unified diff