etherlab/etherlab.py
changeset 2053 5998beb54a6c
parent 2052 bf9d93a06a18
child 2057 bb63c0479411
equal deleted inserted replaced
2052:bf9d93a06a18 2053:5998beb54a6c
    64 class _EthercatSlaveCTN:
    64 class _EthercatSlaveCTN:
    65 
    65 
    66     NODE_PROFILE = None
    66     NODE_PROFILE = None
    67     EditorType = NodeEditor
    67     EditorType = NodeEditor
    68     
    68     
    69     def GetIconPath(self, icon):
    69     def GetIconPath(self):
    70         return os.path.join(CONFNODEFOLDER, "images", icon)
    70         return os.path.join(CONFNODEFOLDER, "images", "Slave.png")
    71     
    71     
    72     def ExtractHexDecValue(self, value):
    72     def ExtractHexDecValue(self, value):
    73         return ExtractHexDecValue(value)
    73         return ExtractHexDecValue(value)
    74     
    74     
    75     def GetSizeOfType(self, type):
    75     def GetSizeOfType(self, type):
   133                  "type": LOCATION_CONFNODE,
   133                  "type": LOCATION_CONFNODE,
   134                  "location": self.GetFullIEC_Channel(),
   134                  "location": self.GetFullIEC_Channel(),
   135                  "children": self.CTNParent.GetDeviceLocationTree(self.GetSlavePos(), self.GetCurrentLocation(), self.BaseParams.getName())
   135                  "children": self.CTNParent.GetDeviceLocationTree(self.GetSlavePos(), self.GetCurrentLocation(), self.BaseParams.getName())
   136         }
   136         }
   137 
   137 
   138     ConfNodeMethods = [
       
   139         {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "editSlave"),
       
   140          "name" : _("Edit Slave"), 
       
   141          "tooltip" : _("Edit Slave"),
       
   142          "method" : "_OpenView"},
       
   143     ]
       
   144 
       
   145     def CTNGenerate_C(self, buildpath, locations):
   138     def CTNGenerate_C(self, buildpath, locations):
   146         """
   139         """
   147         Generate C code
   140         Generate C code
   148         @param current_location: Tupple containing confnode IEC location : %I0.0.4.5 => (0,0,4,5)
   141         @param current_location: Tupple containing confnode IEC location : %I0.0.4.5 => (0,0,4,5)
   149         @param locations: List of complete variables locations \
   142         @param locations: List of complete variables locations \
   184         """ % AxisXSD
   177         """ % AxisXSD
   185         
   178         
   186         NODE_PROFILE = 402
   179         NODE_PROFILE = 402
   187         EditorType = CIA402NodeEditor
   180         EditorType = CIA402NodeEditor
   188         
   181         
   189         ConfNodeMethods = [
   182         def GetIconPath(self):
   190             {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "editCIA402Slave"),
   183             return os.path.join(CONFNODEFOLDER, "images", "CIA402Slave.png")
   191              "name" : _("Edit CIA402 Slave"), 
       
   192              "tooltip" : _("Edit CIA402 Slave"),
       
   193              "method" : "_OpenView"},
       
   194         ]
       
   195         
   184         
   196         def CTNGenerate_C(self, buildpath, locations):
   185         def CTNGenerate_C(self, buildpath, locations):
   197             """
   186             """
   198             Generate C code
   187             Generate C code
   199             @param current_location: Tupple containing confnode IEC location : %I0.0.4.5 => (0,0,4,5)
   188             @param current_location: Tupple containing confnode IEC location : %I0.0.4.5 => (0,0,4,5)