diff --git a/slic/gui/daqpanels/scan.py b/slic/gui/daqpanels/scan.py index dcaa42ed..a3572e58 100644 --- a/slic/gui/daqpanels/scan.py +++ b/slic/gui/daqpanels/scan.py @@ -59,6 +59,7 @@ class ScanPanel(wx.Panel): adjustable = self.sel_adj.get() if adjustable is None: + self.sel_adj.nope() post_event(wx.EVT_BUTTON, self.btn_go.btn2) return diff --git a/slic/gui/daqpanels/scan2d.py b/slic/gui/daqpanels/scan2d.py index 9f74e3d8..d67482da 100644 --- a/slic/gui/daqpanels/scan2d.py +++ b/slic/gui/daqpanels/scan2d.py @@ -44,7 +44,12 @@ class Scan2DPanel(wx.Panel): return adjustable1 = self.adjbox1.sel_adj.get() + if adjustable1 is None: + self.adjbox1.sel_adj.nope() + adjustable2 = self.adjbox2.sel_adj.get() + if adjustable2 is None: + self.adjbox2.sel_adj.nope() if adjustable1 is None or adjustable2 is None: post_event(wx.EVT_BUTTON, self.btn_go.btn2) diff --git a/slic/gui/daqpanels/special.py b/slic/gui/daqpanels/special.py index e6f7140b..80ae69d8 100644 --- a/slic/gui/daqpanels/special.py +++ b/slic/gui/daqpanels/special.py @@ -78,6 +78,7 @@ class SpecialScanPanel(wx.Panel): adjustable = self.sel_adj.get() if adjustable is None: + self.sel_adj.nope() post_event(wx.EVT_BUTTON, self.btn_go.btn2) return diff --git a/slic/gui/daqpanels/tools.py b/slic/gui/daqpanels/tools.py index f07632dc..fdd2b91b 100644 --- a/slic/gui/daqpanels/tools.py +++ b/slic/gui/daqpanels/tools.py @@ -7,8 +7,7 @@ from slic.core.adjustable import Adjustable from slic.utils.registry import instances from slic.utils import readable_seconds -from ..widgets import post_event -from ..widgets import ContainsTextCompleter +from ..widgets import post_event, ContainsTextCompleter, Nope NOMINAL_REPRATE = 100 # Hz @@ -33,6 +32,8 @@ class AdjustableSelection(wx.BoxSizer): self.Add(select, 1, flag=wx.EXPAND|wx.BOTTOM, border=10) self.Add(current, 1, flag=wx.EXPAND|wx.TOP, border=10) + self.nope = Nope(self.select) + def on_change(self, _event): adjustable = self.select.get() diff --git a/slic/gui/daqpanels/tweak.py b/slic/gui/daqpanels/tweak.py index 2531fff3..e5fdea2d 100644 --- a/slic/gui/daqpanels/tweak.py +++ b/slic/gui/daqpanels/tweak.py @@ -88,6 +88,7 @@ class TweakPanel(wx.Panel): adjustable = self.sel_adj.get() if adjustable is None: + self.sel_adj.nope() post_event(wx.EVT_BUTTON, self.btn_go.btn2) return @@ -154,6 +155,7 @@ class TweakPanel(wx.Panel): print("move delta", direction) adj = self.sel_adj.get() if adj is None: + self.sel_adj.nope() return current = adj.get_current_value()