Skip to content

Commit

Permalink
fix: fix exposure on mda range (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 authored Oct 12, 2023
1 parent 3974f92 commit 37c8284
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/pymmcore_widgets/_mda/_channel_table_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _pick_first_unused_channel(self, channel_group: str) -> str:
return available[0]

def _create_spinbox(
self, range: tuple[int, int], double: bool = False
self, range: tuple[int | float, int | float], double: bool = False
) -> QDoubleSpinBox:
dspinbox = QDoubleSpinBox() if double else QSpinBox()
dspinbox.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons)
Expand Down Expand Up @@ -249,8 +249,7 @@ def _create_new_row(self, channel: useq.Channel | None = None) -> None:
channel_combo.setCurrentText(channel.config)

# exposure spinbox
channel_exp_spinbox = self._create_spinbox((0, 10000), True)
channel_exp_spinbox.setMinimum(1)
channel_exp_spinbox = self._create_spinbox((0.01, 999999), True)
channel_exp_spinbox.setValue(channel.exposure or self._mmc.getExposure() or 100)

# z offset spinbox
Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/useq_widgets/_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ChannelTable(DataTableWidget):
# fmt: off
GROUP = TextColumn(key="group", default=DEFAULT_GROUP, hidden=True)
CONFIG = TextColumn(key="config", default=None, is_row_selector=True)
EXPOSURE = FloatColumn(key="exposure", header="Exposure [ms]", default=100.0, minimum=1) # noqa
EXPOSURE = FloatColumn(key="exposure", header="Exposure [ms]", default=100.0, minimum=0.01) # noqa
ACQUIRE_EVERY = IntColumn(key="acquire_every", default=1, minimum=1)
DO_STACK = BoolColumn(key="do_stack", default=True)
Z_OFFSET = FloatColumn(key="z_offset", default=0.0, minimum=-10000, maximum=10000)
Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/useq_widgets/_column_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class TableDoubleSpinBox(_TableSpinboxMixin, QDoubleSpinBox):
class _RangeColumn(WidgetColumn, Generic[W, T]):
data_type: WdgGetSet[W, float]
minimum: float = 0
maximum: float = 10_000
maximum: float = 999_999

def _init_widget(self) -> W:
wdg = self.data_type.widget()
Expand Down

0 comments on commit 37c8284

Please sign in to comment.