Merge branch 'dropdown-gui' into 'v3'
Optional options in UI property control become dropdown See merge request openflexure/openflexure-microscope-server!477
This commit is contained in:
commit
a6b95f0948
4 changed files with 55 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
"""Functionality for communicating the required user interface for a thing."""
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
|
@ -90,6 +90,13 @@ class PropertyControl(BaseModel):
|
|||
read_back_delay: int = 1000
|
||||
"""The delay in ms before reading back the property."""
|
||||
|
||||
options: Optional[dict[str, str | int | float | bool]] = None
|
||||
"""A mapping of UI display name to value, used for creating a dropdown.
|
||||
|
||||
These options aren't validated here in any way. Any invalid values will be rejected
|
||||
when selected.
|
||||
"""
|
||||
|
||||
|
||||
def property_control_for(
|
||||
thing: lt.Thing, property_name: str, **kwargs: Any
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue