|  | 
| 145 | 145 |             ) | 
| 146 | 146 | 
 | 
| 147 | 147 | with right_col: | 
|  | 148 | + | 
|  | 149 | +    with st.container(border=True): | 
|  | 150 | +        st.title("Acquired Data") | 
|  | 151 | +        acquired_data = panel.get_value("acquired_data", [0.0]) | 
|  | 152 | +        sample_rate = panel.get_value("sample_rate", 100.0) | 
|  | 153 | +        acquired_data_graph = { | 
|  | 154 | +            "animation": False, | 
|  | 155 | +            "tooltip": {"trigger": "axis"}, | 
|  | 156 | +            "legend": {"data": ["Voltage (V)"]}, | 
|  | 157 | +            "xAxis": { | 
|  | 158 | +                "type": "category", | 
|  | 159 | +                "data": [x / sample_rate for x in range(len(acquired_data))], | 
|  | 160 | +                "name": "Time", | 
|  | 161 | +                "nameLocation": "center", | 
|  | 162 | +                "nameGap": 40, | 
|  | 163 | +            }, | 
|  | 164 | +            "yAxis": { | 
|  | 165 | +                "type": "value", | 
|  | 166 | +                "name": "Volts", | 
|  | 167 | +                "nameRotate": 90, | 
|  | 168 | +                "nameLocation": "center", | 
|  | 169 | +                "nameGap": 40, | 
|  | 170 | +            }, | 
|  | 171 | +            "series": [ | 
|  | 172 | +                { | 
|  | 173 | +                    "name": "voltage_amplitude", | 
|  | 174 | +                    "type": "line", | 
|  | 175 | +                    "data": acquired_data, | 
|  | 176 | +                    "emphasis": {"focus": "series"}, | 
|  | 177 | +                    "smooth": True, | 
|  | 178 | +                    "seriesLayoutBy": "row", | 
|  | 179 | +                }, | 
|  | 180 | +            ], | 
|  | 181 | +        } | 
|  | 182 | +        st_echarts(options=acquired_data_graph, height="400px", key="graph", width="100%") | 
|  | 183 | + | 
|  | 184 | +    st.title("Trigger Settings") | 
|  | 185 | +    trigger_type = stx.tab_bar( | 
|  | 186 | +        data=[ | 
|  | 187 | +            stx.TabBarItemData(id=1, title="No Trigger", description=""), | 
|  | 188 | +            stx.TabBarItemData(id=2, title="Digital Start", description=""), | 
|  | 189 | +            stx.TabBarItemData(id=3, title="Digital Pause", description=""), | 
|  | 190 | +            stx.TabBarItemData(id=4, title="Digital Reference", description=""), | 
|  | 191 | +            stx.TabBarItemData(id=5, title="Analog Start", description=""), | 
|  | 192 | +            stx.TabBarItemData(id=6, title="Analog Pause", description=""), | 
|  | 193 | +            stx.TabBarItemData(id=7, title="Analog Reference", description=""), | 
|  | 194 | +        ], | 
|  | 195 | +        default=1, | 
|  | 196 | +    ) | 
|  | 197 | +    panel.set_value("trigger_type", trigger_type) | 
|  | 198 | + | 
|  | 199 | +    if trigger_type == "1": | 
|  | 200 | +        with st.container(border=True): | 
|  | 201 | +            st.write( | 
|  | 202 | +                "To enable triggers, select a tab above, and configure the settings. \n Not all hardware supports all trigger types. Refer to your device documentation for more information." | 
|  | 203 | +            ) | 
|  | 204 | +    if trigger_type == "2": | 
|  | 205 | +        with st.container(border=True): | 
|  | 206 | +            source = st.selectbox( | 
|  | 207 | +                "Source", options=panel.get_value("available_trigger_sources", [""]) | 
|  | 208 | +            ) | 
|  | 209 | +            panel.set_value("digital_source", source) | 
|  | 210 | +            enum_selectbox( | 
|  | 211 | +                panel, | 
|  | 212 | +                label="Edge", | 
|  | 213 | +                value=Edge.FALLING, | 
|  | 214 | +                disabled=panel.get_value("is_running", False), | 
|  | 215 | +                key="edge", | 
|  | 216 | +            ) | 
|  | 217 | +    if trigger_type == "3": | 
|  | 218 | +        with st.container(border=True): | 
|  | 219 | +            st.write( | 
|  | 220 | +                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported" | 
|  | 221 | +            ) | 
|  | 222 | +    if trigger_type == "4": | 
|  | 223 | +        with st.container(border=True): | 
|  | 224 | +            st.write( | 
|  | 225 | +                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported" | 
|  | 226 | +            ) | 
|  | 227 | +    if trigger_type == "5": | 
|  | 228 | +        with st.container(border=True): | 
|  | 229 | +            analog_source = st.text_input("Source", "APFI0", key="analog_source") | 
|  | 230 | +            enum_selectbox( | 
|  | 231 | +                panel, | 
|  | 232 | +                label="Slope", | 
|  | 233 | +                value=Slope.FALLING, | 
|  | 234 | +                disabled=panel.get_value("is_running", False), | 
|  | 235 | +                key="slope", | 
|  | 236 | +            ) | 
|  | 237 | + | 
|  | 238 | +            level = st.number_input("Level", key="level") | 
|  | 239 | +            hysteriesis = st.number_input( | 
|  | 240 | +                "Hysteriesis", | 
|  | 241 | +                disabled=panel.get_value("is_running", False), | 
|  | 242 | +                key="hysteriesis", | 
|  | 243 | +            ) | 
|  | 244 | + | 
|  | 245 | +    if trigger_type == "6": | 
|  | 246 | +        with st.container(border=True): | 
|  | 247 | +            st.write( | 
|  | 248 | +                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported" | 
|  | 249 | +            ) | 
|  | 250 | +    if trigger_type == "7": | 
|  | 251 | +        with st.container(border=True): | 
|  | 252 | +            st.write( | 
|  | 253 | +                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported." | 
|  | 254 | +            ) | 
| 148 | 255 |     st.title("Task Types") | 
|  | 256 | + | 
| 149 | 257 |     chan_type = stx.tab_bar( | 
| 150 | 258 |         data=[ | 
| 151 | 259 |             stx.TabBarItemData(id=1, title="Voltage", description=""), | 
|  | 
| 156 | 264 |     ) | 
| 157 | 265 | 
 | 
| 158 | 266 |     panel.set_value("chan_type", chan_type) | 
| 159 |  | - | 
| 160 | 267 |     if chan_type == "1": | 
| 161 | 268 |         with st.container(border=True): | 
| 162 | 269 |             st.title("Voltage Data") | 
|  | 
| 197 | 304 |                     disabled=panel.get_value("is_running", False), | 
| 198 | 305 |                     key="units", | 
| 199 | 306 |                 ) | 
| 200 |  | -                with st.expander("More current info", expanded=False): | 
| 201 |  | -                    min_value_current = st.number_input( | 
| 202 |  | -                        "Min Value", | 
| 203 |  | -                        value=-0.01, | 
| 204 |  | -                        step=0.001, | 
| 205 |  | -                        disabled=panel.get_value("is_running", False), | 
| 206 |  | -                    ) | 
| 207 |  | -                    max_value_current = st.number_input( | 
| 208 |  | -                        "Max Value", | 
| 209 |  | -                        value=0.01, | 
| 210 |  | -                        step=1.0, | 
| 211 |  | -                        key="max_value_current", | 
| 212 |  | -                        disabled=panel.get_value("is_running", False), | 
| 213 |  | -                    ) | 
| 214 |  | -                    shunt_resistor_value = st.number_input( | 
| 215 |  | -                        "Shunt Resistor Value", | 
| 216 |  | -                        value=249.0, | 
| 217 |  | -                        step=1.0, | 
| 218 |  | -                        disabled=panel.get_value("is_running", False), | 
| 219 |  | -                    ) | 
|  | 307 | +                min_value_current = st.number_input( | 
|  | 308 | +                    "Min Value", | 
|  | 309 | +                    value=-0.01, | 
|  | 310 | +                    step=0.001, | 
|  | 311 | +                    disabled=panel.get_value("is_running", False), | 
|  | 312 | +                ) | 
|  | 313 | +                max_value_current = st.number_input( | 
|  | 314 | +                    "Max Value", | 
|  | 315 | +                    value=0.01, | 
|  | 316 | +                    step=1.0, | 
|  | 317 | +                    key="max_value_current", | 
|  | 318 | +                    disabled=panel.get_value("is_running", False), | 
|  | 319 | +                ) | 
|  | 320 | +                shunt_resistor_value = st.number_input( | 
|  | 321 | +                    "Shunt Resistor Value", | 
|  | 322 | +                    value=249.0, | 
|  | 323 | +                    step=1.0, | 
|  | 324 | +                    disabled=panel.get_value("is_running", False), | 
|  | 325 | +                ) | 
| 220 | 326 |     if chan_type == "3": | 
| 221 | 327 |         with st.container(border=True): | 
| 222 | 328 |             st.title("Strain Gage Data") | 
|  | 
| 242 | 348 |                     disabled=panel.get_value("is_running", False), | 
| 243 | 349 |                     key="strain_units", | 
| 244 | 350 |                 ) | 
| 245 |  | -                with st.expander("Strain Gage Information", expanded=False): | 
| 246 |  | -                    st.title("Strain Gage Information") | 
| 247 |  | -                    gage_factor = st.number_input( | 
| 248 |  | -                        "Gage Factor", | 
| 249 |  | -                        value=2.0, | 
| 250 |  | -                        step=1.0, | 
| 251 |  | -                        disabled=panel.get_value("is_running", False), | 
| 252 |  | -                        key="gage_factor", | 
| 253 |  | -                    ) | 
| 254 |  | -                    nominal_gage = st.number_input( | 
| 255 |  | -                        "nominal gage resistance", | 
| 256 |  | -                        value=350.0, | 
| 257 |  | -                        step=1.0, | 
| 258 |  | -                        disabled=panel.get_value("is_running", False), | 
| 259 |  | -                        key="gage_resistance", | 
| 260 |  | -                    ) | 
| 261 |  | -                    poisson_ratio = st.number_input( | 
| 262 |  | -                        "poisson ratio", | 
| 263 |  | -                        value=0.3, | 
| 264 |  | -                        step=1.0, | 
| 265 |  | -                        disabled=panel.get_value("is_running", False), | 
| 266 |  | -                        key="poisson_ratio", | 
| 267 |  | -                    ) | 
| 268 |  | -                with st.expander("Bridge Information", expanded=False): | 
| 269 |  | -                    st.title("Bridge Information") | 
| 270 |  | -                    enum_selectbox( | 
| 271 |  | -                        panel, | 
| 272 |  | -                        label="Strain Configuration", | 
| 273 |  | -                        value=StrainGageBridgeType.FULL_BRIDGE_I, | 
| 274 |  | -                        disabled=panel.get_value("is_running", False), | 
| 275 |  | -                        key="strain_configuration", | 
| 276 |  | -                    ) | 
| 277 |  | -                    wire_resistance = st.number_input( | 
| 278 |  | -                        "lead wire resistance", | 
| 279 |  | -                        value=0.0, | 
| 280 |  | -                        step=1.0, | 
| 281 |  | -                        key="wire_resistance", | 
| 282 |  | -                    ) | 
| 283 |  | -                    initial_voltage = st.number_input( | 
| 284 |  | -                        "initial bridge voltage", | 
| 285 |  | -                        value=0.0, | 
| 286 |  | -                        step=1.0, | 
| 287 |  | -                        disabled=panel.get_value("is_running", False), | 
| 288 |  | -                        key="initial_voltage", | 
| 289 |  | -                    ) | 
| 290 |  | - | 
| 291 |  | -                    st.selectbox( | 
| 292 |  | -                        label="voltage excitation source", | 
| 293 |  | -                        key="voltage_excit", | 
| 294 |  | -                        options=["External"], | 
| 295 |  | -                        disabled=True, | 
| 296 |  | -                    ) | 
| 297 |  | -                    panel.set_value("voltage_excitation_source", "voltage_excit") | 
| 298 |  | -                    voltage_excit = st.number_input( | 
| 299 |  | -                        "voltage excitation value", | 
| 300 |  | -                        value=2.5, | 
| 301 |  | -                        step=1.0, | 
| 302 |  | -                        key="voltage_excitation_value", | 
| 303 |  | -                        disabled=panel.get_value("is_running", False), | 
| 304 |  | -                    ) | 
| 305 |  | - | 
| 306 |  | -    st.title("Trigger Settings") | 
| 307 |  | -    trigger_type = stx.tab_bar( | 
| 308 |  | -        data=[ | 
| 309 |  | -            stx.TabBarItemData(id=1, title="No Trigger", description=""), | 
| 310 |  | -            stx.TabBarItemData(id=2, title="Digital Start", description=""), | 
| 311 |  | -            stx.TabBarItemData(id=3, title="Digital Pause", description=""), | 
| 312 |  | -            stx.TabBarItemData(id=4, title="Digital Reference", description=""), | 
| 313 |  | -            stx.TabBarItemData(id=5, title="Analog Start", description=""), | 
| 314 |  | -            stx.TabBarItemData(id=6, title="Analog Pause", description=""), | 
| 315 |  | -            stx.TabBarItemData(id=7, title="Analog Reference", description=""), | 
| 316 |  | -        ], | 
| 317 |  | -        default=1, | 
| 318 |  | -    ) | 
| 319 |  | -    panel.set_value("trigger_type", trigger_type) | 
| 320 |  | - | 
| 321 |  | -    if trigger_type == "1": | 
| 322 |  | -        with st.container(border=True): | 
| 323 |  | -            st.write( | 
| 324 |  | -                "To enable triggers, select a tab above, and configure the settings. \n Not all hardware supports all trigger types. Refer to your device documentation for more information." | 
| 325 |  | -            ) | 
| 326 |  | -    if trigger_type == "2": | 
| 327 |  | -        with st.container(border=True): | 
| 328 |  | -            source = st.selectbox( | 
| 329 |  | -                "Source->", options=panel.get_value("available_trigger_sources", [""]) | 
| 330 |  | -            ) | 
| 331 |  | -            panel.set_value("digital_source", source) | 
|  | 351 | +                st.title("Strain Gage Information") | 
|  | 352 | +                gage_factor = st.number_input( | 
|  | 353 | +                    "Gage Factor", | 
|  | 354 | +                    value=2.0, | 
|  | 355 | +                    step=1.0, | 
|  | 356 | +                    disabled=panel.get_value("is_running", False), | 
|  | 357 | +                    key="gage_factor", | 
|  | 358 | +                ) | 
|  | 359 | +                nominal_gage = st.number_input( | 
|  | 360 | +                    "Nominal Gage Resistance", | 
|  | 361 | +                    value=350.0, | 
|  | 362 | +                    step=1.0, | 
|  | 363 | +                    disabled=panel.get_value("is_running", False), | 
|  | 364 | +                    key="gage_resistance", | 
|  | 365 | +                ) | 
|  | 366 | +                poisson_ratio = st.number_input( | 
|  | 367 | +                    "Poisson Ratio", | 
|  | 368 | +                    value=0.3, | 
|  | 369 | +                    step=1.0, | 
|  | 370 | +                    disabled=panel.get_value("is_running", False), | 
|  | 371 | +                    key="poisson_ratio", | 
|  | 372 | +                ) | 
|  | 373 | +            st.title("Bridge Information") | 
| 332 | 374 |             enum_selectbox( | 
| 333 | 375 |                 panel, | 
| 334 |  | -                label="Edge", | 
| 335 |  | -                value=Edge.FALLING, | 
|  | 376 | +                label="Strain Configuration", | 
|  | 377 | +                value=StrainGageBridgeType.FULL_BRIDGE_I, | 
| 336 | 378 |                 disabled=panel.get_value("is_running", False), | 
| 337 |  | -                key="edge", | 
| 338 |  | -            ) | 
| 339 |  | -    if trigger_type == "3": | 
| 340 |  | -        with st.container(border=True): | 
| 341 |  | -            st.write( | 
| 342 |  | -                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported" | 
| 343 |  | -            ) | 
| 344 |  | -    if trigger_type == "4": | 
| 345 |  | -        with st.container(border=True): | 
| 346 |  | -            st.write( | 
| 347 |  | -                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported" | 
|  | 379 | +                key="strain_configuration", | 
| 348 | 380 |             ) | 
| 349 |  | -    if trigger_type == "5": | 
| 350 |  | -        with st.container(border=True): | 
| 351 |  | -            analog_source = st.text_input("Source:", "APFI0", key="analog_source") | 
| 352 |  | -            enum_selectbox( | 
| 353 |  | -                panel, | 
| 354 |  | -                label="Slope", | 
| 355 |  | -                value=Slope.FALLING, | 
| 356 |  | -                disabled=panel.get_value("is_running", False), | 
| 357 |  | -                key="slope", | 
|  | 381 | +            wire_resistance = st.number_input( | 
|  | 382 | +                "Lead Wire Resistance", | 
|  | 383 | +                value=0.0, | 
|  | 384 | +                step=1.0, | 
|  | 385 | +                key="wire_resistance", | 
| 358 | 386 |             ) | 
| 359 |  | - | 
| 360 |  | -            level = st.number_input("Level", key="level") | 
| 361 |  | -            hysteriesis = st.number_input( | 
| 362 |  | -                "Hysteriesis", | 
|  | 387 | +            initial_voltage = st.number_input( | 
|  | 388 | +                "Initial Bridge Voltage", | 
|  | 389 | +                value=0.0, | 
|  | 390 | +                step=1.0, | 
| 363 | 391 |                 disabled=panel.get_value("is_running", False), | 
| 364 |  | -                key="hysteriesis", | 
|  | 392 | +                key="initial_voltage", | 
| 365 | 393 |             ) | 
| 366 | 394 | 
 | 
| 367 |  | -    if trigger_type == "6": | 
| 368 |  | -        with st.container(border=True): | 
| 369 |  | -            st.write( | 
| 370 |  | -                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported" | 
|  | 395 | +            st.selectbox( | 
|  | 396 | +                label="Voltage Excitation Source", | 
|  | 397 | +                key="voltage_excit", | 
|  | 398 | +                options=["External"], | 
|  | 399 | +                disabled=True, | 
| 371 | 400 |             ) | 
| 372 |  | -    if trigger_type == "7": | 
| 373 |  | -        with st.container(border=True): | 
| 374 |  | -            st.write( | 
| 375 |  | -                "This trigger type is not supported in continuous sample timing. Refer to your device documentation for more information on which triggers are supported." | 
|  | 401 | +            panel.set_value("voltage_excitation_source", "voltage_excit") | 
|  | 402 | +            voltage_excit = st.number_input( | 
|  | 403 | +                "Voltage Excitation Value", | 
|  | 404 | +                value=2.5, | 
|  | 405 | +                step=1.0, | 
|  | 406 | +                key="voltage_excitation_value", | 
|  | 407 | +                disabled=panel.get_value("is_running", False), | 
| 376 | 408 |             ) | 
| 377 |  | - | 
| 378 |  | -    with st.container(border=True): | 
| 379 |  | -        acquired_data = panel.get_value("acquired_data", [0.0]) | 
| 380 |  | -        sample_rate = panel.get_value("sample_rate", 100.0) | 
| 381 |  | -        acquired_data_graph = { | 
| 382 |  | -            "animation": False, | 
| 383 |  | -            "tooltip": {"trigger": "axis"}, | 
| 384 |  | -            "legend": {"data": ["Voltage (V)"]}, | 
| 385 |  | -            "xAxis": { | 
| 386 |  | -                "type": "category", | 
| 387 |  | -                "data": [x / sample_rate for x in range(len(acquired_data))], | 
| 388 |  | -                "name": "Time", | 
| 389 |  | -                "nameLocation": "center", | 
| 390 |  | -                "nameGap": 40, | 
| 391 |  | -            }, | 
| 392 |  | -            "yAxis": { | 
| 393 |  | -                "type": "value", | 
| 394 |  | -                "name": "Volts", | 
| 395 |  | -                "nameRotate": 90, | 
| 396 |  | -                "nameLocation": "center", | 
| 397 |  | -                "nameGap": 40, | 
| 398 |  | -            }, | 
| 399 |  | -            "series": [ | 
| 400 |  | -                { | 
| 401 |  | -                    "name": "voltage_amplitude", | 
| 402 |  | -                    "type": "line", | 
| 403 |  | -                    "data": acquired_data, | 
| 404 |  | -                    "emphasis": {"focus": "series"}, | 
| 405 |  | -                    "smooth": True, | 
| 406 |  | -                    "seriesLayoutBy": "row", | 
| 407 |  | -                }, | 
| 408 |  | -            ], | 
| 409 |  | -        } | 
| 410 |  | -        st_echarts(options=acquired_data_graph, height="400px", key="graph", width="100%") | 
0 commit comments