Skip to content

Commit

Permalink
fix: fix stage widget styles and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jul 16, 2024
1 parent 5957860 commit 14329d3
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 302 deletions.
30 changes: 12 additions & 18 deletions examples/stage_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@
mmc.loadSystemConfiguration()

wdg = QWidget()
wdg.setLayout(QHBoxLayout())

stage_dev_list = list(mmc.getLoadedDevicesOfType(DeviceType.XYStage))
stage_dev_list.extend(iter(mmc.getLoadedDevicesOfType(DeviceType.Stage)))

for stage_dev in stage_dev_list:
if mmc.getDeviceType(stage_dev) is DeviceType.XYStage:
bx = QGroupBox("XY Control")
bx.setLayout(QHBoxLayout())
bx.layout().addWidget(StageWidget(device=stage_dev))
wdg.layout().addWidget(bx)
if mmc.getDeviceType(stage_dev) is DeviceType.Stage:
bx = QGroupBox("Z Control")
bx.setLayout(QHBoxLayout())
bx.layout().addWidget(StageWidget(device=stage_dev))
wdg.layout().addWidget(bx)
wdg_layout = QHBoxLayout(wdg)

stages = list(mmc.getLoadedDevicesOfType(DeviceType.XYStage))
stages.extend(mmc.getLoadedDevicesOfType(DeviceType.Stage))
for stage in stages:
lbl = "Z" if mmc.getDeviceType(stage) == DeviceType.Stage else "XY"
bx = QGroupBox(f"{lbl} Control")
bx_layout = QHBoxLayout(bx)
bx_layout.addWidget(StageWidget(device=stage, position_labels_below=True))
wdg_layout.addWidget(bx)

wdg.show()

app.exec_()
wdg.show()
app.exec()
Loading

0 comments on commit 14329d3

Please sign in to comment.