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
5340with left_col :
5441 with st .container (border = True ):
@@ -141,6 +128,41 @@ def hide_run_button() -> None:
141128 )
142129
143130with 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