plugger.py
changeset 447 af3399aca7b7
parent 446 1edde533db19
parent 443 34c9788bd933
child 450 18583d13f0fa
equal deleted inserted replaced
446:1edde533db19 447:af3399aca7b7
   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         
   982         if getattr(self, "PluggedChilds", None) is not None:
   986         if getattr(self, "PluggedChilds", None) is not None:
   983             self.ClearPluginTypes()
   987             self.ClearPluginTypes()
   984             self.AddPluginBlockList(self.PluginsBlockTypesFactory())
   988             self.AddPluginBlockList(self.PluginsBlockTypesFactory())
   985         if self.AppFrame is not None:
   989         if self.AppFrame is not None:
   986             self.AppFrame.RefreshLibraryTree()
   990             self.AppFrame.RefreshLibraryTree()
       
   991             self.AppFrame.RefreshEditor()
       
   992     
       
   993     # Update a PLCOpenEditor Pou variable location
       
   994     def UpdateProjectVariableLocation(self, old_leading, new_leading):
       
   995         self.Project.updateElementAddress(old_leading, new_leading)
       
   996         self.BufferProject()
       
   997         if self.AppFrame is not None:
       
   998             self.AppFrame._Refresh(TITLE, INSTANCESTREE, FILEMENU, EDITMENU)
   987             self.AppFrame.RefreshEditor()
   999             self.AppFrame.RefreshEditor()
   988     
  1000     
   989     def GetVariableLocationTree(self):
  1001     def GetVariableLocationTree(self):
   990         '''
  1002         '''
   991         This function is meant to be overridden by plugins.
  1003         This function is meant to be overridden by plugins.