plugger.py
changeset 443 34c9788bd933
parent 440 f122eb4248b6
child 447 af3399aca7b7
equal deleted inserted replaced
442:f971de6d274f 443:34c9788bd933
   172         
   172         
   173     def SetParamsAttribute(self, path, value):
   173     def SetParamsAttribute(self, path, value):
   174         self.ChangesToSave = True
   174         self.ChangesToSave = True
   175         # Filter IEC_Channel and Name, that have specific behavior
   175         # Filter IEC_Channel and Name, that have specific behavior
   176         if path == "BaseParams.IEC_Channel":
   176         if path == "BaseParams.IEC_Channel":
   177             return self.FindNewIEC_Channel(value), True
   177             old_leading = ".".join(map(str, self.GetCurrentLocation()))
       
   178             new_value = self.FindNewIEC_Channel(value)
       
   179             new_leading = ".".join(map(str, self.PlugParent.GetCurrentLocation() + (new_value,)))
       
   180             self.GetPlugRoot().UpdateProjectVariableLocation(old_leading, new_leading)
       
   181             return new_value, True
   178         elif path == "BaseParams.Name":
   182         elif path == "BaseParams.Name":
   179             res = self.FindNewName(value)
   183             res = self.FindNewName(value)
   180             self.PlugRequestSave()
   184             self.PlugRequestSave()
   181             return res, True
   185             return res, True
   182         
   186         
   984         if getattr(self, "PluggedChilds", None) is not None:
   988         if getattr(self, "PluggedChilds", None) is not None:
   985             self.ClearPluginTypes()
   989             self.ClearPluginTypes()
   986             self.AddPluginBlockList(self.PluginsBlockTypesFactory())
   990             self.AddPluginBlockList(self.PluginsBlockTypesFactory())
   987         if self.AppFrame is not None:
   991         if self.AppFrame is not None:
   988             self.AppFrame.RefreshLibraryTree()
   992             self.AppFrame.RefreshLibraryTree()
       
   993             self.AppFrame.RefreshEditor()
       
   994     
       
   995     # Update a PLCOpenEditor Pou variable location
       
   996     def UpdateProjectVariableLocation(self, old_leading, new_leading):
       
   997         self.Project.updateElementAddress(old_leading, new_leading)
       
   998         self.BufferProject()
       
   999         if self.AppFrame is not None:
       
  1000             self.AppFrame._Refresh(TITLE, INSTANCESTREE, FILEMENU, EDITMENU)
   989             self.AppFrame.RefreshEditor()
  1001             self.AppFrame.RefreshEditor()
   990     
  1002     
   991     def GetVariableLocationTree(self):
  1003     def GetVariableLocationTree(self):
   992         '''
  1004         '''
   993         This function is meant to be overridden by plugins.
  1005         This function is meant to be overridden by plugins.