0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 11:41:49 +02:00

WIP Curve config reviewed and commented

This commit is contained in:
2025-01-16 13:46:08 +01:00
parent ca4ab59361
commit 7c46e1075a

View File

@ -31,11 +31,11 @@ class SignalData(BaseModel):
class Signal(BaseModel):
"""The configuration of a signal in the 1D waveform widget."""
source: str
x: Optional[SignalData] = None
source: Optional[str] = None # TODO probably not needed
x: Optional[SignalData] = None # TODO maybe not needed
y: SignalData
z: Optional[SignalData] = None
dap: Optional[str] = None
z: Optional[SignalData] = None # TODO maybe not needed
dap: Optional[str] = None # TODO utilize differently than in past
model_config: dict = {"validate_assignment": True}
@ -52,7 +52,9 @@ class CurveConfig(ConnectionConfig):
pen_style: Optional[Literal["solid", "dash", "dot", "dashdot"]] = Field(
"solid", description="The style of the pen of the curve."
)
source: Optional[str] = Field(None, description="The source of the curve.")
source: Optional[str] = Field(
None, description="The source of the curve."
) # TODO not needed probably
signals: Optional[Signal] = Field(None, description="The signal of the curve.")
color_map_z: Optional[str] = Field(
"magma", description="The colormap of the curves z gradient.", validate_default=True
@ -60,7 +62,9 @@ class CurveConfig(ConnectionConfig):
model_config: dict = {"validate_assignment": True}
_validate_color_map_z = field_validator("color_map_z")(Colors.validate_color_map)
_validate_color_map_z = field_validator("color_map_z")(
Colors.validate_color_map
) # TODO not needed probably
_validate_color = field_validator("color")(Colors.validate_color)
_validate_symbol_color = field_validator("symbol_color")(Colors.validate_color)