|
1 | | -"""Streamlit script for displaying values from nidaqmx_continuous_analog_input.py.""" |
| 1 | +"""Streamlit visualization script that displays the data acquired by nidaqmx_continuous_analog_input.py""" |
2 | 2 |
|
3 | 3 | import streamlit as st |
4 | 4 | from streamlit_echarts import st_echarts |
|
21 | 21 | unsafe_allow_html=True, |
22 | 22 | ) |
23 | 23 |
|
24 | | -list_of_therm_amp = panel.get_value("thermocouple_data", [0.0]) |
25 | | -list_of_voltage_amp = panel.get_value("voltage_data", [0.0]) |
| 24 | +thermocouple_data = panel.get_value("thermocouple_data", [0.0]) |
| 25 | +voltage_data = panel.get_value("voltage_data", [0.0]) |
26 | 26 |
|
27 | 27 | st.header("Voltage & Thermocouple") |
28 | 28 | voltage_therm_graph = { |
29 | 29 | "tooltip": {"trigger": "axis"}, |
30 | | - "legend": {"data": ["voltage_amplitude", "thermocouple_amplitude"]}, |
| 30 | + "legend": {"data": ["Voltage (V)", "Temperature (C)"]}, |
31 | 31 | "xAxis": { |
32 | 32 | "type": "category", |
33 | | - "data": list(range(len(list_of_voltage_amp))), |
| 33 | + "data": list(range(len(voltage_data))), |
34 | 34 | "name": "Time", |
| 35 | + "nameLocation": "center", |
| 36 | + "nameGap": 40 |
35 | 37 | }, |
36 | | - "yAxis": {"type": "value", "name": "Voltage and Thermocouple Amplitude"}, |
| 38 | + "yAxis": {"type": "value", "name": "Measurement", "nameRotate": 90,"nameLocation": "center", "nameGap": 40}, |
| 39 | + |
37 | 40 | "series": [ |
38 | 41 | { |
39 | 42 | "name": "voltage_amplitude", |
40 | 43 | "type": "line", |
41 | | - "data": list_of_voltage_amp, |
| 44 | + "data": voltage_data, |
42 | 45 | "emphasis": {"focus": "series"}, |
43 | 46 | "smooth": True, |
44 | 47 | "seriesLayoutBy": "row", |
45 | 48 | }, |
46 | 49 | { |
47 | 50 | "name": "thermocouple_amplitude", |
48 | 51 | "type": "line", |
49 | | - "data": list_of_therm_amp, |
| 52 | + "data": thermocouple_data, |
50 | 53 | "color": "red", |
51 | 54 | "emphasis": {"focus": "series"}, |
52 | 55 | "smooth": True, |
|
0 commit comments