Additional fix for rewrite ForceVariableDialog commit (9076249f)
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 14 Feb 2019 10:19:30 +0300
changeset 2510 4f78f0e201d9
parent 2509 9c5f835b031e
child 2511 d6e0442a3986
Additional fix for rewrite ForceVariableDialog commit (9076249f)

fix following backtrace:

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_core.py", line 16765, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/DebugVariablePanel/DebugVariableViewer.py", line 232, in HandleButton
button.ProcessCallback()
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/DebugVariablePanel/GraphButton.py", line 156, in ProcessCallback
self.Callback()
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/DebugVariablePanel/DebugVariableViewer.py", line 350, in OnForceButton
self.ForceValue(self.ItemsDict.values()[0])
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/DebugVariablePanel/DebugVariableViewer.py", line 428, in ForceValue
dialog.GetValue())
File "/home/developer/WorkData/PLC/beremiz/beremiz/dialogs/ForceVariableDialog.py", line 232, in GetValue
return GetTypeValue[self.IEC_Type](wx.TextEntryDialog.GetValue(self))
TypeError: unbound method GetValue() must be called with TextEntryDialog instance as first argument (got ForceVariableDialog instance instead)
dialogs/ForceVariableDialog.py
--- a/dialogs/ForceVariableDialog.py	Thu Feb 14 10:02:58 2019 +0300
+++ b/dialogs/ForceVariableDialog.py	Thu Feb 14 10:19:30 2019 +0300
@@ -228,4 +228,7 @@
         event.Skip()
 
     def GetValue(self):
-        return GetTypeValue[self.IEC_Type](wx.TextEntryDialog.GetValue(self))
+        """
+        Return new enforce value of particular type
+        """
+        return GetTypeValue[self.IEC_Type](self.ValueTextCtrl.GetValue())