etherlab/etherlab.py
changeset 2397 25f16349644b
parent 2396 41adf1dfc7a7
child 2405 af050469fc5c
equal deleted inserted replaced
2396:41adf1dfc7a7 2397:25f16349644b
    56     ("PDO index", str, ""),
    56     ("PDO index", str, ""),
    57     ("PDO name", str, ""),
    57     ("PDO name", str, ""),
    58     ("PDO type", str, "")]
    58     ("PDO type", str, "")]
    59 
    59 
    60 
    60 
    61 class EntryListFactory:
    61 class EntryListFactory(object):
    62 
    62 
    63     def __init__(self, entries):
    63     def __init__(self, entries):
    64         self.Entries = entries
    64         self.Entries = entries
    65 
    65 
    66     def AddEntry(self, context, *args):
    66     def AddEntry(self, context, *args):
   152         if item["type"] == ETHERCAT_GROUP:
   152         if item["type"] == ETHERCAT_GROUP:
   153             SortGroupItems(item)
   153             SortGroupItems(item)
   154     group["children"].sort(GroupItemCompare)
   154     group["children"].sort(GroupItemCompare)
   155 
   155 
   156 
   156 
   157 class ModulesLibrary:
   157 class ModulesLibrary(object):
   158 
   158 
   159     MODULES_EXTRA_PARAMS = [
   159     MODULES_EXTRA_PARAMS = [
   160         (
   160         (
   161             "pdo_alignment",
   161             "pdo_alignment",
   162             {
   162             {
   407 
   407 
   408 ModulesDatabase = ModulesLibrary(
   408 ModulesDatabase = ModulesLibrary(
   409     os.path.join(USERDATA_DIR, "ethercat_modules"))
   409     os.path.join(USERDATA_DIR, "ethercat_modules"))
   410 
   410 
   411 
   411 
   412 class RootClass:
   412 class RootClass(object):
   413 
   413 
   414     CTNChildrenTypes = [("EthercatNode", _EthercatCTN, "Ethercat Master")]
   414     CTNChildrenTypes = [("EthercatNode", _EthercatCTN, "Ethercat Master")]
   415     EditorType = LibraryEditor
   415     EditorType = LibraryEditor
   416 
   416 
   417     def __init__(self):
   417     def __init__(self):