Fixed various bugs
authoretisserant
Sat, 28 Jun 2008 19:00:04 +0200
changeset 215 dd3381f38a9e
parent 214 a88b377f75cb
child 216 93af9ac5aeaf
Fixed various bugs
.cvsignore
DataTypeEditor.py
PLCGenerator.py
--- a/.cvsignore	Thu Jun 26 09:18:16 2008 +0200
+++ b/.cvsignore	Sat Jun 28 19:00:04 2008 +0200
@@ -3,3 +3,4 @@
 .settings
 .pydevproject
 .project
+.externalToolBuilders
--- a/DataTypeEditor.py	Thu Jun 26 09:18:16 2008 +0200
+++ b/DataTypeEditor.py	Sat Jun 28 19:00:04 2008 +0200
@@ -420,14 +420,14 @@
         event.Skip()
 
     def OnSubrangeMinimumChanged(self, event):
-        if self.Initializing:
+        if not self.Initializing:
             wx.CallAfter(self.SubrangeMinimum.SetValue, min(self.SubrangeMaximum.GetValue(), self.SubrangeMinimum.GetValue()))
             wx.CallAfter(self.RefreshSubrangeInitialValueRange)
             wx.CallAfter(self.RefreshTypeInfos)
         event.Skip()
 
     def OnSubrangeMaximumChanged(self, event):
-        if self.Initializing:
+        if not self.Initializing:
             wx.CallAfter(self.SubrangeMaximum.SetValue, max(self.SubrangeMinimum.GetValue(), self.SubrangeMaximum.GetValue()))
             wx.CallAfter(self.RefreshSubrangeInitialValueRange)
             wx.CallAfter(self.RefreshTypeInfos)
--- a/PLCGenerator.py	Thu Jun 26 09:18:16 2008 +0200
+++ b/PLCGenerator.py	Sat Jun 28 19:00:04 2008 +0200
@@ -921,13 +921,12 @@
                     program += "AT %s "%var_address
                 program += ": %s"%var_type
                 if var_initial != None:
-                    value = {"TRUE":"0","FALSE":"1"}.get(str(var_initial).upper(), str(var_initial))
                     if var_type == "STRING":
-                        program += " := '%s'"%value
+                        program += " := '%s'"%var_initial
                     elif var_type == "WSTRING":
-                        program += " := \"%s\""%value
+                        program += " := \"%s\""%var_initial
                     else:
-                        program += " := %s"%value
+                        program += " := %s"%var_initial
                 program += ";\n"
             program += "  END_VAR\n"
         program += "\n"