Operator UI
Monitor runs in real time from the production floor.
Overview
The Operator UI provides a simple interface for production operators to start tests, respond to prompts, and monitor progress in real-time on Stations.
Connect to Operator UI
Prerequisites
Upgrade to tofupilot client version ≥ 1.11.0:
pip install --upgrade tofupilot
Required Parameters
All Operator UI sessions require these fields: add procedure_id
and part_number
to your Test
constructor to enable real-time monitoring.
Prop | Type | Default |
---|---|---|
procedure_id? | str | – |
part_number? | str | – |
import openhtf as htf
from tofupilot.openhtf import TofuPilot
def phase_one(test):
return htf.PhaseResult.CONTINUE
def main():
test = htf.Test(
phase_one,
procedure_id="FVT1", # Required for Operator UI
part_number="PCB01", # Required for Operator UI
)
with TofuPilot(test):
test.execute(lambda: "SN-0001")
if __name__ == "__main__":
main()
User Input Parameters
Show instructions or collect input from operators using user_input.prompt()
.
Prop | Type | Default |
---|---|---|
user_input.prompt? | str → str | – |
message? | str | – |
text_input? | bool | False |
import openhtf as htf
from openhtf.plugs.user_input import UserInput
from openhtf.plugs import user_input
from tofupilot.openhtf import TofuPilot
import time
def power_on():
time.sleep(1)
return htf.PhaseResult.CONTINUE
@htf.plug(user_input=UserInput)
def prompt_operator_next(user_input):
user_input.prompt(
message="Click Next when the LED turn on",
text_input=False,
)
@htf.measures(htf.Measurement("led_color").equals("Green"))
@htf.plug(user_input=UserInput)
def prompt_operator_led_color(test, user_input):
led_color = user_input.prompt(
message="What is the LED color? (Green/Red/Blue)",
text_input=True,
)
test.measurements.led_color = led_color
def main():
test = htf.Test(
power_on,
prompt_operator_next,
prompt_operator_led_color,
procedure_id="FVT1",
part_number="PCB01",
)
with TofuPilot(test):
test.execute(test_start=user_input.prompt_for_test_start())
if __name__ == "__main__":
main()
Access Operator UI
Three ways to access the Operator UI:
- Console URL: Click the URL that appears in your console when the test starts
Connected to TofuPilot real-time server
Access Operator UI: [clickable_URL_to_Operator_UI]
- Stations page: Navigate to Stations and click Operator UI next to your station name
- Navigation bar: Click Operator UI to open the view for your User API key
The URL is unique per user or station. Share it with operators for live monitoring. Only authorized users can interact with prompts.
Disable Streaming
Test results stream live by default. Disable with stream=False
:
with TofuPilot(test, stream=False):
How is this guide?