Bug with task ticktime definition fixed
authorlbessard
Thu, 13 Mar 2008 10:20:00 +0100
changeset 188 d64037e17075
parent 187 183486133b96
child 189 43cd3ef83a1f
Bug with task ticktime definition fixed
PLCControler.py
--- a/PLCControler.py	Fri Mar 07 09:16:54 2008 +0100
+++ b/PLCControler.py	Thu Mar 13 10:20:00 2008 +0100
@@ -34,7 +34,7 @@
 from graphics.GraphicCommons import *
 from PLCGenerator import *
 
-duration_model = re.compile("(?:([0-9]{1,2})h)?(?:([0-9]{1,2})m(?!s))?(?:([0-9]{1,2})s)?(?:([0-9]{1,3}(?:.[0-9]*)?)ms)?")
+duration_model = re.compile("(?:([0-9]{1,2})h)?(?:([0-9]{1,2})m(?!s))?(?:([0-9]{1,2})s)?(?:([0-9]{1,3}(?:\.[0-9]*)?)ms)?")
 
 ITEMS_EDITABLE = [ITEM_PROJECT,
                     ITEM_POU,
@@ -66,7 +66,7 @@
 UNDO_BUFFER_LENGTH = 20
 
 """
-Class implementing a buffer of changes made on the current editing Object Dictionary
+Class implementing a buffer of changes made on the current editing model
 """
 class UndoBuffer:
 
@@ -2358,7 +2358,8 @@
                             values.append(int(value))
                         else:
                             values.append(0)
-                    values.append(int(float(result[-1]) * 1000))
+                    if values[-1] is not None:
+                        values.append(int(float(result[-1]) * 1000))
                     new_task.setinterval(time(*values))
                 new_task.setpriority(int(task["Priority"]))
                 if task["Name"] != "":