Skip to content

Commit 1e706e2

Browse files
committed
Pass precision to widget for Int and Float
1 parent 6bf2fae commit 1e706e2

File tree

1 file changed

+8
-4
lines changed
  • src/fastcs/transports/epics

1 file changed

+8
-4
lines changed

src/fastcs/transports/epics/gui.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ def _get_read_widget(self, fastcs_datatype: DataType) -> ReadWidgetUnion | None:
6161
match fastcs_datatype:
6262
case Bool():
6363
return LED()
64-
case Int() | Float():
65-
return TextRead()
64+
case Int():
65+
return TextRead(precision=0)
66+
case Float(prec=precision):
67+
return TextRead(precision=precision)
6668
case String():
6769
return TextRead(format=TextFormat.string)
6870
case Enum():
@@ -80,8 +82,10 @@ def _get_write_widget(self, fastcs_datatype: DataType) -> WriteWidgetUnion | Non
8082
match fastcs_datatype:
8183
case Bool():
8284
return ToggleButton()
83-
case Int() | Float():
84-
return TextWrite()
85+
case Int():
86+
return TextWrite(precision=0)
87+
case Float(prec=precision):
88+
return TextWrite(precision=precision)
8589
case String():
8690
return TextWrite(format=TextFormat.string)
8791
case Enum():

0 commit comments

Comments
 (0)