Skip to content

Commit 58de63a

Browse files
author
Dilmi Wickramanayake
committed
remove function
1 parent 16cdcc5 commit 58de63a

File tree

1 file changed

+36
-46
lines changed

1 file changed

+36
-46
lines changed

examples/nidaqmx/nidaqmx_analog_output_voltage/nidaqmx_analog_output_voltage_panel.py

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,6 @@
3636
)
3737

3838

39-
def hide_run_button() -> None:
40-
"""hide_run_button is used to disable run button when DAQ error pops up."""
41-
st.markdown(
42-
"""
43-
<style>
44-
button[data-testid="stBaseButton-secondary"] {
45-
display: none;
46-
}
47-
</style>
48-
""",
49-
unsafe_allow_html=True,
50-
)
51-
5239

5340
with left_col:
5441
with st.container(border=True):
@@ -141,6 +128,41 @@ def hide_run_button() -> None:
141128
)
142129

143130
with right_col:
131+
with st.container(border=True):
132+
st.title("Output")
133+
acquired_data = panel.get_value("data", [0.0])
134+
sample_rate = panel.get_value("sample_rate", 1000.0)
135+
acquired_data_graph = {
136+
"animation": False,
137+
"tooltip": {"trigger": "axis"},
138+
"legend": {"data": ["Voltage (V)"]},
139+
"xAxis": {
140+
"type": "category",
141+
"data": [x / sample_rate for x in range(len(acquired_data))],
142+
"name": "Time",
143+
"nameLocation": "center",
144+
"nameGap": 40,
145+
},
146+
"yAxis": {
147+
"type": "value",
148+
"name": "Amplitude",
149+
"nameRotate": 90,
150+
"nameLocation": "center",
151+
"nameGap": 40,
152+
},
153+
"series": [
154+
{
155+
"name": "voltage_amplitude",
156+
"type": "line",
157+
"data": acquired_data,
158+
"emphasis": {"focus": "series"},
159+
"smooth": True,
160+
"seriesLayoutBy": "row",
161+
},
162+
],
163+
}
164+
st_echarts(options=acquired_data_graph, height="400px", key="graph", width="100%")
165+
144166
with st.container(border=True):
145167
st.title("Trigger Settings")
146168
trigger_type = stx.tab_bar(
@@ -176,36 +198,4 @@ def hide_run_button() -> None:
176198
"This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported."
177199
)
178200

179-
with st.container(border=True):
180-
acquired_data = panel.get_value("data", [0.0])
181-
sample_rate = panel.get_value("sample_rate", 1000.0)
182-
acquired_data_graph = {
183-
"animation": False,
184-
"tooltip": {"trigger": "axis"},
185-
"legend": {"data": ["Voltage (V)"]},
186-
"xAxis": {
187-
"type": "category",
188-
"data": [x / sample_rate for x in range(len(acquired_data))],
189-
"name": "Time",
190-
"nameLocation": "center",
191-
"nameGap": 40,
192-
},
193-
"yAxis": {
194-
"type": "value",
195-
"name": "Amplitude",
196-
"nameRotate": 90,
197-
"nameLocation": "center",
198-
"nameGap": 40,
199-
},
200-
"series": [
201-
{
202-
"name": "voltage_amplitude",
203-
"type": "line",
204-
"data": acquired_data,
205-
"emphasis": {"focus": "series"},
206-
"smooth": True,
207-
"seriesLayoutBy": "row",
208-
},
209-
],
210-
}
211-
st_echarts(options=acquired_data_graph, height="400px", key="graph", width="100%")
201+

0 commit comments

Comments
 (0)