806 content["value"].setName(new_name) |
806 content["value"].setName(new_name) |
807 elif content["name"] == "inline": |
807 elif content["name"] == "inline": |
808 content["value"].updateElementName(old_name, new_name) |
808 content["value"].updateElementName(old_name, new_name) |
809 setattr(cls, "updateElementName", updateElementName) |
809 setattr(cls, "updateElementName", updateElementName) |
810 |
810 |
|
811 def addConnection(self): |
|
812 print "addConnection" |
|
813 if not self.condition: |
|
814 self.addCondition() |
|
815 content = self.condition.getContent() |
|
816 if content["name"] != "connection": |
|
817 self.condition.setContent("connection", []) |
|
818 content = self.condition.getContent() |
|
819 content["value"].append(PLCOpenClasses["connection"]()) |
|
820 setattr(cls, "addConnection", addConnection) |
|
821 |
|
822 def removeConnection(self, idx): |
|
823 if self.condition: |
|
824 content = self.condition.getContent() |
|
825 if content["name"] == "connection": |
|
826 content["value"].pop(idx) |
|
827 setattr(cls, "removeConnection", removeConnection) |
|
828 |
|
829 def removeConnections(self): |
|
830 if self.condition: |
|
831 content = self.condition.getContent() |
|
832 if content["name"] == "connection": |
|
833 content["value"] = [] |
|
834 setattr(cls, "removeConnections", removeConnections) |
|
835 |
|
836 def getConnections(self): |
|
837 if self.condition: |
|
838 content = self.condition.getContent() |
|
839 print "getConnections", content |
|
840 if content["name"] == "connection": |
|
841 return content["value"] |
|
842 setattr(cls, "getConnections", getConnections) |
|
843 |
|
844 def setConnectionId(self, idx, id): |
|
845 if self.condition: |
|
846 content = self.condition.getContent() |
|
847 if content["name"] == "connection": |
|
848 content["value"][idx].setRefLocalId(id) |
|
849 print "SetId", content |
|
850 setattr(cls, "setConnectionId", setConnectionId) |
|
851 |
|
852 def getConnectionId(self, idx): |
|
853 if self.condition: |
|
854 content = self.condition.getContent() |
|
855 if content["name"] == "connection": |
|
856 return content["value"][idx].getRefLocalId() |
|
857 return None |
|
858 setattr(cls, "getConnectionId", getConnectionId) |
|
859 |
|
860 def setConnectionPoints(self, idx, points): |
|
861 if self.condition: |
|
862 content = self.condition.getContent() |
|
863 if content["name"] == "connection": |
|
864 content["value"][idx].setPoints(points) |
|
865 print "SetPoints", content |
|
866 setattr(cls, "setConnectionPoints", setConnectionPoints) |
|
867 |
|
868 def getConnectionPoints(self, idx): |
|
869 if self.condition: |
|
870 content = self.condition.getContent() |
|
871 if content["name"] == "connection": |
|
872 return content["value"][idx].getPoints() |
|
873 return None |
|
874 setattr(cls, "getConnectionPoints", getConnectionPoints) |
|
875 |
|
876 def setConnectionParameter(self, idx, parameter): |
|
877 if self.condition: |
|
878 content = self.condition.getContent() |
|
879 if content["name"] == "connection": |
|
880 content["value"][idx].setFormalParameter(parameter) |
|
881 print "SetParameter", content |
|
882 setattr(cls, "setConnectionParameter", setConnectionParameter) |
|
883 |
|
884 def getConnectionParameter(self, idx): |
|
885 if self.condition: |
|
886 content = self.condition.getContent() |
|
887 if content["name"] == "connection": |
|
888 return content["value"][idx].getFormalParameter() |
|
889 return None |
|
890 setattr(cls, "getConnectionParameter", getConnectionParameter) |
|
891 |
|
892 setattr(cls, "addConnection", addConnection) |
|
893 |
811 if "selectionDivergence" in PLCOpenClasses: |
894 if "selectionDivergence" in PLCOpenClasses: |
812 cls = PLCOpenClasses["selectionDivergence"] |
895 cls = PLCOpenClasses["selectionDivergence"] |
813 setattr(cls, "getX", getX) |
896 setattr(cls, "getX", getX) |
814 setattr(cls, "getY", getY) |
897 setattr(cls, "getY", getY) |
815 setattr(cls, "setX", setX) |
898 setattr(cls, "setX", setX) |