etherlab/etherlab.py
changeset 2068 05a267b1a362
parent 2067 04cc0295e2c4
child 2069 840d328560f8
equal deleted inserted replaced
2067:04cc0295e2c4 2068:05a267b1a362
    12 try:
    12 try:
    13     from MotionLibrary import Headers, AxisXSD
    13     from MotionLibrary import Headers, AxisXSD
    14     HAS_MCL = True
    14     HAS_MCL = True
    15 except:
    15 except:
    16     HAS_MCL = False
    16     HAS_MCL = False
    17 
       
    18 CONFNODEFOLDER = os.path.split(os.path.realpath(__file__))[0]
       
    19 
    17 
    20 TYPECONVERSION = {"BOOL" : "X", "SINT" : "B", "INT" : "W", "DINT" : "D", "LINT" : "L",
    18 TYPECONVERSION = {"BOOL" : "X", "SINT" : "B", "INT" : "W", "DINT" : "D", "LINT" : "L",
    21     "USINT" : "B", "UINT" : "W", "UDINT" : "D", "ULINT" : "L", 
    19     "USINT" : "B", "UINT" : "W", "UDINT" : "D", "ULINT" : "L", 
    22     "BYTE" : "B", "WORD" : "W", "DWORD" : "D", "LWORD" : "L"}
    20     "BYTE" : "B", "WORD" : "W", "DWORD" : "D", "LWORD" : "L"}
    23 
    21 
    74     """
    72     """
    75     
    73     
    76     NODE_PROFILE = None
    74     NODE_PROFILE = None
    77     EditorType = NodeEditor
    75     EditorType = NodeEditor
    78     
    76     
    79     def GetIconPath(self):
    77     def GetIconName(self):
    80         return os.path.join(CONFNODEFOLDER, "images", "Slave.png")
    78         return "Slave"
    81     
    79     
    82     def ExtractHexDecValue(self, value):
    80     def ExtractHexDecValue(self, value):
    83         return ExtractHexDecValue(value)
    81         return ExtractHexDecValue(value)
    84     
    82     
    85     def GetSizeOfType(self, type):
    83     def GetSizeOfType(self, type):
   196         
   194         
   197         NODE_PROFILE = 402
   195         NODE_PROFILE = 402
   198         EditorType = CIA402NodeEditor
   196         EditorType = CIA402NodeEditor
   199         
   197         
   200         ConfNodeMethods = [
   198         ConfNodeMethods = [
   201             {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "CIA402AxisRef.png"),
   199             {"bitmap" : "CIA402AxisRef",
   202              "name" : _("Axis Ref"),
   200              "name" : _("Axis Ref"),
   203              "tooltip" : _("Initiate Drag'n drop of Axis ref located variable"),
   201              "tooltip" : _("Initiate Drag'n drop of Axis ref located variable"),
   204              "method" : "_getCIA402AxisRef",
   202              "method" : "_getCIA402AxisRef",
   205              "push": True},
   203              "push": True},
   206         ]
   204         ]
   207         
   205         
   208         def GetIconPath(self):
   206         def GetIconName(self):
   209             return os.path.join(CONFNODEFOLDER, "images", "CIA402Slave.png")
   207             return "CIA402Slave"
   210         
   208         
   211         def SetParamsAttribute(self, path, value):
   209         def SetParamsAttribute(self, path, value):
   212             if path == "CIA402SlaveParams.Type":
   210             if path == "CIA402SlaveParams.Type":
   213                 path = "SlaveParams.Type"
   211                 path = "SlaveParams.Type"
   214             elif path == "CIA402SlaveParams.Alias":
   212             elif path == "CIA402SlaveParams.Alias":
   632         LDFLAGS.append("-lethercat -lrtdm")
   630         LDFLAGS.append("-lethercat -lrtdm")
   633         
   631         
   634         return LocationCFilesAndCFLAGS, LDFLAGS, extra_files
   632         return LocationCFilesAndCFLAGS, LDFLAGS, extra_files
   635 
   633 
   636     ConfNodeMethods = [
   634     ConfNodeMethods = [
   637         {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "ScanNetwork"),
   635         {"bitmap" : "ScanNetwork",
   638          "name" : _("Scan Network"), 
   636          "name" : _("Scan Network"), 
   639          "tooltip" : _("Scan Network"),
   637          "tooltip" : _("Scan Network"),
   640          "method" : "_ScanNetwork"},
   638          "method" : "_ScanNetwork"},
   641     ]
   639     ]
   642 
   640 
  1390             else:
  1388             else:
  1391                 self.GetCTRoot().logger.write_error(_("No such XML file: %s\n") % filepath)
  1389                 self.GetCTRoot().logger.write_error(_("No such XML file: %s\n") % filepath)
  1392         dialog.Destroy()  
  1390         dialog.Destroy()  
  1393     
  1391     
  1394     ConfNodeMethods = [
  1392     ConfNodeMethods = [
  1395         {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "ImportESI"),
  1393         {"bitmap" : "ImportESI",
  1396          "name" : _("Import module library"), 
  1394          "name" : _("Import module library"), 
  1397          "tooltip" : _("Import module library"),
  1395          "tooltip" : _("Import module library"),
  1398          "method" : "_ImportModuleLibrary"},
  1396          "method" : "_ImportModuleLibrary"},
  1399     ]
  1397     ]
  1400     
  1398