Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/shutters_widget.py → examples/shutter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pymmcore_plus import CMMCorePlus, DeviceType
from qtpy.QtWidgets import QApplication, QHBoxLayout, QWidget

from pymmcore_widgets import ShuttersWidget
from pymmcore_widgets import ShutterWidget

app = QApplication([])

Expand All @@ -24,7 +24,12 @@
for idx, shutter_dev in enumerate(shutter_dev_list):
# bool to display the autoshutter checkbox only with the last shutter
autoshutter = bool(idx >= len(shutter_dev_list) - 1)
shutter = ShuttersWidget(shutter_dev, autoshutter=autoshutter)
shutter = ShutterWidget(
shutter_dev,
autoshutter=autoshutter,
button_text_open=shutter_dev,
button_text_closed=shutter_dev,
)
wdg.layout().addWidget(shutter)

wdg.show()
Expand Down
11 changes: 9 additions & 2 deletions src/pymmcore_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"PropertiesWidget",
"PropertyBrowser",
"PropertyWidget",
"ShuttersWidget",
"ShutterWidget",
"SnapButton",
"StageExplorer",
"StageWidget",
Expand Down Expand Up @@ -69,7 +69,7 @@
LiveButton,
ObjectivesWidget,
PresetsWidget,
ShuttersWidget,
ShutterWidget,
SnapButton,
StageExplorer,
StageWidget,
Expand Down Expand Up @@ -137,4 +137,11 @@ def __getattr__(name: str) -> object:
stacklevel=2,
)
return ObjectivesPixelConfigurationWidget
if name == "ShuttersWidget":
warnings.warn(
"'ShuttersWidget' is deprecated, use 'ShutterWidget' instead.",
DeprecationWarning,
stacklevel=2,
)
return ShutterWidget
raise AttributeError(f"module {__name__} has no attribute {name}")
4 changes: 2 additions & 2 deletions src/pymmcore_widgets/control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ._load_system_cfg_widget import ConfigurationWidget
from ._objective_widget import ObjectivesWidget
from ._presets_widget import PresetsWidget
from ._shutter_widget import ShuttersWidget
from ._shutter_widget import ShutterWidget
from ._snap_button_widget import SnapButton
from ._stage_explorer import StageExplorer
from ._stage_widget import StageWidget
Expand All @@ -23,7 +23,7 @@
"LiveButton",
"ObjectivesWidget",
"PresetsWidget",
"ShuttersWidget",
"ShutterWidget",
"SnapButton",
"StageExplorer",
"StageWidget",
Expand Down
4 changes: 2 additions & 2 deletions src/pymmcore_widgets/control/_shutter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
]


class ShuttersWidget(QWidget):
"""A Widget to control shutters and Micro-Manager autoshutter.
class ShutterWidget(QWidget):
"""A Widget to control a Micro-Manager shutter.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
pmmw.PropertiesWidget: {},
pmmw.PropertyBrowser: {},
pmmw.PropertyWidget: {"device_label": "Camera", "prop_name": "Binning"},
pmmw.ShuttersWidget: {"shutter_device": "Shutter"},
pmmw.ShutterWidget: {"shutter_device": "Shutter"},
pmmw.SnapButton: {},
pmmw.StageWidget: {"device": "XY"},
pmmw.TimePlanWidget: {},
Expand Down
6 changes: 3 additions & 3 deletions tests/test_shutter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from pymmcore_widgets.control._shutter_widget import ShuttersWidget
from pymmcore_widgets.control._shutter_widget import ShutterWidget
from tests._utils import wait_signal

if TYPE_CHECKING:
Expand All @@ -17,8 +17,8 @@ def _make_shutter(
mmcore: CMMCorePlus,
device: str = "Shutter",
autoshutter: bool = True,
) -> ShuttersWidget:
wdg = ShuttersWidget(
) -> ShutterWidget:
wdg = ShutterWidget(
device,
autoshutter=autoshutter,
button_text_open=f"{device} opened",
Expand Down
Loading