mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix: renamed spiral progress bar to ring progress bar; closes #235
This commit is contained in:
@ -97,11 +97,11 @@ Note, we chain commands here which is possible since the `add_dock` and `add_wid
|
||||
cam_widget.set_title("Camera Image Eiger")
|
||||
cam_widget.set_vrange(vmin=0, vmax=100)
|
||||
```
|
||||
As a final step, we can now add also a SpiralProgressBar to a new dock, and perform a grid_scan with the motors *samx* and *samy*.
|
||||
As a final step, we can now add also a RingProgressBar to a new dock, and perform a grid_scan with the motors *samx* and *samy*.
|
||||
As you see in the example below, all docks are arranged below each other. This is the default behavior of the `add_dock` method. However, the docks can be freely arranged by drag and drop as desired by the user. We invite you to explore this by yourself following the example in the video, and build your custom GUI with BEC Widgets.
|
||||
|
||||
```python
|
||||
prog_bar = gui.add_dock(name="prog_dock").add_widget('SpiralProgressBar')
|
||||
prog_bar = gui.add_dock(name="prog_dock").add_widget('RingProgressBar')
|
||||
prog_bar.set_line_widths(15)
|
||||
scans.grid_scan(dev.samy, -2, 2, 10, dev.samx, -5, 5, 10, exp_time=0.1, relative=False)
|
||||
```
|
||||
|
@ -1,9 +1,9 @@
|
||||
(user.widgets.spiral_progress_bar)=
|
||||
# [Spiral Progress Bar](/api_reference/_autosummary/bec_widgets.cli.client.SpiralProgressBar)
|
||||
# [Ring Progress Bar](/api_reference/_autosummary/bec_widgets.cli.client.RingProgressBar)
|
||||
|
||||
**Purpose:**
|
||||
|
||||
The Spiral Progress Bar widget is a circular progress bar that can be used to visualize the progress of a task. The
|
||||
The ring Progress Bar widget is a circular progress bar that can be used to visualize the progress of a task. The
|
||||
widget is designed to be used in applications where the progress of a task is represented as a percentage. The Spiral
|
||||
Progress Bar widget is a part of the BEC Widgets library and can be controlled directly using its API, or hooked up to
|
||||
the progress of a device readback or scan.
|
||||
@ -15,22 +15,22 @@ the progress of a device readback or scan.
|
||||
- multiple progress rings to show different tasks in parallel.
|
||||
|
||||
**Example of Use:**
|
||||

|
||||

|
||||
|
||||
**Code example:**
|
||||
|
||||
The following code snipped demonstrates how to create a `SpiralProgressBar` using BEC Widgets within BEC.
|
||||
The following code snipped demonstrates how to create a `RingProgressBar` using BEC Widgets within BEC.
|
||||
```python
|
||||
# adds a new dock with a spiral progress bar
|
||||
progress = gui.add_dock().add_widget("SpiralProgressBar")
|
||||
# adds a new dock with a ring progress bar
|
||||
progress = gui.add_dock().add_widget("RingProgressBar")
|
||||
# customize the size of the ring
|
||||
progress.set_line_width(20)
|
||||
```
|
||||
|
||||
By default, the Spiral Progress Bar widget will display a single ring. To add more rings, use the add_ring method:
|
||||
By default, the Ring Progress Bar widget will display a single ring. To add more rings, use the add_ring method:
|
||||
|
||||
```python
|
||||
# adds a new dock with a spiral progress bar
|
||||
# adds a new dock with a ring progress bar
|
||||
progress.add_ring()
|
||||
```
|
||||
|
||||
@ -42,7 +42,7 @@ progress.rings[0].set_line_width(20) # set the width of the first ring
|
||||
progress.rings[1].set_line_width(10) # set the width of the second ring
|
||||
```
|
||||
|
||||
By default, the `SpiralProgressBar` widget is set with `progress.enable_auto_update(True)`, which will automatically
|
||||
By default, the `RingProgressBar` widget is set with `progress.enable_auto_update(True)`, which will automatically
|
||||
update the bars in the widget. To manually set updates for each progress bar, use the set_update method. Note that
|
||||
manually updating a ring will disable the automatic update for the whole widget:
|
||||
|
@ -9,7 +9,7 @@ hidden: false
|
||||
---
|
||||
|
||||
bec_figure/
|
||||
spiral_progress_bar/
|
||||
ring_progress_bar/
|
||||
website/
|
||||
buttons/
|
||||
text_box/
|
||||
|
Reference in New Issue
Block a user