Skip to content

Commit 3fa3dd7

Browse files
author
Dilmi Wickramanayake
committed
Merge branch 'users/DilmiWickramanayake/Analog_Input' of https://github.com/ni/nipanel-python into users/DilmiWickramanayake/Analog_Input
2 parents 37cf999 + 75bd664 commit 3fa3dd7

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

examples/nidaqmx/nidaqmx_continuous_analog_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Streamlit application script for displaying values using nipanel package."""
1+
"""Data acquisition script that continuously acquires analog input data."""
22

33
import pathlib
44

examples/nidaqmx/nidaqmx_continuous_analog_input_panel.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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"""
22

33
import streamlit as st
44
from streamlit_echarts import st_echarts
@@ -21,32 +21,35 @@
2121
unsafe_allow_html=True,
2222
)
2323

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])
2626

2727
st.header("Voltage & Thermocouple")
2828
voltage_therm_graph = {
2929
"tooltip": {"trigger": "axis"},
30-
"legend": {"data": ["voltage_amplitude", "thermocouple_amplitude"]},
30+
"legend": {"data": ["Voltage (V)", "Temperature (C)"]},
3131
"xAxis": {
3232
"type": "category",
33-
"data": list(range(len(list_of_voltage_amp))),
33+
"data": list(range(len(voltage_data))),
3434
"name": "Time",
35+
"nameLocation": "center",
36+
"nameGap": 40
3537
},
36-
"yAxis": {"type": "value", "name": "Voltage and Thermocouple Amplitude"},
38+
"yAxis": {"type": "value", "name": "Measurement", "nameRotate": 90,"nameLocation": "center", "nameGap": 40},
39+
3740
"series": [
3841
{
3942
"name": "voltage_amplitude",
4043
"type": "line",
41-
"data": list_of_voltage_amp,
44+
"data": voltage_data,
4245
"emphasis": {"focus": "series"},
4346
"smooth": True,
4447
"seriesLayoutBy": "row",
4548
},
4649
{
4750
"name": "thermocouple_amplitude",
4851
"type": "line",
49-
"data": list_of_therm_amp,
52+
"data": thermocouple_data,
5053
"color": "red",
5154
"emphasis": {"focus": "series"},
5255
"smooth": True,

0 commit comments

Comments
 (0)