431 setattr(cls, "RefreshCustomBlockTypes", RefreshCustomBlockTypes) |
431 setattr(cls, "RefreshCustomBlockTypes", RefreshCustomBlockTypes) |
432 |
432 |
433 def AddCustomBlockType(self, pou): |
433 def AddCustomBlockType(self, pou): |
434 pou_name = pou.getname() |
434 pou_name = pou.getname() |
435 pou_type = pou.getpouType() |
435 pou_type = pou.getpouType() |
436 pou_description = pou.getdescription() |
|
437 if pou_description != "": |
|
438 pou_comment = "%s\n%s" % (pou_name, pou_description) |
|
439 else: |
|
440 pou_comment = pou_name |
|
441 block_infos = {"name" : pou_name, "type" : pou_type, "extensible" : False, |
436 block_infos = {"name" : pou_name, "type" : pou_type, "extensible" : False, |
442 "inputs" : [], "outputs" : [], "comment" : pou_comment, |
437 "inputs" : [], "outputs" : [], "comment" : pou.getdescription(), |
443 "generate" : generate_block, "initialise" : initialise_block} |
438 "generate" : generate_block, "initialise" : initialise_block} |
444 if pou.getinterface(): |
439 if pou.getinterface(): |
445 return_type = pou.interface.getreturnType() |
440 return_type = pou.interface.getreturnType() |
446 if return_type: |
441 if return_type: |
447 var_type = return_type.getcontent() |
442 var_type = return_type.getcontent() |