609 value = plcopen.value() |
609 value = plcopen.value() |
610 value.setValue(var["Initial Value"]) |
610 value.setValue(var["Initial Value"]) |
611 tempvar.setInitialValue(value) |
611 tempvar.setInitialValue(value) |
612 if var["Location"] != "": |
612 if var["Location"] != "": |
613 tempvar.setAddress(var["Location"]) |
613 tempvar.setAddress(var["Location"]) |
|
614 else: |
|
615 tempvar.setAddress(None) |
614 # Add variable to varList |
616 # Add variable to varList |
615 current_varlist.appendVariable(tempvar) |
617 current_varlist.appendVariable(tempvar) |
616 return varlist_list |
618 return varlist_list |
617 |
619 |
618 # Replace the configuration globalvars by those given |
620 # Replace the configuration globalvars by those given |
633 configuration = self.Project.getConfiguration(name) |
635 configuration = self.Project.getConfiguration(name) |
634 if configuration: |
636 if configuration: |
635 # Extract variables from every varLists |
637 # Extract variables from every varLists |
636 for varlist in configuration.getGlobalVars(): |
638 for varlist in configuration.getGlobalVars(): |
637 for var in varlist.getVariable(): |
639 for var in varlist.getVariable(): |
638 tempvar = {"Name":var.getName(),"Class":"Global","Type":var.getType().getValue(), |
640 tempvar = {"Name":var.getName(),"Class":"Global","Type":var.getType().getValue()} |
639 "Location":var.getAddress()} |
|
640 initial = var.getInitialValue() |
641 initial = var.getInitialValue() |
641 if initial: |
642 if initial: |
642 tempvar["Initial Value"] = initial.getValue() |
643 tempvar["Initial Value"] = initial.getValue() |
643 else: |
644 else: |
644 tempvar["Initial Value"] = "" |
645 tempvar["Initial Value"] = "" |
|
646 address = var.getAddress() |
|
647 if address: |
|
648 tempvar["Location"] = address |
|
649 else: |
|
650 tempvar["Location"] = "" |
645 if varlist.getRetain(): |
651 if varlist.getRetain(): |
646 tempvar["Retain"] = "Yes" |
652 tempvar["Retain"] = "Yes" |
647 else: |
653 else: |
648 tempvar["Retain"] = "No" |
654 tempvar["Retain"] = "No" |
649 if varlist.getConstant(): |
655 if varlist.getConstant(): |
671 resource = self.Project.getConfigurationResource(config_name, name) |
677 resource = self.Project.getConfigurationResource(config_name, name) |
672 if resource: |
678 if resource: |
673 # Extract variables from every varLists |
679 # Extract variables from every varLists |
674 for varlist in resource.getGlobalVars(): |
680 for varlist in resource.getGlobalVars(): |
675 for var in varlist.getVariable(): |
681 for var in varlist.getVariable(): |
676 tempvar = {"Name":var.getName(),"Class":"Global","Type":var.getType().getValue(), |
682 tempvar = {"Name":var.getName(),"Class":"Global","Type":var.getType().getValue()} |
677 "Location":var.getAddress()} |
|
678 initial = var.getInitialValue() |
683 initial = var.getInitialValue() |
679 if initial: |
684 if initial: |
680 tempvar["Initial Value"] = initial.getValue() |
685 tempvar["Initial Value"] = initial.getValue() |
681 else: |
686 else: |
682 tempvar["Initial Value"] = "" |
687 tempvar["Initial Value"] = "" |
|
688 address = var.getAddress() |
|
689 if address: |
|
690 tempvar["Location"] = address |
|
691 else: |
|
692 tempvar["Location"] = "" |
683 if varlist.getRetain(): |
693 if varlist.getRetain(): |
684 tempvar["Retain"] = "Yes" |
694 tempvar["Retain"] = "Yes" |
685 else: |
695 else: |
686 tempvar["Retain"] = "No" |
696 tempvar["Retain"] = "No" |
687 if varlist.getConstant(): |
697 if varlist.getConstant(): |
702 # Verify that the pou has an interface |
712 # Verify that the pou has an interface |
703 if pou.interface: |
713 if pou.interface: |
704 # Extract variables from every varLists |
714 # Extract variables from every varLists |
705 for type, varlist in pou.getVars(): |
715 for type, varlist in pou.getVars(): |
706 for var in varlist.getVariable(): |
716 for var in varlist.getVariable(): |
707 tempvar = {"Name":var.getName(),"Class":type,"Type":var.getType().getValue(), |
717 tempvar = {"Name":var.getName(),"Class":type,"Type":var.getType().getValue()} |
708 "Location":var.getAddress()} |
|
709 initial = var.getInitialValue() |
718 initial = var.getInitialValue() |
710 if initial: |
719 if initial: |
711 tempvar["Initial Value"] = initial.getValue() |
720 tempvar["Initial Value"] = initial.getValue() |
712 else: |
721 else: |
713 tempvar["Initial Value"] = "" |
722 tempvar["Initial Value"] = "" |
|
723 address = var.getAddress() |
|
724 if address: |
|
725 tempvar["Location"] = address |
|
726 else: |
|
727 tempvar["Location"] = "" |
714 if varlist.getRetain(): |
728 if varlist.getRetain(): |
715 tempvar["Retain"] = "Yes" |
729 tempvar["Retain"] = "Yes" |
716 else: |
730 else: |
717 tempvar["Retain"] = "No" |
731 tempvar["Retain"] = "No" |
718 if varlist.getConstant(): |
732 if varlist.getConstant(): |