Skip to content

Commit 4e7e158

Browse files
author
Dilmi Wickramanayake
committed
Merge branch 'users/DilmiWickramanayake/niscope_ex_fetch_forever' of https://github.com/ni/nipanel-python into users/DilmiWickramanayake/niscope_ex_fetch_forever
2 parents 0d720c5 + 94a0afc commit 4e7e158

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

examples/nidaqmx/nidaqmx_continuous_analog_input_panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
],
6666
}
67-
st_echarts(options=voltage_therm_graph, height="400px")
67+
st_echarts(options=voltage_therm_graph, height="400px", key="grpah")
6868

6969
voltage_tab.header("Voltage")
7070
with voltage_tab:

examples/niscope/niscope_ex_fetch_forever.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
print(f"Panel URL: {panel.panel_url}")
1616

1717
resource_name = "Dev1"
18-
channels = "0"
18+
channels = 0
1919
options = ""
2020
length = 1000
2121
samples_per_fetch = 1000
@@ -41,12 +41,12 @@
4141
waveform=wfm,
4242
)
4343
try:
44-
print(f"\nPress Ctrl + C to stop")
44+
print(f"Press Ctrl + C to stop")
4545
while True:
4646
offset = session._fetch_offset
4747
gain = session.meas_array_gain
4848
for i in range(len(waveforms)):
49-
time.sleep(1)
49+
time.sleep(0.2)
5050
amplitude_list = []
5151
total_data = waveforms[i].samples.tolist()
5252
for amplitude in total_data:

examples/niscope/niscope_ex_fetch_forever_panel.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
import nipanel
77

8-
panel = nipanel.get_panel_accessor()
9-
8+
st.set_page_config(page_title="NI-SCOPE Example", page_icon="📈", layout="wide")
109
st.title("NIScope EX Fetch Forever")
1110

11+
panel = nipanel.get_panel_accessor()
12+
1213
waveform = panel.get_value("Waveform", [0])
1314

1415
graph = {
16+
"animation": False,
1517
"tooltip": {"trigger": "axis"},
1618
"legend": {"data": ["Amplitude (V)"]},
1719
"xAxis": {
@@ -37,6 +39,8 @@
3739
"smooth": True,
3840
"seriesLayoutBy": "row",
3941
},
42+
4043
],
4144
}
42-
st_echarts(options=graph, height="400px", width="75%")
45+
st_echarts(options=graph, height="400px", width="75%", key="graph")
46+

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ optional = true
5959
[tool.poetry.group.examples.dependencies]
6060
streamlit-echarts = ">=0.4.0"
6161
nidaqmx = ">=0.8.0"
62+
niscope = ">=1.4.9"
6263

6364
[build-system]
6465
requires = ["poetry-core>=1.8.0"]

0 commit comments

Comments
 (0)