From cc3ebaa55088d0fd35480fe053409d74ad44b189 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 21 Jul 2023 22:35:49 -0400 Subject: [PATCH] first pass --- hardware_calibration.txt | 538 +++++++++++++++++++++++++++++++++++++++ parse_hardware.py | 77 ++++++ parse_transducer.py | 68 +++++ transducer_verify.txt | 85 +++++++ 4 files changed, 768 insertions(+) create mode 100644 hardware_calibration.txt create mode 100644 parse_hardware.py create mode 100644 parse_transducer.py create mode 100644 transducer_verify.txt diff --git a/hardware_calibration.txt b/hardware_calibration.txt new file mode 100644 index 0000000..e5e656a --- /dev/null +++ b/hardware_calibration.txt @@ -0,0 +1,538 @@ +|| Instrument Info || + +Instrument Name Chassis2 Adult +Serial Number BBP1736 +Time 11:31:39 +Date 07/12/2022 + + +|| Hardware Calibration Report || + +Hardware 0 +=============================================================== + Test Port 1 + =========================================================== + + + Mass Flow Trans + =========================================================== + Transducer Custom + Input AIN 2 + Setpoint Pressure 1 25.000 psig + Setpoint Pressure 2 25.000 psig + Setpoint Pressure 3 25.000 psig + Setpoint Pressure 4 25.000 psig + Setpoint Pressure 5 25.000 psig + Setpoint Pressure 6 25.000 psig + Analog Value 1 8688254 cnts + Analog Value 2 9864771 cnts + Analog Value 3 11053088 cnts + Analog Value 4 12185889 cnts + Analog Value 5 13357767 cnts + Analog Value 6 14524278 cnts + Master Value 1 0.041 sccm + Master Value 2 4.059 sccm + Master Value 3 8.150 sccm + Master Value 4 11.980 sccm + Master Value 5 15.995 sccm + Master Value 6 19.985 sccm + Linearity 0.129 % + Last Cal Date 12/07/2020 + Last Cal Time 10:35:20 + Xdcr Filter Code Median + Xdcr Typ Residual 108.000 + Xdcr Zero LL 0.000 cnts + Xdcr Zero HL 0.000 cnts + Xdcr Zero Lwin 0.000 + Xdcr Zero Hwin 0.000 + Xdcr Analog Min 0.000 cnts + Xdcr Analog Max 0.000 cnts + Xdcr Base Min 0.000 + Xdcr Base Max 0.000 + Setpoint Pressure 1 5.800 psig + Setpoint Pressure 2 5.800 psig + Setpoint Pressure 3 5.800 psig + Setpoint Pressure 4 5.800 psig + Setpoint Pressure 5 5.800 psig + Setpoint Pressure 6 5.800 psig + Instrument Pressure 1 5.824 psig + Instrument Pressure 2 5.822 psig + Instrument Pressure 3 5.820 psig + Instrument Pressure 4 5.818 psig + Instrument Pressure 5 5.816 psig + Instrument Pressure 6 5.815 psig + Instrument Flow 1 0.038 sccm + Instrument Flow 2 4.075 sccm + Instrument Flow 3 8.151 sccm + Instrument Flow 4 12.124 sccm + Instrument Flow 5 16.213 sccm + Instrument Flow 6 20.165 sccm + Master Value 1 0.000 sccm + Master Value 2 4.000 sccm + Master Value 3 8.000 sccm + Master Value 4 12.000 sccm + Master Value 5 16.000 sccm + Master Value 6 20.000 sccm + Master Reading 1 0.000 sccm + Master Reading 2 4.000 sccm + Master Reading 3 8.000 sccm + Master Reading 4 12.000 sccm + Master Reading 5 16.000 sccm + Master Reading 6 20.000 sccm + Verify Date 07/12/2022 + Verify Time 10:54:56 + + + Pressure Transducer + =========================================================== + Transducer CTS D34-441 45PSIA + Input AIN 1 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Analog Value 1 10087020 cnts + Analog Value 2 10810568 cnts + Analog Value 3 11532365 cnts + Analog Value 4 12252414 cnts + Analog Value 5 12970722 cnts + Analog Value 6 13687182 cnts + Master Value 1 0.001 psig + Master Value 2 6.001 psig + Master Value 3 12.001 psig + Master Value 4 18.001 psig + Master Value 5 24.001 psig + Master Value 6 30.001 psig + XDCR Analog ATM 10086749 + Atm Pressure -0.000 bar + Linearity 0.082 % + Last Cal Date 12/07/2020 + Last Cal Time 09:03:38 + Xdcr Filter Code Med, J-Filter + Xdcr Typ Residual 80.000 + Xdcr Zero LL 9654557.000 cnts + Xdcr Zero HL 10485333.000 cnts + Xdcr Zero Lwin -2.501 psig + Xdcr Zero Hwin 2.499 psig + Xdcr Analog Min 5699952.000 cnts + Xdcr Analog Max 15110248.000 cnts + Xdcr Base Min -4294967.000 + Xdcr Base Max 8589935.000 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Instrument Pressure 1 0.000 psig + Instrument Pressure 2 6.000 psig + Instrument Pressure 3 11.999 psig + Instrument Pressure 4 17.998 psig + Instrument Pressure 5 23.997 psig + Instrument Pressure 6 29.997 psig + Master Value 1 0.000 psig + Master Value 2 6.000 psig + Master Value 3 12.000 psig + Master Value 4 18.000 psig + Master Value 5 24.000 psig + Master Value 6 30.000 psig + Verify Date 07/12/2022 + Verify Time 08:14:59 + + + Test Port 2 + =========================================================== + + + Mass Flow Trans + =========================================================== + Transducer Custom + Input AIN 4 + Setpoint Pressure 1 25.000 psig + Setpoint Pressure 2 25.000 psig + Setpoint Pressure 3 25.000 psig + Setpoint Pressure 4 25.000 psig + Setpoint Pressure 5 25.000 psig + Setpoint Pressure 6 25.000 psig + Analog Value 1 8689552 cnts + Analog Value 2 9914953 cnts + Analog Value 3 11057751 cnts + Analog Value 4 12214973 cnts + Analog Value 5 13397425 cnts + Analog Value 6 14516985 cnts + Master Value 1 0.054 sccm + Master Value 2 4.255 sccm + Master Value 3 8.124 sccm + Master Value 4 12.146 sccm + Master Value 5 16.159 sccm + Master Value 6 19.993 sccm + Linearity 0.166 % + Last Cal Date 12/07/2020 + Last Cal Time 10:50:52 + Xdcr Filter Code Median + Xdcr Typ Residual 83.000 + Xdcr Zero LL 0.000 cnts + Xdcr Zero HL 0.000 cnts + Xdcr Zero Lwin 0.000 + Xdcr Zero Hwin 0.000 + Xdcr Analog Min 0.000 cnts + Xdcr Analog Max 0.000 cnts + Xdcr Base Min 0.000 + Xdcr Base Max 0.000 + Setpoint Pressure 1 5.800 psig + Setpoint Pressure 2 5.800 psig + Setpoint Pressure 3 5.800 psig + Setpoint Pressure 4 5.800 psig + Setpoint Pressure 5 5.800 psig + Setpoint Pressure 6 5.800 psig + Instrument Pressure 1 5.780 psig + Instrument Pressure 2 5.779 psig + Instrument Pressure 3 5.808 psig + Instrument Pressure 4 5.809 psig + Instrument Pressure 5 5.807 psig + Instrument Pressure 6 5.807 psig + Instrument Flow 1 0.049 sccm + Instrument Flow 2 4.122 sccm + Instrument Flow 3 8.171 sccm + Instrument Flow 4 12.220 sccm + Instrument Flow 5 16.204 sccm + Instrument Flow 6 20.221 sccm + Master Value 1 0.000 sccm + Master Value 2 4.000 sccm + Master Value 3 8.000 sccm + Master Value 4 12.000 sccm + Master Value 5 16.000 sccm + Master Value 6 20.000 sccm + Master Reading 1 0.000 sccm + Master Reading 2 4.000 sccm + Master Reading 3 8.000 sccm + Master Reading 4 12.000 sccm + Master Reading 5 16.000 sccm + Master Reading 6 20.000 sccm + Verify Date 07/12/2022 + Verify Time 11:01:54 + + + Pressure Transducer + =========================================================== + Transducer CTS D34-441 45PSIA + Input AIN 3 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Analog Value 1 10050243 cnts + Analog Value 2 10763409 cnts + Analog Value 3 11474665 cnts + Analog Value 4 12184422 cnts + Analog Value 5 12892174 cnts + Analog Value 6 13598393 cnts + Master Value 1 0.001 psig + Master Value 2 6.001 psig + Master Value 3 12.001 psig + Master Value 4 18.001 psig + Master Value 5 24.001 psig + Master Value 6 30.001 psig + XDCR Analog ATM 10050055 + Atm Pressure -0.000 bar + Linearity 0.082 % + Last Cal Date 12/07/2020 + Last Cal Time 09:11:34 + Xdcr Filter Code Med, J-Filter + Xdcr Typ Residual 59.000 + Xdcr Zero LL 9654557.000 cnts + Xdcr Zero HL 10485333.000 cnts + Xdcr Zero Lwin -2.501 psig + Xdcr Zero Hwin 2.499 psig + Xdcr Analog Min 5699952.000 cnts + Xdcr Analog Max 15110248.000 cnts + Xdcr Base Min -4294967.000 + Xdcr Base Max 8589935.000 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Instrument Pressure 1 -0.000 psig + Instrument Pressure 2 5.999 psig + Instrument Pressure 3 12.000 psig + Instrument Pressure 4 17.998 psig + Instrument Pressure 5 23.999 psig + Instrument Pressure 6 29.999 psig + Master Value 1 0.000 psig + Master Value 2 6.000 psig + Master Value 3 12.000 psig + Master Value 4 18.000 psig + Master Value 5 24.000 psig + Master Value 6 30.000 psig + Verify Date 07/12/2022 + Verify Time 08:21:53 + + + Test Port 3 + =========================================================== + + + Mass Flow Trans + =========================================================== + Transducer Custom + Input AIN 6 + Setpoint Pressure 1 25.000 psig + Setpoint Pressure 2 25.000 psig + Setpoint Pressure 3 25.000 psig + Setpoint Pressure 4 25.000 psig + Setpoint Pressure 5 25.000 psig + Setpoint Pressure 6 25.000 psig + Analog Value 1 8686103 cnts + Analog Value 2 9889340 cnts + Analog Value 3 11072089 cnts + Analog Value 4 12249269 cnts + Analog Value 5 13397809 cnts + Analog Value 6 14502802 cnts + Master Value 1 0.007 sccm + Master Value 2 4.155 sccm + Master Value 3 8.207 sccm + Master Value 4 12.206 sccm + Master Value 5 16.165 sccm + Master Value 6 19.942 sccm + Linearity 0.096 % + Last Cal Date 12/07/2020 + Last Cal Time 14:29:53 + Xdcr Filter Code Median + Xdcr Typ Residual 722632.000 + Xdcr Zero LL 0.000 cnts + Xdcr Zero HL 0.000 cnts + Xdcr Zero Lwin 0.000 + Xdcr Zero Hwin 0.000 + Xdcr Analog Min 0.000 cnts + Xdcr Analog Max 0.000 cnts + Xdcr Base Min 0.000 + Xdcr Base Max 0.000 + Setpoint Pressure 1 5.800 psig + Setpoint Pressure 2 5.800 psig + Setpoint Pressure 3 5.800 psig + Setpoint Pressure 4 5.800 psig + Setpoint Pressure 5 5.800 psig + Setpoint Pressure 6 5.800 psig + Instrument Pressure 1 5.892 psig + Instrument Pressure 2 5.889 psig + Instrument Pressure 3 5.887 psig + Instrument Pressure 4 5.884 psig + Instrument Pressure 5 5.883 psig + Instrument Pressure 6 5.881 psig + Instrument Flow 1 0.005 sccm + Instrument Flow 2 4.091 sccm + Instrument Flow 3 8.123 sccm + Instrument Flow 4 12.135 sccm + Instrument Flow 5 16.175 sccm + Instrument Flow 6 20.202 sccm + Master Value 1 0.000 sccm + Master Value 2 4.000 sccm + Master Value 3 8.000 sccm + Master Value 4 12.000 sccm + Master Value 5 16.000 sccm + Master Value 6 20.000 sccm + Master Reading 1 0.000 sccm + Master Reading 2 4.000 sccm + Master Reading 3 8.000 sccm + Master Reading 4 12.000 sccm + Master Reading 5 16.000 sccm + Master Reading 6 20.000 sccm + Verify Date 07/12/2022 + Verify Time 11:18:36 + + + Pressure Transducer + =========================================================== + Transducer CTS D34-441 45PSIA + Input AIN 5 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Analog Value 1 10008894 cnts + Analog Value 2 10714413 cnts + Analog Value 3 11418030 cnts + Analog Value 4 12120292 cnts + Analog Value 5 12820552 cnts + Analog Value 6 13519203 cnts + Master Value 1 0.000 psig + Master Value 2 6.000 psig + Master Value 3 12.000 psig + Master Value 4 18.000 psig + Master Value 5 24.000 psig + Master Value 6 30.000 psig + XDCR Analog ATM 10008874 + Atm Pressure -0.000 bar + Linearity 0.081 % + Last Cal Date 07/12/2022 + Last Cal Time 09:09:57 + Xdcr Filter Code Med, J-Filter + Xdcr Typ Residual 121.000 + Xdcr Zero LL 9654557.000 cnts + Xdcr Zero HL 10485333.000 cnts + Xdcr Zero Lwin -2.500 psig + Xdcr Zero Hwin 2.500 psig + Xdcr Analog Min 5699952.000 cnts + Xdcr Analog Max 15110248.000 cnts + Xdcr Base Min -4294967.000 + Xdcr Base Max 8589935.000 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Instrument Pressure 1 -0.000 psig + Instrument Pressure 2 6.000 psig + Instrument Pressure 3 12.002 psig + Instrument Pressure 4 18.000 psig + Instrument Pressure 5 24.002 psig + Instrument Pressure 6 30.001 psig + Master Value 1 0.000 psig + Master Value 2 6.000 psig + Master Value 3 12.000 psig + Master Value 4 18.000 psig + Master Value 5 24.000 psig + Master Value 6 30.000 psig + Verify Date 07/12/2022 + Verify Time 09:13:02 + + + Test Port 4 + =========================================================== + + + Mass Flow Trans + =========================================================== + Transducer Custom + Input AIN 8 + Setpoint Pressure 1 25.000 psig + Setpoint Pressure 2 25.000 psig + Setpoint Pressure 3 25.000 psig + Setpoint Pressure 4 25.000 psig + Setpoint Pressure 5 25.000 psig + Setpoint Pressure 6 25.000 psig + Analog Value 1 8684522 cnts + Analog Value 2 9881552 cnts + Analog Value 3 11081720 cnts + Analog Value 4 12240018 cnts + Analog Value 5 13413541 cnts + Analog Value 6 14535797 cnts + Master Value 1 0.000 sccm + Master Value 2 4.090 sccm + Master Value 3 8.134 sccm + Master Value 4 12.132 sccm + Master Value 5 16.121 sccm + Master Value 6 19.984 sccm + Linearity 0.194 % + Last Cal Date 12/07/2020 + Last Cal Time 11:27:27 + Xdcr Filter Code Median + Xdcr Typ Residual 13.000 + Xdcr Zero LL 0.000 cnts + Xdcr Zero HL 0.000 cnts + Xdcr Zero Lwin 0.000 + Xdcr Zero Hwin 0.000 + Xdcr Analog Min 0.000 cnts + Xdcr Analog Max 0.000 cnts + Xdcr Base Min 0.000 + Xdcr Base Max 0.000 + Setpoint Pressure 1 5.800 psig + Setpoint Pressure 2 5.800 psig + Setpoint Pressure 3 5.800 psig + Setpoint Pressure 4 5.800 psig + Setpoint Pressure 5 5.800 psig + Setpoint Pressure 6 5.800 psig + Instrument Pressure 1 5.835 psig + Instrument Pressure 2 5.837 psig + Instrument Pressure 3 5.839 psig + Instrument Pressure 4 5.841 psig + Instrument Pressure 5 5.841 psig + Instrument Pressure 6 5.841 psig + Instrument Flow 1 -0.002 sccm + Instrument Flow 2 4.051 sccm + Instrument Flow 3 7.989 sccm + Instrument Flow 4 12.073 sccm + Instrument Flow 5 16.013 sccm + Instrument Flow 6 20.043 sccm + Master Value 1 0.000 sccm + Master Value 2 4.000 sccm + Master Value 3 8.000 sccm + Master Value 4 12.000 sccm + Master Value 5 16.000 sccm + Master Value 6 20.000 sccm + Master Reading 1 0.000 sccm + Master Reading 2 4.000 sccm + Master Reading 3 8.000 sccm + Master Reading 4 12.000 sccm + Master Reading 5 16.000 sccm + Master Reading 6 20.000 sccm + Verify Date 07/12/2022 + Verify Time 11:26:40 + + + Pressure Transducer + =========================================================== + Transducer CTS D34-441 45PSIA + Input AIN 7 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Analog Value 1 10046563 cnts + Analog Value 2 10762536 cnts + Analog Value 3 11476853 cnts + Analog Value 4 12189519 cnts + Analog Value 5 12900160 cnts + Analog Value 6 13609169 cnts + Master Value 1 0.000 psig + Master Value 2 6.000 psig + Master Value 3 12.000 psig + Master Value 4 18.000 psig + Master Value 5 24.000 psig + Master Value 6 30.000 psig + XDCR Analog ATM 10046626 + Atm Pressure 0.000 bar + Linearity 0.083 % + Last Cal Date 07/12/2022 + Last Cal Time 08:57:20 + Xdcr Filter Code Med, J-Filter + Xdcr Typ Residual 138.000 + Xdcr Zero LL 9654557.000 cnts + Xdcr Zero HL 10485333.000 cnts + Xdcr Zero Lwin -2.499 psig + Xdcr Zero Hwin 2.501 psig + Xdcr Analog Min 5699952.000 cnts + Xdcr Analog Max 15110248.000 cnts + Xdcr Base Min -4294967.000 + Xdcr Base Max 8589935.000 + Setpoint Pressure 1 0.000 psig + Setpoint Pressure 2 6.000 psig + Setpoint Pressure 3 12.000 psig + Setpoint Pressure 4 18.000 psig + Setpoint Pressure 5 24.000 psig + Setpoint Pressure 6 30.000 psig + Instrument Pressure 1 -0.000 psig + Instrument Pressure 2 5.999 psig + Instrument Pressure 3 11.999 psig + Instrument Pressure 4 17.998 psig + Instrument Pressure 5 23.997 psig + Instrument Pressure 6 29.997 psig + Master Value 1 0.000 psig + Master Value 2 6.000 psig + Master Value 3 12.000 psig + Master Value 4 18.000 psig + Master Value 5 24.000 psig + Master Value 6 30.000 psig + Verify Date 07/12/2022 + Verify Time 09:04:54 diff --git a/parse_hardware.py b/parse_hardware.py new file mode 100644 index 0000000..5e9368a --- /dev/null +++ b/parse_hardware.py @@ -0,0 +1,77 @@ +import re +from pprint import pprint + +def parse_instrument_info(text): + instrument_info = {} + # Regex pattern for key-value pairs in the instrument info section + for line in text.split("\n")[2:]: + if line: + key, value = re.sub(r'\s\s+', '`', line.strip()).split('`') + instrument_info[key.strip()] = value.strip() + return instrument_info + + +def parse_ports(text): + text = f"{text}\n\n" # ensure extra newline to match on + pattern = r'(Test Port \d)' + matches = re.split(pattern, text)[1:] + m = dict(list(zip(matches[0::2], matches[1::2]))) + calibration_data = {} + for port, calibration in m.items(): + calibration_data[port] = parse_calibration_data(calibration) + return calibration_data + + +KEEP = { + "Mass Flow Trans": ("Instrument Flow", "Master Reading"), + "Pressure Transducer" : ("Instrument Pressure", "Master Value") +} + + +def parse_calibration_data(text): + # Regex pattern for each block in the calibration data section per Port + pattern = r'(Mass Flow Trans|Pressure Transducer)\n(.+?)\n\n' + matches = re.findall(pattern, text, re.DOTALL) + calibration_data = {} + for block_title, block_content in matches: + lines = block_content.strip().split('\n') + lines.pop(0) # Go away ======= + device_name = lines.pop(0).strip().split(None, 1)[-1].strip() + device_data = {"name": device_name} + for line in lines: + key, value = re.sub(r'\s\s+', '`', line.strip()).split('`') + # Only keep the fields we want + for start in KEEP[block_title]: + key = key.strip() + if key.startswith(start): + device_data[key] = value.strip() + calibration_data[block_title] = device_data + return calibration_data + +def parse_file(file_path): + with open(file_path, 'r') as file: + content = file.read() + + # Split the content into instrument info and calibration data sections + info_section, calibration_section = content.split('|| Hardware Calibration Report ||') + + instrument_info = parse_instrument_info(info_section) + calibration_data = parse_ports(calibration_section) + + return instrument_info, calibration_data + +if __name__ == "__main__": + file_path = "./hardware_calibration.txt" # Replace with the actual file path + instrument_info, calibration_data = parse_file(file_path) + + print("Instrument Info:") + print(instrument_info) + + print("\nCalibration Data:") + for device_name, device_data in calibration_data.items(): + print(f"\nDevice: {device_name}") + for port, transducers in device_data.items(): + print(port) + pprint(transducers) + + diff --git a/parse_transducer.py b/parse_transducer.py new file mode 100644 index 0000000..a0c1a4e --- /dev/null +++ b/parse_transducer.py @@ -0,0 +1,68 @@ +import re + +def parse_transducer(file_path): + transducer_data = [] + with open(file_path, 'r') as file: + content = file.read() + + # Split the content into sections based on the blank line + sections = content.strip().split('\n\n') + + for section in sections: + # Split each section into lines + lines = section.strip().split('\n') + lines = [line.strip() for line in lines if not line.startswith("==") and line != "|| Transducer Verify Report ||"] + lines.pop(0) + + # Extract the Transducer number and Transducer type + transducer_line = lines.pop(0).strip() + _, transducer_name, transducer_type = transducer_line.split(None, 2) + + # Create a dictionary to store the data for each transducer + transducer_info = { + 'Transducer Name': transducer_name, + 'Transducer Type': transducer_type, + 'Setpoint Pressures': {}, + 'Instrument Pressures': {}, + 'Master Values': {}, + 'Instrument Flows': {}, + 'Verify Date': '', + 'Verify Time': '' + } + + # Extract other information for the transducer + for line in lines: + key, value = re.sub(r'\s\s+', ',', line.strip()).split(',') + if 'Setpoint Pressure' in key: + transducer_info['Setpoint Pressures'][key] = value + elif 'Instrument Pressure' in key: + transducer_info['Instrument Pressures'][key] = value + elif 'Master Value' in key: + transducer_info['Master Values'][key] = value + elif 'Instrument Flow' in key: + transducer_info['Instrument Flows'][key] = value + elif 'Verify Date' in key: + transducer_info['Verify Date'] = value + elif 'Verify Time' in key: + transducer_info['Verify Time'] = value + + transducer_data.append(transducer_info) + + return transducer_data + + +if __name__ == '__main__': + file_path = './transducer_verify.txt' + parsed_data = parse_text_file(file_path) + + # Printing the parsed data for each transducer + for transducer_info in parsed_data: + print("Transducer Name:", transducer_info['Transducer Name']) + print("Transducer Type:", transducer_info['Transducer Type']) + print("Setpoint Pressures:", transducer_info['Setpoint Pressures']) + print("Instrument Pressures:", transducer_info['Instrument Pressures']) + print("Master Values:", transducer_info['Master Values']) + print("Instrument Flows:", transducer_info['Instrument Flows']) + print("Verify Date:", transducer_info['Verify Date']) + print("Verify Time:", transducer_info['Verify Time']) + print("==========================") diff --git a/transducer_verify.txt b/transducer_verify.txt new file mode 100644 index 0000000..596e282 --- /dev/null +++ b/transducer_verify.txt @@ -0,0 +1,85 @@ +|| Transducer Verify Report || +TRANSDUCER1 +=============================================================== +Transducer 1 CTS D34-442 115PSIA +Setpoint Pressure 1 0.000 psig +Setpoint Pressure 2 20.000 psig +Setpoint Pressure 3 40.000 psig +Setpoint Pressure 4 60.000 psig +Setpoint Pressure 5 80.000 psig +Setpoint Pressure 6 100.000 psig +Instrument Pressure 1 0.000 psig +Instrument Pressure 2 20.002 psig +Instrument Pressure 3 39.997 psig +Instrument Pressure 4 60.010 psig +Instrument Pressure 5 80.001 psig +Instrument Pressure 6 100.002 psig +Master Value 1 0.000 psig +Master Value 2 20.000 psig +Master Value 3 40.000 psig +Master Value 4 60.000 psig +Master Value 5 80.000 psig +Master Value 6 100.000 psig +Verify Date 07/20/22 +Verify Time 11:20:26 + +TRANSDUCER2 +=============================================================== +Transducer 2 CTS A12-221 250SCCM +Setpoint Pressure 1 20.000 psig +Setpoint Pressure 2 20.000 psig +Setpoint Pressure 3 20.000 psig +Setpoint Pressure 4 20.000 psig +Setpoint Pressure 5 20.000 psig +Setpoint Pressure 6 20.000 psig +Setpoint Pressure 7 20.000 psig +Setpoint Pressure 8 20.000 psig +Setpoint Pressure 9 20.000 psig +Setpoint Pressure 10 20.000 psig +Setpoint Pressure 11 20.000 psig +Instrument Pressure 1 20.154 psig +Instrument Pressure 2 20.153 psig +Instrument Pressure 3 20.152 psig +Instrument Pressure 4 20.150 psig +Instrument Pressure 5 20.148 psig +Instrument Pressure 6 20.145 psig +Instrument Pressure 7 20.144 psig +Instrument Pressure 8 20.141 psig +Instrument Pressure 9 20.139 psig +Instrument Pressure 10 20.138 psig +Instrument Pressure 11 20.136 psig +Instrument Flow 1 -0.082 sccm +Instrument Flow 2 24.802 sccm +Instrument Flow 3 49.664 sccm +Instrument Flow 4 74.836 sccm +Instrument Flow 5 99.416 sccm +Instrument Flow 6 125.289 sccm +Instrument Flow 7 150.205 sccm +Instrument Flow 8 175.290 sccm +Instrument Flow 9 200.165 sccm +Instrument Flow 10 224.748 sccm +Instrument Flow 11 249.825 sccm +Master Reading 1 0.000 sccm +Master Reading 2 25.000 sccm +Master Reading 3 50.000 sccm +Master Reading 4 75.000 sccm +Master Reading 5 100.000 sccm +Master Reading 6 125.000 sccm +Master Reading 7 150.000 sccm +Master Reading 8 175.000 sccm +Master Reading 9 200.000 sccm +Master Reading 10 225.000 sccm +Master Reading 11 250.000 sccm +Master Value 1 0.000 sccm +Master Value 2 25.000 sccm +Master Value 3 50.000 sccm +Master Value 4 75.000 sccm +Master Value 5 100.000 sccm +Master Value 6 125.000 sccm +Master Value 7 150.000 sccm +Master Value 8 175.000 sccm +Master Value 9 200.000 sccm +Master Value 10 225.000 sccm +Master Value 11 250.000 sccm +Verify Date 07/15/21 +Verify Time 14:55:10