1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-04-07 09:17:53 +02:00

fix: fix examples when run directly as a script

This commit is contained in:
2023-07-24 15:06:50 +02:00
parent b16406a7fc
commit cd11ee51c1
2 changed files with 18 additions and 2 deletions

View File

@@ -122,3 +122,19 @@ class BECScanPlot2D(pg.GraphicsView):
@z_channel.setter
def z_channel(self, new_val):
self._z_channel = new_val
if __name__ == "__main__":
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
plot = BECScanPlot2D()
# If x_channel and y_channel are both omitted, they will be inferred from each running grid scan
plot.z_channel = "bpm3y"
plot.show()
sys.exit(app.exec_())

View File

@@ -124,9 +124,9 @@ if __name__ == "__main__":
app = QApplication(sys.argv)
plot = BECScanPlot()
plot.y_channel_list = ["a", "b", "c"]
plot.x_channel = "samx"
plot.y_channel_list = ["bpm3y", "bpm6y"]
plot.initialize()
plot.show()
sys.exit(app.exec_())