PLCControler.py
changeset 1581 2295fdc5c271
parent 1571 486f94a8032c
child 1616 3638463d6e02
equal deleted inserted replaced
1580:f37b88d3edc6 1581:2295fdc5c271
   965             # prevent violations of POU content restrictions:
   965             # prevent violations of POU content restrictions:
   966             # function blocks cannot be pasted as functions,
   966             # function blocks cannot be pasted as functions,
   967             # programs cannot be pasted as functions or function blocks
   967             # programs cannot be pasted as functions or function blocks
   968             if orig_type == 'functionBlock' and pou_type == 'function' or \
   968             if orig_type == 'functionBlock' and pou_type == 'function' or \
   969                orig_type == 'program' and pou_type in ['function', 'functionBlock']:
   969                orig_type == 'program' and pou_type in ['function', 'functionBlock']:
   970                 return _('''%s "%s" can't be pasted as a %s.''') % (orig_type, name, pou_type)
   970                 msg = _('''{a1} "{a2}" can't be pasted as a {a3}.''').format(a1 = orig_type, a2 = name, a3 = pou_type)
       
   971                 return msg
   971 
   972 
   972             new_pou.setpouType(pou_type)
   973             new_pou.setpouType(pou_type)
   973 
   974 
   974         self.Project.insertpou(0, new_pou)
   975         self.Project.insertpou(0, new_pou)
   975         self.BufferProject()
   976         self.BufferProject()