--- a/LPCCommand.py Mon Feb 05 15:45:38 2018 +0100
+++ b/LPCCommand.py Mon Feb 05 15:47:22 2018 +0100
@@ -1,11 +1,36 @@
-from threading import Timer
+from threading import Thread, Semaphore, Lock, Timer from types import StringType, UnicodeType
+wx_eval_lock = Semaphore(0) +# Command log for debug, for viewing from wxInspector +# __builtins__.cmdlog = [] +def wx_evaluator(callable, *args, **kwargs): + eval_res = callable(*args, **kwargs) +def evaluator(callable, *args, **kwargs): + wx.CallAfter(wx_evaluator, callable, *args, **kwargs) return tuple(map(int, loc.split(".")))
@@ -189,13 +214,8 @@
for child in self.CTR.IterChildren():
if child != bus and child.BaseParams.getIEC_Channel() == new_iec_channel:
return "Error: A bus with IEC_channel %d already exists\n" % new_iec_channel
- if wx.GetApp() is None:
- self.CTR.UpdateProjectVariableLocation(str(old_iec_channel),
- self.CTR.UpdateProjectVariableLocation(
+ self.CTR.UpdateProjectVariableLocation(str(old_iec_channel), bus.BaseParams.setIEC_Channel(new_iec_channel)
--- a/LPCManager.py Mon Feb 05 15:45:38 2018 +0100
+++ b/LPCManager.py Mon Feb 05 15:47:22 2018 +0100
@@ -983,32 +983,6 @@
# slave.BaseParams.setEnabled(False)
-# -------------------------------------------------------------------------------
-from threading import Thread, Semaphore, Lock
-wx_eval_lock = Semaphore(0)
-def wx_evaluator(callable, *args, **kwargs):
- eval_res = callable(*args, **kwargs)
-def evaluator(callable, *args, **kwargs):
- wx.CallAfter(wx_evaluator, callable, *args, **kwargs)
if __name__ == '__main__':