Progress
Progress indicator bar.
You can create a progress bar with progress:
ui:
components:
- key: download_progress
type: progress
label: "Firmware Download"
description: "Downloading firmware to device"
value: 0
max: 100Properties
Display
You can configure how the progress bar appears to the operator.
| Property | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique identifier for updating the value |
type | string | Yes | Must be "progress" |
label | string | No | Display label above the progress bar |
description | string | No | Helper text displayed below the label |
Value
You can set default values and update them dynamically from Python.
| Property | Type | Required | Description |
|---|---|---|---|
value | number | No | Initial progress value |
min | number | No | Minimum value (default: 0) |
max | number | No | Maximum value (default: 100) |
Examples
Firmware Download
We'll show progress while downloading firmware to the device:
phases:
- name: Firmware Update
python:
module: update_firmware
ui:
components:
- key: download_progress
type: progress
label: "Firmware Download"
description: "Downloading firmware to device"
value: 0
max: 100import time
def update_firmware(run, device):
firmware_size = 2048 # KB
chunk_size = 64 # KB
downloaded = 0
log.info("Starting firmware download")
while downloaded < firmware_size:
chunk = min(chunk_size, firmware_size - downloaded)
device.write_firmware_chunk(chunk)
downloaded += chunk
progress = int((downloaded / firmware_size) * 100)
run.ui.download_progress = progress
time.sleep(0.1)
log.info("Firmware download complete")Multi-Stage Progress
We'll track progress across multiple test stages:
phases:
- name: Multi-Stage Test
python:
module: multi_stage_test
ui:
components:
- key: overall_progress
type: progress
label: "Overall Progress"
description: "Total progress across all stages"
value: 0
max: 100
- key: stage_name
type: text
label: "Current Stage"
value: ""
- key: stage_progress
type: progress
label: "Stage Progress"
description: "Progress within current stage"
value: 0
max: 100import time
def multi_stage_test(run):
stages = [
("Initialization", 10),
("Calibration", 20),
("Testing", 50),
("Cleanup", 10)
]
total_progress = 0
for stage_name, stage_steps in stages:
run.ui.stage_name = stage_name
log.info(f"Starting: {stage_name}")
for step in range(stage_steps + 1):
stage_progress = int((step / stage_steps) * 100)
run.ui.stage_progress = stage_progress
overall = total_progress + (step / stage_steps) * (stage_steps / 100)
run.ui.overall_progress = int(overall)
time.sleep(0.1)
total_progress += stage_stepsHow is this guide?