LPCManager.py
changeset 14 37734da73adc
parent 13 2e3c3da3593e
child 15 1c68bb669806
equal deleted inserted replaced
13:2e3c3da3593e 14:37734da73adc
   556                 self.OnCTNSave()
   556                 self.OnCTNSave()
   557         
   557         
   558         def GetCanDevice(self):
   558         def GetCanDevice(self):
   559             return str(self.BaseParams.getIEC_Channel())
   559             return str(self.BaseParams.getIEC_Channel())
   560     
   560     
       
   561         ConfNodeMethods = [
       
   562             {"bitmap" : "NetworkEdit",
       
   563              "name" : _("Edit slave"), 
       
   564              "tooltip" : _("Edit CanOpen slave with ObjdictEdit"),
       
   565              "method" : "_OpenView"},
       
   566         ] + _SlaveCTN.ConfNodeMethods
       
   567     
   561     class LPCNetworkEditor(NetworkEditor):
   568     class LPCNetworkEditor(NetworkEditor):
   562         SHOW_BASE_PARAMS = False
   569         SHOW_BASE_PARAMS = False
   563         
   570         
   564     class LPCCanOpenMaster(_NodeListCTN):
   571     class LPCCanOpenMaster(_NodeListCTN):
   565         XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
   572         XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
   577         EditorType = LPCNetworkEditor
   584         EditorType = LPCNetworkEditor
   578         
   585         
   579         def GetCanDevice(self):
   586         def GetCanDevice(self):
   580             return str(self.BaseParams.getIEC_Channel())
   587             return str(self.BaseParams.getIEC_Channel())
   581     
   588     
       
   589         ConfNodeMethods = [
       
   590             {"bitmap" : "NetworkEdit",
       
   591              "name" : _("Edit network"), 
       
   592              "tooltip" : _("Edit CanOpen Network with NetworkEdit"),
       
   593              "method" : "_OpenView"},
       
   594         ] + _NodeListCTN.ConfNodeMethods
       
   595     
   582     class LPCCanOpen(CanOpenRootClass):
   596     class LPCCanOpen(CanOpenRootClass):
   583         XSD = None
   597         XSD = None
   584         CTNChildrenTypes = [("CanOpenNode", LPCCanOpenMaster, "CanOpen Master"),
   598         CTNChildrenTypes = [("CanOpenNode", LPCCanOpenMaster, "CanOpen Master"),
   585                             ("CanOpenSlave", LPCCanOpenSlave, "CanOpen Slave")]
   599                             ("CanOpenSlave", LPCCanOpenSlave, "CanOpen Slave")]
   586         
   600         
   597             
   611             
   598             if self.GetChildByName("Slave") is None:
   612             if self.GetChildByName("Slave") is None:
   599                 slave = self.CTNAddChild("Slave", "CanOpenSlave", 1)
   613                 slave = self.CTNAddChild("Slave", "CanOpenSlave", 1)
   600                 #slave.BaseParams.setEnabled(False)
   614                 #slave.BaseParams.setEnabled(False)
   601                 slave.CTNRequestSave()
   615                 slave.CTNRequestSave()
   602     
       
   603 
   616 
   604 #-------------------------------------------------------------------------------
   617 #-------------------------------------------------------------------------------
   605 #                              LPCProjectController Class
   618 #                              LPCProjectController Class
   606 #-------------------------------------------------------------------------------
   619 #-------------------------------------------------------------------------------
   607 
   620